vouchington-tooling 0.34.0 → 0.36.0

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 (542) hide show
  1. package/README.md +24 -221
  2. package/dist/agent-blackboard/feedback-audit-source.mjs +2 -2
  3. package/dist/agent-blackboard/feedback-canonical.mjs +1 -1
  4. package/dist/agent-blackboard/feedback-codec.mjs +3 -3
  5. package/dist/agent-blackboard/feedback-compose.mjs +5 -5
  6. package/dist/agent-blackboard/feedback-deadline.mjs +1 -1
  7. package/dist/agent-blackboard/feedback-delivery.mjs +6 -6
  8. package/dist/agent-blackboard/feedback-fields.mjs +1 -1
  9. package/dist/agent-blackboard/feedback-identity.mjs +3 -3
  10. package/dist/agent-blackboard/feedback-journal-audit.mjs +4 -4
  11. package/dist/agent-blackboard/feedback-journal-sandbox.mjs +1 -1
  12. package/dist/agent-blackboard/feedback-online-error.mjs +1 -1
  13. package/dist/agent-blackboard/feedback-online.mjs +7 -7
  14. package/dist/agent-blackboard/feedback-outbox-counts.mjs +2 -2
  15. package/dist/agent-blackboard/feedback-outbox.mjs +7 -7
  16. package/dist/agent-blackboard/index.mjs +13 -13
  17. package/dist/agent-blackboard/journal.mjs +3 -3
  18. package/dist/agent-blackboard/session-tools.mjs +4 -4
  19. package/dist/agent-blackboard/snapshot-cleanup-directory.mjs +3 -3
  20. package/dist/agent-blackboard/snapshot-cleanup-receipt.mjs +1 -1
  21. package/dist/agent-blackboard/snapshot-cleanup-resume.mjs +2 -2
  22. package/dist/agent-blackboard/snapshot-partition-cleanup.mjs +3 -3
  23. package/dist/agent-blackboard/snapshot-partition-format.mjs +3 -3
  24. package/dist/agent-blackboard/snapshot-partition-predicates.mjs +2 -2
  25. package/dist/agent-blackboard/snapshot-partition-read.mjs +2 -2
  26. package/dist/agent-blackboard/snapshot-partition-validate.mjs +2 -2
  27. package/dist/agent-blackboard/snapshot-partition-write.mjs +2 -2
  28. package/dist/agent-blackboard/snapshot-partitions.mjs +4 -4
  29. package/dist/agent-blackboard/snapshot.mjs +2 -2
  30. package/dist/agent-harness-identity/index.d.mts +1 -1
  31. package/dist/api-fixtures/fixture-contract-validation.mjs +1 -1
  32. package/dist/api-fixtures/index.mjs +3 -3
  33. package/dist/ast-grep-examples/companion-parity.mjs +1 -1
  34. package/dist/ast-grep-examples/index.mjs +1 -1
  35. package/dist/basic-auth-doc-sync/index.mjs +2 -2
  36. package/dist/basic-auth-doc-sync/runbook.mjs +4 -4
  37. package/dist/basic-auth-doc-sync/source.mjs +2 -2
  38. package/dist/browser-session-runner/attempt.mjs +5 -5
  39. package/dist/browser-session-runner/index.mjs +4 -4
  40. package/dist/browser-session-runner/output.mjs +1 -1
  41. package/dist/ci-local/index.mjs +2 -2
  42. package/dist/cli/commands/agent-blackboard-flags.mjs +1 -1
  43. package/dist/cli/commands/agent-blackboard.mjs +3 -3
  44. package/dist/cli/commands/ast-grep-examples.mjs +1 -1
  45. package/dist/cli/commands/ast-grep-pack.mjs +1 -1
  46. package/dist/cli/commands/gha-artifacts-cleanup.mjs +1 -1
  47. package/dist/cli/commands/gha-runtime-audit.mjs +1 -1
  48. package/dist/cli/commands/gha-workspace-policy.mjs +2 -2
  49. package/dist/cli/commands/http-origin.mjs +1 -1
  50. package/dist/cli/commands/link-skill.mjs +1 -1
  51. package/dist/cli/commands/mcp.mjs +2 -2
  52. package/dist/cli/commands/nuget-central-version.mjs +1 -1
  53. package/dist/cli/commands/pnpm-install.mjs +1 -1
  54. package/dist/cli/commands/prepare-vitest-reports.mjs +1 -1
  55. package/dist/cli/commands/require-up-to-date.mjs +1 -1
  56. package/dist/cli/commands/retrospective-facts.mjs +1 -1
  57. package/dist/cli/commands/retrospective-transcript.mjs +1 -1
  58. package/dist/cli/commands/runner-port-policy.mjs +1 -1
  59. package/dist/cli/commands/vitest-blob-manifest.mjs +1 -1
  60. package/dist/cli/commands/vitest-report-attempt.mjs +1 -1
  61. package/dist/cli/index.mjs +27 -27
  62. package/dist/cli/installed-version.mjs +1 -1
  63. package/dist/cli/parse-gha-runtime-audit.mjs +1 -1
  64. package/dist/cli/parse-options.mjs +2 -2
  65. package/dist/cli/parse.mjs +5 -5
  66. package/dist/compiler-build/index.mjs +3 -3
  67. package/dist/compiler-build/program.mjs +3 -3
  68. package/dist/config-inventory/collect.mjs +5 -5
  69. package/dist/config-inventory/dynamic-configs.mjs +1 -1
  70. package/dist/config-inventory/env-expression-readers.mjs +1 -1
  71. package/dist/config-inventory/env-prefix-readers.mjs +2 -2
  72. package/dist/config-inventory/env-var-accumulator.mjs +1 -1
  73. package/dist/config-inventory/env-vars.mjs +5 -5
  74. package/dist/config-inventory/index.mjs +2 -2
  75. package/dist/contract-schema/contract-schema-bounded-array.mjs +2 -2
  76. package/dist/contract-schema/contract-schema-extractor.mjs +3 -3
  77. package/dist/contract-schema/contract-schema-object-tuple.mjs +2 -2
  78. package/dist/contract-schema/contract-schema-type-extractor.mjs +5 -5
  79. package/dist/contract-schema/contract-schema-type-utils.mjs +2 -2
  80. package/dist/contract-schema/contract-schema-validator.mjs +1 -1
  81. package/dist/contract-schema/index.mjs +7 -7
  82. package/dist/contract-schema/type-query-call.mjs +3 -3
  83. package/dist/contract-schema/type-query.mjs +2 -2
  84. package/dist/contract-schema/virtual-program.mjs +1 -1
  85. package/dist/coverage-transport/control-v2-parse-object.mjs +2 -2
  86. package/dist/coverage-transport/control-v2.mjs +4 -4
  87. package/dist/coverage-transport/control.mjs +2 -2
  88. package/dist/coverage-transport/discovery.mjs +4 -4
  89. package/dist/coverage-transport/http.mjs +1 -1
  90. package/dist/coverage-transport/index.mjs +10 -10
  91. package/dist/coverage-transport/keys.mjs +1 -1
  92. package/dist/coverage-transport/lib.mjs +6 -6
  93. package/dist/coverage-transport/prefix-transfer.mjs +4 -4
  94. package/dist/coverage-transport/prefix.mjs +3 -3
  95. package/dist/coverage-transport/presign.mjs +1 -1
  96. package/dist/coverage-transport/vitest-blob-transport.mjs +2 -2
  97. package/dist/dependency-license-policy/collect.mjs +5 -5
  98. package/dist/dependency-license-policy/index.mjs +3 -3
  99. package/dist/dependency-license-policy/policy.mjs +1 -1
  100. package/dist/dependency-license-policy/workspace.mjs +1 -1
  101. package/dist/dockerfile-parse/index.mjs +2 -2
  102. package/dist/dockerfile-parse/prewarm-ports.mjs +1 -1
  103. package/dist/dockerfile-parse/runtime-cmd.mjs +2 -2
  104. package/dist/finite-enum-ripple/check.mjs +3 -3
  105. package/dist/finite-enum-ripple/compare.mjs +3 -5
  106. package/dist/finite-enum-ripple/component-paths.mjs +2 -2
  107. package/dist/finite-enum-ripple/configured-object-mutations.mjs +1 -1
  108. package/dist/finite-enum-ripple/create-page-jsx.mjs +1 -1
  109. package/dist/finite-enum-ripple/create-page-literals.mjs +4 -4
  110. package/dist/finite-enum-ripple/create-page-object-visitor.mjs +2 -2
  111. package/dist/finite-enum-ripple/create-page-properties.mjs +1 -1
  112. package/dist/finite-enum-ripple/index.mjs +1 -1
  113. package/dist/finite-enum-ripple/model.d.mts +4 -0
  114. package/dist/finite-enum-ripple/parser-support.mjs +16 -3
  115. package/dist/finite-enum-ripple/parsers.mjs +5 -3
  116. package/dist/finite-enum-ripple/structured-route-check.mjs +5 -5
  117. package/dist/finite-enum-ripple/types.mjs +3 -3
  118. package/dist/finite-enum-ripple/union-factory-check.mjs +2 -2
  119. package/dist/finite-enum-ripple/union-types.mjs +5 -5
  120. package/dist/gh-api-shell-quoting/index.mjs +2 -2
  121. package/dist/gh-api-shell-quoting/logical-line.mjs +1 -1
  122. package/dist/gh-api-shell-quoting/scan.mjs +1 -1
  123. package/dist/gh-api-shell-quoting/yaml.mjs +1 -1
  124. package/dist/gh-cli/index.mjs +4 -4
  125. package/dist/gha-artifacts-cleanup/commands.mjs +2 -2
  126. package/dist/gha-artifacts-cleanup/index.mjs +4 -4
  127. package/dist/gha-check-run/cli.mjs +2 -2
  128. package/dist/gha-check-run/index.mjs +2 -2
  129. package/dist/gha-claude-post-review/index.mjs +2 -2
  130. package/dist/gha-post-review/claude-token.d.mts +2 -2
  131. package/dist/gha-post-review/claude-token.mjs +1 -1
  132. package/dist/gha-post-review/cli.mjs +1 -1
  133. package/dist/gha-post-review/github.mjs +7 -7
  134. package/dist/gha-post-review/index.mjs +6 -6
  135. package/dist/gha-post-review/post.mjs +2 -2
  136. package/dist/gha-post-review/pull-io.mjs +1 -1
  137. package/dist/gha-post-review/token.mjs +1 -1
  138. package/dist/gha-pr-checkpoint/index.mjs +3 -3
  139. package/dist/gha-pr-checkpoint/resume.mjs +1 -1
  140. package/dist/gha-pr-checkpoint/update.mjs +1 -1
  141. package/dist/gha-review-payload/cli.mjs +2 -2
  142. package/dist/gha-review-payload/file.mjs +1 -1
  143. package/dist/gha-review-payload/index.mjs +4 -4
  144. package/dist/gha-review-payload/remap.mjs +1 -1
  145. package/dist/gha-runtime-audit/audit.mjs +4 -4
  146. package/dist/gha-runtime-audit/index.mjs +3 -3
  147. package/dist/gha-workspace-policy/docker-options.mjs +1 -1
  148. package/dist/gha-workspace-policy/docker-workspace-user.mjs +2 -2
  149. package/dist/gha-workspace-policy/index.mjs +3 -3
  150. package/dist/gha-workspace-policy/shell-tokens.mjs +1 -1
  151. package/dist/gha-workspace-policy/sparse-checkout.mjs +1 -1
  152. package/dist/github-projects/index.mjs +2 -2
  153. package/dist/github-projects/project-audit.mjs +1 -1
  154. package/dist/index.mjs +55 -55
  155. package/dist/markdown/content-facts.mjs +1 -1
  156. package/dist/markdown/document-sections.mjs +2 -2
  157. package/dist/markdown/html-blocks.mjs +1 -1
  158. package/dist/markdown/index.mjs +10 -10
  159. package/dist/markdown/sections.mjs +2 -2
  160. package/dist/markdown/tables.mjs +2 -2
  161. package/dist/markdown/tasks.mjs +1 -1
  162. package/dist/mcp-server/context.mjs +2 -2
  163. package/dist/mcp-server/dispatch.mjs +8 -8
  164. package/dist/mcp-server/git-fixture.test-helpers.mjs +1 -1
  165. package/dist/mcp-server/handlers-journal.mjs +4 -4
  166. package/dist/mcp-server/handlers-outbox.mjs +2 -2
  167. package/dist/mcp-server/handlers-session.mjs +3 -3
  168. package/dist/mcp-server/harness.test-helpers.mjs +4 -4
  169. package/dist/mcp-server/main.mjs +1 -1
  170. package/dist/mcp-server/run.mjs +3 -3
  171. package/dist/mcp-server/sdk.mjs +1 -1
  172. package/dist/mcp-server/server.mjs +2 -2
  173. package/dist/mcp-server/worktree.mjs +2 -2
  174. package/dist/nuget-central-version/cli.mjs +1 -1
  175. package/dist/openapi-document/build-openapi-catalog-sse.mjs +1 -1
  176. package/dist/openapi-document/build-openapi-document.mjs +8 -8
  177. package/dist/openapi-document/build-openapi-request.mjs +1 -1
  178. package/dist/openapi-document/build-openapi-response.mjs +3 -3
  179. package/dist/openapi-document/build-openapi-sse-events.mjs +1 -1
  180. package/dist/openapi-document/component-registry.mjs +1 -1
  181. package/dist/openapi-document/contract-schema-intersection-merge.mjs +1 -1
  182. package/dist/openapi-document/contract-schema-to-openapi.mjs +1 -1
  183. package/dist/openapi-document/index.mjs +12 -12
  184. package/dist/openapi-document/openapi-route-helpers.mjs +1 -1
  185. package/dist/pg-schema-snapshot/build-snapshot.mjs +3 -3
  186. package/dist/pg-schema-snapshot/catalog-objects.mjs +1 -1
  187. package/dist/pg-schema-snapshot/catalog-queries.mjs +4 -4
  188. package/dist/pg-schema-snapshot/catalog-table-constraints.mjs +1 -1
  189. package/dist/pg-schema-snapshot/catalog-table-indexes.mjs +1 -1
  190. package/dist/pg-schema-snapshot/catalog-tables.mjs +1 -1
  191. package/dist/pg-schema-snapshot/generate.mjs +5 -5
  192. package/dist/pg-schema-snapshot/index.mjs +6 -6
  193. package/dist/pg-schema-snapshot/markdown-files.mjs +1 -1
  194. package/dist/pg-schema-snapshot/render-markdown.mjs +1 -1
  195. package/dist/pg-schema-snapshot/table-snapshot-constraints.mjs +1 -1
  196. package/dist/pg-schema-snapshot/table-snapshot.mjs +3 -3
  197. package/dist/pnpm-deploy/index.mjs +3 -3
  198. package/dist/pnpm-deploy/restore.mjs +1 -1
  199. package/dist/pnpm-install/exec.mjs +1 -1
  200. package/dist/pnpm-install/index.mjs +8 -8
  201. package/dist/pnpm-install/install-operations.mjs +6 -6
  202. package/dist/pnpm-install/metadata-legacy.mjs +1 -1
  203. package/dist/pnpm-install/metadata.d.mts +1 -1
  204. package/dist/pnpm-install/metadata.mjs +2 -2
  205. package/dist/pnpm-install/native-health.mjs +2 -2
  206. package/dist/pnpm-install/pnpm-install-fixture.test-helpers.mjs +2 -2
  207. package/dist/pnpm-install/runner.mjs +7 -7
  208. package/dist/post-publication-inventory/index.d.mts +6 -0
  209. package/dist/post-publication-inventory/index.mjs +6 -2
  210. package/dist/post-publication-inventory/readers/compose-appends.d.mts +7 -0
  211. package/dist/post-publication-inventory/readers/compose-appends.mjs +38 -0
  212. package/dist/post-publication-inventory/readers/composes.d.mts +2 -0
  213. package/dist/post-publication-inventory/readers/composes.mjs +79 -0
  214. package/dist/post-publication-inventory/readers/composition.d.mts +2 -0
  215. package/dist/post-publication-inventory/readers/composition.mjs +62 -0
  216. package/dist/post-publication-inventory/readers/public-boundary-ast.d.mts +5 -0
  217. package/dist/post-publication-inventory/readers/public-boundary-ast.mjs +33 -0
  218. package/dist/post-publication-inventory/readers/public-boundary-consumed.d.mts +3 -0
  219. package/dist/post-publication-inventory/readers/public-boundary-consumed.mjs +39 -0
  220. package/dist/post-publication-inventory/readers/public-boundary-dataflow.d.mts +3 -0
  221. package/dist/post-publication-inventory/readers/public-boundary-dataflow.mjs +61 -0
  222. package/dist/post-publication-inventory/readers/public-boundary-then.d.mts +9 -0
  223. package/dist/post-publication-inventory/readers/public-boundary-then.mjs +31 -0
  224. package/dist/post-publication-inventory/readers/public-boundary.d.mts +3 -0
  225. package/dist/post-publication-inventory/readers/public-boundary.mjs +71 -0
  226. package/dist/post-publication-inventory/readers/public-view-ast.d.mts +6 -0
  227. package/dist/post-publication-inventory/readers/public-view-ast.mjs +67 -0
  228. package/dist/post-publication-inventory/readers/public-view-options.d.mts +8 -0
  229. package/dist/post-publication-inventory/readers/public-view-protection.d.mts +2 -0
  230. package/dist/post-publication-inventory/readers/public-view-protection.mjs +83 -0
  231. package/dist/post-publication-inventory/readers/public-view.d.mts +2 -0
  232. package/dist/post-publication-inventory/readers/public-view.mjs +117 -0
  233. package/dist/post-publication-inventory/readers/source-ast.d.mts +30 -0
  234. package/dist/post-publication-inventory/readers/source-ast.mjs +52 -0
  235. package/dist/post-publication-inventory/readers/source-executors.d.mts +4 -0
  236. package/dist/post-publication-inventory/readers/source-executors.mjs +38 -0
  237. package/dist/post-publication-inventory/readers/source-helpers.d.mts +16 -0
  238. package/dist/post-publication-inventory/readers/source-helpers.mjs +72 -0
  239. package/dist/post-publication-inventory/readers/source-options.d.mts +8 -0
  240. package/dist/post-publication-inventory/readers/source-sql.d.mts +3 -0
  241. package/dist/post-publication-inventory/readers/source-sql.mjs +17 -0
  242. package/dist/post-publication-inventory/readers/sql-executors.mjs +2 -2
  243. package/dist/post-publication-inventory/readers/sql-source.mjs +3 -3
  244. package/dist/post-publication-inventory/readers/sql-template.mjs +1 -1
  245. package/dist/post-publication-inventory/writers/source.mjs +1 -1
  246. package/dist/retrospective-facts/coverage.mjs +1 -1
  247. package/dist/retrospective-facts/foreign.mjs +3 -3
  248. package/dist/retrospective-facts/index.mjs +4 -4
  249. package/dist/retrospective-facts/local.mjs +4 -4
  250. package/dist/retrospective-transcript/claude-blocks.mjs +1 -1
  251. package/dist/retrospective-transcript/claude.mjs +2 -2
  252. package/dist/retrospective-transcript/codex-messages.mjs +1 -1
  253. package/dist/retrospective-transcript/codex-payload.mjs +2 -2
  254. package/dist/retrospective-transcript/codex-records.mjs +3 -3
  255. package/dist/retrospective-transcript/codex-segment.mjs +1 -1
  256. package/dist/retrospective-transcript/codex.mjs +2 -2
  257. package/dist/retrospective-transcript/index.mjs +9 -9
  258. package/dist/retrospective-transcript/resolve-transcript-file.mjs +2 -2
  259. package/dist/scc-complexity/baseline.mjs +2 -2
  260. package/dist/scc-complexity/index.mjs +8 -8
  261. package/dist/scc-complexity/parser.mjs +1 -1
  262. package/dist/scc-complexity/scope-config.mjs +1 -1
  263. package/dist/session-friction/audit-block.mjs +1 -1
  264. package/dist/session-friction/ci-failures.mjs +2 -2
  265. package/dist/session-friction/classify.mjs +2 -2
  266. package/dist/session-friction/coverage-ledger.mjs +1 -1
  267. package/dist/session-friction/index.mjs +5 -5
  268. package/dist/session-friction/log-file.mjs +2 -2
  269. package/dist/session-friction/log.mjs +7 -7
  270. package/dist/session-friction/normalize.mjs +1 -1
  271. package/dist/session-friction/report.mjs +5 -5
  272. package/dist/session-friction/sandbox.mjs +1 -1
  273. package/dist/session-friction/session-id.mjs +1 -1
  274. package/dist/shared-context/index.mjs +1 -1
  275. package/dist/skill-discovery/index.mjs +3 -3
  276. package/dist/sql-ast/add-column.mjs +1 -1
  277. package/dist/sql-ast/constraint-do-block.mjs +2 -2
  278. package/dist/sql-ast/constraint-shared.mjs +1 -1
  279. package/dist/sql-ast/constraint.mjs +4 -4
  280. package/dist/sql-ast/create-table.mjs +2 -2
  281. package/dist/sql-ast/drop-index.mjs +2 -2
  282. package/dist/sql-ast/implicit-indexes.mjs +1 -1
  283. package/dist/sql-ast/index-metadata.mjs +3 -3
  284. package/dist/sql-ast/index.mjs +8 -8
  285. package/dist/sql-scanner/comments.mjs +1 -1
  286. package/dist/sql-scanner/index.mjs +3 -3
  287. package/dist/sql-scanner/literals.mjs +1 -1
  288. package/dist/swift-semantic-equal/cli.mjs +1 -1
  289. package/dist/swift-semantic-equal/index.mjs +1 -1
  290. package/dist/transient-retry/index.mjs +2 -2
  291. package/dist/vitest-blob-manifest/cli.mjs +2 -2
  292. package/dist/vitest-blob-manifest/index.mjs +4 -4
  293. package/dist/vitest-blob-manifest/report-attempt-cli.mjs +2 -2
  294. package/dist/vitest-blob-manifest/report-attempt.mjs +1 -1
  295. package/dist/vitest-blob-manifest/reports-cli.mjs +3 -3
  296. package/dist/vitest-blob-manifest/reports-source.mjs +2 -2
  297. package/dist/vitest-blob-manifest/reports.mjs +2 -2
  298. package/dist/vitest-diagnostics/index.mjs +8 -8
  299. package/dist/vitest-diagnostics/vitest-fork-exit-records.mjs +1 -1
  300. package/dist/vitest-diagnostics/vitest-fork-exit-sentinel.mjs +2 -2
  301. package/dist/vitest-diagnostics/vitest-fork-leak-detection.mjs +2 -2
  302. package/dist/vitest-diagnostics/vitest-worker-exit-diagnostics-reporter.mjs +2 -2
  303. package/dist/workflow-policy/condition-entailment.mjs +1 -1
  304. package/dist/workflow-policy/index.d.mts +1 -3
  305. package/dist/workflow-policy/index.mjs +4 -6
  306. package/dist/workflow-policy/permission-inheritance.mjs +1 -1
  307. package/dist/workflow-policy/permission-mismatches.mjs +2 -2
  308. package/dist/workflow-policy/secret-readiness.mjs +2 -2
  309. package/dist/workflow-policy/types.d.mts +2 -28
  310. package/dist/workspace-gates/first-party-graph.mjs +2 -2
  311. package/dist/workspace-gates/index.mjs +1 -1
  312. package/dist/workspace-gates/manifest-version-assertions.mjs +2 -2
  313. package/dist/workspace-gates/manifest-version-parser.mjs +1 -1
  314. package/dist/workspace-gates/options.mjs +1 -1
  315. package/dist/workspace-gates/policy.mjs +7 -7
  316. package/dist/workspace-gates/test-helpers.d.mts +2 -2
  317. package/docs/workflow-and-compiler.md +7 -16
  318. package/package.json +3 -6
  319. package/dist/api-contract-discovery/header-contract-parser.d.mts +0 -3
  320. package/dist/api-contract-discovery/header-contract-parser.mjs +0 -93
  321. package/dist/api-contract-discovery/header-contract-registry.d.mts +0 -3
  322. package/dist/api-contract-discovery/header-contract-registry.mjs +0 -40
  323. package/dist/api-contract-discovery/header-contract-types.d.mts +0 -19
  324. package/dist/api-contract-discovery/index.d.mts +0 -34
  325. package/dist/api-contract-discovery/index.mjs +0 -27
  326. package/dist/api-contract-discovery/protocol-analysis-cache.d.mts +0 -21
  327. package/dist/api-contract-discovery/protocol-analysis-cache.mjs +0 -7
  328. package/dist/api-contract-discovery/protocol-body-status.d.mts +0 -2
  329. package/dist/api-contract-discovery/protocol-body-status.mjs +0 -4
  330. package/dist/api-contract-discovery/protocol-callback-argument-bindings.d.mts +0 -7
  331. package/dist/api-contract-discovery/protocol-callback-argument-bindings.mjs +0 -33
  332. package/dist/api-contract-discovery/protocol-callback-invocation.d.mts +0 -6
  333. package/dist/api-contract-discovery/protocol-callback-invocation.mjs +0 -111
  334. package/dist/api-contract-discovery/protocol-callback-mutations.d.mts +0 -5
  335. package/dist/api-contract-discovery/protocol-callback-mutations.mjs +0 -42
  336. package/dist/api-contract-discovery/protocol-callback-registration.d.mts +0 -3
  337. package/dist/api-contract-discovery/protocol-callback-registration.mjs +0 -27
  338. package/dist/api-contract-discovery/protocol-callback-values.d.mts +0 -18
  339. package/dist/api-contract-discovery/protocol-callback-values.mjs +0 -114
  340. package/dist/api-contract-discovery/protocol-context-alias.d.mts +0 -3
  341. package/dist/api-contract-discovery/protocol-context-alias.mjs +0 -20
  342. package/dist/api-contract-discovery/protocol-contract-extraction.d.mts +0 -9
  343. package/dist/api-contract-discovery/protocol-contract-extraction.mjs +0 -87
  344. package/dist/api-contract-discovery/protocol-contract-keys.d.mts +0 -1
  345. package/dist/api-contract-discovery/protocol-contract-keys.mjs +0 -8
  346. package/dist/api-contract-discovery/protocol-contract-registry.d.mts +0 -5
  347. package/dist/api-contract-discovery/protocol-contract-registry.mjs +0 -133
  348. package/dist/api-contract-discovery/protocol-executable-path.d.mts +0 -3
  349. package/dist/api-contract-discovery/protocol-executable-path.mjs +0 -64
  350. package/dist/api-contract-discovery/protocol-execution-path.d.mts +0 -4
  351. package/dist/api-contract-discovery/protocol-execution-path.mjs +0 -16
  352. package/dist/api-contract-discovery/protocol-http-association.d.mts +0 -7
  353. package/dist/api-contract-discovery/protocol-http-association.mjs +0 -108
  354. package/dist/api-contract-discovery/protocol-http-body-kinds.d.mts +0 -3
  355. package/dist/api-contract-discovery/protocol-http-body-kinds.mjs +0 -19
  356. package/dist/api-contract-discovery/protocol-http-context-callers.d.mts +0 -7
  357. package/dist/api-contract-discovery/protocol-http-context-callers.mjs +0 -40
  358. package/dist/api-contract-discovery/protocol-http-context-escapes.d.mts +0 -3
  359. package/dist/api-contract-discovery/protocol-http-context-escapes.mjs +0 -95
  360. package/dist/api-contract-discovery/protocol-http-context.d.mts +0 -8
  361. package/dist/api-contract-discovery/protocol-http-context.mjs +0 -85
  362. package/dist/api-contract-discovery/protocol-http-emission.d.mts +0 -3
  363. package/dist/api-contract-discovery/protocol-http-emission.mjs +0 -76
  364. package/dist/api-contract-discovery/protocol-http-implicit-taint.d.mts +0 -7
  365. package/dist/api-contract-discovery/protocol-http-implicit-taint.mjs +0 -26
  366. package/dist/api-contract-discovery/protocol-http-method-access.d.mts +0 -9
  367. package/dist/api-contract-discovery/protocol-http-method-access.mjs +0 -34
  368. package/dist/api-contract-discovery/protocol-http-method-mutations.d.mts +0 -3
  369. package/dist/api-contract-discovery/protocol-http-method-mutations.mjs +0 -31
  370. package/dist/api-contract-discovery/protocol-http-reflect.d.mts +0 -5
  371. package/dist/api-contract-discovery/protocol-http-reflect.mjs +0 -45
  372. package/dist/api-contract-discovery/protocol-http-registration.d.mts +0 -12
  373. package/dist/api-contract-discovery/protocol-http-registration.mjs +0 -53
  374. package/dist/api-contract-discovery/protocol-http-response-mutations.d.mts +0 -3
  375. package/dist/api-contract-discovery/protocol-http-response-mutations.mjs +0 -31
  376. package/dist/api-contract-discovery/protocol-marker-analysis.d.mts +0 -7
  377. package/dist/api-contract-discovery/protocol-marker-analysis.mjs +0 -50
  378. package/dist/api-contract-discovery/protocol-opaque-callback.d.mts +0 -3
  379. package/dist/api-contract-discovery/protocol-opaque-callback.mjs +0 -107
  380. package/dist/api-contract-discovery/protocol-platform-callbacks.d.mts +0 -7
  381. package/dist/api-contract-discovery/protocol-platform-callbacks.mjs +0 -76
  382. package/dist/api-contract-discovery/protocol-platform-mutation-targets.d.mts +0 -5
  383. package/dist/api-contract-discovery/protocol-platform-mutation-targets.mjs +0 -89
  384. package/dist/api-contract-discovery/protocol-platform-writes.d.mts +0 -3
  385. package/dist/api-contract-discovery/protocol-platform-writes.mjs +0 -92
  386. package/dist/api-contract-discovery/protocol-requested-keys.d.mts +0 -5
  387. package/dist/api-contract-discovery/protocol-requested-keys.mjs +0 -45
  388. package/dist/api-contract-discovery/protocol-sse-callers.d.mts +0 -7
  389. package/dist/api-contract-discovery/protocol-sse-callers.mjs +0 -67
  390. package/dist/api-contract-discovery/protocol-sse-emission.d.mts +0 -11
  391. package/dist/api-contract-discovery/protocol-sse-emission.mjs +0 -61
  392. package/dist/api-contract-discovery/protocol-sse-feasible-status.d.mts +0 -3
  393. package/dist/api-contract-discovery/protocol-sse-feasible-status.mjs +0 -24
  394. package/dist/api-contract-discovery/protocol-sse-raw-writes.d.mts +0 -9
  395. package/dist/api-contract-discovery/protocol-sse-raw-writes.mjs +0 -99
  396. package/dist/api-contract-discovery/protocol-sse-status.d.mts +0 -3
  397. package/dist/api-contract-discovery/protocol-sse-status.mjs +0 -84
  398. package/dist/api-contract-discovery/protocol-sse-write-access.d.mts +0 -9
  399. package/dist/api-contract-discovery/protocol-sse-write-access.mjs +0 -42
  400. package/dist/api-contract-discovery/protocol-sse-write-helpers.d.mts +0 -7
  401. package/dist/api-contract-discovery/protocol-sse-write-helpers.mjs +0 -82
  402. package/dist/api-contract-discovery/protocol-sse-write-mutations.d.mts +0 -9
  403. package/dist/api-contract-discovery/protocol-sse-write-mutations.mjs +0 -42
  404. package/dist/api-contract-discovery/protocol-sse-write-resolution.d.mts +0 -14
  405. package/dist/api-contract-discovery/protocol-sse-write-resolution.mjs +0 -79
  406. package/dist/api-contract-discovery/protocol-status-dominance.d.mts +0 -5
  407. package/dist/api-contract-discovery/protocol-status-dominance.mjs +0 -35
  408. package/dist/api-contract-discovery/protocol-write-receiver.d.mts +0 -9
  409. package/dist/api-contract-discovery/protocol-write-receiver.mjs +0 -79
  410. package/dist/api-contract-discovery/query-contract-extraction.d.mts +0 -3
  411. package/dist/api-contract-discovery/query-contract-extraction.mjs +0 -82
  412. package/dist/api-contract-discovery/query-contract-literals.d.mts +0 -13
  413. package/dist/api-contract-discovery/query-contract-literals.mjs +0 -83
  414. package/dist/api-contract-discovery/query-contract-registry.d.mts +0 -3
  415. package/dist/api-contract-discovery/query-contract-registry.mjs +0 -70
  416. package/dist/api-contract-discovery/query-contract-types.d.mts +0 -8
  417. package/dist/api-contract-discovery/registered-route-binding-writes.d.mts +0 -4
  418. package/dist/api-contract-discovery/registered-route-binding-writes.mjs +0 -47
  419. package/dist/api-contract-discovery/registered-route-catalog.d.mts +0 -10
  420. package/dist/api-contract-discovery/registered-route-catalog.mjs +0 -85
  421. package/dist/api-contract-discovery/registered-route-factory-returns.d.mts +0 -3
  422. package/dist/api-contract-discovery/registered-route-factory-returns.mjs +0 -29
  423. package/dist/api-contract-discovery/registered-route-handler-analysis.d.mts +0 -12
  424. package/dist/api-contract-discovery/registered-route-handler-analysis.mjs +0 -119
  425. package/dist/api-contract-discovery/registered-route-handler-helpers.d.mts +0 -3
  426. package/dist/api-contract-discovery/registered-route-handler-helpers.mjs +0 -16
  427. package/dist/api-contract-discovery/registered-route-runtime-parameters.d.mts +0 -3
  428. package/dist/api-contract-discovery/registered-route-runtime-parameters.mjs +0 -5
  429. package/dist/api-contract-discovery/registered-route-terminal-error.d.mts +0 -3
  430. package/dist/api-contract-discovery/registered-route-terminal-error.mjs +0 -98
  431. package/dist/api-contract-discovery/request-contract-implicit.d.mts +0 -17
  432. package/dist/api-contract-discovery/request-contract-implicit.mjs +0 -73
  433. package/dist/api-contract-discovery/request-contract-lenient.d.mts +0 -28
  434. package/dist/api-contract-discovery/request-contract-lenient.mjs +0 -59
  435. package/dist/api-contract-discovery/request-contract-registry.d.mts +0 -14
  436. package/dist/api-contract-discovery/request-contract-registry.mjs +0 -63
  437. package/dist/api-contract-discovery/request-contract-route-analysis.d.mts +0 -25
  438. package/dist/api-contract-discovery/request-contract-route-analysis.mjs +0 -68
  439. package/dist/api-contract-discovery/request-contract-types.d.mts +0 -12
  440. package/dist/api-contract-discovery/request-contract-types.mjs +0 -1
  441. package/dist/api-contract-discovery/request-validation-callbacks.d.mts +0 -9
  442. package/dist/api-contract-discovery/request-validation-callbacks.mjs +0 -27
  443. package/dist/api-contract-discovery/request-validation-checker.d.mts +0 -7
  444. package/dist/api-contract-discovery/request-validation-checker.mjs +0 -25
  445. package/dist/api-contract-discovery/request-validation-conditional.d.mts +0 -6
  446. package/dist/api-contract-discovery/request-validation-conditional.mjs +0 -31
  447. package/dist/api-contract-discovery/request-validation-factory-calls.d.mts +0 -11
  448. package/dist/api-contract-discovery/request-validation-factory-calls.mjs +0 -23
  449. package/dist/api-contract-discovery/request-validation-facts.d.mts +0 -16
  450. package/dist/api-contract-discovery/request-validation-facts.mjs +0 -64
  451. package/dist/api-contract-discovery/request-validation-follow.d.mts +0 -24
  452. package/dist/api-contract-discovery/request-validation-follow.mjs +0 -38
  453. package/dist/api-contract-discovery/request-validation-handler-state.d.mts +0 -8
  454. package/dist/api-contract-discovery/request-validation-handler-state.mjs +0 -35
  455. package/dist/api-contract-discovery/request-validation-input.d.mts +0 -12
  456. package/dist/api-contract-discovery/request-validation-input.mjs +0 -43
  457. package/dist/api-contract-discovery/request-validation-keys.d.mts +0 -25
  458. package/dist/api-contract-discovery/request-validation-keys.mjs +0 -119
  459. package/dist/api-contract-discovery/request-validation-match.d.mts +0 -11
  460. package/dist/api-contract-discovery/request-validation-match.mjs +0 -47
  461. package/dist/api-contract-discovery/request-validation-mutation.d.mts +0 -7
  462. package/dist/api-contract-discovery/request-validation-mutation.mjs +0 -80
  463. package/dist/api-contract-discovery/request-validation-origin.d.mts +0 -20
  464. package/dist/api-contract-discovery/request-validation-origin.mjs +0 -71
  465. package/dist/api-contract-discovery/request-validation-reads.d.mts +0 -13
  466. package/dist/api-contract-discovery/request-validation-reads.mjs +0 -88
  467. package/dist/api-contract-discovery/request-validation-registration.d.mts +0 -9
  468. package/dist/api-contract-discovery/request-validation-registration.mjs +0 -32
  469. package/dist/api-contract-discovery/request-validation-report.d.mts +0 -3
  470. package/dist/api-contract-discovery/request-validation-report.mjs +0 -21
  471. package/dist/api-contract-discovery/request-validation-request-origin.d.mts +0 -5
  472. package/dist/api-contract-discovery/request-validation-request-origin.mjs +0 -13
  473. package/dist/api-contract-discovery/request-validation-select.d.mts +0 -9
  474. package/dist/api-contract-discovery/request-validation-select.mjs +0 -36
  475. package/dist/api-contract-discovery/request-validation-sites.d.mts +0 -9
  476. package/dist/api-contract-discovery/request-validation-sites.mjs +0 -77
  477. package/dist/api-contract-discovery/request-validation-state-key.d.mts +0 -13
  478. package/dist/api-contract-discovery/request-validation-state-key.mjs +0 -30
  479. package/dist/api-contract-discovery/request-validation-trace-helpers.d.mts +0 -14
  480. package/dist/api-contract-discovery/request-validation-trace-helpers.mjs +0 -80
  481. package/dist/api-contract-discovery/request-validation-trace-select.d.mts +0 -23
  482. package/dist/api-contract-discovery/request-validation-trace-select.mjs +0 -45
  483. package/dist/api-contract-discovery/request-validation-trace.d.mts +0 -8
  484. package/dist/api-contract-discovery/request-validation-trace.mjs +0 -130
  485. package/dist/api-contract-discovery/request-validation-types.d.mts +0 -84
  486. package/dist/api-contract-discovery/request-validation-types.mjs +0 -1
  487. package/dist/api-contract-discovery/request-validation-walker.d.mts +0 -26
  488. package/dist/api-contract-discovery/request-validation-walker.mjs +0 -143
  489. package/dist/api-contract-discovery/request-validation.test-helpers.d.mts +0 -39
  490. package/dist/api-contract-discovery/request-validation.test-helpers.mjs +0 -108
  491. package/dist/api-contract-discovery/response-contract-attribution-facts.d.mts +0 -2
  492. package/dist/api-contract-discovery/response-contract-attribution-facts.mjs +0 -18
  493. package/dist/api-contract-discovery/response-contract-attribution.d.mts +0 -3
  494. package/dist/api-contract-discovery/response-contract-attribution.mjs +0 -23
  495. package/dist/api-contract-discovery/response-contract-call-classification.d.mts +0 -3
  496. package/dist/api-contract-discovery/response-contract-call-classification.mjs +0 -37
  497. package/dist/api-contract-discovery/response-contract-ctx-analysis.d.mts +0 -7
  498. package/dist/api-contract-discovery/response-contract-ctx-analysis.mjs +0 -28
  499. package/dist/api-contract-discovery/response-contract-error-branch.d.mts +0 -15
  500. package/dist/api-contract-discovery/response-contract-error-branch.mjs +0 -150
  501. package/dist/api-contract-discovery/response-contract-handler-bindings.d.mts +0 -3
  502. package/dist/api-contract-discovery/response-contract-handler-bindings.mjs +0 -126
  503. package/dist/api-contract-discovery/response-contract-handler-calls.d.mts +0 -3
  504. package/dist/api-contract-discovery/response-contract-handler-calls.mjs +0 -81
  505. package/dist/api-contract-discovery/response-contract-implicit-sources.test-helpers.d.mts +0 -145
  506. package/dist/api-contract-discovery/response-contract-implicit-sources.test-helpers.mjs +0 -145
  507. package/dist/api-contract-discovery/response-contract-implicit-variants.d.mts +0 -2
  508. package/dist/api-contract-discovery/response-contract-implicit-variants.mjs +0 -6
  509. package/dist/api-contract-discovery/response-contract-implicit.d.mts +0 -6
  510. package/dist/api-contract-discovery/response-contract-implicit.mjs +0 -120
  511. package/dist/api-contract-discovery/response-contract-lenient.d.mts +0 -41
  512. package/dist/api-contract-discovery/response-contract-lenient.mjs +0 -52
  513. package/dist/api-contract-discovery/response-contract-media.d.mts +0 -3
  514. package/dist/api-contract-discovery/response-contract-media.mjs +0 -46
  515. package/dist/api-contract-discovery/response-contract-object-symbols.d.mts +0 -3
  516. package/dist/api-contract-discovery/response-contract-object-symbols.mjs +0 -80
  517. package/dist/api-contract-discovery/response-contract-property-mutations.d.mts +0 -5
  518. package/dist/api-contract-discovery/response-contract-property-mutations.mjs +0 -84
  519. package/dist/api-contract-discovery/response-contract-registration.d.mts +0 -11
  520. package/dist/api-contract-discovery/response-contract-registration.mjs +0 -65
  521. package/dist/api-contract-discovery/response-contract-registry.d.mts +0 -7
  522. package/dist/api-contract-discovery/response-contract-registry.mjs +0 -124
  523. package/dist/api-contract-discovery/response-contract-route-analysis.d.mts +0 -12
  524. package/dist/api-contract-discovery/response-contract-route-analysis.mjs +0 -65
  525. package/dist/api-contract-discovery/response-contract-route-syntax.d.mts +0 -7
  526. package/dist/api-contract-discovery/response-contract-route-syntax.mjs +0 -41
  527. package/dist/api-contract-discovery/response-contract-status.d.mts +0 -27
  528. package/dist/api-contract-discovery/response-contract-status.mjs +0 -82
  529. package/dist/api-contract-discovery/response-contract-symbols.d.mts +0 -5
  530. package/dist/api-contract-discovery/response-contract-symbols.mjs +0 -82
  531. package/dist/api-contract-discovery/response-contract-types.d.mts +0 -23
  532. package/dist/api-contract-discovery/response-contract-types.mjs +0 -1
  533. package/dist/api-contract-discovery/test-setup.test-helpers.d.mts +0 -3
  534. package/dist/api-contract-discovery/test-setup.test-helpers.mjs +0 -2
  535. package/dist/workflow-policy/concurrency-scope.d.mts +0 -4
  536. package/dist/workflow-policy/concurrency-scope.mjs +0 -66
  537. package/dist/workflow-policy/concurrency.d.mts +0 -10
  538. package/dist/workflow-policy/concurrency.mjs +0 -77
  539. package/dist/workflow-policy/graph.d.mts +0 -2
  540. package/dist/workflow-policy/graph.mjs +0 -138
  541. /package/dist/{api-contract-discovery/header-contract-types.mjs → post-publication-inventory/readers/public-view-options.mjs} +0 -0
  542. /package/dist/{api-contract-discovery/query-contract-types.mjs → post-publication-inventory/readers/source-options.mjs} +0 -0
