primitive-admin 1.1.0-alpha.73 → 1.1.0-alpha.75

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 (150) hide show
  1. package/README.md +18 -25
  2. package/assets/skill/skills/primitive-platform/SKILL.md +30 -14
  3. package/dist/bin/primitive.js +25 -21
  4. package/dist/bin/primitive.js.map +1 -1
  5. package/dist/src/commands/analytics.js +117 -2
  6. package/dist/src/commands/analytics.js.map +1 -1
  7. package/dist/src/commands/auth.js +13 -107
  8. package/dist/src/commands/auth.js.map +1 -1
  9. package/dist/src/commands/collection-type-configs.js +1 -1
  10. package/dist/src/commands/collection-type-configs.js.map +1 -1
  11. package/dist/src/commands/config.js +8 -4
  12. package/dist/src/commands/config.js.map +1 -1
  13. package/dist/src/commands/database-type-configs.js +1 -1
  14. package/dist/src/commands/database-type-configs.js.map +1 -1
  15. package/dist/src/commands/databases.js +25 -31
  16. package/dist/src/commands/databases.js.map +1 -1
  17. package/dist/src/commands/documents.js +758 -53
  18. package/dist/src/commands/documents.js.map +1 -1
  19. package/dist/src/commands/env.d.ts +1 -1
  20. package/dist/src/commands/env.js +57 -16
  21. package/dist/src/commands/env.js.map +1 -1
  22. package/dist/src/commands/functions.d.ts +20 -0
  23. package/dist/src/commands/functions.js +463 -0
  24. package/dist/src/commands/functions.js.map +1 -0
  25. package/dist/src/commands/groups.js +1 -1
  26. package/dist/src/commands/groups.js.map +1 -1
  27. package/dist/src/commands/init.d.ts +12 -15
  28. package/dist/src/commands/init.js +38 -92
  29. package/dist/src/commands/init.js.map +1 -1
  30. package/dist/src/commands/integrations.js +5 -3
  31. package/dist/src/commands/integrations.js.map +1 -1
  32. package/dist/src/commands/prompts.js +5 -7
  33. package/dist/src/commands/prompts.js.map +1 -1
  34. package/dist/src/commands/rule-sets.js +1 -1
  35. package/dist/src/commands/rule-sets.js.map +1 -1
  36. package/dist/src/commands/scripts.js +23 -11
  37. package/dist/src/commands/scripts.js.map +1 -1
  38. package/dist/src/commands/sync-app-settings.js +2 -4
  39. package/dist/src/commands/sync-app-settings.js.map +1 -1
  40. package/dist/src/commands/sync.d.ts +65 -2
  41. package/dist/src/commands/sync.js +867 -21
  42. package/dist/src/commands/sync.js.map +1 -1
  43. package/dist/src/commands/workflows.js +6 -8
  44. package/dist/src/commands/workflows.js.map +1 -1
  45. package/dist/src/lib/api-client.d.ts +163 -2
  46. package/dist/src/lib/api-client.js +227 -5
  47. package/dist/src/lib/api-client.js.map +1 -1
  48. package/dist/src/lib/app-match-guard.d.ts +44 -0
  49. package/dist/src/lib/app-match-guard.js +72 -0
  50. package/dist/src/lib/app-match-guard.js.map +1 -0
  51. package/dist/src/lib/app-settings-descriptor.js +4 -0
  52. package/dist/src/lib/app-settings-descriptor.js.map +1 -1
  53. package/dist/src/lib/codegen-shared/resolveCodegenSourceDir.d.ts +11 -8
  54. package/dist/src/lib/codegen-shared/resolveCodegenSourceDir.js +112 -60
  55. package/dist/src/lib/codegen-shared/resolveCodegenSourceDir.js.map +1 -1
  56. package/dist/src/lib/config-object-descriptor.js +39 -0
  57. package/dist/src/lib/config-object-descriptor.js.map +1 -1
  58. package/dist/src/lib/config-surface.d.ts +10 -0
  59. package/dist/src/lib/config-surface.js +17 -0
  60. package/dist/src/lib/config-surface.js.map +1 -1
  61. package/dist/src/lib/config.d.ts +15 -4
  62. package/dist/src/lib/config.js +22 -39
  63. package/dist/src/lib/config.js.map +1 -1
  64. package/dist/src/lib/credentials-store.d.ts +7 -15
  65. package/dist/src/lib/credentials-store.js +52 -85
  66. package/dist/src/lib/credentials-store.js.map +1 -1
  67. package/dist/src/lib/document-export-permissions.d.ts +30 -0
  68. package/dist/src/lib/document-export-permissions.js +54 -0
  69. package/dist/src/lib/document-export-permissions.js.map +1 -0
  70. package/dist/src/lib/env-resolver-core.d.ts +64 -16
  71. package/dist/src/lib/env-resolver-core.js +128 -17
  72. package/dist/src/lib/env-resolver-core.js.map +1 -1
  73. package/dist/src/lib/env-resolver.d.ts +3 -3
  74. package/dist/src/lib/env-resolver.js +2 -2
  75. package/dist/src/lib/function-bundle.d.ts +141 -0
  76. package/dist/src/lib/function-bundle.js +333 -0
  77. package/dist/src/lib/function-bundle.js.map +1 -0
  78. package/dist/src/lib/function-collect.d.ts +101 -0
  79. package/dist/src/lib/function-collect.js +339 -0
  80. package/dist/src/lib/function-collect.js.map +1 -0
  81. package/dist/src/lib/function-db-types.d.ts +149 -0
  82. package/dist/src/lib/function-db-types.js +587 -0
  83. package/dist/src/lib/function-db-types.js.map +1 -0
  84. package/dist/src/lib/function-grants-preflight.d.ts +118 -0
  85. package/dist/src/lib/function-grants-preflight.js +213 -0
  86. package/dist/src/lib/function-grants-preflight.js.map +1 -0
  87. package/dist/src/lib/function-sync.d.ts +191 -0
  88. package/dist/src/lib/function-sync.js +474 -0
  89. package/dist/src/lib/function-sync.js.map +1 -0
  90. package/dist/src/lib/function-triggers.d.ts +54 -0
  91. package/dist/src/lib/function-triggers.js +223 -0
  92. package/dist/src/lib/function-triggers.js.map +1 -0
  93. package/dist/src/lib/generated-config-surfaces.d.ts +389 -0
  94. package/dist/src/lib/generated-config-surfaces.js +1030 -2
  95. package/dist/src/lib/generated-config-surfaces.js.map +1 -1
  96. package/dist/src/lib/generated-sdk-types.d.ts +12 -0
  97. package/dist/src/lib/generated-sdk-types.js +13 -0
  98. package/dist/src/lib/generated-sdk-types.js.map +1 -0
  99. package/dist/src/lib/init-adopt.js +2 -2
  100. package/dist/src/lib/init-adopt.js.map +1 -1
  101. package/dist/src/lib/init-assets.js +3 -3
  102. package/dist/src/lib/init-config.d.ts +1 -1
  103. package/dist/src/lib/init-ios-links.d.ts +6 -5
  104. package/dist/src/lib/init-ios-links.js +9 -8
  105. package/dist/src/lib/init-ios-links.js.map +1 -1
  106. package/dist/src/lib/init-plan.d.ts +1 -1
  107. package/dist/src/lib/init-plan.js +1 -1
  108. package/dist/src/lib/init-xcode.d.ts +6 -5
  109. package/dist/src/lib/init-xcode.js +34 -10
  110. package/dist/src/lib/init-xcode.js.map +1 -1
  111. package/dist/src/lib/ios-app-id.d.ts +34 -0
  112. package/dist/src/lib/ios-app-id.js +69 -0
  113. package/dist/src/lib/ios-app-id.js.map +1 -0
  114. package/dist/src/lib/local-state.d.ts +1 -1
  115. package/dist/src/lib/local-state.js +1 -1
  116. package/dist/src/lib/local-test-cases.d.ts +1 -1
  117. package/dist/src/lib/local-test-cases.js +2 -1
  118. package/dist/src/lib/local-test-cases.js.map +1 -1
  119. package/dist/src/lib/migration-nag.d.ts +2 -2
  120. package/dist/src/lib/migration-nag.js +4 -3
  121. package/dist/src/lib/migration-nag.js.map +1 -1
  122. package/dist/src/lib/project-config.d.ts +38 -21
  123. package/dist/src/lib/project-config.js +57 -47
  124. package/dist/src/lib/project-config.js.map +1 -1
  125. package/dist/src/lib/snapshots.d.ts +2 -2
  126. package/dist/src/lib/snapshots.js +2 -2
  127. package/dist/src/lib/swift-codegen/generator.d.ts +1 -1
  128. package/dist/src/lib/swift-codegen/generator.js +1 -1
  129. package/dist/src/lib/sync-dir-selector.d.ts +1 -1
  130. package/dist/src/lib/sync-dir-selector.js +1 -1
  131. package/dist/src/lib/sync-paths.d.ts +52 -16
  132. package/dist/src/lib/sync-paths.js +68 -22
  133. package/dist/src/lib/sync-paths.js.map +1 -1
  134. package/dist/src/lib/sync-resource-types.d.ts +23 -4
  135. package/dist/src/lib/sync-resource-types.js +106 -8
  136. package/dist/src/lib/sync-resource-types.js.map +1 -1
  137. package/dist/src/lib/template.d.ts +2 -2
  138. package/dist/src/lib/template.js +2 -2
  139. package/dist/src/lib/test-case-keys.d.ts +1 -1
  140. package/dist/src/lib/test-case-keys.js +1 -1
  141. package/dist/src/lib/test-case-variables.d.ts +14 -0
  142. package/dist/src/lib/test-case-variables.js +42 -0
  143. package/dist/src/lib/test-case-variables.js.map +1 -1
  144. package/dist/src/lib/workflow-codegen/generator.d.ts +1 -1
  145. package/dist/src/lib/workflow-codegen/generator.js +1 -1
  146. package/dist/src/lib/workflow-usage.d.ts +198 -0
  147. package/dist/src/lib/workflow-usage.js +312 -0
  148. package/dist/src/lib/workflow-usage.js.map +1 -0
  149. package/dist/src/types/index.d.ts +12 -2
  150. package/package.json +4 -3
