primitive-admin 1.2.0-alpha.3 → 1.2.0-alpha.5
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/assets/skill/skills/primitive-platform/SKILL.md +17 -0
- package/dist/src/commands/agent-sessions.js +4 -0
- package/dist/src/commands/agent-sessions.js.map +1 -1
- package/dist/src/commands/auth.js +7 -4
- package/dist/src/commands/auth.js.map +1 -1
- package/dist/src/commands/connections.js +11 -12
- package/dist/src/commands/connections.js.map +1 -1
- package/dist/src/commands/database-type-configs.js +2 -76
- package/dist/src/commands/database-type-configs.js.map +1 -1
- package/dist/src/commands/database-types.js +313 -13
- package/dist/src/commands/database-types.js.map +1 -1
- package/dist/src/commands/databases.d.ts +9 -0
- package/dist/src/commands/databases.js +78 -403
- package/dist/src/commands/databases.js.map +1 -1
- package/dist/src/commands/documents.d.ts +32 -2
- package/dist/src/commands/documents.js +344 -711
- package/dist/src/commands/documents.js.map +1 -1
- package/dist/src/commands/functions.js +2 -2
- package/dist/src/commands/functions.js.map +1 -1
- package/dist/src/commands/llm.js +6 -9
- package/dist/src/commands/llm.js.map +1 -1
- package/dist/src/commands/prompts.d.ts +7 -0
- package/dist/src/commands/prompts.js +44 -0
- package/dist/src/commands/prompts.js.map +1 -1
- package/dist/src/commands/settings.d.ts +9 -12
- package/dist/src/commands/settings.js +79 -31
- package/dist/src/commands/settings.js.map +1 -1
- package/dist/src/commands/sync.d.ts +43 -110
- package/dist/src/commands/sync.js +356 -1251
- package/dist/src/commands/sync.js.map +1 -1
- package/dist/src/lib/aggregate-output.d.ts +25 -0
- package/dist/src/lib/aggregate-output.js +53 -0
- package/dist/src/lib/aggregate-output.js.map +1 -0
- package/dist/src/lib/api-client.d.ts +48 -204
- package/dist/src/lib/api-client.js +57 -321
- package/dist/src/lib/api-client.js.map +1 -1
- package/dist/src/lib/codegen-shared/generatedFiles.d.ts +6 -7
- package/dist/src/lib/codegen-shared/generatedFiles.js +2 -2
- package/dist/src/lib/codegen-shared/generatedFiles.js.map +1 -1
- package/dist/src/lib/codegen-shared/prettierStable.d.ts +1 -1
- package/dist/src/lib/codegen-shared/prettierStable.js +1 -1
- package/dist/src/lib/codegen-shared/resolveCodegenSourceDir.d.ts +2 -2
- package/dist/src/lib/codegen-shared/resolveCodegenSourceDir.js +2 -2
- package/dist/src/lib/config-object-descriptor.js +15 -10
- package/dist/src/lib/config-object-descriptor.js.map +1 -1
- package/dist/src/lib/config-surface.d.ts +2 -1
- package/dist/src/lib/config-surface.js +4 -1
- package/dist/src/lib/config-surface.js.map +1 -1
- package/dist/src/lib/connections-list.d.ts +10 -0
- package/dist/src/lib/connections-list.js +18 -0
- package/dist/src/lib/connections-list.js.map +1 -0
- package/dist/src/lib/csv.d.ts +8 -9
- package/dist/src/lib/csv.js +3 -4
- package/dist/src/lib/csv.js.map +1 -1
- package/dist/src/lib/db-codegen/dbGenerator.js +5 -16
- package/dist/src/lib/db-codegen/dbGenerator.js.map +1 -1
- package/dist/src/lib/db-codegen/dbNaming.d.ts +5 -13
- package/dist/src/lib/db-codegen/dbNaming.js +5 -17
- package/dist/src/lib/db-codegen/dbNaming.js.map +1 -1
- package/dist/src/lib/db-codegen/dbTemplates.d.ts +7 -56
- package/dist/src/lib/db-codegen/dbTemplates.js +25 -125
- package/dist/src/lib/db-codegen/dbTemplates.js.map +1 -1
- package/dist/src/lib/db-codegen/dbTsTypes.d.ts +2 -2
- package/dist/src/lib/db-codegen/dbTsTypes.js +2 -2
- package/dist/src/lib/db-codegen/dbTypeIR.d.ts +60 -2
- package/dist/src/lib/db-codegen/dbTypeIR.js +12 -1
- package/dist/src/lib/db-codegen/dbTypeIR.js.map +1 -1
- package/dist/src/lib/document-export-record-log.d.ts +57 -0
- package/dist/src/lib/document-export-record-log.js +215 -0
- package/dist/src/lib/document-export-record-log.js.map +1 -0
- package/dist/src/lib/document-ingest-artifact.d.ts +13 -2
- package/dist/src/lib/document-ingest-artifact.js +7 -3
- package/dist/src/lib/document-ingest-artifact.js.map +1 -1
- package/dist/src/lib/document-ingest-rows.d.ts +16 -0
- package/dist/src/lib/document-ingest-rows.js +17 -0
- package/dist/src/lib/document-ingest-rows.js.map +1 -1
- package/dist/src/lib/document-ingest.d.ts +22 -0
- package/dist/src/lib/document-ingest.js +33 -0
- package/dist/src/lib/document-ingest.js.map +1 -1
- package/dist/src/lib/function-sync.d.ts +3 -16
- package/dist/src/lib/function-sync.js +14 -18
- package/dist/src/lib/function-sync.js.map +1 -1
- package/dist/src/lib/function-triggers.d.ts +3 -15
- package/dist/src/lib/function-triggers.js +10 -72
- package/dist/src/lib/function-triggers.js.map +1 -1
- package/dist/src/lib/generated-allowlist.js +0 -20
- package/dist/src/lib/generated-allowlist.js.map +1 -1
- package/dist/src/lib/generated-config-surfaces.d.ts +212 -49
- package/dist/src/lib/generated-config-surfaces.js +759 -184
- 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/login-scope-lines.d.ts +15 -0
- package/dist/src/lib/login-scope-lines.js +22 -0
- package/dist/src/lib/login-scope-lines.js.map +1 -0
- package/dist/src/lib/paginate.d.ts +0 -5
- package/dist/src/lib/paginate.js +0 -5
- package/dist/src/lib/paginate.js.map +1 -1
- package/dist/src/lib/prompt-schema-codegen.js +5 -2
- package/dist/src/lib/prompt-schema-codegen.js.map +1 -1
- package/dist/src/lib/refresh-admin-credentials.d.ts +7 -0
- package/dist/src/lib/refresh-admin-credentials.js +16 -4
- package/dist/src/lib/refresh-admin-credentials.js.map +1 -1
- package/dist/src/lib/root-import-decision.d.ts +15 -14
- package/dist/src/lib/root-import-decision.js +44 -51
- package/dist/src/lib/root-import-decision.js.map +1 -1
- package/dist/src/lib/snapshot-build-rows.d.ts +21 -0
- package/dist/src/lib/snapshot-build-rows.js +22 -0
- package/dist/src/lib/snapshot-build-rows.js.map +1 -1
- package/dist/src/lib/snapshot-build.js +8 -3
- package/dist/src/lib/snapshot-build.js.map +1 -1
- package/dist/src/lib/swift-codegen/banners.d.ts +34 -7
- package/dist/src/lib/swift-codegen/banners.js +37 -7
- package/dist/src/lib/swift-codegen/banners.js.map +1 -1
- package/dist/src/lib/swift-codegen/dbGenerator.d.ts +4 -3
- package/dist/src/lib/swift-codegen/dbGenerator.js +14 -117
- package/dist/src/lib/swift-codegen/dbGenerator.js.map +1 -1
- package/dist/src/lib/swift-codegen/functionGenerator.d.ts +3 -3
- package/dist/src/lib/swift-codegen/functionGenerator.js +22 -17
- package/dist/src/lib/swift-codegen/functionGenerator.js.map +1 -1
- package/dist/src/lib/swift-codegen/generator.d.ts +5 -5
- package/dist/src/lib/swift-codegen/generator.js +35 -40
- package/dist/src/lib/swift-codegen/generator.js.map +1 -1
- package/dist/src/lib/toml-database-config.d.ts +14 -75
- package/dist/src/lib/toml-database-config.js +14 -305
- package/dist/src/lib/toml-database-config.js.map +1 -1
- package/dist/src/lib/workflow-codegen/generator.d.ts +7 -7
- package/dist/src/lib/workflow-codegen/generator.js +16 -23
- package/dist/src/lib/workflow-codegen/generator.js.map +1 -1
- package/dist/src/lib/workflow-codegen/invokerIR.d.ts +6 -12
- package/dist/src/lib/workflow-codegen/invokerIR.js +4 -5
- package/dist/src/lib/workflow-codegen/invokerIR.js.map +1 -1
- package/dist/src/lib/workflow-toml-validator.d.ts +2 -0
- package/dist/src/lib/workflow-toml-validator.js +28 -1
- package/dist/src/lib/workflow-toml-validator.js.map +1 -1
- package/package.json +3 -5
- package/dist/src/lib/generated-workflow-model-fields.d.ts +0 -20
- package/dist/src/lib/generated-workflow-model-fields.js +0 -53
- package/dist/src/lib/generated-workflow-model-fields.js.map +0 -1
- package/dist/src/lib/workflow-field-descriptor.d.ts +0 -91
- package/dist/src/lib/workflow-field-descriptor.js +0 -153
- package/dist/src/lib/workflow-field-descriptor.js.map +0 -1
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
* server; the CLI vendors them at build time into
|
|
32
32
|
* `cli/src/lib/generated-config-surfaces.ts`
|
|
33
33
|
* (`cli/scripts/gen-config-surfaces.mjs`), the same server→CLI vendoring
|
|
34
|
-
* `gen-
|
|
34
|
+
* `gen-workflow-schema-descriptor.mjs` (#1442) already uses, so the published CLI
|
|
35
35
|
* still imports no server code at runtime.
|
|
36
36
|
*
|
|
37
37
|
* ── Scope: declarative classification and coverage ONLY ──────────────────
|
|
@@ -1101,6 +1101,19 @@ export interface RetiredConfigKey {
|
|
|
1101
1101
|
request: string;
|
|
1102
1102
|
}
|
|
1103
1103
|
export declare const RETIRED_CONFIG_KEYS: Record<string, Record<string, RetiredConfigKey>>;
|
|
1104
|
+
/**
|
|
1105
|
+
* Top-level TOML tables a configuration object's FILE retired — keyed by the
|
|
1106
|
+
* surface's label, then by the table key. Only the TOML half exists: these were
|
|
1107
|
+
* sub-trees applied through their own endpoints, never request keys of the
|
|
1108
|
+
* object itself, so no request body can carry one.
|
|
1109
|
+
*
|
|
1110
|
+
* Without an entry here a retired table would be answered as an unrecognized
|
|
1111
|
+
* one ("check the spelling, or upgrade the CLI"), which is backwards for a
|
|
1112
|
+
* table removed on purpose.
|
|
1113
|
+
*/
|
|
1114
|
+
export declare const RETIRED_DOCUMENT_KEYS: Record<string, Record<string, RetiredTomlSpelling>>;
|
|
1115
|
+
/** The retired-table guidance for `key` on the surface labelled `label`, or null. */
|
|
1116
|
+
export declare function retiredDocumentKey(label: string, key: string): RetiredTomlSpelling | null;
|
|
1104
1117
|
/** The retired-key entry for `key` under `prefix`, or null when it is simply unknown. */
|
|
1105
1118
|
export declare function retiredConfigKey(prefix: string, key: string): RetiredConfigKey | null;
|
|
1106
1119
|
/**
|
|
@@ -1492,7 +1505,8 @@ export interface ParsedManifest {
|
|
|
1492
1505
|
export declare function parseFunctionManifest(value: unknown): ParsedManifest;
|
|
1493
1506
|
/**
|
|
1494
1507
|
* The runtime keys a `functions/<key>.toml` no longer decides anything with —
|
|
1495
|
-
* #3482, project `server-functions` phase
|
|
1508
|
+
* #3482 retired them, and #3188 (project `server-functions` phase 5) refuses
|
|
1509
|
+
* them.
|
|
1496
1510
|
*
|
|
1497
1511
|
* The sponsor settled it on 2026-09-15 (the intent, "Mode vocabulary?",
|
|
1498
1512
|
* amended again): the config says NOTHING about how a function runs. A
|
|
@@ -1501,58 +1515,70 @@ export declare function parseFunctionManifest(value: unknown): ParsedManifest;
|
|
|
1501
1515
|
* and a function that must not run under one runtime tests for it in code with
|
|
1502
1516
|
* `assertRuntime`.
|
|
1503
1517
|
*
|
|
1504
|
-
* ──
|
|
1518
|
+
* ── Accepted through phase 4, refused from phase 5 ────────────────────────
|
|
1505
1519
|
*
|
|
1506
|
-
* Every tree pushed since #3454 that declares a cron trigger
|
|
1507
|
-
* `mode = …` ON THE ENTRY, because `cron-trigger-mode-required` demanded it
|
|
1508
|
-
*
|
|
1509
|
-
*
|
|
1510
|
-
*
|
|
1511
|
-
*
|
|
1520
|
+
* Every tree pushed since #3454 that declares a cron trigger carried
|
|
1521
|
+
* `mode = …` ON THE ENTRY, because `cron-trigger-mode-required` demanded it,
|
|
1522
|
+
* so #3482 accepted the keys and warned rather than refusing them one day
|
|
1523
|
+
* after the platform insisted on them. Phase 5 is the declared breaking phase
|
|
1524
|
+
* that ends the grace: `mode`, `durable` and a cron entry's `mode` are refused
|
|
1525
|
+
* with one sentence per key, naming the key, saying the caller picks the
|
|
1526
|
+
* runtime, and saying to delete the line. `config pull` still strips them
|
|
1527
|
+
* (`stripRetiredFunctionKeys` in the CLI reads this scanner), so a tree pulled
|
|
1528
|
+
* from a version pushed before the retirement pushes again unchanged.
|
|
1512
1529
|
*
|
|
1513
|
-
*
|
|
1514
|
-
*
|
|
1515
|
-
*
|
|
1516
|
-
* nothing left to validate it against, and refusing a bad value for a key
|
|
1517
|
-
* nobody reads would be a refusal about spelling alone.
|
|
1530
|
+
* One rule id, one handler: `refusedFunctionKeys` is declared `preflight` on
|
|
1531
|
+
* the `function` surface and the CLI's push preflight runs it before the first
|
|
1532
|
+
* request. The value is not validated — the key's PRESENCE is the refusal.
|
|
1518
1533
|
*
|
|
1519
|
-
* Pure: no models, no tenant context, no `env` (see `types.ts` §Purity).
|
|
1520
|
-
*
|
|
1521
|
-
*
|
|
1522
|
-
*
|
|
1534
|
+
* Pure: no models, no tenant context, no `env` (see `types.ts` §Purity). The
|
|
1535
|
+
* CLI preflight reaches this module through the vendored copy
|
|
1536
|
+
* (`cli/scripts/gen-config-surfaces.mjs`), so the sentence an author reads from
|
|
1537
|
+
* `config push` is the one this module writes.
|
|
1523
1538
|
*/
|
|
1524
1539
|
/** The two `[function]` keys that no longer say anything (#3482). */
|
|
1525
1540
|
export declare const RETIRED_FUNCTION_RUNTIME_KEYS: readonly ["mode", "durable"];
|
|
1526
1541
|
export type RetiredFunctionRuntimeKey = (typeof RETIRED_FUNCTION_RUNTIME_KEYS)[number];
|
|
1527
|
-
/**
|
|
1528
|
-
|
|
1542
|
+
/**
|
|
1543
|
+
* The rule ids this module owns, declared on the `function` surface (#3374's
|
|
1544
|
+
* anchor). One id covers the three spellings: they are one rule — the config
|
|
1545
|
+
* does not choose the runtime — met in three places.
|
|
1546
|
+
*/
|
|
1547
|
+
export declare const RETIRED_RUNTIME_KEY_RULE_IDS: readonly ["retired-runtime-key"];
|
|
1548
|
+
type RetiredRuntimeKeyRuleId = (typeof RETIRED_RUNTIME_KEY_RULE_IDS)[number];
|
|
1549
|
+
/** One retired key met in a `[function]` table. */
|
|
1550
|
+
export interface RetiredFunctionKey extends RuleRefusal<RetiredRuntimeKeyRuleId> {
|
|
1529
1551
|
/**
|
|
1530
1552
|
* Where it was: `mode`, `durable`, or `triggers.cron.<name>.mode`. Never
|
|
1531
1553
|
* rendered on its own — a reader that wants to branch reads this, and every
|
|
1532
1554
|
* printer reads `message`.
|
|
1533
1555
|
*/
|
|
1534
1556
|
path: string;
|
|
1535
|
-
/** The sentence the author is owed, with no file prefix (the caller adds it). */
|
|
1536
|
-
message: string;
|
|
1537
1557
|
}
|
|
1538
1558
|
/**
|
|
1539
|
-
*
|
|
1540
|
-
*
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
*
|
|
1545
|
-
*
|
|
1559
|
+
* The pre-phase-5 name of a met key, kept for the CLI's pull strip, which only
|
|
1560
|
+
* needs `path`. Every key met is refused now.
|
|
1561
|
+
*/
|
|
1562
|
+
export type IgnoredFunctionKey = RetiredFunctionKey;
|
|
1563
|
+
/**
|
|
1564
|
+
* Every retired runtime key the table carries, each as the refusal the author
|
|
1565
|
+
* reads. A cron entry's sentence says the extra thing its author needs to hear
|
|
1566
|
+
* — that the schedule no longer chooses, because every fire starts a task run.
|
|
1567
|
+
*/
|
|
1568
|
+
export declare function refusedFunctionKeys(functionTable: unknown): RetiredFunctionKey[];
|
|
1569
|
+
/**
|
|
1570
|
+
* The same refusals, rendered for one file — the shape `config push` and
|
|
1571
|
+
* `config diff` print.
|
|
1546
1572
|
*
|
|
1547
|
-
*
|
|
1548
|
-
*
|
|
1573
|
+
* `label` is what the reader can act on: `functions/<key>.toml` from the CLI,
|
|
1574
|
+
* and the function's key from the API, which has no file to name.
|
|
1549
1575
|
*/
|
|
1550
|
-
export declare function
|
|
1576
|
+
export declare function refusedFunctionKeyMessages(label: string, functionTable: unknown): string[];
|
|
1551
1577
|
/**
|
|
1552
1578
|
* The database types a `[function]` table's retired trigger block names —
|
|
1553
1579
|
* #3483.
|
|
1554
1580
|
*
|
|
1555
|
-
* Beside `
|
|
1581
|
+
* Beside `refusedFunctionKeys` because it answers the same question about the
|
|
1556
1582
|
* same table, for the same reader: `config pull` writes a version's AUTHORED
|
|
1557
1583
|
* bytes, and a version pushed before the removal carries the block. Without
|
|
1558
1584
|
* this the pulled tree would be refused on its next push — a tree an author
|
|
@@ -1584,14 +1610,6 @@ export declare function retiredDatabaseTriggerTypes(functionTable: unknown): str
|
|
|
1584
1610
|
* of them would call a block and the other would not cannot exist.
|
|
1585
1611
|
*/
|
|
1586
1612
|
export declare function hasRetiredDatabaseTriggerBlock(functionTable: unknown): boolean;
|
|
1587
|
-
/**
|
|
1588
|
-
* The same scan, rendered for one file — the shape `config push` and
|
|
1589
|
-
* `config diff` print and the admin route answers with.
|
|
1590
|
-
*
|
|
1591
|
-
* `label` is what the reader can act on: `functions/<key>.toml` from the CLI,
|
|
1592
|
-
* and the function's key from the API, which has no file to name.
|
|
1593
|
-
*/
|
|
1594
|
-
export declare function ignoredFunctionKeyWarnings(label: string, functionTable: unknown): string[];
|
|
1595
1613
|
/**
|
|
1596
1614
|
* The trigger blocks a function declares, derived from its authored TOML
|
|
1597
1615
|
* (#3181, project `server-functions`, criterion 4).
|
|
@@ -1963,7 +1981,7 @@ export declare function validateSigningSecretDeclaration(input: {
|
|
|
1963
1981
|
* `preflight`.
|
|
1964
1982
|
*/
|
|
1965
1983
|
/** The rule ids this module owns — the union type below anchors them (#3373). */
|
|
1966
|
-
export declare const WORKFLOW_RULE_IDS: readonly ["system-access-rule"];
|
|
1984
|
+
export declare const WORKFLOW_RULE_IDS: readonly ["system-access-rule", "retired-database-step-kind"];
|
|
1967
1985
|
type WorkflowRuleId = (typeof WORKFLOW_RULE_IDS)[number];
|
|
1968
1986
|
/** A violation of one of this module's rules, for a site to render. */
|
|
1969
1987
|
export interface WorkflowRuleViolation extends RuleRefusal<WorkflowRuleId> {
|
|
@@ -1981,6 +1999,31 @@ export declare function checkWorkflowSystemAccessRule(input: {
|
|
|
1981
1999
|
runAs?: unknown;
|
|
1982
2000
|
accessRule?: unknown;
|
|
1983
2001
|
}): WorkflowRuleViolation | null;
|
|
2002
|
+
/**
|
|
2003
|
+
* The DSL step kinds that executed a registered database operation (#3189,
|
|
2004
|
+
* phase 6 of project `server-functions`, matrix row M8).
|
|
2005
|
+
*
|
|
2006
|
+
* Every `database.*` runner except `database.syncIndexes` called
|
|
2007
|
+
* `DatabaseOperationsController.execute`, so retiring database operations
|
|
2008
|
+
* retires these fourteen kinds with them: the seven base kinds and their seven
|
|
2009
|
+
* `*ForUser` twins. `database.syncIndexes` (which calls the records index
|
|
2010
|
+
* route), `database.create` and `database.delete` (resource lifecycle) are not
|
|
2011
|
+
* here and keep running until the engine retires.
|
|
2012
|
+
*/
|
|
2013
|
+
export declare const RETIRED_DATABASE_STEP_KINDS: readonly ["database.query", "database.mutate", "database.count", "database.aggregate", "database.pipeline", "database.applyToQuery", "database.batch", "database.queryForUser", "database.mutateForUser", "database.countForUser", "database.aggregateForUser", "database.pipelineForUser", "database.applyToQueryForUser", "database.batchForUser"];
|
|
2014
|
+
/**
|
|
2015
|
+
* Every step in a definition — or the one step a run has reached — whose kind
|
|
2016
|
+
* is a retired database kind, with the sentence naming the replacement.
|
|
2017
|
+
*
|
|
2018
|
+
* Walks the top-level `steps` and a `collect` step's nested `step`, the one
|
|
2019
|
+
* place a step definition nests another. Push (the CLI preflight), save, the
|
|
2020
|
+
* activation lint and the engine all ask this one question, so a definition is
|
|
2021
|
+
* refused by the same words wherever it is caught, and a run that reaches such
|
|
2022
|
+
* a step fails with them.
|
|
2023
|
+
*/
|
|
2024
|
+
export declare function checkWorkflowRetiredStepKinds(input: {
|
|
2025
|
+
steps?: unknown;
|
|
2026
|
+
}): WorkflowRuleViolation[];
|
|
1984
2027
|
export declare const WORKFLOW_SURFACE: ConfigObjectSurface;
|
|
1985
2028
|
/**
|
|
1986
2029
|
* Cron-expression and timezone VALIDITY — the half of `src/cron-parser.ts`
|
|
@@ -2495,7 +2538,7 @@ export declare function resolvePromptStrictOutput(input: PromptStrictOutputInput
|
|
|
2495
2538
|
* Pure and dependency-free, like every module under `src/config-surface/`.
|
|
2496
2539
|
*/
|
|
2497
2540
|
/** The stable codes every agent agentRefusal this project adds carries. */
|
|
2498
|
-
export declare const AGENT_ERROR_CODES: readonly ["AGENT_DECLARATION_INVALID", "AGENT_TOOL_FUNCTION_MISSING", "AGENT_TOOL_FUNCTION_SCHEMA_MISSING", "AGENT_OUTPUT_SCHEMA_NOT_ALLOWED", "AGENT_CONFIG_KEY_NOT_ALLOWED", "AGENT_NOT_RUNNABLE", "AGENT_TEST_CASE_NOT_SUPPORTED", "AGENT_SCHEMA_NOT_TRANSLATABLE", "AGENT_MODEL_UNKNOWN", "AGENT_MODEL_CAPABILITY_MISSING", "AGENT_MODEL_CAPABILITIES_UNAVAILABLE", "AGENT_ROUND_NOT_AGENT", "AGENT_ROUND_INPUT_INVALID", "AGENT_TOOL_UNKNOWN", "AGENT_TOOL_ARGUMENTS_INVALID", "AGENT_ROUND_TRUNCATED", "AGENT_ROUND_EMPTY"];
|
|
2541
|
+
export declare const AGENT_ERROR_CODES: readonly ["AGENT_DECLARATION_INVALID", "AGENT_TOOL_FUNCTION_MISSING", "AGENT_TOOL_FUNCTION_SCHEMA_MISSING", "AGENT_OUTPUT_SCHEMA_NOT_ALLOWED", "AGENT_CONFIG_KEY_NOT_ALLOWED", "AGENT_NOT_RUNNABLE", "AGENT_TEST_CASE_NOT_SUPPORTED", "AGENT_SCHEMA_NOT_TRANSLATABLE", "AGENT_MODEL_UNKNOWN", "AGENT_MODEL_CAPABILITY_MISSING", "AGENT_MODEL_CAPABILITIES_UNAVAILABLE", "AGENT_ROUND_NOT_AGENT", "AGENT_ROUND_INPUT_INVALID", "AGENT_TOOL_UNKNOWN", "AGENT_TOOL_ARGUMENTS_INVALID", "AGENT_ROUND_TRUNCATED", "AGENT_ROUND_EMPTY", "AGENT_TEST_CASE_INVALID"];
|
|
2499
2542
|
export type AgentErrorCode = (typeof AGENT_ERROR_CODES)[number];
|
|
2500
2543
|
/** One agentRefusal: the code a client branches on, and the sentence a person reads. */
|
|
2501
2544
|
export interface AgentRefusal {
|
|
@@ -2544,6 +2587,12 @@ export interface AgentToolDeclaration {
|
|
|
2544
2587
|
approval?: boolean;
|
|
2545
2588
|
statusText?: string;
|
|
2546
2589
|
historyScope?: AgentToolHistoryScope;
|
|
2590
|
+
/**
|
|
2591
|
+
* A call to this tool ends the turn: once every call of its response is
|
|
2592
|
+
* final, the turn settles with no further model round. A client tool with
|
|
2593
|
+
* it is never answered — the platform records its result.
|
|
2594
|
+
*/
|
|
2595
|
+
endsTurn?: boolean;
|
|
2547
2596
|
}
|
|
2548
2597
|
/** One `[[prompt.agent.events]]` entry. */
|
|
2549
2598
|
export interface AgentEventDeclaration {
|
|
@@ -2571,7 +2620,18 @@ export interface AgentDeclaration {
|
|
|
2571
2620
|
export type NormalizedAgentTool = AgentToolDeclaration & {
|
|
2572
2621
|
approval: boolean;
|
|
2573
2622
|
historyScope: AgentToolHistoryScope;
|
|
2623
|
+
endsTurn: boolean;
|
|
2624
|
+
};
|
|
2625
|
+
/**
|
|
2626
|
+
* The result the platform records for a call to a client tool with
|
|
2627
|
+
* `endsTurn = true`: the call is final when its response is committed, and
|
|
2628
|
+
* later rounds read this as its tool result.
|
|
2629
|
+
*/
|
|
2630
|
+
export declare const AGENT_TERMINAL_CALL_OUTPUT: {
|
|
2631
|
+
delivered: true;
|
|
2574
2632
|
};
|
|
2633
|
+
/** The schema of `AGENT_TERMINAL_CALL_OUTPUT`: a terminal client tool's output type. */
|
|
2634
|
+
export declare const AGENT_TERMINAL_CALL_OUTPUT_SCHEMA: AgentSchema;
|
|
2575
2635
|
/** The declaration with every default applied — what readers consume. */
|
|
2576
2636
|
export interface NormalizedAgentDeclaration {
|
|
2577
2637
|
answeredBy: AgentAnsweredBy;
|
|
@@ -2675,16 +2735,16 @@ export declare function agentNotRunnableRefusal(promptKey?: string): AgentRefusa
|
|
|
2675
2735
|
*/
|
|
2676
2736
|
export declare function agentRoundNotAgentRefusal(promptKey: string): AgentRefusal;
|
|
2677
2737
|
/**
|
|
2678
|
-
* The refusal of a prompt test case that
|
|
2679
|
-
*
|
|
2680
|
-
*
|
|
2681
|
-
*
|
|
2738
|
+
* The refusal of a prompt test case that names an agent as its judge (§D1: an
|
|
2739
|
+
* evaluator runs single-shot, which an agent never does). A case written ON an
|
|
2740
|
+
* agent is a single-round test since #4262 (`agent-test-case.ts`), so
|
|
2741
|
+
* `evaluator` is the one role left.
|
|
2682
2742
|
*/
|
|
2683
|
-
export declare function agentTestCaseRefusal(promptKey: string,
|
|
2743
|
+
export declare function agentTestCaseRefusal(promptKey: string, _role?: "evaluator"): AgentRefusal;
|
|
2684
2744
|
/**
|
|
2685
2745
|
* The declaration with every default applied: `answeredBy = "initiator"`, the
|
|
2686
2746
|
* platform maximums for the limits, and per tool `invoke = "request"` (server
|
|
2687
|
-
* tools), `approval = false
|
|
2747
|
+
* tools), `approval = false`, `historyScope = "session"` and `endsTurn = false`.
|
|
2688
2748
|
*
|
|
2689
2749
|
* The ONLY accessor for defaults — the stored value never carries them
|
|
2690
2750
|
* (DSO-3798-001). Takes a value `resolveAgentDeclaration` accepted (or `null`)
|
|
@@ -2812,6 +2872,109 @@ export interface AgentSchemaTranslationInput {
|
|
|
2812
2872
|
* A declaration with no tools and no events reads no function schema at all.
|
|
2813
2873
|
*/
|
|
2814
2874
|
export declare function agentSchemaTranslationRefusals(input: AgentSchemaTranslationInput): AgentRefusal[];
|
|
2875
|
+
/**
|
|
2876
|
+
* What an agent test case may say — issue #4262 (single-round prompt tests
|
|
2877
|
+
* from a seeded history; design-docs/agents.md §D1).
|
|
2878
|
+
*
|
|
2879
|
+
* A test case on an agent prompt carries one `[test.agent]` block: a seeded
|
|
2880
|
+
* `history` (JSON text), the round's turn `context`, `timezone` and `locale`,
|
|
2881
|
+
* and two assertions on the round's calls (`expectedToolCall`,
|
|
2882
|
+
* `expectedNoToolCall`). On the wire and in storage those are six flat
|
|
2883
|
+
* `BlockTestCase` fields, `agentHistory` … `agentExpectedNoToolCall`.
|
|
2884
|
+
*
|
|
2885
|
+
* This module is the whole FILE-DECIDABLE rule for them: the history's shape,
|
|
2886
|
+
* its turns, its call and result pairing, where its events sit, the
|
|
2887
|
+
* assertions' shapes, and — when the caller passes the agent's declaration —
|
|
2888
|
+
* that the event kinds and the asserted tool are declared. The admin test-case
|
|
2889
|
+
* routes call it, and so does the CLI's push preflight through the vendored
|
|
2890
|
+
* artifact, so a refusal at push and a refusal at the route cannot disagree.
|
|
2891
|
+
* What needs app state or a schema validator (the input, context and event
|
|
2892
|
+
* schemas, the send route's zone and tag rules) is `agent-test-round.ts`'s.
|
|
2893
|
+
*
|
|
2894
|
+
* Every refusal carries `AGENT_TEST_CASE_INVALID` and the caller gets every
|
|
2895
|
+
* offending item at once, as the declaration resolver does.
|
|
2896
|
+
*
|
|
2897
|
+
* Pure and dependency-free apart from the agent declaration's types, like
|
|
2898
|
+
* every module under `src/config-surface/`.
|
|
2899
|
+
*/
|
|
2900
|
+
/** The six wire and stored fields, in the order the surface declares them. */
|
|
2901
|
+
export declare const AGENT_TEST_CASE_FIELDS: readonly ["agentHistory", "agentContext", "agentTimezone", "agentLocale", "agentExpectedToolCall", "agentExpectedNoToolCall"];
|
|
2902
|
+
export type AgentTestCaseField = (typeof AGENT_TEST_CASE_FIELDS)[number];
|
|
2903
|
+
/** One call of a seeded assistant entry. */
|
|
2904
|
+
export interface AgentTestCall {
|
|
2905
|
+
callId: string;
|
|
2906
|
+
name: string;
|
|
2907
|
+
arguments: unknown;
|
|
2908
|
+
}
|
|
2909
|
+
/** One entry of a seeded history, oldest first. */
|
|
2910
|
+
export type AgentTestHistoryEntry = {
|
|
2911
|
+
role: "user";
|
|
2912
|
+
text: string;
|
|
2913
|
+
} | {
|
|
2914
|
+
role: "assistant";
|
|
2915
|
+
text?: string;
|
|
2916
|
+
reasoning?: string;
|
|
2917
|
+
calls?: AgentTestCall[];
|
|
2918
|
+
} | {
|
|
2919
|
+
role: "tool";
|
|
2920
|
+
callId: string;
|
|
2921
|
+
output: unknown;
|
|
2922
|
+
} | {
|
|
2923
|
+
role: "tool";
|
|
2924
|
+
callId: string;
|
|
2925
|
+
error: {
|
|
2926
|
+
code: string;
|
|
2927
|
+
message: string;
|
|
2928
|
+
};
|
|
2929
|
+
} | {
|
|
2930
|
+
role: "event";
|
|
2931
|
+
kind: string;
|
|
2932
|
+
refersTo?: string;
|
|
2933
|
+
data: unknown;
|
|
2934
|
+
};
|
|
2935
|
+
/** The `[test.agent]` block, read. */
|
|
2936
|
+
export interface AgentTestCase {
|
|
2937
|
+
history: AgentTestHistoryEntry[];
|
|
2938
|
+
context: Record<string, unknown> | null;
|
|
2939
|
+
timezone: string | null;
|
|
2940
|
+
locale: string | null;
|
|
2941
|
+
expectedToolCall: {
|
|
2942
|
+
name: string;
|
|
2943
|
+
arguments?: unknown;
|
|
2944
|
+
} | null;
|
|
2945
|
+
/** `false` when unset: no assertion. */
|
|
2946
|
+
expectedNoToolCall: boolean;
|
|
2947
|
+
}
|
|
2948
|
+
export interface AgentTestCaseInput {
|
|
2949
|
+
/**
|
|
2950
|
+
* The prompt's kind; unset means `chat`. The admin routes pass a block type
|
|
2951
|
+
* (`workflow`, `script`, `integration`) for a case that is not a prompt's.
|
|
2952
|
+
*/
|
|
2953
|
+
kind?: unknown;
|
|
2954
|
+
/**
|
|
2955
|
+
* The agent's `[prompt.agent]` (a table, one JSON string, or `null` for an
|
|
2956
|
+
* agent that declares none). Omitted means "not known here": the declared
|
|
2957
|
+
* names are not checked (the CLI preflight reads the sidecar alone).
|
|
2958
|
+
*/
|
|
2959
|
+
declaration?: unknown;
|
|
2960
|
+
/** The case's fields, in wire spelling (`agentHistory`, …, `expectedJsonSubset`). */
|
|
2961
|
+
fields: Record<string, unknown>;
|
|
2962
|
+
}
|
|
2963
|
+
export type AgentTestCaseResolution = {
|
|
2964
|
+
ok: true;
|
|
2965
|
+
testCase: AgentTestCase | null;
|
|
2966
|
+
} | {
|
|
2967
|
+
ok: false;
|
|
2968
|
+
refusals: AgentRefusal[];
|
|
2969
|
+
};
|
|
2970
|
+
/**
|
|
2971
|
+
* The one rule: is this case's agent block something a round can be built
|
|
2972
|
+
* from? `{ ok: true, testCase }` carries it read (`null` on a case whose
|
|
2973
|
+
* prompt is not an agent). On a chat or decisions case, every agent key
|
|
2974
|
+
* holding a non-null value is refused by name; an explicit `null` is unset on
|
|
2975
|
+
* any case, which is how a full-state update clears one.
|
|
2976
|
+
*/
|
|
2977
|
+
export declare function resolveAgentTestCase(input: AgentTestCaseInput): AgentTestCaseResolution;
|
|
2815
2978
|
export declare const PROMPT_SURFACE: ConfigObjectSurface;
|
|
2816
2979
|
export declare const INTEGRATION_SURFACE: ConfigObjectSurface;
|
|
2817
2980
|
export declare const WEBHOOK_SURFACE: ConfigObjectSurface;
|