primitive-admin 1.0.61 → 1.0.62

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 (300) hide show
  1. package/README.md +125 -69
  2. package/assets/skill/skills/primitive-platform/SKILL.md +336 -37
  3. package/dist/bin/primitive.js +25 -14
  4. package/dist/bin/primitive.js.map +1 -1
  5. package/dist/src/commands/analytics.js +36 -16
  6. package/dist/src/commands/analytics.js.map +1 -1
  7. package/dist/src/commands/apps.js +49 -188
  8. package/dist/src/commands/apps.js.map +1 -1
  9. package/dist/src/commands/blob-buckets.js +13 -153
  10. package/dist/src/commands/blob-buckets.js.map +1 -1
  11. package/dist/src/commands/collection-type-configs.js +14 -100
  12. package/dist/src/commands/collection-type-configs.js.map +1 -1
  13. package/dist/src/commands/collections.js +47 -8
  14. package/dist/src/commands/collections.js.map +1 -1
  15. package/dist/src/commands/config.d.ts +46 -0
  16. package/dist/src/commands/config.js +479 -0
  17. package/dist/src/commands/config.js.map +1 -0
  18. package/dist/src/commands/connections.js +12 -7
  19. package/dist/src/commands/connections.js.map +1 -1
  20. package/dist/src/commands/cron-triggers.js +84 -176
  21. package/dist/src/commands/cron-triggers.js.map +1 -1
  22. package/dist/src/commands/database-type-configs.d.ts +2 -0
  23. package/dist/src/commands/database-type-configs.js +171 -0
  24. package/dist/src/commands/database-type-configs.js.map +1 -0
  25. package/dist/src/commands/database-types.js +4 -4
  26. package/dist/src/commands/database-types.js.map +1 -1
  27. package/dist/src/commands/databases.d.ts +63 -0
  28. package/dist/src/commands/databases.js +649 -87
  29. package/dist/src/commands/databases.js.map +1 -1
  30. package/dist/src/commands/documents.js +869 -12
  31. package/dist/src/commands/documents.js.map +1 -1
  32. package/dist/src/commands/email-templates.js +18 -125
  33. package/dist/src/commands/email-templates.js.map +1 -1
  34. package/dist/src/commands/env.d.ts +12 -1
  35. package/dist/src/commands/env.js +98 -25
  36. package/dist/src/commands/env.js.map +1 -1
  37. package/dist/src/commands/feature-flags.d.ts +14 -0
  38. package/dist/src/commands/feature-flags.js +116 -0
  39. package/dist/src/commands/feature-flags.js.map +1 -0
  40. package/dist/src/commands/group-type-configs.js +14 -109
  41. package/dist/src/commands/group-type-configs.js.map +1 -1
  42. package/dist/src/commands/init.d.ts +9 -1
  43. package/dist/src/commands/init.js +1056 -277
  44. package/dist/src/commands/init.js.map +1 -1
  45. package/dist/src/commands/integrations.js +136 -421
  46. package/dist/src/commands/integrations.js.map +1 -1
  47. package/dist/src/commands/metadata-category-configs.d.ts +12 -0
  48. package/dist/src/commands/metadata-category-configs.js +112 -0
  49. package/dist/src/commands/metadata-category-configs.js.map +1 -0
  50. package/dist/src/commands/metadata.js +33 -141
  51. package/dist/src/commands/metadata.js.map +1 -1
  52. package/dist/src/commands/prompts.js +206 -563
  53. package/dist/src/commands/prompts.js.map +1 -1
  54. package/dist/src/commands/rule-sets.d.ts +1 -1
  55. package/dist/src/commands/rule-sets.js +16 -132
  56. package/dist/src/commands/rule-sets.js.map +1 -1
  57. package/dist/src/commands/scripts.js +67 -234
  58. package/dist/src/commands/scripts.js.map +1 -1
  59. package/dist/src/commands/sessions.js +17 -5
  60. package/dist/src/commands/sessions.js.map +1 -1
  61. package/dist/src/commands/sync-app-settings.d.ts +113 -70
  62. package/dist/src/commands/sync-app-settings.js +193 -242
  63. package/dist/src/commands/sync-app-settings.js.map +1 -1
  64. package/dist/src/commands/sync.d.ts +1932 -49
  65. package/dist/src/commands/sync.js +9521 -1769
  66. package/dist/src/commands/sync.js.map +1 -1
  67. package/dist/src/commands/tokens.js +8 -2
  68. package/dist/src/commands/tokens.js.map +1 -1
  69. package/dist/src/commands/users.js +92 -1
  70. package/dist/src/commands/users.js.map +1 -1
  71. package/dist/src/commands/vars.js +44 -58
  72. package/dist/src/commands/vars.js.map +1 -1
  73. package/dist/src/commands/webhooks.js +318 -156
  74. package/dist/src/commands/webhooks.js.map +1 -1
  75. package/dist/src/commands/workflows.d.ts +49 -12
  76. package/dist/src/commands/workflows.js +652 -1086
  77. package/dist/src/commands/workflows.js.map +1 -1
  78. package/dist/src/lib/access-rule-display.d.ts +21 -0
  79. package/dist/src/lib/access-rule-display.js +34 -0
  80. package/dist/src/lib/access-rule-display.js.map +1 -0
  81. package/dist/src/lib/api-client.d.ts +541 -61
  82. package/dist/src/lib/api-client.js +559 -102
  83. package/dist/src/lib/api-client.js.map +1 -1
  84. package/dist/src/lib/app-settings-descriptor.d.ts +180 -25
  85. package/dist/src/lib/app-settings-descriptor.js +403 -82
  86. package/dist/src/lib/app-settings-descriptor.js.map +1 -1
  87. package/dist/src/lib/canonical-json.d.ts +12 -0
  88. package/dist/src/lib/canonical-json.js +35 -0
  89. package/dist/src/lib/canonical-json.js.map +1 -0
  90. package/dist/src/lib/cli-manifest.d.ts +8 -0
  91. package/dist/src/lib/cli-manifest.js +1 -0
  92. package/dist/src/lib/cli-manifest.js.map +1 -1
  93. package/dist/src/lib/codegen-shared/generatedFiles.d.ts +6 -2
  94. package/dist/src/lib/codegen-shared/generatedFiles.js +9 -2
  95. package/dist/src/lib/codegen-shared/generatedFiles.js.map +1 -1
  96. package/dist/src/lib/codegen-shared/resolveCodegenSourceDir.d.ts +6 -6
  97. package/dist/src/lib/codegen-shared/resolveCodegenSourceDir.js +8 -8
  98. package/dist/src/lib/codegen-shared/resolveCodegenSourceDir.js.map +1 -1
  99. package/dist/src/lib/config-object-descriptor.d.ts +127 -0
  100. package/dist/src/lib/config-object-descriptor.js +658 -0
  101. package/dist/src/lib/config-object-descriptor.js.map +1 -0
  102. package/dist/src/lib/config-payload.d.ts +85 -0
  103. package/dist/src/lib/config-payload.js +116 -0
  104. package/dist/src/lib/config-payload.js.map +1 -0
  105. package/dist/src/lib/config-surface.d.ts +130 -0
  106. package/dist/src/lib/config-surface.js +300 -0
  107. package/dist/src/lib/config-surface.js.map +1 -0
  108. package/dist/src/lib/credentials-store.d.ts +10 -0
  109. package/dist/src/lib/credentials-store.js +23 -0
  110. package/dist/src/lib/credentials-store.js.map +1 -1
  111. package/dist/src/lib/data-input.d.ts +23 -0
  112. package/dist/src/lib/data-input.js +50 -0
  113. package/dist/src/lib/data-input.js.map +1 -0
  114. package/dist/src/lib/db-codegen/dbTemplates.js +1 -1
  115. package/dist/src/lib/db-codegen/dbTemplates.js.map +1 -1
  116. package/dist/src/lib/db-codegen/dbTypeIR.d.ts +1 -1
  117. package/dist/src/lib/env-resolver-core.d.ts +147 -0
  118. package/dist/src/lib/env-resolver-core.js +265 -0
  119. package/dist/src/lib/env-resolver-core.js.map +1 -0
  120. package/dist/src/lib/env-resolver.d.ts +28 -6
  121. package/dist/src/lib/env-resolver.js +44 -32
  122. package/dist/src/lib/env-resolver.js.map +1 -1
  123. package/dist/src/lib/generated-allowlist.js +12 -0
  124. package/dist/src/lib/generated-allowlist.js.map +1 -1
  125. package/dist/src/lib/generated-config-surfaces.d.ts +682 -0
  126. package/dist/src/lib/generated-config-surfaces.js +4058 -0
  127. package/dist/src/lib/generated-config-surfaces.js.map +1 -0
  128. package/dist/src/lib/generated-template-lint.d.ts +212 -0
  129. package/dist/src/lib/generated-template-lint.js +624 -0
  130. package/dist/src/lib/generated-template-lint.js.map +1 -0
  131. package/dist/src/lib/init-adopt.d.ts +16 -0
  132. package/dist/src/lib/init-adopt.js +34 -0
  133. package/dist/src/lib/init-adopt.js.map +1 -0
  134. package/dist/src/lib/init-assets.d.ts +39 -0
  135. package/dist/src/lib/init-assets.js +97 -0
  136. package/dist/src/lib/init-assets.js.map +1 -0
  137. package/dist/src/lib/init-config.d.ts +44 -5
  138. package/dist/src/lib/init-config.js +80 -7
  139. package/dist/src/lib/init-config.js.map +1 -1
  140. package/dist/src/lib/init-ios-links.d.ts +50 -0
  141. package/dist/src/lib/init-ios-links.js +153 -0
  142. package/dist/src/lib/init-ios-links.js.map +1 -0
  143. package/dist/src/lib/init-plan.d.ts +80 -0
  144. package/dist/src/lib/init-plan.js +95 -0
  145. package/dist/src/lib/init-plan.js.map +1 -0
  146. package/dist/src/lib/init-production-env.d.ts +48 -0
  147. package/dist/src/lib/init-production-env.js +59 -0
  148. package/dist/src/lib/init-production-env.js.map +1 -0
  149. package/dist/src/lib/init-schema.d.ts +74 -0
  150. package/dist/src/lib/init-schema.js +358 -0
  151. package/dist/src/lib/init-schema.js.map +1 -0
  152. package/dist/src/lib/init-xcode.d.ts +33 -0
  153. package/dist/src/lib/init-xcode.js +114 -0
  154. package/dist/src/lib/init-xcode.js.map +1 -0
  155. package/dist/src/lib/integration-request-config.d.ts +30 -0
  156. package/dist/src/lib/integration-request-config.js +145 -0
  157. package/dist/src/lib/integration-request-config.js.map +1 -0
  158. package/dist/src/lib/local-state.d.ts +55 -0
  159. package/dist/src/lib/local-state.js +167 -0
  160. package/dist/src/lib/local-state.js.map +1 -0
  161. package/dist/src/lib/log-inspection.d.ts +568 -0
  162. package/dist/src/lib/log-inspection.js +639 -0
  163. package/dist/src/lib/log-inspection.js.map +1 -0
  164. package/dist/src/lib/migration-nag.d.ts +2 -2
  165. package/dist/src/lib/migration-nag.js +3 -3
  166. package/dist/src/lib/object-status-filter.d.ts +22 -0
  167. package/dist/src/lib/object-status-filter.js +45 -0
  168. package/dist/src/lib/object-status-filter.js.map +1 -0
  169. package/dist/src/lib/output.d.ts +24 -1
  170. package/dist/src/lib/output.js +42 -1
  171. package/dist/src/lib/output.js.map +1 -1
  172. package/dist/src/lib/package-manager.d.ts +140 -0
  173. package/dist/src/lib/package-manager.js +305 -0
  174. package/dist/src/lib/package-manager.js.map +1 -0
  175. package/dist/src/lib/paginate.d.ts +50 -0
  176. package/dist/src/lib/paginate.js +53 -0
  177. package/dist/src/lib/paginate.js.map +1 -1
  178. package/dist/src/lib/platform-owned.d.ts +29 -3
  179. package/dist/src/lib/platform-owned.js +42 -3
  180. package/dist/src/lib/platform-owned.js.map +1 -1
  181. package/dist/src/lib/project-config.js +13 -5
  182. package/dist/src/lib/project-config.js.map +1 -1
  183. package/dist/src/lib/query-operators.d.ts +1 -1
  184. package/dist/src/lib/query-operators.js +1 -1
  185. package/dist/src/lib/record-filter.d.ts +18 -0
  186. package/dist/src/lib/record-filter.js +55 -0
  187. package/dist/src/lib/record-filter.js.map +1 -0
  188. package/dist/src/lib/resolve-init-dev-port.d.ts +56 -0
  189. package/dist/src/lib/resolve-init-dev-port.js +55 -0
  190. package/dist/src/lib/resolve-init-dev-port.js.map +1 -0
  191. package/dist/src/lib/resolve-init-server.d.ts +64 -0
  192. package/dist/src/lib/resolve-init-server.js +77 -0
  193. package/dist/src/lib/resolve-init-server.js.map +1 -0
  194. package/dist/src/lib/resolve-platform.d.ts +43 -14
  195. package/dist/src/lib/resolve-platform.js +74 -12
  196. package/dist/src/lib/resolve-platform.js.map +1 -1
  197. package/dist/src/lib/run-status.d.ts +19 -0
  198. package/dist/src/lib/run-status.generated.d.ts +39 -0
  199. package/dist/src/lib/run-status.generated.js +66 -0
  200. package/dist/src/lib/run-status.generated.js.map +1 -0
  201. package/dist/src/lib/run-status.js +19 -0
  202. package/dist/src/lib/run-status.js.map +1 -0
  203. package/dist/src/lib/server-text-normalization.d.ts +51 -0
  204. package/dist/src/lib/server-text-normalization.js +90 -0
  205. package/dist/src/lib/server-text-normalization.js.map +1 -0
  206. package/dist/src/lib/server-url.d.ts +22 -0
  207. package/dist/src/lib/server-url.js +33 -0
  208. package/dist/src/lib/server-url.js.map +1 -0
  209. package/dist/src/lib/signing-secret-status.d.ts +81 -0
  210. package/dist/src/lib/signing-secret-status.js +116 -0
  211. package/dist/src/lib/signing-secret-status.js.map +1 -0
  212. package/dist/src/lib/skill-installer.js +6 -3
  213. package/dist/src/lib/skill-installer.js.map +1 -1
  214. package/dist/src/lib/snapshots.d.ts +2 -2
  215. package/dist/src/lib/snapshots.js +2 -2
  216. package/dist/src/lib/swift-codegen/dbGenerator.d.ts +15 -2
  217. package/dist/src/lib/swift-codegen/dbGenerator.js +250 -18
  218. package/dist/src/lib/swift-codegen/dbGenerator.js.map +1 -1
  219. package/dist/src/lib/swift-codegen/generator.d.ts +11 -2
  220. package/dist/src/lib/swift-codegen/generator.js +181 -7
  221. package/dist/src/lib/swift-codegen/generator.js.map +1 -1
  222. package/dist/src/lib/swift-codegen/siblingSymbols.d.ts +7 -3
  223. package/dist/src/lib/swift-codegen/siblingSymbols.js +4 -1
  224. package/dist/src/lib/swift-codegen/siblingSymbols.js.map +1 -1
  225. package/dist/src/lib/sync-dir-selector.d.ts +21 -0
  226. package/dist/src/lib/sync-dir-selector.js +30 -0
  227. package/dist/src/lib/sync-dir-selector.js.map +1 -0
  228. package/dist/src/lib/sync-paths.d.ts +39 -0
  229. package/dist/src/lib/sync-paths.js +70 -2
  230. package/dist/src/lib/sync-paths.js.map +1 -1
  231. package/dist/src/lib/sync-resource-types.d.ts +138 -31
  232. package/dist/src/lib/sync-resource-types.js +241 -47
  233. package/dist/src/lib/sync-resource-types.js.map +1 -1
  234. package/dist/src/lib/sync-selectors.d.ts +95 -0
  235. package/dist/src/lib/sync-selectors.js +228 -0
  236. package/dist/src/lib/sync-selectors.js.map +1 -0
  237. package/dist/src/lib/template.d.ts +62 -4
  238. package/dist/src/lib/template.js +147 -39
  239. package/dist/src/lib/template.js.map +1 -1
  240. package/dist/src/lib/test-case-keys.d.ts +29 -0
  241. package/dist/src/lib/test-case-keys.js +55 -0
  242. package/dist/src/lib/test-case-keys.js.map +1 -0
  243. package/dist/src/lib/test-case-variables.d.ts +15 -0
  244. package/dist/src/lib/test-case-variables.js +29 -0
  245. package/dist/src/lib/test-case-variables.js.map +1 -0
  246. package/dist/src/lib/toml-database-config.d.ts +4 -4
  247. package/dist/src/lib/toml-database-config.js +27 -34
  248. package/dist/src/lib/toml-database-config.js.map +1 -1
  249. package/dist/src/lib/toml-metadata-config.d.ts +9 -5
  250. package/dist/src/lib/toml-metadata-config.js +40 -45
  251. package/dist/src/lib/toml-metadata-config.js.map +1 -1
  252. package/dist/src/lib/toml-native-form.d.ts +1 -1
  253. package/dist/src/lib/toml-native-form.js +1 -1
  254. package/dist/src/lib/toml-params-validator.d.ts +1 -1
  255. package/dist/src/lib/toml-params-validator.js +1 -1
  256. package/dist/src/lib/toml-scalar-edit.d.ts +43 -0
  257. package/dist/src/lib/toml-scalar-edit.js +283 -0
  258. package/dist/src/lib/toml-scalar-edit.js.map +1 -0
  259. package/dist/src/lib/user-selector.d.ts +24 -0
  260. package/dist/src/lib/user-selector.js +33 -0
  261. package/dist/src/lib/user-selector.js.map +1 -0
  262. package/dist/src/lib/version-check.d.ts +25 -0
  263. package/dist/src/lib/version-check.js +77 -8
  264. package/dist/src/lib/version-check.js.map +1 -1
  265. package/dist/src/lib/watch.d.ts +121 -0
  266. package/dist/src/lib/watch.js +169 -0
  267. package/dist/src/lib/watch.js.map +1 -0
  268. package/dist/src/lib/workflow-apply.d.ts +69 -45
  269. package/dist/src/lib/workflow-apply.js +99 -72
  270. package/dist/src/lib/workflow-apply.js.map +1 -1
  271. package/dist/src/lib/workflow-codegen/generator.js +4 -4
  272. package/dist/src/lib/workflow-codegen/generator.js.map +1 -1
  273. package/dist/src/lib/workflow-codegen/invokerIR.d.ts +11 -0
  274. package/dist/src/lib/workflow-codegen/invokerIR.js +5 -0
  275. package/dist/src/lib/workflow-codegen/invokerIR.js.map +1 -1
  276. package/dist/src/lib/workflow-config-apply.d.ts +70 -0
  277. package/dist/src/lib/workflow-config-apply.js +137 -0
  278. package/dist/src/lib/workflow-config-apply.js.map +1 -0
  279. package/dist/src/lib/workflow-config-sidecar.d.ts +63 -0
  280. package/dist/src/lib/workflow-config-sidecar.js +96 -0
  281. package/dist/src/lib/workflow-config-sidecar.js.map +1 -0
  282. package/dist/src/lib/workflow-defaults.d.ts +29 -0
  283. package/dist/src/lib/workflow-defaults.js +41 -0
  284. package/dist/src/lib/workflow-defaults.js.map +1 -0
  285. package/dist/src/lib/workflow-include-preserve.d.ts +76 -0
  286. package/dist/src/lib/workflow-include-preserve.js +286 -0
  287. package/dist/src/lib/workflow-include-preserve.js.map +1 -0
  288. package/dist/src/lib/workflow-payload.d.ts +31 -20
  289. package/dist/src/lib/workflow-payload.js +100 -110
  290. package/dist/src/lib/workflow-payload.js.map +1 -1
  291. package/dist/src/lib/workflow-toml-validator.d.ts +37 -16
  292. package/dist/src/lib/workflow-toml-validator.js +141 -16
  293. package/dist/src/lib/workflow-toml-validator.js.map +1 -1
  294. package/dist/src/types/index.d.ts +78 -22
  295. package/dist/src/validators.d.ts +7 -7
  296. package/dist/src/validators.js +6 -6
  297. package/package.json +11 -6
  298. package/dist/src/commands/settings.d.ts +0 -15
  299. package/dist/src/commands/settings.js +0 -102
  300. package/dist/src/commands/settings.js.map +0 -1
