@prestack/thread 0.1.3 → 0.1.5

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 (270) hide show
  1. package/CHANGELOG.md +563 -0
  2. package/dist/core/actor.d.ts +1 -1
  3. package/dist/core/actor.js +5 -4
  4. package/dist/core/actor.ts +5 -4
  5. package/dist/core/attach.d.ts +0 -7
  6. package/dist/core/attach.js +38 -67
  7. package/dist/core/attach.ts +34 -80
  8. package/dist/core/chain.js +13 -17
  9. package/dist/core/chain.ts +11 -15
  10. package/dist/core/condition.d.ts +4 -4
  11. package/dist/core/condition.js +2 -2
  12. package/dist/core/descend.d.ts +4 -2
  13. package/dist/core/descend.js +91 -23
  14. package/dist/core/descend.ts +90 -21
  15. package/dist/core/errors/catalogue.d.ts +52 -0
  16. package/dist/{operations/errors/errors.js → core/errors/catalogue.js} +1 -1
  17. package/dist/{operations/errors/errors.ts → core/errors/catalogue.ts} +1 -1
  18. package/dist/{operations/errors/catalog.d.ts → core/errors/error.d.ts} +2 -3
  19. package/dist/{operations/errors/catalog.js → core/errors/error.js} +1 -16
  20. package/dist/{operations/errors/catalog.ts → core/errors/error.ts} +3 -19
  21. package/dist/core/errors/namespaces.d.ts +3 -0
  22. package/dist/core/errors/namespaces.js +15 -0
  23. package/dist/core/errors/namespaces.ts +19 -0
  24. package/dist/core/finding.js +2 -2
  25. package/dist/core/finding.ts +1 -2
  26. package/dist/core/init.d.ts +1 -1
  27. package/dist/core/init.js +51 -5
  28. package/dist/core/init.ts +58 -5
  29. package/dist/core/invoked.d.ts +1 -1
  30. package/dist/core/invoked.js +3 -1
  31. package/dist/core/invoked.ts +5 -2
  32. package/dist/core/round.js +36 -22
  33. package/dist/core/round.ts +26 -9
  34. package/dist/core/rows.d.ts +4 -0
  35. package/dist/core/rows.js +31 -2
  36. package/dist/core/rows.ts +33 -1
  37. package/dist/core/scope.d.ts +1 -0
  38. package/dist/core/scope.js +1 -0
  39. package/dist/core/scope.ts +2 -0
  40. package/dist/core/thread.d.ts +3 -3
  41. package/dist/core/tree.d.ts +4 -1
  42. package/dist/core/tree.js +26 -6
  43. package/dist/core/tree.ts +29 -6
  44. package/dist/core/types.d.ts +3 -3
  45. package/dist/core/types.js +3 -1
  46. package/dist/core/types.ts +2 -1
  47. package/dist/derivation/attach.js +3 -2
  48. package/dist/derivation/attach.ts +2 -1
  49. package/dist/derivation/generators/build.js +6 -6
  50. package/dist/derivation/generators/build.ts +1 -1
  51. package/dist/derivation/generators/check.js +1 -1
  52. package/dist/derivation/generators/determinism.js +1 -1
  53. package/dist/derivation/generators/release.js +60 -47
  54. package/dist/derivation/generators/release.ts +66 -43
  55. package/dist/derivation/release.d.ts +7 -3
  56. package/dist/derivation/release.js +14 -1
  57. package/dist/derivation/release.ts +22 -2
  58. package/dist/integrations/attach.d.ts +4 -0
  59. package/dist/integrations/attach.js +37 -56
  60. package/dist/integrations/attach.ts +54 -60
  61. package/dist/integrations/cli.d.ts +37 -0
  62. package/dist/integrations/cli.js +440 -0
  63. package/dist/integrations/cli.ts +543 -0
  64. package/dist/{core/files.d.ts → integrations/disk.d.ts} +16 -24
  65. package/dist/integrations/disk.js +435 -0
  66. package/dist/integrations/disk.ts +465 -0
  67. package/dist/integrations/generators/read.js +6 -6
  68. package/dist/integrations/generators/read.ts +4 -4
  69. package/dist/integrations/generators/vault.js +10 -11
  70. package/dist/integrations/generators/vault.ts +4 -5
  71. package/dist/{operations/http.d.ts → integrations/https.d.ts} +10 -6
  72. package/dist/integrations/https.js +170 -0
  73. package/dist/integrations/https.ts +216 -0
  74. package/dist/integrations/pglite.d.ts +26 -0
  75. package/dist/integrations/pglite.js +143 -0
  76. package/dist/integrations/pglite.ts +206 -0
  77. package/dist/integrations/secret.d.ts +8 -2
  78. package/dist/integrations/secret.js +3 -5
  79. package/dist/integrations/secret.ts +10 -6
  80. package/dist/integrations/target.d.ts +155 -14
  81. package/dist/integrations/target.js +171 -50
  82. package/dist/integrations/target.ts +377 -61
  83. package/dist/integrations/vault.d.ts +1 -0
  84. package/dist/integrations/vault.js +20 -5
  85. package/dist/integrations/vault.ts +17 -5
  86. package/dist/integrity/attach.js +8 -77
  87. package/dist/integrity/attach.ts +7 -76
  88. package/dist/integrity/check-threads.js +5 -5
  89. package/dist/integrity/check-threads.ts +2 -2
  90. package/dist/integrity/constraint.d.ts +0 -1
  91. package/dist/integrity/constraint.js +267 -366
  92. package/dist/integrity/constraint.ts +267 -375
  93. package/dist/integrity/generators/compiler.js +14 -17
  94. package/dist/integrity/generators/compiler.ts +10 -15
  95. package/dist/integrity/generators/gate.js +15 -15
  96. package/dist/integrity/generators/gate.ts +10 -10
  97. package/dist/integrity/generators/issues.js +7 -7
  98. package/dist/integrity/generators/publish.js +39 -57
  99. package/dist/integrity/generators/publish.ts +44 -55
  100. package/dist/integrity/generators/trial.d.ts +3 -3
  101. package/dist/integrity/generators/trial.js +133 -165
  102. package/dist/integrity/generators/trial.ts +145 -169
  103. package/dist/integrity/lint.js +9 -13
  104. package/dist/integrity/lint.ts +7 -10
  105. package/dist/integrity/lsp/bin.js +5 -4
  106. package/dist/integrity/lsp/bin.ts +3 -1
  107. package/dist/integrity/lsp/diagnostics.js +3 -3
  108. package/dist/integrity/lsp/diagnostics.ts +1 -1
  109. package/dist/integrity/lsp/lint.js +19 -30
  110. package/dist/integrity/lsp/lint.ts +16 -32
  111. package/dist/integrity/lsp/server.js +3 -3
  112. package/dist/integrity/slopnator.d.ts +3 -13
  113. package/dist/integrity/slopnator.js +59 -38
  114. package/dist/integrity/slopnator.ts +54 -38
  115. package/dist/integrity/slopnators/sl_broken_lineage.js +2 -2
  116. package/dist/integrity/slopnators/sl_declared_elsewhere.js +1 -1
  117. package/dist/integrity/slopnators/sl_derived_drift.js +4 -4
  118. package/dist/integrity/slopnators/sl_derived_drift.ts +1 -1
  119. package/dist/integrity/slopnators/sl_door_in_a_node.js +220 -0
  120. package/dist/integrity/slopnators/sl_door_in_a_node.ts +250 -0
  121. package/dist/integrity/slopnators/sl_inert_island.js +10 -8
  122. package/dist/integrity/slopnators/sl_inert_island.ts +8 -6
  123. package/dist/integrity/slopnators/sl_missing_row.js +6 -51
  124. package/dist/integrity/slopnators/sl_missing_row.ts +4 -50
  125. package/dist/integrity/slopnators/sl_no_barrel.js +1 -1
  126. package/dist/integrity/slopnators/sl_no_child_process.js +36 -18
  127. package/dist/integrity/slopnators/sl_no_child_process.ts +44 -18
  128. package/dist/integrity/slopnators/sl_no_dispatch_bypass.js +80 -149
  129. package/dist/integrity/slopnators/sl_no_dispatch_bypass.ts +95 -147
  130. package/dist/integrity/slopnators/sl_no_import_cycle.js +15 -4
  131. package/dist/integrity/slopnators/sl_no_import_cycle.ts +20 -4
  132. package/dist/integrity/slopnators/sl_no_such_command.js +2 -2
  133. package/dist/integrity/slopnators/sl_no_such_command.ts +1 -1
  134. package/dist/integrity/slopnators/sl_outside_an_operation.js +20 -0
  135. package/dist/integrity/slopnators/sl_outside_an_operation.ts +25 -0
  136. package/dist/integrity/slopnators/sl_screen_holds_only_declared.d.ts +2 -0
  137. package/dist/integrity/slopnators/sl_screen_holds_only_declared.js +61 -0
  138. package/dist/integrity/slopnators/sl_screen_holds_only_declared.ts +70 -0
  139. package/dist/integrity/slopnators/sl_secret_literal.js +1 -33
  140. package/dist/integrity/slopnators/sl_secret_literal.ts +1 -33
  141. package/dist/integrity/slopnators/sl_stale_path.js +5 -22
  142. package/dist/integrity/slopnators/sl_stale_path.ts +4 -20
  143. package/dist/integrity/slopnators/sl_twice_meant.js +1 -1
  144. package/dist/integrity/slopnators/sl_twice_parented.js +29 -5
  145. package/dist/integrity/slopnators/sl_twice_parented.ts +28 -4
  146. package/dist/integrity/slopnators/sl_undeclared_crossing.d.ts +4 -1
  147. package/dist/integrity/slopnators/sl_undeclared_crossing.js +426 -62
  148. package/dist/integrity/slopnators/sl_undeclared_crossing.ts +454 -70
  149. package/dist/integrity/slopnators/sl_undeclared_destination.js +59 -25
  150. package/dist/integrity/slopnators/sl_undeclared_destination.ts +69 -21
  151. package/dist/integrity/slopnators/sl_undeclared_list.d.ts +2 -0
  152. package/dist/integrity/slopnators/sl_undeclared_list.js +363 -0
  153. package/dist/integrity/slopnators/sl_undeclared_list.ts +358 -0
  154. package/dist/integrity/slopnators/sl_undeclared_node.js +1 -11
  155. package/dist/integrity/slopnators/sl_undeclared_node.ts +0 -10
  156. package/dist/integrity/slopnators/sl_undeclared_operation.js +111 -29
  157. package/dist/integrity/slopnators/sl_undeclared_operation.ts +134 -26
  158. package/dist/integrity/slopnators/sl_undeclared_variant.js +2 -2
  159. package/dist/integrity/slopnators/sl_undeclared_webhook.d.ts +2 -0
  160. package/dist/integrity/slopnators/sl_undeclared_webhook.js +90 -0
  161. package/dist/integrity/slopnators/sl_undeclared_webhook.ts +108 -0
  162. package/dist/integrity/slopnators/sl_underived_route.d.ts +2 -0
  163. package/dist/integrity/slopnators/sl_underived_route.js +61 -0
  164. package/dist/integrity/slopnators/sl_underived_route.ts +72 -0
  165. package/dist/integrity/slopnators/sl_ungoverned_island.js +3 -3
  166. package/dist/integrity/slopnators/sl_ungoverned_island.ts +1 -1
  167. package/dist/integrity/slopnators/sl_unlisted_program.d.ts +2 -0
  168. package/dist/integrity/slopnators/sl_unlisted_program.js +39 -0
  169. package/dist/integrity/slopnators/sl_unlisted_program.ts +40 -0
  170. package/dist/integrity/slopnators/sl_unnamed_island.js +1 -1
  171. package/dist/integrity/slopnators/sl_unpaired_member.js +3 -3
  172. package/dist/integrity/slopnators/sl_unpaired_member.ts +1 -1
  173. package/dist/integrity/slopnators/sl_unpaired_slopnator.js +4 -4
  174. package/dist/integrity/slopnators/sl_unpaired_slopnator.ts +1 -1
  175. package/dist/integrity/slopnators/sl_unprefixed_member.js +5 -31
  176. package/dist/integrity/slopnators/sl_unprefixed_member.ts +2 -28
  177. package/dist/integrity/slopnators/sl_unthreaded.js +11 -7
  178. package/dist/integrity/slopnators/sl_unthreaded.ts +6 -7
  179. package/dist/integrity/slopnators/sl_untranslated_key.js +2 -25
  180. package/dist/integrity/slopnators/sl_untranslated_key.ts +1 -25
  181. package/dist/integrity/slopnators/sl_unvaulted_secret.d.ts +2 -0
  182. package/dist/integrity/slopnators/sl_unvaulted_secret.js +107 -0
  183. package/dist/integrity/slopnators/sl_unvaulted_secret.ts +132 -0
  184. package/dist/integrity/slopnators/sl_unversioned.js +6 -4
  185. package/dist/integrity/slopnators/sl_unversioned.ts +5 -3
  186. package/dist/integrity/sweep.d.ts +1 -0
  187. package/dist/integrity/sweep.js +105 -42
  188. package/dist/integrity/sweep.ts +115 -42
  189. package/dist/knowledge/attach.js +4 -3
  190. package/dist/knowledge/attach.ts +3 -2
  191. package/dist/knowledge/generators/docsgen.js +8 -6
  192. package/dist/knowledge/generators/docsgen.ts +4 -2
  193. package/dist/knowledge/generators/glossary.js +4 -4
  194. package/dist/knowledge/generators/glossary.ts +1 -1
  195. package/dist/operations/access.d.ts +23 -0
  196. package/dist/operations/access.js +28 -1
  197. package/dist/operations/access.ts +43 -0
  198. package/dist/operations/attach.js +33 -113
  199. package/dist/operations/attach.ts +51 -117
  200. package/dist/operations/capabilities.d.ts +14 -5
  201. package/dist/operations/capabilities.js +13 -4
  202. package/dist/operations/capabilities.ts +27 -8
  203. package/dist/operations/dispatch.d.ts +8 -2
  204. package/dist/operations/dispatch.js +128 -185
  205. package/dist/operations/dispatch.ts +138 -191
  206. package/dist/operations/error-results.d.ts +1 -1
  207. package/dist/operations/error-results.js +2 -2
  208. package/dist/operations/error-results.ts +2 -2
  209. package/dist/operations/generators/capability.d.ts +11 -1
  210. package/dist/operations/generators/capability.js +481 -224
  211. package/dist/operations/generators/capability.ts +562 -233
  212. package/dist/operations/generators/compile.js +66 -39
  213. package/dist/operations/generators/compile.ts +78 -39
  214. package/dist/operations/generators/permits.js +11 -12
  215. package/dist/operations/generators/permits.ts +3 -4
  216. package/dist/operations/generators/seed.d.ts +1 -0
  217. package/dist/operations/generators/seed.js +19 -17
  218. package/dist/operations/generators/seed.ts +22 -14
  219. package/dist/operations/generators/trial.d.ts +6 -8
  220. package/dist/operations/generators/trial.js +200 -70
  221. package/dist/operations/generators/trial.ts +230 -93
  222. package/dist/operations/nodes.d.ts +15 -16
  223. package/dist/operations/nodes.ts +16 -17
  224. package/dist/operations/operations.d.ts +40 -4
  225. package/dist/operations/operations.js +1 -0
  226. package/dist/operations/operations.ts +61 -4
  227. package/dist/operations/result.d.ts +2 -2
  228. package/dist/operations/result.ts +2 -2
  229. package/package.json +1 -4
  230. package/dist/core/answers.d.ts +0 -171
  231. package/dist/core/answers.js +0 -789
  232. package/dist/core/answers.ts +0 -999
  233. package/dist/core/client.d.ts +0 -63
  234. package/dist/core/client.js +0 -249
  235. package/dist/core/client.ts +0 -289
  236. package/dist/core/files.js +0 -171
  237. package/dist/core/files.ts +0 -222
  238. package/dist/integrations/module.d.ts +0 -6
  239. package/dist/integrations/module.js +0 -153
  240. package/dist/integrations/module.ts +0 -191
  241. package/dist/integrity/slopnators/sl_unkept_rows.js +0 -104
  242. package/dist/integrity/slopnators/sl_unkept_rows.ts +0 -111
  243. package/dist/integrity/slopnators/sl_unseamed_reach.js +0 -73
  244. package/dist/integrity/slopnators/sl_unseamed_reach.ts +0 -79
  245. package/dist/operations/cost.d.ts +0 -14
  246. package/dist/operations/cost.js +0 -37
  247. package/dist/operations/cost.ts +0 -58
  248. package/dist/operations/errors/errors.d.ts +0 -52
  249. package/dist/operations/http.js +0 -124
  250. package/dist/operations/http.ts +0 -169
  251. package/dist/operations/memory.d.ts +0 -104
  252. package/dist/operations/memory.js +0 -365
  253. package/dist/operations/memory.ts +0 -470
  254. package/dist/operations/metering.d.ts +0 -55
  255. package/dist/operations/metering.js +0 -247
  256. package/dist/operations/metering.ts +0 -328
  257. package/dist/operations/queue-policy.d.ts +0 -3
  258. package/dist/operations/queue-policy.js +0 -8
  259. package/dist/operations/queue-policy.ts +0 -10
  260. package/dist/operations/seams.d.ts +0 -239
  261. package/dist/operations/seams.js +0 -45
  262. package/dist/operations/seams.ts +0 -364
  263. package/dist/operations/store.d.ts +0 -14
  264. package/dist/operations/store.js +0 -1
  265. package/dist/operations/store.ts +0 -29
  266. /package/dist/{operations → core}/errors/classes.d.ts +0 -0
  267. /package/dist/{operations → core}/errors/classes.js +0 -0
  268. /package/dist/{operations → core}/errors/classes.ts +0 -0
  269. /package/dist/integrity/slopnators/{sl_unkept_rows.d.ts → sl_door_in_a_node.d.ts} +0 -0
  270. /package/dist/integrity/slopnators/{sl_unseamed_reach.d.ts → sl_outside_an_operation.d.ts} +0 -0
