primitive-admin 1.2.0-alpha.9 → 1.3.0-alpha.1

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 (590) hide show
  1. package/README.md +303 -186
  2. package/assets/skill/skills/primitive-platform/SKILL.md +93 -27
  3. package/dist/bin/primitive.js +15 -89
  4. package/dist/bin/primitive.js.map +1 -1
  5. package/dist/src/commands/admins.js +80 -17
  6. package/dist/src/commands/admins.js.map +1 -1
  7. package/dist/src/commands/agent-sessions.d.ts +129 -0
  8. package/dist/src/commands/agent-sessions.js +532 -20
  9. package/dist/src/commands/agent-sessions.js.map +1 -1
  10. package/dist/src/commands/analytics.js +207 -155
  11. package/dist/src/commands/analytics.js.map +1 -1
  12. package/dist/src/commands/apps-children.js +3 -0
  13. package/dist/src/commands/apps-children.js.map +1 -1
  14. package/dist/src/commands/apps-transitions.d.ts +39 -0
  15. package/dist/src/commands/apps-transitions.js +198 -0
  16. package/dist/src/commands/apps-transitions.js.map +1 -0
  17. package/dist/src/commands/apps.d.ts +17 -0
  18. package/dist/src/commands/apps.js +108 -3
  19. package/dist/src/commands/apps.js.map +1 -1
  20. package/dist/src/commands/auth-sessions.js +2 -0
  21. package/dist/src/commands/auth-sessions.js.map +1 -1
  22. package/dist/src/commands/auth.js +170 -50
  23. package/dist/src/commands/auth.js.map +1 -1
  24. package/dist/src/commands/blob-buckets.js +2 -0
  25. package/dist/src/commands/blob-buckets.js.map +1 -1
  26. package/dist/src/commands/collections.js +318 -256
  27. package/dist/src/commands/collections.js.map +1 -1
  28. package/dist/src/commands/comparisons.js +2 -0
  29. package/dist/src/commands/comparisons.js.map +1 -1
  30. package/dist/src/commands/config.d.ts +2 -2
  31. package/dist/src/commands/config.js +59 -33
  32. package/dist/src/commands/config.js.map +1 -1
  33. package/dist/src/commands/connections.js +2 -0
  34. package/dist/src/commands/connections.js.map +1 -1
  35. package/dist/src/commands/database-type-configs.js +5 -3
  36. package/dist/src/commands/database-type-configs.js.map +1 -1
  37. package/dist/src/commands/databases.js +6 -4
  38. package/dist/src/commands/databases.js.map +1 -1
  39. package/dist/src/commands/db3-types.d.ts +42 -0
  40. package/dist/src/commands/db3-types.js +445 -0
  41. package/dist/src/commands/db3-types.js.map +1 -0
  42. package/dist/src/commands/db3.d.ts +38 -0
  43. package/dist/src/commands/db3.js +2053 -0
  44. package/dist/src/commands/db3.js.map +1 -0
  45. package/dist/src/commands/documents.d.ts +110 -10
  46. package/dist/src/commands/documents.js +1019 -748
  47. package/dist/src/commands/documents.js.map +1 -1
  48. package/dist/src/commands/email-templates.js +74 -0
  49. package/dist/src/commands/email-templates.js.map +1 -1
  50. package/dist/src/commands/env.js +8 -4
  51. package/dist/src/commands/env.js.map +1 -1
  52. package/dist/src/commands/function-trigger-commands.d.ts +28 -0
  53. package/dist/src/commands/function-trigger-commands.js +341 -0
  54. package/dist/src/commands/function-trigger-commands.js.map +1 -0
  55. package/dist/src/commands/functions.js +383 -32
  56. package/dist/src/commands/functions.js.map +1 -1
  57. package/dist/src/commands/groups.js +168 -50
  58. package/dist/src/commands/groups.js.map +1 -1
  59. package/dist/src/commands/guides.js +7 -5
  60. package/dist/src/commands/guides.js.map +1 -1
  61. package/dist/src/commands/hosting.d.ts +8 -0
  62. package/dist/src/commands/hosting.js +509 -0
  63. package/dist/src/commands/hosting.js.map +1 -0
  64. package/dist/src/commands/init.js +129 -38
  65. package/dist/src/commands/init.js.map +1 -1
  66. package/dist/src/commands/integrations.js +82 -53
  67. package/dist/src/commands/integrations.js.map +1 -1
  68. package/dist/src/commands/locks.d.ts +5 -3
  69. package/dist/src/commands/locks.js +19 -61
  70. package/dist/src/commands/locks.js.map +1 -1
  71. package/dist/src/commands/metadata-category-configs.d.ts +2 -2
  72. package/dist/src/commands/metadata-category-configs.js +4 -2
  73. package/dist/src/commands/metadata-category-configs.js.map +1 -1
  74. package/dist/src/commands/metadata.js +55 -6
  75. package/dist/src/commands/metadata.js.map +1 -1
  76. package/dist/src/commands/prompts.js +75 -52
  77. package/dist/src/commands/prompts.js.map +1 -1
  78. package/dist/src/commands/rate-counters.d.ts +19 -0
  79. package/dist/src/commands/rate-counters.js +104 -0
  80. package/dist/src/commands/rate-counters.js.map +1 -0
  81. package/dist/src/commands/rule-sets.d.ts +1 -1
  82. package/dist/src/commands/rule-sets.js +2 -1
  83. package/dist/src/commands/rule-sets.js.map +1 -1
  84. package/dist/src/commands/schemas.d.ts +15 -0
  85. package/dist/src/commands/schemas.js +122 -0
  86. package/dist/src/commands/schemas.js.map +1 -0
  87. package/dist/src/commands/scripts.d.ts +9 -17
  88. package/dist/src/commands/scripts.js +24 -479
  89. package/dist/src/commands/scripts.js.map +1 -1
  90. package/dist/src/commands/secrets.d.ts +38 -0
  91. package/dist/src/commands/secrets.js +148 -6
  92. package/dist/src/commands/secrets.js.map +1 -1
  93. package/dist/src/commands/sessions.js +2 -0
  94. package/dist/src/commands/sessions.js.map +1 -1
  95. package/dist/src/commands/skill.js +2 -0
  96. package/dist/src/commands/skill.js.map +1 -1
  97. package/dist/src/commands/spent-tokens.d.ts +19 -0
  98. package/dist/src/commands/spent-tokens.js +79 -0
  99. package/dist/src/commands/spent-tokens.js.map +1 -0
  100. package/dist/src/commands/sync-app-settings.d.ts +58 -0
  101. package/dist/src/commands/sync-app-settings.js +119 -2
  102. package/dist/src/commands/sync-app-settings.js.map +1 -1
  103. package/dist/src/commands/sync-schemas.d.ts +202 -0
  104. package/dist/src/commands/sync-schemas.js +629 -0
  105. package/dist/src/commands/sync-schemas.js.map +1 -0
  106. package/dist/src/commands/sync-user-properties.d.ts +118 -0
  107. package/dist/src/commands/sync-user-properties.js +276 -0
  108. package/dist/src/commands/sync-user-properties.js.map +1 -0
  109. package/dist/src/commands/sync.d.ts +578 -546
  110. package/dist/src/commands/sync.js +3516 -5134
  111. package/dist/src/commands/sync.js.map +1 -1
  112. package/dist/src/commands/tokens.js +5 -3
  113. package/dist/src/commands/tokens.js.map +1 -1
  114. package/dist/src/commands/transitions.d.ts +54 -0
  115. package/dist/src/commands/transitions.js +418 -0
  116. package/dist/src/commands/transitions.js.map +1 -0
  117. package/dist/src/commands/usage.d.ts +42 -0
  118. package/dist/src/commands/usage.js +397 -0
  119. package/dist/src/commands/usage.js.map +1 -0
  120. package/dist/src/commands/user-properties.d.ts +14 -0
  121. package/dist/src/commands/user-properties.js +79 -0
  122. package/dist/src/commands/user-properties.js.map +1 -0
  123. package/dist/src/commands/users.js +951 -18
  124. package/dist/src/commands/users.js.map +1 -1
  125. package/dist/src/commands/vars.js +2 -0
  126. package/dist/src/commands/vars.js.map +1 -1
  127. package/dist/src/commands/waitlist.js +39 -4
  128. package/dist/src/commands/waitlist.js.map +1 -1
  129. package/dist/src/commands/workflows.d.ts +5 -83
  130. package/dist/src/commands/workflows.js +57 -2282
  131. package/dist/src/commands/workflows.js.map +1 -1
  132. package/dist/src/lib/analytics-query.d.ts +58 -0
  133. package/dist/src/lib/analytics-query.js +134 -0
  134. package/dist/src/lib/analytics-query.js.map +1 -0
  135. package/dist/src/lib/api-client.d.ts +1976 -431
  136. package/dist/src/lib/api-client.js +1095 -550
  137. package/dist/src/lib/api-client.js.map +1 -1
  138. package/dist/src/lib/app-settings-descriptor.d.ts +14 -2
  139. package/dist/src/lib/app-settings-descriptor.js +55 -1
  140. package/dist/src/lib/app-settings-descriptor.js.map +1 -1
  141. package/dist/src/lib/auth-fixtures.d.ts +44 -0
  142. package/dist/src/lib/auth-fixtures.js +61 -0
  143. package/dist/src/lib/auth-fixtures.js.map +1 -0
  144. package/dist/src/lib/auth-flow.d.ts +47 -1
  145. package/dist/src/lib/auth-flow.js +451 -14
  146. package/dist/src/lib/auth-flow.js.map +1 -1
  147. package/dist/src/lib/block-layout.d.ts +12 -23
  148. package/dist/src/lib/block-layout.js +26 -92
  149. package/dist/src/lib/block-layout.js.map +1 -1
  150. package/dist/src/lib/block-selector.d.ts +8 -14
  151. package/dist/src/lib/block-selector.js +8 -19
  152. package/dist/src/lib/block-selector.js.map +1 -1
  153. package/dist/src/lib/child-apps-local.d.ts +3 -1
  154. package/dist/src/lib/child-apps-local.js +9 -1
  155. package/dist/src/lib/child-apps-local.js.map +1 -1
  156. package/dist/src/lib/cli-manifest.d.ts +9 -0
  157. package/dist/src/lib/cli-manifest.js +10 -1
  158. package/dist/src/lib/cli-manifest.js.map +1 -1
  159. package/dist/src/lib/cli-version.d.ts +14 -0
  160. package/dist/src/lib/cli-version.js +38 -0
  161. package/dist/src/lib/cli-version.js.map +1 -0
  162. package/dist/src/lib/codegen-shared/prettierStable.d.ts +41 -0
  163. package/dist/src/lib/codegen-shared/prettierStable.js +146 -24
  164. package/dist/src/lib/codegen-shared/prettierStable.js.map +1 -1
  165. package/dist/src/lib/collection-export.d.ts +76 -15
  166. package/dist/src/lib/collection-export.js +116 -23
  167. package/dist/src/lib/collection-export.js.map +1 -1
  168. package/dist/src/lib/collection-principal.d.ts +22 -0
  169. package/dist/src/lib/collection-principal.js +35 -0
  170. package/dist/src/lib/collection-principal.js.map +1 -0
  171. package/dist/src/lib/command-groups.d.ts +30 -0
  172. package/dist/src/lib/command-groups.js +111 -0
  173. package/dist/src/lib/command-groups.js.map +1 -0
  174. package/dist/src/lib/command-status.d.ts +147 -0
  175. package/dist/src/lib/command-status.js +266 -0
  176. package/dist/src/lib/command-status.js.map +1 -0
  177. package/dist/src/lib/config-object-descriptor.d.ts +9 -22
  178. package/dist/src/lib/config-object-descriptor.js +113 -277
  179. package/dist/src/lib/config-object-descriptor.js.map +1 -1
  180. package/dist/src/lib/config-surface.d.ts +3 -7
  181. package/dist/src/lib/config-surface.js +9 -13
  182. package/dist/src/lib/config-surface.js.map +1 -1
  183. package/dist/src/lib/config-toml.d.ts +11 -2
  184. package/dist/src/lib/config-toml.js +25 -2
  185. package/dist/src/lib/config-toml.js.map +1 -1
  186. package/dist/src/lib/credentials-home.d.ts +7 -0
  187. package/dist/src/lib/credentials-home.js +45 -10
  188. package/dist/src/lib/credentials-home.js.map +1 -1
  189. package/dist/src/lib/credentials-lock.d.ts +14 -6
  190. package/dist/src/lib/credentials-lock.js +90 -10
  191. package/dist/src/lib/credentials-lock.js.map +1 -1
  192. package/dist/src/lib/credentials-store.d.ts +142 -70
  193. package/dist/src/lib/credentials-store.js +420 -111
  194. package/dist/src/lib/credentials-store.js.map +1 -1
  195. package/dist/src/lib/custodian.d.ts +8 -0
  196. package/dist/src/lib/custodian.js +18 -0
  197. package/dist/src/lib/custodian.js.map +1 -0
  198. package/dist/src/lib/data-input.d.ts +1 -1
  199. package/dist/src/lib/data-input.js +1 -1
  200. package/dist/src/lib/db-codegen/dbTsTypes.d.ts +1 -1
  201. package/dist/src/lib/db-codegen/dbTsTypes.js +3 -0
  202. package/dist/src/lib/db-codegen/dbTsTypes.js.map +1 -1
  203. package/dist/src/lib/db-codegen/dbTypeIR.d.ts +40 -1
  204. package/dist/src/lib/db-codegen/dbTypeIR.js +32 -8
  205. package/dist/src/lib/db-codegen/dbTypeIR.js.map +1 -1
  206. package/dist/src/lib/db-type-records.d.ts +125 -0
  207. package/dist/src/lib/db-type-records.js +237 -0
  208. package/dist/src/lib/db-type-records.js.map +1 -0
  209. package/dist/src/lib/db3-export.d.ts +322 -0
  210. package/dist/src/lib/db3-export.js +767 -0
  211. package/dist/src/lib/db3-export.js.map +1 -0
  212. package/dist/src/lib/db3-index-output.d.ts +116 -0
  213. package/dist/src/lib/db3-index-output.js +223 -0
  214. package/dist/src/lib/db3-index-output.js.map +1 -0
  215. package/dist/src/lib/db3-json-fields.d.ts +49 -0
  216. package/dist/src/lib/db3-json-fields.js +195 -0
  217. package/dist/src/lib/db3-json-fields.js.map +1 -0
  218. package/dist/src/lib/db3-type-archive.d.ts +59 -0
  219. package/dist/src/lib/db3-type-archive.js +95 -0
  220. package/dist/src/lib/db3-type-archive.js.map +1 -0
  221. package/dist/src/lib/db3-type-models.d.ts +148 -0
  222. package/dist/src/lib/db3-type-models.js +583 -0
  223. package/dist/src/lib/db3-type-models.js.map +1 -0
  224. package/dist/src/lib/deprecation.d.ts +2 -2
  225. package/dist/src/lib/deprecation.js +2 -2
  226. package/dist/src/lib/document-export-record-log.d.ts +7 -0
  227. package/dist/src/lib/document-export-record-log.js +9 -0
  228. package/dist/src/lib/document-export-record-log.js.map +1 -1
  229. package/dist/src/lib/document-ingest-artifact.d.ts +19 -0
  230. package/dist/src/lib/document-ingest-artifact.js +55 -6
  231. package/dist/src/lib/document-ingest-artifact.js.map +1 -1
  232. package/dist/src/lib/document-ingest-format2.d.ts +36 -0
  233. package/dist/src/lib/document-ingest-format2.js +78 -0
  234. package/dist/src/lib/document-ingest-format2.js.map +1 -0
  235. package/dist/src/lib/document-ingest-input.d.ts +9 -0
  236. package/dist/src/lib/document-ingest-input.js +28 -1
  237. package/dist/src/lib/document-ingest-input.js.map +1 -1
  238. package/dist/src/lib/document-ingest.d.ts +11 -1
  239. package/dist/src/lib/document-ingest.js +16 -0
  240. package/dist/src/lib/document-ingest.js.map +1 -1
  241. package/dist/src/lib/document-schema-rows.d.ts +42 -0
  242. package/dist/src/lib/document-schema-rows.js +53 -0
  243. package/dist/src/lib/document-schema-rows.js.map +1 -0
  244. package/dist/src/lib/experimental-apis.d.ts +36 -0
  245. package/dist/src/lib/experimental-apis.js +46 -0
  246. package/dist/src/lib/experimental-apis.js.map +1 -0
  247. package/dist/src/lib/file-attachment.d.ts +24 -0
  248. package/dist/src/lib/file-attachment.js +31 -0
  249. package/dist/src/lib/file-attachment.js.map +1 -0
  250. package/dist/src/lib/function-authorize-check.d.ts +142 -0
  251. package/dist/src/lib/function-authorize-check.js +311 -0
  252. package/dist/src/lib/function-authorize-check.js.map +1 -0
  253. package/dist/src/lib/function-authorize-view.d.ts +36 -0
  254. package/dist/src/lib/function-authorize-view.js +110 -0
  255. package/dist/src/lib/function-authorize-view.js.map +1 -0
  256. package/dist/src/lib/function-bundle.d.ts +27 -5
  257. package/dist/src/lib/function-bundle.js +142 -7
  258. package/dist/src/lib/function-bundle.js.map +1 -1
  259. package/dist/src/lib/function-collect.d.ts +112 -12
  260. package/dist/src/lib/function-collect.js +601 -12
  261. package/dist/src/lib/function-collect.js.map +1 -1
  262. package/dist/src/lib/function-db-types.d.ts +65 -11
  263. package/dist/src/lib/function-db-types.js +326 -157
  264. package/dist/src/lib/function-db-types.js.map +1 -1
  265. package/dist/src/lib/function-document-types.d.ts +19 -7
  266. package/dist/src/lib/function-document-types.js +24 -12
  267. package/dist/src/lib/function-document-types.js.map +1 -1
  268. package/dist/src/lib/function-grants-preflight.d.ts +99 -0
  269. package/dist/src/lib/function-grants-preflight.js +154 -2
  270. package/dist/src/lib/function-grants-preflight.js.map +1 -1
  271. package/dist/src/lib/function-lint.d.ts +85 -0
  272. package/dist/src/lib/function-lint.js +442 -0
  273. package/dist/src/lib/function-lint.js.map +1 -0
  274. package/dist/src/lib/function-log-row.js +21 -2
  275. package/dist/src/lib/function-log-row.js.map +1 -1
  276. package/dist/src/lib/function-run.d.ts +13 -21
  277. package/dist/src/lib/function-run.js +14 -27
  278. package/dist/src/lib/function-run.js.map +1 -1
  279. package/dist/src/lib/function-schema-codegen.d.ts +86 -22
  280. package/dist/src/lib/function-schema-codegen.js +194 -88
  281. package/dist/src/lib/function-schema-codegen.js.map +1 -1
  282. package/dist/src/lib/function-schema-refs.d.ts +98 -0
  283. package/dist/src/lib/function-schema-refs.js +177 -0
  284. package/dist/src/lib/function-schema-refs.js.map +1 -0
  285. package/dist/src/lib/function-sync.d.ts +120 -6
  286. package/dist/src/lib/function-sync.js +217 -26
  287. package/dist/src/lib/function-sync.js.map +1 -1
  288. package/dist/src/lib/function-trigger-listing.d.ts +11 -6
  289. package/dist/src/lib/function-trigger-listing.js +32 -11
  290. package/dist/src/lib/function-trigger-listing.js.map +1 -1
  291. package/dist/src/lib/function-typecheck.d.ts +52 -0
  292. package/dist/src/lib/function-typecheck.js +174 -54
  293. package/dist/src/lib/function-typecheck.js.map +1 -1
  294. package/dist/src/lib/function-versions.d.ts +2 -0
  295. package/dist/src/lib/function-versions.js +1 -0
  296. package/dist/src/lib/function-versions.js.map +1 -1
  297. package/dist/src/lib/generated-build-flags.d.ts +13 -0
  298. package/dist/src/lib/generated-build-flags.js +14 -0
  299. package/dist/src/lib/generated-build-flags.js.map +1 -0
  300. package/dist/src/lib/generated-command-status.d.ts +6 -0
  301. package/dist/src/lib/generated-command-status.js +502 -0
  302. package/dist/src/lib/generated-command-status.js.map +1 -0
  303. package/dist/src/lib/generated-config-surfaces.d.ts +804 -140
  304. package/dist/src/lib/generated-config-surfaces.js +2491 -1806
  305. package/dist/src/lib/generated-config-surfaces.js.map +1 -1
  306. package/dist/src/lib/generated-sdk-types.d.ts +1 -1
  307. package/dist/src/lib/generated-sdk-types.js +1 -1
  308. package/dist/src/lib/generated-sdk-types.js.map +1 -1
  309. package/dist/src/lib/hosting-build.d.ts +97 -0
  310. package/dist/src/lib/hosting-build.js +204 -0
  311. package/dist/src/lib/hosting-build.js.map +1 -0
  312. package/dist/src/lib/hosting-client.d.ts +167 -0
  313. package/dist/src/lib/hosting-client.js +340 -0
  314. package/dist/src/lib/hosting-client.js.map +1 -0
  315. package/dist/src/lib/hosting-environments.d.ts +32 -0
  316. package/dist/src/lib/hosting-environments.js +74 -0
  317. package/dist/src/lib/hosting-environments.js.map +1 -0
  318. package/dist/src/lib/hosting-errors.d.ts +30 -0
  319. package/dist/src/lib/hosting-errors.js +43 -0
  320. package/dist/src/lib/hosting-errors.js.map +1 -0
  321. package/dist/src/lib/hosting-token.d.ts +46 -0
  322. package/dist/src/lib/hosting-token.js +60 -0
  323. package/dist/src/lib/hosting-token.js.map +1 -0
  324. package/dist/src/lib/hosting-trust-step.d.ts +67 -0
  325. package/dist/src/lib/hosting-trust-step.js +279 -0
  326. package/dist/src/lib/hosting-trust-step.js.map +1 -0
  327. package/dist/src/lib/hosting-trust.d.ts +77 -0
  328. package/dist/src/lib/hosting-trust.js +194 -0
  329. package/dist/src/lib/hosting-trust.js.map +1 -0
  330. package/dist/src/lib/hosting-wait.d.ts +42 -0
  331. package/dist/src/lib/hosting-wait.js +84 -0
  332. package/dist/src/lib/hosting-wait.js.map +1 -0
  333. package/dist/src/lib/hosting-wfp-upload.d.ts +86 -0
  334. package/dist/src/lib/hosting-wfp-upload.js +149 -0
  335. package/dist/src/lib/hosting-wfp-upload.js.map +1 -0
  336. package/dist/src/lib/init-assets.d.ts +2 -6
  337. package/dist/src/lib/init-assets.js +11 -27
  338. package/dist/src/lib/init-assets.js.map +1 -1
  339. package/dist/src/lib/init-ios-links.d.ts +11 -7
  340. package/dist/src/lib/init-ios-links.js +28 -22
  341. package/dist/src/lib/init-ios-links.js.map +1 -1
  342. package/dist/src/lib/init-login-note.d.ts +13 -0
  343. package/dist/src/lib/init-login-note.js +22 -0
  344. package/dist/src/lib/init-login-note.js.map +1 -0
  345. package/dist/src/lib/init-schema.d.ts +15 -0
  346. package/dist/src/lib/init-schema.js +54 -0
  347. package/dist/src/lib/init-schema.js.map +1 -1
  348. package/dist/src/lib/integration-test-request.d.ts +54 -0
  349. package/dist/src/lib/integration-test-request.js +207 -0
  350. package/dist/src/lib/integration-test-request.js.map +1 -0
  351. package/dist/src/lib/invoker-shared-enums.d.ts +35 -0
  352. package/dist/src/lib/invoker-shared-enums.js +98 -0
  353. package/dist/src/lib/invoker-shared-enums.js.map +1 -0
  354. package/dist/src/lib/json-value.d.ts +6 -0
  355. package/dist/src/lib/json-value.js +13 -0
  356. package/dist/src/lib/json-value.js.map +1 -0
  357. package/dist/src/lib/load-routes.d.ts +33 -0
  358. package/dist/src/lib/load-routes.js +35 -0
  359. package/dist/src/lib/load-routes.js.map +1 -0
  360. package/dist/src/lib/log-inspection.d.ts +23 -4
  361. package/dist/src/lib/log-inspection.js +14 -5
  362. package/dist/src/lib/log-inspection.js.map +1 -1
  363. package/dist/src/lib/login-exchange-check.d.ts +18 -0
  364. package/dist/src/lib/login-exchange-check.js +27 -0
  365. package/dist/src/lib/login-exchange-check.js.map +1 -0
  366. package/dist/src/lib/login-scope-lines.d.ts +17 -7
  367. package/dist/src/lib/login-scope-lines.js +33 -10
  368. package/dist/src/lib/login-scope-lines.js.map +1 -1
  369. package/dist/src/lib/metadata-report.d.ts +85 -0
  370. package/dist/src/lib/metadata-report.js +81 -0
  371. package/dist/src/lib/metadata-report.js.map +1 -0
  372. package/dist/src/lib/object-status-filter.d.ts +9 -1
  373. package/dist/src/lib/object-status-filter.js +9 -1
  374. package/dist/src/lib/object-status-filter.js.map +1 -1
  375. package/dist/src/lib/output.d.ts +1 -1
  376. package/dist/src/lib/output.js +3 -1
  377. package/dist/src/lib/output.js.map +1 -1
  378. package/dist/src/lib/pin-refusal-hint.d.ts +12 -0
  379. package/dist/src/lib/pin-refusal-hint.js +35 -0
  380. package/dist/src/lib/pin-refusal-hint.js.map +1 -0
  381. package/dist/src/lib/platform-owned.js +5 -0
  382. package/dist/src/lib/platform-owned.js.map +1 -1
  383. package/dist/src/lib/primitive-declaration-names.d.ts +21 -0
  384. package/dist/src/lib/primitive-declaration-names.js +22 -0
  385. package/dist/src/lib/primitive-declaration-names.js.map +1 -0
  386. package/dist/src/lib/primitive-declaration.d.ts +174 -0
  387. package/dist/src/lib/primitive-declaration.js +871 -0
  388. package/dist/src/lib/primitive-declaration.js.map +1 -0
  389. package/dist/src/lib/primitive-env-plugin.d.ts +99 -0
  390. package/dist/src/lib/primitive-env-plugin.js +408 -0
  391. package/dist/src/lib/primitive-env-plugin.js.map +1 -0
  392. package/dist/src/lib/project-login-apps.d.ts +8 -0
  393. package/dist/src/lib/project-login-apps.js +27 -0
  394. package/dist/src/lib/project-login-apps.js.map +1 -0
  395. package/dist/src/lib/prompt-schema-codegen.d.ts +36 -12
  396. package/dist/src/lib/prompt-schema-codegen.js +96 -100
  397. package/dist/src/lib/prompt-schema-codegen.js.map +1 -1
  398. package/dist/src/lib/prompt-schema-document.d.ts +35 -0
  399. package/dist/src/lib/prompt-schema-document.js +92 -0
  400. package/dist/src/lib/prompt-schema-document.js.map +1 -0
  401. package/dist/src/lib/prompt-schema-refs.d.ts +173 -0
  402. package/dist/src/lib/prompt-schema-refs.js +478 -0
  403. package/dist/src/lib/prompt-schema-refs.js.map +1 -0
  404. package/dist/src/lib/records-verbs.d.ts +79 -0
  405. package/dist/src/lib/records-verbs.js +45 -0
  406. package/dist/src/lib/records-verbs.js.map +1 -0
  407. package/dist/src/lib/refresh-admin-credentials.d.ts +34 -4
  408. package/dist/src/lib/refresh-admin-credentials.js +85 -29
  409. package/dist/src/lib/refresh-admin-credentials.js.map +1 -1
  410. package/dist/src/lib/refresh-stored-login.d.ts +85 -0
  411. package/dist/src/lib/refresh-stored-login.js +233 -0
  412. package/dist/src/lib/refresh-stored-login.js.map +1 -0
  413. package/dist/src/lib/register-commands.d.ts +36 -0
  414. package/dist/src/lib/register-commands.js +37 -0
  415. package/dist/src/lib/register-commands.js.map +1 -0
  416. package/dist/src/lib/retired-imports.d.ts +53 -0
  417. package/dist/src/lib/retired-imports.js +120 -0
  418. package/dist/src/lib/retired-imports.js.map +1 -0
  419. package/dist/src/lib/row-field-rename.d.ts +18 -0
  420. package/dist/src/lib/row-field-rename.js +32 -0
  421. package/dist/src/lib/row-field-rename.js.map +1 -0
  422. package/dist/src/lib/run-status.d.ts +1 -1
  423. package/dist/src/lib/run-status.generated.d.ts +2 -2
  424. package/dist/src/lib/run-status.generated.js +3 -1
  425. package/dist/src/lib/run-status.generated.js.map +1 -1
  426. package/dist/src/lib/run-status.js +1 -1
  427. package/dist/src/lib/schema-codegen/compiledSpace.d.ts +62 -0
  428. package/dist/src/lib/schema-codegen/compiledSpace.js +103 -0
  429. package/dist/src/lib/schema-codegen/compiledSpace.js.map +1 -0
  430. package/dist/src/lib/schema-codegen/generated-db3-bridge.d.ts +86 -0
  431. package/dist/src/lib/schema-codegen/generated-db3-bridge.js +227 -0
  432. package/dist/src/lib/schema-codegen/generated-db3-bridge.js.map +1 -0
  433. package/dist/src/lib/schema-codegen/generated-db3-query-capabilities.d.ts +85 -0
  434. package/dist/src/lib/schema-codegen/generated-db3-query-capabilities.js +86 -0
  435. package/dist/src/lib/schema-codegen/generated-db3-query-capabilities.js.map +1 -0
  436. package/dist/src/lib/schema-codegen/generated-field-grammar.d.ts +229 -0
  437. package/dist/src/lib/schema-codegen/generated-field-grammar.js +420 -0
  438. package/dist/src/lib/schema-codegen/generated-field-grammar.js.map +1 -0
  439. package/dist/src/lib/schema-codegen/generated-field-table.d.ts +80 -0
  440. package/dist/src/lib/schema-codegen/generated-field-table.js +542 -0
  441. package/dist/src/lib/schema-codegen/generated-field-table.js.map +1 -0
  442. package/dist/src/lib/schema-codegen/generated-prompt-schemas.d.ts +195 -0
  443. package/dist/src/lib/schema-codegen/generated-prompt-schemas.js +503 -0
  444. package/dist/src/lib/schema-codegen/generated-prompt-schemas.js.map +1 -0
  445. package/dist/src/lib/schema-codegen/generated-schema-descriptor.d.ts +258 -0
  446. package/dist/src/lib/schema-codegen/generated-schema-descriptor.js +422 -0
  447. package/dist/src/lib/schema-codegen/generated-schema-descriptor.js.map +1 -0
  448. package/dist/src/lib/schema-codegen/generated-schema-file.d.ts +129 -0
  449. package/dist/src/lib/schema-codegen/generated-schema-file.js +475 -0
  450. package/dist/src/lib/schema-codegen/generated-schema-file.js.map +1 -0
  451. package/dist/src/lib/schema-codegen/generated-schema-provenance.d.ts +115 -0
  452. package/dist/src/lib/schema-codegen/generated-schema-provenance.js +274 -0
  453. package/dist/src/lib/schema-codegen/generated-schema-provenance.js.map +1 -0
  454. package/dist/src/lib/schema-codegen/generated-schema-refs.d.ts +366 -0
  455. package/dist/src/lib/schema-codegen/generated-schema-refs.js +1789 -0
  456. package/dist/src/lib/schema-codegen/generated-schema-refs.js.map +1 -0
  457. package/dist/src/lib/schema-codegen/generated-schema-shape.d.ts +27 -0
  458. package/dist/src/lib/schema-codegen/generated-schema-shape.js +126 -0
  459. package/dist/src/lib/schema-codegen/generated-schema-shape.js.map +1 -0
  460. package/dist/src/lib/schema-codegen/namedRefs.d.ts +56 -0
  461. package/dist/src/lib/schema-codegen/namedRefs.js +143 -0
  462. package/dist/src/lib/schema-codegen/namedRefs.js.map +1 -0
  463. package/dist/src/lib/schema-codegen/naming.d.ts +35 -0
  464. package/dist/src/lib/schema-codegen/naming.js +83 -0
  465. package/dist/src/lib/schema-codegen/naming.js.map +1 -0
  466. package/dist/src/lib/schema-codegen/schemaChanges.d.ts +74 -0
  467. package/dist/src/lib/schema-codegen/schemaChanges.js +277 -0
  468. package/dist/src/lib/schema-codegen/schemaChanges.js.map +1 -0
  469. package/dist/src/lib/schema-codegen/schemaDocs.d.ts +69 -0
  470. package/dist/src/lib/schema-codegen/schemaDocs.js +219 -0
  471. package/dist/src/lib/schema-codegen/schemaDocs.js.map +1 -0
  472. package/dist/src/lib/schema-codegen/schemaIR.d.ts +158 -0
  473. package/dist/src/lib/schema-codegen/schemaIR.js +279 -0
  474. package/dist/src/lib/schema-codegen/schemaIR.js.map +1 -0
  475. package/dist/src/lib/schema-codegen/schemaToTs.d.ts +109 -0
  476. package/dist/src/lib/schema-codegen/schemaToTs.js +269 -0
  477. package/dist/src/lib/schema-codegen/schemaToTs.js.map +1 -0
  478. package/dist/src/lib/schema-codegen/valuesLists.d.ts +48 -0
  479. package/dist/src/lib/schema-codegen/valuesLists.js +144 -0
  480. package/dist/src/lib/schema-codegen/valuesLists.js.map +1 -0
  481. package/dist/src/lib/schema-defs-module.d.ts +29 -0
  482. package/dist/src/lib/schema-defs-module.js +103 -0
  483. package/dist/src/lib/schema-defs-module.js.map +1 -0
  484. package/dist/src/lib/schema-family-index.d.ts +228 -0
  485. package/dist/src/lib/schema-family-index.js +813 -0
  486. package/dist/src/lib/schema-family-index.js.map +1 -0
  487. package/dist/src/lib/schema-pins.d.ts +82 -0
  488. package/dist/src/lib/schema-pins.js +198 -0
  489. package/dist/src/lib/schema-pins.js.map +1 -0
  490. package/dist/src/lib/schema-preview.d.ts +244 -0
  491. package/dist/src/lib/schema-preview.js +498 -0
  492. package/dist/src/lib/schema-preview.js.map +1 -0
  493. package/dist/src/lib/scope-request.d.ts +23 -11
  494. package/dist/src/lib/scope-request.js +69 -31
  495. package/dist/src/lib/scope-request.js.map +1 -1
  496. package/dist/src/lib/session-scope.d.ts +26 -0
  497. package/dist/src/lib/session-scope.js +58 -0
  498. package/dist/src/lib/session-scope.js.map +1 -0
  499. package/dist/src/lib/skill-installer.d.ts +2 -2
  500. package/dist/src/lib/skill-installer.js +2 -21
  501. package/dist/src/lib/skill-installer.js.map +1 -1
  502. package/dist/src/lib/step-run-table.d.ts +1 -2
  503. package/dist/src/lib/step-run-table.js +1 -2
  504. package/dist/src/lib/step-run-table.js.map +1 -1
  505. package/dist/src/lib/swift-codegen/agentGenerator.d.ts +2 -1
  506. package/dist/src/lib/swift-codegen/agentGenerator.js +25 -23
  507. package/dist/src/lib/swift-codegen/agentGenerator.js.map +1 -1
  508. package/dist/src/lib/swift-codegen/banners.d.ts +12 -0
  509. package/dist/src/lib/swift-codegen/banners.js +12 -0
  510. package/dist/src/lib/swift-codegen/banners.js.map +1 -1
  511. package/dist/src/lib/swift-codegen/functionGenerator.d.ts +36 -1
  512. package/dist/src/lib/swift-codegen/functionGenerator.js +169 -51
  513. package/dist/src/lib/swift-codegen/functionGenerator.js.map +1 -1
  514. package/dist/src/lib/swift-codegen/schemaToSwift.d.ts +33 -9
  515. package/dist/src/lib/swift-codegen/schemaToSwift.js +215 -179
  516. package/dist/src/lib/swift-codegen/schemaToSwift.js.map +1 -1
  517. package/dist/src/lib/swift-codegen/sharedGenerator.d.ts +51 -0
  518. package/dist/src/lib/swift-codegen/sharedGenerator.js +239 -0
  519. package/dist/src/lib/swift-codegen/sharedGenerator.js.map +1 -0
  520. package/dist/src/lib/swift-codegen/swiftKeys.d.ts +19 -0
  521. package/dist/src/lib/swift-codegen/swiftKeys.js +31 -0
  522. package/dist/src/lib/swift-codegen/swiftKeys.js.map +1 -0
  523. package/dist/src/lib/swift-codegen/userPropertiesGenerator.d.ts +30 -0
  524. package/dist/src/lib/swift-codegen/userPropertiesGenerator.js +69 -0
  525. package/dist/src/lib/swift-codegen/userPropertiesGenerator.js.map +1 -0
  526. package/dist/src/lib/sync-resource-types.d.ts +117 -31
  527. package/dist/src/lib/sync-resource-types.js +197 -189
  528. package/dist/src/lib/sync-resource-types.js.map +1 -1
  529. package/dist/src/lib/sync-selectors.d.ts +7 -0
  530. package/dist/src/lib/sync-selectors.js +22 -2
  531. package/dist/src/lib/sync-selectors.js.map +1 -1
  532. package/dist/src/lib/template.d.ts +39 -3
  533. package/dist/src/lib/template.js +103 -14
  534. package/dist/src/lib/template.js.map +1 -1
  535. package/dist/src/lib/test-case-file-names.d.ts +3 -5
  536. package/dist/src/lib/test-case-file-names.js +3 -5
  537. package/dist/src/lib/test-case-file-names.js.map +1 -1
  538. package/dist/src/lib/test-runs.d.ts +45 -0
  539. package/dist/src/lib/test-runs.js +150 -0
  540. package/dist/src/lib/test-runs.js.map +1 -0
  541. package/dist/src/lib/test-users.d.ts +25 -0
  542. package/dist/src/lib/test-users.js +36 -0
  543. package/dist/src/lib/test-users.js.map +1 -0
  544. package/dist/src/lib/toml-database-config.d.ts +4 -2
  545. package/dist/src/lib/toml-database-config.js +11 -6
  546. package/dist/src/lib/toml-database-config.js.map +1 -1
  547. package/dist/src/lib/toml-list-edit.d.ts +33 -0
  548. package/dist/src/lib/toml-list-edit.js +481 -0
  549. package/dist/src/lib/toml-list-edit.js.map +1 -0
  550. package/dist/src/lib/toml-scalar-edit.d.ts +9 -0
  551. package/dist/src/lib/toml-scalar-edit.js +73 -5
  552. package/dist/src/lib/toml-scalar-edit.js.map +1 -1
  553. package/dist/src/lib/transition-warnings.d.ts +21 -0
  554. package/dist/src/lib/transition-warnings.js +49 -0
  555. package/dist/src/lib/transition-warnings.js.map +1 -0
  556. package/dist/src/lib/usage-meters.d.ts +16 -0
  557. package/dist/src/lib/usage-meters.js +52 -0
  558. package/dist/src/lib/usage-meters.js.map +1 -0
  559. package/dist/src/lib/user-index.d.ts +80 -0
  560. package/dist/src/lib/user-index.js +166 -0
  561. package/dist/src/lib/user-index.js.map +1 -0
  562. package/dist/src/lib/user-properties/generated-properties-schema.d.ts +159 -0
  563. package/dist/src/lib/user-properties/generated-properties-schema.js +471 -0
  564. package/dist/src/lib/user-properties/generated-properties-schema.js.map +1 -0
  565. package/dist/src/lib/user-properties/user-properties-codegen.d.ts +55 -0
  566. package/dist/src/lib/user-properties/user-properties-codegen.js +129 -0
  567. package/dist/src/lib/user-properties/user-properties-codegen.js.map +1 -0
  568. package/dist/src/lib/user-walk.d.ts +31 -0
  569. package/dist/src/lib/user-walk.js +102 -0
  570. package/dist/src/lib/user-walk.js.map +1 -0
  571. package/dist/src/lib/webhook-capture.d.ts +43 -0
  572. package/dist/src/lib/webhook-capture.js +91 -0
  573. package/dist/src/lib/webhook-capture.js.map +1 -0
  574. package/dist/src/lib/webhook-deliver.d.ts +18 -20
  575. package/dist/src/lib/webhook-deliver.js +34 -89
  576. package/dist/src/lib/webhook-deliver.js.map +1 -1
  577. package/dist/src/lib/webhook-test-run.d.ts +32 -0
  578. package/dist/src/lib/webhook-test-run.js +108 -0
  579. package/dist/src/lib/webhook-test-run.js.map +1 -0
  580. package/dist/src/lib/worker-perf-format.d.ts +22 -0
  581. package/dist/src/lib/worker-perf-format.js +27 -0
  582. package/dist/src/lib/worker-perf-format.js.map +1 -0
  583. package/dist/src/types/index.d.ts +20 -65
  584. package/dist/src/validators.d.ts +7 -55
  585. package/dist/src/validators.js +7 -53
  586. package/dist/src/validators.js.map +1 -1
  587. package/dist/src/vite.d.ts +17 -0
  588. package/dist/src/vite.js +18 -0
  589. package/dist/src/vite.js.map +1 -0
  590. package/package.json +20 -9
