primitive-admin 1.2.0-alpha.0 → 1.2.0-alpha.10

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 (412) hide show
  1. package/README.md +108 -136
  2. package/assets/skill/skills/primitive-platform/SKILL.md +37 -4
  3. package/dist/bin/primitive.js +30 -35
  4. package/dist/bin/primitive.js.map +1 -1
  5. package/dist/src/commands/agent-sessions.d.ts +133 -0
  6. package/dist/src/commands/agent-sessions.js +792 -0
  7. package/dist/src/commands/agent-sessions.js.map +1 -0
  8. package/dist/src/commands/analytics.js +0 -148
  9. package/dist/src/commands/analytics.js.map +1 -1
  10. package/dist/src/commands/apps-children.d.ts +54 -0
  11. package/dist/src/commands/apps-children.js +631 -0
  12. package/dist/src/commands/apps-children.js.map +1 -0
  13. package/dist/src/commands/apps.d.ts +6 -0
  14. package/dist/src/commands/apps.js +131 -9
  15. package/dist/src/commands/apps.js.map +1 -1
  16. package/dist/src/commands/auth-sessions.d.ts +3 -3
  17. package/dist/src/commands/auth-sessions.js +117 -23
  18. package/dist/src/commands/auth-sessions.js.map +1 -1
  19. package/dist/src/commands/auth.js +460 -36
  20. package/dist/src/commands/auth.js.map +1 -1
  21. package/dist/src/commands/collections.js +316 -256
  22. package/dist/src/commands/collections.js.map +1 -1
  23. package/dist/src/commands/config.d.ts +1 -1
  24. package/dist/src/commands/config.js +60 -28
  25. package/dist/src/commands/config.js.map +1 -1
  26. package/dist/src/commands/connections.js +12 -17
  27. package/dist/src/commands/connections.js.map +1 -1
  28. package/dist/src/commands/database-type-configs.js +2 -76
  29. package/dist/src/commands/database-type-configs.js.map +1 -1
  30. package/dist/src/commands/databases.d.ts +9 -0
  31. package/dist/src/commands/databases.js +228 -566
  32. package/dist/src/commands/databases.js.map +1 -1
  33. package/dist/src/commands/db3-types.d.ts +15 -0
  34. package/dist/src/commands/db3-types.js +157 -0
  35. package/dist/src/commands/db3-types.js.map +1 -0
  36. package/dist/src/commands/db3.d.ts +12 -0
  37. package/dist/src/commands/db3.js +1052 -0
  38. package/dist/src/commands/db3.js.map +1 -0
  39. package/dist/src/commands/documents.d.ts +121 -2
  40. package/dist/src/commands/documents.js +1601 -1251
  41. package/dist/src/commands/documents.js.map +1 -1
  42. package/dist/src/commands/env.d.ts +9 -1
  43. package/dist/src/commands/env.js +164 -49
  44. package/dist/src/commands/env.js.map +1 -1
  45. package/dist/src/commands/function-trigger-commands.d.ts +28 -0
  46. package/dist/src/commands/function-trigger-commands.js +341 -0
  47. package/dist/src/commands/function-trigger-commands.js.map +1 -0
  48. package/dist/src/commands/functions.js +297 -24
  49. package/dist/src/commands/functions.js.map +1 -1
  50. package/dist/src/commands/groups.js +150 -49
  51. package/dist/src/commands/groups.js.map +1 -1
  52. package/dist/src/commands/guides.js +5 -5
  53. package/dist/src/commands/init.d.ts +7 -0
  54. package/dist/src/commands/init.js +23 -5
  55. package/dist/src/commands/init.js.map +1 -1
  56. package/dist/src/commands/integrations.js +14 -8
  57. package/dist/src/commands/integrations.js.map +1 -1
  58. package/dist/src/commands/metadata-category-configs.d.ts +2 -2
  59. package/dist/src/commands/metadata-category-configs.js +2 -2
  60. package/dist/src/commands/prompts.d.ts +7 -0
  61. package/dist/src/commands/prompts.js +48 -5
  62. package/dist/src/commands/prompts.js.map +1 -1
  63. package/dist/src/commands/scripts.d.ts +9 -17
  64. package/dist/src/commands/scripts.js +24 -479
  65. package/dist/src/commands/scripts.js.map +1 -1
  66. package/dist/src/commands/sessions.js +3 -8
  67. package/dist/src/commands/sessions.js.map +1 -1
  68. package/dist/src/commands/sync-app-settings.d.ts +36 -8
  69. package/dist/src/commands/sync-app-settings.js +109 -23
  70. package/dist/src/commands/sync-app-settings.js.map +1 -1
  71. package/dist/src/commands/sync.d.ts +436 -613
  72. package/dist/src/commands/sync.js +2604 -5977
  73. package/dist/src/commands/sync.js.map +1 -1
  74. package/dist/src/commands/tokens.js +4 -9
  75. package/dist/src/commands/tokens.js.map +1 -1
  76. package/dist/src/commands/users.js +77 -2
  77. package/dist/src/commands/users.js.map +1 -1
  78. package/dist/src/commands/workflows.d.ts +5 -83
  79. package/dist/src/commands/workflows.js +57 -2282
  80. package/dist/src/commands/workflows.js.map +1 -1
  81. package/dist/src/lib/aggregate-output.d.ts +25 -0
  82. package/dist/src/lib/aggregate-output.js +53 -0
  83. package/dist/src/lib/aggregate-output.js.map +1 -0
  84. package/dist/src/lib/api-client.d.ts +681 -581
  85. package/dist/src/lib/api-client.js +880 -851
  86. package/dist/src/lib/api-client.js.map +1 -1
  87. package/dist/src/lib/app-settings-descriptor.d.ts +47 -1
  88. package/dist/src/lib/app-settings-descriptor.js +114 -10
  89. package/dist/src/lib/app-settings-descriptor.js.map +1 -1
  90. package/dist/src/lib/auth-fixtures.d.ts +44 -0
  91. package/dist/src/lib/auth-fixtures.js +61 -0
  92. package/dist/src/lib/auth-fixtures.js.map +1 -0
  93. package/dist/src/lib/auth-flow.d.ts +41 -1
  94. package/dist/src/lib/auth-flow.js +70 -16
  95. package/dist/src/lib/auth-flow.js.map +1 -1
  96. package/dist/src/lib/block-layout.d.ts +12 -23
  97. package/dist/src/lib/block-layout.js +26 -92
  98. package/dist/src/lib/block-layout.js.map +1 -1
  99. package/dist/src/lib/block-selector.d.ts +2 -2
  100. package/dist/src/lib/block-selector.js +2 -2
  101. package/dist/src/lib/child-apps-local.d.ts +164 -0
  102. package/dist/src/lib/child-apps-local.js +258 -0
  103. package/dist/src/lib/child-apps-local.js.map +1 -0
  104. package/dist/src/lib/ci-session-request.d.ts +22 -0
  105. package/dist/src/lib/ci-session-request.js +51 -0
  106. package/dist/src/lib/ci-session-request.js.map +1 -0
  107. package/dist/src/lib/codegen-shared/generatedFiles.d.ts +10 -8
  108. package/dist/src/lib/codegen-shared/generatedFiles.js +21 -15
  109. package/dist/src/lib/codegen-shared/generatedFiles.js.map +1 -1
  110. package/dist/src/lib/codegen-shared/prettierStable.d.ts +1 -1
  111. package/dist/src/lib/codegen-shared/prettierStable.js +1 -1
  112. package/dist/src/lib/codegen-shared/resolveCodegenSourceDir.d.ts +2 -2
  113. package/dist/src/lib/codegen-shared/resolveCodegenSourceDir.js +2 -2
  114. package/dist/src/lib/collection-export.d.ts +76 -15
  115. package/dist/src/lib/collection-export.js +116 -23
  116. package/dist/src/lib/collection-export.js.map +1 -1
  117. package/dist/src/lib/collection-principal.d.ts +22 -0
  118. package/dist/src/lib/collection-principal.js +35 -0
  119. package/dist/src/lib/collection-principal.js.map +1 -0
  120. package/dist/src/lib/config-object-descriptor.d.ts +3 -22
  121. package/dist/src/lib/config-object-descriptor.js +56 -291
  122. package/dist/src/lib/config-object-descriptor.js.map +1 -1
  123. package/dist/src/lib/config-payload.js +2 -3
  124. package/dist/src/lib/config-payload.js.map +1 -1
  125. package/dist/src/lib/config-surface.d.ts +5 -7
  126. package/dist/src/lib/config-surface.js +18 -40
  127. package/dist/src/lib/config-surface.js.map +1 -1
  128. package/dist/src/lib/connections-list.d.ts +10 -0
  129. package/dist/src/lib/connections-list.js +18 -0
  130. package/dist/src/lib/connections-list.js.map +1 -0
  131. package/dist/src/lib/credentials-home.d.ts +58 -0
  132. package/dist/src/lib/credentials-home.js +204 -0
  133. package/dist/src/lib/credentials-home.js.map +1 -0
  134. package/dist/src/lib/credentials-lock.d.ts +88 -0
  135. package/dist/src/lib/credentials-lock.js +302 -0
  136. package/dist/src/lib/credentials-lock.js.map +1 -0
  137. package/dist/src/lib/credentials-store.d.ts +179 -24
  138. package/dist/src/lib/credentials-store.js +712 -77
  139. package/dist/src/lib/credentials-store.js.map +1 -1
  140. package/dist/src/lib/csv.d.ts +8 -9
  141. package/dist/src/lib/csv.js +3 -4
  142. package/dist/src/lib/csv.js.map +1 -1
  143. package/dist/src/lib/custodian.d.ts +8 -0
  144. package/dist/src/lib/custodian.js +18 -0
  145. package/dist/src/lib/custodian.js.map +1 -0
  146. package/dist/src/lib/db-codegen/dbGenerator.js +5 -16
  147. package/dist/src/lib/db-codegen/dbGenerator.js.map +1 -1
  148. package/dist/src/lib/db-codegen/dbNaming.d.ts +5 -13
  149. package/dist/src/lib/db-codegen/dbNaming.js +5 -17
  150. package/dist/src/lib/db-codegen/dbNaming.js.map +1 -1
  151. package/dist/src/lib/db-codegen/dbTemplates.d.ts +7 -56
  152. package/dist/src/lib/db-codegen/dbTemplates.js +25 -125
  153. package/dist/src/lib/db-codegen/dbTemplates.js.map +1 -1
  154. package/dist/src/lib/db-codegen/dbTsTypes.d.ts +2 -2
  155. package/dist/src/lib/db-codegen/dbTsTypes.js +2 -2
  156. package/dist/src/lib/db-codegen/dbTypeIR.d.ts +67 -2
  157. package/dist/src/lib/db-codegen/dbTypeIR.js +13 -2
  158. package/dist/src/lib/db-codegen/dbTypeIR.js.map +1 -1
  159. package/dist/src/lib/db3-export.d.ts +231 -0
  160. package/dist/src/lib/db3-export.js +510 -0
  161. package/dist/src/lib/db3-export.js.map +1 -0
  162. package/dist/src/lib/db3-index-output.d.ts +27 -0
  163. package/dist/src/lib/db3-index-output.js +49 -0
  164. package/dist/src/lib/db3-index-output.js.map +1 -0
  165. package/dist/src/lib/document-export-lookups.d.ts +31 -0
  166. package/dist/src/lib/document-export-lookups.js +53 -0
  167. package/dist/src/lib/document-export-lookups.js.map +1 -0
  168. package/dist/src/lib/document-export-permissions.d.ts +7 -5
  169. package/dist/src/lib/document-export-permissions.js +7 -5
  170. package/dist/src/lib/document-export-permissions.js.map +1 -1
  171. package/dist/src/lib/document-export-record-log.d.ts +57 -0
  172. package/dist/src/lib/document-export-record-log.js +215 -0
  173. package/dist/src/lib/document-export-record-log.js.map +1 -0
  174. package/dist/src/lib/document-ingest-artifact.d.ts +26 -2
  175. package/dist/src/lib/document-ingest-artifact.js +42 -8
  176. package/dist/src/lib/document-ingest-artifact.js.map +1 -1
  177. package/dist/src/lib/document-ingest-format2.d.ts +36 -0
  178. package/dist/src/lib/document-ingest-format2.js +78 -0
  179. package/dist/src/lib/document-ingest-format2.js.map +1 -0
  180. package/dist/src/lib/document-ingest-input.d.ts +9 -0
  181. package/dist/src/lib/document-ingest-input.js +28 -1
  182. package/dist/src/lib/document-ingest-input.js.map +1 -1
  183. package/dist/src/lib/document-ingest-rows.d.ts +16 -0
  184. package/dist/src/lib/document-ingest-rows.js +17 -0
  185. package/dist/src/lib/document-ingest-rows.js.map +1 -1
  186. package/dist/src/lib/document-ingest.d.ts +33 -1
  187. package/dist/src/lib/document-ingest.js +49 -0
  188. package/dist/src/lib/document-ingest.js.map +1 -1
  189. package/dist/src/lib/document-schema-rows.d.ts +42 -0
  190. package/dist/src/lib/document-schema-rows.js +53 -0
  191. package/dist/src/lib/document-schema-rows.js.map +1 -0
  192. package/dist/src/lib/env-resolver-core.d.ts +70 -2
  193. package/dist/src/lib/env-resolver-core.js +137 -20
  194. package/dist/src/lib/env-resolver-core.js.map +1 -1
  195. package/dist/src/lib/env-resolver.d.ts +14 -2
  196. package/dist/src/lib/env-resolver.js +32 -10
  197. package/dist/src/lib/env-resolver.js.map +1 -1
  198. package/dist/src/lib/function-authorize-check.d.ts +142 -0
  199. package/dist/src/lib/function-authorize-check.js +310 -0
  200. package/dist/src/lib/function-authorize-check.js.map +1 -0
  201. package/dist/src/lib/function-authorize-view.d.ts +15 -0
  202. package/dist/src/lib/function-authorize-view.js +50 -0
  203. package/dist/src/lib/function-authorize-view.js.map +1 -0
  204. package/dist/src/lib/function-bundle.d.ts +38 -18
  205. package/dist/src/lib/function-bundle.js +96 -35
  206. package/dist/src/lib/function-bundle.js.map +1 -1
  207. package/dist/src/lib/function-collect.d.ts +75 -12
  208. package/dist/src/lib/function-collect.js +427 -12
  209. package/dist/src/lib/function-collect.js.map +1 -1
  210. package/dist/src/lib/function-db-types.d.ts +29 -0
  211. package/dist/src/lib/function-db-types.js +117 -7
  212. package/dist/src/lib/function-db-types.js.map +1 -1
  213. package/dist/src/lib/function-document-types.d.ts +5 -3
  214. package/dist/src/lib/function-document-types.js +10 -14
  215. package/dist/src/lib/function-document-types.js.map +1 -1
  216. package/dist/src/lib/function-lint.d.ts +34 -0
  217. package/dist/src/lib/function-lint.js +112 -0
  218. package/dist/src/lib/function-lint.js.map +1 -0
  219. package/dist/src/lib/function-log-row.js +21 -2
  220. package/dist/src/lib/function-log-row.js.map +1 -1
  221. package/dist/src/lib/function-run.d.ts +16 -21
  222. package/dist/src/lib/function-run.js +37 -30
  223. package/dist/src/lib/function-run.js.map +1 -1
  224. package/dist/src/lib/function-schema-codegen.d.ts +1 -1
  225. package/dist/src/lib/function-schema-codegen.js +5 -5
  226. package/dist/src/lib/function-schema-codegen.js.map +1 -1
  227. package/dist/src/lib/function-source-roots.d.ts +67 -0
  228. package/dist/src/lib/function-source-roots.js +148 -0
  229. package/dist/src/lib/function-source-roots.js.map +1 -0
  230. package/dist/src/lib/function-sync.d.ts +108 -22
  231. package/dist/src/lib/function-sync.js +127 -39
  232. package/dist/src/lib/function-sync.js.map +1 -1
  233. package/dist/src/lib/function-trigger-listing.d.ts +11 -6
  234. package/dist/src/lib/function-trigger-listing.js +32 -11
  235. package/dist/src/lib/function-trigger-listing.js.map +1 -1
  236. package/dist/src/lib/function-typecheck.d.ts +37 -2
  237. package/dist/src/lib/function-typecheck.js +210 -28
  238. package/dist/src/lib/function-typecheck.js.map +1 -1
  239. package/dist/src/lib/function-versions.d.ts +2 -0
  240. package/dist/src/lib/function-versions.js +1 -0
  241. package/dist/src/lib/function-versions.js.map +1 -1
  242. package/dist/src/lib/generated-allowlist.js +0 -20
  243. package/dist/src/lib/generated-allowlist.js.map +1 -1
  244. package/dist/src/lib/generated-config-surfaces.d.ts +703 -201
  245. package/dist/src/lib/generated-config-surfaces.js +2335 -2033
  246. package/dist/src/lib/generated-config-surfaces.js.map +1 -1
  247. package/dist/src/lib/generated-sdk-types.d.ts +1 -1
  248. package/dist/src/lib/generated-sdk-types.js +1 -1
  249. package/dist/src/lib/generated-sdk-types.js.map +1 -1
  250. package/dist/src/lib/init-adopt.js +12 -3
  251. package/dist/src/lib/init-adopt.js.map +1 -1
  252. package/dist/src/lib/init-login-note.d.ts +13 -0
  253. package/dist/src/lib/init-login-note.js +22 -0
  254. package/dist/src/lib/init-login-note.js.map +1 -0
  255. package/dist/src/lib/json-value.d.ts +6 -0
  256. package/dist/src/lib/json-value.js +13 -0
  257. package/dist/src/lib/json-value.js.map +1 -0
  258. package/dist/src/lib/load-routes.d.ts +33 -0
  259. package/dist/src/lib/load-routes.js +35 -0
  260. package/dist/src/lib/load-routes.js.map +1 -0
  261. package/dist/src/lib/local-state.d.ts +38 -7
  262. package/dist/src/lib/local-state.js +172 -49
  263. package/dist/src/lib/local-state.js.map +1 -1
  264. package/dist/src/lib/local-test-cases.d.ts +5 -2
  265. package/dist/src/lib/local-test-cases.js +7 -4
  266. package/dist/src/lib/local-test-cases.js.map +1 -1
  267. package/dist/src/lib/log-inspection.d.ts +42 -4
  268. package/dist/src/lib/log-inspection.js +37 -5
  269. package/dist/src/lib/log-inspection.js.map +1 -1
  270. package/dist/src/lib/login-exchange-check.d.ts +18 -0
  271. package/dist/src/lib/login-exchange-check.js +27 -0
  272. package/dist/src/lib/login-exchange-check.js.map +1 -0
  273. package/dist/src/lib/login-scope-lines.d.ts +25 -0
  274. package/dist/src/lib/login-scope-lines.js +45 -0
  275. package/dist/src/lib/login-scope-lines.js.map +1 -0
  276. package/dist/src/lib/logout-admin-session.d.ts +2 -1
  277. package/dist/src/lib/logout-admin-session.js +7 -1
  278. package/dist/src/lib/logout-admin-session.js.map +1 -1
  279. package/dist/src/lib/object-status-filter.d.ts +9 -1
  280. package/dist/src/lib/object-status-filter.js +9 -1
  281. package/dist/src/lib/object-status-filter.js.map +1 -1
  282. package/dist/src/lib/output.js +2 -0
  283. package/dist/src/lib/output.js.map +1 -1
  284. package/dist/src/lib/paginate.d.ts +0 -5
  285. package/dist/src/lib/paginate.js +0 -5
  286. package/dist/src/lib/paginate.js.map +1 -1
  287. package/dist/src/lib/pin-refusal-hint.d.ts +12 -0
  288. package/dist/src/lib/pin-refusal-hint.js +35 -0
  289. package/dist/src/lib/pin-refusal-hint.js.map +1 -0
  290. package/dist/src/lib/primitive-env-plugin.d.ts +99 -0
  291. package/dist/src/lib/primitive-env-plugin.js +408 -0
  292. package/dist/src/lib/primitive-env-plugin.js.map +1 -0
  293. package/dist/src/lib/project-config.d.ts +7 -0
  294. package/dist/src/lib/project-config.js +22 -1
  295. package/dist/src/lib/project-config.js.map +1 -1
  296. package/dist/src/lib/project-login-apps.d.ts +8 -0
  297. package/dist/src/lib/project-login-apps.js +27 -0
  298. package/dist/src/lib/project-login-apps.js.map +1 -0
  299. package/dist/src/lib/prompt-schema-codegen.d.ts +10 -3
  300. package/dist/src/lib/prompt-schema-codegen.js +52 -11
  301. package/dist/src/lib/prompt-schema-codegen.js.map +1 -1
  302. package/dist/src/lib/pull-write.d.ts +31 -0
  303. package/dist/src/lib/pull-write.js +49 -0
  304. package/dist/src/lib/pull-write.js.map +1 -0
  305. package/dist/src/lib/push-failure-report.d.ts +45 -0
  306. package/dist/src/lib/push-failure-report.js +57 -0
  307. package/dist/src/lib/push-failure-report.js.map +1 -0
  308. package/dist/src/lib/records-verbs.d.ts +69 -0
  309. package/dist/src/lib/records-verbs.js +40 -0
  310. package/dist/src/lib/records-verbs.js.map +1 -0
  311. package/dist/src/lib/refresh-admin-credentials.d.ts +7 -0
  312. package/dist/src/lib/refresh-admin-credentials.js +16 -4
  313. package/dist/src/lib/refresh-admin-credentials.js.map +1 -1
  314. package/dist/src/lib/root-import-decision.d.ts +65 -0
  315. package/dist/src/lib/root-import-decision.js +109 -0
  316. package/dist/src/lib/root-import-decision.js.map +1 -0
  317. package/dist/src/lib/run-status.d.ts +1 -1
  318. package/dist/src/lib/run-status.generated.d.ts +2 -2
  319. package/dist/src/lib/run-status.generated.js +3 -1
  320. package/dist/src/lib/run-status.generated.js.map +1 -1
  321. package/dist/src/lib/run-status.js +1 -1
  322. package/dist/src/lib/schema-codegen/generated-schema-descriptor.d.ts +129 -0
  323. package/dist/src/lib/schema-codegen/generated-schema-descriptor.js +269 -0
  324. package/dist/src/lib/schema-codegen/generated-schema-descriptor.js.map +1 -0
  325. package/dist/src/lib/schema-codegen/naming.d.ts +35 -0
  326. package/dist/src/lib/schema-codegen/naming.js +83 -0
  327. package/dist/src/lib/schema-codegen/naming.js.map +1 -0
  328. package/dist/src/lib/schema-codegen/schemaToTs.d.ts +82 -0
  329. package/dist/src/lib/schema-codegen/schemaToTs.js +305 -0
  330. package/dist/src/lib/schema-codegen/schemaToTs.js.map +1 -0
  331. package/dist/src/lib/scope-request.d.ts +84 -0
  332. package/dist/src/lib/scope-request.js +235 -0
  333. package/dist/src/lib/scope-request.js.map +1 -0
  334. package/dist/src/lib/session-id.d.ts +9 -0
  335. package/dist/src/lib/session-id.js +28 -0
  336. package/dist/src/lib/session-id.js.map +1 -0
  337. package/dist/src/lib/snapshot-build-rows.d.ts +21 -0
  338. package/dist/src/lib/snapshot-build-rows.js +22 -0
  339. package/dist/src/lib/snapshot-build-rows.js.map +1 -1
  340. package/dist/src/lib/snapshot-build.js +8 -3
  341. package/dist/src/lib/snapshot-build.js.map +1 -1
  342. package/dist/src/lib/snapshots.d.ts +17 -1
  343. package/dist/src/lib/snapshots.js +50 -2
  344. package/dist/src/lib/snapshots.js.map +1 -1
  345. package/dist/src/lib/swift-codegen/agentGenerator.d.ts +6 -2
  346. package/dist/src/lib/swift-codegen/agentGenerator.js +57 -5
  347. package/dist/src/lib/swift-codegen/agentGenerator.js.map +1 -1
  348. package/dist/src/lib/swift-codegen/banners.d.ts +34 -7
  349. package/dist/src/lib/swift-codegen/banners.js +37 -7
  350. package/dist/src/lib/swift-codegen/banners.js.map +1 -1
  351. package/dist/src/lib/swift-codegen/dbGenerator.d.ts +4 -3
  352. package/dist/src/lib/swift-codegen/dbGenerator.js +14 -117
  353. package/dist/src/lib/swift-codegen/dbGenerator.js.map +1 -1
  354. package/dist/src/lib/swift-codegen/functionGenerator.d.ts +3 -3
  355. package/dist/src/lib/swift-codegen/functionGenerator.js +23 -18
  356. package/dist/src/lib/swift-codegen/functionGenerator.js.map +1 -1
  357. package/dist/src/lib/swift-codegen/generator.d.ts +5 -5
  358. package/dist/src/lib/swift-codegen/generator.js +35 -40
  359. package/dist/src/lib/swift-codegen/generator.js.map +1 -1
  360. package/dist/src/lib/swift-codegen/schemaToSwift.d.ts +3 -3
  361. package/dist/src/lib/swift-codegen/schemaToSwift.js +4 -4
  362. package/dist/src/lib/swift-codegen/schemaToSwift.js.map +1 -1
  363. package/dist/src/lib/swift-codegen/swiftKeys.d.ts +19 -0
  364. package/dist/src/lib/swift-codegen/swiftKeys.js +31 -0
  365. package/dist/src/lib/swift-codegen/swiftKeys.js.map +1 -0
  366. package/dist/src/lib/sync-paths.d.ts +35 -0
  367. package/dist/src/lib/sync-paths.js +57 -5
  368. package/dist/src/lib/sync-paths.js.map +1 -1
  369. package/dist/src/lib/sync-resource-types.d.ts +26 -26
  370. package/dist/src/lib/sync-resource-types.js +61 -189
  371. package/dist/src/lib/sync-resource-types.js.map +1 -1
  372. package/dist/src/lib/sync-selectors.d.ts +5 -1
  373. package/dist/src/lib/sync-selectors.js +23 -13
  374. package/dist/src/lib/sync-selectors.js.map +1 -1
  375. package/dist/src/lib/test-case-file-names.d.ts +3 -5
  376. package/dist/src/lib/test-case-file-names.js +3 -5
  377. package/dist/src/lib/test-case-file-names.js.map +1 -1
  378. package/dist/src/lib/toml-database-config.d.ts +15 -75
  379. package/dist/src/lib/toml-database-config.js +17 -306
  380. package/dist/src/lib/toml-database-config.js.map +1 -1
  381. package/dist/src/lib/transient-retry.d.ts +43 -0
  382. package/dist/src/lib/transient-retry.js +94 -0
  383. package/dist/src/lib/transient-retry.js.map +1 -0
  384. package/dist/src/lib/vars-override.d.ts +105 -0
  385. package/dist/src/lib/vars-override.js +143 -0
  386. package/dist/src/lib/vars-override.js.map +1 -0
  387. package/dist/src/lib/webhook-capture.d.ts +43 -0
  388. package/dist/src/lib/webhook-capture.js +91 -0
  389. package/dist/src/lib/webhook-capture.js.map +1 -0
  390. package/dist/src/lib/webhook-deliver.d.ts +18 -20
  391. package/dist/src/lib/webhook-deliver.js +34 -89
  392. package/dist/src/lib/webhook-deliver.js.map +1 -1
  393. package/dist/src/lib/webhook-test-run.d.ts +32 -0
  394. package/dist/src/lib/webhook-test-run.js +108 -0
  395. package/dist/src/lib/webhook-test-run.js.map +1 -0
  396. package/dist/src/lib/workflow-codegen/generator.d.ts +7 -7
  397. package/dist/src/lib/workflow-codegen/generator.js +16 -23
  398. package/dist/src/lib/workflow-codegen/generator.js.map +1 -1
  399. package/dist/src/lib/workflow-codegen/invokerIR.d.ts +6 -12
  400. package/dist/src/lib/workflow-codegen/invokerIR.js +4 -5
  401. package/dist/src/lib/workflow-codegen/invokerIR.js.map +1 -1
  402. package/dist/src/lib/workflow-toml-validator.d.ts +2 -0
  403. package/dist/src/lib/workflow-toml-validator.js +28 -1
  404. package/dist/src/lib/workflow-toml-validator.js.map +1 -1
  405. package/dist/src/types/index.d.ts +30 -37
  406. package/dist/src/validators.d.ts +7 -55
  407. package/dist/src/validators.js +7 -53
  408. package/dist/src/validators.js.map +1 -1
  409. package/dist/src/vite.d.ts +17 -0
  410. package/dist/src/vite.js +18 -0
  411. package/dist/src/vite.js.map +1 -0
  412. package/package.json +20 -12
