primitive-admin 1.1.0-alpha.83 → 1.1.0-alpha.85
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +43 -1
- package/assets/skill/skills/primitive-platform/SKILL.md +105 -675
- package/dist/src/commands/admins.js +29 -32
- package/dist/src/commands/admins.js.map +1 -1
- package/dist/src/commands/analytics.js +2 -1
- package/dist/src/commands/analytics.js.map +1 -1
- package/dist/src/commands/apps.js +12 -5
- package/dist/src/commands/apps.js.map +1 -1
- package/dist/src/commands/blob-buckets.js +2 -1
- package/dist/src/commands/blob-buckets.js.map +1 -1
- package/dist/src/commands/catalog.js +26 -10
- package/dist/src/commands/catalog.js.map +1 -1
- package/dist/src/commands/collection-type-configs.js +2 -1
- package/dist/src/commands/collection-type-configs.js.map +1 -1
- package/dist/src/commands/collections.js +88 -18
- package/dist/src/commands/collections.js.map +1 -1
- package/dist/src/commands/connections.js +8 -9
- package/dist/src/commands/connections.js.map +1 -1
- package/dist/src/commands/cron-triggers.js +2 -1
- package/dist/src/commands/cron-triggers.js.map +1 -1
- package/dist/src/commands/database-type-configs.js +3 -2
- package/dist/src/commands/database-type-configs.js.map +1 -1
- package/dist/src/commands/databases.js +26 -10
- package/dist/src/commands/databases.js.map +1 -1
- package/dist/src/commands/documents.d.ts +38 -0
- package/dist/src/commands/documents.js +258 -64
- package/dist/src/commands/documents.js.map +1 -1
- package/dist/src/commands/email-templates.js +2 -1
- package/dist/src/commands/email-templates.js.map +1 -1
- package/dist/src/commands/env.js +11 -1
- package/dist/src/commands/env.js.map +1 -1
- package/dist/src/commands/feature-flags.js +2 -1
- package/dist/src/commands/feature-flags.js.map +1 -1
- package/dist/src/commands/functions.js +3 -2
- package/dist/src/commands/functions.js.map +1 -1
- package/dist/src/commands/group-type-configs.js +2 -1
- package/dist/src/commands/group-type-configs.js.map +1 -1
- package/dist/src/commands/groups.js +29 -8
- package/dist/src/commands/groups.js.map +1 -1
- package/dist/src/commands/guides.js +17 -11
- package/dist/src/commands/guides.js.map +1 -1
- package/dist/src/commands/integrations.js +26 -9
- package/dist/src/commands/integrations.js.map +1 -1
- package/dist/src/commands/locks.js +2 -1
- package/dist/src/commands/locks.js.map +1 -1
- package/dist/src/commands/metadata-category-configs.js +2 -1
- package/dist/src/commands/metadata-category-configs.js.map +1 -1
- package/dist/src/commands/metadata.js +8 -1
- package/dist/src/commands/metadata.js.map +1 -1
- package/dist/src/commands/prompts.js +28 -11
- package/dist/src/commands/prompts.js.map +1 -1
- package/dist/src/commands/rule-sets.js +2 -1
- package/dist/src/commands/rule-sets.js.map +1 -1
- package/dist/src/commands/scripts.js +15 -6
- package/dist/src/commands/scripts.js.map +1 -1
- package/dist/src/commands/secrets.js +2 -1
- package/dist/src/commands/secrets.js.map +1 -1
- package/dist/src/commands/sessions.js +10 -9
- package/dist/src/commands/sessions.js.map +1 -1
- package/dist/src/commands/sync.d.ts +64 -0
- package/dist/src/commands/sync.js +347 -17
- package/dist/src/commands/sync.js.map +1 -1
- package/dist/src/commands/tokens.js +2 -1
- package/dist/src/commands/tokens.js.map +1 -1
- package/dist/src/commands/users.js +16 -9
- package/dist/src/commands/users.js.map +1 -1
- package/dist/src/commands/vars.js +2 -1
- package/dist/src/commands/vars.js.map +1 -1
- package/dist/src/commands/waitlist.js +2 -1
- package/dist/src/commands/waitlist.js.map +1 -1
- package/dist/src/commands/webhooks.js +17 -10
- package/dist/src/commands/webhooks.js.map +1 -1
- package/dist/src/commands/workflows.js +36 -18
- package/dist/src/commands/workflows.js.map +1 -1
- package/dist/src/lib/api-client.d.ts +111 -1
- package/dist/src/lib/api-client.js +179 -66
- package/dist/src/lib/api-client.js.map +1 -1
- package/dist/src/lib/config-object-descriptor.js +29 -7
- package/dist/src/lib/config-object-descriptor.js.map +1 -1
- package/dist/src/lib/config-payload.js +27 -2
- package/dist/src/lib/config-payload.js.map +1 -1
- package/dist/src/lib/config-surface.d.ts +2 -1
- package/dist/src/lib/config-surface.js +50 -3
- package/dist/src/lib/config-surface.js.map +1 -1
- package/dist/src/lib/db-codegen/dbTypeIR.js +8 -0
- package/dist/src/lib/db-codegen/dbTypeIR.js.map +1 -1
- package/dist/src/lib/document-ingest-rows.d.ts +137 -0
- package/dist/src/lib/document-ingest-rows.js +181 -0
- package/dist/src/lib/document-ingest-rows.js.map +1 -0
- package/dist/src/lib/document-ingest.d.ts +25 -2
- package/dist/src/lib/document-ingest.js +184 -31
- package/dist/src/lib/document-ingest.js.map +1 -1
- package/dist/src/lib/function-db-types.d.ts +1 -1
- package/dist/src/lib/function-db-types.js +1 -1
- package/dist/src/lib/function-document-types.js +23 -2
- package/dist/src/lib/function-document-types.js.map +1 -1
- package/dist/src/lib/generated-config-surfaces.d.ts +182 -1
- package/dist/src/lib/generated-config-surfaces.js +441 -2
- package/dist/src/lib/generated-config-surfaces.js.map +1 -1
- package/dist/src/lib/generated-sdk-types.d.ts +1 -1
- package/dist/src/lib/generated-sdk-types.js +1 -1
- package/dist/src/lib/generated-sdk-types.js.map +1 -1
- package/dist/src/lib/list-options.d.ts +68 -0
- package/dist/src/lib/list-options.js +89 -0
- package/dist/src/lib/list-options.js.map +1 -0
- package/dist/src/lib/log-inspection.d.ts +16 -0
- package/dist/src/lib/log-inspection.js +23 -0
- package/dist/src/lib/log-inspection.js.map +1 -1
- package/dist/src/lib/paginate.d.ts +15 -0
- package/dist/src/lib/paginate.js +17 -0
- package/dist/src/lib/paginate.js.map +1 -1
- package/dist/src/lib/resolve-owner.d.ts +19 -0
- package/dist/src/lib/resolve-owner.js +20 -0
- package/dist/src/lib/resolve-owner.js.map +1 -0
- package/dist/src/lib/skill-installer.d.ts +49 -3
- package/dist/src/lib/skill-installer.js +275 -100
- package/dist/src/lib/skill-installer.js.map +1 -1
- package/dist/src/lib/snapshot-build.d.ts +50 -0
- package/dist/src/lib/snapshot-build.js +111 -0
- package/dist/src/lib/snapshot-build.js.map +1 -0
- package/package.json +2 -2
|
@@ -165,12 +165,24 @@ function documentSchemaProblem(source) {
|
|
|
165
165
|
if (!data?.models) {
|
|
166
166
|
return `${fileLabel(source)} has no [models] section`;
|
|
167
167
|
}
|
|
168
|
+
// #3501 — a push is an authoring door, so a field name the engine
|
|
169
|
+
// reserves stops the schema here rather than at the server. `type` maps to
|
|
170
|
+
// the internal `_type` column, so a model declaring it would seed a
|
|
171
|
+
// document whose filters match the MODEL NAME instead of the stored value.
|
|
168
172
|
loadSchemaFromTomlString(stringifyConfigToml({ models: data.models }), {
|
|
169
173
|
strict: false,
|
|
174
|
+
rejectReservedFieldNames: true,
|
|
170
175
|
});
|
|
171
176
|
}
|
|
172
177
|
catch (error) {
|
|
173
|
-
|
|
178
|
+
const message = String(error?.message ?? error).split("\n")[0];
|
|
179
|
+
// A reserved name is not a syntax error — the file parses, and saying it
|
|
180
|
+
// does not would send the author looking for a typo (matched on the
|
|
181
|
+
// error's NAME so the CLI needs no second import from js-bao).
|
|
182
|
+
if (error?.name === "ReservedFieldNameError") {
|
|
183
|
+
return `${fileLabel(source)} declares a reserved field name: ${message}`;
|
|
184
|
+
}
|
|
185
|
+
return `${fileLabel(source)} does not parse: ${message}`;
|
|
174
186
|
}
|
|
175
187
|
return null;
|
|
176
188
|
}
|
|
@@ -252,21 +264,30 @@ export function renderDocumentTypesDeclaration(source) {
|
|
|
252
264
|
}
|
|
253
265
|
let schemas = [];
|
|
254
266
|
let problem = null;
|
|
267
|
+
let reserved = false;
|
|
255
268
|
try {
|
|
256
269
|
const data = parseConfigToml(source.content);
|
|
257
270
|
schemas = data?.models
|
|
258
271
|
? loadSchemaFromTomlString(stringifyConfigToml({ models: data.models }), {
|
|
259
272
|
strict: false,
|
|
273
|
+
// #3501 — the same refusal `documentSchemaProblem` makes, so a
|
|
274
|
+
// model the push will not carry is not typed here either. A
|
|
275
|
+
// generated `type?: string` would promise a field whose filters
|
|
276
|
+
// match the model name instead of the stored value.
|
|
277
|
+
rejectReservedFieldNames: true,
|
|
260
278
|
})
|
|
261
279
|
: [];
|
|
262
280
|
}
|
|
263
281
|
catch (error) {
|
|
264
282
|
problem = String(error?.message ?? error);
|
|
283
|
+
reserved = error?.name === "ReservedFieldNameError";
|
|
265
284
|
}
|
|
266
285
|
if (problem !== null) {
|
|
267
286
|
// No augmentation: an untyped handle is what a schemaless project gets
|
|
268
287
|
// anyway, and the file is named so the author knows where to look.
|
|
269
|
-
lines.push(
|
|
288
|
+
lines.push(reserved
|
|
289
|
+
? `// ${fileLabel(source)} declares a reserved field name, so it contributes no types:`
|
|
290
|
+
: `// ${fileLabel(source)} does not parse, so it contributes no types:`);
|
|
270
291
|
for (const line of problem.split("\n").slice(0, 3))
|
|
271
292
|
lines.push(`// ${line}`);
|
|
272
293
|
lines.push("export interface PrimitiveDocumentSchemas {}");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"function-document-types.js","sourceRoot":"","sources":["../../../src/lib/function-document-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AACnD,OAAO,EAAE,wBAAwB,EAAE,MAAM,QAAQ,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAEnF,oEAAoE;AACpE,MAAM,CAAC,MAAM,+BAA+B,GAAG,+BAA+B,CAAC;AAE/E,mEAAmE;AACnE,MAAM,CAAC,MAAM,wBAAwB,GAAG,IAAI,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;AAEtE,qDAAqD;AACrD,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,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,KAAK,CAAC,IAAI,CAAC,wCAAwC,CAAC,CAAC;IACrD,KAAK,CAAC,IAAI,CAAC,iEAAiE,CAAC,CAAC;IAC9E,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAChB,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -87,6 +87,27 @@ export interface ConfigField {
|
|
|
87
87
|
field: string;
|
|
88
88
|
/** Key inside the TOML table (often identical to `field`). */
|
|
89
89
|
tomlKey: string;
|
|
90
|
+
/**
|
|
91
|
+
* The SUB-TABLE inside this field's table that the key is authored under
|
|
92
|
+
* (#3626) — `tomlGroup: "chat"` means `[configs.chat].systemPrompt` rather
|
|
93
|
+
* than `systemPrompt` at the `[[configs]]` root.
|
|
94
|
+
*
|
|
95
|
+
* A statement of WHERE a key is authored and nothing else (#1976): the pull
|
|
96
|
+
* projection writes it there, the push builder reads it from there, the
|
|
97
|
+
* unknown-key check stops accepting it at the root, and the declared-type
|
|
98
|
+
* check labels it with the group. No behavior is attached, and the WIRE stays
|
|
99
|
+
* flat — the admin and app API bodies carry `systemPrompt` beside `questions`
|
|
100
|
+
* exactly as before, each its own typed column.
|
|
101
|
+
*
|
|
102
|
+
* Prompts are the first object to need it: a prompt declares a `kind` and a
|
|
103
|
+
* `[[configs]]` entry may carry only the block named by that kind, so the
|
|
104
|
+
* next kind (embeddings, rerank) is a group declaration plus its fields
|
|
105
|
+
* rather than another round of implicit discrimination.
|
|
106
|
+
*
|
|
107
|
+
* The group must be declared in the table's `tomlGroups`
|
|
108
|
+
* (`findBadTomlGroupDeclarations`).
|
|
109
|
+
*/
|
|
110
|
+
tomlGroup?: string;
|
|
90
111
|
type: FieldType;
|
|
91
112
|
/** "whenSet" omits the key on pull when the value is empty; see #1033's `emit`. */
|
|
92
113
|
emit: "always" | "whenSet";
|
|
@@ -165,6 +186,20 @@ export interface ConfigTable {
|
|
|
165
186
|
/** The `models.yaml` model backing this table — the coverage anchor. */
|
|
166
187
|
model: string;
|
|
167
188
|
fields: readonly ConfigField[];
|
|
189
|
+
/**
|
|
190
|
+
* The CLOSED set of sub-table names this table's fields may be authored under
|
|
191
|
+
* (#3626), each with the reason it exists. A field's `tomlGroup` must name
|
|
192
|
+
* one of these, and a name declared here that no field uses is a failure —
|
|
193
|
+
* both checked by `findBadTomlGroupDeclarations`, the same rule `notExposed`
|
|
194
|
+
* follows one level down: absence from a hand-written list is never a
|
|
195
|
+
* decision.
|
|
196
|
+
*
|
|
197
|
+
* Omitted on every table whose keys are all authored at its root, which is
|
|
198
|
+
* all of them but `prompt`'s `[[configs]]`.
|
|
199
|
+
*/
|
|
200
|
+
tomlGroups?: Readonly<Record<string, {
|
|
201
|
+
note: string;
|
|
202
|
+
}>>;
|
|
168
203
|
/** Every model field not in `fields`, with its reason. Coverage is exhaustive. */
|
|
169
204
|
notExposed: Readonly<Record<string, NotExposed>>;
|
|
170
205
|
/**
|
|
@@ -559,8 +594,37 @@ export declare function findUnclassifiedSecretishFields(table: ConfigTable, mode
|
|
|
559
594
|
* when the module or the export is missing (#2644 behavior 2b).
|
|
560
595
|
*/
|
|
561
596
|
export declare function handlerReferences(table: ConfigTable): string[];
|
|
562
|
-
/**
|
|
597
|
+
/** The group names this table declares, sorted. Empty for an ungrouped table. */
|
|
598
|
+
export declare function tomlGroupNames(table: ConfigTable): string[];
|
|
599
|
+
/** The TOML keys accepted INSIDE `group`: every field that declares it. */
|
|
600
|
+
export declare function acceptedGroupTomlKeys(table: ConfigTable, group: string): Set<string>;
|
|
601
|
+
/**
|
|
602
|
+
* TOML keys this table accepts AT ITS ROOT: the UNGROUPED fields, the declared
|
|
603
|
+
* group names, and the declared extras.
|
|
604
|
+
*
|
|
605
|
+
* A grouped leaf written at the root (`questions` directly under `[[configs]]`)
|
|
606
|
+
* is therefore an unknown key rather than one the payload builder silently
|
|
607
|
+
* ignores (SO3626-013) — the builder reads a grouped field only from
|
|
608
|
+
* `source[group][tomlKey]`, so accepting it here would drop the author's value
|
|
609
|
+
* without a word. The nine deprecated flat chat keys stay accepted through
|
|
610
|
+
* their `tomlOnlyKeys` declarations, which is what keeps old files pushing.
|
|
611
|
+
*/
|
|
563
612
|
export declare function acceptedTomlKeys(table: ConfigTable): Set<string>;
|
|
613
|
+
/**
|
|
614
|
+
* Keys inside a group table that no field declares under it, as
|
|
615
|
+
* `"<group>.<key>"` — plus the bare `"<group>"` for a group value that is not a
|
|
616
|
+
* table at all (`chat = "yes"`), which has no keys to check and would otherwise
|
|
617
|
+
* be read as an empty block.
|
|
618
|
+
*/
|
|
619
|
+
export declare function findUnknownGroupedTomlKeys(tomlTable: unknown, table: ConfigTable): string[];
|
|
620
|
+
/**
|
|
621
|
+
* Group declarations that do not hold together: a field naming a group the
|
|
622
|
+
* table does not declare, a declared group no field is authored under, and a
|
|
623
|
+
* declaration with no reason. All three are failures, for the reason
|
|
624
|
+
* `notExposed` carries a note — a name in a list with nothing behind it reads
|
|
625
|
+
* as a decision and is not one.
|
|
626
|
+
*/
|
|
627
|
+
export declare function findBadTomlGroupDeclarations(table: ConfigTable): string[];
|
|
564
628
|
/** Top-level TOML keys this object's file accepts: its tables plus the extras. */
|
|
565
629
|
export declare function acceptedTomlDocumentKeys(surface: ConfigObjectSurface): Set<string>;
|
|
566
630
|
/**
|
|
@@ -2102,6 +2166,123 @@ export declare function hasPromptReasoning(input: PromptReasoningInput): boolean
|
|
|
2102
2166
|
* error and what the admin routes answer 400 with.
|
|
2103
2167
|
*/
|
|
2104
2168
|
export declare function resolvePromptReasoning(input: PromptReasoningInput): PromptReasoningResolution;
|
|
2169
|
+
/**
|
|
2170
|
+
* What a prompt's KIND admits — issue #3626.
|
|
2171
|
+
*
|
|
2172
|
+
* A prompt declares `[prompt] kind = "chat" | "decisions"`. The kind decides
|
|
2173
|
+
* the input envelope (`variables` rendered into templates for chat, a `state`
|
|
2174
|
+
* value for decisions), the provider endpoint the executor posts to, and which
|
|
2175
|
+
* `[configs.<kind>]` block a `[[configs]]` entry may carry. Adding a kind is a
|
|
2176
|
+
* group declaration plus its fields, not another round of implicit
|
|
2177
|
+
* discrimination: the earlier design inferred "this is a decisions config" from
|
|
2178
|
+
* the presence of `questions` on a table otherwise shaped for chat, and refused
|
|
2179
|
+
* the nine chat keys one by one.
|
|
2180
|
+
*
|
|
2181
|
+
* This module is the whole rule. `resolvePromptKind` is called by the CLI's
|
|
2182
|
+
* push preflight through the vendored artifact, by `createAppPrompt`,
|
|
2183
|
+
* `createPromptConfig` and `updatePromptConfig`, so a refusal at push and a
|
|
2184
|
+
* refusal at the admin route cannot disagree — the `resolvePromptReasoning`
|
|
2185
|
+
* posture of #3358, for the same reason.
|
|
2186
|
+
*
|
|
2187
|
+
* Pure and dependency-free, like every module under `src/config-surface/`.
|
|
2188
|
+
*/
|
|
2189
|
+
/** The kinds a prompt may declare. An omitted `kind` is `chat`. */
|
|
2190
|
+
export declare const PROMPT_KINDS: readonly ["chat", "decisions"];
|
|
2191
|
+
export type PromptKind = (typeof PROMPT_KINDS)[number];
|
|
2192
|
+
/**
|
|
2193
|
+
* The nine settings that describe a CHAT COMPLETION and nothing else. They are
|
|
2194
|
+
* authored under `[configs.chat]`; the flat spelling is deprecated (#3642).
|
|
2195
|
+
*/
|
|
2196
|
+
export declare const CHAT_CONFIG_KEYS: readonly ["systemPrompt", "userPromptTemplate", "temperature", "topP", "maxTokens", "outputFormat", "outputSchema", "reasoningEffort", "reasoningBudget"];
|
|
2197
|
+
export type ChatConfigKey = (typeof CHAT_CONFIG_KEYS)[number];
|
|
2198
|
+
/** The settings that describe a DECISIONS request. */
|
|
2199
|
+
export declare const DECISIONS_CONFIG_KEYS: readonly ["questions"];
|
|
2200
|
+
/**
|
|
2201
|
+
* The WIRE field names each kind's block holds. The config surface declares the
|
|
2202
|
+
* same grouping through `ConfigField.tomlGroup`, and the drift guard asserts
|
|
2203
|
+
* the two agree — so a chat key added to the surface without a home here (or
|
|
2204
|
+
* the reverse) fails `cli-unit-tests` rather than being accepted under a
|
|
2205
|
+
* decisions prompt.
|
|
2206
|
+
*/
|
|
2207
|
+
export declare const PROMPT_KIND_BLOCKS: Readonly<Record<PromptKind, readonly string[]>>;
|
|
2208
|
+
/** The question types TypeSafe's System One models answer. */
|
|
2209
|
+
export declare const DECISIONS_QUESTION_TYPES: readonly ["choice", "score", "noul"];
|
|
2210
|
+
export type DecisionsQuestionType = (typeof DECISIONS_QUESTION_TYPES)[number];
|
|
2211
|
+
/**
|
|
2212
|
+
* The prompt's kind, normalized.
|
|
2213
|
+
*
|
|
2214
|
+
* Every reader goes through this: rows created before #3626 carry no `kind`
|
|
2215
|
+
* attribute at all, and an absent one is `chat` everywhere — the detail route,
|
|
2216
|
+
* pull, diff, execution and codegen.
|
|
2217
|
+
*/
|
|
2218
|
+
export declare function promptKindOf(prompt: unknown): PromptKind;
|
|
2219
|
+
/** The config values the rule reads — the wire spelling, not the TOML one. */
|
|
2220
|
+
export interface PromptKindConfigInput {
|
|
2221
|
+
systemPrompt?: unknown;
|
|
2222
|
+
userPromptTemplate?: unknown;
|
|
2223
|
+
temperature?: unknown;
|
|
2224
|
+
topP?: unknown;
|
|
2225
|
+
maxTokens?: unknown;
|
|
2226
|
+
outputFormat?: unknown;
|
|
2227
|
+
outputSchema?: unknown;
|
|
2228
|
+
reasoningEffort?: unknown;
|
|
2229
|
+
reasoningBudget?: unknown;
|
|
2230
|
+
questions?: unknown;
|
|
2231
|
+
}
|
|
2232
|
+
export interface PromptKindInput {
|
|
2233
|
+
/** `[prompt].kind`. `null`, `undefined` and `""` are unset, meaning `chat`. */
|
|
2234
|
+
kind?: unknown;
|
|
2235
|
+
provider?: unknown;
|
|
2236
|
+
model?: unknown;
|
|
2237
|
+
/**
|
|
2238
|
+
* The EFFECTIVE config: the payload value where the request carries one, the
|
|
2239
|
+
* stored value otherwise. `outputSchema` here is the CONFIG's own field —
|
|
2240
|
+
* never the prompt-level schema, which is legal on either kind (§3, SO3626-003).
|
|
2241
|
+
*/
|
|
2242
|
+
config: PromptKindConfigInput;
|
|
2243
|
+
}
|
|
2244
|
+
export type PromptKindResolution = {
|
|
2245
|
+
ok: true;
|
|
2246
|
+
kind: "chat";
|
|
2247
|
+
} | {
|
|
2248
|
+
ok: true;
|
|
2249
|
+
kind: "decisions";
|
|
2250
|
+
questions: Record<string, unknown>;
|
|
2251
|
+
} | {
|
|
2252
|
+
ok: false;
|
|
2253
|
+
error: string;
|
|
2254
|
+
};
|
|
2255
|
+
/**
|
|
2256
|
+
* The one rule: does this (kind, provider, config) triple describe something
|
|
2257
|
+
* the platform can run?
|
|
2258
|
+
*
|
|
2259
|
+
* `{ ok: true, kind: "chat" }` is today's behavior byte for byte. The decisions
|
|
2260
|
+
* arm returns the NORMALIZED questions so the caller stores one spelling
|
|
2261
|
+
* whichever transport the author used.
|
|
2262
|
+
*/
|
|
2263
|
+
export declare function resolvePromptKind(input: PromptKindInput): PromptKindResolution;
|
|
2264
|
+
/** What the hoist did to one `[[configs]]` entry. */
|
|
2265
|
+
export interface DeprecatedChatKeyHoist {
|
|
2266
|
+
/** A COPY of the entry with the flat chat keys moved under `chat`. */
|
|
2267
|
+
entry: Record<string, unknown>;
|
|
2268
|
+
/** The flat keys that were moved, sorted — what the warning names. */
|
|
2269
|
+
moved: string[];
|
|
2270
|
+
/** Keys set BOTH flat and under `[configs.chat]`; the caller refuses these. */
|
|
2271
|
+
conflicts: string[];
|
|
2272
|
+
}
|
|
2273
|
+
/**
|
|
2274
|
+
* Move the deprecated flat chat keys of one `[[configs]]` entry under `chat`
|
|
2275
|
+
* — #3626 §4, the blob-bucket `accessPolicy` precedent made reusable.
|
|
2276
|
+
*
|
|
2277
|
+
* Push keeps accepting the nine keys flat so no existing file breaks, and pull
|
|
2278
|
+
* rewrites them, so one pull-then-push migrates a file. A key present in BOTH
|
|
2279
|
+
* spellings is not merged: the grouped value is left standing and the key is
|
|
2280
|
+
* reported in `conflicts`, which the caller turns into a refusal naming the
|
|
2281
|
+
* entry. Nothing else in the entry is touched — `providerConfig` is
|
|
2282
|
+
* provider-keyed rather than chat-keyed (D3626-002) and `questions` has no flat
|
|
2283
|
+
* spelling at all (SO3626-013).
|
|
2284
|
+
*/
|
|
2285
|
+
export declare function hoistDeprecatedChatKeys(entry: unknown): DeprecatedChatKeyHoist;
|
|
2105
2286
|
export declare const PROMPT_SURFACE: ConfigObjectSurface;
|
|
2106
2287
|
export declare const INTEGRATION_SURFACE: ConfigObjectSurface;
|
|
2107
2288
|
export declare const WEBHOOK_SURFACE: ConfigObjectSurface;
|