primitive-admin 1.2.0-alpha.1 → 1.2.0-alpha.11

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 (410) hide show
  1. package/README.md +105 -134
  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 +11 -12
  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 +221 -457
  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/sync-app-settings.d.ts +36 -8
  67. package/dist/src/commands/sync-app-settings.js +109 -23
  68. package/dist/src/commands/sync-app-settings.js.map +1 -1
  69. package/dist/src/commands/sync.d.ts +360 -610
  70. package/dist/src/commands/sync.js +3151 -6697
  71. package/dist/src/commands/sync.js.map +1 -1
  72. package/dist/src/commands/tokens.js +3 -3
  73. package/dist/src/commands/tokens.js.map +1 -1
  74. package/dist/src/commands/users.js +77 -2
  75. package/dist/src/commands/users.js.map +1 -1
  76. package/dist/src/commands/workflows.d.ts +5 -83
  77. package/dist/src/commands/workflows.js +57 -2282
  78. package/dist/src/commands/workflows.js.map +1 -1
  79. package/dist/src/lib/aggregate-output.d.ts +25 -0
  80. package/dist/src/lib/aggregate-output.js +53 -0
  81. package/dist/src/lib/aggregate-output.js.map +1 -0
  82. package/dist/src/lib/api-client.d.ts +681 -551
  83. package/dist/src/lib/api-client.js +880 -814
  84. package/dist/src/lib/api-client.js.map +1 -1
  85. package/dist/src/lib/app-settings-descriptor.d.ts +47 -1
  86. package/dist/src/lib/app-settings-descriptor.js +114 -10
  87. package/dist/src/lib/app-settings-descriptor.js.map +1 -1
  88. package/dist/src/lib/auth-fixtures.d.ts +44 -0
  89. package/dist/src/lib/auth-fixtures.js +61 -0
  90. package/dist/src/lib/auth-fixtures.js.map +1 -0
  91. package/dist/src/lib/auth-flow.d.ts +41 -1
  92. package/dist/src/lib/auth-flow.js +70 -16
  93. package/dist/src/lib/auth-flow.js.map +1 -1
  94. package/dist/src/lib/block-layout.d.ts +12 -23
  95. package/dist/src/lib/block-layout.js +26 -92
  96. package/dist/src/lib/block-layout.js.map +1 -1
  97. package/dist/src/lib/block-selector.d.ts +2 -2
  98. package/dist/src/lib/block-selector.js +2 -2
  99. package/dist/src/lib/child-apps-local.d.ts +164 -0
  100. package/dist/src/lib/child-apps-local.js +258 -0
  101. package/dist/src/lib/child-apps-local.js.map +1 -0
  102. package/dist/src/lib/ci-session-request.d.ts +22 -0
  103. package/dist/src/lib/ci-session-request.js +51 -0
  104. package/dist/src/lib/ci-session-request.js.map +1 -0
  105. package/dist/src/lib/codegen-shared/generatedFiles.d.ts +10 -8
  106. package/dist/src/lib/codegen-shared/generatedFiles.js +21 -15
  107. package/dist/src/lib/codegen-shared/generatedFiles.js.map +1 -1
  108. package/dist/src/lib/codegen-shared/prettierStable.d.ts +1 -1
  109. package/dist/src/lib/codegen-shared/prettierStable.js +1 -1
  110. package/dist/src/lib/codegen-shared/resolveCodegenSourceDir.d.ts +2 -2
  111. package/dist/src/lib/codegen-shared/resolveCodegenSourceDir.js +2 -2
  112. package/dist/src/lib/collection-export.d.ts +76 -15
  113. package/dist/src/lib/collection-export.js +116 -23
  114. package/dist/src/lib/collection-export.js.map +1 -1
  115. package/dist/src/lib/collection-principal.d.ts +22 -0
  116. package/dist/src/lib/collection-principal.js +35 -0
  117. package/dist/src/lib/collection-principal.js.map +1 -0
  118. package/dist/src/lib/config-object-descriptor.d.ts +3 -22
  119. package/dist/src/lib/config-object-descriptor.js +56 -290
  120. package/dist/src/lib/config-object-descriptor.js.map +1 -1
  121. package/dist/src/lib/config-payload.js +2 -3
  122. package/dist/src/lib/config-payload.js.map +1 -1
  123. package/dist/src/lib/config-surface.d.ts +5 -7
  124. package/dist/src/lib/config-surface.js +18 -40
  125. package/dist/src/lib/config-surface.js.map +1 -1
  126. package/dist/src/lib/connections-list.d.ts +10 -0
  127. package/dist/src/lib/connections-list.js +18 -0
  128. package/dist/src/lib/connections-list.js.map +1 -0
  129. package/dist/src/lib/credentials-home.d.ts +58 -0
  130. package/dist/src/lib/credentials-home.js +204 -0
  131. package/dist/src/lib/credentials-home.js.map +1 -0
  132. package/dist/src/lib/credentials-lock.d.ts +88 -0
  133. package/dist/src/lib/credentials-lock.js +302 -0
  134. package/dist/src/lib/credentials-lock.js.map +1 -0
  135. package/dist/src/lib/credentials-store.d.ts +179 -24
  136. package/dist/src/lib/credentials-store.js +712 -77
  137. package/dist/src/lib/credentials-store.js.map +1 -1
  138. package/dist/src/lib/csv.d.ts +8 -9
  139. package/dist/src/lib/csv.js +3 -4
  140. package/dist/src/lib/csv.js.map +1 -1
  141. package/dist/src/lib/custodian.d.ts +8 -0
  142. package/dist/src/lib/custodian.js +18 -0
  143. package/dist/src/lib/custodian.js.map +1 -0
  144. package/dist/src/lib/db-codegen/dbGenerator.js +5 -16
  145. package/dist/src/lib/db-codegen/dbGenerator.js.map +1 -1
  146. package/dist/src/lib/db-codegen/dbNaming.d.ts +5 -13
  147. package/dist/src/lib/db-codegen/dbNaming.js +5 -17
  148. package/dist/src/lib/db-codegen/dbNaming.js.map +1 -1
  149. package/dist/src/lib/db-codegen/dbTemplates.d.ts +7 -56
  150. package/dist/src/lib/db-codegen/dbTemplates.js +25 -125
  151. package/dist/src/lib/db-codegen/dbTemplates.js.map +1 -1
  152. package/dist/src/lib/db-codegen/dbTsTypes.d.ts +2 -2
  153. package/dist/src/lib/db-codegen/dbTsTypes.js +2 -2
  154. package/dist/src/lib/db-codegen/dbTypeIR.d.ts +67 -2
  155. package/dist/src/lib/db-codegen/dbTypeIR.js +13 -2
  156. package/dist/src/lib/db-codegen/dbTypeIR.js.map +1 -1
  157. package/dist/src/lib/db3-export.d.ts +231 -0
  158. package/dist/src/lib/db3-export.js +510 -0
  159. package/dist/src/lib/db3-export.js.map +1 -0
  160. package/dist/src/lib/db3-index-output.d.ts +27 -0
  161. package/dist/src/lib/db3-index-output.js +49 -0
  162. package/dist/src/lib/db3-index-output.js.map +1 -0
  163. package/dist/src/lib/document-export-lookups.d.ts +31 -0
  164. package/dist/src/lib/document-export-lookups.js +53 -0
  165. package/dist/src/lib/document-export-lookups.js.map +1 -0
  166. package/dist/src/lib/document-export-permissions.d.ts +7 -5
  167. package/dist/src/lib/document-export-permissions.js +7 -5
  168. package/dist/src/lib/document-export-permissions.js.map +1 -1
  169. package/dist/src/lib/document-export-record-log.d.ts +57 -0
  170. package/dist/src/lib/document-export-record-log.js +215 -0
  171. package/dist/src/lib/document-export-record-log.js.map +1 -0
  172. package/dist/src/lib/document-ingest-artifact.d.ts +26 -2
  173. package/dist/src/lib/document-ingest-artifact.js +42 -8
  174. package/dist/src/lib/document-ingest-artifact.js.map +1 -1
  175. package/dist/src/lib/document-ingest-format2.d.ts +36 -0
  176. package/dist/src/lib/document-ingest-format2.js +78 -0
  177. package/dist/src/lib/document-ingest-format2.js.map +1 -0
  178. package/dist/src/lib/document-ingest-input.d.ts +9 -0
  179. package/dist/src/lib/document-ingest-input.js +28 -1
  180. package/dist/src/lib/document-ingest-input.js.map +1 -1
  181. package/dist/src/lib/document-ingest-rows.d.ts +16 -0
  182. package/dist/src/lib/document-ingest-rows.js +17 -0
  183. package/dist/src/lib/document-ingest-rows.js.map +1 -1
  184. package/dist/src/lib/document-ingest.d.ts +33 -1
  185. package/dist/src/lib/document-ingest.js +49 -0
  186. package/dist/src/lib/document-ingest.js.map +1 -1
  187. package/dist/src/lib/document-schema-rows.d.ts +42 -0
  188. package/dist/src/lib/document-schema-rows.js +53 -0
  189. package/dist/src/lib/document-schema-rows.js.map +1 -0
  190. package/dist/src/lib/env-resolver-core.d.ts +70 -2
  191. package/dist/src/lib/env-resolver-core.js +137 -20
  192. package/dist/src/lib/env-resolver-core.js.map +1 -1
  193. package/dist/src/lib/env-resolver.d.ts +14 -2
  194. package/dist/src/lib/env-resolver.js +32 -10
  195. package/dist/src/lib/env-resolver.js.map +1 -1
  196. package/dist/src/lib/function-authorize-check.d.ts +142 -0
  197. package/dist/src/lib/function-authorize-check.js +310 -0
  198. package/dist/src/lib/function-authorize-check.js.map +1 -0
  199. package/dist/src/lib/function-authorize-view.d.ts +15 -0
  200. package/dist/src/lib/function-authorize-view.js +50 -0
  201. package/dist/src/lib/function-authorize-view.js.map +1 -0
  202. package/dist/src/lib/function-bundle.d.ts +38 -18
  203. package/dist/src/lib/function-bundle.js +96 -35
  204. package/dist/src/lib/function-bundle.js.map +1 -1
  205. package/dist/src/lib/function-collect.d.ts +75 -12
  206. package/dist/src/lib/function-collect.js +427 -12
  207. package/dist/src/lib/function-collect.js.map +1 -1
  208. package/dist/src/lib/function-db-types.d.ts +29 -0
  209. package/dist/src/lib/function-db-types.js +117 -7
  210. package/dist/src/lib/function-db-types.js.map +1 -1
  211. package/dist/src/lib/function-document-types.d.ts +5 -3
  212. package/dist/src/lib/function-document-types.js +10 -14
  213. package/dist/src/lib/function-document-types.js.map +1 -1
  214. package/dist/src/lib/function-lint.d.ts +34 -0
  215. package/dist/src/lib/function-lint.js +112 -0
  216. package/dist/src/lib/function-lint.js.map +1 -0
  217. package/dist/src/lib/function-log-row.js +21 -2
  218. package/dist/src/lib/function-log-row.js.map +1 -1
  219. package/dist/src/lib/function-run.d.ts +16 -21
  220. package/dist/src/lib/function-run.js +37 -30
  221. package/dist/src/lib/function-run.js.map +1 -1
  222. package/dist/src/lib/function-schema-codegen.d.ts +1 -1
  223. package/dist/src/lib/function-schema-codegen.js +5 -5
  224. package/dist/src/lib/function-schema-codegen.js.map +1 -1
  225. package/dist/src/lib/function-source-roots.d.ts +67 -0
  226. package/dist/src/lib/function-source-roots.js +148 -0
  227. package/dist/src/lib/function-source-roots.js.map +1 -0
  228. package/dist/src/lib/function-sync.d.ts +108 -22
  229. package/dist/src/lib/function-sync.js +127 -39
  230. package/dist/src/lib/function-sync.js.map +1 -1
  231. package/dist/src/lib/function-trigger-listing.d.ts +11 -6
  232. package/dist/src/lib/function-trigger-listing.js +32 -11
  233. package/dist/src/lib/function-trigger-listing.js.map +1 -1
  234. package/dist/src/lib/function-typecheck.d.ts +37 -2
  235. package/dist/src/lib/function-typecheck.js +210 -28
  236. package/dist/src/lib/function-typecheck.js.map +1 -1
  237. package/dist/src/lib/function-versions.d.ts +2 -0
  238. package/dist/src/lib/function-versions.js +1 -0
  239. package/dist/src/lib/function-versions.js.map +1 -1
  240. package/dist/src/lib/generated-allowlist.js +0 -20
  241. package/dist/src/lib/generated-allowlist.js.map +1 -1
  242. package/dist/src/lib/generated-config-surfaces.d.ts +703 -203
  243. package/dist/src/lib/generated-config-surfaces.js +2270 -2014
  244. package/dist/src/lib/generated-config-surfaces.js.map +1 -1
  245. package/dist/src/lib/generated-sdk-types.d.ts +1 -1
  246. package/dist/src/lib/generated-sdk-types.js +1 -1
  247. package/dist/src/lib/generated-sdk-types.js.map +1 -1
  248. package/dist/src/lib/init-adopt.js +12 -3
  249. package/dist/src/lib/init-adopt.js.map +1 -1
  250. package/dist/src/lib/init-login-note.d.ts +13 -0
  251. package/dist/src/lib/init-login-note.js +22 -0
  252. package/dist/src/lib/init-login-note.js.map +1 -0
  253. package/dist/src/lib/json-value.d.ts +6 -0
  254. package/dist/src/lib/json-value.js +13 -0
  255. package/dist/src/lib/json-value.js.map +1 -0
  256. package/dist/src/lib/load-routes.d.ts +33 -0
  257. package/dist/src/lib/load-routes.js +35 -0
  258. package/dist/src/lib/load-routes.js.map +1 -0
  259. package/dist/src/lib/local-state.d.ts +38 -7
  260. package/dist/src/lib/local-state.js +172 -49
  261. package/dist/src/lib/local-state.js.map +1 -1
  262. package/dist/src/lib/local-test-cases.d.ts +5 -2
  263. package/dist/src/lib/local-test-cases.js +7 -4
  264. package/dist/src/lib/local-test-cases.js.map +1 -1
  265. package/dist/src/lib/log-inspection.d.ts +42 -4
  266. package/dist/src/lib/log-inspection.js +37 -5
  267. package/dist/src/lib/log-inspection.js.map +1 -1
  268. package/dist/src/lib/login-exchange-check.d.ts +18 -0
  269. package/dist/src/lib/login-exchange-check.js +27 -0
  270. package/dist/src/lib/login-exchange-check.js.map +1 -0
  271. package/dist/src/lib/login-scope-lines.d.ts +25 -0
  272. package/dist/src/lib/login-scope-lines.js +45 -0
  273. package/dist/src/lib/login-scope-lines.js.map +1 -0
  274. package/dist/src/lib/logout-admin-session.d.ts +2 -1
  275. package/dist/src/lib/logout-admin-session.js +7 -1
  276. package/dist/src/lib/logout-admin-session.js.map +1 -1
  277. package/dist/src/lib/object-status-filter.d.ts +9 -1
  278. package/dist/src/lib/object-status-filter.js +9 -1
  279. package/dist/src/lib/object-status-filter.js.map +1 -1
  280. package/dist/src/lib/output.js +2 -0
  281. package/dist/src/lib/output.js.map +1 -1
  282. package/dist/src/lib/paginate.d.ts +0 -5
  283. package/dist/src/lib/paginate.js +0 -5
  284. package/dist/src/lib/paginate.js.map +1 -1
  285. package/dist/src/lib/pin-refusal-hint.d.ts +12 -0
  286. package/dist/src/lib/pin-refusal-hint.js +35 -0
  287. package/dist/src/lib/pin-refusal-hint.js.map +1 -0
  288. package/dist/src/lib/primitive-env-plugin.d.ts +99 -0
  289. package/dist/src/lib/primitive-env-plugin.js +408 -0
  290. package/dist/src/lib/primitive-env-plugin.js.map +1 -0
  291. package/dist/src/lib/project-config.d.ts +7 -0
  292. package/dist/src/lib/project-config.js +22 -1
  293. package/dist/src/lib/project-config.js.map +1 -1
  294. package/dist/src/lib/project-login-apps.d.ts +8 -0
  295. package/dist/src/lib/project-login-apps.js +27 -0
  296. package/dist/src/lib/project-login-apps.js.map +1 -0
  297. package/dist/src/lib/prompt-schema-codegen.d.ts +10 -3
  298. package/dist/src/lib/prompt-schema-codegen.js +52 -11
  299. package/dist/src/lib/prompt-schema-codegen.js.map +1 -1
  300. package/dist/src/lib/pull-write.d.ts +31 -0
  301. package/dist/src/lib/pull-write.js +49 -0
  302. package/dist/src/lib/pull-write.js.map +1 -0
  303. package/dist/src/lib/push-failure-report.d.ts +45 -0
  304. package/dist/src/lib/push-failure-report.js +57 -0
  305. package/dist/src/lib/push-failure-report.js.map +1 -0
  306. package/dist/src/lib/records-verbs.d.ts +69 -0
  307. package/dist/src/lib/records-verbs.js +40 -0
  308. package/dist/src/lib/records-verbs.js.map +1 -0
  309. package/dist/src/lib/refresh-admin-credentials.d.ts +7 -0
  310. package/dist/src/lib/refresh-admin-credentials.js +16 -4
  311. package/dist/src/lib/refresh-admin-credentials.js.map +1 -1
  312. package/dist/src/lib/root-import-decision.d.ts +65 -0
  313. package/dist/src/lib/root-import-decision.js +109 -0
  314. package/dist/src/lib/root-import-decision.js.map +1 -0
  315. package/dist/src/lib/run-status.d.ts +1 -1
  316. package/dist/src/lib/run-status.generated.d.ts +2 -2
  317. package/dist/src/lib/run-status.generated.js +3 -1
  318. package/dist/src/lib/run-status.generated.js.map +1 -1
  319. package/dist/src/lib/run-status.js +1 -1
  320. package/dist/src/lib/schema-codegen/generated-schema-descriptor.d.ts +129 -0
  321. package/dist/src/lib/schema-codegen/generated-schema-descriptor.js +269 -0
  322. package/dist/src/lib/schema-codegen/generated-schema-descriptor.js.map +1 -0
  323. package/dist/src/lib/schema-codegen/naming.d.ts +35 -0
  324. package/dist/src/lib/schema-codegen/naming.js +83 -0
  325. package/dist/src/lib/schema-codegen/naming.js.map +1 -0
  326. package/dist/src/lib/schema-codegen/schemaToTs.d.ts +82 -0
  327. package/dist/src/lib/schema-codegen/schemaToTs.js +305 -0
  328. package/dist/src/lib/schema-codegen/schemaToTs.js.map +1 -0
  329. package/dist/src/lib/scope-request.d.ts +84 -0
  330. package/dist/src/lib/scope-request.js +235 -0
  331. package/dist/src/lib/scope-request.js.map +1 -0
  332. package/dist/src/lib/session-id.d.ts +9 -0
  333. package/dist/src/lib/session-id.js +28 -0
  334. package/dist/src/lib/session-id.js.map +1 -0
  335. package/dist/src/lib/snapshot-build-rows.d.ts +21 -0
  336. package/dist/src/lib/snapshot-build-rows.js +22 -0
  337. package/dist/src/lib/snapshot-build-rows.js.map +1 -1
  338. package/dist/src/lib/snapshot-build.js +8 -3
  339. package/dist/src/lib/snapshot-build.js.map +1 -1
  340. package/dist/src/lib/snapshots.d.ts +17 -1
  341. package/dist/src/lib/snapshots.js +50 -2
  342. package/dist/src/lib/snapshots.js.map +1 -1
  343. package/dist/src/lib/swift-codegen/agentGenerator.d.ts +6 -2
  344. package/dist/src/lib/swift-codegen/agentGenerator.js +57 -5
  345. package/dist/src/lib/swift-codegen/agentGenerator.js.map +1 -1
  346. package/dist/src/lib/swift-codegen/banners.d.ts +34 -7
  347. package/dist/src/lib/swift-codegen/banners.js +37 -7
  348. package/dist/src/lib/swift-codegen/banners.js.map +1 -1
  349. package/dist/src/lib/swift-codegen/dbGenerator.d.ts +4 -3
  350. package/dist/src/lib/swift-codegen/dbGenerator.js +14 -117
  351. package/dist/src/lib/swift-codegen/dbGenerator.js.map +1 -1
  352. package/dist/src/lib/swift-codegen/functionGenerator.d.ts +3 -3
  353. package/dist/src/lib/swift-codegen/functionGenerator.js +23 -18
  354. package/dist/src/lib/swift-codegen/functionGenerator.js.map +1 -1
  355. package/dist/src/lib/swift-codegen/generator.d.ts +5 -5
  356. package/dist/src/lib/swift-codegen/generator.js +35 -40
  357. package/dist/src/lib/swift-codegen/generator.js.map +1 -1
  358. package/dist/src/lib/swift-codegen/schemaToSwift.d.ts +3 -3
  359. package/dist/src/lib/swift-codegen/schemaToSwift.js +4 -4
  360. package/dist/src/lib/swift-codegen/schemaToSwift.js.map +1 -1
  361. package/dist/src/lib/swift-codegen/swiftKeys.d.ts +19 -0
  362. package/dist/src/lib/swift-codegen/swiftKeys.js +31 -0
  363. package/dist/src/lib/swift-codegen/swiftKeys.js.map +1 -0
  364. package/dist/src/lib/sync-paths.d.ts +35 -0
  365. package/dist/src/lib/sync-paths.js +57 -5
  366. package/dist/src/lib/sync-paths.js.map +1 -1
  367. package/dist/src/lib/sync-resource-types.d.ts +26 -26
  368. package/dist/src/lib/sync-resource-types.js +61 -189
  369. package/dist/src/lib/sync-resource-types.js.map +1 -1
  370. package/dist/src/lib/sync-selectors.d.ts +5 -1
  371. package/dist/src/lib/sync-selectors.js +23 -13
  372. package/dist/src/lib/sync-selectors.js.map +1 -1
  373. package/dist/src/lib/test-case-file-names.d.ts +3 -5
  374. package/dist/src/lib/test-case-file-names.js +3 -5
  375. package/dist/src/lib/test-case-file-names.js.map +1 -1
  376. package/dist/src/lib/toml-database-config.d.ts +15 -75
  377. package/dist/src/lib/toml-database-config.js +17 -306
  378. package/dist/src/lib/toml-database-config.js.map +1 -1
  379. package/dist/src/lib/transient-retry.d.ts +43 -0
  380. package/dist/src/lib/transient-retry.js +94 -0
  381. package/dist/src/lib/transient-retry.js.map +1 -0
  382. package/dist/src/lib/vars-override.d.ts +105 -0
  383. package/dist/src/lib/vars-override.js +143 -0
  384. package/dist/src/lib/vars-override.js.map +1 -0
  385. package/dist/src/lib/webhook-capture.d.ts +43 -0
  386. package/dist/src/lib/webhook-capture.js +91 -0
  387. package/dist/src/lib/webhook-capture.js.map +1 -0
  388. package/dist/src/lib/webhook-deliver.d.ts +18 -20
  389. package/dist/src/lib/webhook-deliver.js +34 -89
  390. package/dist/src/lib/webhook-deliver.js.map +1 -1
  391. package/dist/src/lib/webhook-test-run.d.ts +32 -0
  392. package/dist/src/lib/webhook-test-run.js +108 -0
  393. package/dist/src/lib/webhook-test-run.js.map +1 -0
  394. package/dist/src/lib/workflow-codegen/generator.d.ts +7 -7
  395. package/dist/src/lib/workflow-codegen/generator.js +16 -23
  396. package/dist/src/lib/workflow-codegen/generator.js.map +1 -1
  397. package/dist/src/lib/workflow-codegen/invokerIR.d.ts +6 -12
  398. package/dist/src/lib/workflow-codegen/invokerIR.js +4 -5
  399. package/dist/src/lib/workflow-codegen/invokerIR.js.map +1 -1
  400. package/dist/src/lib/workflow-toml-validator.d.ts +2 -0
  401. package/dist/src/lib/workflow-toml-validator.js +28 -1
  402. package/dist/src/lib/workflow-toml-validator.js.map +1 -1
  403. package/dist/src/types/index.d.ts +30 -37
  404. package/dist/src/validators.d.ts +7 -55
  405. package/dist/src/validators.js +7 -53
  406. package/dist/src/validators.js.map +1 -1
  407. package/dist/src/vite.d.ts +17 -0
  408. package/dist/src/vite.js +18 -0
  409. package/dist/src/vite.js.map +1 -0
  410. package/package.json +20 -12