@@ -1,42 +0,0 @@
1
- import ts from '../contract-schema/typescript-api.mjs';
2
- import { hasRawBytes, indirectPayload, reflectApplyInvocation, writeAccess, } from './protocol-sse-write-resolution.mjs';
3
- /** Resolves direct and indirect SSE writes without losing their actual receiver. */
4
- export function sseWriteInvocation(call, checker) {
5
- const reflected = reflectApplyInvocation(call, checker);
6
- if (reflected)
7
- return reflected;
8
- const access = writeAccess(call.expression);
9
- if (!access)
10
- return undefined;
11
- if (access.method === 'pipe')
12
- return call.arguments[0]
13
- ? { receiver: call.arguments[0], method: 'write', rawBytes: true }
14
- : undefined;
15
- if (access.method === 'bind') {
16
- const target = writeAccess(access.receiver);
17
- if (target?.method !== 'write' && target?.method !== 'end')
18
- return undefined;
19
- return { receiver: call.arguments[0], method: target.method, rawBytes: true };
20
- }
21
- if (access.method !== 'call' && access.method !== 'apply')
22
- return { ...access, rawBytes: hasRawBytes(access.method, call.arguments, checker, false) };
23
- const target = writeAccess(access.receiver);
24
- const receiver = call.arguments[0];
25
- if (!receiver)
26
- return undefined;
27
- const payload = indirectPayload(access.method, call, checker);
28
- if (target?.method === 'pipe') {
29
- const destination = payload?.[0];
30
- return {
31
- receiver: destination,
32
- method: 'write',
33
- rawBytes: payload === undefined || destination !== undefined,
34
- };
35
- }
36
- const method = target?.method === 'write' || target?.method === 'end' ? target.method : undefined;
37
- return {
38
- receiver,
39
- method,
40
- rawBytes: payload === undefined || hasRawBytes(method, payload, checker, true),
41
- };
42
- }
@@ -1,7 +0,0 @@
1
- import ts from '../contract-schema/typescript-api.mts';
2
- import { type HandlerBindings, type RouteBinding } from './response-contract-route-analysis.mts';
3
- import { type WriteReceiver } from './protocol-write-receiver.mts';
4
- export declare function routeKey(binding: RouteBinding): string;
5
- export declare function opaqueCallReceivesSelectedStream(call: ts.CallExpression, selectedReceivers: readonly WriteReceiver[], binding: RouteBinding, calls: readonly ts.CallExpression[], checker: ts.TypeChecker, bindings: HandlerBindings): boolean;
6
- export declare function helperBindings(node: ts.Node, calls: readonly ts.CallExpression[], checker: ts.TypeChecker, bindings: HandlerBindings): RouteBinding[];
7
- export declare function actualReceivers(receiver: WriteReceiver, binding: RouteBinding, calls: readonly ts.CallExpression[], checker: ts.TypeChecker, bindings: HandlerBindings, active?: Set<ts.Symbol>): (WriteReceiver | undefined)[];
@@ -1,82 +0,0 @@
1
- import ts from '../contract-schema/typescript-api.mjs';
2
- import { hasBindingWrite } from './registered-route-binding-writes.mjs';
3
- import { createProtocolCallbackValueResolver } from './protocol-callback-values.mjs';
4
- import { runtimeParameters } from './registered-route-runtime-parameters.mjs';
5
- import { enclosingFunction } from './protocol-marker-analysis.mjs';
6
- import { executableProtocolPath } from './protocol-execution-path.mjs';
7
- import { enclosingRouteBinding, } from './response-contract-route-analysis.mjs';
8
- import { expressionReceiver, sameWriteReceiver, } from './protocol-write-receiver.mjs';
9
- export function routeKey(binding) {
10
- return `${binding.method}:${binding.routeTemplate}`;
11
- }
12
- function implementationDeclaration(declaration, checker) {
13
- if (!declaration)
14
- return undefined;
15
- if (ts.isArrowFunction(declaration) || ts.isFunctionExpression(declaration))
16
- return declaration;
17
- if (ts.isFunctionDeclaration(declaration) || ts.isMethodDeclaration(declaration)) {
18
- if (declaration.body)
19
- return declaration;
20
- const symbol = declaration.name && checker.getSymbolAtLocation(declaration.name);
21
- return symbol?.declarations?.find((candidate) => (ts.isFunctionDeclaration(candidate) || ts.isMethodDeclaration(candidate)) &&
22
- !!candidate.body);
23
- }
24
- return undefined;
25
- }
26
- function implementationCall(call, checker) {
27
- return (implementationDeclaration(checker.getResolvedSignature(call)?.declaration, checker) ??
28
- createProtocolCallbackValueResolver(checker).resolve(call.expression, new Map())?.node);
29
- }
30
- export function opaqueCallReceivesSelectedStream(call, selectedReceivers, binding, calls, checker, bindings) {
31
- const implementation = implementationCall(call, checker);
32
- if (implementation && ts.isFunctionLike(implementation) && 'body' in implementation)
33
- return false;
34
- const framed = selectedReceivers.flatMap((receiver) => actualReceivers(receiver, binding, calls, checker, bindings));
35
- return call.arguments.some((argument) => {
36
- const receiver = expressionReceiver(argument, checker);
37
- if (!receiver)
38
- return false;
39
- return actualReceivers(receiver, binding, calls, checker, bindings).some((value) => value === undefined ||
40
- framed.some((frame) => frame === undefined || sameWriteReceiver(frame, value)));
41
- });
42
- }
43
- export function helperBindings(node, calls, checker, bindings) {
44
- const fn = enclosingFunction(node);
45
- if (!fn || fn.asteriskToken)
46
- return [];
47
- return calls.flatMap((call) => {
48
- if (implementationCall(call, checker) !== fn || !executableProtocolPath(call, checker))
49
- return [];
50
- const binding = enclosingRouteBinding(call, checker, bindings, false);
51
- return binding ? [binding] : [];
52
- });
53
- }
54
- export function actualReceivers(receiver, binding, calls, checker, bindings, active = new Set()) {
55
- const declaration = receiver.root.valueDeclaration;
56
- if (receiver.mutableAlias ||
57
- (declaration &&
58
- (ts.isBindingElement(declaration) ||
59
- (ts.isVariableDeclaration(declaration) &&
60
- !(declaration.parent.flags & ts.NodeFlags.Const)) ||
61
- (ts.isParameter(declaration) && hasBindingWrite(declaration, checker)))))
62
- return [undefined];
63
- const fn = declaration && enclosingFunction(declaration);
64
- if (!declaration || !ts.isParameter(declaration) || !fn)
65
- return [receiver];
66
- if (active.has(receiver.root))
67
- return [undefined];
68
- const index = runtimeParameters(fn).indexOf(declaration);
69
- const actuals = calls.flatMap((call) => {
70
- if (implementationCall(call, checker) !== fn || !executableProtocolPath(call, checker))
71
- return [];
72
- const callBinding = enclosingRouteBinding(call, checker, bindings, false);
73
- if (!callBinding || routeKey(callBinding) !== routeKey(binding))
74
- return [];
75
- const argument = call.arguments[index] ?? declaration.initializer;
76
- const actual = argument && expressionReceiver(argument, checker);
77
- if (!actual || receiver.path.length)
78
- return [undefined];
79
- return actualReceivers(actual, binding, calls, checker, bindings, new Set(active).add(receiver.root));
80
- });
81
- return actuals.length ? actuals : [receiver];
82
- }
@@ -1,9 +0,0 @@
1
- import ts from '../contract-schema/typescript-api.mts';
2
- import { type WriteReceiver } from './protocol-write-receiver.mts';
3
- export type SseWriteMutation = {
4
- node: ts.Node;
5
- receiver: ts.Expression;
6
- };
7
- export declare function sseWriteMutation(node: ts.Node): SseWriteMutation | undefined;
8
- export declare function mutationAffectsSelectedStream(mutations: readonly SseWriteMutation[], frameReceivers: readonly WriteReceiver[], checker: ts.TypeChecker, isSameRoute: (node: ts.Node) => boolean, isInvokedHelper: (node: ts.Node) => boolean, resolveActual: (expression: ts.Expression) => readonly (WriteReceiver | undefined)[] | undefined, resolveFrame: (receiver: WriteReceiver) => readonly (WriteReceiver | undefined)[]): boolean;
9
- export declare function isSourceLevelMutation(node: ts.Node): boolean;
@@ -1,42 +0,0 @@
1
- import ts from '../contract-schema/typescript-api.mjs';
2
- import { potentiallyExecuted } from './protocol-executable-path.mjs';
3
- import { executableProtocolPath } from './protocol-execution-path.mjs';
4
- import { opaqueProtocolCallbackPath } from './protocol-opaque-callback.mjs';
5
- import { sameWriteReceiver } from './protocol-write-receiver.mjs';
6
- import { writeAccess } from './protocol-sse-write-resolution.mjs';
7
- export function sseWriteMutation(node) {
8
- if (ts.isBinaryExpression(node) && isAssignment(node.operatorToken.kind)) {
9
- const access = writeAccess(node.left);
10
- if (access && (access.method === 'write' || access.method === 'end'))
11
- return { node, receiver: access.receiver };
12
- }
13
- if (ts.isDeleteExpression(node)) {
14
- const access = writeAccess(node.expression);
15
- if (access && (access.method === 'write' || access.method === 'end'))
16
- return { node, receiver: access.receiver };
17
- }
18
- return undefined;
19
- }
20
- function isAssignment(kind) {
21
- return kind >= ts.SyntaxKind.FirstAssignment && kind <= ts.SyntaxKind.LastAssignment;
22
- }
23
- export function mutationAffectsSelectedStream(mutations, frameReceivers, checker, isSameRoute, isInvokedHelper, resolveActual, resolveFrame) {
24
- const framed = frameReceivers.flatMap(resolveFrame);
25
- return mutations.some(({ node, receiver }) => {
26
- if (!potentiallyExecuted(node) ||
27
- (!isSourceLevelMutation(node) &&
28
- !executableProtocolPath(node, checker) &&
29
- !opaqueProtocolCallbackPath(node, checker) &&
30
- !isInvokedHelper(node)) ||
31
- !isSameRoute(node))
32
- return false;
33
- const actual = resolveActual(receiver);
34
- if (!actual)
35
- return true;
36
- return actual.some((value) => value === undefined ||
37
- framed.some((frame) => frame === undefined || sameWriteReceiver(frame, value)));
38
- });
39
- }
40
- export function isSourceLevelMutation(node) {
41
- return ts.isExpressionStatement(node.parent) && ts.isSourceFile(node.parent.parent);
42
- }
@@ -1,14 +0,0 @@
1
- import ts from '../contract-schema/typescript-api.mts';
2
- export type WriteAccess = {
3
- receiver: ts.Expression;
4
- method: string | undefined;
5
- };
6
- export type WriteInvocation = {
7
- receiver: ts.Expression | undefined;
8
- method: string | undefined;
9
- rawBytes: boolean;
10
- };
11
- export declare function writeAccess(expression: ts.Expression): WriteAccess | undefined;
12
- export declare function reflectApplyInvocation(call: ts.CallExpression, checker: ts.TypeChecker): WriteInvocation | undefined;
13
- export declare function indirectPayload(method: 'call' | 'apply', call: ts.CallExpression, checker: ts.TypeChecker): readonly ts.Expression[] | undefined;
14
- export declare function hasRawBytes(method: string | undefined, payload: readonly ts.Expression[] | undefined, checker: ts.TypeChecker, indirect: boolean): boolean;
@@ -1,79 +0,0 @@
1
- import ts from '../contract-schema/typescript-api.mjs';
2
- import { unwrapExpression } from './protocol-marker-analysis.mjs';
3
- export function writeAccess(expression) {
4
- expression = unwrapExpression(expression);
5
- if (ts.isPropertyAccessExpression(expression))
6
- return { receiver: expression.expression, method: expression.name.text };
7
- if (!ts.isElementAccessExpression(expression))
8
- return undefined;
9
- const method = unwrapExpression(expression.argumentExpression);
10
- return {
11
- receiver: expression.expression,
12
- method: ts.isStringLiteralLike(method) ? method.text : undefined,
13
- };
14
- }
15
- export function reflectApplyInvocation(call, checker) {
16
- const expression = unwrapExpression(call.expression);
17
- if (!ts.isPropertyAccessExpression(expression) ||
18
- expression.name.text !== 'apply' ||
19
- !ts.isIdentifier(expression.expression) ||
20
- expression.expression.text !== 'Reflect')
21
- return undefined;
22
- const defaultApply = checker
23
- .getSymbolAtLocation(expression.name)
24
- ?.declarations?.some((declaration) => declaration.getSourceFile().fileName.endsWith('/lib.es2015.reflect.d.ts'));
25
- if (!defaultApply)
26
- return undefined;
27
- const target = call.arguments[0] && writeAccess(call.arguments[0]);
28
- const receiver = call.arguments[1];
29
- const payload = applyPayload(call.arguments[2], checker);
30
- if (target?.method === 'pipe') {
31
- const destination = payload?.[0];
32
- return {
33
- receiver: destination,
34
- method: 'write',
35
- rawBytes: payload === undefined || destination !== undefined,
36
- };
37
- }
38
- const method = target?.method === 'write' || target?.method === 'end' ? target.method : undefined;
39
- return {
40
- receiver,
41
- method,
42
- rawBytes: payload === undefined || hasRawBytes(method, payload, checker, true),
43
- };
44
- }
45
- export function indirectPayload(method, call, checker) {
46
- if (method === 'call')
47
- return call.arguments.slice(1);
48
- return applyPayload(call.arguments[1], checker);
49
- }
50
- function applyPayload(argument, checker) {
51
- if (!argument)
52
- return [];
53
- const value = unwrapExpression(argument);
54
- if (isNullish(argument, checker))
55
- return [];
56
- if (!ts.isArrayLiteralExpression(value) || value.elements.some(ts.isSpreadElement))
57
- return undefined;
58
- return value.elements.filter(ts.isExpression);
59
- }
60
- function isNullish(expression, checker) {
61
- const value = unwrapExpression(expression);
62
- if (value.kind === ts.SyntaxKind.NullKeyword)
63
- return true;
64
- if (ts.isIdentifier(value) && value.text === 'undefined')
65
- return true;
66
- const flags = checker.getTypeAtLocation(expression).flags;
67
- return !!(flags & (ts.TypeFlags.Undefined | ts.TypeFlags.Null));
68
- }
69
- export function hasRawBytes(method, payload, checker, indirect) {
70
- if (payload === undefined || method === undefined)
71
- return true;
72
- if (method === 'write')
73
- return !indirect || payload.length > 0;
74
- if (method !== 'end' || !payload[0])
75
- return false;
76
- const type = checker.getTypeAtLocation(payload[0]);
77
- return (!(type.flags & (ts.TypeFlags.Undefined | ts.TypeFlags.Null)) &&
78
- type.getCallSignatures().length === 0);
79
- }
@@ -1,5 +0,0 @@
1
- import ts from '../contract-schema/typescript-api.mts';
2
- /** Requires the last potentially preceding proven status setter to belong to this response. */
3
- export declare function statusDominatesEmission(emission: ts.CallExpression | ts.NewExpression, statuses: ReadonlySet<ts.CallExpression>, allStatuses?: ReadonlySet<ts.CallExpression>): boolean;
4
- /** Finds the last setter through unconditional blocks, excluding conditional compound statements. */
5
- export declare function unconditionalStatusSetter(statement: ts.Statement, statuses: ReadonlySet<ts.CallExpression>): ts.CallExpression | undefined;
@@ -1,35 +0,0 @@
1
- import ts from '../contract-schema/typescript-api.mjs';
2
- /** Requires the last potentially preceding proven status setter to belong to this response. */
3
- export function statusDominatesEmission(emission, statuses, allStatuses = statuses) {
4
- let current = emission;
5
- while (current.parent && !ts.isFunctionLike(current.parent)) {
6
- const parent = current.parent;
7
- if (ts.isBlock(parent)) {
8
- const index = parent.statements.indexOf(current);
9
- for (const statement of parent.statements.slice(0, index).toReversed())
10
- if (containsStatus(statement, allStatuses)) {
11
- const setter = unconditionalStatusSetter(statement, allStatuses);
12
- return !!setter && statuses.has(setter);
13
- }
14
- }
15
- current = parent;
16
- }
17
- return false;
18
- }
19
- /** Finds the last setter through unconditional blocks, excluding conditional compound statements. */
20
- export function unconditionalStatusSetter(statement, statuses) {
21
- if (ts.isBlock(statement)) {
22
- for (const child of statement.statements.toReversed())
23
- if (containsStatus(child, statuses))
24
- return unconditionalStatusSetter(child, statuses);
25
- }
26
- else if (ts.isExpressionStatement(statement) &&
27
- ts.isCallExpression(statement.expression) &&
28
- statuses.has(statement.expression))
29
- return statement.expression;
30
- return undefined;
31
- }
32
- function containsStatus(node, statuses) {
33
- return ((ts.isCallExpression(node) && statuses.has(node)) ||
34
- (ts.forEachChild(node, (child) => containsStatus(child, statuses)) ?? false));
35
- }
@@ -1,9 +0,0 @@
1
- import ts from '../contract-schema/typescript-api.mts';
2
- export type WriteReceiver = {
3
- root: ts.Symbol;
4
- path: readonly string[];
5
- mutableAlias?: boolean;
6
- };
7
- export declare function writeReceiver(call: ts.CallExpression, checker: ts.TypeChecker): WriteReceiver | undefined;
8
- export declare function sameWriteReceiver(left: WriteReceiver, right: WriteReceiver | undefined): boolean;
9
- export declare function expressionReceiver(expression: ts.Expression, checker: ts.TypeChecker, active?: Set<ts.Symbol>): WriteReceiver | undefined;
@@ -1,79 +0,0 @@
1
- import ts from '../contract-schema/typescript-api.mjs';
2
- import { unwrapExpression } from './protocol-marker-analysis.mjs';
3
- export function writeReceiver(call, checker) {
4
- const target = unwrapExpression(call.expression);
5
- if (!ts.isPropertyAccessExpression(target) || target.name.text !== 'write')
6
- return undefined;
7
- return expressionReceiver(target.expression, checker);
8
- }
9
- export function sameWriteReceiver(left, right) {
10
- return (right !== undefined &&
11
- left.root === right.root &&
12
- left.path.length === right.path.length &&
13
- left.path.every((part, index) => part === right.path[index]));
14
- }
15
- export function expressionReceiver(expression, checker, active = new Set()) {
16
- const value = unwrapExpression(expression);
17
- if (ts.isIdentifier(value)) {
18
- const symbol = checker.getSymbolAtLocation(value);
19
- if (!symbol)
20
- return undefined;
21
- return symbolReceiver(symbol, checker, active);
22
- }
23
- if (!ts.isPropertyAccessExpression(value))
24
- return undefined;
25
- const propertySymbol = checker.getSymbolAtLocation(value.name);
26
- if (propertySymbol && active.has(propertySymbol))
27
- return undefined;
28
- const property = literalProperty(value, checker) ?? propertySymbol?.valueDeclaration;
29
- const propertyActive = new Set(active);
30
- if (propertySymbol)
31
- propertyActive.add(propertySymbol);
32
- // Object literal properties remain writable even when their variable is const.
33
- // Track the original receiver for raw-write rejection; never trust a marked wrapper.
34
- if (property && ts.isPropertyAssignment(property)) {
35
- const receiver = expressionReceiver(property.initializer, checker, propertyActive);
36
- return receiver && { ...receiver, mutableAlias: true };
37
- }
38
- if (property && ts.isShorthandPropertyAssignment(property)) {
39
- const symbol = checker.getShorthandAssignmentValueSymbol(property);
40
- const receiver = symbol && symbolReceiver(symbol, checker, propertyActive);
41
- return receiver && { ...receiver, mutableAlias: true };
42
- }
43
- const parent = expressionReceiver(value.expression, checker, active);
44
- return parent ? { ...parent, path: [...parent.path, value.name.text] } : undefined;
45
- }
46
- function symbolReceiver(symbol, checker, active) {
47
- const root = symbol.flags & ts.SymbolFlags.Alias ? checker.getAliasedSymbol(symbol) : symbol;
48
- if (active.has(root))
49
- return undefined;
50
- const declaration = root.valueDeclaration;
51
- if (declaration &&
52
- ts.isVariableDeclaration(declaration) &&
53
- declaration.initializer &&
54
- ts.isVariableDeclarationList(declaration.parent)) {
55
- const initializer = unwrapExpression(declaration.initializer);
56
- if (ts.isIdentifier(initializer) || ts.isPropertyAccessExpression(initializer)) {
57
- const receiver = expressionReceiver(initializer, checker, new Set(active).add(root));
58
- return (receiver && {
59
- ...receiver,
60
- ...(!(declaration.parent.flags & ts.NodeFlags.Const) ? { mutableAlias: true } : {}),
61
- });
62
- }
63
- }
64
- return { root, path: [] };
65
- }
66
- function literalProperty(value, checker) {
67
- const base = unwrapExpression(value.expression);
68
- if (!ts.isIdentifier(base))
69
- return undefined;
70
- const declaration = checker.getSymbolAtLocation(base)?.valueDeclaration;
71
- if (!declaration || !ts.isVariableDeclaration(declaration) || !declaration.initializer)
72
- return undefined;
73
- const initializer = unwrapExpression(declaration.initializer);
74
- if (!ts.isObjectLiteralExpression(initializer))
75
- return undefined;
76
- return initializer.properties.find((member) => (ts.isPropertyAssignment(member) || ts.isShorthandPropertyAssignment(member)) &&
77
- ts.isIdentifier(member.name) &&
78
- member.name.text === value.name.text);
79
- }
@@ -1,3 +0,0 @@
1
- import type { QueryParameterContract } from './query-contract-types.mts';
2
- import ts from '../contract-schema/typescript-api.mts';
3
- export declare function extractQueryParameterDescriptor(type: ts.Type, checker: ts.TypeChecker, sourceFile: ts.SourceFile, node: ts.Node, parameterName: string): QueryParameterContract;
@@ -1,82 +0,0 @@
1
- import ts from '../contract-schema/typescript-api.mjs';
2
- import { contractError } from './response-contract-registration.mjs';
3
- import { optionalNumberLiteral, declaresProperty, optionalTrueLiteral, optionalStringLiteral, requiredBooleanLiteral, requiredNumberLiteral, requiredPropertyType, rejectUnresolvedType, requiredStringLiteral, stringTuple, } from './query-contract-literals.mjs';
4
- export function extractQueryParameterDescriptor(type, checker, sourceFile, node, parameterName) {
5
- rejectUnresolvedType(type, failure(sourceFile, node, parameterName));
6
- const descriptor = extractDescriptorShape(type, checker, sourceFile, node, parameterName);
7
- if (!optionalTrueLiteral(type, 'required', checker, failure(sourceFile, node, parameterName))) {
8
- return descriptor;
9
- }
10
- if (declaresProperty(type, 'default')) {
11
- failure(sourceFile, node, parameterName)('required cannot be combined with default');
12
- }
13
- return { ...descriptor, required: true };
14
- }
15
- function failure(sourceFile, node, parameterName) {
16
- return (detail) => {
17
- throw contractError(sourceFile, node, `Malformed query parameter "${parameterName}": ${detail}`);
18
- };
19
- }
20
- function extractDescriptorShape(type, checker, sourceFile, node, parameterName) {
21
- const fail = failure(sourceFile, node, parameterName);
22
- const kind = requiredStringLiteral(type, 'kind', checker, fail);
23
- const description = optionalStringLiteral(type, 'description', checker, node, fail);
24
- const options = description === undefined ? {} : { description };
25
- if (kind === 'string') {
26
- const format = optionalStringLiteral(type, 'format', checker, node, fail);
27
- if (format === 'uuid')
28
- return { kind, format, ...options };
29
- if (format === 'uri')
30
- return { kind, format, ...options };
31
- if (format !== undefined)
32
- fail('unsupported format');
33
- return { kind, ...options };
34
- }
35
- if (kind === 'uuid-or-uri' ||
36
- kind === 'boolean' ||
37
- kind === 'nullable-boolean' ||
38
- kind === 'number') {
39
- return { kind, ...options };
40
- }
41
- if (kind === 'integer') {
42
- const minimum = requiredNumberLiteral(type, 'minimum', checker, fail);
43
- const maximum = requiredNumberLiteral(type, 'maximum', checker, fail);
44
- const defaultValue = optionalNumberLiteral(type, 'default', checker, node, fail);
45
- return {
46
- kind,
47
- minimum,
48
- maximum,
49
- ...(defaultValue === undefined ? {} : { default: defaultValue }),
50
- ...options,
51
- };
52
- }
53
- if (kind === 'enum') {
54
- const values = stringTuple(type, 'values', checker, fail);
55
- const defaultValue = optionalStringLiteral(type, 'default', checker, node, fail);
56
- if (defaultValue !== undefined && !values.includes(defaultValue)) {
57
- fail('default must be one of values');
58
- }
59
- return {
60
- kind,
61
- values,
62
- ...(defaultValue === undefined ? {} : { default: defaultValue }),
63
- ...options,
64
- };
65
- }
66
- if (kind === 'csv-array') {
67
- if (requiredStringLiteral(type, 'style', checker, fail) !== 'form')
68
- fail('style must be form');
69
- if (requiredBooleanLiteral(type, 'explode', checker, fail) !== false)
70
- fail('explode must be false');
71
- const itemType = requiredPropertyType(type, 'items', checker, fail);
72
- rejectUnresolvedType(itemType, fail);
73
- if (declaresProperty(itemType, 'required'))
74
- fail('array items cannot be required');
75
- const items = extractDescriptorShape(itemType, checker, sourceFile, node, `${parameterName}[]`);
76
- if (items.kind === 'string' || items.kind === 'enum') {
77
- return { kind, items, style: 'form', explode: false, ...options };
78
- }
79
- return fail('array items must be string or enum');
80
- }
81
- return fail(`unsupported kind "${kind}"`);
82
- }
@@ -1,13 +0,0 @@
1
- import ts from '../contract-schema/typescript-api.mts';
2
- export declare function requiredPropertyType(type: ts.Type, name: string, checker: ts.TypeChecker, fail: (detail: string) => never): ts.Type;
3
- export declare function requiredStringLiteral(type: ts.Type, name: string, checker: ts.TypeChecker, fail: (detail: string) => never): string;
4
- export declare function requiredNumberLiteral(type: ts.Type, name: string, checker: ts.TypeChecker, fail: (detail: string) => never): number;
5
- export declare function requiredBooleanLiteral(type: ts.Type, name: string, checker: ts.TypeChecker, fail: (detail: string) => never): boolean;
6
- export declare function optionalStringLiteral(type: ts.Type, name: string, checker: ts.TypeChecker, node: ts.Node, fail: (detail: string) => never): string | undefined;
7
- export declare function optionalNumberLiteral(type: ts.Type, name: string, checker: ts.TypeChecker, node: ts.Node, fail: (detail: string) => never): number | undefined;
8
- export declare function optionalTrueLiteral(type: ts.Type, name: string, checker: ts.TypeChecker, fail: (detail: string) => never): boolean;
9
- /** True when the type, or any member of a union type, declares the property. */
10
- export declare function declaresProperty(type: ts.Type, name: string): boolean;
11
- export declare function stringTuple(type: ts.Type, name: string, checker: ts.TypeChecker, fail: (detail: string) => never): readonly string[];
12
- /** Fails when the type, or any union/intersection constituent, is conditional or generic. */
13
- export declare function rejectUnresolvedType(type: ts.Type, fail: (detail: string) => never): void;
@@ -1,83 +0,0 @@
1
- import ts from '../contract-schema/typescript-api.mjs';
2
- export function requiredPropertyType(type, name, checker, fail) {
3
- const property = type.getProperty(name);
4
- if (!property || property.flags & ts.SymbolFlags.Optional)
5
- return fail(`requires literal ${name}`);
6
- const location = property.valueDeclaration ?? property.declarations?.[0];
7
- if (!location)
8
- return fail(`requires declared ${name}`);
9
- return checker.getTypeOfSymbolAtLocation(property, location);
10
- }
11
- export function requiredStringLiteral(type, name, checker, fail) {
12
- const value = requiredPropertyType(type, name, checker, fail);
13
- return value.isStringLiteral() ? value.value : fail(`requires literal ${name}`);
14
- }
15
- export function requiredNumberLiteral(type, name, checker, fail) {
16
- const value = requiredPropertyType(type, name, checker, fail);
17
- return value.isNumberLiteral() ? value.value : fail(`requires literal ${name}`);
18
- }
19
- export function requiredBooleanLiteral(type, name, checker, fail) {
20
- const value = requiredPropertyType(type, name, checker, fail);
21
- if (value.flags & ts.TypeFlags.BooleanLiteral)
22
- return checker.typeToString(value) === 'true';
23
- return fail(`requires literal ${name}`);
24
- }
25
- export function optionalStringLiteral(type, name, checker, node, fail) {
26
- const property = type.getProperty(name);
27
- if (!property)
28
- return undefined;
29
- if (property.flags & ts.SymbolFlags.Optional)
30
- return fail(`${name} must be literal when present`);
31
- const location = property.valueDeclaration ?? property.declarations?.[0] ?? node;
32
- const value = checker.getTypeOfSymbolAtLocation(property, location);
33
- return value.isStringLiteral() ? value.value : fail(`requires literal ${name}`);
34
- }
35
- export function optionalNumberLiteral(type, name, checker, node, fail) {
36
- const property = type.getProperty(name);
37
- if (!property)
38
- return undefined;
39
- if (property.flags & ts.SymbolFlags.Optional)
40
- return fail(`${name} must be literal when present`);
41
- const location = property.valueDeclaration ?? property.declarations?.[0] ?? node;
42
- const value = checker.getTypeOfSymbolAtLocation(property, location);
43
- return value.isNumberLiteral() ? value.value : fail(`requires literal ${name}`);
44
- }
45
- export function optionalTrueLiteral(type, name, checker, fail) {
46
- const property = type.getProperty(name);
47
- if (!property) {
48
- if (declaresProperty(type, name))
49
- return fail(`${name} must be present on every union member`);
50
- return false;
51
- }
52
- if (property.flags & ts.SymbolFlags.Optional)
53
- return fail(`${name} must be literal when present`);
54
- const value = requiredPropertyType(type, name, checker, fail);
55
- const isTrue = value.flags & ts.TypeFlags.BooleanLiteral && checker.typeToString(value) === 'true';
56
- return isTrue ? true : fail(`${name} must be the literal true`);
57
- }
58
- /** True when the type, or any member of a union type, declares the property. */
59
- export function declaresProperty(type, name) {
60
- if (type.getProperty(name))
61
- return true;
62
- return type.isUnion() && type.types.some((member) => member.getProperty(name) !== undefined);
63
- }
64
- export function stringTuple(type, name, checker, fail) {
65
- const value = requiredPropertyType(type, name, checker, fail);
66
- if (!checker.isTupleType(value))
67
- return fail(`${name} must be a literal tuple`);
68
- const values = checker.getTypeArguments(value);
69
- if (values.length === 0 || values.some((item) => !item.isStringLiteral())) {
70
- return fail(`${name} must contain string literals`);
71
- }
72
- return values.map((item) => item.value);
73
- }
74
- /** Fails when the type, or any union/intersection constituent, is conditional or generic. */
75
- export function rejectUnresolvedType(type, fail) {
76
- if (type.flags & (ts.TypeFlags.Conditional | ts.TypeFlags.Instantiable)) {
77
- fail('descriptor must not contain unresolved conditional or generic types');
78
- }
79
- if (type.isUnionOrIntersection()) {
80
- for (const member of type.types)
81
- rejectUnresolvedType(member, fail);
82
- }
83
- }
@@ -1,3 +0,0 @@
1
- import ts from '../contract-schema/typescript-api.mts';
2
- import type { BackendQueryContractRegistry } from './query-contract-types.mts';
3
- export declare function discoverApiQueryContracts(program: ts.Program, sourceFiles: readonly ts.SourceFile[], knownResponseRoutes: ReadonlySet<string>): BackendQueryContractRegistry;