UNPKG

@upstart.gg/sdk

Version:

You can test the CLI without recompiling by running:

63 lines (56 loc) 2.06 kB
import { type Static, Type } from "@sinclair/typebox"; import { StringEnum } from "../utils/string-enum"; export const waitingMessageSchema = Type.Object({ waitingMessage: Type.String({ description: "Message to display, in the user language, while the agent is creating / editing content. Example: 'Creating themes', 'Creating section', 'Searching images'. Don't use triple dots at the end.", }), }); export type ToolInputWaitingMessageType = { waitingMessage: string }; export type ToolInputInstructionsType = { instructions: string }; export const askUserChoiceInput = Type.Object({ choices: Type.Array( Type.String({ title: "Choice. Will appear as a button label to the user. Don't make it too long for a button label.", minLength: 1, }), { description: `The list of choices to present to the user. For yes/no questions, use 'Yes' and 'No' as choices. (translated to user language). For other multiple choice questions, always include one LAST choice for 'Other' or 'None of these' as a last choice to let the user manually input their own answer if none of the predefined choices fit.`, maxItems: 7, minItems: 2, }, ), allowMultiple: Type.Optional( Type.Boolean({ description: "Whether to allow multiple choices to be selected by the user. Default to false.", }), ), }); export type AskUserChoiceInput = Static<typeof askUserChoiceInput>; export const getDocInput = Type.Object({ entityType: StringEnum( [ "site-attributes", "page-attributes", "datasource", "datarecord", "site-query", "page-query", "section", "brick-type", ], { description: "The type of entity to get the schema documentation for.", }, ), // Only used when entityType is brick-type brickType: Type.Optional( Type.String({ description: "The brick type to get the schema documentation for. Required if entityType is 'brick-type'.", }), ), }); export type GetDocInput = Static<typeof getDocInput>;