primitive-admin 1.1.0 → 1.2.0-alpha.0

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 (62) hide show
  1. package/README.md +11 -11
  2. package/assets/skill/skills/primitive-platform/SKILL.md +6 -0
  3. package/dist/src/commands/collections.js +20 -17
  4. package/dist/src/commands/collections.js.map +1 -1
  5. package/dist/src/commands/database-types.js +13 -313
  6. package/dist/src/commands/database-types.js.map +1 -1
  7. package/dist/src/commands/databases.js +0 -19
  8. package/dist/src/commands/databases.js.map +1 -1
  9. package/dist/src/commands/groups.js +16 -0
  10. package/dist/src/commands/groups.js.map +1 -1
  11. package/dist/src/commands/llm.js +9 -6
  12. package/dist/src/commands/llm.js.map +1 -1
  13. package/dist/src/commands/settings.d.ts +18 -0
  14. package/dist/src/commands/settings.js +54 -0
  15. package/dist/src/commands/settings.js.map +1 -0
  16. package/dist/src/commands/sync.d.ts +1 -4
  17. package/dist/src/commands/sync.js +42 -45
  18. package/dist/src/commands/sync.js.map +1 -1
  19. package/dist/src/commands/workflows.js +3 -3
  20. package/dist/src/commands/workflows.js.map +1 -1
  21. package/dist/src/lib/api-client.d.ts +3 -40
  22. package/dist/src/lib/api-client.js +20 -69
  23. package/dist/src/lib/api-client.js.map +1 -1
  24. package/dist/src/lib/app-match-guard.d.ts +44 -0
  25. package/dist/src/lib/app-match-guard.js +72 -0
  26. package/dist/src/lib/app-match-guard.js.map +1 -0
  27. package/dist/src/lib/collection-export.d.ts +37 -9
  28. package/dist/src/lib/collection-export.js +48 -12
  29. package/dist/src/lib/collection-export.js.map +1 -1
  30. package/dist/src/lib/function-triggers.d.ts +66 -0
  31. package/dist/src/lib/function-triggers.js +285 -0
  32. package/dist/src/lib/function-triggers.js.map +1 -0
  33. package/dist/src/lib/generated-allowlist.js +0 -1
  34. package/dist/src/lib/generated-allowlist.js.map +1 -1
  35. package/dist/src/lib/generated-config-surfaces.js +56 -32
  36. package/dist/src/lib/generated-config-surfaces.js.map +1 -1
  37. package/dist/src/lib/generated-sdk-types.d.ts +1 -1
  38. package/dist/src/lib/generated-sdk-types.js +1 -1
  39. package/dist/src/lib/generated-sdk-types.js.map +1 -1
  40. package/dist/src/lib/generated-workflow-model-fields.d.ts +20 -0
  41. package/dist/src/lib/generated-workflow-model-fields.js +53 -0
  42. package/dist/src/lib/generated-workflow-model-fields.js.map +1 -0
  43. package/dist/src/lib/google-client-secret-status.d.ts +35 -0
  44. package/dist/src/lib/google-client-secret-status.js +56 -0
  45. package/dist/src/lib/google-client-secret-status.js.map +1 -0
  46. package/dist/src/lib/log-inspection.d.ts +1 -6
  47. package/dist/src/lib/log-inspection.js +5 -7
  48. package/dist/src/lib/log-inspection.js.map +1 -1
  49. package/dist/src/lib/migration-nag.d.ts +2 -2
  50. package/dist/src/lib/migration-nag.js +4 -3
  51. package/dist/src/lib/migration-nag.js.map +1 -1
  52. package/dist/src/lib/paginate.d.ts +8 -24
  53. package/dist/src/lib/paginate.js +8 -21
  54. package/dist/src/lib/paginate.js.map +1 -1
  55. package/dist/src/lib/sync-dir-selector.d.ts +1 -1
  56. package/dist/src/lib/sync-dir-selector.js +1 -1
  57. package/dist/src/lib/toml-database-config.js +2 -2
  58. package/dist/src/lib/toml-database-config.js.map +1 -1
  59. package/dist/src/lib/workflow-field-descriptor.d.ts +91 -0
  60. package/dist/src/lib/workflow-field-descriptor.js +153 -0
  61. package/dist/src/lib/workflow-field-descriptor.js.map +1 -0
  62. package/package.json +2 -2
@@ -2265,6 +2265,23 @@ export function unknownRequestKeysMessage(keys) {
2265
2265
  `${keys.join(", ")}. This endpoint rejects keys it does not accept rather ` +
2266
2266
  "than ignoring them.");
2267
2267
  }