@@ -2,16 +2,17 @@
2
2
  name: primitive-platform
3
3
  description: >
4
4
  Fetches the Primitive platform's agent guides and applies them. MUST be used whenever the user
5
- is writing or reviewing code that uses js-bao, js-bao-wss-client, primitive-app,
6
- primitive-functions, or any Primitive platform feature (documents, databases, server functions,
5
+ is writing or reviewing code that uses js-bao, js-bao-wss-client, primitive-functions,
6
+ JsBaoClient (Swift), or any Primitive platform feature (databases, server functions,
7
7
  prompts, integrations, blobs, authentication, users/groups), and before running any `primitive`
8
8
  CLI command. All development guidance lives in the guides this skill fetches; after writing or
9
9
  modifying code that touches Primitive APIs, it cross-references the code against those guides
10
10
  and corrects mistakes. Use this skill even if the user doesn't explicitly ask for it. Also use it
11
11
  when something looks like a platform bug or missing platform capability, to record the platform
12
12
  feedback in the app's PRIMITIVE-FEEDBACK.md. Also trigger whenever the user wants to upgrade or
13
- update the app to a newer platform version — bumping js-bao, js-bao-wss-client, primitive-app, or
14
- the primitive CLI — which follows the "Upgrading Platform Libraries" workflow below.
13
+ update the app to a newer platform version — bumping js-bao, js-bao-wss-client, JsBaoClient or
14
+ the primitive CLI, or moving an app off the retired `primitive-app` / `swift-primitive-app`
15
+ libraries — which follows the "Upgrading Platform Libraries" workflow below.
15
16
  allowed-tools: Bash, Read, Edit, Write, Glob, Grep, Agent
16
17
  ---
17
18
 
@@ -49,7 +50,7 @@ primitive guides get <topic> # the topic's default variant
49
50
  - **Freshness.** Guides are cached under `~/.primitive/guides/` for 24 hours. After upgrading the
50
51
  CLI or the libraries, pass `--refresh` on the first `list` and `get`.
51
52
  - **Where to start.** `configuration` covers projects, environments, and pushing config;
52
- `data-modeling` covers choosing where data lives; `inspecting-and-debugging` covers reading a
53
+ `databases` covers storing and partitioning data; `inspecting-and-debugging` covers reading a
53
54
  running app. For a CLI command you have not used, fetch the guide for its feature first.
54
55
 
55
56
  ## Writing code
@@ -68,8 +69,9 @@ primitive guides get <topic> # the topic's default variant
68
69
  instead, and follow the `configuration` guide's "Child apps" workflow.
69
70
  5. A plain `primitive login` holds the default scope, which cannot delete apps other than
70
71
  `internal` ones (every child app is `internal`), cannot delete databases or change roles,
71
- and cannot write to an app whose protection level is `protected`. When a command is refused with
72
- a 403, act on its `code`, not on the command it prints:
72
+ and cannot write to an app whose protection level is `protected`. In a project it is pinned
73
+ to the project's apps on that server. When a command is refused with a 403, act on its
74
+ `code`, not on the command it prints:
73
75
  - `INSUFFICIENT_SCOPE`: it prints the exact `primitive login …` command that grants the
74
76
  missing scope (a missing `admin` prints `primitive login --step-up --scope … --app <id>`).
75
77
  Ask the user to run it (a step-up opens the browser), then retry once.
@@ -78,7 +80,8 @@ primitive guides get <topic> # the topic's default variant
78
80
  app's `protection` to get past it.
79
81
  - `APP_NOT_PINNED`: the login's pins do not reach the app or route the command named. First
80
82
  confirm the command targets the app you intended (`primitive whoami` shows the pins); only
81
- then ask the user to run the printed command.
83
+ then ask the user to run the `primitive -e <env> login` the error names, or the printed
84
+ command. Never ask for `primitive login --app all` to get around a pin.
82
85
  - `PROTECTION_OWNER_ONLY` or `PROTECTION_FIXED_ON_CHILD`: the push changes a protection level
83
86
  this login may not change. Unless the user asked for the change, restore the `protection`
84
87
  line that `primitive config pull --only app` writes.
@@ -93,8 +96,10 @@ primitive guides get <topic> # the topic's default variant
93
96
  After writing or modifying code that touches Primitive, review it without being asked:
94
97
 
95
98
  1. **Identify the features touched.** Imports from `js-bao`, `js-bao-wss-client`,
96
- `primitive-app`, or `primitive-functions`; files in the project's configuration tree; model
97
- definitions and schemas.
99
+ `primitive-functions`, or `JsBaoClient`; files in the project's configuration tree; model
100
+ definitions and schemas. An import from `primitive-app` or `PrimitiveApp` means the app has
101
+ not migrated off a retired library: report it, and point at the `changelog` guide's
102
+ retirement entry (Step 6 of "Upgrading Platform Libraries").
98
103
  2. **Fetch those guides** in the project's language and platform.
99
104
  3. **Compare the code against them.** API usage, lifecycle, access and authorization, anything
100
105
  the guide warns against, and any follow-up step the guide requires that the change skipped.
@@ -104,7 +109,9 @@ After writing or modifying code that touches Primitive, review it without being
104
109
  ## When the user is starting a new feature
105
110
 
106
111
  1. Run `primitive guides list` and pick every relevant topic.
107
- 2. Fetch those guides in the project's language and platform.
112
+ 2. Fetch those guides in the project's language and platform. In an app that still uses
113
+ `primitive-app` or `PrimitiveApp`, build on the client and the app's own code rather than
114
+ the retired library, and suggest the migration (Step 6 of the upgrade workflow).
108
115
  3. Recommend a data model from the guides. If requirements are ambiguous, ask clarifying
109
116
  questions first: a data model is much easier to get right up front than to migrate.
110
117
  4. Outline the implementation, citing the guide patterns it follows.
@@ -118,11 +125,9 @@ After writing or modifying code that touches Primitive, review it without being
118
125
 
119
126
  ## When the user is moving an app's data to another app
120
127
 
121
- Fetch the `documents` guide and follow its export/import sections. A migration is two
122
- exports into one directory and two imports out of it, in a fixed order — the documents
123
- bundle, then the collections those documents sit in — and the guide has the commands, the
124
- order they must run in, and what does not travel. Don't run a single export or import from
125
- memory: the wrong order silently loses every collection's document membership.
128
+ Fetch `primitive guides get databases` and follow its export and import steps. Never run an
129
+ export or import from memory: the guide has the commands, the order they run in, and what
130
+ does not travel.
126
131
 
127
132
  ## Upgrading Platform Libraries
128
133
 
@@ -132,17 +137,37 @@ platform bugs should come out, the starter template the app was scaffolded from
132
137
  moved too, and new platform capabilities should be considered. The refreshed guides are the
133
138
  source of truth for what the platform can do now.
134
139
 
140
+ The first upgrade after the starter templates folded the app libraries in is also a
141
+ migration: an app on `primitive-app` (web) or `swift-primitive-app` (iOS) moves onto the
142
+ template's own code in Step 6. A library is retired when the `changelog` guide's **Breaking**
143
+ entries say so (`primitive guides get changelog --refresh`); npm may also mark the package
144
+ deprecated, but the changelog is the rule. Moving `js-bao-wss-client` or `JsBaoClient` forward
145
+ while keeping a retired library is not a path the platform tests (the frozen Swift library
146
+ can stop building against a newer client, and `primitive-app`'s peer range may refuse it), so
147
+ the choice is to migrate, or to stay on the whole old set for now. Never pin back or suppress
148
+ to keep both.
149
+
135
150
  The backend is upgraded by the platform team, not by the app — the app only chooses which
136
151
  environment it points at (see the `configuration` guide). A library upgrade against the production environment
137
152
  needs no server-side changes.
138
153
 
139
154
  ### 1. Snapshot the current state
140
155
 
141
- - Read `package.json` and note the installed versions of the platform packages the app
142
- uses: `js-bao`, `js-bao-wss-client`, `primitive-app`, and `primitive-admin` (the CLI).
143
- - Check what's available: `pnpm view <pkg> dist-tags` for each. Compare the target tag's
144
- version against what's installed — a dist-tag can lag (or even point behind another
145
- tag), so confirm the upgrade actually moves forward before proceeding.
156
+ Snapshot each client the app has (an app with a web and an iOS client snapshots both):
157
+
158
+ - **Web.** Read `package.json` and note the installed versions of the platform packages:
159
+ `js-bao`, `js-bao-wss-client`, and `primitive-admin` (the CLI, which is also a dev
160
+ dependency: the template's build imports `primitive-admin/vite`). Check what's available:
161
+ `pnpm view <pkg> dist-tags` for each. Compare the target tag's version against what's
162
+ installed — a dist-tag can lag (or even point behind another tag), so confirm the upgrade
163
+ actually moves forward before proceeding.
164
+ - **iOS.** Note the `JsBaoClient` package's `branch:` in `Package.swift` (and in `project.yml`
165
+ when the app has one): `main` is production, `alpha` is alpha. Note the revision it is
166
+ pinned to in `Package.resolved`, and the version in `.primitive-cli-version`.
167
+ - **Retired libraries.** A dependency the `changelog` guide's **Breaking** entries retire
168
+ (`primitive-app` in `package.json`; the `PrimitiveApp` or `PrimitiveAppTesting` products of
169
+ `swift-primitive-app` in `Package.swift` or `project.yml`) is never bumped. Note it for
170
+ Step 6, which removes it. `pnpm view <pkg> deprecated` may confirm a retired npm package.
146
171
  - Locate the app's platform feedback doc (convention below). Note its upgrade stamp and
147
172
  the tracked workarounds — Step 5 revisits each one.
148
173
 
@@ -164,15 +189,34 @@ Upgrading the CLI first matters for two reasons:
164
189
 
165
190
  ### 3. Upgrade the app's libraries
166
191
 
192
+ Web, with pnpm by default (use npm only if the app already uses npm):
193
+
194
+ ```bash
195
+ pnpm add js-bao@latest js-bao-wss-client@latest # the packages the app uses
196
+ pnpm add -D primitive-admin@latest # the CLI the build imports from
197
+ ```
198
+
199
+ iOS:
200
+
167
201
  ```bash
168
- # pnpm by default (use npm only if the app already uses npm), for the packages the app uses:
169
- pnpm add js-bao@latest js-bao-wss-client@latest primitive-app@latest
202
+ swift package update # moves JsBaoClient to the newest commit on its branch
170
203
  ```
171
204
 
205
+ An iOS app built through Xcode also needs its project's packages updated: Xcode resolves
206
+ from its own copy of `Package.resolved`, so run Xcode's package update, or the template's
207
+ `scripts/sync-xcode-pins.sh`, which copies the root pin into the project (the template's
208
+ build scripts run it before every `xcodebuild`). Then set `.primitive-cli-version` to the
209
+ installed CLI's version (`primitive --version`). That file is only the codegen phase's
210
+ fallback: the phase runs `PRIMITIVE_CLI` when it is set, then an installed `primitive`, and
211
+ only when neither exists `npx` with the version the file pins.
212
+
213
+ A retired library stays where it is until Step 6 removes it.
214
+
172
215
  Upgrade the libraries **before** fetching guides: the guides system selects its version
173
216
  channel from the *installed* `js-bao-wss-client` major, so fetching first returns guides
174
- for the old version. Then refetch the guides for every feature area the app uses,
175
- passing `--refresh` on the first call.
217
+ for the old version.
218
+ Then refetch the guides for every feature area the app uses, passing `--refresh` on the
219
+ first call (and `--language swift` for an iOS app).
176
220
 
177
221
  ### 4. Fix breaking changes, then scan for deprecated API use
178
222
 
@@ -181,6 +225,11 @@ feature area and migrate the code to the current API — don't pin back or suppr
181
225
  major version bump means breaking changes are expected; treat the migration as part of
182
226
  the upgrade, not an optional follow-up.
183
227
 
228
+ Some errors mean a retired library, not an API change: `Cannot find module 'primitive-app'`
229
+ or a typecheck error on its exports (web), `no such module 'PrimitiveApp'`, or a frozen
230
+ `PrimitiveApp` that no longer builds against the updated `JsBaoClient` (iOS). Those are
231
+ the migration. Do Step 6 first, then come back here.
232
+
184
233
  Once it builds, find every platform API the app still uses that the platform has
185
234
  deprecated. A deprecated surface works today and is removed in a later major, so this
186
235
  is the moment to warn the user, not the moment it breaks. Each surface marks its
@@ -230,6 +279,20 @@ so default to removing them the moment they're unnecessary.
230
279
 
231
280
  ### 6. Adopt template updates
232
281
 
282
+ When Step 1 found a retired library, this step is the upgrade. The `changelog` guide's
283
+ **Breaking** entry for the retirement lists the migration for each platform; follow it
284
+ rather than diffing file by file. In outline: the app moves to the template's client setup
285
+ (`src/lib/client.ts`), auth store and sign-in pages on the web, or to the template's
286
+ `AppState` and `AuthModel` with their views on iOS; `primitive-app/vite` becomes
287
+ `primitive-admin/vite`; the dev tools go; the in-app test groups move to plain vitest or
288
+ XCTest with the template's sign-in helper; and the dependency is dropped. The entry holds
289
+ the details. Then run the baseline diff below for everything else.
290
+
291
+ The migration replaces the library's starter pieces only. Where the app itself uses
292
+ something the template no longer has — user prefs, theming, group-aware routing, its root
293
+ document, its own data model — that use stays: the app changed it, so ask (the third case
294
+ below).
295
+
233
296
  The app was scaffolded by `primitive init` from a starter template —
234
297
  `Primitive-Labs/primitive-vue-template` for web apps, `Primitive-Labs/primitive-swift-template`
235
298
  for iOS. Those templates keep moving with the platform: config, setup, and wiring fixes
@@ -277,7 +340,9 @@ guides for the app's feature areas. Compare against what the app actually does:
277
340
 
278
341
  Run the app's tests, apply the post-change review above to everything modified, and
279
342
  update the feedback doc's upgrade stamp (date, channel, versions, and the template
280
- commit synced in Step 6). If the upgrade changed the configuration tree and the
343
+ commit synced in Step 6). Versions are the web packages' versions, or for iOS the
344
+ `JsBaoClient` branch and the revision `Package.resolved` now pins; an app with both
345
+ clients lists both. If the upgrade changed the configuration tree and the
281
346
  environment is shared, verify against the child app from Step 4, not the shared