@@ -1,102 +1,123 @@
1
1
  /**
2
- * Shared app-settings sync helpers (issue #1033, Phase 2).
2
+ * Shared app-settings helpers (issue #1033, Phase 2; narrowed by #2645).
3
3
  *
4
4
  * The descriptor-driven `app.toml` round-trip (issue #1033, Phase 1) was born
5
- * inside the big `sync pull` / `sync push` command flow. Phase 2 lifts the
6
- * app-settings-specific pieces here so BOTH surfaces drive them:
5
+ * inside the big `config pull` / `config push` command flow. Phase 2 lifted the
6
+ * app-settings-specific pieces here so both surfaces could drive them. #2645
7
+ * then removed the second surface: `app.toml` is authored like every other
8
+ * configuration file and applied by `config push`, so what is left here is what
9
+ * `sync` calls (`serializeAppSettings`, `writePulledAppSettings`,
10
+ * `collectAppSettingsPushErrors`, `diffAppSettings` for `config diff --only app`)
11
+ * plus the one thing the file cannot answer — `renderAppSettings`, the
12
+ * server-effective view behind `primitive apps get` (#2759).
7
13
  *
8
- * - `sync pull` / `sync push` call the low-level helpers
9
- * (`serializeAppSettings`, `collectAppSettingsPushErrors`)behavior
10
- * unchanged from Phase 1.
11
- * - the new `primitive settings show|pull|push|diff` command
12
- * (`cli/src/commands/settings.ts`) calls the higher-level orchestrators
13
- * (`pullAppSettings`, `pushAppSettings`, `diffAppSettings`, `showAppSettings`).
14
+ * #2880 added the comparison the whole epic is about — `appSettingsFieldDiffs`,
15
+ * `hashAppSettingsForDiff` and `appSettingsNameExcluded` — and removed the last
16
+ * caller of the retired byte-hash/present-only rule (the `settings push`
17
+ * orchestrator #2645 had already unhooked). `app.toml` is now compared field by
18
+ * field against live state by both commands, over the full writable descriptor
19
+ * set, and applied as the whole truth.
14
20
  *
15
- * Both directions share the same `app.toml`, the same field descriptor
16
- * (`cli/src/lib/app-settings-descriptor.ts`), and the same single
17
- * `entities.app.contentHash` sync-state entry, so `settings push` then
18
- * `sync push` (or the reverse) is idempotent the second one skips on the
19
- * unchanged hash.
20
- *
21
- * `googleClientSecret` never leaves the server through here: pull omits it,
22
- * push errors on it (pointing at `primitive apps update --google-client-secret`),
23
- * and `settings show` redacts it in both the rendered and `--json` views.
21
+ * Google is a typed client map here (#2891): `googleClients` renders as
22
+ * `[auth.google.clients.<type>]`, and each entry's `clientSecret` holds a whole
23
+ * `{{secrets.KEY}}` reference, not the secret itself, so the map pulls, pushes,
24
+ * diffs and shows like any other setting. The secrets' values live only in the
25
+ * app secret store (`primitive secrets set`).
24
26
  */
