vouchington-tooling 0.35.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 (532) 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 +2 -2
  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/parser-support.mjs +2 -2
  114. package/dist/finite-enum-ripple/parsers.mjs +3 -3
  115. package/dist/finite-enum-ripple/structured-route-check.mjs +4 -4
  116. package/dist/finite-enum-ripple/types.mjs +3 -3
  117. package/dist/finite-enum-ripple/union-factory-check.mjs +2 -2
  118. package/dist/finite-enum-ripple/union-types.mjs +4 -4
  119. package/dist/gh-api-shell-quoting/index.mjs +2 -2
  120. package/dist/gh-api-shell-quoting/logical-line.mjs +1 -1
  121. package/dist/gh-api-shell-quoting/scan.mjs +1 -1
  122. package/dist/gh-api-shell-quoting/yaml.mjs +1 -1
  123. package/dist/gh-cli/index.mjs +4 -4
  124. package/dist/gha-artifacts-cleanup/commands.mjs +2 -2
  125. package/dist/gha-artifacts-cleanup/index.mjs +4 -4
  126. package/dist/gha-check-run/cli.mjs +2 -2
  127. package/dist/gha-check-run/index.mjs +2 -2
  128. package/dist/gha-claude-post-review/index.mjs +2 -2
  129. package/dist/gha-post-review/claude-token.d.mts +2 -2
  130. package/dist/gha-post-review/claude-token.mjs +1 -1
  131. package/dist/gha-post-review/cli.mjs +1 -1
  132. package/dist/gha-post-review/github.mjs +7 -7
  133. package/dist/gha-post-review/index.mjs +6 -6
  134. package/dist/gha-post-review/post.mjs +2 -2
  135. package/dist/gha-post-review/pull-io.mjs +1 -1
  136. package/dist/gha-post-review/token.mjs +1 -1
  137. package/dist/gha-pr-checkpoint/index.mjs +3 -3
  138. package/dist/gha-pr-checkpoint/resume.mjs +1 -1
  139. package/dist/gha-pr-checkpoint/update.mjs +1 -1
  140. package/dist/gha-review-payload/cli.mjs +2 -2
  141. package/dist/gha-review-payload/file.mjs +1 -1
  142. package/dist/gha-review-payload/index.mjs +4 -4
  143. package/dist/gha-review-payload/remap.mjs +1 -1
  144. package/dist/gha-runtime-audit/audit.mjs +4 -4
  145. package/dist/gha-runtime-audit/index.mjs +3 -3
  146. package/dist/gha-workspace-policy/docker-options.mjs +1 -1
  147. package/dist/gha-workspace-policy/docker-workspace-user.mjs +2 -2
  148. package/dist/gha-workspace-policy/index.mjs +3 -3
  149. package/dist/gha-workspace-policy/shell-tokens.mjs +1 -1
  150. package/dist/gha-workspace-policy/sparse-checkout.mjs +1 -1
  151. package/dist/github-projects/index.mjs +2 -2
  152. package/dist/github-projects/project-audit.mjs +1 -1
  153. package/dist/index.mjs +55 -55
  154. package/dist/markdown/content-facts.mjs +1 -1
  155. package/dist/markdown/document-sections.mjs +2 -2
  156. package/dist/markdown/html-blocks.mjs +1 -1
  157. package/dist/markdown/index.mjs +10 -10
  158. package/dist/markdown/sections.mjs +2 -2
  159. package/dist/markdown/tables.mjs +2 -2
  160. package/dist/markdown/tasks.mjs +1 -1
  161. package/dist/mcp-server/context.mjs +2 -2
  162. package/dist/mcp-server/dispatch.mjs +8 -8
  163. package/dist/mcp-server/git-fixture.test-helpers.mjs +1 -1
  164. package/dist/mcp-server/handlers-journal.mjs +4 -4
  165. package/dist/mcp-server/handlers-outbox.mjs +2 -2
  166. package/dist/mcp-server/handlers-session.mjs +3 -3
  167. package/dist/mcp-server/harness.test-helpers.mjs +4 -4
  168. package/dist/mcp-server/main.mjs +1 -1
  169. package/dist/mcp-server/run.mjs +3 -3
  170. package/dist/mcp-server/sdk.mjs +1 -1
  171. package/dist/mcp-server/server.mjs +2 -2
  172. package/dist/mcp-server/worktree.mjs +2 -2
  173. package/dist/nuget-central-version/cli.mjs +1 -1
  174. package/dist/openapi-document/build-openapi-catalog-sse.mjs +1 -1
  175. package/dist/openapi-document/build-openapi-document.mjs +8 -8
  176. package/dist/openapi-document/build-openapi-request.mjs +1 -1
  177. package/dist/openapi-document/build-openapi-response.mjs +3 -3
  178. package/dist/openapi-document/build-openapi-sse-events.mjs +1 -1
  179. package/dist/openapi-document/component-registry.mjs +1 -1
  180. package/dist/openapi-document/contract-schema-intersection-merge.mjs +1 -1
  181. package/dist/openapi-document/contract-schema-to-openapi.mjs +1 -1
  182. package/dist/openapi-document/index.mjs +12 -12
  183. package/dist/openapi-document/openapi-route-helpers.mjs +1 -1
  184. package/dist/pg-schema-snapshot/build-snapshot.mjs +3 -3
  185. package/dist/pg-schema-snapshot/catalog-objects.mjs +1 -1
  186. package/dist/pg-schema-snapshot/catalog-queries.mjs +4 -4
  187. package/dist/pg-schema-snapshot/catalog-table-constraints.mjs +1 -1
  188. package/dist/pg-schema-snapshot/catalog-table-indexes.mjs +1 -1
  189. package/dist/pg-schema-snapshot/catalog-tables.mjs +1 -1
  190. package/dist/pg-schema-snapshot/generate.mjs +5 -5
  191. package/dist/pg-schema-snapshot/index.mjs +6 -6
  192. package/dist/pg-schema-snapshot/markdown-files.mjs +1 -1
  193. package/dist/pg-schema-snapshot/render-markdown.mjs +1 -1
  194. package/dist/pg-schema-snapshot/table-snapshot-constraints.mjs +1 -1
  195. package/dist/pg-schema-snapshot/table-snapshot.mjs +3 -3
  196. package/dist/pnpm-deploy/index.mjs +3 -3
  197. package/dist/pnpm-deploy/restore.mjs +1 -1
  198. package/dist/pnpm-install/exec.mjs +1 -1
  199. package/dist/pnpm-install/index.mjs +8 -8
  200. package/dist/pnpm-install/install-operations.mjs +6 -6
  201. package/dist/pnpm-install/metadata-legacy.mjs +1 -1
  202. package/dist/pnpm-install/metadata.d.mts +1 -1
  203. package/dist/pnpm-install/metadata.mjs +2 -2
  204. package/dist/pnpm-install/native-health.mjs +2 -2
  205. package/dist/pnpm-install/pnpm-install-fixture.test-helpers.mjs +2 -2
  206. package/dist/pnpm-install/runner.mjs +7 -7
  207. package/dist/post-publication-inventory/index.d.mts +6 -0
  208. package/dist/post-publication-inventory/index.mjs +6 -2
  209. package/dist/post-publication-inventory/readers/compose-appends.d.mts +7 -0
  210. package/dist/post-publication-inventory/readers/compose-appends.mjs +38 -0
  211. package/dist/post-publication-inventory/readers/composes.d.mts +2 -0
  212. package/dist/post-publication-inventory/readers/composes.mjs +79 -0
  213. package/dist/post-publication-inventory/readers/composition.d.mts +2 -0
  214. package/dist/post-publication-inventory/readers/composition.mjs +62 -0
  215. package/dist/post-publication-inventory/readers/public-boundary-ast.d.mts +5 -0
  216. package/dist/post-publication-inventory/readers/public-boundary-ast.mjs +33 -0
  217. package/dist/post-publication-inventory/readers/public-boundary-consumed.d.mts +3 -0
  218. package/dist/post-publication-inventory/readers/public-boundary-consumed.mjs +39 -0
  219. package/dist/post-publication-inventory/readers/public-boundary-dataflow.d.mts +3 -0
  220. package/dist/post-publication-inventory/readers/public-boundary-dataflow.mjs +61 -0
  221. package/dist/post-publication-inventory/readers/public-boundary-then.d.mts +9 -0
  222. package/dist/post-publication-inventory/readers/public-boundary-then.mjs +31 -0
  223. package/dist/post-publication-inventory/readers/public-boundary.d.mts +3 -0
  224. package/dist/post-publication-inventory/readers/public-boundary.mjs +71 -0
  225. package/dist/post-publication-inventory/readers/public-view-ast.d.mts +6 -0
  226. package/dist/post-publication-inventory/readers/public-view-ast.mjs +67 -0
  227. package/dist/post-publication-inventory/readers/public-view-options.d.mts +8 -0
  228. package/dist/post-publication-inventory/readers/public-view-protection.d.mts +2 -0
  229. package/dist/post-publication-inventory/readers/public-view-protection.mjs +83 -0
  230. package/dist/post-publication-inventory/readers/public-view.d.mts +2 -0
  231. package/dist/post-publication-inventory/readers/public-view.mjs +117 -0
  232. package/dist/post-publication-inventory/readers/source-ast.d.mts +30 -0
  233. package/dist/post-publication-inventory/readers/source-ast.mjs +52 -0
  234. package/dist/post-publication-inventory/readers/source-executors.d.mts +4 -0
  235. package/dist/post-publication-inventory/readers/source-executors.mjs +38 -0
  236. package/dist/post-publication-inventory/readers/source-helpers.d.mts +16 -0
  237. package/dist/post-publication-inventory/readers/source-helpers.mjs +72 -0
  238. package/dist/post-publication-inventory/readers/source-options.d.mts +8 -0
  239. package/dist/post-publication-inventory/readers/source-sql.d.mts +3 -0
  240. package/dist/post-publication-inventory/readers/source-sql.mjs +17 -0
  241. package/dist/post-publication-inventory/readers/sql-executors.mjs +2 -2
  242. package/dist/post-publication-inventory/readers/sql-source.mjs +3 -3
  243. package/dist/post-publication-inventory/readers/sql-template.mjs +1 -1
  244. package/dist/post-publication-inventory/writers/source.mjs +1 -1
  245. package/dist/retrospective-facts/coverage.mjs +1 -1
  246. package/dist/retrospective-facts/foreign.mjs +3 -3
  247. package/dist/retrospective-facts/index.mjs +4 -4
  248. package/dist/retrospective-facts/local.mjs +4 -4
  249. package/dist/retrospective-transcript/claude-blocks.mjs +1 -1
  250. package/dist/retrospective-transcript/claude.mjs +2 -2
  251. package/dist/retrospective-transcript/codex-messages.mjs +1 -1
  252. package/dist/retrospective-transcript/codex-payload.mjs +2 -2
  253. package/dist/retrospective-transcript/codex-records.mjs +3 -3
  254. package/dist/retrospective-transcript/codex-segment.mjs +1 -1
  255. package/dist/retrospective-transcript/codex.mjs +2 -2
  256. package/dist/retrospective-transcript/index.mjs +9 -9
  257. package/dist/retrospective-transcript/resolve-transcript-file.mjs +2 -2
  258. package/dist/scc-complexity/baseline.mjs +2 -2
  259. package/dist/scc-complexity/index.mjs +8 -8
  260. package/dist/scc-complexity/parser.mjs +1 -1
  261. package/dist/scc-complexity/scope-config.mjs +1 -1
  262. package/dist/session-friction/audit-block.mjs +1 -1
  263. package/dist/session-friction/ci-failures.mjs +2 -2
  264. package/dist/session-friction/classify.mjs +2 -2
  265. package/dist/session-friction/coverage-ledger.mjs +1 -1
  266. package/dist/session-friction/index.mjs +5 -5
  267. package/dist/session-friction/log-file.mjs +2 -2
  268. package/dist/session-friction/log.mjs +7 -7
  269. package/dist/session-friction/normalize.mjs +1 -1
  270. package/dist/session-friction/report.mjs +5 -5
  271. package/dist/session-friction/sandbox.mjs +1 -1
  272. package/dist/session-friction/session-id.mjs +1 -1
  273. package/dist/shared-context/index.mjs +1 -1
  274. package/dist/skill-discovery/index.mjs +3 -3
  275. package/dist/sql-ast/add-column.mjs +1 -1
  276. package/dist/sql-ast/constraint-do-block.mjs +2 -2
  277. package/dist/sql-ast/constraint-shared.mjs +1 -1
  278. package/dist/sql-ast/constraint.mjs +4 -4
  279. package/dist/sql-ast/create-table.mjs +2 -2
  280. package/dist/sql-ast/drop-index.mjs +2 -2
  281. package/dist/sql-ast/implicit-indexes.mjs +1 -1
  282. package/dist/sql-ast/index-metadata.mjs +3 -3
  283. package/dist/sql-ast/index.mjs +8 -8
  284. package/dist/sql-scanner/comments.mjs +1 -1
  285. package/dist/sql-scanner/index.mjs +3 -3
  286. package/dist/sql-scanner/literals.mjs +1 -1
  287. package/dist/swift-semantic-equal/cli.mjs +1 -1
  288. package/dist/swift-semantic-equal/index.mjs +1 -1
  289. package/dist/transient-retry/index.mjs +2 -2
  290. package/dist/vitest-blob-manifest/cli.mjs +2 -2
  291. package/dist/vitest-blob-manifest/index.mjs +4 -4
  292. package/dist/vitest-blob-manifest/report-attempt-cli.mjs +2 -2
  293. package/dist/vitest-blob-manifest/report-attempt.mjs +1 -1
  294. package/dist/vitest-blob-manifest/reports-cli.mjs +3 -3
  295. package/dist/vitest-blob-manifest/reports-source.mjs +2 -2
  296. package/dist/vitest-blob-manifest/reports.mjs +2 -2
  297. package/dist/vitest-diagnostics/index.mjs +8 -8
  298. package/dist/vitest-diagnostics/vitest-fork-exit-records.mjs +1 -1
  299. package/dist/vitest-diagnostics/vitest-fork-exit-sentinel.mjs +2 -2
  300. package/dist/vitest-diagnostics/vitest-fork-leak-detection.mjs +2 -2
  301. package/dist/vitest-diagnostics/vitest-worker-exit-diagnostics-reporter.mjs +2 -2
  302. package/dist/workflow-policy/condition-entailment.mjs +1 -1
  303. package/dist/workflow-policy/index.mjs +4 -4
  304. package/dist/workflow-policy/permission-inheritance.mjs +1 -1
  305. package/dist/workflow-policy/permission-mismatches.mjs +2 -2
  306. package/dist/workflow-policy/secret-readiness.mjs +2 -2
  307. package/dist/workspace-gates/first-party-graph.mjs +2 -2
  308. package/dist/workspace-gates/index.mjs +1 -1
  309. package/dist/workspace-gates/manifest-version-assertions.mjs +2 -2
  310. package/dist/workspace-gates/manifest-version-parser.mjs +1 -1
  311. package/dist/workspace-gates/options.mjs +1 -1
  312. package/dist/workspace-gates/policy.mjs +7 -7
  313. package/dist/workspace-gates/test-helpers.d.mts +2 -2
  314. package/package.json +3 -6
  315. package/dist/api-contract-discovery/header-contract-parser.d.mts +0 -3
  316. package/dist/api-contract-discovery/header-contract-parser.mjs +0 -93
  317. package/dist/api-contract-discovery/header-contract-registry.d.mts +0 -3
  318. package/dist/api-contract-discovery/header-contract-registry.mjs +0 -40
  319. package/dist/api-contract-discovery/header-contract-types.d.mts +0 -19
  320. package/dist/api-contract-discovery/index.d.mts +0 -34
  321. package/dist/api-contract-discovery/index.mjs +0 -27
  322. package/dist/api-contract-discovery/protocol-analysis-cache.d.mts +0 -21
  323. package/dist/api-contract-discovery/protocol-analysis-cache.mjs +0 -7
  324. package/dist/api-contract-discovery/protocol-body-status.d.mts +0 -2
  325. package/dist/api-contract-discovery/protocol-body-status.mjs +0 -4
  326. package/dist/api-contract-discovery/protocol-callback-argument-bindings.d.mts +0 -7
  327. package/dist/api-contract-discovery/protocol-callback-argument-bindings.mjs +0 -33
  328. package/dist/api-contract-discovery/protocol-callback-invocation.d.mts +0 -6
  329. package/dist/api-contract-discovery/protocol-callback-invocation.mjs +0 -111
  330. package/dist/api-contract-discovery/protocol-callback-mutations.d.mts +0 -5
  331. package/dist/api-contract-discovery/protocol-callback-mutations.mjs +0 -42
  332. package/dist/api-contract-discovery/protocol-callback-registration.d.mts +0 -3
  333. package/dist/api-contract-discovery/protocol-callback-registration.mjs +0 -27
  334. package/dist/api-contract-discovery/protocol-callback-values.d.mts +0 -18
  335. package/dist/api-contract-discovery/protocol-callback-values.mjs +0 -114
  336. package/dist/api-contract-discovery/protocol-context-alias.d.mts +0 -3
  337. package/dist/api-contract-discovery/protocol-context-alias.mjs +0 -20
  338. package/dist/api-contract-discovery/protocol-contract-extraction.d.mts +0 -9
  339. package/dist/api-contract-discovery/protocol-contract-extraction.mjs +0 -87
  340. package/dist/api-contract-discovery/protocol-contract-keys.d.mts +0 -1
  341. package/dist/api-contract-discovery/protocol-contract-keys.mjs +0 -8
  342. package/dist/api-contract-discovery/protocol-contract-registry.d.mts +0 -5
  343. package/dist/api-contract-discovery/protocol-contract-registry.mjs +0 -133
  344. package/dist/api-contract-discovery/protocol-executable-path.d.mts +0 -3
  345. package/dist/api-contract-discovery/protocol-executable-path.mjs +0 -64
  346. package/dist/api-contract-discovery/protocol-execution-path.d.mts +0 -4
  347. package/dist/api-contract-discovery/protocol-execution-path.mjs +0 -16
  348. package/dist/api-contract-discovery/protocol-http-association.d.mts +0 -7
  349. package/dist/api-contract-discovery/protocol-http-association.mjs +0 -108
  350. package/dist/api-contract-discovery/protocol-http-body-kinds.d.mts +0 -3
  351. package/dist/api-contract-discovery/protocol-http-body-kinds.mjs +0 -19
  352. package/dist/api-contract-discovery/protocol-http-context-callers.d.mts +0 -7
  353. package/dist/api-contract-discovery/protocol-http-context-callers.mjs +0 -40
  354. package/dist/api-contract-discovery/protocol-http-context-escapes.d.mts +0 -3
  355. package/dist/api-contract-discovery/protocol-http-context-escapes.mjs +0 -95
  356. package/dist/api-contract-discovery/protocol-http-context.d.mts +0 -8
  357. package/dist/api-contract-discovery/protocol-http-context.mjs +0 -85
  358. package/dist/api-contract-discovery/protocol-http-emission.d.mts +0 -3
  359. package/dist/api-contract-discovery/protocol-http-emission.mjs +0 -76
  360. package/dist/api-contract-discovery/protocol-http-implicit-taint.d.mts +0 -7
  361. package/dist/api-contract-discovery/protocol-http-implicit-taint.mjs +0 -26
  362. package/dist/api-contract-discovery/protocol-http-method-access.d.mts +0 -9
  363. package/dist/api-contract-discovery/protocol-http-method-access.mjs +0 -34
  364. package/dist/api-contract-discovery/protocol-http-method-mutations.d.mts +0 -3
  365. package/dist/api-contract-discovery/protocol-http-method-mutations.mjs +0 -31
  366. package/dist/api-contract-discovery/protocol-http-reflect.d.mts +0 -5
  367. package/dist/api-contract-discovery/protocol-http-reflect.mjs +0 -45
  368. package/dist/api-contract-discovery/protocol-http-registration.d.mts +0 -12
  369. package/dist/api-contract-discovery/protocol-http-registration.mjs +0 -53
  370. package/dist/api-contract-discovery/protocol-http-response-mutations.d.mts +0 -3
  371. package/dist/api-contract-discovery/protocol-http-response-mutations.mjs +0 -31
  372. package/dist/api-contract-discovery/protocol-marker-analysis.d.mts +0 -7
  373. package/dist/api-contract-discovery/protocol-marker-analysis.mjs +0 -50
  374. package/dist/api-contract-discovery/protocol-opaque-callback.d.mts +0 -3
  375. package/dist/api-contract-discovery/protocol-opaque-callback.mjs +0 -107
  376. package/dist/api-contract-discovery/protocol-platform-callbacks.d.mts +0 -7
  377. package/dist/api-contract-discovery/protocol-platform-callbacks.mjs +0 -76
  378. package/dist/api-contract-discovery/protocol-platform-mutation-targets.d.mts +0 -5
  379. package/dist/api-contract-discovery/protocol-platform-mutation-targets.mjs +0 -89
  380. package/dist/api-contract-discovery/protocol-platform-writes.d.mts +0 -3
  381. package/dist/api-contract-discovery/protocol-platform-writes.mjs +0 -92
  382. package/dist/api-contract-discovery/protocol-requested-keys.d.mts +0 -5
  383. package/dist/api-contract-discovery/protocol-requested-keys.mjs +0 -45
  384. package/dist/api-contract-discovery/protocol-sse-callers.d.mts +0 -7
  385. package/dist/api-contract-discovery/protocol-sse-callers.mjs +0 -67
  386. package/dist/api-contract-discovery/protocol-sse-emission.d.mts +0 -11
  387. package/dist/api-contract-discovery/protocol-sse-emission.mjs +0 -61
  388. package/dist/api-contract-discovery/protocol-sse-feasible-status.d.mts +0 -3
  389. package/dist/api-contract-discovery/protocol-sse-feasible-status.mjs +0 -24
  390. package/dist/api-contract-discovery/protocol-sse-raw-writes.d.mts +0 -9
  391. package/dist/api-contract-discovery/protocol-sse-raw-writes.mjs +0 -99
  392. package/dist/api-contract-discovery/protocol-sse-status.d.mts +0 -3
  393. package/dist/api-contract-discovery/protocol-sse-status.mjs +0 -84
  394. package/dist/api-contract-discovery/protocol-sse-write-access.d.mts +0 -9
  395. package/dist/api-contract-discovery/protocol-sse-write-access.mjs +0 -42
  396. package/dist/api-contract-discovery/protocol-sse-write-helpers.d.mts +0 -7
  397. package/dist/api-contract-discovery/protocol-sse-write-helpers.mjs +0 -82
  398. package/dist/api-contract-discovery/protocol-sse-write-mutations.d.mts +0 -9
  399. package/dist/api-contract-discovery/protocol-sse-write-mutations.mjs +0 -42
  400. package/dist/api-contract-discovery/protocol-sse-write-resolution.d.mts +0 -14
  401. package/dist/api-contract-discovery/protocol-sse-write-resolution.mjs +0 -79
  402. package/dist/api-contract-discovery/protocol-status-dominance.d.mts +0 -5
  403. package/dist/api-contract-discovery/protocol-status-dominance.mjs +0 -35
  404. package/dist/api-contract-discovery/protocol-write-receiver.d.mts +0 -9
  405. package/dist/api-contract-discovery/protocol-write-receiver.mjs +0 -79
  406. package/dist/api-contract-discovery/query-contract-extraction.d.mts +0 -3
  407. package/dist/api-contract-discovery/query-contract-extraction.mjs +0 -82
  408. package/dist/api-contract-discovery/query-contract-literals.d.mts +0 -13
  409. package/dist/api-contract-discovery/query-contract-literals.mjs +0 -83
  410. package/dist/api-contract-discovery/query-contract-registry.d.mts +0 -3
  411. package/dist/api-contract-discovery/query-contract-registry.mjs +0 -70
  412. package/dist/api-contract-discovery/query-contract-types.d.mts +0 -8
  413. package/dist/api-contract-discovery/registered-route-binding-writes.d.mts +0 -4
  414. package/dist/api-contract-discovery/registered-route-binding-writes.mjs +0 -47
  415. package/dist/api-contract-discovery/registered-route-catalog.d.mts +0 -10
  416. package/dist/api-contract-discovery/registered-route-catalog.mjs +0 -85
  417. package/dist/api-contract-discovery/registered-route-factory-returns.d.mts +0 -3
  418. package/dist/api-contract-discovery/registered-route-factory-returns.mjs +0 -29
  419. package/dist/api-contract-discovery/registered-route-handler-analysis.d.mts +0 -12
  420. package/dist/api-contract-discovery/registered-route-handler-analysis.mjs +0 -119
  421. package/dist/api-contract-discovery/registered-route-handler-helpers.d.mts +0 -3
  422. package/dist/api-contract-discovery/registered-route-handler-helpers.mjs +0 -16
  423. package/dist/api-contract-discovery/registered-route-runtime-parameters.d.mts +0 -3
  424. package/dist/api-contract-discovery/registered-route-runtime-parameters.mjs +0 -5
  425. package/dist/api-contract-discovery/registered-route-terminal-error.d.mts +0 -3
  426. package/dist/api-contract-discovery/registered-route-terminal-error.mjs +0 -98
  427. package/dist/api-contract-discovery/request-contract-implicit.d.mts +0 -17
  428. package/dist/api-contract-discovery/request-contract-implicit.mjs +0 -73
  429. package/dist/api-contract-discovery/request-contract-lenient.d.mts +0 -28
  430. package/dist/api-contract-discovery/request-contract-lenient.mjs +0 -59
  431. package/dist/api-contract-discovery/request-contract-registry.d.mts +0 -14
  432. package/dist/api-contract-discovery/request-contract-registry.mjs +0 -63
  433. package/dist/api-contract-discovery/request-contract-route-analysis.d.mts +0 -25
  434. package/dist/api-contract-discovery/request-contract-route-analysis.mjs +0 -68
  435. package/dist/api-contract-discovery/request-contract-types.d.mts +0 -12
  436. package/dist/api-contract-discovery/request-contract-types.mjs +0 -1
  437. package/dist/api-contract-discovery/request-validation-callbacks.d.mts +0 -9
  438. package/dist/api-contract-discovery/request-validation-callbacks.mjs +0 -27
  439. package/dist/api-contract-discovery/request-validation-checker.d.mts +0 -7
  440. package/dist/api-contract-discovery/request-validation-checker.mjs +0 -25
  441. package/dist/api-contract-discovery/request-validation-conditional.d.mts +0 -6
  442. package/dist/api-contract-discovery/request-validation-conditional.mjs +0 -31
  443. package/dist/api-contract-discovery/request-validation-factory-calls.d.mts +0 -11
  444. package/dist/api-contract-discovery/request-validation-factory-calls.mjs +0 -23
  445. package/dist/api-contract-discovery/request-validation-facts.d.mts +0 -16
  446. package/dist/api-contract-discovery/request-validation-facts.mjs +0 -64
  447. package/dist/api-contract-discovery/request-validation-follow.d.mts +0 -24
  448. package/dist/api-contract-discovery/request-validation-follow.mjs +0 -38
  449. package/dist/api-contract-discovery/request-validation-handler-state.d.mts +0 -8
  450. package/dist/api-contract-discovery/request-validation-handler-state.mjs +0 -35
  451. package/dist/api-contract-discovery/request-validation-input.d.mts +0 -12
  452. package/dist/api-contract-discovery/request-validation-input.mjs +0 -43
  453. package/dist/api-contract-discovery/request-validation-keys.d.mts +0 -25
  454. package/dist/api-contract-discovery/request-validation-keys.mjs +0 -119
  455. package/dist/api-contract-discovery/request-validation-match.d.mts +0 -11
  456. package/dist/api-contract-discovery/request-validation-match.mjs +0 -47
  457. package/dist/api-contract-discovery/request-validation-mutation.d.mts +0 -7
  458. package/dist/api-contract-discovery/request-validation-mutation.mjs +0 -80
  459. package/dist/api-contract-discovery/request-validation-origin.d.mts +0 -20
  460. package/dist/api-contract-discovery/request-validation-origin.mjs +0 -71
  461. package/dist/api-contract-discovery/request-validation-reads.d.mts +0 -13
  462. package/dist/api-contract-discovery/request-validation-reads.mjs +0 -88
  463. package/dist/api-contract-discovery/request-validation-registration.d.mts +0 -9
  464. package/dist/api-contract-discovery/request-validation-registration.mjs +0 -32
  465. package/dist/api-contract-discovery/request-validation-report.d.mts +0 -3
  466. package/dist/api-contract-discovery/request-validation-report.mjs +0 -21
  467. package/dist/api-contract-discovery/request-validation-request-origin.d.mts +0 -5
  468. package/dist/api-contract-discovery/request-validation-request-origin.mjs +0 -13
  469. package/dist/api-contract-discovery/request-validation-select.d.mts +0 -9
  470. package/dist/api-contract-discovery/request-validation-select.mjs +0 -36
  471. package/dist/api-contract-discovery/request-validation-sites.d.mts +0 -9
  472. package/dist/api-contract-discovery/request-validation-sites.mjs +0 -77
  473. package/dist/api-contract-discovery/request-validation-state-key.d.mts +0 -13
  474. package/dist/api-contract-discovery/request-validation-state-key.mjs +0 -30
  475. package/dist/api-contract-discovery/request-validation-trace-helpers.d.mts +0 -14
  476. package/dist/api-contract-discovery/request-validation-trace-helpers.mjs +0 -80
  477. package/dist/api-contract-discovery/request-validation-trace-select.d.mts +0 -23
  478. package/dist/api-contract-discovery/request-validation-trace-select.mjs +0 -45
  479. package/dist/api-contract-discovery/request-validation-trace.d.mts +0 -8
  480. package/dist/api-contract-discovery/request-validation-trace.mjs +0 -130
  481. package/dist/api-contract-discovery/request-validation-types.d.mts +0 -84
  482. package/dist/api-contract-discovery/request-validation-types.mjs +0 -1
  483. package/dist/api-contract-discovery/request-validation-walker.d.mts +0 -26
  484. package/dist/api-contract-discovery/request-validation-walker.mjs +0 -143
  485. package/dist/api-contract-discovery/request-validation.test-helpers.d.mts +0 -39
  486. package/dist/api-contract-discovery/request-validation.test-helpers.mjs +0 -108
  487. package/dist/api-contract-discovery/response-contract-attribution-facts.d.mts +0 -2
  488. package/dist/api-contract-discovery/response-contract-attribution-facts.mjs +0 -18
  489. package/dist/api-contract-discovery/response-contract-attribution.d.mts +0 -3
  490. package/dist/api-contract-discovery/response-contract-attribution.mjs +0 -23
  491. package/dist/api-contract-discovery/response-contract-call-classification.d.mts +0 -3
  492. package/dist/api-contract-discovery/response-contract-call-classification.mjs +0 -37
  493. package/dist/api-contract-discovery/response-contract-ctx-analysis.d.mts +0 -7
  494. package/dist/api-contract-discovery/response-contract-ctx-analysis.mjs +0 -28
  495. package/dist/api-contract-discovery/response-contract-error-branch.d.mts +0 -15
  496. package/dist/api-contract-discovery/response-contract-error-branch.mjs +0 -150
  497. package/dist/api-contract-discovery/response-contract-handler-bindings.d.mts +0 -3
  498. package/dist/api-contract-discovery/response-contract-handler-bindings.mjs +0 -126
  499. package/dist/api-contract-discovery/response-contract-handler-calls.d.mts +0 -3
  500. package/dist/api-contract-discovery/response-contract-handler-calls.mjs +0 -81
  501. package/dist/api-contract-discovery/response-contract-implicit-sources.test-helpers.d.mts +0 -145
  502. package/dist/api-contract-discovery/response-contract-implicit-sources.test-helpers.mjs +0 -145
  503. package/dist/api-contract-discovery/response-contract-implicit-variants.d.mts +0 -2
  504. package/dist/api-contract-discovery/response-contract-implicit-variants.mjs +0 -6
  505. package/dist/api-contract-discovery/response-contract-implicit.d.mts +0 -6
  506. package/dist/api-contract-discovery/response-contract-implicit.mjs +0 -120
  507. package/dist/api-contract-discovery/response-contract-lenient.d.mts +0 -41
  508. package/dist/api-contract-discovery/response-contract-lenient.mjs +0 -52
  509. package/dist/api-contract-discovery/response-contract-media.d.mts +0 -3
  510. package/dist/api-contract-discovery/response-contract-media.mjs +0 -46
  511. package/dist/api-contract-discovery/response-contract-object-symbols.d.mts +0 -3
  512. package/dist/api-contract-discovery/response-contract-object-symbols.mjs +0 -80
  513. package/dist/api-contract-discovery/response-contract-property-mutations.d.mts +0 -5
  514. package/dist/api-contract-discovery/response-contract-property-mutations.mjs +0 -84
  515. package/dist/api-contract-discovery/response-contract-registration.d.mts +0 -11
  516. package/dist/api-contract-discovery/response-contract-registration.mjs +0 -65
  517. package/dist/api-contract-discovery/response-contract-registry.d.mts +0 -7
  518. package/dist/api-contract-discovery/response-contract-registry.mjs +0 -124
  519. package/dist/api-contract-discovery/response-contract-route-analysis.d.mts +0 -12
  520. package/dist/api-contract-discovery/response-contract-route-analysis.mjs +0 -65
  521. package/dist/api-contract-discovery/response-contract-route-syntax.d.mts +0 -7
  522. package/dist/api-contract-discovery/response-contract-route-syntax.mjs +0 -41
  523. package/dist/api-contract-discovery/response-contract-status.d.mts +0 -27
  524. package/dist/api-contract-discovery/response-contract-status.mjs +0 -82
  525. package/dist/api-contract-discovery/response-contract-symbols.d.mts +0 -5
  526. package/dist/api-contract-discovery/response-contract-symbols.mjs +0 -82
  527. package/dist/api-contract-discovery/response-contract-types.d.mts +0 -23
  528. package/dist/api-contract-discovery/response-contract-types.mjs +0 -1
  529. package/dist/api-contract-discovery/test-setup.test-helpers.d.mts +0 -3
  530. package/dist/api-contract-discovery/test-setup.test-helpers.mjs +0 -2
  531. /package/dist/{api-contract-discovery/header-contract-types.mjs → post-publication-inventory/readers/public-view-options.mjs} +0 -0
  532. /package/dist/{api-contract-discovery/query-contract-types.mjs → post-publication-inventory/readers/source-options.mjs} +0 -0