@@ -662,6 +662,20 @@ export declare function serializeBlobBucket(bucket: any, logger?: (message: stri
662
662
  * drift.
663
663
  */
664
664
  export declare function buildBlobBucketUpdatePayload(bucket: any): any;
665
+ /**
666
+ * The status a freshly CREATED prompt config still owes the file, or null
667
+ * (#3201).
668
+ *
669
+ * `status` is update-only — `POST /prompts` and `POST /prompts/:id/configs`
670
+ * both assign `active` whatever the body says — so an authored
671
+ * `status = "archived"` was silently dropped on every create path: a pulled
672
+ * tree pushed from a clean clone into a fresh environment brought every
673
+ * retired config back into service. Read through the push payload builder, so
674
+ * a file that omits the key asks for the default and needs no request.
675
+ */
676
+ export declare function createdConfigStatusPatch(tomlConfig: any): {
677
+ status: string;
678
+ } | null;
665
679
  /**
666
680
  * Which `[[configs]]` entry a prompt file marks as live (issue #2645).
667
681
  *
@@ -767,6 +781,13 @@ export declare function buildPromptCreatePayload(key: string, tomlData: any): Re
767
781
  * `seededConfigName` is what the server called it — read from the create
768
782
  * response rather than assumed, so a handler that one day honors the name
769
783
  * produces no needless PATCH.
784
+ *
785
+ * #3201 — the entry's `status` is deferred the OTHER way and is deliberately
786
+ * not here. The create points the prompt's `activeConfigId` at this seeded
787
+ * config, so retiring it in this early patch would archive the config the
788
+ * prompt is serving from and leave it there until the marked entry is created
789
+ * and activated — a window a failed create or activation freezes. It is
790
+ * applied after activation instead (`createdConfigStatusPatch`).
770
791
  */
771
792
  export declare function seededOnlyPromptConfigFields(firstConfig: any, seededConfigName?: string): Record<string, any> | null;
772
793
  /**
@@ -1700,7 +1721,7 @@ export declare function configSemanticHash(label: string, filePath: string, maps
1700
1721
  /**
1701
1722
  * The sync state `config push` writes into (#2731 B6, closing #2374).
1702
1723
  *
1703
- * `loadSyncState` answers `null` for an absent `.primitive-sync.json`, and
1724
+ * `loadSyncState` answers `null` for an absent sync-state baseline, and
1704
1725
  * every per-entity state write in the push loops is guarded by `if (syncState)`
1705
1726
  * — so a first push created every resource and recorded none of them. The next
1706
1727
  * push then re-entered the create path for everything and depended on 409
@@ -1881,6 +1902,48 @@ selects?: (name: string) => boolean): Promise<{
1881
1902
  /** Names the server listed, empty when the listing failed. */
1882
1903
  serverKeys: string[];
1883
1904
  }>;
1905
+ /**
1906
+ * Pull server-side `ServerFunction` rows into `functions/` (#3179).
1907
+ *
1908
+ * Two things make this different from every other type's pull:
1909
+ *
1910
+ * 1. **A function is more than its file.** The active config VERSION holds an
1911
+ * envelope with the authored TOML bytes and every source file, so the pull
1912
+ * writes `functions/<key>.toml` plus the TypeScript beside it, and records
1913
+ * the source paths so prune can remove the code with the function.
1914
+ * 2. **Bytes, not a re-serialization.** The stored TOML is written verbatim,
1915
+ * so comments, key order and line endings survive the round trip (F-009).
1916
+ * A function that has never had code pushed has no stored bytes; that one
1917
+ * gets a canonical serialization of its header, which is still a pushable
1918
+ * file.
1919
+ *
1920
+ * A stored source path is never trusted: `planFunctionPull` refuses one that
1921
+ * normalizes outside the tree, and the refusals are reported rather than
1922
+ * swallowed.
1923
+ */
1924
+ export declare function pullFunctions(client: ApiClient, appId: string, configDir: string, logger?: (msg: string) => void, selects?: (key: string) => boolean): Promise<{
1925
+ functionEntities: Record<string, {
1926
+ id: string;
1927
+ modifiedAt: string;
1928
+ contentHash?: string;
1929
+ semanticHash?: string;
1930
+ envelopeHash?: string;
1931
+ activeConfigId?: string;
1932
+ sources?: string[];
1933
+ }>;
1934
+ count: number;
1935
+ presence: PresenceOutcome;
1936
+ listOk: boolean;
1937
+ serverKeys: string[];
1938
+ /**
1939
+ * Everything the server listed, archived rows included. Pull exports no file
1940
+ * for a tombstone, so without the row here the archived function would be
1941
+ * stranded: no file to delete and no managed key to prune, and its key would
1942
+ * go on blocking the app's whole namespace with nothing able to reclaim it.
1943
+ * The caller folds these into the state through `archivedTombstoneEntries`.
1944
+ */
1945
+ items: any[];
1946
+ }>;
1884
1947
  /** The outcome of one block's test-case pull (#2769). */
1885
1948
  export type TestCasePullOutcome =
1886
1949
  /** The listing succeeded; `count` cases were written and stale files removed. */
@@ -2287,7 +2350,7 @@ export declare function applyTestCasePrune(params: {
2287
2350
  * `registerConfigCommands` created rather than making one of its own.
2288
2351
  *
2289
2352
  * The module keeps its name and its ~50 exported helpers: `sync.ts`,
2290
- * `resolveSyncDir`, `.primitive-sync.json` and `.primitive/sync/<env>/<appId>/`
2353
+ * `resolveSyncDir`, the sync-state baseline and `primitive/<env>/`
2291
2354
  * are internal identifiers, deliberately left alone (#2759 scope).
2292
2355
  */
2293
2356
  export declare function registerConfigSyncCommands(sync: Command): void;