@@ -1,52 +0,0 @@
1
- export declare const AuthUnauthenticated: import("./catalog.ts").ErrorFactory<"auth.unauthenticated">;
2
- export declare const AuthInvalidCredentials: import("./catalog.ts").ErrorFactory<"auth.invalid_credentials">;
3
- export declare const AuthTokenExpired: import("./catalog.ts").ErrorFactory<"auth.token_expired">;
4
- export declare const AuthTokenReused: import("./catalog.ts").ErrorFactory<"auth.token_reused">;
5
- export declare const AuthSessionRevoked: import("./catalog.ts").ErrorFactory<"auth.session_revoked">;
6
- export declare const AuthDenied: import("./catalog.ts").ErrorFactory<"auth.denied">;
7
- export declare const QuotaExceeded: import("./catalog.ts").ErrorFactory<"quota.exceeded">;
8
- export declare const QuotaReservationExpired: import("./catalog.ts").ErrorFactory<"quota.reservation_expired">;
9
- export declare const RateLimitExceeded: import("./catalog.ts").ErrorFactory<"rate_limit.exceeded">;
10
- export declare const FeatureNotInPlan: import("./catalog.ts").ErrorFactory<"feature.not_in_plan">;
11
- export declare const DbNotFound: import("./catalog.ts").ErrorFactory<"db.not_found">;
12
- export declare const DbConstraintViolation: import("./catalog.ts").ErrorFactory<"db.constraint_violation">;
13
- export declare const DbAlreadyExists: import("./catalog.ts").ErrorFactory<"db.already_exists">;
14
- export declare const DbConflict: import("./catalog.ts").ErrorFactory<"db.conflict">;
15
- export declare const DbMigrationChecksumMismatch: import("./catalog.ts").ErrorFactory<"db.migration_checksum_mismatch">;
16
- export declare const DbDestructiveWithoutDryRun: import("./catalog.ts").ErrorFactory<"db.destructive_without_dry_run">;
17
- export declare const DbRoundTripBudgetExceeded: import("./catalog.ts").ErrorFactory<"db.round_trip_budget_exceeded">;
18
- export declare const DbCursorInvalid: import("./catalog.ts").ErrorFactory<"db.cursor_invalid">;
19
- export declare const DbCursorExpired: import("./catalog.ts").ErrorFactory<"db.cursor_expired">;
20
- export declare const WorkflowNodeFailed: import("./catalog.ts").ErrorFactory<"workflow.node_failed">;
21
- export declare const WorkflowInvalidTransition: import("./catalog.ts").ErrorFactory<"workflow.invalid_transition">;
22
- export declare const WorkflowCompensationFailed: import("./catalog.ts").ErrorFactory<"workflow.compensation_failed">;
23
- export declare const WorkflowAlreadyRunning: import("./catalog.ts").ErrorFactory<"workflow.already_running">;
24
- export declare const QueueJobFailed: import("./catalog.ts").ErrorFactory<"queue.job_failed">;
25
- export declare const QueueDlqExhausted: import("./catalog.ts").ErrorFactory<"queue.dlq_exhausted">;
26
- export declare const AiProviderUnavailable: import("./catalog.ts").ErrorFactory<"ai.provider_unavailable">;
27
- export declare const AiSchemaValidationFailed: import("./catalog.ts").ErrorFactory<"ai.schema_validation_failed">;
28
- export declare const AiToolNotInMask: import("./catalog.ts").ErrorFactory<"ai.tool_not_in_mask">;
29
- export declare const AiNodeCapExceeded: import("./catalog.ts").ErrorFactory<"ai.node_cap_exceeded">;
30
- export declare const SearchIndexFailed: import("./catalog.ts").ErrorFactory<"search.index_failed">;
31
- export declare const SearchQueryInvalid: import("./catalog.ts").ErrorFactory<"search.query_invalid">;
32
- export declare const CommsChannelKindUndeclared: import("./catalog.ts").ErrorFactory<"comms.channel_kind_undeclared">;
33
- export declare const CommsChannelKindUndescribed: import("./catalog.ts").ErrorFactory<"comms.channel_kind_undescribed">;
34
- export declare const CommsChannelKindUnlabelled: import("./catalog.ts").ErrorFactory<"comms.channel_kind_unlabelled">;
35
- export declare const CommsChannelKindUndocumented: import("./catalog.ts").ErrorFactory<"comms.channel_kind_undocumented">;
36
- export declare const CommsChannelKindDuplicate: import("./catalog.ts").ErrorFactory<"comms.channel_kind_duplicate">;
37
- export declare const ConfigInvalid: import("./catalog.ts").ErrorFactory<"config.invalid">;
38
- export declare const ConfigMissingEnv: import("./catalog.ts").ErrorFactory<"config.missing_env">;
39
- export declare const ConfigSecretInPublicVar: import("./catalog.ts").ErrorFactory<"config.secret_in_public_var">;
40
- export declare const ConfigCredentialInvalid: import("./catalog.ts").ErrorFactory<"config.credential_invalid">;
41
- export declare const ConfigScopeMissing: import("./catalog.ts").ErrorFactory<"config.scope_missing">;
42
- export declare const ConfigResourceNotFound: import("./catalog.ts").ErrorFactory<"config.resource_not_found">;
43
- export declare const ConfigDestinationIncompatible: import("./catalog.ts").ErrorFactory<"config.destination_incompatible">;
44
- export declare const ConfigBlocksExit: import("./catalog.ts").ErrorFactory<"config.blocks_exit">;
45
- export declare const NetTimeout: import("./catalog.ts").ErrorFactory<"net.timeout">;
46
- export declare const NetUpstreamUnavailable: import("./catalog.ts").ErrorFactory<"net.upstream_unavailable">;
47
- export declare const NetDestinationRefused: import("./catalog.ts").ErrorFactory<"net.destination_refused">;
48
- export declare const InternalUnexpected: import("./catalog.ts").ErrorFactory<"internal.unexpected">;
49
- export declare const InternalNotImplemented: import("./catalog.ts").ErrorFactory<"internal.not_implemented">;
50
- export declare const InternalInvalidArgument: import("./catalog.ts").ErrorFactory<"internal.invalid_argument">;
51
- export declare const PLATFORM_ERRORS: readonly [import("./catalog.ts").ErrorFactory<"auth.unauthenticated">, import("./catalog.ts").ErrorFactory<"auth.invalid_credentials">, import("./catalog.ts").ErrorFactory<"auth.token_expired">, import("./catalog.ts").ErrorFactory<"auth.token_reused">, import("./catalog.ts").ErrorFactory<"auth.session_revoked">, import("./catalog.ts").ErrorFactory<"auth.denied">, import("./catalog.ts").ErrorFactory<"quota.exceeded">, import("./catalog.ts").ErrorFactory<"quota.reservation_expired">, import("./catalog.ts").ErrorFactory<"rate_limit.exceeded">, import("./catalog.ts").ErrorFactory<"feature.not_in_plan">, import("./catalog.ts").ErrorFactory<"db.not_found">, import("./catalog.ts").ErrorFactory<"db.constraint_violation">, import("./catalog.ts").ErrorFactory<"db.already_exists">, import("./catalog.ts").ErrorFactory<"db.conflict">, import("./catalog.ts").ErrorFactory<"db.migration_checksum_mismatch">, import("./catalog.ts").ErrorFactory<"db.destructive_without_dry_run">, import("./catalog.ts").ErrorFactory<"db.round_trip_budget_exceeded">, import("./catalog.ts").ErrorFactory<"db.cursor_invalid">, import("./catalog.ts").ErrorFactory<"db.cursor_expired">, import("./catalog.ts").ErrorFactory<"workflow.node_failed">, import("./catalog.ts").ErrorFactory<"workflow.invalid_transition">, import("./catalog.ts").ErrorFactory<"workflow.compensation_failed">, import("./catalog.ts").ErrorFactory<"workflow.already_running">, import("./catalog.ts").ErrorFactory<"queue.job_failed">, import("./catalog.ts").ErrorFactory<"queue.dlq_exhausted">, import("./catalog.ts").ErrorFactory<"ai.provider_unavailable">, import("./catalog.ts").ErrorFactory<"ai.schema_validation_failed">, import("./catalog.ts").ErrorFactory<"ai.tool_not_in_mask">, import("./catalog.ts").ErrorFactory<"ai.node_cap_exceeded">, import("./catalog.ts").ErrorFactory<"search.index_failed">, import("./catalog.ts").ErrorFactory<"search.query_invalid">, import("./catalog.ts").ErrorFactory<"comms.channel_kind_undeclared">, import("./catalog.ts").ErrorFactory<"comms.channel_kind_undescribed">, import("./catalog.ts").ErrorFactory<"comms.channel_kind_unlabelled">, import("./catalog.ts").ErrorFactory<"comms.channel_kind_undocumented">, import("./catalog.ts").ErrorFactory<"comms.channel_kind_duplicate">, import("./catalog.ts").ErrorFactory<"config.invalid">, import("./catalog.ts").ErrorFactory<"config.missing_env">, import("./catalog.ts").ErrorFactory<"config.secret_in_public_var">, import("./catalog.ts").ErrorFactory<"config.credential_invalid">, import("./catalog.ts").ErrorFactory<"config.scope_missing">, import("./catalog.ts").ErrorFactory<"config.resource_not_found">, import("./catalog.ts").ErrorFactory<"config.destination_incompatible">, import("./catalog.ts").ErrorFactory<"config.blocks_exit">, import("./catalog.ts").ErrorFactory<"net.timeout">, import("./catalog.ts").ErrorFactory<"net.upstream_unavailable">, import("./catalog.ts").ErrorFactory<"net.destination_refused">, import("./catalog.ts").ErrorFactory<"internal.unexpected">, import("./catalog.ts").ErrorFactory<"internal.not_implemented">, import("./catalog.ts").ErrorFactory<"internal.invalid_argument">];
52
- export type PlatformErrorCode = (typeof PLATFORM_ERRORS)[number]['def']['code'];
@@ -1,124 +0,0 @@
1
- import { payloadBytes } from "./metering.js";
2
- import { ValidationError } from "./result.js";
3
- export const HTTP_CALL_ACTION = 'http.call';
4
- export class HttpNotConfiguredError extends Error {
5
- constructor() {
6
- super('no outward seam is configured. `http.call` needs `seams.http`, which is the transport an app ' +
7
- 'wires — which hosts it may reach is declared in its tree and is not this seam\'s business.');
8
- this.name = 'HttpNotConfiguredError';
9
- }
10
- }
11
- export class OutwardTransportError extends Error {
12
- target;
13
- constructor(target, cause) {
14
- super(`outward call to "${target}" never reached it: ${cause instanceof Error ? cause.message : String(cause)}`);
15
- this.target = target;
16
- this.name = 'OutwardTransportError';
17
- }
18
- }
19
- export function outwardUrl(target, address, path) {
20
- let base;
21
- try {
22
- base = new URL(address);
23
- }
24
- catch {
25
- throw new ValidationError(`the address resolved for "${target}" is not an absolute URL: ${JSON.stringify(address)}`);
26
- }
27
- if (base.protocol !== 'https:') {
28
- throw new ValidationError(`outward calls go over https only, and "${target}" resolved to ${base.protocol.replace(':', '')}`);
29
- }
30
- if (base.search !== '' || base.hash !== '') {
31
- throw new ValidationError(`the address for "${target}" carries a query or a fragment — those belong to the call`);
32
- }
33
- if (!path.startsWith('/')) {
34
- throw new ValidationError(`an outward path starts with "/", and "${path}" does not`);
35
- }
36
- if (path.startsWith('//')) {
37
- throw new ValidationError(`the path "${path}" is protocol-relative, which points at another host`);
38
- }
39
- const url = new URL(`${base.origin}${base.pathname.replace(/\/$/, '')}${path}`);
40
- if (url.origin !== base.origin) {
41
- throw new ValidationError(`the path "${path}" resolves to ${url.origin}, which is not where "${target}" is`);
42
- }
43
- return url;
44
- }
45
- function requestBytes(headers, body) {
46
- return payloadBytes(headers) + (body === undefined ? 0 : body.byteLength);
47
- }
48
- function wireBody(body) {
49
- const copy = new ArrayBuffer(body.byteLength);
50
- new Uint8Array(copy).set(body);
51
- return copy;
52
- }
53
- const DEFAULT_TIMEOUT_MS = 10_000;
54
- export function httpSeam(options = {}) {
55
- const send = options.transport ?? fetch;
56
- const timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;
57
- return {
58
- async call(request) {
59
- const url = outwardUrl(request.target, request.address, request.path);
60
- const headers = { ...request.headers };
61
- if (request.contentType !== undefined)
62
- headers['content-type'] = request.contentType;
63
- if (request.idempotencyKey !== undefined)
64
- headers['idempotency-key'] = request.idempotencyKey;
65
- const bytesSent = requestBytes(headers, request.body);
66
- const startedAt = Date.now();
67
- let response;
68
- try {
69
- response = await send(url.toString(), {
70
- method: request.method,
71
- headers,
72
- ...(request.body === undefined ? {} : { body: wireBody(request.body) }),
73
- signal: AbortSignal.timeout(timeoutMs),
74
- });
75
- }
76
- catch (error) {
77
- throw new OutwardTransportError(request.target, error);
78
- }
79
- const body = new Uint8Array(await response.arrayBuffer());
80
- const responseHeaders = Object.fromEntries(response.headers.entries());
81
- return {
82
- status: response.status,
83
- headers: responseHeaders,
84
- body,
85
- bytesSent,
86
- bytesReceived: payloadBytes(responseHeaders) + body.byteLength,
87
- durationMs: Date.now() - startedAt,
88
- };
89
- },
90
- };
91
- }
92
- const REDACTED = '(sent)';
93
- export function recordingHttp(script = {}) {
94
- const calls = [];
95
- const decoder = new TextDecoder();
96
- return {
97
- calls,
98
- async call(request) {
99
- outwardUrl(request.target, request.address, request.path);
100
- const body = request.body === undefined ? '' : decoder.decode(request.body);
101
- calls.push({
102
- target: request.target,
103
- method: request.method,
104
- path: request.path,
105
- headers: Object.fromEntries(Object.keys(request.headers ?? {}).map((one) => [one, REDACTED])),
106
- body,
107
- });
108
- const answer = script[`${request.method} ${request.path}`];
109
- if (answer === undefined) {
110
- throw new Error(`this scenario scripts no answer for "${request.method} ${request.path}", so nothing here knows what ${request.target} would say. Add that key to the scenario's answers — a call answered by something nobody scripted proves it was made and nothing about what came back.`);
111
- }
112
- const answered = new TextEncoder().encode(answer.body ?? '');
113
- const headers = answer.headers ?? {};
114
- return {
115
- status: answer.status,
116
- headers,
117
- body: answered,
118
- bytesSent: requestBytes({ ...request.headers }, request.body),
119
- bytesReceived: payloadBytes(headers) + answered.byteLength,
120
- durationMs: 0,
121
- };
122
- },
123
- };
124
- }
@@ -1,169 +0,0 @@
1
- import { payloadBytes } from './metering.ts'
2
- import { ValidationError } from './result.ts'
3
- import type { Http, HttpRequest, HttpResponse } from './seams.ts'
4
-
5
- export const HTTP_CALL_ACTION = 'http.call'
6
-
7
- export class HttpNotConfiguredError extends Error {
8
- constructor() {
9
- super(
10
- 'no outward seam is configured. `http.call` needs `seams.http`, which is the transport an app ' +
11
- 'wires — which hosts it may reach is declared in its tree and is not this seam\'s business.',
12
- )
13
- this.name = 'HttpNotConfiguredError'
14
- }
15
- }
16
-
17
- export class OutwardTransportError extends Error {
18
- constructor(
19
- readonly target: string,
20
- cause: unknown,
21
- ) {
22
- super(`outward call to "${target}" never reached it: ${cause instanceof Error ? cause.message : String(cause)}`)
23
- this.name = 'OutwardTransportError'
24
- }
25
- }
26
-
27
- export function outwardUrl(target: string, address: string, path: string): URL {
28
- let base: URL
29
- try {
30
- base = new URL(address)
31
- } catch {
32
- throw new ValidationError(`the address resolved for "${target}" is not an absolute URL: ${JSON.stringify(address)}`)
33
- }
34
- if (base.protocol !== 'https:') {
35
- throw new ValidationError(`outward calls go over https only, and "${target}" resolved to ${base.protocol.replace(':', '')}`)
36
- }
37
- if (base.search !== '' || base.hash !== '') {
38
- throw new ValidationError(`the address for "${target}" carries a query or a fragment — those belong to the call`)
39
- }
40
- if (!path.startsWith('/')) {
41
- throw new ValidationError(`an outward path starts with "/", and "${path}" does not`)
42
- }
43
- if (path.startsWith('//')) {
44
- throw new ValidationError(`the path "${path}" is protocol-relative, which points at another host`)
45
- }
46
- const url = new URL(`${base.origin}${base.pathname.replace(/\/$/, '')}${path}`)
47
- if (url.origin !== base.origin) {
48
- throw new ValidationError(`the path "${path}" resolves to ${url.origin}, which is not where "${target}" is`)
49
- }
50
- return url
51
- }
52
-
53
- function requestBytes(headers: Readonly<Record<string, string>>, body: Uint8Array | undefined): number {
54
- return payloadBytes(headers) + (body === undefined ? 0 : body.byteLength)
55
- }
56
-
57
- function wireBody(body: Uint8Array): ArrayBuffer {
58
- const copy = new ArrayBuffer(body.byteLength)
59
- new Uint8Array(copy).set(body)
60
- return copy
61
- }
62
-
63
- export interface HttpSeamOptions {
64
- readonly transport?: typeof fetch
65
-
66
- readonly timeoutMs?: number
67
- }
68
-
69
- const DEFAULT_TIMEOUT_MS = 10_000
70
-
71
- export function httpSeam(options: HttpSeamOptions = {}): Http {
72
- const send = options.transport ?? fetch
73
- const timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS
74
-
75
- return {
76
- async call(request: HttpRequest): Promise<HttpResponse> {
77
- const url = outwardUrl(request.target, request.address, request.path)
78
-
79
- const headers: Record<string, string> = { ...request.headers }
80
- if (request.contentType !== undefined) headers['content-type'] = request.contentType
81
- if (request.idempotencyKey !== undefined) headers['idempotency-key'] = request.idempotencyKey
82
-
83
- const bytesSent = requestBytes(headers, request.body)
84
- const startedAt = Date.now()
85
-
86
- let response: Response
87
- try {
88
- response = await send(url.toString(), {
89
- method: request.method,
90
- headers,
91
- ...(request.body === undefined ? {} : { body: wireBody(request.body) }),
92
- signal: AbortSignal.timeout(timeoutMs),
93
- })
94
- } catch (error) {
95
-
96
- throw new OutwardTransportError(request.target, error)
97
- }
98
-
99
- const body = new Uint8Array(await response.arrayBuffer())
100
- const responseHeaders = Object.fromEntries(response.headers.entries())
101
-
102
- return {
103
- status: response.status,
104
- headers: responseHeaders,
105
- body,
106
- bytesSent,
107
- bytesReceived: payloadBytes(responseHeaders) + body.byteLength,
108
- durationMs: Date.now() - startedAt,
109
- }
110
- },
111
- }
112
- }
113
-
114
- export interface RecordedCall {
115
- readonly target: string
116
- readonly method: string
117
- readonly path: string
118
- readonly headers: Readonly<Record<string, string>>
119
- readonly body: string
120
- }
121
-
122
- export interface ScriptedAnswer {
123
- readonly status: number
124
- readonly headers?: Readonly<Record<string, string>>
125
- readonly body?: string
126
- }
127
-
128
- const REDACTED = '(sent)'
129
-
130
- export function recordingHttp(
131
- script: Readonly<Record<string, ScriptedAnswer>> = {},
132
- ): Http & { readonly calls: readonly RecordedCall[] } {
133
- const calls: RecordedCall[] = []
134
- const decoder = new TextDecoder()
135
-
136
- return {
137
- calls,
138
- async call(request) {
139
- outwardUrl(request.target, request.address, request.path)
140
-
141
- const body = request.body === undefined ? '' : decoder.decode(request.body)
142
- calls.push({
143
- target: request.target,
144
- method: request.method,
145
- path: request.path,
146
- headers: Object.fromEntries(Object.keys(request.headers ?? {}).map((one) => [one, REDACTED])),
147
- body,
148
- })
149
-
150
- const answer = script[`${request.method} ${request.path}`]
151
- if (answer === undefined) {
152
- throw new Error(
153
- `this scenario scripts no answer for "${request.method} ${request.path}", so nothing here knows what ${request.target} would say. Add that key to the scenario's answers — a call answered by something nobody scripted proves it was made and nothing about what came back.`,
154
- )
155
- }
156
- const answered = new TextEncoder().encode(answer.body ?? '')
157
- const headers = answer.headers ?? {}
158
- return {
159
- status: answer.status,
160
- headers,
161
- body: answered,
162
- bytesSent: requestBytes({ ...request.headers }, request.body),
163
- bytesReceived: payloadBytes(headers) + answered.byteLength,
164
-
165
- durationMs: 0,
166
- }
167
- },
168
- }
169
- }
@@ -1,104 +0,0 @@
1
- import type { Actor } from '../core/actor.ts';
2
- import type { Store, Row, Seams, Idempotency, PlatformEvent, LogLevel, Queue, Job, EnqueueOpts, Transactional, AuditRecord, ErrorRecord, Vault, FieldList } from './seams.ts';
3
- export declare class UnknownColumnError extends Error {
4
- constructor(entity: string, key: string);
5
- }
6
- export declare class VersionConflictError extends Error {
7
- constructor(entity: string, id: string, expectedVersion: number);
8
- }
9
- export declare class MemoryStore implements Store, Transactional {
10
- private data;
11
- private readonly declared;
12
- private readonly keys;
13
- constructor(declared?: ReadonlyMap<string, ReadonlySet<string>>, keys?: ReadonlyMap<string, string>);
14
- private keyOf;
15
- private static readonly SYSTEM;
16
- private assertDeclared;
17
- private depth;
18
- transaction<T>(_actor: Actor, fn: () => Promise<T>): Promise<T>;
19
- insert(_actor: Actor, entity: string, row: Row): Promise<Row>;
20
- get(_actor: Actor, entity: string, key: string | number, fields: FieldList): Promise<Row | null>;
21
- list(_actor: Actor, entity: string, opts?: {
22
- limit?: number;
23
- where?: Readonly<Record<string, string | number | boolean | null>>;
24
- }): Promise<Row[]>;
25
- update(_actor: Actor, entity: string, key: string | number, patch: Record<string, unknown>, expectedVersion?: number): Promise<Row>;
26
- remove(_actor: Actor, entity: string, key: string | number): Promise<void>;
27
- }
28
- export declare class MemoryQueue implements Queue {
29
- private jobs;
30
- private dead;
31
- private seq;
32
- enqueue<T>(actor: Actor, kind: string, payload: T, opts?: EnqueueOpts): Promise<string>;
33
- poll(kinds: string[], limit: number, now: number): Promise<Job[]>;
34
- ack(id: string): Promise<void>;
35
- fail(id: string, error: string, now: number): Promise<void>;
36
- deadLetter(id: string, error: string): Promise<void>;
37
- deadLetters(): Promise<Job[]>;
38
- }
39
- export interface Sink {
40
- logs: {
41
- level: LogLevel;
42
- action: string;
43
- data: Record<string, unknown>;
44
- }[];
45
- events: PlatformEvent[];
46
- audits: AuditRecord[];
47
- errors: ErrorRecord[];
48
- costs: string[];
49
- indexed: {
50
- entity: string;
51
- row: Row;
52
- }[];
53
- spans: {
54
- action: string;
55
- status: 'ok' | 'error';
56
- }[];
57
- outbox: PlatformEvent[];
58
- gateOrder: string[];
59
- quota: {
60
- reserved: number[];
61
- committed: number[];
62
- released: number;
63
- };
64
- files: {
65
- action: 'put' | 'get' | 'signed' | 'remove';
66
- key: string;
67
- bytes: number | null;
68
- }[];
69
- queries: {
70
- sql: string;
71
- params: readonly unknown[];
72
- rows: number;
73
- }[];
74
- }
75
- export declare class MemoryIdempotency implements Idempotency {
76
- private readonly records;
77
- private readonly onCheck?;
78
- constructor(opts: {
79
- readonly onCheck?: () => void;
80
- readonly records?: Map<string, unknown>;
81
- });
82
- private keyFor;
83
- check(key: string | undefined, action: string): Promise<unknown | null>;
84
- store(key: string | undefined, action: string, output: unknown): Promise<void>;
85
- }
86
- export interface MemorySeamOptions {
87
- readonly allowRate?: boolean;
88
- readonly features?: readonly string[];
89
- readonly quota?: Readonly<Record<string, number>>;
90
- readonly onExceed?: string;
91
- readonly entities?: ReadonlyMap<string, ReadonlySet<string>>;
92
- readonly keys?: ReadonlyMap<string, string>;
93
- readonly secrets?: Readonly<Record<string, string>>;
94
- readonly views?: Readonly<Record<string, readonly unknown[]>>;
95
- }
96
- export declare function memoryVault(seed?: Readonly<Record<string, string>>): Vault;
97
- export declare const arrived: () => number;
98
- export declare const fresh: () => string;
99
- export declare function inMemorySeams(opts?: MemorySeamOptions): {
100
- seams: Seams;
101
- sink: Sink;
102
- store: MemoryStore;
103
- queue: MemoryQueue;
104
- };