@@ -1,47 +0,0 @@
1
- import ts from '../contract-schema/typescript-api.mjs';
2
- import { unwrapTransparentExpression } from './response-contract-route-syntax.mjs';
3
- import { attributionFunctionSymbol, resolveSymbol } from './response-contract-symbols.mjs';
4
- /** Resolves a callee through aliases and re-exports to the symbol it ultimately names. */
5
- export function calleeSymbol(callee, checker) {
6
- const target = unwrapTransparentExpression(callee);
7
- const name = ts.isPropertyAccessExpression(target) ? target.name : target;
8
- const symbol = ts.isIdentifier(name) ? checker.getSymbolAtLocation(name) : undefined;
9
- return symbol && resolveSymbol(symbol, checker);
10
- }
11
- const stripExtension = (path) => path.replace(/\.d\.[cm]?ts$/, '').replace(/\.[cm]?[jt]sx?$/, '');
12
- /** Compares extension-less paths, so `.ts`, `.js`, `.mts` and `.d.ts` spellings all agree. */
13
- function moduleMatches(fileName, module) {
14
- const path = fileName.replaceAll('\\', '/');
15
- return (path.includes(`/node_modules/${module}/`) ||
16
- stripExtension(path).endsWith(`/${stripExtension(module.replace(/^\.?\//, ''))}`));
17
- }
18
- /** True when the symbol is the configured export of a declaration file matching the module. */
19
- function matchesExport(symbol, config, checker) {
20
- return (symbol.declarations ?? []).some((declaration) => {
21
- const file = declaration.getSourceFile();
22
- if (!moduleMatches(file.fileName, config.module))
23
- return false;
24
- const moduleSymbol = checker.getSymbolAtLocation(file);
25
- const exported = moduleSymbol
26
- ? checker
27
- .getExportsOfModule(moduleSymbol)
28
- .find((item) => item.getName() === config.exportName)
29
- : undefined;
30
- return !!exported && resolveSymbol(exported, checker) === symbol;
31
- });
32
- }
33
- export function findConfig(callee, configs, checker) {
34
- const symbol = calleeSymbol(callee, checker);
35
- return symbol ? configs.find((config) => matchesExport(symbol, config, checker)) : undefined;
36
- }
37
- /** True when the node sits inside the implementation of a configured export. */
38
- export function insideConfiguredImplementation(node, configs, checker) {
39
- for (let current = node; current; current = current.parent) {
40
- const symbol = ts.isFunctionLike(current)
41
- ? attributionFunctionSymbol(current, checker)
42
- : undefined;
43
- if (symbol && configs.some((config) => matchesExport(symbol, config, checker)))
44
- return true;
45
- }
46
- return false;
47
- }
@@ -1,7 +0,0 @@
1
- import ts from '../contract-schema/typescript-api.mts';
2
- /**
3
- * True when a property of the const object an identifier names may have been written before the
4
- * use: in the use's own function, or anywhere in the declaring function or module when that
5
- * differs. `const` fixes the binding, not the object, so a written object is not its initializer.
6
- */
7
- export declare function hasPropertyWriteBefore(identifier: ts.Identifier, symbol: ts.Symbol, checker: ts.TypeChecker): boolean;
@@ -1,80 +0,0 @@
1
- import ts from '../contract-schema/typescript-api.mjs';
2
- import { unwrapTransparentExpression } from './response-contract-route-syntax.mjs';
3
- import { resolveSymbol } from './response-contract-symbols.mjs';
4
- const MUTATORS = new Set(['assign', 'defineProperty', 'defineProperties', 'setPrototypeOf']);
5
- const UPDATES = new Set([ts.SyntaxKind.PlusPlusToken, ts.SyntaxKind.MinusMinusToken]);
6
- /**
7
- * Property-write start positions per symbol, per function (or source file). Symbols belong to one
8
- * checker, so the memo is keyed by checker and never leaks between programs.
9
- */
10
- const writesByChecker = new WeakMap();
11
- const isMember = (node) => ts.isPropertyAccessExpression(node) || ts.isElementAccessExpression(node);
12
- /** The identifier an `a.b[c]` chain starts from, through parentheses, `!` and `as`. */
13
- function rootIdentifier(target) {
14
- let current = unwrapTransparentExpression(target);
15
- while (isMember(current))
16
- current = unwrapTransparentExpression(current.expression);
17
- return ts.isIdentifier(current) ? current : undefined;
18
- }
19
- /** The object a node writes a property of: `o.p = v`, `delete o.p`, `o.p++`, `Object.assign(o)`. */
20
- function mutatedObject(node) {
21
- let target;
22
- if (ts.isBinaryExpression(node) &&
23
- node.operatorToken.kind >= ts.SyntaxKind.FirstAssignment &&
24
- node.operatorToken.kind <= ts.SyntaxKind.LastAssignment)
25
- target = node.left;
26
- else if (ts.isDeleteExpression(node))
27
- target = node.expression;
28
- else if ((ts.isPrefixUnaryExpression(node) || ts.isPostfixUnaryExpression(node)) &&
29
- UPDATES.has(node.operator))
30
- target = node.operand;
31
- if (target)
32
- return isMember(target) ? rootIdentifier(target) : undefined;
33
- const callee = ts.isCallExpression(node) ? node.expression : undefined;
34
- const mutates = callee &&
35
- ts.isPropertyAccessExpression(callee) &&
36
- ts.isIdentifier(callee.expression) &&
37
- callee.expression.text === 'Object' &&
38
- MUTATORS.has(callee.name.text);
39
- const [first] = mutates ? node.arguments : [];
40
- return first ? rootIdentifier(first) : undefined;
41
- }
42
- function propertyWrites(scope, checker) {
43
- const scopes = writesByChecker.get(checker) ?? new WeakMap();
44
- writesByChecker.set(checker, scopes);
45
- const cached = scopes.get(scope);
46
- if (cached)
47
- return cached;
48
- const found = new Map();
49
- const scan = (node) => {
50
- if (node !== scope && ts.isFunctionLike(node))
51
- return;
52
- const object = mutatedObject(node);
53
- const symbol = object && checker.getSymbolAtLocation(object);
54
- if (symbol)
55
- found.set(symbol, [...(found.get(symbol) ?? []), node.getStart()]);
56
- ts.forEachChild(node, scan);
57
- };
58
- scan(scope);
59
- scopes.set(scope, found);
60
- return found;
61
- }
62
- function ownerOf(node) {
63
- let current = node.parent;
64
- while (current && !ts.isFunctionLike(current))
65
- current = current.parent;
66
- return current ?? node.getSourceFile();
67
- }
68
- /**
69
- * True when a property of the const object an identifier names may have been written before the
70
- * use: in the use's own function, or anywhere in the declaring function or module when that
71
- * differs. `const` fixes the binding, not the object, so a written object is not its initializer.
72
- */
73
- export function hasPropertyWriteBefore(identifier, symbol, checker) {
74
- const resolved = resolveSymbol(symbol, checker);
75
- const useScope = ownerOf(identifier);
76
- const declaration = resolved.declarations.find(ts.isVariableDeclaration);
77
- return [...new Set([useScope, ownerOf(declaration)])].some((scope) => [symbol, resolved].some((candidate) => propertyWrites(scope, checker)
78
- .get(candidate)
79
- ?.some((start) => scope !== useScope || start < identifier.getStart())));
80
- }
@@ -1,20 +0,0 @@
1
- import ts from '../contract-schema/typescript-api.mts';
2
- import type { Carrier } from './request-validation-types.mts';
3
- /** What a value is relative to the handler's request context. */
4
- export type RootKind = 'context' | 'request' | 'query' | 'path' | 'header';
5
- /** A value bound to a parameter at a call site, with the request carriers it derives from. */
6
- export type Bound = {
7
- kind?: RootKind | undefined;
8
- origins: readonly Carrier[];
9
- unresolved?: string | undefined;
10
- /** The argument expression the call passed, for resolving object literals through it. */
11
- expression?: ts.Expression | undefined;
12
- };
13
- export type RootBindings = ReadonlyMap<ts.Symbol, Bound>;
14
- /** The carrier object a named member of a context or request object denotes. */
15
- export declare function memberKind(base: RootKind | undefined, name: string): RootKind | undefined;
16
- export declare function rootKind(expression: ts.Expression, roots: RootBindings, checker: ts.TypeChecker, seen?: Set<ts.Symbol>): RootKind | undefined;
17
- /** `X.request.json()` and its siblings, where X is the request context. */
18
- export declare function isBodyRead(call: ts.CallExpression, roots: RootBindings, checker: ts.TypeChecker): boolean;
19
- /** `ctx.get(name)`. */
20
- export declare function isHeaderGet(call: ts.CallExpression, roots: RootBindings, checker: ts.TypeChecker): boolean;
@@ -1,71 +0,0 @@
1
- import ts from '../contract-schema/typescript-api.mjs';
2
- import { identifierSymbol } from './request-validation-keys.mjs';
3
- import { unwrapTransparentExpression } from './response-contract-route-syntax.mjs';
4
- const BODY_READERS = new Set(['json', 'text', 'buffer', 'formData', 'arrayBuffer', 'blob']);
5
- /** The carrier object a named member of a context or request object denotes. */
6
- export function memberKind(base, name) {
7
- if (base === 'context' && (name === 'request' || name === 'req'))
8
- return 'request';
9
- if ((base === 'context' || base === 'request') && name === 'query')
10
- return 'query';
11
- if (base === 'context' && name === 'params')
12
- return 'path';
13
- if ((base === 'context' || base === 'request') && (name === 'headers' || name === 'header'))
14
- return 'header';
15
- return undefined;
16
- }
17
- /** The const initializer an identifier aliases, with the destructured key when it is a member. */
18
- function aliasSource(symbol) {
19
- for (const declaration of symbol.declarations ?? []) {
20
- const owner = ts.isBindingElement(declaration) ? declaration.parent.parent : declaration;
21
- if (!ts.isVariableDeclaration(owner) ||
22
- !owner.initializer ||
23
- !(ts.getCombinedNodeFlags(owner) & ts.NodeFlags.Const))
24
- continue;
25
- if (!ts.isBindingElement(declaration))
26
- return { initializer: owner.initializer };
27
- const name = declaration.propertyName ?? declaration.name;
28
- const member = ts.isObjectBindingPattern(declaration.parent) && !declaration.dotDotDotToken;
29
- const named = ts.isIdentifier(name) || ts.isStringLiteral(name);
30
- return { initializer: owner.initializer, key: member && named ? name.text : null };
31
- }
32
- return undefined;
33
- }
34
- export function rootKind(expression, roots, checker, seen = new Set()) {
35
- const value = unwrapTransparentExpression(expression);
36
- if (ts.isPropertyAccessExpression(value))
37
- return memberKind(rootKind(value.expression, roots, checker, seen), value.name.text);
38
- if (ts.isElementAccessExpression(value))
39
- return ts.isStringLiteralLike(value.argumentExpression)
40
- ? memberKind(rootKind(value.expression, roots, checker, seen), value.argumentExpression.text)
41
- : undefined;
42
- if (!ts.isIdentifier(value))
43
- return undefined;
44
- const symbol = identifierSymbol(value, checker);
45
- if (!symbol || seen.has(symbol))
46
- return undefined;
47
- const bound = roots.get(symbol);
48
- if (bound)
49
- return bound.kind;
50
- const alias = aliasSource(symbol);
51
- if (!alias)
52
- return undefined;
53
- const base = rootKind(alias.initializer, roots, checker, new Set(seen).add(symbol));
54
- if (alias.key === undefined)
55
- return base;
56
- return alias.key === null ? undefined : memberKind(base, alias.key);
57
- }
58
- /** `X.request.json()` and its siblings, where X is the request context. */
59
- export function isBodyRead(call, roots, checker) {
60
- const callee = unwrapTransparentExpression(call.expression);
61
- return (ts.isPropertyAccessExpression(callee) &&
62
- BODY_READERS.has(callee.name.text) &&
63
- rootKind(callee.expression, roots, checker) === 'request');
64
- }
65
- /** `ctx.get(name)`. */
66
- export function isHeaderGet(call, roots, checker) {
67
- const callee = unwrapTransparentExpression(call.expression);
68
- return (ts.isPropertyAccessExpression(callee) &&
69
- callee.name.text === 'get' &&
70
- rootKind(callee.expression, roots, checker) === 'context');
71
- }
@@ -1,13 +0,0 @@
1
- import ts from '../contract-schema/typescript-api.mts';
2
- import { type KeyBindings } from './request-validation-keys.mts';
3
- import { type RootBindings } from './request-validation-origin.mts';
4
- import type { CarrierRead } from './request-validation-types.mts';
5
- export type RawRead = Omit<CarrierRead, 'source'>;
6
- type Scope = {
7
- checker: ts.TypeChecker;
8
- roots: RootBindings;
9
- keys: KeyBindings;
10
- };
11
- /** The raw request reads made by exactly this node, not by its children. */
12
- export declare function rawReadsAt(node: ts.Node, scope: Scope): RawRead[];
13
- export {};
@@ -1,88 +0,0 @@
1
- import ts from '../contract-schema/typescript-api.mjs';
2
- import { resolveKey } from './request-validation-keys.mjs';
3
- import { isBodyRead, isHeaderGet, rootKind, } from './request-validation-origin.mjs';
4
- const carrierRoot = (node, scope) => {
5
- const kind = rootKind(node, scope.roots, scope.checker);
6
- return kind === 'query' || kind === 'path' || kind === 'header' ? kind : undefined;
7
- };
8
- const isTransparent = (node) => ts.isParenthesizedExpression(node) ||
9
- ts.isAsExpression(node) ||
10
- ts.isNonNullExpression(node) ||
11
- ts.isSatisfiesExpression(node) ||
12
- ts.isTypeAssertionExpression(node);
13
- /** True when an identifier sits where it declares or names a property rather than reads a value. */
14
- function namesSomething(node) {
15
- const { name, propertyName } = node.parent;
16
- return (name === node && !ts.isShorthandPropertyAssignment(node.parent)) || propertyName === node;
17
- }
18
- /** True when the carrier expression is consumed as a value, not indexed, aliased or destructured. */
19
- function consumedAsValue(node) {
20
- if (ts.isIdentifier(node) && namesSomething(node))
21
- return false;
22
- let outer = node;
23
- while (isTransparent(outer.parent))
24
- outer = outer.parent;
25
- const parent = outer.parent;
26
- if (ts.isPropertyAccessExpression(parent) || ts.isElementAccessExpression(parent))
27
- return parent.expression !== outer;
28
- if (ts.isVariableDeclaration(parent) && parent.initializer === outer)
29
- return !(ts.isObjectBindingPattern(parent.name) ||
30
- (ts.isIdentifier(parent.name) && !!(ts.getCombinedNodeFlags(parent) & ts.NodeFlags.Const)));
31
- return !ts.isExpressionStatement(parent);
32
- }
33
- /** A whole-carrier read: the carrier object itself used as a value, as in `consume(ctx.query)`. */
34
- function wholeRead(node, scope) {
35
- if (!ts.isExpression(node) || isTransparent(node))
36
- return [];
37
- const carrier = carrierRoot(node, scope);
38
- return carrier && consumedAsValue(node) ? [{ carrier, key: null, access: 'whole' }] : [];
39
- }
40
- function destructuredRead(element, carrier) {
41
- const name = element.propertyName ?? element.name;
42
- if (element.dotDotDotToken)
43
- return { carrier, key: null, access: 'whole' };
44
- if (ts.isIdentifier(name) || ts.isStringLiteral(name))
45
- return { carrier, key: name.text, access: 'key' };
46
- return { carrier, key: null, access: 'computed' };
47
- }
48
- /** True for the target of a plain assignment or `delete`, which replaces without reading. */
49
- function isWriteTarget(node) {
50
- let outer = node;
51
- while (isTransparent(outer.parent))
52
- outer = outer.parent;
53
- const parent = outer.parent;
54
- return (ts.isDeleteExpression(parent) ||
55
- (ts.isBinaryExpression(parent) &&
56
- parent.operatorToken.kind === ts.SyntaxKind.EqualsToken &&
57
- parent.left === outer));
58
- }
59
- /** The raw request reads made by exactly this node, not by its children. */
60
- export function rawReadsAt(node, scope) {
61
- const keyed = (carrier, expression) => {
62
- const key = resolveKey(expression, scope.checker, scope.keys) ?? null;
63
- return { carrier, key, access: key === null ? 'computed' : 'key' };
64
- };
65
- if (ts.isCallExpression(node)) {
66
- if (isBodyRead(node, scope.roots, scope.checker))
67
- return [{ carrier: 'body', key: null, access: 'whole' }];
68
- return isHeaderGet(node, scope.roots, scope.checker) ? [keyed('header', node.arguments[0])] : [];
69
- }
70
- if ((ts.isPropertyAccessExpression(node) || ts.isElementAccessExpression(node)) &&
71
- isWriteTarget(node))
72
- return [];
73
- if (ts.isPropertyAccessExpression(node)) {
74
- const carrier = carrierRoot(node.expression, scope);
75
- if (carrier)
76
- return [{ carrier, key: node.name.text, access: 'key' }];
77
- }
78
- if (ts.isElementAccessExpression(node)) {
79
- const carrier = carrierRoot(node.expression, scope);
80
- if (carrier)
81
- return [keyed(carrier, node.argumentExpression)];
82
- }
83
- if (ts.isVariableDeclaration(node) && ts.isObjectBindingPattern(node.name) && node.initializer) {
84
- const carrier = carrierRoot(node.initializer, scope);
85
- return carrier ? node.name.elements.map((element) => destructuredRead(element, carrier)) : [];
86
- }
87
- return wholeRead(node, scope);
88
- }
@@ -1,9 +0,0 @@
1
- import ts from '../contract-schema/typescript-api.mts';
2
- import { type Scope } from './request-validation-follow.mts';
3
- import { type WalkState } from './request-validation-state-key.mts';
4
- /**
5
- * Finds configured factory calls in registration-time expressions, without entering handlers.
6
- * Validators evaluated here run while the handler is built, not per request, so only the walk of
7
- * the handler itself reports them.
8
- */
9
- export declare function createRegistrationScanner(scopeOf: (state: WalkState) => Scope, reportFactory: (call: ts.CallExpression, state: WalkState) => boolean): (node: ts.Node, state?: WalkState) => void;
@@ -1,32 +0,0 @@
1
- import ts from '../contract-schema/typescript-api.mjs';
2
- import { followedImplementations } from './request-validation-follow.mjs';
3
- import { bindArguments } from './request-validation-trace.mjs';
4
- import { returnedValues } from './request-validation-trace-helpers.mjs';
5
- import { emptyState } from './request-validation-state-key.mjs';
6
- /**
7
- * Finds configured factory calls in registration-time expressions, without entering handlers.
8
- * Validators evaluated here run while the handler is built, not per request, so only the walk of
9
- * the handler itself reports them.
10
- */
11
- export function createRegistrationScanner(scopeOf, reportFactory) {
12
- const scanning = new Set();
13
- function scan(node, state = emptyState) {
14
- if (ts.isFunctionLike(node))
15
- return;
16
- if (ts.isCallExpression(node) && reportFactory(node, state))
17
- return;
18
- if (ts.isCallExpression(node))
19
- // A helper that builds the handler: follow its returned values with bound arguments.
20
- for (const fn of followedImplementations(node, scopeOf(state))) {
21
- if (scanning.has(fn))
22
- continue;
23
- scanning.add(fn);
24
- const { keys, roots } = bindArguments(fn, node, scopeOf(state));
25
- for (const value of returnedValues(fn))
26
- scan(value, { ...state, keys, roots });
27
- scanning.delete(fn);
28
- }
29
- ts.forEachChild(node, (child) => scan(child, state));
30
- }
31
- return scan;
32
- }
@@ -1,3 +0,0 @@
1
- import type ts from '../contract-schema/typescript-api.mts';
2
- /** Collects facts once per originating AST node and fact; a repeat returns the fact reported. */
3
- export declare function createReporter(): <T extends object>(kind: string, target: T[], item: T, node?: ts.Node, identity?: object) => T;
@@ -1,21 +0,0 @@
1
- /** Collects facts once per originating AST node and fact; a repeat returns the fact reported. */
2
- export function createReporter() {
3
- const reported = new Map();
4
- const nodeIds = new Map();
5
- const nodeId = (node) => {
6
- if (!node)
7
- return '';
8
- if (!nodeIds.has(node))
9
- nodeIds.set(node, nodeIds.size);
10
- return nodeIds.get(node);
11
- };
12
- return (kind, target, item, node, identity = item) => {
13
- const key = `${kind}${nodeId(node)}${JSON.stringify(identity)}`;
14
- const existing = reported.get(key);
15
- if (existing)
16
- return existing;
17
- reported.set(key, item);
18
- target.push(item);
19
- return item;
20
- };
21
- }
@@ -1,5 +0,0 @@
1
- import ts from '../contract-schema/typescript-api.mts';
2
- import { type RootBindings } from './request-validation-origin.mts';
3
- import type { Carrier } from './request-validation-types.mts';
4
- /** The carrier a node reads directly from the request context, if it is such a read. */
5
- export declare function requestOrigin(node: ts.Node, roots: RootBindings, checker: ts.TypeChecker): Carrier | undefined;
@@ -1,13 +0,0 @@
1
- import ts from '../contract-schema/typescript-api.mjs';
2
- import { isBodyRead, isHeaderGet, rootKind, } from './request-validation-origin.mjs';
3
- /** The carrier a node reads directly from the request context, if it is such a read. */
4
- export function requestOrigin(node, roots, checker) {
5
- const kind = ts.isExpression(node) ? rootKind(node, roots, checker) : undefined;
6
- if (kind === 'query' || kind === 'path' || kind === 'header')
7
- return kind;
8
- if (!ts.isCallExpression(node))
9
- return undefined;
10
- if (isBodyRead(node, roots, checker))
11
- return 'body';
12
- return isHeaderGet(node, roots, checker) ? 'header' : undefined;
13
- }
@@ -1,9 +0,0 @@
1
- import ts from '../contract-schema/typescript-api.mts';
2
- import type { Scope } from './request-validation-follow.mts';
3
- /** The property name or array position a destructured binding selects, when it is static. */
4
- export declare function bindingKey(element: ts.BindingElement): string | number | undefined;
5
- /**
6
- * The expression a literal (or a const naming one) holds at a property or position: `null` when
7
- * nothing is there, `undefined` when it cannot be resolved statically.
8
- */
9
- export declare function literalMember(node: ts.Node, key: string | number, scope: Scope, seen?: Set<ts.Node>): ts.Expression | null | undefined;
@@ -1,36 +0,0 @@
1
- import ts from '../contract-schema/typescript-api.mjs';
2
- import { ABSENT, findProperty, stableConstInitializer } from './request-validation-keys.mjs';
3
- import { unwrapTransparentExpression } from './response-contract-route-syntax.mjs';
4
- /** The property name or array position a destructured binding selects, when it is static. */
5
- export function bindingKey(element) {
6
- if (element.dotDotDotToken)
7
- return undefined;
8
- if (ts.isArrayBindingPattern(element.parent))
9
- return element.parent.elements.indexOf(element);
10
- const name = element.propertyName ?? element.name;
11
- return ts.isIdentifier(name) || ts.isStringLiteral(name) ? name.text : undefined;
12
- }
13
- /**
14
- * The expression a literal (or a const naming one) holds at a property or position: `null` when
15
- * nothing is there, `undefined` when it cannot be resolved statically.
16
- */
17
- export function literalMember(node, key, scope, seen = new Set()) {
18
- const value = unwrapTransparentExpression(node);
19
- if (seen.has(value))
20
- return undefined;
21
- if (ts.isIdentifier(value)) {
22
- const initializer = stableConstInitializer(value, scope.checker);
23
- return initializer && literalMember(initializer, key, scope, new Set(seen).add(value));
24
- }
25
- if (typeof key === 'number') {
26
- if (!ts.isArrayLiteralExpression(value))
27
- return undefined;
28
- if (value.elements.slice(0, key + 1).some(ts.isSpreadElement))
29
- return undefined;
30
- return value.elements[key] ?? null;
31
- }
32
- if (!ts.isObjectLiteralExpression(value))
33
- return undefined;
34
- const found = findProperty(value, key, scope.checker, scope.roots, new Set([value]));
35
- return found === ABSENT ? null : found;
36
- }
@@ -1,9 +0,0 @@
1
- import ts from '../contract-schema/typescript-api.mts';
2
- import type { Scope } from './request-validation-follow.mts';
3
- import { type FactoryConfig, type FactorySite, type ValidatorConfig, type ValidatorSite } from './request-validation-types.mts';
4
- export declare function sourceOf(node: ts.Node): string;
5
- export declare function validatorSite(call: ts.CallExpression, config: ValidatorConfig, scope: Scope, conditional: boolean): {
6
- site: ValidatorSite;
7
- inputNodes: ts.Node[];
8
- };
9
- export declare function factorySite(call: ts.CallExpression, config: FactoryConfig, scope: Scope, conditional: boolean): FactorySite;
@@ -1,77 +0,0 @@
1
- import ts from '../contract-schema/typescript-api.mjs';
2
- import { ABSENT, findProperty, resolveKey, resolveObject, resolveOptionString, } from './request-validation-keys.mjs';
3
- import { unwrapTransparentExpression } from './response-contract-route-syntax.mjs';
4
- import { resolveInput } from './request-validation-input.mjs';
5
- import {} from './request-validation-types.mjs';
6
- export function sourceOf(node) {
7
- const file = node.getSourceFile();
8
- return `${file.fileName}:${file.getLineAndCharacterOfPosition(node.getStart()).line + 1}`;
9
- }
10
- /** Whether the options object ends with `property: true`, applying spreads in order. */
11
- function optionEnabled(options, property, scope) {
12
- if (!options)
13
- return { enabled: false };
14
- const object = resolveObject(options, scope.checker, scope.roots);
15
- if (!object)
16
- return {
17
- enabled: false,
18
- unresolved: `options \`${options.getText()}\` are not statically resolvable`,
19
- };
20
- const found = findProperty(object, property, scope.checker, scope.roots, new Set([object]));
21
- if (found === undefined)
22
- return { enabled: false, unresolved: `option "${property}" is not statically resolvable` };
23
- return {
24
- enabled: found !== ABSENT && unwrapTransparentExpression(found).kind === ts.SyntaxKind.TrueKeyword,
25
- };
26
- }
27
- function fixedInput(config, call, scope) {
28
- const options = (config.optionCarriers ?? []).map((option) => ({
29
- option,
30
- ...optionEnabled(call.arguments[option.argument], option.property, scope),
31
- }));
32
- const added = options.filter((item) => item.enabled).map((item) => item.option.carrier);
33
- const unresolved = options.find((item) => item.unresolved)?.unresolved;
34
- return {
35
- carriers: [...new Set([...config.carriers, ...added])].map((carrier) => ({
36
- carrier,
37
- origins: [carrier],
38
- })),
39
- ...(unresolved && { unresolved }),
40
- nodes: [],
41
- };
42
- }
43
- export function validatorSite(call, config, scope, conditional) {
44
- const argument = call.arguments[config.operationArgument];
45
- const operation = resolveKey(argument, scope.checker, scope.keys) ?? null;
46
- const input = config.carriers.kind === 'input-object'
47
- ? resolveInput(call.arguments[config.carriers.argument], scope)
48
- : fixedInput(config.carriers, call, scope);
49
- const site = {
50
- exportName: config.exportName,
51
- source: sourceOf(call),
52
- operation,
53
- ...(operation === null && { unresolvedReason: unresolved(argument) }),
54
- carriers: input.carriers,
55
- ...(input.unresolved && { unresolvedCarriers: input.unresolved }),
56
- conditional,
57
- };
58
- return { site, inputNodes: input.nodes };
59
- }
60
- export function factorySite(call, config, scope, conditional) {
61
- const operation = resolveOptionString(call.arguments[config.optionsArgument], config.operationProperty, scope.checker, scope.keys, scope.roots) ?? null;
62
- return {
63
- exportName: config.exportName,
64
- source: sourceOf(call),
65
- operation,
66
- ...(operation === null && {
67
- unresolvedReason: `option "${config.operationProperty}" is not statically resolvable`,
68
- }),
69
- carriers: [...config.carriers],
70
- conditional,
71
- };
72
- }
73
- function unresolved(argument) {
74
- return argument
75
- ? `operation key \`${argument.getText()}\` is not statically resolvable`
76
- : 'operation argument is missing';
77
- }
@@ -1,13 +0,0 @@
1
- import type ts from '../contract-schema/typescript-api.mts';
2
- import type { KeyBindings } from './request-validation-keys.mts';
3
- import type { RootBindings } from './request-validation-origin.mts';
4
- export type WalkState = {
5
- keys: KeyBindings;
6
- roots: RootBindings;
7
- conditional: boolean;
8
- /** The calls this walk was entered through, innermost last; a call may build a validator input. */
9
- via: ReadonlySet<ts.Node>;
10
- };
11
- export declare const emptyState: WalkState;
12
- /** A stable identity for the bindings a function is walked with, used to stop repeat walks. */
13
- export declare function createStateKey(): (state: WalkState) => string;
@@ -1,30 +0,0 @@
1
- export const emptyState = {
2
- keys: new Map(),
3
- roots: new Map(),
4
- conditional: false,
5
- via: new Set(),
6
- };
7
- /** A stable identity for the bindings a function is walked with, used to stop repeat walks. */
8
- export function createStateKey() {
9
- const symbolIds = new Map();
10
- const symbolId = (symbol) => {
11
- if (!symbolIds.has(symbol))
12
- symbolIds.set(symbol, symbolIds.size);
13
- return symbolIds.get(symbol);
14
- };
15
- const nodeIds = new Map();
16
- const nodeId = (node) => {
17
- if (!nodeIds.has(node))
18
- nodeIds.set(node, nodeIds.size);
19
- return nodeIds.get(node);
20
- };
21
- const bound = (value) => JSON.stringify(value, (name, item) => name === 'expression' ? nodeId(item) : item);
22
- return (state) => [
23
- ...[...state.keys].map(([symbol, value]) => JSON.stringify(['k', symbolId(symbol), value])),
24
- ...[...state.roots].map(([symbol, value]) => bound(['r', symbolId(symbol), value])),
25
- JSON.stringify(state.conditional),
26
- JSON.stringify([...state.via].map(nodeId).toSorted((left, right) => left - right)),
27
- ]
28
- .toSorted((left, right) => left.localeCompare(right))
29
- .join('|');
30
- }
@@ -1,14 +0,0 @@
1
- import ts from '../contract-schema/typescript-api.mts';
2
- import type { ProtocolCache } from './protocol-analysis-cache.mts';
3
- import type { Followable } from './request-validation-follow.mts';
4
- /**
5
- * The assignments that can supply a value at the use: property writes, plus reassignments of the
6
- * identifier itself made earlier in the same function. An unconditional reassignment replaces
7
- * everything before it, including the initializer; conditional ones merge.
8
- */
9
- export declare function reachingWrites(use: ts.Node, symbol: ts.Symbol, checker: ts.TypeChecker, cache?: ProtocolCache): {
10
- writes: ts.Expression[];
11
- initializer: boolean;
12
- };
13
- /** Returned expressions of a function, including an arrow function's expression body. */
14
- export declare function returnedValues(fn: Followable): ts.Node[];