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.
Files changed (143) hide show
  1. package/assets/skill/skills/primitive-platform/SKILL.md +17 -0
  2. package/dist/src/commands/agent-sessions.js +4 -0
  3. package/dist/src/commands/agent-sessions.js.map +1 -1
  4. package/dist/src/commands/auth.js +7 -4
  5. package/dist/src/commands/auth.js.map +1 -1
  6. package/dist/src/commands/connections.js +11 -12
  7. package/dist/src/commands/connections.js.map +1 -1
  8. package/dist/src/commands/database-type-configs.js +2 -76
  9. package/dist/src/commands/database-type-configs.js.map +1 -1
  10. package/dist/src/commands/database-types.js +313 -13
  11. package/dist/src/commands/database-types.js.map +1 -1
  12. package/dist/src/commands/databases.d.ts +9 -0
  13. package/dist/src/commands/databases.js +78 -403
  14. package/dist/src/commands/databases.js.map +1 -1
  15. package/dist/src/commands/documents.d.ts +32 -2
  16. package/dist/src/commands/documents.js +344 -711
  17. package/dist/src/commands/documents.js.map +1 -1
  18. package/dist/src/commands/functions.js +2 -2
  19. package/dist/src/commands/functions.js.map +1 -1
  20. package/dist/src/commands/llm.js +6 -9
  21. package/dist/src/commands/llm.js.map +1 -1
  22. package/dist/src/commands/prompts.d.ts +7 -0
  23. package/dist/src/commands/prompts.js +44 -0
  24. package/dist/src/commands/prompts.js.map +1 -1
  25. package/dist/src/commands/settings.d.ts +9 -12
  26. package/dist/src/commands/settings.js +79 -31
  27. package/dist/src/commands/settings.js.map +1 -1
  28. package/dist/src/commands/sync.d.ts +43 -110
  29. package/dist/src/commands/sync.js +356 -1251
  30. package/dist/src/commands/sync.js.map +1 -1
  31. package/dist/src/lib/aggregate-output.d.ts +25 -0
  32. package/dist/src/lib/aggregate-output.js +53 -0
  33. package/dist/src/lib/aggregate-output.js.map +1 -0
  34. package/dist/src/lib/api-client.d.ts +48 -204
  35. package/dist/src/lib/api-client.js +57 -321
  36. package/dist/src/lib/api-client.js.map +1 -1
  37. package/dist/src/lib/codegen-shared/generatedFiles.d.ts +6 -7
  38. package/dist/src/lib/codegen-shared/generatedFiles.js +2 -2
  39. package/dist/src/lib/codegen-shared/generatedFiles.js.map +1 -1
  40. package/dist/src/lib/codegen-shared/prettierStable.d.ts +1 -1
  41. package/dist/src/lib/codegen-shared/prettierStable.js +1 -1
  42. package/dist/src/lib/codegen-shared/resolveCodegenSourceDir.d.ts +2 -2
  43. package/dist/src/lib/codegen-shared/resolveCodegenSourceDir.js +2 -2
  44. package/dist/src/lib/config-object-descriptor.js +15 -10
  45. package/dist/src/lib/config-object-descriptor.js.map +1 -1
  46. package/dist/src/lib/config-surface.d.ts +2 -1
  47. package/dist/src/lib/config-surface.js +4 -1
  48. package/dist/src/lib/config-surface.js.map +1 -1
  49. package/dist/src/lib/connections-list.d.ts +10 -0
  50. package/dist/src/lib/connections-list.js +18 -0
  51. package/dist/src/lib/connections-list.js.map +1 -0
  52. package/dist/src/lib/csv.d.ts +8 -9
  53. package/dist/src/lib/csv.js +3 -4
  54. package/dist/src/lib/csv.js.map +1 -1
  55. package/dist/src/lib/db-codegen/dbGenerator.js +5 -16
  56. package/dist/src/lib/db-codegen/dbGenerator.js.map +1 -1
  57. package/dist/src/lib/db-codegen/dbNaming.d.ts +5 -13
  58. package/dist/src/lib/db-codegen/dbNaming.js +5 -17
  59. package/dist/src/lib/db-codegen/dbNaming.js.map +1 -1
  60. package/dist/src/lib/db-codegen/dbTemplates.d.ts +7 -56
  61. package/dist/src/lib/db-codegen/dbTemplates.js +25 -125
  62. package/dist/src/lib/db-codegen/dbTemplates.js.map +1 -1
  63. package/dist/src/lib/db-codegen/dbTsTypes.d.ts +2 -2
  64. package/dist/src/lib/db-codegen/dbTsTypes.js +2 -2
  65. package/dist/src/lib/db-codegen/dbTypeIR.d.ts +60 -2
  66. package/dist/src/lib/db-codegen/dbTypeIR.js +12 -1
  67. package/dist/src/lib/db-codegen/dbTypeIR.js.map +1 -1
  68. package/dist/src/lib/document-export-record-log.d.ts +57 -0
  69. package/dist/src/lib/document-export-record-log.js +215 -0
  70. package/dist/src/lib/document-export-record-log.js.map +1 -0
  71. package/dist/src/lib/document-ingest-artifact.d.ts +13 -2
  72. package/dist/src/lib/document-ingest-artifact.js +7 -3
  73. package/dist/src/lib/document-ingest-artifact.js.map +1 -1
  74. package/dist/src/lib/document-ingest-rows.d.ts +16 -0
  75. package/dist/src/lib/document-ingest-rows.js +17 -0
  76. package/dist/src/lib/document-ingest-rows.js.map +1 -1
  77. package/dist/src/lib/document-ingest.d.ts +22 -0
  78. package/dist/src/lib/document-ingest.js +33 -0
  79. package/dist/src/lib/document-ingest.js.map +1 -1
  80. package/dist/src/lib/function-sync.d.ts +3 -16
  81. package/dist/src/lib/function-sync.js +14 -18
  82. package/dist/src/lib/function-sync.js.map +1 -1
  83. package/dist/src/lib/function-triggers.d.ts +3 -15
  84. package/dist/src/lib/function-triggers.js +10 -72
  85. package/dist/src/lib/function-triggers.js.map +1 -1
  86. package/dist/src/lib/generated-allowlist.js +0 -20
  87. package/dist/src/lib/generated-allowlist.js.map +1 -1
  88. package/dist/src/lib/generated-config-surfaces.d.ts +212 -49
  89. package/dist/src/lib/generated-config-surfaces.js +759 -184
  90. package/dist/src/lib/generated-config-surfaces.js.map +1 -1
  91. package/dist/src/lib/generated-sdk-types.d.ts +1 -1
  92. package/dist/src/lib/generated-sdk-types.js +1 -1
  93. package/dist/src/lib/generated-sdk-types.js.map +1 -1
  94. package/dist/src/lib/login-scope-lines.d.ts +15 -0
  95. package/dist/src/lib/login-scope-lines.js +22 -0
  96. package/dist/src/lib/login-scope-lines.js.map +1 -0
  97. package/dist/src/lib/paginate.d.ts +0 -5
  98. package/dist/src/lib/paginate.js +0 -5
  99. package/dist/src/lib/paginate.js.map +1 -1
  100. package/dist/src/lib/prompt-schema-codegen.js +5 -2
  101. package/dist/src/lib/prompt-schema-codegen.js.map +1 -1
  102. package/dist/src/lib/refresh-admin-credentials.d.ts +7 -0
  103. package/dist/src/lib/refresh-admin-credentials.js +16 -4
  104. package/dist/src/lib/refresh-admin-credentials.js.map +1 -1
  105. package/dist/src/lib/root-import-decision.d.ts +15 -14
  106. package/dist/src/lib/root-import-decision.js +44 -51
  107. package/dist/src/lib/root-import-decision.js.map +1 -1
  108. package/dist/src/lib/snapshot-build-rows.d.ts +21 -0
  109. package/dist/src/lib/snapshot-build-rows.js +22 -0
  110. package/dist/src/lib/snapshot-build-rows.js.map +1 -1
  111. package/dist/src/lib/snapshot-build.js +8 -3
  112. package/dist/src/lib/snapshot-build.js.map +1 -1
  113. package/dist/src/lib/swift-codegen/banners.d.ts +34 -7
  114. package/dist/src/lib/swift-codegen/banners.js +37 -7
  115. package/dist/src/lib/swift-codegen/banners.js.map +1 -1
  116. package/dist/src/lib/swift-codegen/dbGenerator.d.ts +4 -3
  117. package/dist/src/lib/swift-codegen/dbGenerator.js +14 -117
  118. package/dist/src/lib/swift-codegen/dbGenerator.js.map +1 -1
  119. package/dist/src/lib/swift-codegen/functionGenerator.d.ts +3 -3
  120. package/dist/src/lib/swift-codegen/functionGenerator.js +22 -17
  121. package/dist/src/lib/swift-codegen/functionGenerator.js.map +1 -1
  122. package/dist/src/lib/swift-codegen/generator.d.ts +5 -5
  123. package/dist/src/lib/swift-codegen/generator.js +35 -40
  124. package/dist/src/lib/swift-codegen/generator.js.map +1 -1
  125. package/dist/src/lib/toml-database-config.d.ts +14 -75
  126. package/dist/src/lib/toml-database-config.js +14 -305
  127. package/dist/src/lib/toml-database-config.js.map +1 -1
  128. package/dist/src/lib/workflow-codegen/generator.d.ts +7 -7
  129. package/dist/src/lib/workflow-codegen/generator.js +16 -23
  130. package/dist/src/lib/workflow-codegen/generator.js.map +1 -1
  131. package/dist/src/lib/workflow-codegen/invokerIR.d.ts +6 -12
  132. package/dist/src/lib/workflow-codegen/invokerIR.js +4 -5
  133. package/dist/src/lib/workflow-codegen/invokerIR.js.map +1 -1
  134. package/dist/src/lib/workflow-toml-validator.d.ts +2 -0
  135. package/dist/src/lib/workflow-toml-validator.js +28 -1
  136. package/dist/src/lib/workflow-toml-validator.js.map +1 -1
  137. package/package.json +3 -5
  138. package/dist/src/lib/generated-workflow-model-fields.d.ts +0 -20
  139. package/dist/src/lib/generated-workflow-model-fields.js +0 -53
  140. package/dist/src/lib/generated-workflow-model-fields.js.map +0 -1
  141. package/dist/src/lib/workflow-field-descriptor.d.ts +0 -91
  142. package/dist/src/lib/workflow-field-descriptor.js +0 -153
  143. package/dist/src/lib/workflow-field-descriptor.js.map +0 -1