25
27
  import type { ApiClient } from "../lib/api-client.js";
26
28
  import { type AppSettingSection } from "../lib/app-settings-descriptor.js";
29
+ import type { SyncState } from "../types/index.js";
27
30
  /** The app-settings file name inside a sync directory. */
28
31
  export declare const APP_TOML_FILENAME = "app.toml";
29
32
  /** Absolute path to `app.toml` inside a sync directory. */
30
33
  export declare function appTomlPath(configDir: string): string;
31
34
  /**
32
35
  * Serialize server settings into the `app.toml` string (pull direction).
33
- * Descriptor-driven; `googleClientSecret` is never emitted. This is the single
34
- * serializer both `sync pull` and `settings pull` use.
36
+ * Descriptor-driven; this is the single serializer every pull path uses.
35
37
  */
36
38
  export declare function serializeAppSettings(settings: any): string;
37
39
  /**
38
40
  * Write `app.toml` from server settings and return its content hash. Shared by
39
- * `sync pull` and `settings pull` so the two produce byte-identical files and
40
- * the same hash.
41
+ * `config pull` (whole-tree and `--only app`), so the file and the hash have one
42
+ * producer.
41
43
  */
42
44
  export declare function writeAppSettingsToml(configDir: string, settings: any): string;
43
45
  /**
44
- * Validate a parsed `app.toml` for push and return the fatal errors (a
45
- * hand-added secret key, a type mismatch). An empty array means the push may
46
- * proceed. Warnings (unrecognized keys) are intentionally not returned here —
47
- * the caller surfaces those at apply time. Shared by the `sync push` preflight
48
- * and `settings push`.
46
+ * Validate a parsed `app.toml` for push and return the fatal errors (a type
47
+ * mismatch, an unrecognized or retired key, a missing required key). An empty
48
+ * array means the push may proceed. Warnings (advisory notes) are intentionally
49
+ * not returned here — the caller surfaces those at apply time.
50
+ *
51
+ * ONE validator, run by `config push`'s preflight AND by `config diff` (#2880
52
+ * criterion 1): a file diff calls Synced is a file push accepts, and a file
53
+ * push refuses is named by diff with the identical message.
49
54
  */