@@ -0,0 +1,142 @@
1
+ /**
2
+ * `primitive functions authorize` without the I/O — #4732, project
3
+ * `function-authorize` phase 3.
4
+ *
5
+ * The verb asks the admin endpoint `POST functions/{id}/authorize` to run a
6
+ * function's `authorize` alone, and reports what it decided: one check from
7
+ * flags, or every case in the function's case file. This module is the part
8
+ * a test can pin without a server: the `--trigger` and `--runtime` grammar,
9
+ * fixture aliases, the case file, the verdict on a case, and the rendering.
10
+ */
11
+ /** The door kinds `--trigger` names, as the server spells them. */
12
+ export declare const TRIGGER_FLAG_KINDS: readonly ["http", "webhook", "cron", "function", "manual", "tool", "context", "history", "db3"];
13
+ /** What the endpoint's `trigger` field is built from. */
14
+ export type CheckTrigger = {
15
+ kind: string;
16
+ functionKey?: string;
17
+ toolName?: string;
18
+ };
19
+ /**
20
+ * `--trigger` (and a case's `trigger`): a door kind, `function:<key>` for a
21
+ * nested start from the parent `<key>`, or `tool[:<name>]`. A bare `function`
22
+ * names no parent, so it is refused.
23
+ */
24
+ export declare function parseTriggerFlag(text: string): {
25
+ ok: true;
26
+ trigger: CheckTrigger;
27
+ } | {
28
+ ok: false;
29
+ error: string;
30
+ };
31
+ /** `--runtime` (and a case's `runtime`): the isolate `authorize` loads in. */
32
+ export declare function parseRuntimeFlag(text: string): {
33
+ ok: true;
34
+ runtime: "request" | "task";
35
+ } | {
36
+ ok: false;
37
+ error: string;
38
+ };
39
+ /** A resolved value, or the first alias the map lacks. */
40
+ export type AliasResolution = {
41
+ ok: true;
42
+ value: unknown;
43
+ } | {
44
+ ok: false;
45
+ alias: string;
46
+ path: string;
47
+ error: string;
48
+ };
49
+ /**
50
+ * Replace every string that is exactly `@<name>` with the fixture `<name>`,
51
+ * in objects and arrays at any depth. `@@…` is a literal `@…`; every other
52
+ * string, a lone `@` included, is kept as it is.
53
+ */
54
+ export declare function resolveAliases(value: unknown, fixtures: Record<string, unknown>, fixturesPath: string, path?: string): AliasResolution;
55
+ /** The codes a case may expect of a deny. */
56
+ export declare const CASE_DENY_CODES: readonly ["FORBIDDEN", "NOT_FOUND", "INVALID"];
57
+ /** One case of a case file, with its defaults filled in. */
58
+ export interface AuthorizeCase {
59
+ name: string;
60
+ /** An id, an `@alias`, or null. */
61
+ user: string | null;
62
+ role: string | null;
63
+ /** In the `--trigger` grammar. */
64
+ trigger: string;
65
+ /** Null leaves the endpoint's per-kind default. */
66
+ runtime: "request" | "task" | null;
67
+ input: unknown;
68
+ expect: "allow" | "deny";
69
+ code: (typeof CASE_DENY_CODES)[number] | null;
70
+ }
71
+ /**
72
+ * A case file: a JSON array of `{ name, user?, role?, trigger?, runtime?,
73
+ * input?, expect, code? }`. Any mistake refuses the whole file, naming the
74
+ * file, the case and the key, so nothing runs against half a file.
75
+ */
76
+ export declare function parseAuthorizeCaseFile(text: string, path: string): {
77
+ ok: true;
78
+ cases: AuthorizeCase[];
79
+ } | {
80
+ ok: false;
81
+ error: string;
82
+ };
83
+ /** The endpoint's body for one check; `runtime` only when one was named. */
84
+ export declare function checkRequestBody(fields: {
85
+ user: string | null;
86
+ role: string | null;
87
+ trigger: CheckTrigger;
88
+ runtime: "request" | "task" | null;
89
+ input: unknown;
90
+ }): Record<string, unknown>;
91
+ /** The endpoint's answer, or why no request was made. */
92
+ export type CheckOutcome = {
93
+ httpStatus: number;
94
+ body: any;
95
+ } | {
96
+ error: string;
97
+ };
98
+ /** One case's row, for the table and `--json`. */
99
+ export interface CaseRow {
100
+ functionKey: string;
101
+ name: string;
102
+ /** `allow` or `deny`; `-` on the row of a case file that could not be read. */
103
+ expect: string;
104
+ decision: string | null;
105
+ cause: string | null;
106
+ code: string | null;
107
+ reason: string | null;
108
+ ms: number | null;
109
+ reads: number | null;
110
+ pass: boolean;
111
+ error?: string;
112
+ }
113
+ /**
114
+ * A case's verdict. It passes when the decision is the one expected and,
115
+ * when the case names a code, the code is that code; an `authorize-error` is
116
+ * a deny with no code. A case that could not be decided — no request made, a
117
+ * refusal, a version with no `authorize` — fails, saying why.
118
+ */
119
+ export declare function judgeCase(functionKey: string, testCase: {
120
+ name: string;
121
+ expect: string;
122
+ code: string | null;
123
+ }, outcome: CheckOutcome): CaseRow;
124
+ /** The single check's one line. */
125
+ export declare function renderCheckLine(body: any): string;
126
+ /** 0 allow, 1 deny (an `authorize-error` included), 2 when no check was made. */
127
+ export declare function exitCodeForCheck(outcome: {
128
+ httpStatus: number;
129
+ body: any;
130
+ }): 0 | 1 | 2;
131
+ /** The case table: `CASE EXPECT GOT CODE MS READS RESULT`, FUNCTION first for `--all`. */
132
+ export declare function renderCaseTable(rows: CaseRow[], options: {
133
+ withFunction: boolean;
134
+ }): string;
135
+ /** `N passed, M failed`. */
136
+ export declare function caseSummary(rows: CaseRow[]): {
137
+ passed: number;
138
+ failed: number;
139
+ line: string;
140
+ };
141
+ /** The keys with a case file in a tree's `functions/` directory, sorted. */
142
+ export declare function caseFilesInTree(functionsDir: string): string[];
@@ -0,0 +1,310 @@
1
+ /**
2
+ * `primitive functions authorize` without the I/O — #4732, project
3
+ * `function-authorize` phase 3.
4
+ *
5
+ * The verb asks the admin endpoint `POST functions/{id}/authorize` to run a
6
+ * function's `authorize` alone, and reports what it decided: one check from
7
+ * flags, or every case in the function's case file. This module is the part
8
+ * a test can pin without a server: the `--trigger` and `--runtime` grammar,
9
+ * fixture aliases, the case file, the verdict on a case, and the rendering.
10
+ */
11
+ import { existsSync, readdirSync } from "fs";
12
+ import { AUTH_CASE_FILE_SUFFIX } from "./auth-fixtures.js";
13
+ /** The door kinds `--trigger` names, as the server spells them. */
14
+ export const TRIGGER_FLAG_KINDS = [
15
+ "http",
16
+ "webhook",
17
+ "cron",
18
+ "function",
19
+ "manual",
20
+ "tool",
21
+ "context",
22
+ "history",
23
+ "db3",
24
+ ];
25
+ const TRIGGER_GRAMMAR = "http, webhook, cron, manual, context, history, db3, function:<key>, tool or tool:<name>";
26
+ /**
27
+ * `--trigger` (and a case's `trigger`): a door kind, `function:<key>` for a
28
+ * nested start from the parent `<key>`, or `tool[:<name>]`. A bare `function`
29
+ * names no parent, so it is refused.
30
+ */
31
+ export function parseTriggerFlag(text) {
32
+ const refuse = (why) => ({ ok: false, error: `trigger '${text}' ${why}; use ${TRIGGER_GRAMMAR}` });
33
+ const colon = text.indexOf(":");
34
+ const kind = colon === -1 ? text : text.slice(0, colon);
35
+ const param = colon === -1 ? null : text.slice(colon + 1);
36
+ if (!TRIGGER_FLAG_KINDS.includes(kind))
37
+ return refuse("is not a door");
38
+ if (kind === "function") {
39
+ if (!param)
40
+ return refuse("needs the parent function's key, function:<key>");
41
+ return { ok: true, trigger: { kind, functionKey: param } };
42
+ }
43
+ if (kind === "tool" && param !== null) {
44
+ if (!param)
45
+ return refuse("needs a tool name after the colon");
46
+ return { ok: true, trigger: { kind, toolName: param } };
47
+ }
48
+ if (param !== null)
49
+ return refuse("takes no parameter");
50
+ return { ok: true, trigger: { kind } };
51
+ }
52
+ /** `--runtime` (and a case's `runtime`): the isolate `authorize` loads in. */
53
+ export function parseRuntimeFlag(text) {
54
+ if (text === "request" || text === "task")
55
+ return { ok: true, runtime: text };
56
+ return { ok: false, error: `runtime '${text}' must be request or task` };
57
+ }
58
+ /**
59
+ * Replace every string that is exactly `@<name>` with the fixture `<name>`,
60
+ * in objects and arrays at any depth. `@@…` is a literal `@…`; every other
61
+ * string, a lone `@` included, is kept as it is.
62
+ */
63
+ export function resolveAliases(value, fixtures, fixturesPath, path = "$") {
64
+ if (typeof value === "string") {
65
+ if (value.startsWith("@@"))
66
+ return { ok: true, value: value.slice(1) };
67
+ if (value.startsWith("@") && value.length > 1) {
68
+ const alias = value.slice(1);
69
+ if (!Object.prototype.hasOwnProperty.call(fixtures, alias)) {
70
+ return {
71
+ ok: false,
72
+ alias,
73
+ path,
74
+ error: `unknown fixture alias @${alias} at ${path}: ${fixturesPath} has no "${alias}"`,
75
+ };
76
+ }
77
+ return { ok: true, value: fixtures[alias] };
78
+ }
79
+ return { ok: true, value };
80
+ }
81
+ if (Array.isArray(value)) {
82
+ const out = [];
83
+ for (let i = 0; i < value.length; i++) {
84
+ const item = resolveAliases(value[i], fixtures, fixturesPath, `${path}[${i}]`);
85
+ if (item.ok === false)
86
+ return item;
87
+ out.push(item.value);
88
+ }
89
+ return { ok: true, value: out };
90
+ }
91
+ if (value !== null && typeof value === "object") {
92
+ // Entries, not `out[key] =`: an own `__proto__` key JSON.parse made is
93
+ // data the author wrote, and an assignment would hit the prototype setter.
94
+ const entries = [];
95
+ for (const [key, child] of Object.entries(value)) {
96
+ const item = resolveAliases(child, fixtures, fixturesPath, `${path}.${key}`);
97
+ if (item.ok === false)
98
+ return item;
99
+ entries.push([key, item.value]);
100
+ }
101
+ return { ok: true, value: Object.fromEntries(entries) };
102
+ }
103
+ return { ok: true, value };
104
+ }
105
+ /** The codes a case may expect of a deny. */
106
+ export const CASE_DENY_CODES = ["FORBIDDEN", "NOT_FOUND", "INVALID"];
107
+ const CASE_KEYS = ["name", "user", "role", "trigger", "runtime", "input", "expect", "code"];
108
+ /**
109
+ * A case file: a JSON array of `{ name, user?, role?, trigger?, runtime?,
110
+ * input?, expect, code? }`. Any mistake refuses the whole file, naming the
111
+ * file, the case and the key, so nothing runs against half a file.
112
+ */
113
+ export function parseAuthorizeCaseFile(text, path) {
114
+ let parsed;
115
+ try {
116
+ parsed = JSON.parse(text);
117
+ }
118
+ catch (err) {
119
+ return { ok: false, error: `${path} is not valid JSON: ${err?.message || String(err)}` };
120
+ }
121
+ if (!Array.isArray(parsed)) {
122
+ return { ok: false, error: `${path} must be a JSON array of cases` };
123
+ }
124
+ const cases = [];
125
+ const names = new Set();
126
+ for (let i = 0; i < parsed.length; i++) {
127
+ const raw = parsed[i];
128
+ const refuse = (label, why) => ({ ok: false, error: `${path}: ${label}: ${why}` });
129
+ if (raw === null || typeof raw !== "object" || Array.isArray(raw)) {
130
+ return refuse(`case ${i + 1}`, "must be an object");
131
+ }
132
+ const entry = raw;
133
+ if (typeof entry.name !== "string" || !entry.name) {
134
+ return refuse(`case ${i + 1}`, `"name" is required and must be a non-empty string`);
135
+ }
136
+ const label = `case "${entry.name}"`;
137
+ if (names.has(entry.name))
138
+ return refuse(label, `duplicate name "${entry.name}"`);
139
+ names.add(entry.name);
140
+ const unknown = Object.keys(entry).find((key) => !CASE_KEYS.includes(key));
141
+ if (unknown)
142
+ return refuse(label, `unknown key "${unknown}"; a case takes ${CASE_KEYS.join(", ")}`);
143
+ const user = entry.user ?? null;
144
+ if (user !== null && typeof user !== "string")
145
+ return refuse(label, `"user" must be a user id, an @alias or null`);
146
+ const role = entry.role ?? null;
147
+ if (role !== null && (typeof role !== "string" || !role))
148
+ return refuse(label, `"role" must be a non-empty string`);
149
+ const trigger = entry.trigger ?? "http";
150
+ if (typeof trigger !== "string")
151
+ return refuse(label, `"trigger" must be a string`);
152
+ const parsedTrigger = parseTriggerFlag(trigger);
153
+ if (parsedTrigger.ok === false)
154
+ return refuse(label, `"trigger": ${parsedTrigger.error}`);
155
+ let runtime = null;
156
+ if (entry.runtime !== undefined && entry.runtime !== null) {
157
+ const parsedRuntime = parseRuntimeFlag(String(entry.runtime));
158
+ if (!parsedRuntime.ok || typeof entry.runtime !== "string") {
159
+ return refuse(label, `"runtime" must be "request" or "task"`);
160
+ }
161
+ runtime = parsedRuntime.runtime;
162
+ }
163
+ if (entry.expect !== "allow" && entry.expect !== "deny") {
164
+ return refuse(label, `"expect" is required and must be "allow" or "deny"`);
165
+ }
166
+ let code = null;
167
+ if (entry.code !== undefined && entry.code !== null) {
168
+ if (entry.expect !== "deny")
169
+ return refuse(label, `"code" applies only to "expect": "deny"`);
170
+ if (!CASE_DENY_CODES.includes(entry.code)) {
171
+ return refuse(label, `"code" must be one of ${CASE_DENY_CODES.join(", ")}`);
172
+ }
173
+ code = entry.code;
174
+ }
175
+ cases.push({
176
+ name: entry.name,
177
+ user: user,
178
+ role: role,
179
+ trigger,
180
+ runtime,
181
+ input: entry.input === undefined ? {} : entry.input,
182
+ expect: entry.expect,
183
+ code,
184
+ });
185
+ }
186
+ return { ok: true, cases };
187
+ }
188
+ /** The endpoint's body for one check; `runtime` only when one was named. */
189
+ export function checkRequestBody(fields) {
190
+ return {
191
+ user: fields.user,
192
+ ...(fields.role ? { role: fields.role } : {}),
193
+ trigger: fields.trigger,
194
+ ...(fields.runtime ? { runtime: fields.runtime } : {}),
195
+ input: fields.input,
196
+ };
197
+ }
198
+ /** A refusal's one-line reason, from the admin API's envelope. */
199
+ function refusalText(outcome) {
200
+ const body = outcome.body ?? {};
201
+ const code = body.code ?? body.errorCode;
202
+ const reason = body.reason ? ` (${body.reason})` : "";
203
+ return `${outcome.httpStatus}${code ? ` ${code}` : ""}: ${body.error ?? "request refused"}${reason}`;
204
+ }
205
+ /**
206
+ * A case's verdict. It passes when the decision is the one expected and,
207
+ * when the case names a code, the code is that code; an `authorize-error` is
208
+ * a deny with no code. A case that could not be decided — no request made, a
209
+ * refusal, a version with no `authorize` — fails, saying why.
210
+ */
211
+ export function judgeCase(functionKey, testCase, outcome) {
212
+ const row = {
213
+ functionKey,
214
+ name: testCase.name,
215
+ expect: testCase.expect,
216
+ decision: null,
217
+ cause: null,
218
+ code: null,
219
+ reason: null,
220
+ ms: null,
221
+ reads: null,
222
+ pass: false,
223
+ };
224
+ if ("error" in outcome)
225
+ return { ...row, error: outcome.error };
226
+ if (outcome.httpStatus >= 400)
227
+ return { ...row, error: refusalText(outcome) };
228
+ const body = outcome.body ?? {};
229
+ if (body.decision === "legacy") {
230
+ return { ...row, decision: "legacy", error: "legacy (this version has no authorize)" };
231
+ }
232
+ const decided = {
233
+ ...row,
234
+ decision: typeof body.decision === "string" ? body.decision : null,
235
+ cause: body.cause ?? null,
236
+ code: body.code ?? null,
237
+ reason: body.reason ?? null,
238
+ ms: typeof body.ms === "number" ? body.ms : null,
239
+ reads: typeof body.reads === "number" ? body.reads : null,
240
+ };
241
+ decided.pass =
242
+ decided.decision === testCase.expect && (testCase.code === null || decided.code === testCase.code);
243
+ return decided;
244
+ }
245
+ /** The single check's one line. */
246
+ export function renderCheckLine(body) {
247
+ if (body?.decision === "legacy")
248
+ return "legacy (this version has no authorize)";
249
+ const figures = `${body?.ms ?? "-"} ms ${body?.reads ?? "-"} reads`;
250
+ if (body?.decision === "allow")
251
+ return `allow ${figures}`;
252
+ if (body?.cause === "authorize-error")
253
+ return `deny authorize-error ${body.reason} ${figures}`;
254
+ const message = typeof body?.message === "string" ? ` ${JSON.stringify(body.message)}` : "";
255
+ return `deny ${body?.code ?? "-"}${message} ${figures}`;
256
+ }
257
+ /** 0 allow, 1 deny (an `authorize-error` included), 2 when no check was made. */
258
+ export function exitCodeForCheck(outcome) {
259
+ if (outcome.httpStatus >= 400)
260
+ return 2;
261
+ if (outcome.body?.decision === "allow")
262
+ return 0;
263
+ if (outcome.body?.decision === "deny")
264
+ return 1;
265
+ return 2;
266
+ }
267
+ function resultCell(row) {
268
+ if (row.pass)
269
+ return "pass";
270
+ if (row.error)
271
+ return `fail: ${row.error}`;
272
+ if (row.cause === "authorize-error")
273
+ return `fail: authorize-error ${row.reason}`;
274
+ return "fail";
275
+ }
276
+ /** The case table: `CASE EXPECT GOT CODE MS READS RESULT`, FUNCTION first for `--all`. */
277
+ export function renderCaseTable(rows, options) {
278
+ const header = [...(options.withFunction ? ["FUNCTION"] : []), "CASE", "EXPECT", "GOT", "CODE", "MS", "READS", "RESULT"];
279
+ const lines = rows.map((row) => [
280
+ ...(options.withFunction ? [row.functionKey] : []),
281
+ row.name,
282
+ row.expect,
283
+ row.decision ?? "-",
284
+ row.code ?? "-",
285
+ row.ms === null ? "-" : String(row.ms),
286
+ row.reads === null ? "-" : String(row.reads),
287
+ resultCell(row),
288
+ ]);
289
+ const widths = header.map((h, i) => Math.max(h.length, ...lines.map((cells) => cells[i].length)));
290
+ const render = (cells) => cells
291
+ .map((cell, i) => (i === cells.length - 1 ? cell : cell.padEnd(widths[i])))
292
+ .join(" ");
293
+ return [render(header), ...lines.map(render)].join("\n");
294
+ }
295
+ /** `N passed, M failed`. */
296
+ export function caseSummary(rows) {
297
+ const passed = rows.filter((row) => row.pass).length;
298
+ const failed = rows.length - passed;
299
+ return { passed, failed, line: `${passed} passed, ${failed} failed` };
300
+ }
301
+ /** The keys with a case file in a tree's `functions/` directory, sorted. */
302
+ export function caseFilesInTree(functionsDir) {
303
+ if (!existsSync(functionsDir))
304
+ return [];
305
+ return readdirSync(functionsDir)
306
+ .filter((file) => file.endsWith(AUTH_CASE_FILE_SUFFIX) && file.length > AUTH_CASE_FILE_SUFFIX.length)
307
+ .map((file) => file.slice(0, -AUTH_CASE_FILE_SUFFIX.length))
308
+ .sort();
309
+ }
310
+ //# sourceMappingURL=function-authorize-check.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"function-authorize-check.js","sourceRoot":"","sources":["../../../src/lib/function-authorize-check.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,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MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SAC1E,IAAI,CAAC,IAAI,CAAC,CAAC;IAChB,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC3D,CAAC;AAED,4BAA4B;AAC5B,MAAM,UAAU,WAAW,CAAC,IAAe;IACzC,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC;IACrD,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACpC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,YAAY,MAAM,SAAS,EAAE,CAAC;AACxE,CAAC;AAED,4EAA4E;AAC5E,MAAM,UAAU,eAAe,CAAC,YAAoB;IAClD,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC;QAAE,OAAO,EAAE,CAAC;IACzC,OAAO,WAAW,CAAC,YAAY,CAAC;SAC7B,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,qBAAqB,CAAC,IAAI,IAAI,CAAC,MAAM,GAAG,qBAAqB,CAAC,MAAM,CAAC;SACpG,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC;SAC3D,IAAI,EAAE,CAAC;AACZ,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * The Authorize section `primitive functions get` prints (#4730, project
3
+ * `function-authorize` phase 3) — from the active version's manifest, which a
4
+ * flagged build pushes as version 3 with an `authorize` block.
5
+ *
6
+ * The block is what the push collected from the tree, so it documents what
7
+ * the author wrote; the version's `authorize` flag, printed above it, is the
8
+ * server's own answer.
9
+ */
10
+ /**
11
+ * The section's label/value pairs: the block of a version-3 manifest, one
12
+ * `no detail recorded` line for a flagged version whose manifest carries none
13
+ * (pushed by an older CLI), and null for a legacy version.
14
+ */
15
+ export declare function authorizeSection(manifest: any, flagged: boolean): Array<[string, string]> | null;
@@ -0,0 +1,50 @@
1
+ /**
2
+ * The Authorize section `primitive functions get` prints (#4730, project
3
+ * `function-authorize` phase 3) — from the active version's manifest, which a
4
+ * flagged build pushes as version 3 with an `authorize` block.
5
+ *
6
+ * The block is what the push collected from the tree, so it documents what
7
+ * the author wrote; the version's `authorize` flag, printed above it, is the
8
+ * server's own answer.
9
+ */
10
+ /** One `allowCallers` block's doors, in the order the helper takes them. */
11
+ function doorsOf(callers) {
12
+ if (!callers || typeof callers !== "object")
13
+ return "-";
14
+ const doors = [];
15
+ for (const door of ["webhook", "cron", "manual", "db3"]) {
16
+ if (callers[door] === true)
17
+ doors.push(door);
18
+ }
19
+ const functions = Array.isArray(callers.functions) ? callers.functions : [];
20
+ if (functions.length > 0)
21
+ doors.push(`functions: ${functions.join(", ")}`);
22
+ if (callers.agents === true)
23
+ doors.push("agents");
24
+ else if (callers.agents === "rule")
25
+ doors.push("agents: rule");
26
+ if (callers.users === "rule")
27
+ doors.push("users: rule");
28
+ return doors.length > 0 ? doors.join(", ") : "none";
29
+ }
30
+ const listOf = (value) => Array.isArray(value) && value.length > 0 ? value.join(", ") : "none";
31
+ /**
32
+ * The section's label/value pairs: the block of a version-3 manifest, one
33
+ * `no detail recorded` line for a flagged version whose manifest carries none
34
+ * (pushed by an older CLI), and null for a legacy version.
35
+ */
36
+ export function authorizeSection(manifest, flagged) {
37
+ const block = manifest && typeof manifest === "object" ? manifest.authorize : null;
38
+ if (!block || typeof block !== "object") {
39
+ return flagged ? [["Authorize", "no detail recorded"]] : null;
40
+ }
41
+ return [
42
+ ["Present", block.present === true ? "yes" : "no"],
43
+ ["Public", block.public === true ? "yes" : "no"],
44
+ ["Helper", typeof block.helper === "string" ? block.helper : "none (hand-written)"],
45
+ ["Doors", doorsOf(block.callers)],
46
+ ["Auth families", listOf(block.families)],
47
+ ["Write families", listOf(manifest.writeFamilies)],
48
+ ];
49
+ }
50
+ //# sourceMappingURL=function-authorize-view.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"function-authorize-view.js","sourceRoot":"","sources":["../../../src/lib/function-authorize-view.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,4EAA4E;AAC5E,SAAS,OAAO,CAAC,OAAY;IAC3B,IAAI,CAAC,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ;QAAE,OAAO,GAAG,CAAC;IACxD,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,KAAK,MAAM,IAAI,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC;QACxD,IAAI,OAAO,CAAC,IAAI,CAAC,KAAK,IAAI;YAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC/C,CAAC;IACD,MAAM,SAAS,GAAa,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;IACtF,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC;QAAE,KAAK,CAAC,IAAI,CAAC,cAAc,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC3E,IAAI,OAAO,CAAC,MAAM,KAAK,IAAI;QAAE,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;SAC7C,IAAI,OAAO,CAAC,MAAM,KAAK,MAAM;QAAE,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IAC/D,IAAI,OAAO,CAAC,KAAK,KAAK,MAAM;Q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,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QACzC,CAAC,gBAAgB,EAAE,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;KACnD,CAAC;AACJ,CAAC"}
@@ -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
@@ -104,6 +111,13 @@ export interface BuiltFunctionBundle {
104
111
  contentHash: string;
105
112
  /** Every authored file the build read, sorted by path. */
106
113
  sources: FunctionSourceFile[];
114
+ /**
115
+ * The shared sources the bundle inlined from declared `functionSources`
116
+ * directories: POSIX paths relative to the real tree root
117
+ * (`../../web/src/engine/x.ts`), sorted. Never stored or sent — the push
118
+ * hands them to the typechecker.
119
+ */
120
+ projectSources: string[];
107
121
  }
108
122
  export interface EnvelopeShape {
109
123
  schemaVersion: number;
@@ -144,4 +158,10 @@ export declare function buildFunctionBundle(options: {
144
158
  entry: string;
145
159
  /** Only for the message; the key is not part of the build. */
146
160
  functionKey: string;
161
+ /**
162
+ * The declared `functionSources` directories, as absolute paths. Defaults
163
+ * to what the selected project config declares; the push loop resolves them
164
+ * once and passes them, so their warnings are printed once.
165
+ */
166
+ sourceRoots?: readonly string[];
147
167
  }): Promise<BuiltFunctionBundle>;