@@ -0,0 +1,25 @@
1
+ /** One aggregate row as the routes answer it. */
2
+ export interface AggregateOutputRow {
3
+ group?: Record<string, unknown>;
4
+ [operationKey: string]: unknown;
5
+ }
6
+ /** What the command asked for: the group levels and its one operation. */
7
+ export interface AggregateOutputRequest {
8
+ groupBy: string[];
9
+ op: string;
10
+ field?: string;
11
+ }
12
+ /** A rendered aggregate: a key/value line, or a ready-to-print table. */
13
+ export type RenderedAggregate = {
14
+ kind: "scalar";
15
+ label: string;
16
+ value: string;
17
+ } | {
18
+ kind: "table";
19
+ text: string;
20
+ };
21
+ /**
22
+ * Render an aggregate's rows for a terminal. `rows` is the route body's
23
+ * `result`; anything that is not an array renders as no rows.
24
+ */
25
+ export declare function renderAggregateResult(rows: unknown, request: AggregateOutputRequest): RenderedAggregate;
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Human output for `databases records aggregate` and
3
+ * `documents records aggregate`, shared so the two print alike.
4
+ *
5
+ * Both routes answer rows, `{ group, ...operationValues }`. Ungrouped, the one
6
+ * row's value is printed as a key/value line; grouped, as a table with one
7
+ * column per row group key and one value column. A `null` group value prints
8
+ * as `null` so it stays distinct from an empty string (an empty cell); a
9
+ * `null` operation value prints `—`.
10
+ */
11
+ import { formatTable } from "./output.js";
12
+ const display = (value) => value === null || value === undefined ? "—" : String(value);
13
+ /**
14
+ * Render an aggregate's rows for a terminal. `rows` is the route body's
15
+ * `result`; anything that is not an array renders as no rows.
16
+ */
17
+ export function renderAggregateResult(rows, request) {
18
+ const list = Array.isArray(rows) ? rows : [];
19
+ const operationKey = request.op === "count" ? "count" : `${request.op}_${request.field}`;
20
+ if (request.groupBy.length === 0) {
21
+ // The field name is reproduced verbatim in both labels — it is a
22
+ // user-supplied identifier, and case-folding it produced
23
+ // `avg(lastvalue)` for `--field lastValue` (issue #2357).
24
+ return {
25
+ kind: "scalar",
26
+ label: request.op === "count"
27
+ ? "count"
28
+ : `${request.op.toLowerCase()}(${request.field})`,
29
+ value: display(list[0]?.[operationKey]),
30
+ };
31
+ }
32
+ const groupKeys = list.length > 0 ? Object.keys(list[0].group ?? {}) : request.groupBy;
33
+ const valueLabel = request.op === "count"
34
+ ? "COUNT"
35
+ : `${request.op.toUpperCase()}(${request.field})`;
36
+ const table = list.map((row) => {
37
+ const cells = {};
38
+ groupKeys.forEach((key, index) => {
39
+ const value = row.group?.[key];
40
+ cells[`g${index}`] = value === null || value === undefined ? "null" : String(value);
41
+ });
42
+ cells.value = display(row[operationKey]);
43
+ return cells;
44
+ });
45
+ return {
46
+ kind: "table",
47
+ text: formatTable(table, [
48
+ ...groupKeys.map((key, index) => ({ header: key.toUpperCase(), key: `g${index}` })),
49
+ { header: valueLabel, key: "value" },
50
+ ]),
51
+ };
52
+ }
53
+ //# sourceMappingURL=aggregate-output.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aggregate-output.js","sourceRoot":"","sources":["../../../src/lib/aggregate-output.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAoB1C,MAAM,OAAO,GAAG,CAAC,KAAc,EAAU,EAAE,CACzC,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAE9D;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CACnC,IAAa,EACb,OAA+B;IAE/B,MAAM,IAAI,GAAyB,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;IACnE,MAAM,YAAY,GAChB,OAAO,CAAC,EAAE,KAAK,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,EAAE,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;IAEtE,IAAI,OAAO,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACjC,iEAAiE;QACjE,yDAAyD;QACzD,0DAA0D;QAC1D,OAAO;YACL,IAAI,EAAE,QAAQ;YACd,KAAK,EACH,OAAO,CAAC,EAAE,KAAK,OAAO;gBACpB,CAAC,CAAC,OAAO;gBACT,CAAC,CAAC,GAAG,OAAO,CAAC,EAAE,CAAC,WAAW,EAAE,IAAI,OAAO,CAAC,KAAK,GAAG;YACrD,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC;SACxC,CAAC;IACJ,CAAC;IAED,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC;IACvF,MAAM,UAAU,GACd,OAAO,CAAC,EAAE,KAAK,OAAO;QACpB,CAAC,CAAC,OAAO;QACT,CAAC,CAAC,GAAG,OAAO,CAAC,EAAE,CAAC,WAAW,EAAE,IAAI,OAAO,CAAC,KAAK,GAAG,CAAC;IACtD,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;QAC7B,MAAM,KAAK,GAA2B,EAAE,CAAC;QACzC,SAAS,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE;YAC/B,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,EAAE,CAAC,GAAG,CAAC,CAAC;YAC/B,KAAK,CAAC,IAAI,KAAK,EAAE,CAAC,GAAG,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACtF,CAAC,CAAC,CAAC;QACH,KAAK,CAAC,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC;QACzC,OAAO,KAAK,CAAC;IACf,CAAC,CAAC,CAAC;IACH,OAAO;QACL,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,WAAW,CAAC,KAAK,EAAE;YACvB,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,WAAW,EAAE,EAAE,GAAG,EAAE,IAAI,KAAK,EAAE,EAAE,CAAC,CAAC;YACnF,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,EAAE,OAAO,EAAE;SACrC,CAAC;KACH,CAAC;AACJ,CAAC"}
@@ -1,5 +1,17 @@
1
1
  import { type ListEnvelope } from "./paginate.js";