50
55
  export declare function collectAppSettingsPushErrors(tomlData: Record<string, any>, options?: {
51
56
  isCrossAppPush?: boolean;
57
+ excludeName?: boolean;
52
58
  }): string[];
53
- /** Placeholder shown in `settings show` in place of any secret field value. */
54
- export declare const REDACTED_PLACEHOLDER = "[redacted \u2014 set via: primitive apps update <appId> --google-client-secret]";
55
59
  /**
56
- * Return a copy of the server settings with every secret descriptor field
57
- * (currently `googleClientSecret`) redacted when a secret is stored. Used for
58
- * BOTH the rendered and `--json` outputs of `settings show` so the real secret
59
- * never leaves the server through this command (codex design-review concern #2).
60
+ * Render server-effective settings grouped by `app.toml` section the view
61
+ * `apps get` prints (issue #2759; it was `apps get` before the fold).
60
62
  *
61
- * A secret counts as stored when either:
62
- * - the server sent a truthy raw value a server older than #1603, which
63
- * still returns `googleClientSecret` on GET; or
64
- * - the companion `<field>Set` boolean is true — #1603 made the secret
65
- * write-only, so `GET /settings` omits the raw value entirely and reports
66
- * `googleClientSecretSet` instead. Without this branch a configured secret
67
- * renders as "(not set)", indistinguishable from an unconfigured one.
63
+ * Descriptor-driven on purpose: a new setting appears here by being declared,
64
+ * where the hand-curated block `apps get` used to print showed whichever
65
+ * fields somebody remembered to add.
68
66
  *
69
- * When nothing is stored the field is left untouched, so it renders as
70
- * "(not set)" which is then accurate.
71
- */
72
- export declare function redactSecretFields(settings: Record<string, any>): Record<string, any>;
73
- /**
74
- * `settings show` — render the current server-effective settings grouped by
75
- * `app.toml` section, with `googleClientSecret` redacted. `--json` emits the
76
- * full (redacted) server response.
67
+ * Nothing is redacted (#2256, #2891): the only credential-shaped settings are
68
+ * the per-entry `clientSecret`s inside `googleClients`, and each is a whole
69
+ * `{{secrets.KEY}}` reference rather than the secret itself — so printing one
70
+ * tells the operator which secret is in use rather than leaking one. There is
71
+ * no withheld state left to explain.
72
+ *
73
+ * Takes settings rather than a client, and never exits: `apps get` fetches the
74
+ * app and its settings together and tolerates a settings fetch it is not
75
+ * allowed to make, so failure handling belongs at the call site.
77
76
  */
