primitive-admin 1.2.0-alpha.4 → 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 (114) hide show
  1. package/assets/skill/skills/primitive-platform/SKILL.md +17 -0
  2. package/dist/src/commands/auth.js +7 -4
  3. package/dist/src/commands/auth.js.map +1 -1
  4. package/dist/src/commands/connections.js +11 -12
  5. package/dist/src/commands/connections.js.map +1 -1
  6. package/dist/src/commands/database-type-configs.js +2 -76
  7. package/dist/src/commands/database-type-configs.js.map +1 -1
  8. package/dist/src/commands/database-types.js +313 -13
  9. package/dist/src/commands/database-types.js.map +1 -1
  10. package/dist/src/commands/databases.d.ts +9 -0
  11. package/dist/src/commands/databases.js +67 -367
  12. package/dist/src/commands/databases.js.map +1 -1
  13. package/dist/src/commands/documents.d.ts +32 -2
  14. package/dist/src/commands/documents.js +281 -685
  15. package/dist/src/commands/documents.js.map +1 -1
  16. package/dist/src/commands/functions.js +2 -2
  17. package/dist/src/commands/functions.js.map +1 -1
  18. package/dist/src/commands/llm.js +6 -9
  19. package/dist/src/commands/llm.js.map +1 -1
  20. package/dist/src/commands/settings.d.ts +9 -12
  21. package/dist/src/commands/settings.js +79 -31
  22. package/dist/src/commands/settings.js.map +1 -1
  23. package/dist/src/commands/sync.d.ts +31 -81
  24. package/dist/src/commands/sync.js +228 -1113
  25. package/dist/src/commands/sync.js.map +1 -1
  26. package/dist/src/lib/api-client.d.ts +30 -199
  27. package/dist/src/lib/api-client.js +31 -297
  28. package/dist/src/lib/api-client.js.map +1 -1
  29. package/dist/src/lib/codegen-shared/generatedFiles.d.ts +6 -7
  30. package/dist/src/lib/codegen-shared/generatedFiles.js +2 -2
  31. package/dist/src/lib/codegen-shared/generatedFiles.js.map +1 -1
  32. package/dist/src/lib/codegen-shared/prettierStable.d.ts +1 -1
  33. package/dist/src/lib/codegen-shared/prettierStable.js +1 -1
  34. package/dist/src/lib/codegen-shared/resolveCodegenSourceDir.d.ts +2 -2
  35. package/dist/src/lib/codegen-shared/resolveCodegenSourceDir.js +2 -2
  36. package/dist/src/lib/config-object-descriptor.js +1 -5
  37. package/dist/src/lib/config-object-descriptor.js.map +1 -1
  38. package/dist/src/lib/config-surface.d.ts +2 -1
  39. package/dist/src/lib/config-surface.js +4 -1
  40. package/dist/src/lib/config-surface.js.map +1 -1
  41. package/dist/src/lib/connections-list.d.ts +10 -0
  42. package/dist/src/lib/connections-list.js +18 -0
  43. package/dist/src/lib/connections-list.js.map +1 -0
  44. package/dist/src/lib/csv.d.ts +8 -9
  45. package/dist/src/lib/csv.js +3 -4
  46. package/dist/src/lib/csv.js.map +1 -1
  47. package/dist/src/lib/db-codegen/dbNaming.d.ts +2 -1
  48. package/dist/src/lib/db-codegen/dbNaming.js +2 -1
  49. package/dist/src/lib/db-codegen/dbNaming.js.map +1 -1
  50. package/dist/src/lib/db-codegen/dbTsTypes.d.ts +2 -2
  51. package/dist/src/lib/db-codegen/dbTsTypes.js +2 -2
  52. package/dist/src/lib/db-codegen/dbTypeIR.d.ts +59 -1
  53. package/dist/src/lib/db-codegen/dbTypeIR.js +12 -1
  54. package/dist/src/lib/db-codegen/dbTypeIR.js.map +1 -1
  55. package/dist/src/lib/document-export-record-log.d.ts +57 -0
  56. package/dist/src/lib/document-export-record-log.js +215 -0
  57. package/dist/src/lib/document-export-record-log.js.map +1 -0
  58. package/dist/src/lib/document-ingest-artifact.d.ts +13 -2
  59. package/dist/src/lib/document-ingest-artifact.js +7 -3
  60. package/dist/src/lib/document-ingest-artifact.js.map +1 -1
  61. package/dist/src/lib/document-ingest-rows.d.ts +16 -0
  62. package/dist/src/lib/document-ingest-rows.js +17 -0
  63. package/dist/src/lib/document-ingest-rows.js.map +1 -1
  64. package/dist/src/lib/document-ingest.d.ts +22 -0
  65. package/dist/src/lib/document-ingest.js +33 -0
  66. package/dist/src/lib/document-ingest.js.map +1 -1
  67. package/dist/src/lib/function-triggers.d.ts +3 -15
  68. package/dist/src/lib/function-triggers.js +10 -72
  69. package/dist/src/lib/function-triggers.js.map +1 -1
  70. package/dist/src/lib/generated-allowlist.js +0 -20
  71. package/dist/src/lib/generated-allowlist.js.map +1 -1
  72. package/dist/src/lib/generated-config-surfaces.d.ts +40 -2
  73. package/dist/src/lib/generated-config-surfaces.js +160 -94
  74. package/dist/src/lib/generated-config-surfaces.js.map +1 -1
  75. package/dist/src/lib/generated-sdk-types.d.ts +1 -1
  76. package/dist/src/lib/generated-sdk-types.js +1 -1
  77. package/dist/src/lib/generated-sdk-types.js.map +1 -1
  78. package/dist/src/lib/login-scope-lines.d.ts +15 -0
  79. package/dist/src/lib/login-scope-lines.js +22 -0
  80. package/dist/src/lib/login-scope-lines.js.map +1 -0
  81. package/dist/src/lib/paginate.d.ts +0 -5
  82. package/dist/src/lib/paginate.js +0 -5
  83. package/dist/src/lib/paginate.js.map +1 -1
  84. package/dist/src/lib/refresh-admin-credentials.d.ts +7 -0
  85. package/dist/src/lib/refresh-admin-credentials.js +16 -4
  86. package/dist/src/lib/refresh-admin-credentials.js.map +1 -1
  87. package/dist/src/lib/root-import-decision.d.ts +15 -14
  88. package/dist/src/lib/root-import-decision.js +44 -51
  89. package/dist/src/lib/root-import-decision.js.map +1 -1
  90. package/dist/src/lib/snapshot-build-rows.d.ts +21 -0
  91. package/dist/src/lib/snapshot-build-rows.js +22 -0
  92. package/dist/src/lib/snapshot-build-rows.js.map +1 -1
  93. package/dist/src/lib/snapshot-build.js +8 -3
  94. package/dist/src/lib/snapshot-build.js.map +1 -1
  95. package/dist/src/lib/swift-codegen/banners.d.ts +34 -7
  96. package/dist/src/lib/swift-codegen/banners.js +37 -7
  97. package/dist/src/lib/swift-codegen/banners.js.map +1 -1
  98. package/dist/src/lib/swift-codegen/functionGenerator.d.ts +3 -3
  99. package/dist/src/lib/swift-codegen/functionGenerator.js +22 -17
  100. package/dist/src/lib/swift-codegen/functionGenerator.js.map +1 -1
  101. package/dist/src/lib/swift-codegen/generator.js +27 -27
  102. package/dist/src/lib/swift-codegen/generator.js.map +1 -1
  103. package/dist/src/lib/toml-database-config.d.ts +14 -75
  104. package/dist/src/lib/toml-database-config.js +14 -305
  105. package/dist/src/lib/toml-database-config.js.map +1 -1
  106. package/dist/src/lib/workflow-toml-validator.js +15 -1
  107. package/dist/src/lib/workflow-toml-validator.js.map +1 -1
  108. package/package.json +3 -5
  109. package/dist/src/lib/generated-workflow-model-fields.d.ts +0 -20
  110. package/dist/src/lib/generated-workflow-model-fields.js +0 -53
  111. package/dist/src/lib/generated-workflow-model-fields.js.map +0 -1
  112. package/dist/src/lib/workflow-field-descriptor.d.ts +0 -91
  113. package/dist/src/lib/workflow-field-descriptor.js +0 -153
  114. package/dist/src/lib/workflow-field-descriptor.js.map +0 -1