2
2
  import { type GlobalAppRef, type WorkflowUsageReport } from "./workflow-usage.js";
3
+ /**
4
+ * #4262 — an agent prompt's test case: its `[test.agent]` block on the wire.
5
+ * `agentHistory` is JSON text; context and the expected call are parsed.
6
+ */
7
+ export interface AgentTestCaseWireFields {
8
+ agentHistory?: string | null;
9
+ agentContext?: Record<string, any> | null;
10
+ agentTimezone?: string | null;
11
+ agentLocale?: string | null;
12
+ agentExpectedToolCall?: Record<string, any> | null;
13
+ agentExpectedNoToolCall?: boolean | null;
14
+ }
3
15
  /**
4
16
  * Metadata for a single bucket blob, as returned by the metadata endpoint
5
17
  * `GET blob-buckets/:bucketId/blobs/:blobId/metadata`. Mirrors the published
@@ -122,51 +134,11 @@ export interface ParsedErrorResponse {
122
134
  export declare function parseErrorResponse(response: {
123
135
  status: number;
124
136
  }, text: string, path?: string): ParsedErrorResponse;
125
- /**
126
- * Typed exception classes for the database-schema feature (issue #666).
127
- * Each maps 1:1 to a server `code` value emitted from the op-edit or
128
- * schema-edit gate. They all extend ApiError so existing catch-all paths
129
- * continue to work; specialized catch blocks can branch on `instanceof`.
130
- *
131
- * Per round-2 addendum A1, `details` is always preserved so callers can
132
- * extract structured offender lists (refs[], operations[], etc.).
133
- */
134
- export declare class SchemaRequiredError extends ApiError {
135
- constructor(message: string, details?: Record<string, any>);
136
- }
137
- export declare class OperationRefError extends ApiError {
138
- constructor(message: string, details?: Record<string, any>);
139
- get refs(): Array<{
140
- ref: string;
141
- location: string;
142
- }>;
143
- }
144
- export declare class SchemaBreaksOpsError extends ApiError {
145
- constructor(message: string, details?: Record<string, any>);
146
- get operations(): Array<{
147
- operation: string;
148
- refs: Array<{
149
- ref: string;
150
- location: string;
151
- }>;
152
- }>;
153
- }
154
- export declare class SchemaHasUncheckableOpsError extends ApiError {
155
- constructor(message: string, details?: Record<string, any>);
156
- get operations(): Array<{
157
- operation: string;
158
- locations: string[];
159
- }>;
160
- }
161
137
  export declare class TomlParseError extends ApiError {
162
138
  constructor(message: string, details?: Record<string, any>);
163
139
  get line(): number | undefined;
164
140
  get column(): number | undefined;
165
141
  }