78
- export declare function showAppSettings(client: ApiClient, appId: string, options?: {
79
- json?: boolean;
80
- }): Promise<void>;
77
+ export declare function renderAppSettings(settings: any): void;
81
78
  /**
82
- * `settings pull` — fetch the server settings, write `app.toml`, and stamp the
83
- * shared `entities.app.contentHash`. Same file and hash as `sync pull`.
79
+ * Write the pulled `app.toml`.
80
+ *
81
+ * The file carries EVERY writable setting as of #2891 — the server withholds
82
+ * nothing, so there is no longer a class of value the pull has to warn about
83
+ * being absent (#2307's warning went with the withholding layer). `config pull`
84
+ * calls this for `app.toml`, whether the pull is whole-tree or `--only app`.
84
85
  */
85
- export declare function pullAppSettings(client: ApiClient, appId: string, configDir: string, options?: {
86
- json?: boolean;
87
- }): Promise<void>;
86
+ export declare function writePulledAppSettings(configDir: string, settings: any, options?: {
87
+ log?: (message: string) => void;
88
+ }): {
89
+ path: string;
90
+ contentHash: string;
91
+ };
88
92
  /**
89
- * `settings push` read `app.toml`, validate (abort before any PUT on a secret
90
- * key or a type mismatch), skip when unchanged since the last sync unless
91
- * `--force`, then apply via `PUT /settings` and re-stamp the shared content
92
- * hash. Cross-app pushes (state's app differs from the target) always apply and
93
- * strip `name`, matching `sync push`.
93
+ * Whether `[app].name` is out of BOTH the comparison and the payload right now
94
+ * (#2880 DSO-001) the cross-app rule, shared so diff and push cannot disagree.
95
+ *
96
+ * A cross-app push (the sync state belongs to a different app) applies the file
97
+ * to the target with `name` excluded, so it never renames the target, and it
98
+ * RECORDS the file's name in `entities.app.excludedName` with the baseline
99
+ * hashed the same way. While that record stands and the file still states that
100
+ * name, the field stays excluded: the target keeps its own name and no phantom
101
+ * difference appears.
102
+ *
103
+ * A file name that DIFFERS from the recorded one is, by construction, a local
104
+ * name edit — the operator changed the line — so the exclusion lifts, the name
105
+ * goes into the payload, and the baseline is restamped with `name` from the
106
+ * server's returned record. It cannot be discovered by comparison instead:
107
+ * `classifyPushChange` only answers `local-edited` when the remote hash equals
108
+ * the baseline, and a baseline stamped without `name` matches neither side once
109
+ * `name` re-enters, so every post-cross-app rename would report `both-changed`.
94
110
  */
