UNPKG

@code-yeongyu/senpi

Version:

Coding agent CLI with read, bash, edit, write tools and session management

117 lines • 5.94 kB
/** * The bounded field schemas every inbound record schema is built from (senpi#4324): ids, paths, text and secrets by * length, counts as non-negative integers, lists and free-form records by size. The host's own limits are reused * where it has them; the rest are named in `RPC_INBOUND_LIMITS`. */ import Type, { type TLiteral, type TProperties } from "typebox"; /** Bounds on a question answer map (`extension_ui_response`, `extension_ui_progress`) from a validated caller. */ export declare const RPC_QUESTION_ANSWER_LIMITS: { readonly answers: 64; readonly selectedPerAnswer: 64; readonly labelCharacters: 1000000; }; /** * Bounds every field of a validated caller's record stays inside, so a record from someone other than the local * user cannot carry a megabyte id, a negative count or a fifty-thousand-key patch. */ export declare const RPC_INBOUND_LIMITS: { /** ids, session and effect ids, provider and model names, other identifiers */ readonly identifierCharacters: 512; /** host paths: session files, working directories, export and import paths */ readonly pathCharacters: 4096; /** free text: prompts, commands, edits, instructions (the host's own message limit) */ readonly textCharacters: 1000000; /** credentials (API keys) */ readonly secretCharacters: 16384; /** lists of ids, model entries, capabilities, delivery ids */ readonly listItems: 1024; /** images in one prompt, steer or follow-up */ readonly images: 64; /** keys in a free-form record (a context patch, bash operations, fallback chains) */ readonly recordKeys: 256; /** the largest count, revision, sequence or index (JSON numbers stay exact below it) */ readonly count: number; /** `open_session.env` entries; the host refuses more (`session-caller-env.ts`) */ readonly envEntries: 16; /** one `open_session.env` value; the host refuses a longer one (`session-caller-env.ts`) */ readonly envValueCharacters: 4096; }; export declare const Str: Type.TString; export declare const Id: Type.TString; export declare const PathStr: Type.TString; export declare const Secret: Type.TString; /** Counts, revisions, sequences, indexes, sizes and durations: non-negative integers. */ export declare const Num: Type.TInteger; export declare const Bool: Type.TBoolean; export declare const Opt: typeof Type.Optional; export declare const Strings: Type.TArray<Type.TString>; export declare const OptStr: Type.TOptional<Type.TString>; export declare const OptId: Type.TOptional<Type.TString>; export declare const OptPath: Type.TOptional<Type.TString>; export declare const OptNum: Type.TOptional<Type.TInteger>; export declare const OptBool: Type.TOptional<Type.TBoolean>; export declare const literals: <const L extends readonly [string, ...string[]]>(...values: L) => Type.TUnion<[TLiteral<string>, ...TLiteral<string>[]]>; /** The desktop app's `ThreadSettledBy` (`core/session-settled.ts`); the handler also trims and drops extra fields. */ export declare const ThreadSettledBy: Type.TUnion<[Type.TObject<{ kind: TLiteral<"user">; }>, Type.TObject<{ kind: TLiteral<"agent">; threadId: Type.TOptional<Type.TString>; threadTitle: Type.TOptional<Type.TString>; }>, Type.TObject<{ kind: Type.TUnion<[TLiteral<string>, ...TLiteral<string>[]]>; pullRequestNumber: Type.TOptional<Type.TInteger>; }>, Type.TObject<{ kind: TLiteral<"inactivity">; days: Type.TInteger; }>]>; export declare const ThinkingLevel: Type.TUnion<[TLiteral<string>, ...TLiteral<string>[]]>; export declare const SessionKind: Type.TUnion<[TLiteral<string>, ...TLiteral<string>[]]>; export declare const SessionContext: Type.TRecord<"^.*$", Type.TString>; export declare const SessionEnv: Type.TRecord<"^.*$", Type.TString>; export declare const Images: Type.TArray<Type.TObject<{ type: TLiteral<"image">; data: Type.TString; mimeType: Type.TString; }>>; export declare const ModelEntries: Type.TArray<Type.TObject<{ model: Type.TUnknown; thinkingLevel: Type.TOptional<Type.TUnion<[TLiteral<string>, ...TLiteral<string>[]]>>; thinkingSelection: Type.TOptional<Type.TUnknown>; serviceTier: Type.TOptional<Type.TUnknown>; }>>; export declare const RetryFallback: Type.TObject<{ modelFallback: Type.TBoolean; fallbackChains: Type.TRecord<"^.*$", Type.TImmutable<Type.TArray<Type.TString>>>; }>; export declare const QuestionAnswers: Type.TRecord<"^.*$", Type.TObject<{ selected: Type.TArray<Type.TString>; text: Type.TOptional<Type.TString>; }>>; /** * A host-level record: `id`, the compact caller's `admissionId` routing envelope (S15a-1, senpi#4272) and its own * fields. A record whose own fields require `admissionId` (`cancel_attempt`, `reset_stream`) overrides the envelope. */ export declare const command: <const T extends string, const P extends TProperties>(type: T, properties: P) => Type.TObject<{ id: Type.TOptional<Type.TString>; admissionId: Type.TOptional<Type.TString>; type: TLiteral<T>; } & P>; /** A session record: every one accepts the routing envelope's `sessionId`. */ export declare const session: <const T extends string, const P extends TProperties>(type: T, properties: P) => Type.TObject<{ id: Type.TOptional<Type.TString>; admissionId: Type.TOptional<Type.TString>; type: TLiteral<T>; } & { readonly sessionId: Type.TOptional<Type.TString>; } & P>; /** * A session record whose own fields require `admissionId` (the recovery and admission commands, senpi#4272): the * optional envelope `command` adds would widen that field, so these are built without it. */ export declare const admissionSession: <const T extends string, const P extends TProperties>(type: T, properties: P) => Type.TObject<{ id: Type.TOptional<Type.TString>; type: TLiteral<T>; sessionId: Type.TOptional<Type.TString>; } & P>; //# sourceMappingURL=method-classes-schema-fields.d.ts.map