282
347
  environment; the `configuration` guide's "Child apps" workflow covers applying the
283
348
  merged tree to the parent and deleting the child.
@@ -297,7 +362,8 @@ have one, create it the first time there is something to record:
297
362
  ## Upgrade stamp
298
363
  - Last upgraded: 2026-07-21
299
364
  - Channel: production
300
- - Versions: js-bao-wss-client 2.0.6, primitive-app 3.0.5, js-bao 0.5.1, primitive-admin 1.0.55
365
+ - Versions: js-bao-wss-client 3.5.0, js-bao 0.12.0, primitive-admin 1.1.0
366
+ - Versions (iOS): JsBaoClient main @ a1d82eb
301
367
  - Template: primitive-vue-template @ main 0f1c2d3
302
368
 
303
369
  ## Open items
@@ -1,56 +1,17 @@
1
1
  #!/usr/bin/env node
2
2
  import { Command, CommanderError } from "commander";
3
3
  import { readFileSync, writeSync } from "fs";
4
+ import { webcrypto } from "crypto";
4
5
  import { fileURLToPath } from "url";
5
6
  import { dirname, resolve } from "path";
6
- import { registerInitCommand } from "../src/commands/init.js";
7
- import { registerAuthCommands } from "../src/commands/auth.js";
8
- import { registerAppsCommands } from "../src/commands/apps.js";
9
- import { registerUsersCommands } from "../src/commands/users.js";
10
- import { registerWaitlistCommands } from "../src/commands/waitlist.js";
11
- import { registerIntegrationsCommands } from "../src/commands/integrations.js";
12
- import { registerWebhooksCommands } from "../src/commands/webhooks.js";
13
- import { registerConnectionsCommands } from "../src/commands/connections.js";
14
- import { registerSessionsCommands } from "../src/commands/sessions.js";
15
- import { registerAgentSessionsCommands } from "../src/commands/agent-sessions.js";
16
- import { registerCronTriggersCommands } from "../src/commands/cron-triggers.js";
17
- import { registerLocksCommands } from "../src/commands/locks.js";
18
- import { registerMetadataCommands } from "../src/commands/metadata.js";
19
- import { registerPromptsCommands } from "../src/commands/prompts.js";
20
- import { registerScriptsCommands } from "../src/commands/scripts.js";
21
- import { registerFunctionsCommands } from "../src/commands/functions.js";
22
- import { registerWorkflowsCommands } from "../src/commands/workflows.js";
23
- import { registerAdminsCommands } from "../src/commands/admins.js";
24
- import { registerFeatureFlagsCommands } from "../src/commands/feature-flags.js";
25
- import { registerCatalogCommands } from "../src/commands/catalog.js";
26
- import { registerAnalyticsCommands } from "../src/commands/analytics.js";
27
- import { registerConfigSyncCommands } from "../src/commands/sync.js";
28
- import { registerConfigCommands } from "../src/commands/config.js";
29
- import { registerComparisonsCommands } from "../src/commands/comparisons.js";
30
- import { registerTokensCommands } from "../src/commands/tokens.js";
31
- import { registerDatabasesCommands } from "../src/commands/databases.js";
32
- import { registerGroupsCommands } from "../src/commands/groups.js";
33
- import { registerRuleSetsCommands } from "../src/commands/rule-sets.js";
34
- import { registerGroupTypeConfigsCommands } from "../src/commands/group-type-configs.js";
35
- import { registerDatabaseTypeConfigsCommands } from "../src/commands/database-type-configs.js";
36
- import { registerGuidesCommands } from "../src/commands/guides.js";
37
- import { registerDocumentsCommands } from "../src/commands/documents.js";
38
7
  import chalk from "chalk";