@@ -8,27 +8,34 @@
8
8
  * in one envelope. The server verifies the hash and stores the object; it does
9
9
  * not compile anything.
10
10
  *
11
- * ── The two import rules ─────────────────────────────────────────────────
11
+ * ── Where an imported file may come from ───────────────────────────────
12
12
  *
13
- * They look contradictory and are not (F-005):
13
+ * Every file the build read is classified by its REAL path, never by how it
14
+ * was imported (F-005, widened by #4502):
14
15
  *
15
- * - A **filesystem import** — relative or absolute — must stay inside the
16
- * config tree. `entry`, every import it reaches, and every symlink they
17
- * traverse are realpath-resolved and checked against the tree root, so a
18
- * push can never read a file off a developer's disk that the tree does not
19
- * contain.
20
- * - A **bare package specifier** is exempt. It resolves through Node into an
21
- * ancestor `node_modules`, which is outside every config tree by
22
- * construction; esbuild inlines it into the bundle, and it is never
23
- * captured as an authored source (so `config pull` never writes
24
- * `node_modules` content back).
16
+ * 1. Inside the config tree → a **tree source**: captured as authored bytes
17
+ * and stored with the version, so `config pull` hands it back. An
18
+ * in-tree `node_modules` file still builds and is not captured.
19
+ * 2. Inside a directory the project declares in `functionSources` → a
20
+ * **shared source**: bundled, typechecked, and never captured. The
21
+ * repository is its source of truth, as it is for an npm package, so it is
22
+ * listed in `projectSources` for the typechecker and nowhere else.
23
+ * 3. Under a `node_modules` directory AND reached by a bare specifier (or
24
+ * from a file one reached) → a **dependency**: inlined, never captured.
25
+ * 4. Anything else → an **escape**, refused. A push can never read a file
26
+ * off a developer's disk that neither the tree nor a declaration admits.
25
27
  *
26
- * The exemption follows the specifier, not the path a file happens to sit at.
27
- * A resolver plugin records the files a BARE specifier reached (and the files
28
- * those reach in turn), so `import "../../node_modules/private/index.js"` — a
29
- * relative filesystem import that merely lands in a `node_modules` directory —
30
- * is still an escape and still refused. Deciding by path would have let that
31
- * one specifier read any file on the disk and upload it.
28
+ * Rule 3 keeps two conditions on purpose. The provenance half: a resolver
29
+ * plugin records the files a BARE specifier reached, so `import
30
+ * "../../node_modules/private/index.js"` — a relative import that merely lands
31
+ * in a `node_modules` directory — is still an escape. Deciding by path alone
32
+ * would let that one specifier read any file on the disk and upload it. The
33
+ * path half: a bare specifier is not a free pass either. esbuild honours each
34
+ * file's nearest tsconfig `paths`, so a shared file's `@/util/h` resolves into
35
+ * the web app's own source, and a workspace package is a symlink to a
36
+ * directory the repository owns. Both are bare specifiers landing on ordinary
37
+ * files outside `node_modules`, so both are escapes unless their directory is
38
+ * declared — after which they are shared sources, bundled AND typechecked.
32
39
  *
33
40
  * `primitive-functions` is the one bare specifier left EXTERNAL: the loader
34
41
  * (#3180) supplies it at invoke time, so baking a copy into every bundle would
@@ -71,8 +78,10 @@
71
78
  */
72
79
  import * as esbuild from "esbuild";
73
80
  import { createHash } from "crypto";
74
- import { existsSync, readFileSync, realpathSync } from "fs";
81
+ import { existsSync, readdirSync, readFileSync, realpathSync } from "fs";
75
82
  import { isAbsolute, relative, resolve, sep } from "path";
83
+ import { FUNCTION_SOURCES_KEY, isInsideDirectory, resolveFunctionSourceRoots, } from "./function-source-roots.js";
84
+ import { AUTH_FIXTURES_FILE, isAuthCaseFilePath, isAuthFixturesPath } from "./auth-fixtures.js";
76
85
  /** The module the loader supplies; never bundled. */
77
86
  export const PRIMITIVE_FUNCTIONS_MODULE = "primitive-functions";
78
87
  /** What that module was called before #3209. Refused at push, by name. */
@@ -170,7 +179,41 @@ function outsideRoot(root, candidate) {
170
179
  function escapeRefusal(what, path) {
171
180
  return new FunctionBuildError(`${what} '${path}' resolves outside the config tree root. ` +
172
181
  "Filesystem imports must stay inside the config tree; npm packages are " +
173
- "imported by name and inlined into the bundle.");
182
+ "imported by name and inlined into the bundle. To share code from " +
183
+ `another directory, declare it in "${FUNCTION_SOURCES_KEY}" in primitive/config.json.`);
184
+ }
185
+ /**
186
+ * The real path of each reserved file in the tree — `auth-fixtures.json` and
187
+ * `functions/*.auth.json` — mapped to its reserved name (#4732).
188
+ */
189
+ function reservedAuthFileTargets(treeRoot) {
190
+ const names = [AUTH_FIXTURES_FILE];
191
+ try {
192
+ for (const entry of readdirSync(resolve(treeRoot, "functions"))) {
193
+ const name = `functions/${entry}`;
194
+ if (isAuthCaseFilePath(name))
195
+ names.push(name);
196
+ }
197
+ }
198
+ catch {
199
+ // No functions directory: only the fixture map can be reserved.
200
+ }
201
+ const targets = new Map();
202
+ for (const name of names) {
203
+ const absolute = resolve(treeRoot, name);
204
+ if (existsSync(absolute))
205
+ targets.set(realOrSelf(absolute), name);
206
+ }
207
+ return targets;
208
+ }
209
+ /** The real path, or the spelling itself when it cannot be resolved. */
210
+ function realOrSelf(path) {
211
+ try {
212
+ return realpathSync(path);
213
+ }
214
+ catch {
215
+ return path;
216
+ }
174
217
  }
175
218
  /**
176
219
  * Build one function's bundle and collect its authored sources.
@@ -181,6 +224,8 @@ function escapeRefusal(what, path) {
181
224
  export async function buildFunctionBundle(options) {
182
225
  const { configDir, entry, functionKey } = options;
183
226
  const treeRoot = realpathSync(resolve(configDir));
227
+ const sourceRoots = (options.sourceRoots ??
228
+ resolveFunctionSourceRoots(configDir).roots.map((root) => root.absolute)).map((root) => realOrSelf(resolve(root)));
184
229
  // 1. The entry, lexically. An escaping entry is refused as an escape even
185
230
  // when the file it names does not exist — "no such file" would be a
186
231
  // misleading answer to `entry = "../../etc/passwd"`.
@@ -299,26 +344,41 @@ export async function buildFunctionBundle(options) {
299
344
  }
300
345
  const bundle = Buffer.from(output.contents);
301
346
  // 3. Every file the build actually read, from the metafile — the honest list,
302
- // rather than a re-parse of the imports. A file a BARE specifier reached is
303
- // an inlined dependency and is dropped; every other input is a filesystem
304
- // import, and one outside the tree is an escape esbuild followed that the
305
- // push refuses.
347
+ // rather than a re-parse of the imports — classified by its real path in
348
+ // the order the module note gives.
306
349
  const sources = [];
350
+ const projectSources = new Set();
351
+ const reservedTargets = reservedAuthFileTargets(treeRoot);
307
352
  for (const input of Object.keys(result.metafile?.inputs ?? {})) {
308
- const path = toPosix(input);
309
353
  const absolute = resolve(treeRoot, input);
310
- if (isDependencyFile(absolute))
311
- continue;
312
- if (path.startsWith("..") || isAbsolute(input)) {
313
- throw escapeRefusal("import", path);
354
+ const real = realOrSelf(absolute);
355
+ const inNodeModules = real.split(sep).includes("node_modules");
356
+ // #4732 — the fixture map and the case files are never uploaded. Both
357
+ // direct and transitive imports appear here, so one check covers both;
358
+ // a reserved name that is a symlink is matched by its target, which is
359
+ // the path the build reports.
360
+ const reserved = reservedTargets.get(real) ??
361
+ [toPosix(relative(treeRoot, absolute)), toPosix(relative(treeRoot, real))].find((path) => isAuthFixturesPath(path) || isAuthCaseFilePath(path));
362
+ if (reserved !== undefined) {
363
+ throw new FunctionBuildError(`function '${functionKey}' failed to build:\n ${reserved}: auth fixtures and case files are never uploaded; ` +
364
+ "read them with 'primitive functions authorize' instead of importing them");
314
365
  }
315
- if (outsideRoot(treeRoot, realpathSync(absolute)) !== null) {
316
- throw escapeRefusal("import", path);
366
+ if (!isInsideDirectory(treeRoot, real)) {
367
+ // A dependency a bare specifier reached is inlined even when it sits
368
+ // under a declared directory: it is a package, not shared source.
369
+ if (inNodeModules && isDependencyFile(absolute))
370
+ continue;
371
+ if (sourceRoots.some((root) => isInsideDirectory(root, real))) {
372
+ projectSources.add(toPosix(relative(treeRoot, real)));
373
+ continue;
374
+ }
375
+ throw escapeRefusal("import", toPosix(relative(treeRoot, real)));
317
376
  }
318
- // In-tree `node_modules` reached by a filesystem import: inside the
319
- // boundary, so it builds — but `config pull` refuses to write a stored
320
- // `node_modules` path, so capturing it would promise a round trip that
321
- // cannot be kept.
377
+ const path = toPosix(relative(treeRoot, real));
378
+ // In-tree `node_modules`, reached by a bare specifier or a filesystem
379
+ // import: inside the boundary, so it builds — but `config pull` refuses to
380
+ // write a stored `node_modules` path, so capturing it would promise a round
381
+ // trip that cannot be kept.
322
382
  if (isDependencyPath(path))
323
383
  continue;
324
384
  const content = readFileSync(absolute);
@@ -336,6 +396,7 @@ export async function buildFunctionBundle(options) {
336
396
  bundle,
337
397
  contentHash: createHash("sha256").update(bundle).digest("hex"),
338
398
  sources,
399
+ projectSources: [...projectSources].sort(),
339
400
  };
340
401
  }
341
402
  //# sourceMappingURL=function-bundle.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"function-bundle.js","sourceRoot":"","sources":["../../../src/lib/function-bundle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsEG;AAEH,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO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cAAc,EAAE,CAAC,GAAG,cAAc,CAAC,CAAC,IAAI,EAAE;KAC3C,CAAC;AACJ,CAAC"}
@@ -51,6 +51,14 @@
51
51
  */
52
52
  /** The manifest encoding, versioned with the envelope that carries it. */
53
53
  export declare const FUNCTION_MANIFEST_SCHEMA_VERSION = 2;
54
+ /**
55
+ * The version a FLAGGED build emits (#4730): version 2 plus the `authorize`
56
+ * block and `writeFamilies`. A bare-handler build keeps emitting version 2,
57
+ * byte for byte, so no legacy envelope hash moves.
58
+ */
59
+ export declare const FUNCTION_MANIFEST_AUTHORIZE_SCHEMA_VERSION = 3;
60
+ /** How much of one authorize source text the families scan reads. */
61
+ export declare const AUTHORIZE_SOURCE_SCAN_CAP: number;
54
62
  /** How long a tree's module scope may run before collection gives up. */
55
63
  export declare const COLLECT_TIMEOUT_MS = 20000;
56
64
  /** A push that cannot proceed because its manifest could not be collected. */
@@ -85,11 +93,46 @@ export interface FunctionManifest {
85
93
  families: string[];
86
94
  /** A model name the scan could not resolve; "and possibly more". */
87
95
  dynamicModels: boolean;
96
+ /** Version 3 only: the families a write or send verb reaches (#4730). */
97
+ writeFamilies?: string[];
98
+ /** Version 3 only: what the exported `authorize` admits (#4730). */
99
+ authorize?: CollectedAuthorize;
100
+ }
101
+ /** The `authorize` block of a version-3 manifest (#4730). */
102
+ export interface CollectedAuthorize {
103
+ present: true;
104
+ public: boolean;
105
+ helper: string | null;
106
+ callers: {
107
+ webhook: boolean;
108
+ cron: boolean;
109
+ manual: boolean;
110
+ functions: string[];
111
+ agents: boolean | "rule";
112
+ users: false | "rule";
113
+ /** #4803 — present, and true, only when the `db3` door is open. */
114
+ db3?: true;
115
+ } | null;
116
+ families: string[];
88
117
  }
118
+ /**
119
+ * The `auth.*` families a hand-written authorize's source text reaches —
120
+ * #4730 behavior 4.
121
+ *
122
+ * A member-access scan, on whatever the author named the parameter, plus the
123
+ * families of any SDK helper the text calls by name (esbuild may suffix a
124
+ * renamed import, `requireRole2(`). `hasRole` compares `auth.user.role` and
125
+ * reads no membership. Imprecise by construction, as `families[]` is: a body
126
+ * that delegates to a function defined elsewhere records nothing, and an
127
+ * unrelated `.user` in the text counts. Each text is read to
128
+ * {@link AUTHORIZE_SOURCE_SCAN_CAP} only.
129
+ */
130
+ export declare function scanAuthorizeSources(sources: string[]): string[];
89
131
  export declare function scanBundleForManifest(bundle: string): {
90
132
  models: string[];
91
133
  families: string[];
92
134
  dynamicModels: boolean;
135
+ writeFamilies: string[];
93
136
  };
94
137
  /**
95
138
  * The recording stub the collect build substitutes for
@@ -99,17 +142,21 @@ export declare function scanBundleForManifest(bundle: string): {
99
142
  * every other export are inert, so a module that calls one at import time
100
143
  * neither fails nor has an effect.
101
144
  */
102
- export declare const COLLECT_STUB_SOURCE = "\nconst registry = (globalThis.__PRIMITIVE_COLLECT_REGISTRY__ ||= []);\n\n// The default-coercion rule the SDK applies at registration (#3281,\n// D3281-SO-005), spelled here too so a default the declared type cannot\n// coerce is refused at PUSH \u2014 this stub is what push runs \u2014 rather than at\n// the first invocation. The vendored grammar (`coerceParamDefault` in\n// generated-config-surfaces.ts) is the same rule and re-checks the manifest.\nconst SCALAR_TYPES = [\"string\", \"number\", \"boolean\", \"any\"];\nfunction coerceScalar(type, value) {\n if (type === \"number\") {\n const n = typeof value === \"number\" ? value : Number(value);\n if (typeof value === \"boolean\" || value === null || value === \"\" || !Number.isFinite(n)) {\n return { ok: false, reason: \"must be a number\" };\n }\n return { ok: true, value: n };\n }\n if (type === \"boolean\") {\n if (typeof value === \"boolean\") return { ok: true, value };\n if (value === \"true\") return { ok: true, value: true };\n if (value === \"false\") return { ok: true, value: false };\n return { ok: false, reason: \"must be a boolean\" };\n }\n if (type === \"string\") {\n if (typeof value !== \"string\") return { ok: false, reason: \"must be a string\" };\n return { ok: true, value };\n }\n return { ok: true, value };\n}\nfunction coerceDefault(spec, value) {\n if (spec.type === \"array\") {\n if (!Array.isArray(value)) return { ok: false, reason: \"must be an array\" };\n const itemType = spec.items && spec.items.type ? String(spec.items.type) : \"any\";\n const out = [];\n for (const element of value) {\n const coerced = coerceScalar(itemType, element);\n if (!coerced.ok) return { ok: false, reason: \"every element \" + coerced.reason };\n out.push(coerced.value);\n }\n return { ok: true, value: out };\n }\n return coerceScalar(spec.type === undefined ? \"any\" : String(spec.type), value);\n}\n\nfunction record(kind, name, config) {\n const c = config || {};\n const params = {};\n for (const [key, value] of Object.entries(c.params || {})) {\n const spec = value && typeof value === \"object\" ? value : { type: String(value) };\n const entry = {};\n const fail = (message) => {\n throw new Error(\"'\" + name + \"': parameter '\" + key + \"' \" + message);\n };\n if (spec.type !== undefined) entry.type = String(spec.type);\n if (entry.type === \"array\") {\n if (spec.items !== undefined && spec.items !== null) {\n const itemType =\n spec.items && typeof spec.items === \"object\" ? String(spec.items.type ?? \"\") : \"\";\n if (!SCALAR_TYPES.includes(itemType)) {\n fail(\"declares an `items` type outside \" + SCALAR_TYPES.join(\", \") + \".\");\n }\n entry.items = { type: itemType };\n }\n if (spec.caller === true) fail(\"is an array bound to $caller; `caller` is a scalar binding.\");\n }\n if (spec.default !== undefined) {\n const coerced = coerceDefault(entry, spec.default);\n if (!coerced.ok) fail(\"has a default that \" + coerced.reason + \".\");\n entry.default = coerced.value;\n }\n if (spec.caller === true || spec === \"$caller\" || spec.type === \"$caller\") {\n entry.caller = true;\n }\n params[String(key)] = entry;\n }\n const declaredCaller = Object.values(params).some((p) => p.caller === true);\n registry.push({\n kind,\n name: String(name),\n models: Array.isArray(c.models) ? c.models.map(String) : [],\n params,\n cache:\n c.cache && typeof c.cache === \"object\" && Number(c.cache.ttlMs) > 0\n ? { ttlMs: Number(c.cache.ttlMs) }\n : null,\n callerScoped: declaredCaller,\n });\n return async () => {\n throw new Error(\n \"'\" + name + \"' was called during manifest collection; a registration's \" +\n \"`run` only executes inside a real invocation.\"\n );\n };\n}\n\n// The PUBLIC surface, all of it. An ESM import of a name a module does not\n// export is a build error, so a stub missing one export refuses a tree the\n// sandbox would have run \u2014 collection is mandatory, so that is a valid\n// function that cannot be pushed at all (CR3187-007). The constants carry the\n// runtime's own values so a registration computed from one collects the same\n// way it will run.\nexport const SDK_STUB_VERSION = \"collect\";\nexport const MAX_QUERY_CACHE_TTL_MS = 60000;\nexport const PMAP_DEFAULT_CONCURRENCY = 8;\nexport function defineQuery(name, config) { return record(\"query\", name, config); }\nexport function defineMutation(name, config) { return record(\"mutation\", name, config); }\nexport function defineFunction(keyOrHandler, maybeHandler) {\n // The KEYED form (#3281) returns a wrapper CARRYING its key, exactly as the\n // baked SDK's does. That is what push reads: the child resolves the callable\n // the bootstrap would select and compares THAT key to the file's\n // (D3281-SO-006). The registry entry is the child's report of what the\n // module scope did; it is not what the check consults, because a keyed\n // handler an entry merely imports for composition registers here too.\n if (typeof keyOrHandler === \"string\" || maybeHandler !== undefined) {\n registry.push({ kind: \"function\", name: String(keyOrHandler) });\n const wrapped = function (...args) {\n return maybeHandler(...args);\n };\n wrapped.functionKey = String(keyOrHandler);\n return wrapped;\n }\n return keyOrHandler;\n}\nexport function pMap(items, mapper) { return Promise.all((items || []).map(mapper)); }\nexport function ulid() { return \"00000000000000000000000000\"; }\nexport const stepPolicy = new Proxy({}, { get: () => ({}) });\n// #3482 \u2014 the runtime surface, and `assertRuntime` is INERT here on purpose.\n// Collection has no runtime: this child process exists to learn what a tree\n// registers, and there is nothing for an assertion to be about. A stub that\n// threw would refuse exactly the functions the assertion exists for \u2014 and the\n// placement the guide teaches is module scope, which collection runs.\nexport function assertRuntime() {}\nexport class FunctionRuntimeError extends Error {\n constructor(message, runtime, required) {\n super(message);\n this.name = \"FUNCTION_RUNTIME_REFUSED\";\n this.runtime = runtime;\n this.required = required;\n }\n}\nexport default {\n SDK_STUB_VERSION,\n defineFunction,\n defineQuery,\n defineMutation,\n pMap,\n ulid,\n assertRuntime,\n FunctionRuntimeError,\n};\n";
103
- /**
104
- * Collect one function's manifest.
105
- *
106
- * Throws `FunctionCollectError` for every failure — a build error, a module
107
- * that throws at import, a loop that outlives the bound, or output that is not
108
- * the framed result — because a push whose manifest could not be collected is
109
- * refused rather than pushed without one (D3187-SO-005: the manifest is part
110
- * of the envelope, so "later" would mean a different version).
111
- */
112
- export declare function collectFunctionManifest(options: {
145
+ export declare const COLLECT_STUB_SOURCE: string;
146
+ /** What one collect pass learns about a function. */
147
+ export interface CollectedFunction {
148
+ /** The manifest the envelope carries. */
149
+ manifest: FunctionManifest;
150
+ /**
151
+ * Whether the callable the bootstrap would select carries `authorize` — the
152
+ * object form (#4717). The CLI's local answer, which decides whether
153
+ * `access` is sent and compared; the server records its own from the push
154
+ * probe, and this never travels in the push.
155
+ */
156
+ authorize: boolean;
157
+ }
158
+ /** What `collectFunction` and `collectFunctionManifest` take. */
159
+ export interface CollectOptions {
113
160
  configDir: string;
114
161
  entry: string;
115
162
  functionKey: string;
@@ -120,4 +167,20 @@ export declare function collectFunctionManifest(options: {
120
167
  * runs; the real bundle is, and its literals are what the scan reads.
121
168
  */
122
169
  bundle?: string;
123
- }): Promise<FunctionManifest>;
170
+ }
171
+ /**
172
+ * Collect one function's manifest.
173
+ *
174
+ * Throws `FunctionCollectError` for every failure — a build error, a module
175
+ * that throws at import, a loop that outlives the bound, or output that is not
176
+ * the framed result — because a push whose manifest could not be collected is
177
+ * refused rather than pushed without one (D3187-SO-005: the manifest is part
178
+ * of the envelope, so "later" would mean a different version).
179
+ */
180
+ export declare function collectFunctionManifest(options: CollectOptions): Promise<FunctionManifest>;
181
+ /**
182
+ * Collect one function's manifest and its local `authorize` answer (#4717),
183
+ * from the one run of its module scope. Throws as `collectFunctionManifest`
184
+ * does.
185
+ */
186
+ export declare function collectFunction(options: CollectOptions): Promise<CollectedFunction>;