95
- export declare function pushAppSettings(client: ApiClient, appId: string, configDir: string, options?: {
96
- json?: boolean;
97
- force?: boolean;
98
- dryRun?: boolean;
99
- }): Promise<void>;
111
+ export declare function appSettingsNameExcluded(input: {
112
+ /** The sync state belongs to a different app than the one being written. */
113
+ isCrossAppPush: boolean;
114
+ /** `entities.app.excludedName` — the name a prior cross-app push left alone. */
115
+ recordedExcludedName?: unknown;
116
+ /** The `[app].name` the local file states right now. */
117
+ fileName?: unknown;
118
+ }): boolean;
119
+ /** `appSettingsNameExcluded` for a caller holding the loaded state (diff). */
120
+ export declare function appSettingsNameExcludedForState(state: SyncState | null, appId: string, tomlData: Record<string, any> | null | undefined): boolean;
100
121
  export interface AppSettingsFieldDiff {
101
122
  field: string;
102
123
  section: AppSettingSection;
@@ -105,10 +126,32 @@ export interface AppSettingsFieldDiff {
105
126
  remote: unknown;
106
127
  }
107
128
  /**
108
- * `settings diff` — report per-field differences between the local `app.toml`
109
- * push payload and the current server settings. Only keys present in the TOML
110
- * are compared, so a server value that equals a descriptor default (and is
111
- * therefore omitted from `app.toml`) is never flagged as a spurious difference.
129
+ * The fields the local `app.toml` and the live settings disagree on (#2880).
130
+ *
131
+ * Compared over the FULL writable descriptor set, not just the keys the file
132
+ * carries: `app.toml` is the whole truth, so a key the file omits is not "no
133
+ * opinion", it is the absent-value the push will send. Both sides run through
134
+ * `projectAppSettingsForComparison`, which applies the same canonicalization
135
+ * and the same `whenSet`-empty flattening to each — so a pulled file compares
136
+ * equal to the server it was pulled from, and a deleted key shows as the clear
137
+ * push would apply.
138
+ *
139
+ * One helper, three callers: `config diff --only app`'s per-field output, the
140
+ * app-settings row in the full `config diff`, and the push gate.
141
+ */
142
+ export declare function appSettingsFieldDiffs(localSettings: Record<string, any>, remoteSettings: Record<string, any> | null | undefined, options?: {
143
+ excludeName?: boolean;
144
+ }): AppSettingsFieldDiff[];
145
+ /**
146
+ * The comparator's hash of one side's app settings — the push gate's
147
+ * `localHash`/`remoteHash`, and the `entities.app.semanticHash` baseline
148
+ * stamped once the two agree (#2880 criterion 6).
149
+ */
150
+ export declare function hashAppSettingsForDiff(settings: Record<string, any> | null | undefined, options?: {
151
+ excludeName?: boolean;
152
+ }): string;
153
+ /**
154
+ * `config diff --only app` — the per-field report, over the full writable set.
112
155
  */
113
156
  export declare function diffAppSettings(client: ApiClient, appId: string, configDir: string, options?: {
114
157
  json?: boolean;