2268
+ // #3997 — the three type configs author their rule-set reference by name
2269
+ // (#2644): an id names a row in one app and resolves to nothing in another, so
2270
+ // a copied file failed instead of resolving. One sentence serves all three
2271
+ // tables. The `request` half is never surfaced: `ruleSetId` is the live body key
2272
+ // on all three routes, and both `rememberRetiredKeys` (`request-schema.ts`) and
2273
+ // the admin API's unknown-key path skip a key the schema accepts. It exists
2274
+ // because the interface requires both halves.
2275
+ const RULE_SET_ID_RETIRED = {
2276
+ toml: "`ruleSetId` is no longer authored in TOML (#3997). A rule-set id names " +
2277
+ "a row in one app and resolves to nothing in another, so the reference " +
2278
+ 'is authored by name: replace this line with `ruleSetName = "<name>"`, ' +
2279
+ "where the name is the `name` the rule set's own `rule-sets/<key>.toml` " +
2280
+ "declares, and push again. A file pulled since #2644 already spells it " +
2281
+ "that way.",
2282
+ request: "`ruleSetId` is the live request key on this surface; only its TOML " +
2283
+ "spelling is retired (#3997). Send the rule set's id.",
2284
+ };
2268
2285
  export const RETIRED_CONFIG_KEYS = {
2269
2286
  // #2891 — the app-settings auth surface was reshaped so that `app.toml` can
2270
2287
  // state what the server holds. All five keys below stay DECLARED in
@@ -2381,6 +2398,12 @@ export const RETIRED_CONFIG_KEYS = {
2381
2398
  "`primitive cron-triggers archive` to retire the trigger (#2907).",
2382
2399
  },
2383
2400
  },
2401
+ // #3997 — keyed by each table's TOML prefix. Only `database-type-config`
2402
+ // uses `[type]`, so that entry cannot reach another surface; the blob
2403
+ // bucket's `[bucket] ruleSetId` is its live key and is not listed.
2404
+ type: { ruleSetId: RULE_SET_ID_RETIRED },
2405
+ groupTypeConfig: { ruleSetId: RULE_SET_ID_RETIRED },
2406
+ collectionTypeConfig: { ruleSetId: RULE_SET_ID_RETIRED },
2384
2407
  // #2803 — the OBJECT-level availability leaves TOML. The per-version
2385
2408
  // `[[configs]] status` (`active | archived`) is a different question — which
2386
2409
  // named config is retired — and stays authorable.
@@ -2396,6 +2419,26 @@ export const RETIRED_CONFIG_KEYS = {
2396
2419
  "`primitive prompts archive` to retire the prompt (#2907).",
2397
2420
  },
2398
2421
  },