39
- import { registerEmailTemplatesCommands } from "../src/commands/email-templates.js";
40
- import { registerCollectionsCommands } from "../src/commands/collections.js";
41
- import { registerCollectionTypeConfigsCommands } from "../src/commands/collection-type-configs.js";
42
- import { registerMetadataCategoryConfigsCommands } from "../src/commands/metadata-category-configs.js";
43
8
  import { error } from "../src/lib/output.js";
44
9
  import { installGlobalCrashHandlers } from "../src/lib/crash-handlers.js";
45
10
  import { buildCliManifest } from "../src/lib/cli-manifest.js";
11
+ import { registerAllCommands } from "../src/lib/register-commands.js";
46
12
  import { ApiError } from "../src/lib/api-client.js";
47
13
  import { checkForUpdate } from "../src/lib/version-check.js";
48
14
  import { checkSkillStatus } from "../src/lib/skill-installer.js";
49
- import { registerSkillCommands } from "../src/commands/skill.js";
50
- import { registerSecretsCommands } from "../src/commands/secrets.js";
51
- import { registerVarsCommands } from "../src/commands/vars.js";
52
- import { registerBlobBucketsCommands } from "../src/commands/blob-buckets.js";
53
- import { registerEnvCommands } from "../src/commands/env.js";
54
15
  import { setCurrentEnvName, getCurrentEnvNameSafe, getCurrentEnvironment, getProjectConfig, PrimitiveEnvError, } from "../src/lib/env-resolver.js";