166
- export declare class OpsExistError extends ApiError {
167
- constructor(message: string, details?: Record<string, any>);
168
- get opCount(): number;
169
- }
170
142
  interface EmailTemplateSummary {
171
143
  emailType: string;
172
144
  label: string;
@@ -503,35 +475,6 @@ export interface DatabaseBatchOperation {
503
475
  */
504
476
  condition?: Record<string, any>;
505
477
  }
506
- /**
507
- * Normalize a `databases operations execute` result to the CLI's one list
508
- * envelope — but only when the result is a Durable Object query page
509
- * (issue #2440).
510
- *
511
- * A registered operation is a list only sometimes. Of the shapes the server's
512
- * operation dispatch can return, exactly two carry a top-level `data` array: a
513
- * bare `query` and a `pipeline` whose `returnField` names a query step. A
514
- * `count` (`{ count }`), an `aggregate` (`{ result }`), a mutation
515
- * (`{ results }`), an `applyToQuery` (`{ matched, affected, failed, … }`) and a
516
- * `returnField: "all"` pipeline (`{ steps: { … } }`) do not, so blanket
517
- * normalization would corrupt them. This helper therefore tests the shape
518
- * first and passes everything else through byte-for-byte — including the
519
- * nested steps of a `returnField: "all"` pipeline, which are operation-defined
520
- * objects the CLI must not reach into.
521
- *
522
- * Deliberately narrow, not a general-purpose predicate: the contract is
523
- * specifically "an operations-execute result may be a DO query page".
524
- * `executeDatabaseOperation()` is the only caller.
525
- *
526
- * The conversion itself is delegated to `normalizeCliListEnvelope()` so cursor
527
- * handling, `prevCursor` dropping and `hasMore` derivation have exactly one
528
- * implementation. That helper throws on an unrecognized shape — correct when
529
- * the payload is supposed to be a list, wrong here, where the payload is the
530
- * caller's own result — which is why the shape test has to run first. `_timing`
531
- * (`--timing`) is re-attached afterwards, since it rides alongside the envelope
532
- * rather than inside it.
533
- */
534
- export declare function normalizeDatabaseOperationResult(raw: unknown): unknown;
535
478
  export declare class ApiClient {
536
479
  /**
537
480
  * Loaded on first use (`ensureAuthenticated`), never in a constructor.
@@ -1080,15 +1023,13 @@ export declare class ApiClient {
1080
1023
  }>;
1081
1024
  /**
1082
1025
  * List the live connections the server believes exist for exactly one of a
1083
- * document, user, or database. Read-only inspection over admin-api. Rows are
1026
+ * document or user. Read-only inspection over admin-api. Rows are
1084
1027
  * per-connection-×-subscription bindings, so `connectionId` is not unique
1085
- * across rows. `params` on a database-subscription row is caller-defined
1086
- * bound CEL input — typed `unknown`.
1028
+ * across rows.
1087
1029
  */
1088
1030
  listConnections(appId: string, selector: {
1089
1031
  documentId?: string;
1090
1032
  userId?: string;
1091
- databaseId?: string;
1092
1033
  }, params?: {
1093
1034
  limit?: number;
1094
1035
  cursor?: string;
@@ -1358,7 +1299,7 @@ export declare class ApiClient {
1358
1299
  evaluatorConfigId?: string;
1359
1300
  /** The sidecar's file name — the case's identity (#2896). */
1360
1301
  key?: string;
1361
- }): Promise<any>;
1302
+ } & AgentTestCaseWireFields): Promise<any>;
1362
1303
  updateTestCase(appId: string, blockType: "prompt" | "integration" | "workflow" | "script", blockId: string, testCaseId: string, payload: {
1363
1304
  name?: string;
1364
1305
  description?: string | null;
@@ -1371,7 +1312,7 @@ export declare class ApiClient {
1371
1312
  evaluatorConfigId?: string | null;
1372
1313
  /** The sidecar's file name, on a create-or-rename backfill (#2896). */
1373
1314
  key?: string;
1374
- }): Promise<any>;
1315
+ } & AgentTestCaseWireFields): Promise<any>;
1375
1316
  deleteTestCase(appId: string, blockType: "prompt" | "integration" | "workflow" | "script", blockId: string, testCaseId: string): Promise<void>;
