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
@@ -14,6 +14,7 @@
14
14
  * `cli/tests/unit/config-surface-drift-guard.test.ts`) fails if this committed
15
15
  * copy does not match the source.
16
16
  */
17
+ import { type GeminiKeywordVerdict } from "./schema-codegen/generated-schema-descriptor.js";
17
18
  /**
18
19
  * The one definition per configuration object (issue #2644).
19
20
  *
@@ -195,6 +196,21 @@ export interface ConfigField {
195
196
  * Only for a default the server assigns on CREATE and returns on read.
196
197
  */
197
198
  serverDefault?: string | number | boolean;
199
+ /**
200
+ * The field's value is the WHOLE table at its `tomlPath`, keyed by an open
201
+ * set of names: each key of the table is one entry of the map (#6034).
202
+ *
203
+ * `[clients.ios]` and `[clients.web]` are two entries of one field,
204
+ * `clientVersions`, rather than two fields: the names are the author's
205
+ * (platform names), not the definition's. A statement of WHERE the value is
206
+ * authored, like `tomlGroup`, and nothing else: pull writes the map as the
207
+ * table, push reads the table as the map, and the field's handler owns the
208
+ * key set inside each entry. `findBadTableMapDeclarations` holds the table
209
+ * to one such field, with `tomlKey` equal to the table's name.
210
+ */
211
+ tomlTableMap?: {
212
+ note: string;
213
+ };
198
214
  }