55
16
  import { ProjectConfigError, PROJECT_CONFIG_DISPLAY_NAME, findProjectConfigPath } from "../src/lib/project-config.js";
56
17
  // Install global crash handlers first thing. Without these, an error that
@@ -58,6 +19,11 @@ import { ProjectConfigError, PROJECT_CONFIG_DISPLAY_NAME, findProjectConfigPath
58
19
  // inside an inquirer event callback when stdin isn't a usable TTY — makes Node
59
20
  // print only its bare `Node.js vX` banner and die with no message (issue #972).
60
21
  installGlobalCrashHandlers();
22
+ // #5533 — schema provenance hashes with `globalThis.crypto.subtle`, which
23
+ // Node 18 (the oldest the CLI supports) exposes only as `crypto.webcrypto`.
24
+ if (!globalThis.crypto) {
25
+ Object.defineProperty(globalThis, "crypto", { value: webcrypto, configurable: true, writable: true });
26
+ }
61
27
  const __filename = fileURLToPath(import.meta.url);
62
28
  const __dirname = dirname(__filename);
63
29
  const pkg = JSON.parse(readFileSync(resolve(__dirname, "../../package.json"), "utf-8"));
@@ -282,7 +248,7 @@ program
282
248
  .exitOverride()
283
249
  .description(`CLI for administering Primitive applications.
284
250
 
285
- Manage apps, users, integrations, prompts, workflows, and more from the command line.
251
+ Manage apps, users, integrations, prompts, functions, and more from the command line.
286
252
  Supports TOML-based configuration sync for version-controlled app settings.`)
287
253
  .version(pkg.version)
288
254
  // Global --env flag. Parsed above in preParseEnvFlag too; declaring it
@@ -303,9 +269,10 @@ Project configuration (primitive/config.json):
303
269
  the CLI operates in project mode: each environment's committed configuration
304
270
  is at <projectRoot>/primitive/<env>/, this machine's credentials and
305
271
  selection live under <projectRoot>/.primitive/, and each named environment is
306
- isolated. Without a primitive/config.json only login, logout, bootstrap and
307
- init work; every other command stops and names the missing project config
308
- (create one with 'primitive init'). There is no global fallback.
272
+ isolated. Without a primitive/config.json only login, logout, bootstrap,
273
+ init and 'apps delete' work; every other command stops and names the missing
274
+ project config (create one with 'primitive init'). 'apps delete' there uses
275
+ the login for PRIMITIVE_SERVER_URL, or the default server when it is unset.
309
276
 
310
277
  Primitive environment selection (project mode):
311
278
  1. --env <name> flag
@@ -325,50 +292,9 @@ App Context:
325
292
  Documentation:
326
293
  See https://primitive-labs.github.io/primitive-docs-site/ for full documentation.
327
294
  `);
328
- // Register all command groups (init first, then logically grouped)
329
- registerInitCommand(program);
330
- registerEnvCommands(program);
331
- registerAuthCommands(program);
332
- registerAppsCommands(program);
333
- registerUsersCommands(program);
334
- registerWaitlistCommands(program);
335
- registerIntegrationsCommands(program);
336
- registerWebhooksCommands(program);
337
- registerConnectionsCommands(program);
338
- registerSessionsCommands(program);
339
- registerAgentSessionsCommands(program);
340
- registerCronTriggersCommands(program);
341
- registerLocksCommands(program);
342
- registerMetadataCommands(program);
343
- registerPromptsCommands(program);
344
- registerScriptsCommands(program);
345
- registerFunctionsCommands(program);
346
- registerWorkflowsCommands(program);
347
- registerAdminsCommands(program);
348
- registerFeatureFlagsCommands(program);
349
- registerCatalogCommands(program);
350
- registerAnalyticsCommands(program);
351
- // One noun owns the TOML configuration tree (issue #2759): `config` carries
352
- // the local authoring verbs and the server-reconciling verbs that used to be
353
- // the `sync` group, so the group is created once and handed on.
354
- registerConfigSyncCommands(registerConfigCommands(program));
355
- registerComparisonsCommands(program);
356
- registerTokensCommands(program);
357
- registerDatabasesCommands(program);
358
- registerGroupsCommands(program);
359
- registerRuleSetsCommands(program);
360
- registerGroupTypeConfigsCommands(program);
361
- registerDatabaseTypeConfigsCommands(program);
362
- registerGuidesCommands(program);
363
- registerDocumentsCommands(program);
364
- registerEmailTemplatesCommands(program);
365
- registerCollectionsCommands(program);
366
- registerCollectionTypeConfigsCommands(program);
367
- registerMetadataCategoryConfigsCommands(program);
368
- registerSkillCommands(program);
369
- registerSecretsCommands(program);
370
- registerVarsCommands(program);
371
- registerBlobBucketsCommands(program);
295
+ // Register all command groups. The list lives in `registerAllCommands` so the
296
+ // tree can be built in-process, by the API status check among others (#5354).
297
+ registerAllCommands(program);
372
298
  // `primitive help --json` — machine-readable command manifest (issue #983).
373
299
  //
374
300
  // Mechanism: a pre-parse argv guard, NOT a registered `help` subcommand.
@@ -1 +1 @@
1
- {"version":3,"file":"primitive.js","sourceRoot":"","sources":["../../bin/primitive.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACxC,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAA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IACD,IAAI,GAAG,YAAY,QAAQ,EAAE,CAAC;QAC5B,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACnB,IAAI,GAAG,CAAC,UAAU,KAAK,GAAG,EAAE,CAAC;YAC3B,KAAK,CAAC,gDAAgD,CAAC,CAAC;QAC1D,CAAC;QACD,MAAM,sBAAsB,EAAE,CAAC;QAC/B,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/C,CAAC;IACD,KAAK,CAAC,GAAG,CAAC,OAAO,IAAI,8BAA8B,CAAC,CAAC;IACrD,MAAM,sBAAsB,EAAE,CAAC;IAC/B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
@@ -1,6 +1,7 @@
1
1
  import { ApiClient } from "../lib/api-client.js";
2
- import { success, error, info, keyValue, formatTable, formatId, formatDate, json, divider, } from "../lib/output.js";
2
+ import { success, error, info, keyValue, result as printResult, formatTable, formatId, formatDate, json, } from "../lib/output.js";
3
3
  import { confirmPrompt } from "../lib/confirm-prompt.js";
4
+ import { commandStatus } from "../lib/command-status.js";
4
5
  import { pageCursorOption, pageLimitOption, parsePageLimit, printEmptyPage, printPageHint, } from "../lib/list-options.js";
5
6
  import { normalizeCliListEnvelope, wholeListEnvelope, } from "../lib/paginate.js";
6
7
  export function registerAdminsCommands(program) {
@@ -11,10 +12,13 @@ export function registerAdminsCommands(program) {
11
12
  Examples:
12
13
  $ primitive admins list
13
14
  $ primitive admins search user@example.com
15
+ $ primitive admins get user@example.com
16
+ $ primitive admins reindex <adminId>
14
17
  $ primitive admins invite newadmin@example.com --limit 5
15
- $ primitive admins invitations list
18
+ $ primitive admins invitations list --email newadmin@example.com
16
19
  $ primitive admins deferred-grants list --email user@test.com --app <appId>
17
20
  `);