1376
1317
  listTestCaseAttachments(appId: string, blockType: "prompt" | "integration" | "workflow" | "script", blockId: string, testCaseId: string): Promise<{
1377
1318
  attachments: Array<{
@@ -1848,44 +1789,6 @@ export declare class ApiClient {
1848
1789
  * `{ success, id, appliedFields }`.
1849
1790
  */
1850
1791
  patchDatabaseRecord(appId: string, databaseId: string, modelName: string, id: string, data: any): Promise<any>;
1851
- listDatabaseOperations(appId: string, databaseId: string): Promise<any[]>;
1852
- /**
1853
- * Execute a registered operation and, when the result is a query page,
1854
- * normalize it to the CLI's one list envelope (issue #2440).
1855
- *
1856
- * The registered operation decides the response shape, so the normalization
1857
- * is conditional — see {@link normalizeDatabaseOperationResult}. Everything
1858
- * else (a `count`, an `aggregate`, a mutation, a `returnField: "all"`
1859
- * pipeline) is returned exactly as the server sent it.
1860
- */
1861
- executeDatabaseOperation(appId: string, databaseId: string, operationName: string, data?: {
1862
- params?: Record<string, any>;
1863
- limit?: number;
1864
- cursor?: string;
1865
- direction?: number;
1866
- }, token?: string, options?: {
1867
- timing?: boolean;
1868
- }): Promise<any>;
1869
- /**
1870
- * Execute a registered batch (bulk) database operation. Posts a chunk of
1871
- * items to the canonical `operations/:name/batch` endpoint (the same one the
1872
- * client library's `executeBatch` uses — NOT the deprecated `import-bulk`
1873
- * alias). Used by `databases import-csv`.
1874
- *
1875
- * @returns `{ imported, failed }` — DO-level write outcome counts. Per-item
1876
- * validation/access failures abort the whole chunk with a 4xx (thrown).
1877
- */
1878
- executeBatch(appId: string, databaseId: string, operationName: string, batch: Array<{
1879
- params: Record<string, any>;
1880
- }>): Promise<{
1881
- imported: number;
1882
- failed: number;
1883
- }>;
1884
- /**
1885
- * Make a request using a specific JWT token instead of the CLI's credentials.
1886
- * Used for executing operations as a different user.
1887
- */
1888
- requestWithToken<T = any>(path: string, token: string, options?: RequestInit): Promise<T>;
1889
1792
  listDatabaseIndexes(appId: string, databaseId: string, modelName?: string): Promise<any>;
1890
1793
  registerDatabaseIndex(appId: string, databaseId: string, data: {
1891
1794
  modelName: string;
@@ -1915,12 +1818,6 @@ export declare class ApiClient {
1915
1818
  databaseType: string;
1916
1819
  ruleSetId?: string | null;
1917
1820
  triggers?: Record<string, any> | null;
1918
- /**
1919
- * @deprecated The TOML `type.celContextAccess` expression. Use resource
1920
- * metadata categories instead (#1420, #1815).
1921
- */
1922
- metadataAccess?: string | null;
1923
- defaultAccess?: string | null;
1924
1821
  autoPopulatedFields?: Record<string, any> | null;
1925
1822
  timestamps?: Record<string, any> | null;
1926
1823
  schema?: string | null;
@@ -1931,24 +1828,10 @@ export declare class ApiClient {
1931
1828
  updateDatabaseTypeConfig(appId: string, databaseType: string, data: {
1932
1829
  ruleSetId?: string | null;
1933
1830
  triggers?: Record<string, any> | null;
1934
- /**
1935
- * @deprecated The TOML `type.celContextAccess` expression. Use resource
1936
- * metadata categories instead (#1420, #1815).
1937
- */
1938
- metadataAccess?: string | null;
1939
- defaultAccess?: string | null;
1940
1831
  autoPopulatedFields?: Record<string, any> | null;
1941
1832
  timestamps?: Record<string, any> | null;
1942
1833
  schema?: string | null;
1943
- pendingOpDeletes?: string[];
1944
- finalOpNames?: string[];
1945
1834
  metadataManifest?: any;
1946
- pendingOpUpdates?: Array<{
1947
- name: string;
1948
- access?: string | null;
1949
- params?: Record<string, any> | null;
1950
- }>;
1951
- pendingOpUpserts?: Array<Record<string, any>>;
1952
1835
  }, expectedModifiedAt?: string, options?: {
1953
1836
  dryRun?: boolean;
1954
1837
  acceptWarnings?: boolean;
@@ -1957,49 +1840,13 @@ export declare class ApiClient {
1957
1840
  force?: boolean;
1958
1841
  }): Promise<any>;
1959
1842
  /**
1960
- * Issue #666 Phase 3: ask the server to scaffold a TOML schema from
1961
- * existing ops + DO field introspection. Read-only — does NOT persist.
1843
+ * Issue #666 Phase 3: ask the server to scaffold a TOML schema from the
1844
+ * type's databases (the models each holds, and their fields). Read-only —
1845
+ * does NOT persist.
1962
1846
  */
1963
1847
  scaffoldDatabaseTypeSchema(appId: string, databaseType: string): Promise<{
1964
1848
  schema: string;
1965
1849
  }>;
1966
- listDatabaseTypeOperations(appId: string, databaseType: string): Promise<any[]>;
1967
- getDatabaseTypeOperation(appId: string, databaseType: string, name: string): Promise<any>;
1968
- createDatabaseTypeOperation(appId: string, databaseType: string, data: {
1969
- name: string;
1970
- type: string;
1971
- modelName: string;
1972
- access?: string | null;
1973
- definition: Record<string, any>;
1974
- params?: Record<string, any> | null;
1975
- }, options?: {
1976
- dryRun?: boolean;
1977
- schemaOverride?: string | null;
1978
- defaultAccess?: string | null;
1979
- metadataManifestOverride?: Record<string, any> | null;
1980
- }): Promise<any>;
1981
- updateDatabaseTypeOperation(appId: string, databaseType: string, name: string, data: Record<string, any>, expectedModifiedAt?: string, options?: {
1982
- dryRun?: boolean;
1983
- schemaOverride?: string | null;
1984
- metadataManifestOverride?: Record<string, any> | null;
1985
- }): Promise<any>;
1986
- deleteDatabaseTypeOperation(appId: string, databaseType: string, name: string): Promise<any>;
1987
- listDatabaseTypeSubscriptions(appId: string, databaseType: string): Promise<any[]>;
1988
- getDatabaseTypeSubscription(appId: string, databaseType: string, subscriptionKey: string): Promise<any>;
1989
- createDatabaseTypeSubscription(appId: string, databaseType: string, data: {
1990
- subscriptionKey: string;
1991
- displayName: string;
1992
- modelName: string;
1993
- filter: string;
1994
- access: string;
1995
- description?: string | null;
1996
- select?: string[] | null;
1997
- emit?: string[] | null;
1998
- params?: Record<string, any> | null;
1999
- status?: string;
2000
- }): Promise<any>;
2001
- updateDatabaseTypeSubscription(appId: string, databaseType: string, subscriptionKey: string, data: Record<string, any>, expectedModifiedAt?: string): Promise<any>;
2002
- deleteDatabaseTypeSubscription(appId: string, databaseType: string, subscriptionKey: string): Promise<any>;
2003
1850
  listGroups(appId: string, params?: {
2004
1851
  type?: string;
2005
1852
  limit?: number;
@@ -2226,28 +2073,6 @@ export declare class ApiClient {
2226
2073
  */
2227
2074
  downloadDocumentArtifact(_appId: string, grantedPath: string): Promise<Buffer>;
2228
2075
  importDocumentState(appId: string, documentId: string, stateBase64: string): Promise<any>;
2229
- /**
2230
- * Upload one artifact of a large document's import chain (#2816,
2231
- * behavior 20).
2232
- *
2233
- * The bytes travel raw and unmodified: the manifest's digest is over the
2234
- * STORED bytes, so re-encoding a chunk here would fail its own verification
2235
- * on install. The query says which artifact it is — the server derives the
2236
- * key from the document it belongs to, so nothing here composes one.
2237
- */
2238
- uploadDocumentChainArtifact(appId: string, documentId: string, query: Record<string, string | number>, body: Buffer): Promise<any>;
2239
- /** Start installing an uploaded chain (#2816, behavior 20). */
2240
- installDocumentChain(appId: string, documentId: string, plan: {
2241
- installId?: string;
2242
- base: {
2243
- epoch: number;
2244
- buildId: string;
2245
- } | null;
2246
- overlays: number[];
2247
- currentEpoch: number;
2248
- }): Promise<any>;
2249
- /** How far a document's chain install has got (#2816, behavior 20). */
2250
- getDocumentChainInstall(appId: string, documentId: string): Promise<any>;
2251
2076
  getDocument(appId: string, documentId: string): Promise<any>;
2252
2077
  /**
2253
2078
  * Delete a document and everything hanging off it (#2756). The server route
@@ -2285,14 +2110,14 @@ export declare class ApiClient {
2285
2110
  limit?: number;
2286
2111
  cursor?: string;
2287
2112
  /** #3764 — the format the caller believes this document has. */
2288
- documentFormat?: 1 | 2;
2113
+ documentFormat?: 1 | 3;
2289
2114
  }): Promise<ListEnvelope>;
2290
2115
  /**
2291
2116
  * Count records in a document model (issue #1964 Phase 3). Returns `{ count }`.
2292
2117
  */
2293
2118
  countDocumentRecords(appId: string, documentId: string, modelName: string, queryOptions?: {
2294
2119
  filter?: Record<string, any>;
2295
- documentFormat?: 1 | 2;
2120
+ documentFormat?: 1 | 3;
2296
2121
  }): Promise<{
2297
2122
  count: number;
2298
2123
  }>;
@@ -2314,7 +2139,7 @@ export declare class ApiClient {
2314
2139
  groupBy?: string[];
2315
2140
  filter?: Record<string, any>;
2316
2141
  }, extra?: {
2317
- documentFormat?: 1 | 2;
2142
+ documentFormat?: 1 | 3;
2318
2143
  }): Promise<{
2319
2144
  result: unknown;
2320
2145
  }>;
@@ -2323,6 +2148,17 @@ export declare class ApiClient {
2323
2148
  * record/model/blob counts, approximate size, and last-modified timestamp.
2324
2149
  */
2325
2150
  getDocumentStats(appId: string, documentId: string): Promise<any>;
2151
+ /**
2152
+ * A record-log document's room (#4306): `GET documents/:id/room` →
2153
+ * `{ ok, appId, documentId, documentFormat, room }`, `room` null for a
2154
+ * format that has no record room. With `refused` (#4310), the answer also
2155
+ * carries a page of that bulk load's refused rows. App admins only.
2156
+ */
2157
+ getDocumentRoom(appId: string, documentId: string, query?: {
2158
+ refused?: string;
2159
+ limit?: number;
2160
+ cursor?: string;
2161
+ }): Promise<any>;
2326
2162
  /**
2327
2163
  * A large document's snapshot builds, newest first, one page (#3432).
2328
2164
  * `GET documents/:id/snapshots` → `{ items, hasMore, nextCursor? }`.
@@ -2352,8 +2188,16 @@ export declare class ApiClient {
2352
2188
  }>;
2353
2189
  /** One bulk-load session's status (#3434). */
2354
2190
  getDocumentIngest(appId: string, documentId: string, sessionId: string): Promise<any>;
2355
- /** Open a bulk-load session on a large document (#3435, criterion 9). */
2356
- createDocumentIngest(appId: string, documentId: string): Promise<any>;
2191
+ /**
2192
+ * Open a bulk-load session on a large document (#3435, criterion 9). A
2193
+ * record-log (format 3) document's load takes `reserveEpoch`, `mode` and a
2194
+ * refresh's `models` (#4310); `{}` keeps every format's defaults.
2195
+ */
2196
+ createDocumentIngest(appId: string, documentId: string, options?: {
2197
+ reserveEpoch?: "open" | "commit";
2198
+ mode?: "merge" | "refresh";
2199
+ models?: string[];
2200
+ }): Promise<any>;
2357
2201
  /**
2358
2202
  * Upload one chunk of a bulk-load session's artifact (#3435).
2359
2203
  *
@@ -2399,7 +2243,7 @@ export declare class ApiClient {
2399
2243
  data: Record<string, unknown>;
2400
2244
  options?: Record<string, unknown>;
2401
2245
  }, extra?: {
2402
- documentFormat?: 1 | 2;
2246
+ documentFormat?: 1 | 3;
2403
2247
  }): Promise<{
2404
2248
  record: unknown;
2405
2249
  }>;
@@ -2412,7 +2256,7 @@ export declare class ApiClient {
2412
2256
  data: Record<string, unknown>;
2413
2257
  options?: Record<string, unknown>;
2414
2258
  }, extra?: {
2415
- documentFormat?: 1 | 2;
2259
+ documentFormat?: 1 | 3;
2416
2260
  }): Promise<{
2417
2261
  record: unknown;
2418
2262
  }>;
@@ -2422,7 +2266,7 @@ export declare class ApiClient {
2422
2266
  * a silent no-op per the facade contract. Returns `{ deleted: true }`.
2423
2267
  */
2424
2268
  deleteDocumentRecord(appId: string, documentId: string, modelName: string, recordId: string, extra?: {
2425
- documentFormat?: 1 | 2;
2269
+ documentFormat?: 1 | 3;
2426
2270
  }): Promise<{
2427
2271
  deleted: boolean;
2428
2272
  }>;
@@ -2433,7 +2277,7 @@ export declare class ApiClient {
2433
2277
  * `{ applied, added, updated, deleted }`.
2434
2278
  */
2435
2279
  bulkDocumentRecords(appId: string, documentId: string, operations: Array<Record<string, unknown>>, extra?: {
2436
- documentFormat?: 1 | 2;
2280
+ documentFormat?: 1 | 3;
2437
2281
  }): Promise<{
2438
2282
  applied: number;
2439
2283
  added: Array<{
@@ -2457,7 +2301,7 @@ export declare class ApiClient {
2457
2301
  documentId?: string;
2458
2302
  tags?: string[];
2459
2303
  createdBy?: string;
2460
- documentFormat?: 1 | 2;
2304
+ documentFormat?: 1 | 3;
2461
2305
  }): Promise<any>;
2462
2306
  listDocumentPermissions(appId: string, documentId: string): Promise<any[]>;
2463
2307
  grantDocumentPermission(appId: string, documentId: string, permissions: Array<{