2422
+ // #3999 — the prompt `[[configs]]` table (its TOML path is `configs`; no
2423
+ // other field table has that path — the workflow file's `[[configs]]` is a
2424
+ // document key with its own retired list). The live-config marker has one
2425
+ // spelling since #2645, `active`. The legacy `isActive` is refused rather
2426
+ // than ignored: a file whose only marker it is would otherwise push without
2427
+ // activating anything and leave a different config live.
2428
+ configs: {
2429
+ isActive: {
2430
+ toml: "`isActive` is no longer accepted on a `[[configs]]` entry (#3999). " +
2431
+ "The live-config marker has one spelling since #2645: write " +
2432
+ "`active = true` on exactly one entry (pull writes it there), delete " +
2433
+ "the `isActive` line and push again. The line is refused rather than " +
2434
+ "ignored because a file that still carries it would otherwise leave a " +
2435
+ "different config live.",
2436
+ request: "`isActive` is not a config-body key (#3999). Which config a prompt " +
2437
+ "runs is set through " +
2438
+ "`POST …/prompts/{promptId}/configs/{configId}/activate`; omit the " +
2439
+ "field.",
2440
+ },
2441
+ },
2399
2442
  integration: {
2400
2443
  status: {
2401
2444
  toml: "`status` is no longer authored in TOML (#2803), and `draft` no longer " +
@@ -7335,20 +7378,13 @@ export const PROMPT_SURFACE = {
7335
7378
  // carry `active = true`; pull writes it on the active entry and push
7336
7379
  // honors it on create AND update by calling the activate endpoint
7337
7380
  // (activatePromptConfig). It is a control, never a key in the config
7338
- // body.
7381
+ // body. It has one spelling (#3999, `retired-keys.ts`).
7339
7382
  active: {
7340
7383
  kind: "structural",
7341
7384
  note: "Which config the prompt runs (#2645). Pull writes it on the " +
7342
7385
  "active entry; push enacts it through the activate endpoint " +
7343
7386
  "(activatePromptConfig), never as a config-body key.",
7344
7387
  },
7345
- isActive: {
7346
- kind: "structural",
7347
- note: "Legacy spelling of `active` — the create leg read it before pull " +
7348
- "ever wrote a marker. Declared here so the unrecognized-key " +
7349
- "rejection does not fail a file that has always used it; pull " +
7350
- "never writes it.",
7351
- },
7352
7388
  // #3626 §4 — the nine chat keys in their pre-kind FLAT spelling.
7353
7389
  ...DEPRECATED_FLAT_CHAT_KEYS,
7354
7390
  },
@@ -8517,7 +8553,8 @@ export const DATABASE_TYPE_SURFACE = {
8517
8553
  emit: "always",
8518
8554
  writableOn: BOTH,
8519
8555
  // Authored as a portable name and sent as an id; the server checks
8520
- // the set exists and has `resourceType: "database"`.
8556
+ // the set exists and has `resourceType: "database"`. The id
8557
+ // spelling is retired in TOML (#3997): `retired-keys.ts`, `type`.
8521
8558
  validation: handledBy(DB_TYPE_HANDLER, "DatabaseTypeConfigController", "apply"),
8522
8559
  },
8523
8560
  {
@@ -8604,11 +8641,6 @@ export const DATABASE_TYPE_SURFACE = {
8604
8641
  },
8605
8642
  },
8606
8643
  tomlOnlyKeys: {
8607
- ruleSetId: {
8608
- kind: "deprecated",
8609
- note: "The legacy id-based rule-set reference. Still accepted on push " +
8610
- "so an unmigrated file pushes unchanged; pull writes `ruleSetName`.",
8611
- },
8612
8644
  metadataAccess: {
8613
8645
  kind: "deprecated",
8614
8646
  note: "The legacy spelling of `celContextAccess`. Read on push when the " +
@@ -8785,8 +8817,8 @@ export const RULE_SET_SURFACE = {
8785
8817
  * `ruleSetName`, because a name is portable across apps and an id is not. The
8786
8818
  * name → id resolution is the CLI's (`config push` resolves against the app's
8787
8819
  * rule sets); the server validates that the id exists and has
8788
- * `resourceType: "group"`. The legacy id spelling stays accepted on push and is
8789
- * declared in `tomlOnlyKeys`.
8820
+ * `resourceType: "group"`. The id spelling is refused on push (#3997), with
8821
+ * the guidance in `retired-keys.ts`.
8790
8822
  */
8791
8823
  const GROUP_TYPE_HANDLER = "src/app-api/controllers/group-type-config-controller.ts";
8792
8824
  export const GROUP_TYPE_CONFIG_SURFACE = {
@@ -8815,7 +8847,9 @@ export const GROUP_TYPE_CONFIG_SURFACE = {
8815
8847
  emit: "always",
8816
8848
  writableOn: BOTH,
8817
8849
  // Authored as a name, sent as an id; existence and resourceType are
8818
- // checked server-side, and an empty value clears the reference.
8850
+ // checked server-side, and an empty value clears the reference. The
8851
+ // id spelling is retired in TOML (#3997): `retired-keys.ts`,
8852
+ // `groupTypeConfig`.
8819
8853
  validation: handledBy(GROUP_TYPE_HANDLER, "GroupTypeConfigController", "apply"),
8820
8854
  },
8821
8855
  {
@@ -8855,13 +8889,7 @@ export const GROUP_TYPE_CONFIG_SURFACE = {
8855
8889
  note: "User who created the config; assigned server-side.",
8856
8890
  },
8857
8891
  },
8858
- tomlOnlyKeys: {
8859
- ruleSetId: {
8860
- kind: "deprecated",
8861
- note: "The legacy id-based rule-set reference. Still accepted on push " +
8862
- "so an unmigrated file pushes unchanged; pull writes `ruleSetName`.",
8863
- },
8864
- },
8892
+ tomlOnlyKeys: {},
8865
8893
  responseOnlyKeys: {},
8866
8894
  },
8867
8895
  ],
@@ -8908,7 +8936,9 @@ export const COLLECTION_TYPE_CONFIG_SURFACE = {
8908
8936
  emit: "always",
8909
8937
  writableOn: BOTH,
8910
8938
  // Authored as a name, sent as an id; existence and resourceType are
8911
- // checked server-side, and an empty value clears the reference.
8939
+ // checked server-side, and an empty value clears the reference. The
8940
+ // id spelling is retired in TOML (#3997): `retired-keys.ts`,
8941
+ // `collectionTypeConfig`.
8912
8942
  validation: handledBy(COLLECTION_TYPE_HANDLER, "CollectionTypeConfigController", "apply"),
8913
8943
  },
8914
8944
  ],
@@ -8938,13 +8968,7 @@ export const COLLECTION_TYPE_CONFIG_SURFACE = {
8938
8968
  note: "User who created the config; assigned server-side.",
8939
8969
  },
8940
8970
  },
8941
- tomlOnlyKeys: {
8942
- ruleSetId: {
8943
- kind: "deprecated",
8944
- note: "The legacy id-based rule-set reference. Still accepted on push " +
8945
- "so an unmigrated file pushes unchanged; pull writes `ruleSetName`.",
8946
- },
8947
- },
8971
+ tomlOnlyKeys: {},
8948
8972
  responseOnlyKeys: {},
8949
8973
  },
8950
8974
  ],