@jimhoyd/urlcode 0.3.0 → 0.4.0-alpha.2

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 (380) hide show
  1. package/.claude/skills/urlcode-authoring/SKILL.md +122 -0
  2. package/.claude/skills/urlcode-operations/SKILL.md +108 -0
  3. package/.claude-plugin/marketplace.json +18 -0
  4. package/CONTRIBUTING.md +30 -2
  5. package/README.md +195 -255
  6. package/ROADMAP.md +143 -15
  7. package/SECURITY.md +31 -9
  8. package/dist/BUILD-MANIFEST.json +72 -47
  9. package/dist/adapters.js +4 -23
  10. package/dist/agent-lists.js +1 -1
  11. package/dist/agents-guide.js +113 -0
  12. package/dist/authoring-files.js +60 -0
  13. package/dist/authoring.js +11 -1
  14. package/dist/aws.js +4 -3
  15. package/dist/build-cloudflare.js +11 -24
  16. package/dist/build-static.js +134 -0
  17. package/dist/bulk.js +37 -0
  18. package/dist/capabilities.js +262 -0
  19. package/dist/capability-query.js +71 -0
  20. package/dist/catalog.js +105 -0
  21. package/dist/cli.js +165 -34
  22. package/dist/client-address.js +1 -1
  23. package/dist/compliance-rules/baseline.js +9 -17
  24. package/dist/compliance-rules/privacy.js +7 -18
  25. package/dist/compliance-rules/shared.js +0 -2
  26. package/dist/compliance-rules/strict.js +5 -5
  27. package/dist/compliance.js +6 -8
  28. package/dist/conditions.js +88 -0
  29. package/dist/config.js +69 -6
  30. package/dist/context.js +155 -0
  31. package/dist/ecosystem-cli.js +88 -0
  32. package/dist/egress.js +98 -0
  33. package/dist/examples.js +92 -0
  34. package/dist/explain-cli.js +64 -0
  35. package/dist/explain.js +131 -0
  36. package/dist/extensions.js +231 -0
  37. package/dist/function-sources.js +49 -5
  38. package/dist/function-worker.js +3 -1
  39. package/dist/functions.js +84 -13
  40. package/dist/guest-api.js +29 -3
  41. package/dist/index.js +40 -6
  42. package/dist/init-with.js +165 -0
  43. package/dist/interchange-cli.js +42 -0
  44. package/dist/interchange.js +189 -0
  45. package/dist/manifest.js +109 -0
  46. package/dist/match.js +2 -2
  47. package/dist/mcp-authoring.js +147 -0
  48. package/dist/mcp.js +97 -0
  49. package/dist/observability.js +7 -21
  50. package/dist/operator-host.js +29 -0
  51. package/dist/plugins.js +12 -0
  52. package/dist/policies/agents.js +2 -2
  53. package/dist/policies/cache.js +8 -3
  54. package/dist/policies/compression.js +2 -1
  55. package/dist/policies/security.js +0 -0
  56. package/dist/policies.js +1 -1
  57. package/dist/policy.js +56 -15
  58. package/dist/prerender.js +100 -41
  59. package/dist/project-tests.js +3 -3
  60. package/dist/provider-verification.js +92 -0
  61. package/dist/proxy.js +44 -0
  62. package/dist/readiness.js +34 -11
  63. package/dist/recipes.js +41 -0
  64. package/dist/route-diff.js +106 -0
  65. package/dist/router.js +45 -7
  66. package/dist/runtime.js +164 -64
  67. package/dist/sandbox.js +48 -0
  68. package/dist/scaffold.js +0 -0
  69. package/dist/schema-query.js +62 -0
  70. package/dist/scripts/operational-drills.js +12 -54
  71. package/dist/server.js +3 -29
  72. package/dist/signals.js +24 -0
  73. package/dist/site.js +0 -0
  74. package/dist/tooling.js +96 -0
  75. package/dist/trusted-functions.js +210 -0
  76. package/dist/types/adapters.d.ts +7 -4
  77. package/dist/types/agent-lists.d.ts +0 -1
  78. package/dist/types/agents-guide.d.ts +17 -0
  79. package/dist/types/authoring-files.d.ts +10 -0
  80. package/dist/types/aws.d.ts +3 -1
  81. package/dist/types/build-cloudflare.d.ts +1 -0
  82. package/dist/types/build-static.d.ts +43 -0
  83. package/dist/types/bulk.d.ts +27 -0
  84. package/dist/types/capabilities.d.ts +64 -0
  85. package/dist/types/capability-query.d.ts +24 -0
  86. package/dist/types/catalog.d.ts +65 -0
  87. package/dist/types/client-address.d.ts +0 -1
  88. package/dist/types/compliance-rules/baseline.d.ts +1 -9
  89. package/dist/types/compliance-rules/privacy.d.ts +1 -4
  90. package/dist/types/compliance-rules/shared.d.ts +0 -2
  91. package/dist/types/compliance-rules/strict.d.ts +0 -5
  92. package/dist/types/compliance.d.ts +0 -3
  93. package/dist/types/conditions.d.ts +19 -0
  94. package/dist/types/config.d.ts +21 -2
  95. package/dist/types/context.d.ts +66 -0
  96. package/dist/types/ecosystem-cli.d.ts +17 -0
  97. package/dist/types/egress.d.ts +46 -0
  98. package/dist/types/examples.d.ts +50 -0
  99. package/dist/types/explain-cli.d.ts +11 -0
  100. package/dist/types/explain.d.ts +95 -0
  101. package/dist/types/extensions.d.ts +177 -0
  102. package/dist/types/function-sources.d.ts +9 -0
  103. package/dist/types/functions.d.ts +48 -5
  104. package/dist/types/guest-api.d.ts +1 -0
  105. package/dist/types/index.d.ts +36 -6
  106. package/dist/types/init-with.d.ts +30 -0
  107. package/dist/types/interchange-cli.d.ts +16 -0
  108. package/dist/types/interchange.d.ts +42 -0
  109. package/dist/types/manifest.d.ts +79 -0
  110. package/dist/types/match.d.ts +1 -0
  111. package/dist/types/mcp-authoring.d.ts +92 -0
  112. package/dist/types/mcp.d.ts +12 -0
  113. package/dist/types/observability.d.ts +3 -14
  114. package/dist/types/operator-host.d.ts +8 -0
  115. package/dist/types/plugins.d.ts +2 -0
  116. package/dist/types/policies/agents.d.ts +0 -2
  117. package/dist/types/policies/compression.d.ts +2 -0
  118. package/dist/types/policies/security.d.ts +0 -1
  119. package/dist/types/policy.d.ts +15 -4
  120. package/dist/types/project-tests.d.ts +3 -2
  121. package/dist/types/provider-verification.d.ts +53 -0
  122. package/dist/types/proxy.d.ts +21 -0
  123. package/dist/types/readiness.d.ts +10 -3
  124. package/dist/types/recipes.d.ts +30 -0
  125. package/dist/types/route-diff.d.ts +27 -0
  126. package/dist/types/router.d.ts +2 -1
  127. package/dist/types/runtime.d.ts +11 -27
  128. package/dist/types/sandbox.d.ts +12 -0
  129. package/dist/types/scaffold.d.ts +0 -2
  130. package/dist/types/schema-query.d.ts +12 -0
  131. package/dist/types/server.d.ts +1 -4
  132. package/dist/types/signals.d.ts +25 -0
  133. package/dist/types/site.d.ts +0 -1
  134. package/dist/types/tooling.d.ts +115 -0
  135. package/dist/types/trusted-functions.d.ts +29 -0
  136. package/dist/types/types.d.ts +71 -7
  137. package/dist/types/typescript-authoring.d.ts +12 -0
  138. package/dist/types/vercel.d.ts +3 -1
  139. package/dist/types/verify-deployment.d.ts +47 -0
  140. package/dist/types.js +37 -5
  141. package/dist/typescript-authoring.js +142 -0
  142. package/dist/vercel.js +4 -3
  143. package/dist/verify-deployment.js +270 -0
  144. package/docs/AI-AUTHORING.md +232 -15
  145. package/docs/AWS.md +4 -4
  146. package/docs/BEST-PRACTICES.md +3 -2
  147. package/docs/BULK.md +79 -0
  148. package/docs/CAPABILITIES.md +192 -0
  149. package/docs/CAPACITY.md +129 -32
  150. package/docs/CI.md +142 -0
  151. package/docs/CLOUDFLARE.md +1 -2
  152. package/docs/COMPLIANCE.md +6 -9
  153. package/docs/CONDITIONS.md +74 -0
  154. package/docs/DEPLOYMENT-CHECKS.md +108 -0
  155. package/docs/EGRESS.md +125 -0
  156. package/docs/EXTENSIONS.md +398 -0
  157. package/docs/FRAMEWORK.md +198 -0
  158. package/docs/FUNCTION-SECURITY.md +129 -32
  159. package/docs/INSTALL.md +45 -12
  160. package/docs/INTERCHANGE.md +134 -0
  161. package/docs/LOAD-TESTING.md +4 -4
  162. package/docs/MIDDLEWARE-EXAMPLES.md +75 -0
  163. package/docs/MIDDLEWARE.md +29 -16
  164. package/docs/MONITORING.md +2 -19
  165. package/docs/NEXT-PHASE-PLAN.md +98 -0
  166. package/docs/NEXT-STEPS.md +634 -0
  167. package/docs/OBSERVABILITY.md +11 -18
  168. package/docs/OPEN-DECISIONS.md +212 -0
  169. package/docs/OPERATIONAL-PROOF.md +30 -31
  170. package/docs/OPERATIONS.md +29 -35
  171. package/docs/PLUGINS.md +37 -0
  172. package/docs/POLICIES.md +23 -309
  173. package/docs/PRERENDER.md +41 -1
  174. package/docs/PROJECT-DIRECTION.md +75 -8
  175. package/docs/PROVIDER-VERIFICATION.md +84 -0
  176. package/docs/READINESS.md +21 -1
  177. package/docs/README.md +87 -34
  178. package/docs/RECIPES.md +99 -0
  179. package/docs/RELEASE-READINESS.md +57 -35
  180. package/docs/RELEASE-SECURITY.md +116 -7
  181. package/docs/RESILIENCE.md +16 -15
  182. package/docs/ROUTING.md +8 -10
  183. package/docs/SANDBOX-REVIEW.md +19 -6
  184. package/docs/SCAFFOLDING.md +0 -2
  185. package/docs/SECURITY-AUDIT.md +41 -1
  186. package/docs/SPECIFICATION.md +150 -29
  187. package/docs/SPIKE-AI-FRAMEWORK-BENCHMARK.md +287 -0
  188. package/docs/SPIKE-BUSINESS-SUITE.md +1021 -0
  189. package/docs/SPIKE-CORE-LAYERING.md +337 -0
  190. package/docs/SPIKE-DEFAULT-TRUST-MODEL.md +209 -0
  191. package/docs/SPIKE-EXTENSION-MODEL.md +419 -0
  192. package/docs/SPIKE-EXTENSIONS.md +6 -0
  193. package/docs/SPIKE-LAMBDA-COMPILE.md +201 -0
  194. package/docs/SPIKE-MONOREPO.md +322 -0
  195. package/docs/STANDARDS.md +150 -142
  196. package/docs/STARTERS.md +21 -1
  197. package/docs/STATIC.md +94 -0
  198. package/docs/TOOLING.md +295 -0
  199. package/docs/TUNNELS.md +0 -3
  200. package/docs/TYPESCRIPT-AUTHORING.md +82 -0
  201. package/docs/TYPESCRIPT.md +25 -4
  202. package/docs/USABILITY-REVIEW.md +129 -0
  203. package/docs/VERCEL.md +4 -5
  204. package/docs/VERSION-ALIGNMENT.md +205 -0
  205. package/docs/YAML-GUIDE.md +15 -479
  206. package/docs/YAML-REFERENCE.md +143 -22
  207. package/docs/policies/agents.md +1 -1
  208. package/docs/policies/cache.md +13 -0
  209. package/docs/policies/contract.md +52 -0
  210. package/docs/policies/hardened.md +56 -0
  211. package/docs/policies/interoperability.md +169 -0
  212. package/docs/policies/operations.md +45 -0
  213. package/docs/yaml/assets.md +36 -0
  214. package/docs/yaml/conditions.md +20 -0
  215. package/docs/yaml/functions.md +160 -0
  216. package/docs/yaml/middleware.md +29 -0
  217. package/docs/yaml/organization.md +74 -0
  218. package/docs/yaml/policies.md +37 -0
  219. package/docs/yaml/redirects.md +64 -0
  220. package/docs/yaml/responses.md +57 -0
  221. package/docs/yaml/site.md +24 -0
  222. package/examples/assets/example.yaml +17 -0
  223. package/examples/aws/example.yaml +20 -0
  224. package/examples/cloudflare/example.yaml +19 -0
  225. package/examples/compliance/example.yaml +11 -0
  226. package/examples/conditions/README.md +12 -0
  227. package/examples/conditions/example.yaml +19 -0
  228. package/examples/conditions/tests/requests.json +13 -0
  229. package/examples/conditions/urlcode.yaml +24 -0
  230. package/examples/cookbook/README.md +8 -4
  231. package/examples/cookbook/example.yaml +17 -0
  232. package/examples/cookbook/functions/catalog.mjs +3 -0
  233. package/examples/cookbook/functions/fail.mjs +4 -0
  234. package/examples/cookbook/functions/items.mjs +3 -0
  235. package/examples/cookbook/functions/profile.mjs +3 -0
  236. package/examples/cookbook/functions/resource.mjs +3 -0
  237. package/examples/cookbook/functions/status.mjs +3 -0
  238. package/examples/cookbook/middleware/auth.mjs +48 -0
  239. package/examples/cookbook/middleware/body.mjs +15 -0
  240. package/examples/cookbook/middleware/bucket.mjs +29 -0
  241. package/examples/cookbook/middleware/cors.mjs +21 -0
  242. package/examples/cookbook/middleware/debug.mjs +13 -0
  243. package/examples/cookbook/middleware/envelope.mjs +11 -0
  244. package/examples/cookbook/middleware/errors.mjs +11 -0
  245. package/examples/cookbook/middleware/etag.mjs +18 -0
  246. package/examples/cookbook/middleware/locale.mjs +20 -0
  247. package/examples/cookbook/middleware/maintenance.mjs +10 -0
  248. package/examples/cookbook/middleware/methods.mjs +15 -0
  249. package/examples/cookbook/middleware/negotiate.mjs +20 -0
  250. package/examples/cookbook/middleware/referer.mjs +12 -0
  251. package/examples/cookbook/middleware/request-id.mjs +16 -0
  252. package/examples/cookbook/route-index.json +676 -0
  253. package/examples/cookbook/routes/middleware.yaml +126 -0
  254. package/examples/cookbook/tests/requests.json +526 -0
  255. package/examples/cookbook/urlcode.yaml +1 -0
  256. package/examples/egress/README.md +22 -0
  257. package/examples/egress/example.yaml +19 -0
  258. package/examples/egress/urlcode.yaml +19 -0
  259. package/examples/extensions/README.md +7 -0
  260. package/examples/extensions/example.yaml +21 -0
  261. package/examples/extensions/urlcode.yaml +25 -0
  262. package/examples/monitoring/example.yaml +8 -0
  263. package/examples/prerender/README.md +2 -2
  264. package/examples/prerender/example.yaml +16 -0
  265. package/examples/provider-conformance/README.md +12 -0
  266. package/examples/provider-conformance/example.yaml +14 -0
  267. package/examples/provider-conformance/urlcode.yaml +34 -0
  268. package/examples/tunnel/example.yaml +8 -0
  269. package/examples/vercel/example.yaml +19 -0
  270. package/llms-full.txt +3084 -0
  271. package/llms.txt +61 -21
  272. package/package.json +36 -7
  273. package/packaging/claude-plugin/.claude-plugin/plugin.json +19 -0
  274. package/packaging/claude-plugin/skills/urlcode-authoring/SKILL.md +122 -0
  275. package/packaging/claude-plugin/skills/urlcode-operations/SKILL.md +108 -0
  276. package/recipes/authenticated-json-api/README.md +51 -0
  277. package/recipes/authenticated-json-api/functions/profile.mjs +5 -0
  278. package/recipes/authenticated-json-api/recipe.yaml +34 -0
  279. package/recipes/authenticated-json-api/tests/requests.json +39 -0
  280. package/recipes/authenticated-json-api/urlcode.yaml +12 -0
  281. package/recipes/contact-form/README.md +25 -0
  282. package/recipes/contact-form/functions/contact.mjs +17 -0
  283. package/recipes/contact-form/recipe.yaml +33 -0
  284. package/recipes/contact-form/tests/requests.json +47 -0
  285. package/recipes/contact-form/urlcode.yaml +18 -0
  286. package/recipes/cors-api/README.md +16 -0
  287. package/recipes/cors-api/functions/items.mjs +3 -0
  288. package/recipes/cors-api/middleware/cors.mjs +21 -0
  289. package/recipes/cors-api/recipe.yaml +26 -0
  290. package/recipes/cors-api/tests/requests.json +65 -0
  291. package/recipes/cors-api/urlcode.yaml +12 -0
  292. package/recipes/health-page/README.md +13 -0
  293. package/recipes/health-page/recipe.yaml +23 -0
  294. package/recipes/health-page/tests/requests.json +36 -0
  295. package/recipes/health-page/urlcode.yaml +19 -0
  296. package/recipes/json-api/README.md +6 -0
  297. package/recipes/json-api/functions/echo.mjs +3 -0
  298. package/recipes/json-api/recipe.yaml +25 -0
  299. package/recipes/json-api/tests/requests.json +34 -0
  300. package/recipes/json-api/urlcode.yaml +12 -0
  301. package/recipes/middleware/README.md +34 -0
  302. package/recipes/middleware/functions/catalog.mjs +3 -0
  303. package/recipes/middleware/functions/fail.mjs +4 -0
  304. package/recipes/middleware/functions/items.mjs +3 -0
  305. package/recipes/middleware/functions/profile.mjs +3 -0
  306. package/recipes/middleware/functions/resource.mjs +3 -0
  307. package/recipes/middleware/functions/status.mjs +3 -0
  308. package/recipes/middleware/middleware/auth.mjs +48 -0
  309. package/recipes/middleware/middleware/body.mjs +15 -0
  310. package/recipes/middleware/middleware/bucket.mjs +29 -0
  311. package/recipes/middleware/middleware/cors.mjs +21 -0
  312. package/recipes/middleware/middleware/debug.mjs +13 -0
  313. package/recipes/middleware/middleware/envelope.mjs +11 -0
  314. package/recipes/middleware/middleware/errors.mjs +11 -0
  315. package/recipes/middleware/middleware/etag.mjs +18 -0
  316. package/recipes/middleware/middleware/locale.mjs +20 -0
  317. package/recipes/middleware/middleware/maintenance.mjs +10 -0
  318. package/recipes/middleware/middleware/methods.mjs +15 -0
  319. package/recipes/middleware/middleware/negotiate.mjs +20 -0
  320. package/recipes/middleware/middleware/referer.mjs +12 -0
  321. package/recipes/middleware/middleware/request-id.mjs +16 -0
  322. package/recipes/middleware/public/guide.txt +1 -0
  323. package/recipes/middleware/recipe.yaml +50 -0
  324. package/recipes/middleware/tests/requests.json +528 -0
  325. package/recipes/middleware/urlcode.yaml +127 -0
  326. package/recipes/protected-download/README.md +22 -0
  327. package/recipes/protected-download/files/report.txt +1 -0
  328. package/recipes/protected-download/recipe.yaml +31 -0
  329. package/recipes/protected-download/tests/requests.json +32 -0
  330. package/recipes/protected-download/urlcode.yaml +15 -0
  331. package/recipes/redirect/README.md +7 -0
  332. package/recipes/redirect/recipe.yaml +25 -0
  333. package/recipes/redirect/tests/requests.json +19 -0
  334. package/recipes/redirect/urlcode.yaml +9 -0
  335. package/recipes/static-plus-api/README.md +15 -0
  336. package/recipes/static-plus-api/functions/info.mjs +3 -0
  337. package/recipes/static-plus-api/public/assets/index.html +3 -0
  338. package/recipes/static-plus-api/public/assets/site.css +1 -0
  339. package/recipes/static-plus-api/public/index.html +8 -0
  340. package/recipes/static-plus-api/recipe.yaml +29 -0
  341. package/recipes/static-plus-api/tests/requests.json +56 -0
  342. package/recipes/static-plus-api/urlcode.yaml +23 -0
  343. package/recipes/typescript/README.md +8 -0
  344. package/recipes/typescript/functions/hello.ts +5 -0
  345. package/recipes/typescript/recipe.yaml +23 -0
  346. package/recipes/typescript/tests/requests.json +18 -0
  347. package/recipes/typescript/urlcode.yaml +5 -0
  348. package/recipes/webhook-receiver/README.md +20 -0
  349. package/recipes/webhook-receiver/functions/receive.mjs +16 -0
  350. package/recipes/webhook-receiver/recipe.yaml +27 -0
  351. package/recipes/webhook-receiver/tests/requests.json +59 -0
  352. package/recipes/webhook-receiver/urlcode.yaml +23 -0
  353. package/schemas/recipe.schema.json +139 -0
  354. package/schemas/urlcode.schema.json +659 -110
  355. package/skills/urlcode/SKILL.md +119 -0
  356. package/starters/default/.github/workflows/urlcode.yml +23 -0
  357. package/starters/default/.mcp.json +12 -0
  358. package/starters/default/AGENTS.md +79 -0
  359. package/starters/default/urlcode.yaml +0 -1
  360. package/dist/link-api.js +0 -136
  361. package/dist/link-cli.js +0 -141
  362. package/dist/link-events.js +0 -76
  363. package/dist/link-records.js +0 -31
  364. package/dist/link-store-worker.js +0 -150
  365. package/dist/link-store.js +0 -250
  366. package/dist/management-policy.js +0 -41
  367. package/dist/sqlite-version.js +0 -6
  368. package/dist/types/link-api.d.ts +0 -30
  369. package/dist/types/link-cli.d.ts +0 -36
  370. package/dist/types/link-events.d.ts +0 -27
  371. package/dist/types/link-records.d.ts +0 -11
  372. package/dist/types/link-store-worker.d.ts +0 -1
  373. package/dist/types/link-store.d.ts +0 -130
  374. package/dist/types/management-policy.d.ts +0 -9
  375. package/dist/types/sqlite-version.d.ts +0 -1
  376. package/docs/DYNAMIC-LINKS.md +0 -561
  377. package/docs/MANAGEMENT-SECURITY.md +0 -82
  378. package/examples/live-links/README.md +0 -11
  379. package/examples/live-links/tests/requests.json +0 -6
  380. package/examples/live-links/urlcode.yaml +0 -16