@@ -1,7 +1,5 @@
1
1
  import { Command } from "commander";
2
2
  import { ApiClient } from "../lib/api-client.js";
3
- import { type OperationFormHints } from "../lib/toml-database-config.js";
4
- import { type FieldForm } from "../lib/toml-native-form.js";
5
3
  import { type PullWriteTally } from "../lib/pull-write.js";
6
4
  import { type PushMode } from "../lib/config-payload.js";
7
5
  import { type ConfigObjectSurface, type ConfigTable } from "../lib/generated-config-surfaces.js";
@@ -760,23 +758,26 @@ export declare function promptConfigPayload(tomlConfig: any, options?: {
760
758
  export declare function buildBlobBucketCreatePayload(key: string, bucket: any): Record<string, any>;
761
759
  export declare function serializePrompt(prompt: any, logger?: (message: string) => void): string;
762
760
  /**
763
- * The `config push` warning for a resource pushed with no `accessRule` (#2652).
761
+ * The `config push` warning for a caller workflow pushed with no `accessRule`
762
+ * (#2652).
764
763
  *
765
764
  * Returns `null` when a rule is declared — and for a `runAs = "system"`
766
765
  * workflow, which rejects any rule and cannot be started by a member at all.
767
- * Otherwise it names the resource, the consequence, and the one-line restore,
768
- * because after the #2652 flip a ruleless prompt or caller workflow denies
769
- * every non-admin caller from the deploy onward.
766
+ * Otherwise it names the workflow, the consequence, and the one-line restore,
767
+ * because after the #2652 flip a ruleless caller workflow denies every
768
+ * non-admin caller from the deploy onward.
770
769
  *
771
- * Both kinds now push `accessRule` as value-or-`null` — the prompt since #1567,
772
- * the workflow since #2743's always-send conversion — so for either one an
773
- * omitted key really does leave the resource ruleless on the server. The
774
- * workflow wording says so explicitly, because it used to say the opposite
775
- * (the update path preserved a stored rule) and an operator who learned that
776
- * caveat needs to see it retracted.
770
+ * A prompt gets no warning (#4368): a server function runs it on its
771
+ * `prompt:<key>` grant, which never consults the rule, so a ruleless prompt is
772
+ * the ordinary case, not a lockout.
773
+ *
774
+ * The workflow pushes `accessRule` as value-or-`null` since #2743's
775
+ * always-send conversion, so an omitted key really does leave it ruleless on
776
+ * the server. The wording says so explicitly, because it used to say the
777
+ * opposite (the update path preserved a stored rule) and an operator who
778
+ * learned that caveat needs to see it retracted.
777
779
  */
778
780
  export declare function missingAccessRuleWarning(opts: {
779
- kind: "prompt" | "workflow";
780
781
  key: string;
781
782
  accessRule: unknown;
782
783
  runAs?: unknown;
@@ -1012,6 +1013,21 @@ export declare function partitionPromptFilesForPush(promptsDir: string, files: r
1012
1013
  beforeFunctions: string[];
1013
1014
  afterFunctions: string[];
1014
1015
  };
1016
+ /**
1017
+ * The deferred agent files `config push` can still apply — #4437. An agent
1018
+ * that names a function this push failed to apply, and that the server does
1019
+ * not already hold, would only be refused as naming a function the app does
1020
+ * not have. It is held back instead, with a failure that names the function as
1021
+ * the cause; the function's own failure row says why. A file that does not
1022
+ * parse is left for the prompt leg to report.
1023
+ */
1024
+ export declare function holdAgentPromptFilesForUnappliedFunctions(promptsDir: string, files: readonly string[], unappliedFunctionKeys: ReadonlySet<string>): {
1025
+ apply: string[];
1026
+ held: Array<{
1027
+ key: string;
1028
+ message: string;
1029
+ }>;
1030
+ };
1015
1031
  /**
1016
1032
  * Every `prompts/<key>.tests/*.toml` sidecar the agent test case's rule
1017
1033
  * refuses — #4262 (#3798 refused every sidecar on an agent). An agent's case
@@ -1176,15 +1192,9 @@ export declare function workflowPushSendsUpdate(configDir: string, key: string,
1176
1192
  export declare function documentSchemaPreflightError(resolution: DocumentSchemaResolution): string | null;
1177
1193
  export declare function workflowUpdateNameError(filePath: string, workflow: any): string | null;
1178
1194
  export declare function serializeWorkflow(workflow: any, draft: any, configs: any[], logger?: (message: string) => void): string;
1179
- export declare function serializeDatabaseType(typeConfig: any, operations: any[], ruleSetIdToName: Map<string, string>, options?: {
1180
- /** Per-op form hints derived from the existing file. */
1181
- hints?: OperationFormHints;
1182
- /** Default form for ops with no hint. New files → "native". */
1183
- defaultForm?: FieldForm;
1184
- /** Sink for human-readable fallback messages (logged via `info`). */
1195
+ export declare function serializeDatabaseType(typeConfig: any, ruleSetIdToName: Map<string, string>, options?: {
1196
+ /** Sink for human-readable messages (logged via `info`). */
1185
1197
  logger?: (message: string) => void;
1186
- /** Server subscription rows to emit as `[[subscriptions]]` (issue #803). */
1187
- subscriptions?: any[];
1188
1198
  }): string;
1189
1199
  /**
1190
1200
  * Flatten an email-template detail response onto its field surface.
@@ -1291,46 +1301,8 @@ export declare function buildOwnedScalarUpdate(typeConfig: any): Record<string,
1291
1301
  * GET; without it (fresh type or a failed fetch) nothing is reported cleared.
1292
1302
  */
1293
1303
  export declare function ownedScalarsBeingCleared(updateData: Record<string, any>, serverConfig: any): string[];
1294
- /** The look-ahead a type-config PATCH carries about this push's operations. */
1295
- export interface PendingOpClaims {
1296
- pendingOpDeletes: string[];
1297
- finalOpNames: string[];
1298
- pendingOpUpdates: Array<{
1299
- name: string;
1300
- access: string | null;
1301
- params: any;
1302
- }>;
1303
- pendingOpUpserts: Array<Record<string, any>>;
1304
- }
1305
- /**
1306
- * What this push's operation set will BE, stated to the server (issues #813,
1307
- * #1336, #2732).
1308
- *
1309
- * The type-config PATCH runs its gates BEFORE the same push's operation calls,
1310
- * so without a look-ahead every gate judges the pre-push operations: a push
1311
- * that removes a model is blocked by the very references it is deleting. The
1312
- * file IS the target state (config-as-code), so the claims are derived from it:
1313
- *
1314
- * - `finalOpNames` — the names the type ends with. Both other claims are
1315
- * verified against it server-side, which is what keeps them from being a
1316
- * gate bypass for a direct-API caller.
1317
- * - `pendingOpDeletes` — its complement among the ops last sync recorded, so
1318
- * an op this push deletes is excluded from the schema / OPS_EXIST gates.
1319
- * - `pendingOpUpserts` — the post-push BODY of every declared op, so the
1320
- * schema-edit gate lints a rewritten op as rewritten and a model removal
1321
- * plus its operation rewrites lands in one push (#2732).
1322
- * - `pendingOpUpdates` — the rule-only form (`access`/`params`) the manifest
1323
- * re-lint reads (#1336).
1324
- *
1325
- * All four are built here and sent together, on the dry-run and on the real
1326
- * PATCH alike. They are never conditioned on the push having a deletion: a push
1327
- * that only REWRITES operations is exactly the case #2732 exists for.
1328
- */
1329
- export declare function buildPendingOpClaims(operations: any[], existingOpNames: string[]): PendingOpClaims;
1330
1304
  export declare function parseDatabaseTypeToml(tomlData: any): {
1331
1305
  typeConfig: any;
1332
- operations: any[];
1333
- subscriptions: any[];
1334
1306
  };
1335
1307
  /**
1336
1308
  * The parsed shape of a rule-set TOML: the definition's fields plus the
@@ -1826,28 +1798,6 @@ export declare function resolveExistingId(input: {
1826
1798
  liveId?: string;
1827
1799
  manifestId?: string;
1828
1800
  }): string | undefined;
1829
- /**
1830
- * Which CHILD rows a database type's push reconciles against (#2731 B3).
1831
- *
1832
- * `resolveExistingId` answers this for a whole entity; a database type's
1833
- * operations and subscriptions are rows with the same question and the same
1834
- * two possible answers. The manifest can name an operation the server no
1835
- * longer has (the update PUTs a row that is gone) and be silent about one it
1836
- * does have (the create POSTs a duplicate key) — both abort the push with a
1837
- * server error, which is exactly the recovery `--force` is supposed to
1838
- * perform.
1839
- *
1840
- * When the reconcile read the rows, they ARE the baseline: existence, the
1841
- * timestamp each update guards with, and — as the complement of the file's own
1842
- * list — which rows this push deletes. `undefined` means the read did not
1843
- * happen (the degraded path, or a type live state says is absent), and the
1844
- * manifest stays what it has always been.
1845
- */
1846
- export declare function liveChildBaseline(live: Map<string, any> | undefined, manifestChildren?: Record<string, {
1847
- modifiedAt: string;
1848
- }>): Record<string, {
1849
- modifiedAt: string;
1850
- }> | undefined;
1851
1801
  /**
1852
1802
  * The app's live rule sets, indexed the three ways push reads them (#2731 B3).
1853
1803
  *