21
+ commandStatus(admins, { stability: "production" });
18
22
  // List all admins
19
23
  admins
20
24
  .command("list")
@@ -76,15 +80,64 @@ Examples:
76
80
  keyValue("Role", admin.role);
77
81
  keyValue("App Creation Limit", admin.appCreationLimit);
78
82
  keyValue("Disabled", admin.disabledAt ? formatDate(admin.disabledAt) : "no");
79
- if (result.apps && result.apps.length > 0) {
80
- divider();
81
- info(`Apps (${result.apps.length}):`);
82
- console.log(formatTable(result.apps, [
83
- { header: "APP ID", key: "appId", format: formatId },
84
- { header: "NAME", key: "name" },
85
- { header: "ROLE", key: "role" },
86
- ]));
83
+ }
84
+ catch (err) {
85
+ error(err.message);
86
+ process.exit(1);
87
+ }
88
+ });
89
+ // An admin and the apps assigned to them
90
+ admins
91
+ .command("get")
92
+ .description("Show an admin and their assigned apps (super-admin only)")
93
+ .argument("<email>", "Admin's email")
94
+ .option("--json", "Output as JSON")
95
+ .action(async (email, options) => {
96
+ const client = new ApiClient();
97
+ try {
98
+ const result = await client.getAdminApps(email);
99
+ if (options.json) {
100
+ json(result);
101
+ return;
102
+ }
103
+ const admin = result.admin;
104
+ printResult("Admin ID", admin.adminId);
105
+ printResult("Email", admin.email);
106
+ printResult("Name", admin.name);
107
+ printResult("Role", admin.role);
108
+ const apps = result.apps ?? [];
109
+ if (apps.length === 0) {
110
+ info("No assigned apps.");
111
+ return;
112
+ }
113
+ console.log(formatTable(apps, [
114
+ { header: "APP ID", key: "id", format: formatId },
115
+ { header: "NAME", key: "name" },
116
+ { header: "ROLE", key: "role" },
117
+ { header: "ASSIGNED", key: "assignedAt", format: formatDate },
118
+ ]));
119
+ }
120
+ catch (err) {
121
+ error(err.message);
122
+ process.exit(1);
123
+ }
124
+ });
125
+ // Reindex admin
126
+ admins
127
+ .command("reindex")
128
+ .description("Rebuild an admin's directory index entries (super-admin only)")
129
+ .argument("<admin-id>", "Admin ID to reindex")
130
+ .option("--json", "Output as JSON")
131
+ .action(async (adminId, options) => {
132
+ const client = new ApiClient();
133
+ try {
134
+ const result = await client.reindexAdminWithResult(adminId);
135
+ if (options.json) {
136
+ json(result);
137
+ return;
87
138
  }
139
+ success(`Admin ${adminId} reindexed.`);
140
+ keyValue("Reindexed", formatDate(result.reindexedAt));
88
141
  }
89
142
  catch (err) {
90
143
  error(err.message);
@@ -203,28 +256,35 @@ Examples:
203
256
  });
204
257
  // Invitations subcommand
205
258
  const invitations = admins.command("invitations").description("Manage admin invitations");
206
- // List all invitations
259
+ // One address's invitations
207
260
  invitations
208
261
  .command("list")
209
- .description("List all pending admin invitations")
262
+ .description("List an address's pending admin invitations")
263
+ .requiredOption("--email <email>", "Address whose invitations to list")
210
264
  .option("--json", "Output as JSON")
211
265
  .action(async (options) => {
266
+ const email = options.email.trim();
267
+ if (!email) {
268
+ error("--email needs an address.");
269
+ process.exit(1);
270
+ }
212
271
  const client = new ApiClient();
213
272
  try {
214
- const invitationsList = await client.listAllAdminInvitations();
273
+ const invitationsList = await client.listAllAdminInvitations(email);
215
274
  if (options.json) {
216
275
  json(wholeListEnvelope(invitationsList));
217
276
  return;
218
277
  }
219
278
  if (!invitationsList || invitationsList.length === 0) {
220
- info("No pending invitations.");
279
+ info(`No pending invitations for ${email}.`);
221
280
  return;
222
281
  }
223
282
  console.log(formatTable(invitationsList, [
224
283
  { header: "ID", key: "invitationId", format: formatId },
225
284
  { header: "EMAIL", key: "email" },
226
285
  { header: "TYPE", key: "type" },
227
- { header: "APP", key: "appName" },
286
+ { header: "INVITED BY", key: "invitedBy" },
287
+ { header: "LIMIT", key: "appCreationLimit" },
228
288
  { header: "EXPIRES", key: "expiresAt", format: formatDate },
229
289
  ]));
230
290
  }
@@ -264,10 +324,13 @@ Examples:
264
324
  process.exit(1);
265
325
  }
266
326
  });
267
- // Deferred grants subcommand
327
+ // Deferred grants subcommand. The deferred-grants API is deprecated: a
328
+ // pending invitation is revoked from its resource.
268
329
  const deferredGrants = admins
269
330
  .command("deferred-grants")
270
- .description("Inspect deferred grants (pending document/group grants for users who haven't signed up)");
331
+ .description("Inspect and revoke deferred grants (deprecated: the deferred-grants API is deprecated; revoke a pending " +
332
+ "invitation from its resource)");
333
+ commandStatus(deferredGrants, { stability: "production", deprecated: true });
271
334
  deferredGrants
272
335
  .command("list")
273
336
  .description("List pending deferred grants for an email")