@@ -1,14 +1,11 @@
1
1
  export declare const events: Readonly<{
2
+ signal: readonly string[];
2
3
  request: readonly string[];
3
4
  reload: readonly string[];
4
5
  watch: readonly string[];
5
6
  function_worker: readonly string[];
6
- link_store_worker: readonly string[];
7
- link_request: readonly string[];
8
- link_observer: readonly string[];
9
7
  logs_dropped: readonly string[];
10
8
  observer: readonly string[];
11
- management_request: readonly string[];
12
9
  throttle: readonly string[];
13
10
  agents: readonly string[];
14
11
  cache: readonly string[];
@@ -61,20 +58,12 @@ export interface MetricsSnapshot {
61
58
  healthySlots: number;
62
59
  slots: number;
63
60
  };
64
- linkStoreWorkers: {
65
- started: number;
66
- restarts: number;
67
- };
68
61
  policies: {
69
62
  throttle: Counters;
70
63
  agents: Counters;
71
64
  cache: Counters;
72
65
  };
73
- linkRequests: Counters;
74
- linkObserver: {
75
- failed: number;
76
- dropped: number;
77
- };
66
+ signals: Counters;
78
67
  logsDropped: number;
79
68
  observers: {
80
69
  errors: number;
@@ -97,7 +86,7 @@ export type ObserverSink = ((event: ObserverEvent, context?: RecordContext) => v
97
86
  close(): Promise<void>;
98
87
  };
99
88
  export declare function validateObservers(observers?: unknown): Observer[];
100
- export declare const SNAPSHOT_VERSION = 1;
89
+ export declare const SNAPSHOT_VERSION = 2;
101
90
  export declare function createMetrics(): Metrics;
102
91
  export declare function createObserverSink(observers?: unknown, fallbackLog?: (event: ObserverEvent) => void, metrics?: Metrics): ObserverSink;
103
92
  export declare function renderPrometheus(snapshot: Partial<MetricsSnapshot>): string;
@@ -0,0 +1,8 @@
1
+ import type { RuntimeOptions } from './runtime.ts';
2
+ /** Explicitly loaded operator code. Never discovered in application directories. */
3
+ export interface OperatorHost {
4
+ extensions?: RuntimeOptions['extensions'];
5
+ plugins?: RuntimeOptions['plugins'];
6
+ close?(): void | Promise<void>;
7
+ }
8
+ export declare function loadOperatorHost(file: string | undefined, project: string): Promise<OperatorHost>;
@@ -13,6 +13,8 @@ export interface Plugin {
13
13
  name: string;
14
14
  version: string;
15
15
  targets: TargetName[];
16
+ /** Operator-owned header names withheld from every guest Request and input context. */
17
+ credentialHeaders?: string[];
16
18
  onActivate?(runtime: PluginRuntime): void | Promise<void>;
17
19
  onRequest?(request: PolicyRequest): HandlerResult | undefined | void | Promise<HandlerResult | undefined | void>;
18
20
  onResponse?(request: PolicyRequest, result: HandlerResult): HandlerResult | undefined | void | Promise<HandlerResult | undefined | void>;
@@ -70,8 +70,6 @@ export interface AgentsDescription {
70
70
  };
71
71
  }
72
72
  export declare const bundledLists: readonly string[];
73
- export declare const MAX_PATTERN_BYTES = 256;
74
- export declare const MAX_REPEAT = 64;
75
73
  export declare function validatePattern(pattern: unknown): string | undefined;
76
74
  export declare function isBundled(reference: string): boolean;
77
75
  export declare function isListFile(reference: unknown): reference is string;
@@ -31,6 +31,8 @@ export interface CompressionDescription {
31
31
  level: number | null;
32
32
  precompressed: number;
33
33
  }
34
+ /** The media types compressed when `types` is not declared; exported so the deployment verifier reads the same table. */
35
+ export declare const DEFAULT_TYPES: string[];
34
36
  export declare const zstdAvailable: boolean;
35
37
  export declare function targets(): Record<TargetName, PolicySupport>;
36
38
  export declare function compile(config: CompressionConfig, { route, shared }: PolicyContext): Promise<CompressionState>;
@@ -21,7 +21,6 @@ export interface SecurityDescription {
21
21
  }
22
22
  export declare const name = "security";
23
23
  export declare const phases: readonly string[];
24
- export declare const oshpRevision = "OSHP 2024 best practices";
25
24
  export declare const profiles: Readonly<Record<string, readonly (readonly [string, string])[]>>;
26
25
  export declare const reservedHeaders: Readonly<Set<string>>;
27
26
  export declare function targets(): Record<string, 'native' | 'compiled'>;
@@ -1,13 +1,19 @@
1
1
  import type { FunctionSources } from './function-sources.ts';
2
2
  import type { LoadedDocument } from './types.ts';
3
+ export interface EgressGrants {
4
+ proxy?: string[];
5
+ signals?: string[];
6
+ }
7
+ export interface RouteGrant {
8
+ env?: string[];
9
+ secrets?: string[];
10
+ egress?: EgressGrants;
11
+ }
3
12
  /** The operator's binding grants: which env and secret names each route may read, pinned to a project hash. */
4
13
  export interface OperatorPolicy {
5
14
  version: 1;
6
15
  projectSha256: string;
7
- routes: Record<string, {
8
- env?: string[];
9
- secrets?: string[];
10
- }>;
16
+ routes: Record<string, RouteGrant>;
11
17
  }
12
18
  /** The function snapshot plus the hash operator grants are pinned to. */
13
19
  export interface FunctionSnapshot extends FunctionSources {
@@ -19,3 +25,8 @@ export declare function loadOperatorPolicy(file: string | undefined, project: st
19
25
  export declare function requestedPermissions(loaded: LoadedDocument, snapshot: {
20
26
  projectSha256: string;
21
27
  }): OperatorPolicy;
28
+ /** Called before resources or credentials are activated. Grants never come from YAML. */
29
+ export declare function authorizeEgress(loaded: LoadedDocument, projectSha256: string, policy: OperatorPolicy | undefined): {
30
+ proxy: string[];
31
+ signals: string[];
32
+ };
@@ -1,13 +1,14 @@
1
1
  import type { ServerOptions } from './server.ts';
2
2
  import type { LogFn } from './types.ts';
3
3
  export interface ProjectTestOptions {
4
+ extensions?: ServerOptions['extensions'];
5
+ plugins?: ServerOptions['plugins'];
4
6
  log?: LogFn | undefined;
5
7
  permissions?: ServerOptions['permissions'];
6
- linkStore?: ServerOptions['linkStore'];
7
8
  origin?: string | undefined;
8
9
  }
9
10
  export interface ProjectTestResult {
10
11
  total: number;
11
12
  failed: number;
12
13
  }
13
- export declare function runProjectTests(project: string, { log, permissions, linkStore, origin }?: ProjectTestOptions): Promise<ProjectTestResult>;
14
+ export declare function runProjectTests(project: string, { log, permissions, origin, extensions, plugins }?: ProjectTestOptions): Promise<ProjectTestResult>;
@@ -0,0 +1,53 @@
1
+ export type VerificationTarget = 'self-hosted' | 'aws' | 'vercel' | 'cloudflare';
2
+ export interface ProviderProbe {
3
+ id: string;
4
+ path: string;
5
+ method: string;
6
+ headers: Record<string, string>;
7
+ body?: string;
8
+ expected: {
9
+ status: number;
10
+ headers?: Record<string, string>;
11
+ body?: string;
12
+ };
13
+ }
14
+ export interface ProviderAnswer {
15
+ status: number;
16
+ headers: Record<string, string>;
17
+ body: string;
18
+ }
19
+ export type ProviderTransport = (probe: ProviderProbe, signal: AbortSignal) => Promise<ProviderAnswer>;
20
+ export interface ProviderVerificationOptions {
21
+ timeoutMs?: number;
22
+ release?: string;
23
+ gitCommit?: string;
24
+ }
25
+ export interface ProviderFinding {
26
+ case: string;
27
+ pass: boolean;
28
+ expectedStatus: number;
29
+ observedStatus: number | null;
30
+ failures: string[];
31
+ }
32
+ export interface ProviderVerificationReport {
33
+ schemaVersion: 1;
34
+ fixtureVersion: 1;
35
+ target: VerificationTarget;
36
+ origin: string | null;
37
+ evidence: 'local-adapter' | 'deployment-http';
38
+ providerVerification: 'unverified' | 'observed';
39
+ timestamp: string;
40
+ release: string | null;
41
+ gitCommit: string | null;
42
+ fixtureSha256: string;
43
+ pass: boolean;
44
+ requests: number;
45
+ findings: ProviderFinding[];
46
+ notes: string[];
47
+ }
48
+ /** Synthetic read-only routes, except a POST to a declared constant response. */
49
+ export declare function providerConformanceCases(): ProviderProbe[];
50
+ /** Replay against a caller-supplied local adapter; never label this a provider deployment. */
51
+ export declare function runProviderConformance(target: VerificationTarget, transport: ProviderTransport, options?: ProviderVerificationOptions): Promise<ProviderVerificationReport>;
52
+ /** Probe only an explicitly supplied, operator-owned deployment of the fixture. Redirects are never followed. */
53
+ export declare function verifyProviderDeployment(target: VerificationTarget, origin: string, options?: ProviderVerificationOptions): Promise<ProviderVerificationReport>;
@@ -0,0 +1,21 @@
1
+ import type { EgressRequest, EgressResponse } from './egress.ts';
2
+ export interface ProxyDefinition {
3
+ url: string;
4
+ query?: string[];
5
+ requestHeaders?: string[];
6
+ responseHeaders?: string[];
7
+ headers?: Record<string, string>;
8
+ }
9
+ export interface ProxyInput {
10
+ method: string;
11
+ url: string | URL;
12
+ params: Record<string, unknown>;
13
+ headers: Record<string, string | undefined>;
14
+ body?: Uint8Array;
15
+ signal?: AbortSignal;
16
+ }
17
+ export interface EgressTransport {
18
+ request(input: EgressRequest): Promise<EgressResponse>;
19
+ }
20
+ export declare function validateProxy(definition: ProxyDefinition): void;
21
+ export declare function executeProxy(client: EgressTransport, definition: ProxyDefinition, input: ProxyInput): Promise<EgressResponse>;
@@ -4,10 +4,13 @@ import type { CompiledRedirect, CompiledRoute, LogFn, PlanInventoryEntry, Policy
4
4
  import type { ComplianceOptions, ComplianceReport } from './compliance.ts';
5
5
  import type { CompiledRoutes } from './match.ts';
6
6
  export type { RouteState } from './types.ts';
7
- export type HandlerName = 'redirect' | 'function' | 'page' | 'static' | 'download' | 'respond' | 'link';
7
+ export type HandlerName = 'extension' | 'proxy' | 'conditional' | 'redirect' | 'function' | 'page' | 'static' | 'download' | 'respond';
8
8
  /** One configured route as the inventory reports it: a PlanInventoryEntry with the handler kind named. */
9
9
  export interface RouteInventory extends PlanInventoryEntry {
10
10
  handler: HandlerName | undefined;
11
+ /** Non-blocking `audit` observations about this route (e.g. a webhook-shaped
12
+ * route with no declared `sandbox`/`sandboxReason`); never affects `ready`. */
13
+ advisories?: string[];
11
14
  }
12
15
  /** One request case: a generated probe or a `tests/requests.json` fixture. */
13
16
  export interface RequestCase {
@@ -40,7 +43,6 @@ export interface AuditableApp {
40
43
  address: AddressInfo;
41
44
  root: string;
42
45
  testPlan(): ProjectPlan & {
43
- dynamicLinks?: boolean;
44
46
  policies?: Record<string, PolicyInventory>;
45
47
  };
46
48
  }
@@ -51,7 +53,6 @@ export interface AuditOptions {
51
53
  compliance?: ComplianceOptions | undefined;
52
54
  }
53
55
  export interface AuditReport {
54
- dynamicLinks: boolean | undefined;
55
56
  elapsedMs: number;
56
57
  ready: boolean;
57
58
  counts: {
@@ -74,6 +75,12 @@ export interface AuditReport {
74
75
  }[];
75
76
  policies: Record<string, PolicyInventory>;
76
77
  compliance: ComplianceReport | null;
78
+ /** Non-blocking `audit` observations, e.g. a route that looks webhook-shaped
79
+ * but declares neither `sandbox: true` nor `sandboxReason`. Never affects `ready`. */
80
+ advisories: {
81
+ route: string;
82
+ message: string;
83
+ }[];
77
84
  }
78
85
  export interface BenchmarkOptions {
79
86
  requests?: number | undefined;
@@ -0,0 +1,30 @@
1
+ import type { CatalogMetadata } from './catalog.ts';
2
+ /** recipe.yaml, validated against schemas/recipe.schema.json; `name` repeats `id` and `files` is the copy list. */
3
+ export interface RecipeSummary extends CatalogMetadata {
4
+ name: string;
5
+ }
6
+ export interface Recipe extends RecipeSummary {
7
+ content: Record<string, string>;
8
+ }
9
+ export interface RecipeAddReport {
10
+ name: string;
11
+ output: string;
12
+ dryRun: boolean;
13
+ files: string[];
14
+ }
15
+ export interface RecipeSearchResult {
16
+ query: string;
17
+ count: number;
18
+ results: (RecipeSummary & {
19
+ score: number;
20
+ matched: string[];
21
+ })[];
22
+ }
23
+ export declare const recipeNames: readonly ["redirect", "json-api", "typescript", "middleware", "health-page", "static-plus-api", "cors-api", "webhook-receiver", "contact-form", "authenticated-json-api", "protected-download"];
24
+ export declare function listRecipes(): Promise<RecipeSummary[]>;
25
+ /** Matches id, description, tags and capabilities locally; no service is consulted. */
26
+ export declare function searchRecipes(text: string): Promise<RecipeSearchResult>;
27
+ export declare function showRecipe(name: string): Promise<Recipe>;
28
+ export declare function addRecipe(name: string, output: string, { dryRun }?: {
29
+ dryRun?: boolean | undefined;
30
+ }): Promise<RecipeAddReport>;
@@ -0,0 +1,27 @@
1
+ import type { PlanInventoryEntry } from './types.ts';
2
+ /** One route as the diff sees it: the inventory entry plus its policy description from the `policies` map. */
3
+ export interface RouteRecord extends PlanInventoryEntry {
4
+ policy?: Record<string, unknown>;
5
+ }
6
+ /** The parts of a `urlcode routes` report the diff reads. */
7
+ export interface RouteSnapshot {
8
+ inventory: PlanInventoryEntry[];
9
+ policies?: Record<string, Record<string, unknown>> | undefined;
10
+ }
11
+ export interface RouteChange {
12
+ path: string;
13
+ before: RouteRecord;
14
+ after: RouteRecord;
15
+ }
16
+ export interface RouteDiff {
17
+ added: RouteRecord[];
18
+ removed: RouteRecord[];
19
+ changed: RouteChange[];
20
+ }
21
+ /** Validates a parsed `urlcode routes` JSON report (a child-process or file boundary) into a snapshot. */
22
+ export declare function parseRouteSnapshot(value: unknown): RouteSnapshot;
23
+ /** Compares two route reports. Paths are sorted; an entry changes when any inventory field or its policy description differs. */
24
+ export declare function diffRoutes(before: RouteSnapshot, after: RouteSnapshot): RouteDiff;
25
+ export declare const hasRouteChanges: (diff: RouteDiff) => boolean;
26
+ /** Renders a diff as Markdown: one table per nonempty section, or "No route changes". */
27
+ export declare function renderRouteDiff(diff: RouteDiff): string;
@@ -1,3 +1,4 @@
1
+ import type { RuntimeExtension } from './extensions.ts';
1
2
  import type { CompiledRouteTable, LoadedDocument } from './types.ts';
2
3
  export { parseTarget, matchRoute, contextFor, resolveValue, redirectLocation } from './match.ts';
3
4
  /** The grants compileRoutes consults: a validated OperatorPolicy (policy.ts) or nothing, which denies every binding. */
@@ -8,4 +9,4 @@ export interface BindingPermissions {
8
9
  secrets?: string[];
9
10
  }>;
10
11
  }
11
- export declare function compileRoutes(loaded: LoadedDocument, bindings: Record<string, string | undefined>, permissions?: BindingPermissions, projectSha256?: string): Promise<CompiledRouteTable>;
12
+ export declare function compileRoutes(loaded: LoadedDocument, bindings: Record<string, string | undefined>, permissions?: BindingPermissions, projectSha256?: string, extensions?: readonly Pick<RuntimeExtension, 'name' | 'cacheSensitive'>[]): Promise<CompiledRouteTable>;
@@ -1,61 +1,45 @@
1
+ import type { RuntimeExtension } from './extensions.ts';
2
+ import type { EgressDependencies } from './egress.ts';
1
3
  import type { ProjectPlan } from './readiness.ts';
2
4
  import type { OperatorPolicy } from './policy.ts';
3
- import type { LinkStoreOptions } from './link-store.ts';
4
5
  import type { Plugin } from './plugins.ts';
5
6
  import type { MetricsSnapshot, Observer } from './observability.ts';
6
7
  import type { HandlerResult, HeaderPair } from './http-response.ts';
7
8
  import type { LogFn, PolicyInventory, TargetName } from './types.ts';
8
- /** A stored link as a link store returns it; the runtime validates the fields it uses. */
9
- export interface LinkLookup {
10
- url?: unknown;
11
- status?: unknown;
12
- enabled?: unknown;
13
- expires?: unknown;
14
- }
15
- /** What a `linkStores` binding must provide: a reader and, optionally, its health. */
16
- export interface LinkReader {
17
- get(collection: string, code: string): Promise<LinkLookup | null | undefined>;
18
- readonly readHealthy?: boolean;
19
- readonly healthy?: boolean;
20
- }
21
- /** An operator-owned SQLite link store the runtime opens read-only for one collection. */
22
- export interface LinkStoreBinding extends LinkStoreOptions {
23
- collection: string;
24
- }
25
9
  export type { OperatorPolicy } from './policy.ts';
26
10
  /** An operator plugin (src/plugins.ts). */
27
11
  export type HostPlugin = Plugin;
28
12
  export type { Observer, MetricsSnapshot } from './observability.ts';
29
13
  export interface TestPlan extends ProjectPlan {
30
- dynamicLinks: boolean;
31
14
  policies: Record<string, PolicyInventory>;
32
15
  }
33
16
  export interface RuntimeOptions {
17
+ extensions?: RuntimeExtension[] | undefined;
18
+ /** Trusted host transport injection; never supplied by project YAML or guest code. */
19
+ egressDependencies?: EgressDependencies;
34
20
  observers?: Observer[] | undefined;
35
21
  log?: LogFn | undefined;
36
22
  origin?: string | undefined;
37
23
  local?: boolean | undefined;
38
24
  environment?: NodeJS.ProcessEnv | undefined;
39
25
  permissions?: OperatorPolicy | undefined;
40
- linkStore?: LinkStoreBinding | undefined;
41
- linkStores?: Record<string, LinkReader> | undefined;
42
26
  target?: TargetName | undefined;
43
27
  plugins?: HostPlugin[] | undefined;
44
28
  workers?: number | undefined;
45
29
  timeoutMs?: number | undefined;
46
30
  maxBytes?: number | undefined;
31
+ /** Build tooling only: compile just these route patterns, after site conventions
32
+ * have been expanded. It can only remove routes, never add or alter one, and the
33
+ * smaller route set changes the project hash, so an operator policy pinned to the
34
+ * whole project denies every binding it grants. Prerendering uses it to render a
35
+ * project too large for one function snapshot in passes (docs/PRERENDER.md). */
36
+ only?: readonly string[] | undefined;
47
37
  }
48
38
  /** Per-request facts the host may read after handle() settles; never request text. */
49
- export interface LinkTrace {
50
- collection: string;
51
- code: string | null;
52
- result: string;
53
- }
54
39
  export interface RequestTrace {
55
40
  route?: string;
56
41
  probe?: boolean;
57
42
  client?: string | null;
58
- link?: LinkTrace;
59
43
  }
60
44
  export interface RuntimeRequest {
61
45
  target: string;
@@ -0,0 +1,12 @@
1
+ export { SandboxPool } from './functions.ts';
2
+ export type { SandboxEntry, SandboxTarget, SandboxInvocation, SandboxPoolOptions, FunctionContext, FunctionResult, } from './functions.ts';
3
+ export type { GuestRequestPayload, GuestResponsePayload } from './guest-api.ts';
4
+ export type { HandlerResult, HeaderPair } from './http-response.ts';
5
+ /**
6
+ * Resolves a project-relative hook source string the same way a native
7
+ * `function`/`middleware` route's `source` is resolved (`.mjs`/`.js` only, no
8
+ * path traversal outside the project root) into the absolute path
9
+ * `SandboxPool`'s entries and `execute()` targets expect. `root` must be the
10
+ * project's resolved directory (`ExtensionActivation.root`, never `cwd()`).
11
+ */
12
+ export { functionFile } from './config.ts';
@@ -1,11 +1,9 @@
1
1
  export interface Unresolved {
2
2
  path?: string;
3
3
  reason: string;
4
- collection?: string;
5
4
  }
6
5
  export interface ScaffoldReport {
7
6
  dryRun: boolean;
8
- dynamicLinks: boolean;
9
7
  created: string[];
10
8
  preserved: string[];
11
9
  unresolved: Unresolved[];
@@ -0,0 +1,12 @@
1
+ type Json = Record<string, unknown>;
2
+ export interface SchemaFragment {
3
+ format: 1;
4
+ path: string;
5
+ pointer: string;
6
+ schema: Json;
7
+ }
8
+ /** Top-level document keys first, then `route` itself and every route property (`redirect`, `function`, `middleware`, ...). */
9
+ export declare function schemaPathNames(): string[];
10
+ /** Only the fragment for a dotted path, with references resolved inline. No validation, defaults or authority. */
11
+ export declare function getSchemaFragment(path: string): SchemaFragment;
12
+ export {};
@@ -1,7 +1,6 @@
1
1
  import http from 'node:http';
2
2
  import type { AddressInfo } from 'node:net';
3
3
  import type { RuntimeOptions, TestPlan } from './runtime.ts';
4
- import type { LinkObserverStats } from './link-events.ts';
5
4
  import type { MetricsSnapshot, Observer } from './observability.ts';
6
5
  export interface ServerOptions extends Omit<RuntimeOptions, 'observers'> {
7
6
  project?: string | undefined;
@@ -13,7 +12,6 @@ export interface ServerOptions extends Omit<RuntimeOptions, 'observers'> {
13
12
  maxInFlightHealthRequests?: number | undefined;
14
13
  requestLog?: string | undefined;
15
14
  trustRequestId?: boolean | undefined;
16
- linkEvents?: unknown;
17
15
  trustedProxies?: string | string[] | undefined;
18
16
  observers?: Observer[] | undefined;
19
17
  metrics?: boolean | undefined;
@@ -25,7 +23,6 @@ export interface Server {
25
23
  address: AddressInfo;
26
24
  root: string;
27
25
  testPlan(): TestPlan;
28
- linkEventStats(): LinkObserverStats | undefined;
29
26
  metrics(): MetricsSnapshot;
30
27
  readonly observers: {
31
28
  name: string;
@@ -34,4 +31,4 @@ export interface Server {
34
31
  origin: string;
35
32
  close(): Promise<void>;
36
33
  }
37
- export declare function startServer({ project, host, port, watch, local, log, maxBodyBytes, maxInFlightRequests, maxInFlightHealthRequests, requestLog, trustRequestId, origin, linkEvents, trustedProxies, observers, metrics, metricsIntervalMs, ...runtimeOptions }?: ServerOptions): Promise<Server>;
34
+ export declare function startServer({ project, host, port, watch, local, log, maxBodyBytes, maxInFlightRequests, maxInFlightHealthRequests, requestLog, trustRequestId, origin, trustedProxies, observers, metrics, metricsIntervalMs, ...runtimeOptions }?: ServerOptions): Promise<Server>;
@@ -0,0 +1,25 @@
1
+ import type { EgressTransport } from './proxy.ts';
2
+ export interface SignalDefinition {
3
+ url: string;
4
+ headers?: Record<string, string>;
5
+ }
6
+ export interface SignalEvent {
7
+ route: string;
8
+ status: number;
9
+ method: string;
10
+ }
11
+ export interface SignalStats {
12
+ accepted: number;
13
+ delivered: number;
14
+ failed: number;
15
+ dropped: number;
16
+ }
17
+ export declare function validateSignal(definition: SignalDefinition): void;
18
+ /** No queue, retries, ordering promise, or durable delivery. Counters contain no URL/header data. */
19
+ export declare class SignalBroker {
20
+ #private;
21
+ constructor(client: EgressTransport, concurrency?: number, onStats?: (stats: SignalStats) => void);
22
+ get stats(): SignalStats;
23
+ emit(definition: SignalDefinition, event: SignalEvent): boolean;
24
+ close(): Promise<void>;
25
+ }
@@ -6,7 +6,6 @@ export interface SiteOptions {
6
6
  }
7
7
  type SiteKey = keyof SiteConfig;
8
8
  export declare const generatedPaths: Readonly<Record<SiteKey, string>>;
9
- export declare const MAX_SITEMAP_URLS = 50000;
10
9
  export declare function expandSite(document: ProjectDocument, root: string, { origin, log, routes }?: SiteOptions): Promise<Record<string, RouteConfig>>;
11
10
  export declare function applySite(loaded: LoadedDocument, options?: SiteOptions): Promise<Record<string, RouteConfig>>;
12
11
  export {};
@@ -0,0 +1,115 @@
1
+ import type { ImportRoutesOptions, InterchangeFormat } from './interchange.ts';
2
+ import { listRecipes, showRecipe, searchRecipes } from './recipes.ts';
3
+ import { listExamples, searchExamples } from './examples.ts';
4
+ import type { CompiledRoute, PolicyChain } from './types.ts';
5
+ import type { RuntimeExtension } from './extensions.ts';
6
+ import type { RouteExplanation } from './explain.ts';
7
+ export { getCapabilities } from './capabilities.ts';
8
+ export { getCapability } from './capability-query.ts';
9
+ export type { CapabilityEntry, CapabilityUsage } from './capability-query.ts';
10
+ export { getSchemaFragment, schemaPathNames } from './schema-query.ts';
11
+ export type { SchemaFragment } from './schema-query.ts';
12
+ export { listRecipes, showRecipe, searchRecipes, listExamples, searchExamples };
13
+ export { buildContext, renderContext, estimateTokens, documentationTokens } from './context.ts';
14
+ export type { ContextOptions, ProjectContext, ContextSection } from './context.ts';
15
+ export type { RouteExplanation, ExplainedHandler, ExplainedCache, ExplainedExtensionRequirement, ExtensionProvider, TargetSupport } from './explain.ts';
16
+ /** `extensions` are operator registrations from a host file; explain reports whether each requirement has a provider. Nothing is activated. */
17
+ export interface InspectOptions {
18
+ origin?: string;
19
+ target?: string;
20
+ offset?: number;
21
+ limit?: number;
22
+ extensions?: RuntimeExtension[] | undefined;
23
+ }
24
+ export declare function prepare(project: string, options?: InspectOptions): Promise<{
25
+ loaded: import("./types.ts").LoadedDocument;
26
+ compiled: import("./types.ts").CompiledRouteTable;
27
+ routes: CompiledRoute[];
28
+ chains: Map<string, PolicyChain>;
29
+ projectSha256: string;
30
+ }>;
31
+ /** Semantic authoring inspection; no binding reads, sandbox execution or runtime activation. */
32
+ export declare function inspectProject(project: string, options?: InspectOptions): Promise<{
33
+ format: number;
34
+ projectSha256: string;
35
+ routeCount: number;
36
+ offset: number;
37
+ limit: number;
38
+ routes: {
39
+ path: string;
40
+ methods: string[];
41
+ enabled: boolean;
42
+ capabilities: ("function" | "expires" | "middleware" | "extension" | "proxy" | "signals" | "conditional" | "methods" | "enabled" | "parameters" | "redirect" | "page" | "download" | "static" | "respond" | "policies.extensions" | "conditions" | "request.body" | "response.headers" | "bindings" | "policies.agents" | "policies.security" | "policies.cache" | "policies.compression" | "policies.throttle")[];
43
+ }[];
44
+ compatibility: {
45
+ offset: number;
46
+ limit: number;
47
+ hasMore: boolean;
48
+ issues: import("./capabilities.ts").CapabilityRequirement[];
49
+ target: "vercel" | "aws" | "cloudflare" | "static" | "self-hosted";
50
+ compatible: boolean;
51
+ deployment: "local-runtime" | "unverified";
52
+ requirementCount: number;
53
+ issueCount: number;
54
+ };
55
+ }>;
56
+ export declare function validateProject(project: string, options?: InspectOptions): Promise<{
57
+ valid: boolean;
58
+ projectSha256: string;
59
+ routeCount: number;
60
+ compatibility: {
61
+ target: "vercel" | "aws" | "cloudflare" | "static" | "self-hosted";
62
+ compatible: boolean;
63
+ deployment: "local-runtime" | "unverified";
64
+ requirementCount: number;
65
+ issueCount: number;
66
+ firstIssue: import("./capabilities.ts").CapabilityRequirement | null;
67
+ };
68
+ }>;
69
+ export interface RouteMiss {
70
+ matched: false;
71
+ nearest: string[];
72
+ note: string;
73
+ }
74
+ /** Explain the route a path selects from the compiled IR: effective methods, handler, middleware, inputs, policies, cache outcome, bindings and target support. Nothing executes and no binding is read. */
75
+ export declare function explainRoute(project: string, target: string, options?: InspectOptions): Promise<RouteExplanation | RouteMiss>;
76
+ /** Every route's explanation, in the router's precedence order. */
77
+ export declare function explainProject(project: string, options?: InspectOptions): Promise<{
78
+ projectSha256: string;
79
+ routeCount: number;
80
+ routes: RouteExplanation[];
81
+ }>;
82
+ export declare function previewImport(options: ImportRoutesOptions): Promise<import("./interchange.ts").ConversionReport>;
83
+ export declare function previewExport(project: string, format: InterchangeFormat, acceptProviderDifferences?: boolean): Promise<import("./interchange.ts").ConversionReport>;
84
+ export interface ExtensionInspection {
85
+ format: 1;
86
+ projectSha256: string;
87
+ hostLoaded: boolean;
88
+ note: string;
89
+ extensions: {
90
+ name: string;
91
+ version: string;
92
+ targets: string[];
93
+ credentialHeaders: string[];
94
+ schema: object;
95
+ policySchema: object | null;
96
+ declared: boolean;
97
+ revisionPinned: boolean;
98
+ mounts: string[];
99
+ policyRoutes: string[];
100
+ }[];
101
+ declared: {
102
+ name: string;
103
+ version: string;
104
+ registered: boolean;
105
+ mounts: string[];
106
+ policyRoutes: string[];
107
+ }[];
108
+ }
109
+ /** Reports registered extension contracts against the project's declarations. Never activates an extension. */
110
+ export declare function describeExtensions(project: string, registrations: RuntimeExtension[] | undefined): Promise<ExtensionInspection>;
111
+ /** Executes the trusted operator host file to read its registrations, then releases it. */
112
+ export declare function inspectExtensions(options: {
113
+ project: string;
114
+ hostFile?: string;
115
+ }): Promise<ExtensionInspection>;