199
215
  export interface ConfigTable {
200
216
  /** TOML path, e.g. ["workflow"] for [workflow], ["configs"] for [[configs]]. */
@@ -283,8 +299,7 @@ export type RuleStage = "preflight" | "apply";
283
299
  export type CrossFieldRuleStage = RuleStage;
284
300
  /**
285
301
  * One rule of a configuration object that spans more than one field — `durable
286
- * = true` beside a webhook trigger, `runAs = "system"` beside a non-empty
287
- * `accessRule`, an HMAC scheme with no `signingSecret`.
302
+ * = true` beside a webhook trigger, an HMAC scheme with no `signingSecret`.
288
303
  *
289
304
  * Such a rule belongs to no single field, so `ConfigField.validation` has
290
305
  * nowhere to put it; attaching it to one field arbitrarily would make the
@@ -362,8 +377,9 @@ export interface ConfigObjectSurface {
362
377
  * Declares that this object HAS no TOML field table, with the reason —
363
378
  * required when `tables` is empty and forbidden otherwise.
364
379
  *
365
- * `transform` is the case: a `.rhai` file's authored surface is the script
366
- * body, so there is no key/value table to define. Saying so here is the same
380
+ * `transform` was the case until it retired with the Rhai runtime (#3190): a
381
+ * `.rhai` file's authored surface was the script body, so there was no
382
+ * key/value table to define. Saying so here is the same
367
383
  * rule `notExposed` applies to a field, one level up: "absent from the
368
384
  * registry" and "deliberately fieldless" must not look the same (#2644
369
385
  * criterion 4).
@@ -455,8 +471,8 @@ export declare const DECLARED_ACCESS_MANIFEST_KEYS: Readonly<Record<string, NotE
455
471
  * accepts. What a present key MEANS stays with the per-field handler the
456
472
  * definition names (spec §Contracts, decision of record #1976): the workflow
457
473
  * `status` enum, the non-negative-integer coercion of the queue limits,
458
- * `runAs`'s caller|system check, `parseWorkflowLock`, the `capabilities` array
459
- * shape and the CEL parse of `accessRule` all stay where they are. The
474
+ * `runAs`'s caller|system check, `parseWorkflowLock` and the `capabilities`
475
+ * array shape all stay where they are. The
460
476
  * mechanical win is that a field can no longer be *absent* from the accepted
461
477
  * set.
462
478
  *
@@ -466,10 +482,11 @@ export type WriteMode = "create" | "update";
466
482
  /** The field names this table accepts on the wire in `mode`, in declaration order. */
467
483
  export declare function writableFieldNames(table: ConfigTable, mode: WriteMode): string[];
468
484
  /**
469
- * The field names the server PERSISTS for this table in `mode`: the writable
470
- * fields, plus the `deprecated` classifications — "still writable, superseded
471
- * by another field" is what that kind means (`types.ts`), so a superseded key
472
- * a handler still honors (`passkeyRpId`) belongs in every accepted set, and a
485
+ * The field names the server ACCEPTS for this table in `mode`: the writable
486
+ * fields, plus the `deprecated` classifications — "still accepted, superseded
487
+ * or scheduled for removal" is what that kind means (`types.ts`), so a
488
+ * superseded key a handler still honors (`protected`) and a retired one it
489
+ * accepts and ignores (`accessRule`, #4872) belong in every accepted set, and a
473
490
  * field that is NOT writable belongs in none of them.
474
491
  *
475
492
  * Stated once here because three consumers need the same answer: the generated
@@ -649,6 +666,14 @@ export declare function findUnknownGroupedTomlKeys(tomlTable: unknown, table: Co
649
666
  * as a decision and is not one.
650
667
  */
651
668
  export declare function findBadTomlGroupDeclarations(table: ConfigTable): string[];
669
+ /**
670
+ * Table-map declarations that do not hold together (#6034): a table whose
671
+ * field is the whole table must declare that field alone, no `tomlGroups`
672
+ * and no `tomlOnlyKeys` (the map's keys are the author's names, so no other
673
+ * key can share the table), its `tomlKey` must be the table's own name, and
674
+ * the declaration needs a reason. `[]` means the table is well formed.
675
+ */
676
+ export declare function findBadTableMapDeclarations(table: ConfigTable): string[];
652
677
  /** Top-level TOML keys this object's file accepts: its tables plus the extras. */
653
678
  export declare function acceptedTomlDocumentKeys(surface: ConfigObjectSurface): Set<string>;
654
679
  /**
@@ -980,11 +1005,11 @@ export declare function findUnreachedPreflightRules(surface: ConfigObjectSurface
980
1005
  *
981
1006
  * ── What the schema says, and what it deliberately does not ──────────────
982
1007
  * It states the KEY SET only: each property is the empty schema (or carries
983
- * only the `deprecated` annotation, #1815), so no value is type-checked here. That is the decision of record (#1976, carried forward at
984
- * #2644's design gate): the definition classifies, handlers behave. The
985
- * `status` enum, the queue limits' integer coercion, `runAs`'s caller|system
986
- * check, the CEL parse of `accessRule` — all stay in the handlers the
987
- * definition names, with their existing messages. Adding type gates here would
1008
+ * only the `deprecated` annotation, #1815), so no value is type-checked here.
1009
+ * That is the decision of record (#1976, carried forward at #2644's design
1010
+ * gate): the definition classifies, handlers behave. The `status` enum, the
1011
+ * queue limits' integer coercion, the CEL parse of a rule set's expressions —
1012
+ * all stay in the handlers the definition names, with their existing messages. Adding type gates here would
988
1013
  * duplicate them and start rejecting values the handlers accept.
989
1014
  *
990
1015
  * ── Which keys are in the set ────────────────────────────────────────────
@@ -1017,7 +1042,8 @@ export interface ConfigRequestSchema {
1017
1042
  type: "object";
1018
1043
  /**
1019
1044
  * Each property is the empty schema, or `{ deprecated: true }` for a field
1020
- * the definition marks `deprecated` (#1815). `deprecated` is an OpenAPI
1045
+ * the definition marks `deprecated` (#1815) or a key `notExposed` classifies
1046
+ * `deprecated` (#4872). `deprecated` is an OpenAPI
1021
1047
  * annotation: it constrains no value, so the schema still states the key set
1022
1048
  * and nothing more.
1023
1049
  */
@@ -1089,7 +1115,7 @@ export declare function unknownRequestKeysMessage(keys: readonly string[]): stri
1089
1115
  * retired key: the TOML wording for `config push` (which can tell the author to
1090
1116
  * delete a line) and the request wording for the API handlers (which cannot).
1091
1117
  *
1092
- * Keyed by the table's TOML path prefix (`workflow`, `cronTrigger`, …), because
1118
+ * Keyed by the table's TOML path prefix (`integration`, `prompt`, …), because
1093
1119
  * that is the identifier both consumers already have in hand.
1094
1120
  *
1095
1121
  * Pure: no models, no tenant context, no `env` (see `types.ts` §Purity).
@@ -1101,6 +1127,51 @@ export interface RetiredConfigKey {
1101
1127
  request: string;
1102
1128
  }
1103
1129
  export declare const RETIRED_CONFIG_KEYS: Record<string, Record<string, RetiredConfigKey>>;
1130
+ /**
1131
+ * Keys DEPRECATED on a configuration object's write surface: still accepted
1132
+ * in TOML and on the wire, ignored, and scheduled for removal.
1133
+ *
1134
+ * A deprecated key sits between a live field and a retired one. The table
1135
+ * classifies it `deprecated` in both `notExposed` (so a body that still sends
1136
+ * it is accepted) and `tomlOnlyKeys` (so a file that still carries it
1137
+ * validates); this registry holds the one sentence `config push` prints for a
1138
+ * file that carries it, and is what `config pull` keys its forced rewrite on,
1139
+ * so the pull the sentence names removes the line.
1140
+ *
1141
+ * Keyed by the table's TOML path prefix, like `RETIRED_CONFIG_KEYS`. The
1142
+ * scheduled break moves an entry from here to that map.
1143
+ */
1144
+ export interface DeprecatedConfigKey {
1145
+ /** What `config push` says, once per file, about a file that carries the key. */
1146
+ toml: string;
1147
+ }
1148
+ export declare const DEPRECATED_CONFIG_KEYS: Record<string, Record<string, DeprecatedConfigKey>>;
1149
+ /** The deprecated-key entry for `key` under `prefix`, or null when it is not deprecated. */
1150
+ export declare function deprecatedConfigKey(prefix: string, key: string): DeprecatedConfigKey | null;
1151
+ /**
1152
+ * Config-tree directories whose object type retired — #3190, server-functions
1153
+ * phase 7. The DSL engine, the Rhai runtime and the standalone webhook and
1154
+ * cron objects are gone, so `config push` refuses a tree that still holds one
1155
+ * of these directories, by name and before it writes anything, rather than
1156
+ * ignoring files an author still expects to take effect.
1157
+ *
1158
+ * Each entry is one sentence: what retired, what replaces it, and the docs page
1159
+ * that shows the replacement.
1160
+ */
1161
+ export declare const RETIRED_CONFIG_DIRECTORIES: Record<string, string>;
1162
+ /**
1163
+ * The type-config directories a config tree no longer has (#4731, project
1164
+ * `role-based-groups-collections`). Groups and collections have fixed roles,
1165
+ * so their per-type configuration retired with its routes; `config push`
1166
+ * refuses a tree that still holds a file in either, naming each file, rather
1167
+ * than ignoring files an author still expects to take effect. The rows the
1168
+ * server already stored are not touched.
1169
+ *
1170
+ * Each entry is one sentence: what retired, and what replaces it.
1171
+ */
1172
+ export declare const RETIRED_TYPE_CONFIG_DIRECTORIES: Record<string, string>;
1173
+ /** The retirement sentence for a config-tree directory, or null when it is live. */
1174
+ export declare function retiredConfigDirectory(dir: string): string | null;
1104
1175
  /**
1105
1176
  * Top-level TOML tables a configuration object's FILE retired — keyed by the
1106
1177
  * surface's label, then by the table key. Only the TOML half exists: these were
@@ -1131,10 +1202,29 @@ export interface RetiredTomlSpelling {
1131
1202
  */
1132
1203
  export declare const RETIRED_TOML_SPELLINGS: Record<string, Record<string, RetiredTomlSpelling>>;
1133
1204
  /**
1134
- * The TOML guidance for `key` under `prefix`: a fully retired key's, else a
1135
- * retired spelling's, else null when the key is simply unknown.
1205
+ * A key one surface refuses while another surface of the same TOML prefix
1206
+ * takes it: the prefix alone cannot pick the sentence.
1136
1207
  */
1137
- export declare function retiredTomlKey(prefix: string, key: string): RetiredTomlSpelling | null;
1208
+ export interface RetiredSurfaceTomlKey extends RetiredTomlSpelling {
1209
+ /**
1210
+ * An empty string is accepted and ignored rather than refused: the
1211
+ * placeholder every earlier `config pull` wrote, which a refusal would turn
1212
+ * into a failed first push of every existing tree.
1213
+ */
1214
+ emptyAccepted?: boolean;
1215
+ }
1216
+ /**
1217
+ * Guidance keyed by surface label, then TOML prefix, then key — consulted
1218
+ * before `RETIRED_CONFIG_KEYS` and `RETIRED_TOML_SPELLINGS` when the caller
1219
+ * knows the surface.
1220
+ */
1221
+ export declare const RETIRED_SURFACE_TOML_KEYS: Record<string, Record<string, Record<string, RetiredSurfaceTomlKey>>>;
1222
+ /**
1223
+ * The TOML guidance for `key` under `prefix`: the surface's own when
1224
+ * `surfaceLabel` names one, else a fully retired key's, else a retired
1225
+ * spelling's, else null when the key is simply unknown.
1226
+ */
1227
+ export declare function retiredTomlKey(prefix: string, key: string, surfaceLabel?: string): RetiredSurfaceTomlKey | null;
1138
1228
  /**
1139
1229
  * The capability grammar for server functions — #3182 phase 1, rewritten by
1140
1230
  * #3279 (project `server-functions` phase 3).
@@ -1157,7 +1247,10 @@ export declare function retiredTomlKey(prefix: string, key: string): RetiredToml
1157
1247
  * `secret:<NAME>` credential least privilege — which secret VALUES may
1158
1248
  * cross into the sandbox at all;
1159
1249
  * the high-blast list {@link HIGH_BLAST_CAPABILITIES} — the operations
1160
- * whose blast radius the intent keeps opt-in.
1250
+ * whose blast radius the intent keeps opt-in;
1251
+ * the subject grants {@link SUBJECT_GRANT_CAPABILITIES} — naming another
1252
+ * member on a call about one user, in a run a plain
1253
+ * member invoked.
1161
1254
  *
1162
1255
  * Every other string a function used to declare is RETIRED, and the grammar
1163
1256
  * says so by name: an author who still writes `database:orders/Order:read`
@@ -1210,15 +1303,57 @@ export declare const KEYED_GRANT_FAMILIES: readonly ["integration", "secret"];
1210
1303
  * other — `databases:create` is not permission to delete a database.
1211
1304
  *
1212
1305
  * The database ROLE mutations are here because they hand out persistent
1213
- * authority: a group grant assigns the manager role (D3279-003). App deletion
1306
+ * authority: a group grant assigns the manager role (D3279-003). A db3's sync
1307
+ * switch (`db3:setSync`, the intent's `db3-sync` grant) is here because
1308
+ * turning sync off suspends every grant on the db3 (#4799); a db3's transfer
1309
+ * and its owner-row change (`db3:transfer`, `db3:setOwnerRow`, the intent's
1310
+ * `db3-grant` grant) because they move who holds the db3 and its owner row
1311
+ * (#4800); its app access (`db3:setAppAccess`, the same grant's third string)
1312
+ * because it grants the db3 to every user of the app (#4801); its public
1313
+ * access (`db3:setPublicAccess`) because it lets the db3 be served to callers
1314
+ * who hold no sharing level on it (#5842). App deletion
1214
1315
  * and secret writes have no app-API route today; they are recorded, not gated,
1215
1316
  * and the profile generator refuses to admit a future such route without a row
1216
1317
  * here (`HIGH_BLAST_WATCH` in `scripts/lib/function-profile.mjs`).
1217
1318
  */
1218
- export declare const HIGH_BLAST_CAPABILITIES: readonly ["databases:create", "databases:delete", "databases:transferOwnership", "databases:addManager", "databases:revokePermission", "databases:grantGroupPermission", "databases:revokeGroupPermission", "users:remove", "users:setRole", "blobBuckets:createBucket", "blobBuckets:deleteBucket"];
1219
- /** The exact strings, which since #3279 are exactly the high-blast list. */
1220
- export declare const EXACT_GRANT_STRINGS: readonly ["databases:create", "databases:delete", "databases:transferOwnership", "databases:addManager", "databases:revokePermission", "databases:grantGroupPermission", "databases:revokeGroupPermission", "users:remove", "users:setRole", "blobBuckets:createBucket", "blobBuckets:deleteBucket"];
1221
- export type GrantFamily = (typeof KEYED_GRANT_FAMILIES)[number] | "databases" | "users" | "blobBuckets";
1319
+ export declare const HIGH_BLAST_CAPABILITIES: readonly ["databases:create", "databases:delete", "databases:transferOwnership", "databases:addManager", "databases:revokePermission", "databases:grantGroupPermission", "databases:revokeGroupPermission", "users:remove", "users:setRole", "blobBuckets:createBucket", "blobBuckets:deleteBucket", "db3:setSync", "db3:transfer", "db3:setOwnerRow", "db3:setAppAccess", "db3:setPublicAccess"];
1320
+ /**
1321
+ * The subject grants — #4909.
1322
+ *
1323
+ * A run a plain member invoked may name nobody but its caller on a call that
1324
+ * is about one user (#4142's subject rule): `SUBJECT_USER_FORBIDDEN`. A
1325
+ * function whose own code chooses that user — a class's teacher removing a
1326
+ * student and reading where else the student is enrolled — declares it here,
1327
+ * in a line a reviewer can find:
1328
+ *
1329
+ * `users:readAny` the user-subject READS may name another member
1330
+ * (memberships, a member's collections, their db3s
1331
+ * (owned and shared), inbox, devices, agent sessions);
1332
+ * `users:actAsAny` the calls that ACT as a member may name another member
1333
+ * (marking their notifications read, their devices, an
1334
+ * agent session as them, `ctx.db3` `asUser`, their
1335
+ * aliases).
1336
+ *
1337
+ * Each admits only its own kind. Neither changes a run with no caller, an
1338
+ * owner- or admin-invoked run, or a run an agent drives (refused either way),
1339
+ * and a nested child reads its own version's. They are not high-blast rows:
1340
+ * those are 1:1 with an operation id, and these name a rule, not an operation.
1341
+ */
1342
+ export declare const SUBJECT_GRANT_CAPABILITIES: readonly ["users:readAny", "users:actAsAny"];
1343
+ /**
1344
+ * The gateway-reserved operations a function opts into — #5849.
1345
+ *
1346
+ * `tokens:sign` `ctx.actionTokens.sign`: mint a signed link to a function
1347
+ * of the app (an action token).
1348
+ *
1349
+ * Not high-blast rows: those are 1:1 with an operation id, and these name a
1350
+ * gateway-reserved path with no app-API route. A version declaring one is
1351
+ * write-capable for the public-writer lint and the cache rule.
1352
+ */
1353
+ export declare const RESERVED_OPERATION_CAPABILITIES: readonly ["tokens:sign"];
1354
+ /** The exact strings: the high-blast list, the subject grants and the reserved operations. */
1355
+ export declare const EXACT_GRANT_STRINGS: readonly string[];
1356
+ export type GrantFamily = (typeof KEYED_GRANT_FAMILIES)[number] | "databases" | "users" | "blobBuckets" | "db3" | "tokens";
1222
1357
  /**
1223
1358
  * The retired FAMILIES (#3279), each with the reason it is gone.
1224
1359
  *
@@ -1420,7 +1555,37 @@ export declare function validateKeyedGrantsAgainstTargets(grants: readonly Funct
1420
1555
  * A version-1 manifest still parses: it records registrations only.
1421
1556
  */
1422
1557
  export declare const FUNCTION_MANIFEST_SCHEMA_VERSION = 2;
1423
- export declare const FUNCTION_MANIFEST_SCHEMA_VERSIONS: readonly [1, 2];
1558
+ export declare const FUNCTION_MANIFEST_SCHEMA_VERSIONS: readonly [1, 2, 3];
1559
+ /**
1560
+ * Version 3 (#4730) adds what a version's `authorize` admits: the
1561
+ * `authorize` block and the `writeFamilies` its handler reaches. Only a
1562
+ * FLAGGED build emits it — the manifest is inside the envelope hash, so a
1563
+ * universal bump would make every untouched bare-handler tree a new version
1564
+ * on its next push. A bare-handler tree keeps emitting version 2.
1565
+ */
1566
+ export declare const FUNCTION_MANIFEST_AUTHORIZE_SCHEMA_VERSION = 3;
1567
+ /** The `auth.*` families an `authorize` can read, as the manifest names them. */
1568
+ export declare const AUTH_FAMILIES: readonly ["auth.user", "auth.trigger", "auth.memberships", "auth.collections", "auth.doc", "auth.db", "auth.db3", "auth.configVar", "auth.actionToken", "auth.invitation"];
1569
+ /**
1570
+ * The `auth.*` families whose admission is the caller's own — #5849: a token
1571
+ * admits only its holder, so a cached answer must never stand in for it.
1572
+ * `cacheSeconds` on a version whose manifest shows one is refused. Each maps
1573
+ * to the helper its refusal names.
1574
+ */
1575
+ export declare const UNCACHEABLE_AUTH_FAMILIES: readonly ["auth.actionToken"];
1576
+ /** The SDK helpers that build an `authorize`, as the manifest names them. */
1577
+ export declare const AUTHORIZE_HELPERS: readonly ["allowAnyone", "allowCallers", "requireSignedIn", "requireRole", "requireMember", "requireCollectionRole", "requireDocumentOwner", "requirePublicDb3", "requireDb3Level", "requireToken", "requireInvitation"];
1578
+ /**
1579
+ * The helpers that admit by a token the caller presents (#5848): what admits
1580
+ * is the token alone, so their answers are never cached, and push refuses
1581
+ * `cacheSeconds` on a version whose manifest shows one. `requireToken` is
1582
+ * refused by its family instead, through {@link UNCACHEABLE_AUTH_FAMILIES}.
1583
+ */
1584
+ export declare const TOKEN_ADMITTING_HELPERS: readonly string[];
1585
+ /** The `auth.*` families only a token-admitting helper reads (#5848). */
1586
+ export declare const TOKEN_ADMITTING_AUTH_FAMILIES: readonly string[];
1587
+ /** How many function keys an `allowCallers` block may list. */
1588
+ export declare const MAX_MANIFEST_CALLER_FUNCTIONS = 200;
1424
1589
  /** Bounds, so a manifest cannot be a way to store an unbounded blob. */
1425
1590
  export declare const MAX_MANIFEST_QUERIES = 200;
1426
1591
  export declare const MAX_MANIFEST_NAME_LENGTH = 120;
@@ -1471,6 +1636,41 @@ export interface ManifestQuery {
1471
1636
  /** True when a `$caller` binding scopes this registration. */
1472
1637
  callerScoped: boolean;
1473
1638
  }
1639
+ /** The doors an `allowCallers` admits, as collected (#4730). */
1640
+ export interface ManifestAuthorizeCallers {
1641
+ webhook: boolean;
1642
+ cron: boolean;
1643
+ manual: boolean;
1644
+ /** The parent function keys the `functions` arm names. */
1645
+ functions: string[];
1646
+ /** `true`, `false`, or `"rule"` when the arm is an authorize function. */
1647
+ agents: boolean | "rule";
1648
+ /** `"rule"` when a `users` arm is present, else false. */
1649
+ users: false | "rule";
1650
+ /**
1651
+ * #4803 — the db3 flush door. Optional: a manifest collected before the door
1652
+ * existed carries no key, and absent reads as closed.
1653
+ */
1654
+ db3?: boolean;
1655
+ /**
1656
+ * #5393 — a users walk's batch door: `true` for every walk, or the keys of
1657
+ * the functions whose walks are admitted. Optional like `db3`: absent reads
1658
+ * as closed.
1659
+ */
1660
+ usersBatch?: boolean | string[];
1661
+ }
1662
+ /** What a version's `authorize` admits, as collected (#4730). */
1663
+ export interface ManifestAuthorize {
1664
+ present: true;
1665
+ /** `allowAnyone()`, or an `allowCallers` whose users or agents rule is one. */
1666
+ public: boolean;
1667
+ /** The SDK helper that built the exported `authorize`, or null when hand-written. */
1668
+ helper: string | null;
1669
+ /** The doors, when the helper is `allowCallers`; else null. */
1670
+ callers: ManifestAuthorizeCallers | null;
1671
+ /** The `auth.*` families the authorize code reaches, sorted. */
1672
+ families: string[];
1673
+ }
1474
1674
  export interface FunctionManifest {
1475
1675
  schemaVersion: number;
1476
1676
  queries: ManifestQuery[];
@@ -1489,6 +1689,13 @@ export interface FunctionManifest {
1489
1689
  * empty `models` list does not.
1490
1690
  */
1491
1691
  dynamicModels: boolean;
1692
+ /**
1693
+ * Version 3 only: the families on which the scan met a write or send verb.
1694
+ * Absent on versions 1 and 2, which readers treat as `[]`.
1695
+ */
1696
+ writeFamilies?: string[];
1697
+ /** Version 3 only: the `authorize` block. Absent on 1 and 2 (read as null). */
1698
+ authorize?: ManifestAuthorize;
1492
1699
  }
1493
1700
  export interface ParsedManifest {
1494
1701
  ok: boolean;
@@ -1503,6 +1710,139 @@ export interface ParsedManifest {
1503
1710
  * and whether the author meant any of it are questions this cannot answer.
1504
1711
  */
1505
1712
  export declare function parseFunctionManifest(value: unknown): ParsedManifest;
1713
+ /**
1714
+ * Whether a top-level input schema is one the closed-schema default leaves
1715
+ * OPEN under its union exemption — #4730, criterion 9.
1716
+ *
1717
+ * The validator closes an object against the root's OWN `properties` only,
1718
+ * so a root whose `anyOf` or `oneOf` members declare `properties` of their
1719
+ * own would, closed, refuse the very keys its members declare. Such a root is
1720
+ * left open, and `config push` warns its author to say `additionalProperties`
1721
+ * explicitly. Shared by the server (`closedInputSchemaFor`) and the CLI's
1722
+ * push warning, so both sides read one rule.
1723
+ */
1724
+ export declare function inputSchemaRootLeftOpen(schema: unknown): boolean;
1725
+ /**
1726
+ * The schema a flagged version validates against — #4730, criterion 9.
1727
+ *
1728
+ * A top-level object schema that sets no `additionalProperties` reads as
1729
+ * closed: a shallow copy with `additionalProperties: false`. Every other
1730
+ * schema is answered as it is — an explicit `additionalProperties`, a
1731
+ * non-object root, an empty `{}`, and a root left open under
1732
+ * {@link inputSchemaRootLeftOpen}. Nested objects are not touched. Applied at
1733
+ * run time and never written to the header.
1734
+ */
1735
+ export declare function closedObjectSchema(schema: Record<string, unknown>): Record<string, unknown>;
1736
+ /** The `rate` tiers a public function may name under `[function] public`. */
1737
+ export declare const PUBLIC_RATE_TIERS: readonly ["low", "medium", "high"];
1738
+ /** The most seconds `public.cacheSeconds` may name. */
1739
+ export declare const PUBLIC_CACHE_SECONDS_MAX = 300;
1740
+ /**
1741
+ * The normalized options of `[function] public` written as a table. Only the
1742
+ * options the table sets are present; `turnstile = false` is dropped.
1743
+ */
1744
+ export interface PublicOptions {
1745
+ /** Signed-out answers are cached for this many seconds, 1 to 300. */
1746
+ cacheSeconds?: number;
1747
+ /** Signed-out calls may come from any origin. */
1748
+ cors?: "*";
1749
+ /** Signed-out calls carry a Turnstile token. */
1750
+ turnstile?: true;
1751
+ /** The per-IP tier signed-out calls are held to. */
1752
+ rate?: (typeof PUBLIC_RATE_TIERS)[number];
1753
+ }
1754
+ /** The code every refusal of a malformed `public` answers. */
1755
+ export declare const PUBLIC_OPTIONS_INVALID_CODE = "FUNCTION_PUBLIC_OPTIONS_INVALID";
1756
+ /**
1757
+ * `[function] public`, read from the authored TOML's `[function]` table, with
1758
+ * its options: `true`, `false`, or a table of
1759
+ * `{ cacheSeconds, cors, turnstile, rate }`. A table means public exactly as
1760
+ * `true` does. `options` holds what the table sets, normalized, and is null
1761
+ * when it sets nothing. A value outside the grammar is refused with a
1762
+ * sentence naming the key, the value and what is allowed. Read by the CLI's
1763
+ * preflight and by the server from the envelope's TOML.
1764
+ */
1765
+ export declare function declaredPublicOptionsOf(functionTable: unknown): {
1766
+ ok: true;
1767
+ declared: boolean;
1768
+ options: PublicOptions | null;
1769
+ } | {
1770
+ ok: false;
1771
+ error: string;
1772
+ code: typeof PUBLIC_OPTIONS_INVALID_CODE;
1773
+ };
1774
+ /**
1775
+ * `[function] public`, read from the authored TOML's `[function]` table —
1776
+ * #4730, criterion 13. Absent reads as false; a valid table of options reads
1777
+ * as true; anything else is refused. Read by the CLI's preflight and by the
1778
+ * server from the envelope's TOML.
1779
+ */
1780
+ export declare function declaredPublicOf(functionTable: unknown): {
1781
+ ok: true;
1782
+ value: boolean;
1783
+ } | {
1784
+ ok: false;
1785
+ error: string;
1786
+ };
1787
+ /**
1788
+ * The options string push stores on the version: the normalized options as
1789
+ * JSON, or null when the table sets none (nothing is written then).
1790
+ */
1791
+ export declare function serializePublicOptions(options: PublicOptions | null): string | null;
1792
+ /**
1793
+ * The options a version stores, read back from its string. Absent reads as
1794
+ * null. A string that is not JSON, not an object, or holds anything push
1795
+ * would not have written throws, so a reader refuses it rather than reading
1796
+ * it as no options.
1797
+ */
1798
+ export declare function parseStoredPublicOptions(stored: unknown): PublicOptions | null;
1799
+ /**
1800
+ * What makes a version write-capable for the public-writer lint — #4730: a
1801
+ * mutation registration, a family the manifest records a write or send verb
1802
+ * on, or a declared `integration:<key>`, high-blast or subject-grant
1803
+ * capability (#4909: a function anyone may invoke that names any member is
1804
+ * the same hazard). One phrase per reason, for the refusal to quote.
1805
+ */
1806
+ export declare function writeCapableReasons(manifest: FunctionManifest | null, capabilities: readonly string[]): string[];
1807
+ /**
1808
+ * The public-writer refusal — #4730, criterion 13: a version whose manifest
1809
+ * records `authorize.public` (an `allowAnyone()`, or an `allowCallers` arm
1810
+ * that is one) and that is write-capable needs `public = true` under
1811
+ * `[function]`. The sentence names the function, what makes it write-capable
1812
+ * and the fix; null when the push is fine. The CLI refuses at preflight and
1813
+ * the server at push, from this one rule.
1814
+ */
1815
+ export declare function publicWriterRefusal(input: {
1816
+ functionKey: string;
1817
+ manifest: FunctionManifest | null;
1818
+ capabilities: readonly string[];
1819
+ declaredPublic: boolean;
1820
+ }): string | null;
1821
+ /** The codes {@link publicOptionsRefusal} answers. */
1822
+ export type PublicOptionsRefusalCode = "FUNCTION_PUBLIC_CACHE_WRITE_CAPABLE" | "FUNCTION_PUBLIC_CACHE_WITH_TURNSTILE" | "FUNCTION_PUBLIC_CACHE_TOKEN_ADMITTED" | "FUNCTION_PUBLIC_CACHE_UNCACHEABLE_HELPER";
1823
+ /**
1824
+ * The push rules on `[function] public` options: `cacheSeconds` on a
1825
+ * write-capable version (the public-writer lint's reasons) is refused,
1826
+ * because a cached answer would stand in for a run that writes; and
1827
+ * `cacheSeconds` with `turnstile = true` is refused, because a cached answer
1828
+ * would be served without the check; and `cacheSeconds` on a version whose
1829
+ * manifest shows a token-admitting helper (`requireInvitation`, by helper or
1830
+ * by its `auth.invitation` family) is refused, because its answers are never
1831
+ * cached (#5848); and `cacheSeconds` on a version whose manifest shows an
1832
+ * uncacheable family (#5849: `requireToken`'s `auth.actionToken`) is
1833
+ * refused, because each answer belongs to the caller the helper admitted.
1834
+ * The CLI refuses at preflight and the server at push, from this one rule;
1835
+ * null when the options are fine.
1836
+ */
1837
+ export declare function publicOptionsRefusal(input: {
1838
+ functionKey: string;
1839
+ options: PublicOptions | null;
1840
+ manifest: FunctionManifest | null;
1841
+ capabilities: readonly string[];
1842
+ }): {
1843
+ code: PublicOptionsRefusalCode;
1844
+ message: string;
1845
+ } | null;
1506
1846
  /**
1507
1847
  * The runtime keys a `functions/<key>.toml` no longer decides anything with —
1508
1848
  * #3482 retired them, and #3188 (project `server-functions` phase 5) refuses
@@ -1671,6 +2011,12 @@ export declare function hasRetiredDatabaseTriggerBlock(functionTable: unknown):
1671
2011
  * as ignored by `ignoredFunctionKeys` in `function-retired-keys.ts`.
1672
2012
  */
1673
2013
  /** A function's single webhook trigger, normalized. */
2014
+ /**
2015
+ * The db3 type-name prefix the platform reserves for its own types (#4882,
2016
+ * project `agent-sessions-db3`): no app pushes, attaches or watches a type
2017
+ * whose name starts with it.
2018
+ */
2019
+ export declare const RESERVED_DB3_TYPE_PREFIX = "primitive:";
1674
2020
  export interface WebhookTriggerDeclaration {
1675
2021
  verificationScheme: string;
1676
2022
  signingSecret?: string;
@@ -1681,7 +2027,28 @@ export interface WebhookTriggerDeclaration {
1681
2027
  secretGracePeriodMs?: number;
1682
2028
  /** `[function.triggers.webhook.verification]` — the row's `config`. */
1683
2029
  verification?: Record<string, unknown>;
2030
+ /**
2031
+ * `[[function.triggers.webhook.handshakeRules]]` — a provider's setup
2032
+ * handshake (Slack `url_verification`, Discord PING, Microsoft Graph
2033
+ * `validationToken`, Meta `hub.challenge`), answered by the receiver after
2034
+ * verification and before the function runs (#3190).
2035
+ */
2036
+ handshakeRules?: WebhookHandshakeRuleDeclaration[];
2037
+ /** `allowedIpCidrs` — the sender addresses a delivery may come from (#3190). */
2038
+ allowedIpCidrs?: string[];
1684
2039
  }
2040
+ /** One handshake rule: a CEL `when` and the response it answers with. */
2041
+ export interface WebhookHandshakeRuleDeclaration {
2042
+ when: string;
2043
+ response: {
2044
+ status?: number;
2045
+ contentType?: string;
2046
+ body?: string;
2047
+ };
2048
+ }
2049
+ /** The most handshake rules and allowlist entries one webhook block may carry. */
2050
+ export declare const MAX_WEBHOOK_HANDSHAKE_RULES = 10;
2051
+ export declare const MAX_WEBHOOK_IP_CIDRS = 50;
1685
2052
  /** One `[[function.triggers.cron]]` entry, normalized. */
1686
2053
  export interface CronTriggerDeclaration {
1687
2054
  name: string;
@@ -1690,9 +2057,20 @@ export interface CronTriggerDeclaration {
1690
2057
  overlapPolicy?: string;
1691
2058
  rootInput?: unknown;
1692
2059
  }
2060
+ /** One `[[function.triggers.db3]]` entry, normalized (#4803). */
2061
+ export interface Db3TriggerDeclaration {
2062
+ /** The db3 type whose flushes start the function. */
2063
+ type: string;
2064
+ }
1693
2065
  export interface TriggerDeclaration {
1694
2066
  webhook: WebhookTriggerDeclaration | null;
1695
2067
  cron: CronTriggerDeclaration[];
2068
+ /**
2069
+ * `[[function.triggers.db3]]` — present only when the file declares at least
2070
+ * one entry, so a file written before the kind existed stores exactly the
2071
+ * JSON it stored before (#4803).
2072
+ */
2073
+ db3?: Db3TriggerDeclaration[];
1696
2074
  }
1697
2075
  export declare const EMPTY_TRIGGER_DECLARATION: TriggerDeclaration;
1698
2076
  /**
@@ -1704,13 +2082,19 @@ export declare const EMPTY_TRIGGER_DECLARATION: TriggerDeclaration;
1704
2082
  * remaining slots for the other 40+ objects the cap is sized for.
1705
2083
  */
1706
2084
  export declare const MAX_CRON_TRIGGERS_PER_FUNCTION = 10;
2085
+ /**
2086
+ * The most db3 types one function may watch — the cron cap's per-object
2087
+ * reasoning (#4803). The per-app ceiling is `MAX_DB3_TRIGGERS_PER_APP`, checked
2088
+ * at the push boundary.
2089
+ */
2090
+ export declare const MAX_DB3_TRIGGERS_PER_FUNCTION = 10;
1707
2091
  /**
1708
2092
  * The rule ids this module owns — one per refusal, declared on the `function`
1709
2093
  * surface (#3374). The union below closes `refuseTrigger`'s id parameter, so a
1710
2094
  * twenty-seventh refusal cannot compile without a twenty-seventh id, and that
1711
2095
  * id fails `cli-unit-tests` until the surface declares it (#3373's anchor).
1712
2096
  */
1713
- export declare const TRIGGER_RULE_IDS: readonly ["triggers-table", "trigger-kind", "database-trigger-removed", "webhook-trigger-single", "webhook-trigger-table", "webhook-trigger-keys", "webhook-trigger-scheme-required", "webhook-trigger-scheme-none", "webhook-trigger-number", "webhook-trigger-dedup-boolean", "webhook-trigger-verification-table", "cron-trigger-cap", "cron-trigger-entry", "cron-trigger-keys", "cron-trigger-name-required", "cron-trigger-name-charset", "cron-trigger-duplicate", "cron-trigger-expression-required", "cron-trigger-overlap-policy"];
2097
+ export declare const TRIGGER_RULE_IDS: readonly ["triggers-table", "trigger-kind", "database-trigger-removed", "webhook-trigger-single", "webhook-trigger-table", "webhook-trigger-keys", "webhook-trigger-scheme-required", "webhook-trigger-scheme-none", "webhook-trigger-number", "webhook-trigger-dedup-boolean", "webhook-trigger-verification-table", "webhook-trigger-handshake-rules", "webhook-trigger-ip-allowlist", "cron-trigger-cap", "cron-trigger-entry", "cron-trigger-keys", "cron-trigger-name-required", "cron-trigger-name-charset", "cron-trigger-duplicate", "cron-trigger-expression-required", "cron-trigger-overlap-policy", "db3-trigger-cap", "db3-trigger-entry", "db3-trigger-keys", "db3-trigger-type-required", "db3-trigger-type-reserved", "db3-trigger-duplicate"];
1714
2098
  export type TriggerRuleId = (typeof TRIGGER_RULE_IDS)[number];
1715
2099
  /**
1716
2100
  * A broken trigger rule. `ruleId` names which one, for a reader that wants to
@@ -1751,6 +2135,18 @@ export declare function storedDatabaseTriggerTypes(stored: unknown): string[];
1751
2135
  export declare function cronTriggerKeyFor(functionKey: string, name: string): string;
1752
2136
  /** The entry name a `<functionKey>:<name>` trigger key carries. */
1753
2137
  export declare function cronTriggerNameFrom(functionKey: string, triggerKey: string): string;
2138
+ /**
2139
+ * The `ServerFunctionTrigger.triggerKey` a db3 entry owns (#4803):
2140
+ * `<functionKey>:db3:<type>`. A cron name cannot hold `:`, so the key never
2141
+ * collides with a cron entry's `<functionKey>:<name>`.
2142
+ */
2143
+ export declare function db3TriggerKeyFor(functionKey: string, type: string): string;
2144
+ /**
2145
+ * The type a db3 trigger key carries, or null when the key is not this
2146
+ * function's db3 key. Read by stripping the prefix, never by splitting: a type
2147
+ * name may hold `:` and `/`.
2148
+ */
2149
+ export declare function db3TriggerTypeFrom(functionKey: string, triggerKey: string): string | null;
1754
2150
  /**
1755
2151
  * The `{{secrets.KEY}}` reference SHAPE, decided from the value alone.
1756
2152
  *
@@ -1953,78 +2349,6 @@ export declare function validateSigningSecretDeclaration(input: {
1953
2349
  verificationScheme: string;
1954
2350
  signingSecret?: unknown;
1955
2351
  }): SigningSecretRuleError | null;
1956
- /**
1957
- * The workflow rules two runners share (#3374, project `cli-server-rule-parity`
1958
- * phase 2; intent §Success criteria 3).
1959
- *
1960
- * ── One predicate, two messages ──────────────────────────────────────────
1961
- *
1962
- * `runAs = "system"` beside a non-empty `accessRule` is dead config: a system
1963
- * run can only be started by the system and never evaluates its access rule
1964
- * (#1258, broadening #1172). The server refused it at save time
1965
- * (`validateWorkflowIdentityConfig`) and the CLI refused it in the push
1966
- * preflight (`validateWorkflowIdentity`), and the two carried the conjunction
1967
- * byte-for-byte as separate copies kept in step by a comment. This module is
1968
- * the one copy: it decides, and returns a STRUCTURED violation — the rule id
1969
- * and the server's sentence — that each site renders in its own words. The
1970
- * server pushes the sentence into its `string[]`; the CLI keeps its own hint,
1971
- * which names the preflight remedy. Neither message changed.
1972
- *
1973
- * ── Why a `*-rules.ts` module ────────────────────────────────────────────
1974
- *
1975
- * The registry's unclaimed-export check (`findUnclaimedRuleModuleExports`)
1976
- * keys on this name under `src/config-surface/`: every exported function here
1977
- * is a rule, so one no surface declares fails `cli-unit-tests`. Shared
1978
- * predicates that are not rules live elsewhere (`webhook-signing-secret.ts`).
1979
- * The module is vendored into the CLI artifact like the rest of the
1980
- * directory, which is what lets `workflow`'s declaration call the rule
1981
- * `preflight`.
1982
- */
1983
- /** The rule ids this module owns — the union type below anchors them (#3373). */
1984
- export declare const WORKFLOW_RULE_IDS: readonly ["system-access-rule", "retired-database-step-kind"];
1985
- type WorkflowRuleId = (typeof WORKFLOW_RULE_IDS)[number];
1986
- /** A violation of one of this module's rules, for a site to render. */
1987
- export interface WorkflowRuleViolation extends RuleRefusal<WorkflowRuleId> {
1988
- }
1989
- /**
1990
- * `runAs = "system"` with a non-empty string `accessRule`, or null.
1991
- *
1992
- * Exactly the conjunction both sites carried: a default, unset, empty or
1993
- * whitespace-only rule is no rule, and a non-string one (`accessRule = false`)
1994
- * is malformed input for another check to name, not dead config. The message
1995
- * is the server's save-time sentence; the CLI renders its own hint from the
1996
- * same answer.
1997
- */
1998
- export declare function checkWorkflowSystemAccessRule(input: {
1999
- runAs?: unknown;
2000
- accessRule?: unknown;
2001
- }): WorkflowRuleViolation | null;
2002
- /**
2003
- * The DSL step kinds that executed a registered database operation (#3189,
2004
- * phase 6 of project `server-functions`, matrix row M8).
2005
- *
2006
- * Every `database.*` runner except `database.syncIndexes` called
2007
- * `DatabaseOperationsController.execute`, so retiring database operations
2008
- * retires these fourteen kinds with them: the seven base kinds and their seven
2009
- * `*ForUser` twins. `database.syncIndexes` (which calls the records index
2010
- * route), `database.create` and `database.delete` (resource lifecycle) are not
2011
- * here and keep running until the engine retires.
2012
- */
2013
- export declare const RETIRED_DATABASE_STEP_KINDS: readonly ["database.query", "database.mutate", "database.count", "database.aggregate", "database.pipeline", "database.applyToQuery", "database.batch", "database.queryForUser", "database.mutateForUser", "database.countForUser", "database.aggregateForUser", "database.pipelineForUser", "database.applyToQueryForUser", "database.batchForUser"];
2014
- /**
2015
- * Every step in a definition — or the one step a run has reached — whose kind
2016
- * is a retired database kind, with the sentence naming the replacement.
2017
- *
2018
- * Walks the top-level `steps` and a `collect` step's nested `step`, the one
2019
- * place a step definition nests another. Push (the CLI preflight), save, the
2020
- * activation lint and the engine all ask this one question, so a definition is
2021
- * refused by the same words wherever it is caught, and a run that reaches such
2022
- * a step fails with them.
2023
- */
2024
- export declare function checkWorkflowRetiredStepKinds(input: {
2025
- steps?: unknown;
2026
- }): WorkflowRuleViolation[];
2027
- export declare const WORKFLOW_SURFACE: ConfigObjectSurface;
2028
2352
  /**
2029
2353
  * Cron-expression and timezone VALIDITY — the half of `src/cron-parser.ts`
2030
2354
  * both runners need (#3376, project `cli-server-rule-parity` phase 4).
@@ -2136,15 +2460,6 @@ export declare function isValidTimezone(name: unknown): boolean;
2136
2460
  * pins. So the grammar and the `Intl` probe live next door in
2137
2461
  * `cron-expression.ts`, which is a shared-predicate module rather than a rules
2138
2462
  * module, and this one only decides and renders.
2139
- *
2140
- * ── What is NOT shared ───────────────────────────────────────────────────
2141
- *
2142
- * The standalone cron routes ask the same two predicates and render their own
2143
- * `Invalid cron expression: …` / `Invalid timezone: …`, with their own
2144
- * defaulting (create reads an absent timezone as UTC, update does not). That
2145
- * is intent assumption 2 in the form its own fallback describes, and the shape
2146
- * `workflow-rules.ts` set in phase 2: one predicate, each site's message and
2147
- * defaulting preserved. No refusal message changed anywhere.
2148
2463
  */
2149
2464
  /** The rule ids this module owns — the union type below anchors them (#3373). */
2150
2465
  export declare const CRON_TRIGGER_RULE_IDS: readonly ["cron-trigger-expression", "cron-trigger-timezone"];
@@ -2164,6 +2479,62 @@ export declare function checkCronTriggerEntry(entry: {
2164
2479
  cron: string;
2165
2480
  timezone?: string;
2166
2481
  }): CronTriggerRuleRefusal | null;
2482
+ /**
2483
+ * App-secret names the platform reserves — #5845, project `public-access`
2484
+ * phase 4 (intent criterion 9).
2485
+ *
2486
+ * `PRIMITIVE_TURNSTILE_SECRET` holds an app's Turnstile secret, which the
2487
+ * signed-out door reads to verify a `turnstile` function's token. An app sets,
2488
+ * replaces and deletes it like any other secret, but no new function
2489
+ * capability, CEL manifest, integration template, webhook trigger or Google
2490
+ * client may reference it, so its value never reaches a function, a rule or a
2491
+ * third party.
2492
+ *
2493
+ * "New" is judged against the stored value a write replaces: a write is
2494
+ * refused when what it submits names a reserved secret and what it replaces
2495
+ * does not. A reference stored before the reservation keeps working, and an
2496
+ * unchanged re-push or re-save answers as before.
2497
+ *
2498
+ * Pure by construction (no models, no `env`), like the rest of
2499
+ * `src/config-surface/`.
2500
+ */
2501
+ /** The reserved app-secret names. */
2502
+ export declare const RESERVED_APP_SECRETS: readonly string[];
2503
+ /** The code every refusal of a new reserved reference answers. */
2504
+ export declare const RESERVED_SECRET_REFERENCE_CODE = "RESERVED_SECRET_REFERENCE";
2505
+ /** A refusal of a new reserved reference. */
2506
+ export interface ReservedSecretRefusal {
2507
+ code: typeof RESERVED_SECRET_REFERENCE_CODE;
2508
+ message: string;
2509
+ }
2510
+ /**
2511
+ * Whether `key` is a reserved app-secret name.
2512
+ *
2513
+ * @param key A secret key.
2514
+ * @returns True for `PRIMITIVE_TURNSTILE_SECRET`.
2515
+ */
2516
+ export declare function isReservedAppSecret(key: string): boolean;
2517
+ /**
2518
+ * Refuse a write whose submitted value newly references a reserved secret.
2519
+ *
2520
+ * @param input The secret keys the submitted value names, the keys the stored value it replaces names, and what is written (for the message).
2521
+ * @returns The refusal, or null when every reserved key submitted is also stored.
2522
+ */
2523
+ export declare function reservedSecretRefusal(input: {
2524
+ submittedKeys: Iterable<string>;
2525
+ storedKeys: Iterable<string>;
2526
+ what: string;
2527
+ }): ReservedSecretRefusal | null;
2528
+ /** The `secrets` a CEL manifest declares; empty for anything else. */
2529
+ export declare function manifestSecretKeys(manifest: unknown): string[];
2530
+ /**
2531
+ * Refuse a CEL manifest whose `secrets` newly list a reserved name.
2532
+ *
2533
+ * @param submitted The manifest the write carries (an object or its JSON).
2534
+ * @param stored The manifest it replaces (an object, its JSON, or null for none).
2535
+ * @returns The refusal, or null.
2536
+ */
2537
+ export declare function manifestReservedSecretRefusal(submitted: unknown, stored: unknown): ReservedSecretRefusal | null;
2167
2538
  /**
2168
2539
  * The prompt config's reasoning controls, resolved onto each provider's own
2169
2540
  * spelling — issue #3358.
@@ -2839,11 +3210,9 @@ export declare function normalizeAgentDeclaration(declaration: AgentDeclaration
2839
3210
  *
2840
3211
  * A tool or event schema reaches a provider only through a translation that
2841
3212
  * preserves its meaning; anything else is refused at push, naming the path, the
2842
- * keyword and the provider. The lossy `sanitizeSchemaForGemini` clean-up
2843
- * (`src/services/block-executor.ts`) is NOT reused here: it drops unions and
2844
- * references and rewrites a free-form object as a string, all of which change
2845
- * what the model may produce. It stays where it is, for chat output schemas
2846
- * (the project's non-goal: chat is unchanged).
3213
+ * keyword and the provider. A chat prompt's output schema goes to Gemini
3214
+ * through this translator too (#5538), in place of the lossy clean-up that
3215
+ * dropped unions and references and rewrote a free-form object as a string.
2847
3216
  *
2848
3217
  * ## What "lossless" means (spec §3)
2849
3218
  *
@@ -2862,7 +3231,7 @@ export declare function normalizeAgentDeclaration(declaration: AgentDeclaration
2862
3231
  * the structured error the model sees, and a model following `properties` is
2863
3232
  * never told it may add keys. Refusing it instead would put the platform's own
2864
3233
  * closed-object marker — `additionalProperties: false` is how
2865
- * `src/workflows/schema-descriptor.ts` spells a closed object — outside
3234
+ * `src/function-runs/schema-descriptor.ts` spells a closed object — outside
2866
3235
  * Gemini's reach.
2867
3236
  *
2868
3237
  * The TRANSLATED schema is what the provider is sent; the ORIGINAL is what the
@@ -2884,9 +3253,14 @@ export declare function normalizeAgentDeclaration(declaration: AgentDeclaration
2884
3253
  * `items`. Lowercase type names are accepted (the existing `responseSchema`
2885
3254
  * path already sends them).
2886
3255
  *
2887
- * Pure and dependency-free, like every module under `src/config-surface/`, and
2888
- * vendored into the CLI artifact after `agent-declaration.ts` so the push
2889
- * preflight and the admin routes refuse exactly the same schemas.
3256
+ * Which keywords pass, drop, take a rule or are refused is the keyword table's
3257
+ * `gemini` column (`SCHEMA_KEYWORDS` in `src/function-runs/schema-descriptor.ts`,
3258
+ * #5529), so the translator, the validator and the push refusal list read one
3259
+ * classification. That module is dependency-free and vendored to the CLI whole,
3260
+ * so this one stays pure: the CLI artifact generator rewrites its import to the
3261
+ * vendored copy. This module is vendored into the CLI artifact after
3262
+ * `agent-declaration.ts` so the push preflight and the admin routes refuse
3263
+ * exactly the same schemas.
2890
3264
  */
2891
3265
  /** The providers a prompt config may name. */
2892
3266
  export type SchemaProvider = "openrouter" | "gemini";
@@ -2909,6 +3283,27 @@ export type SchemaTranslation = {
2909
3283
  ok: false;
2910
3284
  refusals: SchemaTranslationRefusal[];
2911
3285
  };
3286
+ /**
3287
+ * What Gemini's function `Schema` does with one keyword, from the keyword
3288
+ * table: `pass` (spelled the same way, with the same meaning — `required`
3289
+ * among them, and Gemini's own `nullable`, `propertyOrdering` and `example`),
3290
+ * `drop` (an annotation with no value meaning, dropped in silence, spec §3),
3291
+ * `rule` (handled by its own rule below) or `refuse`. A key the table does not
3292
+ * name is refused: a keyword nobody classified could mean anything.
3293
+ */
3294
+ export declare function geminiKeywordVerdict(keyword: string): GeminiKeywordVerdict;
3295
+ /**
3296
+ * Keywords handled by their own rule below: exactly the table's `rule` rows,
3297
+ * which the keyword-table conformance test holds it to.
3298
+ */
3299
+ export declare const GEMINI_STRUCTURAL_KEYWORDS: readonly ["type", "enum", "const", "format", "properties", "items", "anyOf", "oneOf", "additionalProperties"];
3300
+ /**
3301
+ * Why Gemini's function `Schema` cannot carry a refused keyword, for the ones
3302
+ * with a reason of their own. Each is refused rather than dropped: dropping any
3303
+ * of them widens what the model may produce. A refused keyword with no entry
3304
+ * here gets the generic reason.
3305
+ */
3306
+ export declare const GEMINI_REFUSAL_REASONS: Readonly<Record<string, string>>;
2912
3307
  /** What a message calls the root. */
2913
3308
  export declare function schemaPathLabel(path: string): string;
2914
3309
  /**
@@ -2988,6 +3383,143 @@ export type AgentSchemaDeficit = {
2988
3383
  export declare function agentSchemaTranslationDeficits(input: AgentSchemaTranslationInput): AgentSchemaDeficit[];
2989
3384
  /** The `AGENT_SCHEMA_NOT_TRANSLATABLE` refusal one deficit renders as. */
2990
3385
  export declare function agentSchemaDeficitRefusal(deficit: AgentSchemaDeficit): AgentRefusal;
3386
+ /**
3387
+ * What a prompt push refuses — #5536 (project `unified-schemas` phase 5)
3388
+ * reported it, #5538 (phase 6, intent criterion 8) refuses it.
3389
+ *
3390
+ * Two checks judge a prompt's schemas: the lossless Gemini translator
3391
+ * (`translateSchemaForProvider`) on the output schemas a Gemini config sends,
3392
+ * and the engine (the function push's rules) on every schema. A write
3393
+ * carrying a keyword either would refuse is refused, each keyword named with
3394
+ * its fix and a code: `PROMPT_SCHEMA_NOT_TRANSLATABLE` for the translator,
3395
+ * `PROMPT_SCHEMA_UNSUPPORTED_KEYWORD` for the engine. The admin prompt routes,
3396
+ * the CLI preflight (through the vendored copy), the Gemini call path and the
3397
+ * audit (`scripts/lib/schema-audit-core.ts`) all read this module, so they
3398
+ * cannot disagree about which schemas are refused.
3399
+ *
3400
+ * An agent's translator refusals are not here: they are already the push
3401
+ * error `AGENT_SCHEMA_NOT_TRANSLATABLE` (DSO-5536-002).
3402
+ */
3403
+ /**
3404
+ * The code a prompt write is refused with for a keyword the lossless Gemini
3405
+ * translator cannot carry, and the code a run of a stored prompt whose output
3406
+ * schema it cannot carry fails with.
3407
+ */
3408
+ export declare const PROMPT_SCHEMA_NOT_TRANSLATABLE = "PROMPT_SCHEMA_NOT_TRANSLATABLE";
3409
+ /** The code a prompt write is refused with for a keyword or a shape the schema check would not enforce. */
3410
+ export declare const PROMPT_SCHEMA_UNSUPPORTED_KEYWORD = "PROMPT_SCHEMA_UNSUPPORTED_KEYWORD";
3411
+ /** One keyword the engine would not enforce: where, which, and why (with its fix). */
3412
+ export interface EngineSchemaRefusal {
3413
+ /** The dotted path from the schema root; `""` is the root. */
3414
+ path: string;
3415
+ keyword: string;
3416
+ reason: string;
3417
+ }
3418
+ /**
3419
+ * The fix for each keyword the engine refuses: one entry per refused row of
3420
+ * the keyword table, and no other key.
3421
+ */
3422
+ export declare const ENGINE_REFUSAL_FIXES: Readonly<Record<string, string>>;
3423
+ /**
3424
+ * The fix for a translator refusal whose reason states only what would be
3425
+ * lost, appended to the refusal line (DSO-5536-008: the translator's own
3426
+ * texts are refusal texts elsewhere and stay as they are). `"*"` is the fix
3427
+ * for a keyword the translator has no reason of its own for.
3428
+ */
3429
+ export declare const TRANSLATOR_REFUSAL_FIXES: Readonly<Record<string, string>>;
3430
+ /**
3431
+ * Every keyword of `schema` the function push's rules refuse, over the nodes
3432
+ * they check (the root, `properties`, `items`, `anyOf`, `oneOf`; never
3433
+ * `$defs`): the keyword table's refused class, each reason ending with its
3434
+ * fix, and the shape rules. An enforced constraint (`uniqueItems`,
3435
+ * `multipleOf`, …) is never one: only the translator refuses those.
3436
+ *
3437
+ * The walk keeps its own work stack rather than recursing: the compiler
3438
+ * accepts a schema nested deeper than the call stack, and every refusal must
3439
+ * still be named for it.
3440
+ */
3441
+ export declare function engineSchemaRefusals(schema: unknown, path?: string): EngineSchemaRefusal[];
3442
+ /**
3443
+ * The schemas an agent's model reads from its declaration (a table or one
3444
+ * JSON string): each client tool's `inputSchema` and `outputSchema`, each
3445
+ * event's `schema` and the turn context's. Never a server tool's: those are
3446
+ * its function's, judged at the function push.
3447
+ */
3448
+ export declare function agentDeclarationSchemas(agent: unknown): Array<{
3449
+ subject: string;
3450
+ schema: unknown;
3451
+ }>;
3452
+ /** What `promptSchemaDeficits` judges: the schema fields a write carries, and the prompt's configs. */
3453
+ export interface PromptSchemaDeficitInput {
3454
+ inputSchema?: unknown;
3455
+ outputSchema?: unknown;
3456
+ /** `[prompt.agent]`: a table or one JSON string. */
3457
+ agent?: unknown;
3458
+ /** The configs that decide whether `outputSchema` targets Gemini; each config's own `outputSchema` is judged too. */
3459
+ configs?: ReadonlyArray<{
3460
+ name: string;
3461
+ provider: string;
3462
+ status?: string | null;
3463
+ outputSchema?: unknown;
3464
+ }>;
3465
+ }
3466
+ /** One keyword the translator or the engine would refuse, in one schema of a prompt. */
3467
+ export interface PromptSchemaDeficit {
3468
+ /** `inputSchema`, `outputSchema`, `config "fast" outputSchema`, `agent tool "pick" inputSchema`, … */
3469
+ subject: string;
3470
+ field: "inputSchema" | "outputSchema" | "agent";
3471
+ /** The config whose own `outputSchema` this is. */
3472
+ config?: string;
3473
+ check: "translator" | "engine";
3474
+ provider?: "gemini";
3475
+ /** The dotted path from the schema root; `""` is the root. */
3476
+ path: string;
3477
+ keyword: string;
3478
+ reason: string;
3479
+ }
3480
+ /**
3481
+ * `translateSchemaForProvider(schema, "gemini")`, failing closed. The
3482
+ * translator recurses, so a schema nested deeper than the call stack cannot be
3483
+ * translated: it is one refusal about the whole document (`(schema)`, the
3484
+ * engine's spelling), so a schema Gemini would never be sent is refused at
3485
+ * push and at call time rather than accepted unread. Any other error is a
3486
+ * fault and propagates.
3487
+ */
3488
+ export declare function translateSchemaForGemini(schema: unknown): SchemaTranslation;
3489
+ /** The translator's refusals for one schema: `translateSchemaForGemini`'s, or none. */
3490
+ export declare function translatorRefusals(schema: unknown): SchemaTranslationRefusal[];
3491
+ /**
3492
+ * Every keyword of a prompt's schemas the translator or the engine would
3493
+ * refuse. The translator judges `outputSchema` when a non-archived config
3494
+ * names Gemini (case-insensitive), and each Gemini config's own
3495
+ * `outputSchema` unless that config is archived; `inputSchema` is never
3496
+ * translated, and an agent's schemas are judged by the engine only. Order:
3497
+ * `inputSchema`, `outputSchema`, the agent's schemas, then each config; per
3498
+ * schema the translator first. A top-level value that is no schema object
3499
+ * is reported once, by the engine.
3500
+ */
3501
+ export declare function promptSchemaDeficits(input: PromptSchemaDeficitInput): PromptSchemaDeficit[];
3502
+ /**
3503
+ * The refusal line for one deficit: the subject, the path, the keyword, why,
3504
+ * and the fix. A translator reason with no fix of its own names what Gemini
3505
+ * needs instead (`properties`, `type`, the overflow's "flatten the schema").
3506
+ */
3507
+ export declare function promptSchemaRefusalLine(deficit: PromptSchemaDeficit): string;
3508
+ /** The code a write is refused with for one deficit. */
3509
+ export declare function promptSchemaDeficitCode(deficit: PromptSchemaDeficit): typeof PROMPT_SCHEMA_NOT_TRANSLATABLE | typeof PROMPT_SCHEMA_UNSUPPORTED_KEYWORD;
3510
+ /** One entry of a refused write's `details.refusals`. */
3511
+ export interface PromptSchemaRefusalEntry {
3512
+ code: typeof PROMPT_SCHEMA_NOT_TRANSLATABLE | typeof PROMPT_SCHEMA_UNSUPPORTED_KEYWORD;
3513
+ /** `promptSchemaRefusalLine` of the deficit. */
3514
+ message: string;
3515
+ subject: string;
3516
+ field: PromptSchemaDeficit["field"];
3517
+ config?: string;
3518
+ path: string;
3519
+ keyword: string;
3520
+ }
3521
+ /** A refused write's `details.refusals`: one entry per deficit, in `promptSchemaDeficits` order. */
3522
+ export declare function promptSchemaRefusals(deficits: readonly PromptSchemaDeficit[]): PromptSchemaRefusalEntry[];
2991
3523
  /**
2992
3524
  * A change to a server function that an agent uses — issue #4441.
2993
3525
  *
@@ -3162,8 +3694,6 @@ export type AgentTestCaseResolution = {
3162
3694
  export declare function resolveAgentTestCase(input: AgentTestCaseInput): AgentTestCaseResolution;
3163
3695
  export declare const PROMPT_SURFACE: ConfigObjectSurface;
3164
3696
  export declare const INTEGRATION_SURFACE: ConfigObjectSurface;
3165
- export declare const WEBHOOK_SURFACE: ConfigObjectSurface;
3166
- export declare const CRON_TRIGGER_SURFACE: ConfigObjectSurface;
3167
3697
  export declare const BLOB_BUCKET_SURFACE: ConfigObjectSurface;
3168
3698
  /**
3169
3699
  * The `email-template` configuration object's definition (issue #2644, phase 2).
@@ -3205,30 +3735,163 @@ export declare function isRetiredEmailType(emailType: string): emailType is Reti
3205
3735
  export declare function retiredEmailTypeGuidance(emailType: string): string;
3206
3736
  export declare const EMAIL_TEMPLATE_SURFACE: ConfigObjectSurface;
3207
3737
  export declare const DATABASE_TYPE_SURFACE: ConfigObjectSurface;
3738
+ export declare const DB3_TYPE_SURFACE: ConfigObjectSurface;
3739
+ /** A retired rule-set resource type: the code and sentence a refusal carries. */
3740
+ export interface RetiredRuleSetResourceType {
3741
+ code: string;
3742
+ message: string;
3743
+ }
3744
+ /**
3745
+ * Rule-set resource types that no longer exist (#4959), with the one refusal
3746
+ * both the rule-set routes and `config push`'s preflight answer for a set of
3747
+ * that type, so the two cannot drift.
3748
+ *
3749
+ * `lock` — locks are server-function-only, and the calling function's
3750
+ * `authorize` decides who may lock which key. A stored row can still be listed
3751
+ * and deleted; nothing evaluates it.
3752
+ */
3753
+ export declare const RETIRED_RULE_SET_RESOURCE_TYPES: Record<string, RetiredRuleSetResourceType>;
3754
+ /** The retirement for `resourceType`, or `null` for a live type. */
3755
+ export declare function retiredRuleSetResourceType(resourceType: unknown): RetiredRuleSetResourceType | null;
3208
3756
  export declare const RULE_SET_SURFACE: ConfigObjectSurface;
3209
- export declare const GROUP_TYPE_CONFIG_SURFACE: ConfigObjectSurface;
3210
- export declare const COLLECTION_TYPE_CONFIG_SURFACE: ConfigObjectSurface;
3211
3757
  export declare const METADATA_CATEGORY_CONFIG_SURFACE: ConfigObjectSurface;
3758
+ export declare const SERVER_FUNCTION_SURFACE: ConfigObjectSurface;
3759
+ /**
3760
+ * The refusal of a new version whose default export has no `authorize`: it
3761
+ * names the function and shows the object form with the function's key. A
3762
+ * `file` prefixes the sentence the way the CLI reports a file it refuses.
3763
+ */
3764
+ export declare function authorizeRequiredMessage(functionKey: string, file?: string): string;
3212
3765
  /**
3213
- * The `transform` configuration object's definition (issue #2644, phase 3).
3766
+ * The refusal of a version that declares `public = true` and has no
3767
+ * `authorize` — #5840. `public = true` opens the function to signed-out
3768
+ * callers, and the version's own `authorize` is what decides about them.
3769
+ */
3770
+ export declare function publicRequiresAuthorizeMessage(functionKey: string, file?: string): string;
3771
+ /**
3772
+ * The refusal of a new version that defines `authorize` while its TOML still
3773
+ * carries `access`.
3774
+ */
3775
+ export declare function accessAmbiguousMessage(functionKey: string): string;
3776
+ /** The refusal of a create or update body that carries `access`. */
3777
+ export declare const FUNCTION_ACCESS_FROZEN_REQUEST: string;
3778
+ export declare const TEST_CASE_SURFACE: ConfigObjectSurface;
3779
+ /**
3780
+ * The client version policy's rules (#6034, project `client-version-policy`).
3781
+ *
3782
+ * An app states, per platform, which versions of its own client are current,
3783
+ * recommended and required, in `[clients.<platform>]` tables of `app.toml`.
3784
+ * The whole map is ONE `App` field, `clientVersions`. This module decides what
3785
+ * that map may say, and is the one place that does: the server's
3786
+ * `PUT settings` calls `checkClientVersions` before it stores anything, and
3787
+ * the CLI's push preflight runs the same function through the vendored
3788
+ * artifact, so both refuse with the same sentence, in TOML spelling.
3214
3789
  *
3215
- * Transforms are the one synced type with NO TOML field table: a transform is
3216
- * `transforms/<name>.rhai`, a Rhai source file, and its whole authored surface
3217
- * is the script body. `config pull` writes the active `ScriptConfig`'s body and
3218
- * `config push` sends it back; there is no key/value table to define, and the
3219
- * `Script` / `ScriptConfig` scalars around it (name, description, inputSchema,
3220
- * limits, status) are not authorable through the sync slot today.
3790
+ * A single-field handler, not a rules module: the checks span the keys of one
3791
+ * field's value, so the file is not named `*-rules.ts` and exports no rule-id
3792
+ * list (the registry's rule ids are keyed by a surface's `crossFieldRules`).
3793
+ * Every refusal is still built through one constructor, `clientVersionsRefusal`.
3221
3794
  *
3222
- * The entry exists so that is a DECISION rather than an absence. Criterion 3's
3223
- * registry guard reads `SYNC_RESOURCE_TYPES` and requires a surface per label;
3224
- * without this module `transform` would have to sit in an exemption list, which
3225
- * is precisely the "absent from a hand-written list" failure mode this epic
3226
- * exists to end.
3795
+ * Maps are read with own-property iteration only, so a platform named
3796
+ * `constructor` is an entry like any other.
3797
+ *
3798
+ * Pure: no models, no tenant context, no `env` (see `types.ts` §Purity).
3227
3799
  */
3228
- export declare const TRANSFORM_SURFACE: ConfigObjectSurface;
3229
- export declare const SERVER_FUNCTION_SURFACE: ConfigObjectSurface;
3230
- export declare const TEST_CASE_SURFACE: ConfigObjectSurface;
3800
+ /** The keys a `[clients.<platform>]` table may carry. */
3801
+ export declare const CLIENT_VERSION_ENTRY_KEYS: readonly ["latest", "minRecommended", "minRequired", "updateUrl"];
3802
+ /** One key of a `[clients.<platform>]` table. */
3803
+ export type ClientVersionEntryKey = (typeof CLIENT_VERSION_ENTRY_KEYS)[number];
3804
+ /** A legal platform name: a lowercase identifier of at most 32 characters. */
3805
+ export declare const CLIENT_PLATFORM_NAME_PATTERN: RegExp;
3806
+ /** A legal version: one to three dot-separated parts of one to six digits. */
3807
+ export declare const CLIENT_VERSION_PATTERN: RegExp;
3808
+ /** The schemes an `updateUrl` may use. */
3809
+ export declare const CLIENT_UPDATE_URL_SCHEMES: readonly string[];
3810
+ /** The most platforms one policy may declare. */
3811
+ export declare const MAX_CLIENT_PLATFORMS = 20;
3812
+ /** The longest `updateUrl` accepted, in characters. */
3813
+ export declare const MAX_CLIENT_UPDATE_URL_LENGTH = 2048;
3814
+ /** One platform's entry, as stored and served. */
3815
+ export interface ClientVersionsEntry {
3816
+ latest?: string;
3817
+ minRecommended?: string;
3818
+ minRequired?: string;
3819
+ updateUrl?: string;
3820
+ }
3821
+ /** The whole policy: platform name to entry. */
3822
+ export type ClientVersionsMap = Record<string, ClientVersionsEntry>;
3823
+ /** Why a policy was refused. */
3824
+ type ClientVersionsRefusalCode = "not-a-map" | "too-many-platforms" | "platform-name" | "entry-not-a-table" | "entry-empty" | "unknown-key" | "enforce-not-accepted" | "version-not-a-string" | "version-format" | "update-url" | "order";
3825
+ /** A refused policy: what was wrong and the sentence that says so. */
3826
+ export interface ClientVersionsRefusal {
3827
+ code: ClientVersionsRefusalCode;
3828
+ /** The TOML spelling of the table or key, `[clients.ios].latest`. */
3829
+ key: string;
3830
+ message: string;
3831
+ }
3832
+ /**
3833
+ * A version's numeric parts, padded to three with zeros, or null when the
3834
+ * value is not a legal version string.
3835
+ */
3836
+ export declare function parseClientVersion(value: unknown): [number, number, number] | null;
3837
+ /**
3838
+ * Compare two legal versions numerically, missing parts zero: -1 when `a` is
3839
+ * lower, 0 when equal, 1 when higher. A value that is not a legal version
3840
+ * compares as `0.0.0`.
3841
+ */
3842
+ export declare function compareClientVersions(a: string, b: string): -1 | 0 | 1;
3843
+ /**
3844
+ * The first refusal of a client version policy, or null when it may be
3845
+ * stored. `null` and an empty map are legal: they clear the policy.
3846
+ */
3847
+ export declare function checkClientVersions(value: unknown): ClientVersionsRefusal | null;
3848
+ /** A stored minimum a policy change lowers or removes. */
3849
+ export interface LoweredClientMinimum {
3850
+ platform: string;
3851
+ key: "minRequired" | "minRecommended";
3852
+ from: string;
3853
+ /** The new value, or null when the key or its table is removed. */
3854
+ to: string | null;
3855
+ }
3856
+ /**
3857
+ * Every stored `minRequired` and `minRecommended` that `next` lowers
3858
+ * numerically, removes, or drops with its table — what `config push` asks the
3859
+ * developer to confirm. A stored value that is not a map reads as no policy.
3860
+ * Ordered by platform name, then `minRequired` before `minRecommended`.
3861
+ */
3862
+ export declare function loweredClientMinimums(stored: unknown, next: unknown): LoweredClientMinimum[];
3231
3863
  export declare const APP_SETTINGS_SURFACE: ConfigObjectSurface;
3864
+ /**
3865
+ * The `user-properties` configuration object's definition (#5385, project
3866
+ * `user-index-properties` phase 2).
3867
+ *
3868
+ * `user-properties.toml` is a root singleton beside `app.toml`, so — like
3869
+ * `app-settings` and `test-case` — it is named explicitly rather than reached
3870
+ * through `SYNC_RESOURCE_TYPES`. Its keys are the app's own: each
3871
+ * `[fields.<name>]` table declares a property in the db3 field grammar plus
3872
+ * `client`, and each `[[unique_constraints]]` entry names two or more of them.
3873
+ * There is no fixed key/value table to define, so the surface declares
3874
+ * `noFieldTable`; the file is parsed, normalized and judged by one module,
3875
+ * `src/user-index/properties-schema.ts`, which the CLI vendors byte for byte
3876
+ * (`cli/src/lib/user-properties/generated-properties-schema.ts`) and which
3877
+ * `config push`'s preflight runs before anything is applied. The pushed
3878
+ * schema is stored on the app's `UserPropertiesConfig` row.
3879
+ */
3880
+ export declare const USER_PROPERTIES_SURFACE: ConfigObjectSurface;
3881
+ /**
3882
+ * The `schema` configuration object's definition (#5532, project
3883
+ * `unified-schemas` phase 3).
3884
+ *
3885
+ * `schemas/<file>.toml` holds shared shapes: each `[defs.<Name>]` table is
3886
+ * one JSON Schema document, named by the file's stem and the def's name
3887
+ * (`schemas:<file>#/$defs/<Name>`). There is no fixed key/value table to
3888
+ * define, so the surface declares `noFieldTable`; the file is checked and
3889
+ * compiled by one module, `src/function-runs/schema-file.ts`, which the CLI
3890
+ * vendors (`cli/src/lib/schema-codegen/generated-schema-file.ts`), runs in
3891
+ * `config push`'s preflight and sends compiled with the source, and which the
3892
+ * push route runs again.
3893
+ */
3894
+ export declare const SCHEMA_FILE_SURFACE: ConfigObjectSurface;
3232
3895
  /**
3233
3896
  * The configuration-object registry (issue #2644).
3234
3897
  *
@@ -3245,9 +3908,10 @@ export declare const APP_SETTINGS_SURFACE: ConfigObjectSurface;
3245
3908
  /**
3246
3909
  * Every configuration object whose field surface is defined here.
3247
3910
  *
3248
- * One entry per `SYNC_RESOURCE_TYPES` label, plus the two surfaces that
3249
- * round-trip without being a per-entity file: `app-settings` (`app.toml`) and
3250
- * `test-case` (`<key>.tests/`). Nothing that syncs sits outside the registry —
3911
+ * One entry per `SYNC_RESOURCE_TYPES` label, plus the three surfaces that
3912
+ * round-trip without being a per-entity file: `app-settings` (`app.toml`),
3913
+ * `user-properties` (`user-properties.toml`, #5385) and `test-case`
3914
+ * (`<key>.tests/`). Nothing that syncs sits outside the registry —
3251
3915
  * `PENDING_MIGRATION`, the migration's temporary exemption list, is gone as of
3252
3916
  * phase 3, so a new synced type has nowhere to be parked and fails the registry
3253
3917
  * guard until it is defined (#2644 criterion 3).