@wenathlan/saddle 1.8.13 → 1.8.15

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 (75) hide show
  1. package/README.md +47 -9
  2. package/dist/binary/archive.d.ts +27 -0
  3. package/dist/binary/archive.d.ts.map +1 -0
  4. package/dist/binary/archive.js +46 -0
  5. package/dist/binary/archive.js.map +1 -0
  6. package/dist/binary/transform.d.ts +70 -0
  7. package/dist/binary/transform.d.ts.map +1 -0
  8. package/dist/binary/transform.js +105 -0
  9. package/dist/binary/transform.js.map +1 -0
  10. package/dist/delivery/manifest.d.ts +35 -0
  11. package/dist/delivery/manifest.d.ts.map +1 -0
  12. package/dist/delivery/manifest.js +68 -0
  13. package/dist/delivery/manifest.js.map +1 -0
  14. package/dist/index.d.ts +7 -0
  15. package/dist/index.d.ts.map +1 -1
  16. package/dist/index.js +7 -0
  17. package/dist/index.js.map +1 -1
  18. package/dist/memory/planner.d.ts +66 -0
  19. package/dist/memory/planner.d.ts.map +1 -0
  20. package/dist/memory/planner.js +108 -0
  21. package/dist/memory/planner.js.map +1 -0
  22. package/dist/runners/chain.d.ts +125 -0
  23. package/dist/runners/chain.d.ts.map +1 -0
  24. package/dist/runners/chain.js +95 -0
  25. package/dist/runners/chain.js.map +1 -0
  26. package/dist/scrape/robots.js +1 -1
  27. package/dist/storage/index.d.ts +1 -0
  28. package/dist/storage/index.d.ts.map +1 -1
  29. package/dist/storage/index.js +1 -0
  30. package/dist/storage/index.js.map +1 -1
  31. package/dist/storage/memory.js +2 -2
  32. package/dist/storage/memory.js.map +1 -1
  33. package/dist/storage/pool.d.ts +95 -0
  34. package/dist/storage/pool.d.ts.map +1 -0
  35. package/dist/storage/pool.js +202 -0
  36. package/dist/storage/pool.js.map +1 -0
  37. package/dist/surfaces/requirements.d.ts +29 -0
  38. package/dist/surfaces/requirements.d.ts.map +1 -0
  39. package/dist/surfaces/requirements.js +50 -0
  40. package/dist/surfaces/requirements.js.map +1 -0
  41. package/docs/artifactavailability.md +22 -4
  42. package/docs/ecosystemplan.md +1 -1
  43. package/docs/enginearchitecture.md +28 -0
  44. package/docs/plans/00.index.md +2 -2
  45. package/docs/plans/06.dependencies.md +1 -1
  46. package/docs/plans/18.research.content.extraction.md +3 -3
  47. package/docs/plans/22.research.universal.runtime.md +10 -10
  48. package/docs/plans/28.action.plan.md +1 -1
  49. package/docs/plans/35.comparativo.concorrencia.md +10 -10
  50. package/docs/plans/40.npm.publish.md +6 -6
  51. package/docs/plans/41.o.que.falta.md +2 -2
  52. package/docs/plans/42.pesquisa.concorrencia.md +2 -2
  53. package/docs/plans/43.plan.universal.architecture.md +2 -2
  54. package/docs/plans/44.reference.md +1 -1
  55. package/docs/plans/45.robotarchitecture.md +3 -3
  56. package/docs/plans/46.scdnintegration.md +1 -1
  57. package/docs/plans/README.md +2 -2
  58. package/docs/plans/missing-facts.md +1 -1
  59. package/docs/registryresearch.md +3 -3
  60. package/docs/release17notes.md +1 -1
  61. package/docs/releaseassets.md +2 -2
  62. package/docs/releasenotes-1.8.12.md +17 -2
  63. package/docs/releasenotes-1.8.13.md +30 -2
  64. package/docs/releasenotes-1.8.14.md +67 -0
  65. package/docs/releasenotes-1.8.15.md +37 -0
  66. package/docs/talks9/README (2).md +2 -2
  67. package/docs/talks9/README.md +4 -4
  68. package/docs/talks9/Viabilidade do Saddle_ Uma An/303/241lise T/303/251cnica da Transforma/303/247/303/243o de Armazenamento Remoto em Mem/303/263ria Computacional.md" +4 -4
  69. package/docs/talks9/conversa.txt +4 -4
  70. package/docs/todo-1.8.15.md +483 -0
  71. package/docs/todo-1.8.16.md +651 -0
  72. package/docs/todo.md +708 -0
  73. package/extension/README.md +1 -1
  74. package/extension/manifest.json +1 -1
  75. package/package.json +9 -2
package/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
  <strong>Storage-backed jobs, scraping contracts and portable runners for Node.js.</strong><br/>
7
7
  <strong>Binary computing engine, agent browser, scraper and packager.</strong><br/>
8
8
  <a href="https://github.com/wenathlan/saddle/actions/workflows/ci.yml"><img src="https://github.com/wenathlan/saddle/actions/workflows/ci.yml/badge.svg" alt="CI" /></a>
9
- <a href="https://github.com/wenathlan/saddle/releases/tag/v1.8.12"><img src="https://img.shields.io/badge/release-v1.8.12-d35d3d" alt="Release 1.8.12" /></a>
9
+ <a href="https://github.com/wenathlan/saddle/releases/tag/v1.8.14"><img src="https://img.shields.io/badge/release-v1.8.14-d35d3d" alt="Release 1.8.14" /></a>
10
10
  <a href="https://github.com/wenathlan/saddle/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-GPL--3.0--only-202a2f" alt="GPL 3.0 only license" /></a>
11
11
  </p>
12
12
 
@@ -14,7 +14,7 @@
14
14
 
15
15
  Saddle is a **TypeScript-first ESM engine** compiled to JavaScript, declarations and source maps for jobs that move data between storage, a bounded working set, a caller-injected runner and durable artifacts. It is also a virtual machine published as a package: the caller can run it on GitHub Actions, Forgejo, Gitea, GitLab, Codeberg, Docker or another third-party compute surface. The engine does not require the operator's local machine, does not embed credentials and does not choose a mandatory cloud provider.
16
16
 
17
- The canonical JavaScript package is `@wenathlan/saddle`. GitHub Packages npm, Maven and GHCR use the `wenathlan` owner namespace; NuGet and RubyGems retain their ecosystem package names. Older `@devthink`, `@iakadion` and `io.devthink` references in archived documents are historical records, not current package identities.
17
+ The canonical JavaScript package is `@wenathlan/saddle`. GitHub Packages npm, Maven and GHCR use the `wenathlan` owner namespace; NuGet and RubyGems retain their ecosystem package names. Older `@wenathlan`, `@iakadion` and `io.devthink` references in archived documents are historical records, not current package identities.
18
18
 
19
19
  ## Start here
20
20
 
@@ -59,6 +59,21 @@ repository or bucket -> runner working set -> process -> durable artifact
59
59
 
60
60
  The repository may act as a disk, a CI workflow may act as a function call, Pages may act as a static bus and a release artifact may act as the durable boundary. `workflow_dispatch`, `repository_dispatch` and HTTP adapters remain caller-configured interfaces.
61
61
 
62
+ ### Runtime modes and physical boundaries
63
+
64
+ The historical design treats the repository and its runner as a **virtual processor**, not as a claim that remote storage is physical VRAM. The storage-to-compute bridge stages a bounded working set through memory, filesystem, tmpfs, mmap or a caller-owned adapter; network latency, bandwidth and provider quotas remain real limits. The same library contracts are available with or without their paired surface, so a caller can use fetch or browser, visible or headless, internal or external storage, physical or vectorized memory, and library or binary packaging without being locked to one mode.
65
+
66
+ | Mode | Boundary | Typical use |
67
+ | --- | --- | --- |
68
+ | Fetch | no browser | Static HTML, APIs and deterministic extraction. |
69
+ | Browser | caller-owned transport | Interactive pages, snapshots, tabs and actions. |
70
+ | Auto | adaptive selection | Fetch first, then browser when the caller permits it. |
71
+ | Headless | no visible UI | CI runners, servers and scheduled jobs. |
72
+ | CLI or binary | packaged entry point | Operator tools or third-party compute jobs. |
73
+ | Computer | storage-to-compute bridge | Bounded binary and memory processing. |
74
+
75
+ The engine keeps these boundaries explicit. It does not silently install a browser, mount a bucket as VRAM, create a database, choose a proxy, or transfer credentials to a provider.
76
+
62
77
  ### Engine: contracts instead of vendor lock-in
63
78
 
64
79
  | Area | Contracts shipped | Result |
@@ -74,12 +89,30 @@ The repository may act as a disk, a CI workflow may act as a function call, Page
74
89
  | Delivery | manifests, workflow registry, extension packaging and release assets | repeatable package and runner surfaces |
75
90
  | Integrations | GitHub, GitLab, Forgejo, app lifecycle, command scopes and delivery adapters | caller-owned provider connectivity |
76
91
 
92
+ The protocol layer accepts JSON request/response envelopes, NDJSON append-only events, SSE progress streams, structured text and raw binary chunks. Retryable operations use bounded backoff, idempotency keys and caller-owned persistence; multi-step operations expose saga compensation instead of assuming that a partial remote action can be rolled back automatically.
93
+
94
+ | Reliability concern | Contract | Default boundary |
95
+ | --- | --- | --- |
96
+ | Retry | transient HTTP and network failures only | bounded attempts with caller-selected delay |
97
+ | Idempotency | request or delivery identity | at-least-once dispatch without duplicate effects |
98
+ | Circuit breaker | `closed -> open -> half-open` | caller-owned recovery threshold and timeout |
99
+ | Concurrency | queue, frontier or pool budget | explicit limits instead of unbounded fan-out |
100
+ | Compensation | workflow or saga callback | caller-owned cleanup after cancellation |
101
+
77
102
  The root entry point is transport-neutral. Node filesystem, HTTP server, persistent sessions and Playwright are explicit subpaths or optional adapters. The library accepts caller-provided fetchers, browser transports, storage adapters, persistence, proxy pools, captcha evidence handlers, webhook secrets and remote credentials.
78
103
 
79
104
  ### Productization: one engine, many shells
80
105
 
81
106
  The same contracts can be surfaced as an npm library, application archive, computer runtime, desktop installer, Android APK/AAB, iOS IPA, CLI, binary, browser package, Manifest V3 extension, web/PWA artifact, LibreOffice OXT, VSIX, webhook server, MCP transport, workflow action, container image, Maven package, NuGet package or RubyGem. These surfaces are declarative target plans and caller-owned adapters around the engine; they are not separate sources of truth.
82
107
 
108
+ ### Agent context and structured output
109
+
110
+ The extraction path is **structured-first**: metadata and schema facts are selected before free-form text, then serialized to bounded Markdown, JSON or XML. Heading-aware chunks preserve source URL, content hash, heading path and token estimates for downstream retrieval. `generateLlmsTxt` and `generateLlmsFullTxt` expose concise agent indexes with absolute links, while `estimateTokens`, `fitsInContext` and the browser context budget prevent a caller from silently exceeding its chosen model or transport limit. No model provider is mandatory; parsing and context policies remain injectable.
111
+
112
+ ### Third-party compute identity
113
+
114
+ Saddle can be connected to GitHub, GitLab, Forgejo, Gitea, Codeberg, Docker or another caller-owned runner. The operator owns the application identity, repository permissions, webhook secret and provider token; Saddle supplies transport-neutral contracts and never assumes that a hosted service account, database or runner exists. This is the operational meaning of the original multi-forge design: the runner is replaceable and the artifact is the durable boundary.
115
+
83
116
  ## Public API
84
117
 
85
118
  | Export | Purpose |
@@ -90,6 +123,11 @@ The same contracts can be surfaced as an npm library, application archive, compu
90
123
  | `extractcontent` | structured extraction |
91
124
  | `serializeresult` | serialize JSON, Markdown or XML results |
92
125
  | `formatforagent` | summary, chunks and token count |
126
+ | `chunkMarkdown` / `formatChunksForRAG` | heading-aware bounded chunks for downstream context |
127
+ | `generateLlmsTxt` / `generateLlmsFullTxt` | agent-readable documentation indexes |
128
+ | `estimateTokens` / `fitsInContext` | model-neutral context and cost estimates |
129
+ | `withRetry` | bounded retry and abort handling |
130
+ | `createServer` | caller-owned HTTP surface |
93
131
  | `batchscrape` | bounded URL groups |
94
132
  | `crawlurl` | crawl contract with domain and budget controls |
95
133
  | `browseragent` | caller-owned navigation, click, type and screenshot actions |
@@ -112,7 +150,7 @@ npm run extension:build -- --output build/extension
112
150
  ls build/extension/manifest.json build/extension/worker.js build/extension/content.js build/extension/popup.html
113
151
  ```
114
152
 
115
- The base permission set is `activeTab`, `scripting` and `storage`. It does not request broad host permissions, cookies, `webRequest`, debugger access or arbitrary page code execution. Optional host escalation remains caller-owned. Releases attach `saddle-extension-<version>.zip`; cross-browser profiles remain adapter work.
153
+ The base permission set is `activeTab`, `scripting` and `storage`. It does not request broad host permissions, cookies, `webRequest`, debugger access or arbitrary page code execution. Optional host escalation remains caller-owned. Releases attach `saddle.extension.<version>.zip`; cross-browser profiles remain adapter work.
116
154
 
117
155
  ## Security boundaries
118
156
 
@@ -127,17 +165,17 @@ The base permission set is `activeTab`, `scripting` and `storage`. It does not r
127
165
  | Failure | retry, circuit breaker, idempotency and resume are configurable |
128
166
  | Releases | version comes from the `vX.Y.Z` tag and must match `package.json` |
129
167
 
130
- Version 1.8.9 makes the active source TypeScript-first, compiles it into ignored `dist/`, and keeps public JavaScript package paths stable. It also adds declarative target plans for mobile, desktop, browser, binary and document-extension formats. The dynamic debug collector is intentionally an unchecked browser boundary because it monkey-patches browser APIs; the rest of the web surface remains strictly typechecked. See [`docs/reorganization-1.8.9.md`](docs/reorganization-1.8.9.md), [`docs/toolchainresearch-1.8.9.md`](docs/toolchainresearch-1.8.9.md) and [`docs/securityaudit-1.8.7.md`](docs/securityaudit-1.8.7.md).
168
+ Version 1.8.14 carries the TypeScript-first source into the current release and keeps public JavaScript package paths stable. It includes release-derived package metadata, queue leases, bounded structured extraction with provenance, browser context budgets, explicit workflow cancellation with caller-owned compensation, deterministic artifact retention decisions and a post-push container pull/smoke validation. The dynamic debug collector is intentionally an unchecked browser boundary because it monkey-patches browser APIs; the rest of the web surface remains strictly typechecked. See [`docs/reorganization-1.8.9.md`](docs/reorganization-1.8.9.md), [`docs/toolchainresearch-1.8.9.md`](docs/toolchainresearch-1.8.9.md), [`docs/releasenotes-1.8.12.md`](docs/releasenotes-1.8.12.md), [`docs/releasenotes-1.8.13.md`](docs/releasenotes-1.8.13.md) and [`docs/releasenotes-1.8.14.md`](docs/releasenotes-1.8.14.md).
131
169
 
132
170
  ## Package surfaces and release automation
133
171
 
134
- Workflows use the release tag and the local `releaseversion` action. They do not contain a manually edited version number. The action fetches the tag, checks out its commit and rejects a release when the tag version does not match the root `package.json`.
172
+ Workflows use the release tag and the local `releaseversion` action. They do not contain a manually edited version number. The action fetches the tag, checks out its commit and rejects a release when the tag version does not match the root `package.json`. The `created` release event fans out to the six registry workflows, so NuGet, Maven, RubyGems, GitHub Packages npm, public npmjs and GHCR receive the same validated version from one source of truth.
135
173
 
136
174
  | Registry | Artifact | Workflow |
137
175
  | --- | --- | --- |
176
+ | GHCR | `ghcr.io/wenathlan/saddle:<version>` | `publishghcr.yml` |
138
177
  | GitHub Packages npm | `@wenathlan/saddle@<version>` | `publishgithubnpm.yml` |
139
178
  | Public npmjs | `@wenathlan/saddle@<version>` | `publishnpmjs.yml` |
140
- | GHCR | `ghcr.io/wenathlan/saddle:<version>` | `publishghcr.yml` |
141
179
  | Maven | `io.wenathlan:saddle:<version>` | `publishmaven.yml` |
142
180
  | NuGet | `Saddle.<version>.nupkg` | `publishnuget.yml` |
143
181
  | RubyGems | `saddle <version>` | `publishrubygems.yml` |
@@ -176,7 +214,7 @@ npm run web:check
176
214
  VITE_BASE_PATH=/saddle npm run web:build:pages
177
215
  ```
178
216
 
179
- The engine test suite is deterministic and does not require real credentials or network access. The release path is: update `package.json` and the manifest files, update `changelog.md`, run all gates, create `v<package-version>`, push the tag and create the GitHub release. Registry workflows then derive the same version from that release tag.
217
+ The engine test suite is deterministic and does not require real credentials or network access. The release path is: update `package.json` and the manifest files, update `changelog.md` and release notes, run all gates, create `v<package-version>`, push the tag and create the GitHub release. Registry workflows then derive the same version from that release tag. A package metadata change alone does not publish anything; the release tag is the intentional publication boundary.
180
218
 
181
219
  ## Repository map
182
220
 
@@ -207,11 +245,11 @@ The engine is TypeScript-first ESM with English JSDoc comments and a generated J
207
245
 
208
246
  ## Historical documentation
209
247
 
210
- Earlier README snapshots remain in `docs/plans/README.md`, `docs/talks9/README.md` and `docs/talks9/README (2).md` as archival evidence. Their useful architecture ideas were consolidated here, while stale `@devthink`, `@iakadion`, `io.devthink`, Node 20/22, `client/src` and speculative provider quotas were not copied into the canonical contract.
248
+ Earlier root README snapshots and platform READMEs remain in `docs/plans/README.md`, `docs/talks9/README.md`, `docs/talks9/README (2).md`, `android/README.md`, `browser/README.md`, `desktop/README.md`, `extension/README.md` and `ios/README.md` as archival or surface-specific evidence. Their useful architecture ideas were consolidated here, while stale `@wenathlan`, `@iakadion`, `io.devthink`, Node 20/22, `client/src`, speculative provider quotas and unimplemented hosted services were not copied into the canonical contract.
211
249
 
212
250
  ## Current scope
213
251
 
214
- Version 1.8.11 extends the TypeScript-first engine with flat project-owned desktop, Android and iOS build surfaces, explicit Capacitor staging boundaries, dotted release asset naming and helper-binary rejection. Browser binaries, provider credentials, n8n host registration, persistent databases, captcha solvers and production deployment remain caller-selected adapters. Future work should extend contracts without coupling the core to one forge, registry, browser or storage vendor.
252
+ Version 1.8.14 extends the TypeScript-first engine with flat project-owned desktop, Android and iOS build surfaces, explicit Capacitor staging boundaries, dotted release asset naming, helper-binary rejection, structured extraction provenance, browser context budgets, resumable workflow compensation, retention metadata and a container image that is pulled and smoke-tested after publication. Browser binaries, provider credentials, n8n host registration, persistent databases, captcha solvers and production deployment remain caller-selected adapters. Future work should extend contracts without coupling the core to one forge, registry, browser or storage vendor.
215
253
 
216
254
  ## License
217
255
 
@@ -0,0 +1,27 @@
1
+ /**
2
+ * archive inspection validates declared entry metadata before any caller-owned extraction adapter runs.
3
+ */
4
+ /** Validates portable archive limits without opening an archive. */
5
+ export declare function archivelimits(input?: {}): Readonly<{
6
+ maxentries: number;
7
+ maxdepth: number;
8
+ maxoutputbytes: number;
9
+ maxratio: number;
10
+ }>;
11
+ /** Inspects declared archive entries and returns explicit acceptance or denial evidence. */
12
+ export declare function archiveinspection(input?: {}): Readonly<{
13
+ version: 1;
14
+ state: "accepted" | "denied";
15
+ limits: Readonly<{
16
+ maxentries: number;
17
+ maxdepth: number;
18
+ maxoutputbytes: number;
19
+ maxratio: number;
20
+ }>;
21
+ entries: any;
22
+ outputbytes: number;
23
+ reasons: readonly any[];
24
+ }>;
25
+ /** Requires a caller-owned extraction adapter and denies an unsafe inspection result. */
26
+ export declare function extractarchive(inspection: any, adapter: any): Promise<any>;
27
+ //# sourceMappingURL=archive.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"archive.d.ts","sourceRoot":"","sources":["../../binary/archive.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,oEAAoE;AACpE,wBAAgB,aAAa,CAAC,KAAK,KAAK;;;;;GAEvC;AAED,4FAA4F;AAC5F,wBAAgB,iBAAiB,CAAC,KAAK,KAAK;;;;;;;;;;;;GAe3C;AAED,yFAAyF;AACzF,wBAAsB,cAAc,CAAC,UAAU,KAAA,EAAE,OAAO,KAAA,gBAIvD"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * archive inspection validates declared entry metadata before any caller-owned extraction adapter runs.
3
+ */
4
+ /** Validates portable archive limits without opening an archive. */
5
+ export function archivelimits(input = {}) {
6
+ return Object.freeze({ maxentries: positive(input.maxentries ?? 1, "archive maxentries"), maxdepth: positive(input.maxdepth ?? 1, "archive maxdepth"), maxoutputbytes: positive(input.maxoutputbytes ?? 1, "archive maxoutputbytes"), maxratio: positive(input.maxratio ?? 1, "archive maxratio") });
7
+ }
8
+ /** Inspects declared archive entries and returns explicit acceptance or denial evidence. */
9
+ export function archiveinspection(input = {}) {
10
+ const limits = archivelimits(input.limits);
11
+ if (!Array.isArray(input.entries))
12
+ throw new TypeError("archive entries must be an array");
13
+ const entries = input.entries.map((entry) => normalizeentry(entry));
14
+ const reasons = [];
15
+ if (entries.length > limits.maxentries)
16
+ reasons.push("entrycount");
17
+ let outputbytes = 0;
18
+ for (const entry of entries) {
19
+ outputbytes += entry.sizebytes;
20
+ if (entry.depth > limits.maxdepth)
21
+ reasons.push(`depth:${entry.path}`);
22
+ if (entry.path.split("/").includes("..") || entry.path.startsWith("/"))
23
+ reasons.push(`path:${entry.path}`);
24
+ if (entry.sizebytes / Math.max(1, entry.compressedbytes) > limits.maxratio)
25
+ reasons.push(`ratio:${entry.path}`);
26
+ }
27
+ if (outputbytes > limits.maxoutputbytes)
28
+ reasons.push("outputbytes");
29
+ return Object.freeze({ version: 1, state: reasons.length === 0 ? "accepted" : "denied", limits, entries: Object.freeze(entries), outputbytes, reasons: Object.freeze([...new Set(reasons)]) });
30
+ }
31
+ /** Requires a caller-owned extraction adapter and denies an unsafe inspection result. */
32
+ export async function extractarchive(inspection, adapter) {
33
+ if (inspection?.state !== "accepted")
34
+ throw archiveerror("ARCHIVE_POLICY_DENIED", "archive inspection must be accepted before extraction");
35
+ if (typeof adapter?.extract !== "function")
36
+ throw archiveerror("ARCHIVE_EXTRACTION_UNAVAILABLE", "archive extraction adapter is required");
37
+ return adapter.extract(inspection);
38
+ }
39
+ function normalizeentry(input) { const path = String(input?.path ?? ""); if (!path)
40
+ throw new TypeError("archive entry path is required"); return Object.freeze({ path, sizebytes: nonnegative(input.sizebytes, "archive entry sizebytes"), compressedbytes: nonnegative(input.compressedbytes, "archive entry compressedbytes"), depth: path.split("/").filter(Boolean).length }); }
41
+ function nonnegative(value, name) { const output = Number(value); if (!Number.isSafeInteger(output) || output < 0)
42
+ throw new TypeError(`${name} must be a non-negative safe integer`); return output; }
43
+ function positive(value, name) { const output = nonnegative(value, name); if (output < 1)
44
+ throw new TypeError(`${name} must be positive`); return output; }
45
+ function archiveerror(code, message) { const error = new Error(message); error.code = code; return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CAAC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC,OAAO,KAAK,CAAC,CAAC,CAAC"}
@@ -0,0 +1,70 @@
1
+ /** Classifies a small binary prefix without trusting a filename extension. */
2
+ export declare function magicbytes(input: any): Readonly<{
3
+ format: "wasm";
4
+ executable: true;
5
+ }> | Readonly<{
6
+ format: "elf";
7
+ executable: true;
8
+ }> | Readonly<{
9
+ format: "pe";
10
+ executable: true;
11
+ }> | Readonly<{
12
+ format: "zip";
13
+ executable: false;
14
+ }> | Readonly<{
15
+ format: "unknown";
16
+ executable: false;
17
+ }>;
18
+ /** Validates a bounded WASM transformation plan without compiling or instantiating a module. */
19
+ export declare function wasmplan(input?: {}): Readonly<{
20
+ version: 1;
21
+ source: string;
22
+ imports: readonly unknown[];
23
+ budget: Readonly<{
24
+ maxbytes: number;
25
+ maxoutputbytes: number;
26
+ maxmilliseconds: number;
27
+ network: boolean;
28
+ }>;
29
+ target: string;
30
+ policyversion: number;
31
+ state: "caller-executes";
32
+ }>;
33
+ /** Builds a reproducible transformation cache key from verified inputs and normalized policy. */
34
+ export declare function transformationkey(input?: {}): string;
35
+ /** Validates an immutable cache manifest that can be reused only by matching policy and toolchain identities. */
36
+ export declare function transformationcache(input?: {}): Readonly<{
37
+ version: 1;
38
+ key: string;
39
+ source: string;
40
+ compiler: string;
41
+ policyversion: number;
42
+ outputs: any;
43
+ verified: boolean;
44
+ }>;
45
+ /** Explains whether a verified cache manifest can serve a requested transformation. */
46
+ export declare function cachedecision(manifest: any, request: any): Readonly<{
47
+ reusable: boolean;
48
+ reasons: readonly any[];
49
+ manifest: Readonly<{
50
+ version: 1;
51
+ key: string;
52
+ source: string;
53
+ compiler: string;
54
+ policyversion: number;
55
+ outputs: any;
56
+ verified: boolean;
57
+ }>;
58
+ }>;
59
+ /** Rejects cache reuse for outputs that are sensitive, environment-bound, partial, or unverified. */
60
+ export declare function cacheeligibility(input?: {}): Readonly<{
61
+ eligible: boolean;
62
+ reasons: readonly any[];
63
+ }>;
64
+ /** Runs a transformation only through an injected isolated adapter and verifies declared output digests. */
65
+ export declare function executeisolated(plan: any, adapter: any): Promise<Readonly<{
66
+ version: 1;
67
+ state: "completed";
68
+ outputs: any;
69
+ }>>;
70
+ //# sourceMappingURL=transform.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transform.d.ts","sourceRoot":"","sources":["../../binary/transform.ts"],"names":[],"mappings":"AAKA,8EAA8E;AAC9E,wBAAgB,UAAU,CAAC,KAAK,KAAA;;;;;;;;;;;;;;;GAQ/B;AAED,gGAAgG;AAChG,wBAAgB,QAAQ,CAAC,KAAK,KAAK;;;;;;;;;;;;;GAKlC;AAED,iGAAiG;AACjG,wBAAgB,iBAAiB,CAAC,KAAK,KAAK,UAI3C;AAED,iHAAiH;AACjH,wBAAgB,mBAAmB,CAAC,KAAK,KAAK;;;;;;;;GAO7C;AAED,uFAAuF;AACvF,wBAAgB,aAAa,CAAC,QAAQ,KAAA,EAAE,OAAO,KAAA;;;;;;;;;;;;GAU9C;AAED,qGAAqG;AACrG,wBAAgB,gBAAgB,CAAC,KAAK,KAAK;;;GAQ1C;AAED,4GAA4G;AAC5G,wBAAsB,eAAe,CAAC,IAAI,KAAA,EAAE,OAAO,KAAA;;;;IAalD"}
@@ -0,0 +1,105 @@
1
+ /**
2
+ * binary transformation contracts classify inputs and delegate execution to isolated caller-owned adapters.
3
+ */
4
+ import { sha256 } from "../core/hash.js";
5
+ /** Classifies a small binary prefix without trusting a filename extension. */
6
+ export function magicbytes(input) {
7
+ const bytes = tobytes(input);
8
+ const matches = (prefix) => prefix.every((value, index) => bytes[index] === value);
9
+ if (matches([0x00, 0x61, 0x73, 0x6d]))
10
+ return Object.freeze({ format: "wasm", executable: true });
11
+ if (matches([0x7f, 0x45, 0x4c, 0x46]))
12
+ return Object.freeze({ format: "elf", executable: true });
13
+ if (matches([0x4d, 0x5a]))
14
+ return Object.freeze({ format: "pe", executable: true });
15
+ if (matches([0x50, 0x4b, 0x03, 0x04]))
16
+ return Object.freeze({ format: "zip", executable: false });
17
+ return Object.freeze({ format: "unknown", executable: false });
18
+ }
19
+ /** Validates a bounded WASM transformation plan without compiling or instantiating a module. */
20
+ export function wasmplan(input = {}) {
21
+ const source = normalizedigest(input.source, "wasm source");
22
+ const imports = normalizeimports(input.imports);
23
+ const budget = resourcebudget(input.budget);
24
+ return Object.freeze({ version: 1, source, imports, budget, target: String(input.target ?? "wasm"), policyversion: positive(input.policyversion ?? 1, "wasm policyversion"), state: "caller-executes" });
25
+ }
26
+ /** Builds a reproducible transformation cache key from verified inputs and normalized policy. */
27
+ export function transformationkey(input = {}) {
28
+ const plan = wasmplan(input.plan ?? input);
29
+ const compiler = normalizedigest(input.compiler, "transformation compiler");
30
+ return sha256(JSON.stringify({ source: plan.source, imports: plan.imports, budget: plan.budget, target: plan.target, policyversion: plan.policyversion, compiler }));
31
+ }
32
+ /** Validates an immutable cache manifest that can be reused only by matching policy and toolchain identities. */
33
+ export function transformationcache(input = {}) {
34
+ const source = normalizedigest(input.source, "transformation cache source");
35
+ const compiler = normalizedigest(input.compiler, "transformation cache compiler");
36
+ const key = normalizedigest(input.key, "transformation cache key");
37
+ const outputs = Array.isArray(input.outputs) ? input.outputs.map((output) => Object.freeze({ name: nonempty(output?.name, "transformation cache output name"), sha256: normalizedigest(output?.sha256, "transformation cache output sha256"), sizebytes: positive(output?.sizebytes, "transformation cache output sizebytes") })) : [];
38
+ if (outputs.length === 0)
39
+ throw new TypeError("transformation cache outputs are required");
40
+ return Object.freeze({ version: 1, key, source, compiler, policyversion: positive(input.policyversion, "transformation cache policyversion"), outputs: Object.freeze(outputs), verified: input.verified === true });
41
+ }
42
+ /** Explains whether a verified cache manifest can serve a requested transformation. */
43
+ export function cachedecision(manifest, request) {
44
+ const cached = transformationcache(manifest);
45
+ const requested = transformationcache(request);
46
+ const reasons = [];
47
+ if (!cached.verified)
48
+ reasons.push("unverified");
49
+ if (cached.key !== requested.key)
50
+ reasons.push("key");
51
+ if (cached.source !== requested.source)
52
+ reasons.push("source");
53
+ if (cached.compiler !== requested.compiler)
54
+ reasons.push("compiler");
55
+ if (cached.policyversion !== requested.policyversion)
56
+ reasons.push("policyversion");
57
+ return Object.freeze({ reusable: reasons.length === 0, reasons: Object.freeze(reasons), manifest: cached });
58
+ }
59
+ /** Rejects cache reuse for outputs that are sensitive, environment-bound, partial, or unverified. */
60
+ export function cacheeligibility(input = {}) {
61
+ const reasons = [];
62
+ if (input.verified !== true)
63
+ reasons.push("unverified");
64
+ if (input.containssecrets === true)
65
+ reasons.push("secrets");
66
+ if (input.containsprivate === true)
67
+ reasons.push("private-data");
68
+ if (input.environmentbound === true)
69
+ reasons.push("environment-bound");
70
+ if (input.partial === true)
71
+ reasons.push("partial");
72
+ return Object.freeze({ eligible: reasons.length === 0, reasons: Object.freeze(reasons) });
73
+ }
74
+ /** Runs a transformation only through an injected isolated adapter and verifies declared output digests. */
75
+ export async function executeisolated(plan, adapter) {
76
+ if (typeof adapter?.execute !== "function")
77
+ throw transformerror("ISOLATED_EXECUTION_UNAVAILABLE", "isolated transformation adapter is required");
78
+ const result = await adapter.execute(wasmplan(plan));
79
+ const outputs = Array.isArray(result?.outputs) ? result.outputs : [];
80
+ if (outputs.length === 0)
81
+ throw transformerror("ISOLATED_EXECUTION_OUTPUT_INVALID", "isolated transformation returned no outputs");
82
+ const verified = outputs.map((output) => {
83
+ const data = tobytes(output?.data);
84
+ const expected = normalizedigest(output?.sha256, "isolated transformation output sha256");
85
+ const actual = sha256(data);
86
+ if (actual !== expected)
87
+ throw transformerror("ISOLATED_EXECUTION_DIGEST_MISMATCH", "isolated transformation output digest did not match");
88
+ return Object.freeze({ name: nonempty(output?.name, "isolated transformation output name"), data, sha256: actual, sizebytes: data.byteLength });
89
+ });
90
+ return Object.freeze({ version: 1, state: "completed", outputs: Object.freeze(verified) });
91
+ }
92
+ function resourcebudget(input = {}) { return Object.freeze({ maxbytes: positive(input.maxbytes ?? 1, "wasm budget maxbytes"), maxoutputbytes: positive(input.maxoutputbytes ?? input.maxbytes ?? 1, "wasm budget maxoutputbytes"), maxmilliseconds: positive(input.maxmilliseconds ?? 1, "wasm budget maxmilliseconds"), network: input.network === true }); }
93
+ function normalizeimports(input) { if (!Array.isArray(input ?? []))
94
+ throw new TypeError("wasm imports must be an array"); return Object.freeze([...new Set(input.map((value) => nonempty(value, "wasm import")))].sort()); }
95
+ function normalizedigest(value, name) { const digest = String(value ?? "").toLowerCase(); if (!/^[a-f0-9]{64}$/.test(digest))
96
+ throw new TypeError(`${name} sha256 is invalid`); return digest; }
97
+ function nonempty(value, name) { const output = String(value ?? ""); if (!output)
98
+ throw new TypeError(`${name} is required`); return output; }
99
+ function positive(value, name) { const numeric = Number(value); if (!Number.isSafeInteger(numeric) || numeric < 1)
100
+ throw new TypeError(`${name} must be a positive safe integer`); return numeric; }
101
+ function tobytes(value) { if (value instanceof Uint8Array)
102
+ return new Uint8Array(value); if (value instanceof ArrayBuffer)
103
+ return new Uint8Array(value); throw new TypeError("binary input must be Uint8Array or ArrayBuffer"); }
104
+ function transformerror(code, message) { const error = new Error(message); error.code = code; return error; }
105
+ //# sourceMappingURL=transform.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transform.js","sourceRoot":"","sources":["../../binary/transform.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,8EAA8E;AAC9E,MAAM,UAAU,UAAU,CAAC,KAAK;IAC9B,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;IAC7B,MAAM,OAAO,GAAG,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,KAAK,CAAC,CAAC;IACnF,IAAI,OAAO,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CA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,MAAM,IAAI,SAAS,CAAC,GAAG,IAAI,kCAAkC,CAAC,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,CAAC;AACpM,SAAS,OAAO,CAAC,KAAK,IAAI,IAAI,KAAK,YAAY,UAAU;IAAE,OAAO,IAAI,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,YAAY,WAAW;IAAE,OAAO,IAAI,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,IAAI,SAAS,CAAC,gDAAgD,CAAC,CAAC,CAAC,CAAC;AACjO,SAAS,cAAc,CAAC,IAAI,EAAE,OAAO,IAAI,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC,OAAO,KAAK,CAAC,CAAC,CAAC"}
@@ -0,0 +1,35 @@
1
+ /** Creates an ordered immutable delivery manifest from verified chunk metadata. */
2
+ export declare function deliverymanifest(input?: {}): Readonly<{
3
+ version: 1;
4
+ id: string;
5
+ chunks: any;
6
+ totalbytes: any;
7
+ visibility: "private" | "public";
8
+ }>;
9
+ /** Verifies supplied chunk bytes against a manifest without executing, importing, or caching them. */
10
+ export declare function verifydelivery(manifest: any, supplied?: any[]): Readonly<{
11
+ version: 1;
12
+ valid: any;
13
+ results: any;
14
+ }>;
15
+ /** Produces a host PWA plan that never registers a service worker or mutates browser state. */
16
+ export declare function pwaplan(input?: {}): Readonly<{
17
+ version: 1;
18
+ scope: string;
19
+ offline: boolean;
20
+ state: "caller-registers" | "unsupported";
21
+ update: "manual" | "prompt";
22
+ cache: "caller-configures" | "disabled";
23
+ }>;
24
+ /** Validates a caller-reported CDN capability set without contacting a CDN provider. */
25
+ export declare function cdncapabilities(input?: {}): Readonly<{
26
+ version: 1;
27
+ immutable: boolean;
28
+ purge: boolean;
29
+ range: boolean;
30
+ integrityheaders: boolean;
31
+ cors: boolean;
32
+ visibility: "private" | "public";
33
+ state: "caller-reports";
34
+ }>;
35
+ //# sourceMappingURL=manifest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../delivery/manifest.ts"],"names":[],"mappings":"AAKA,mFAAmF;AACnF,wBAAgB,gBAAgB,CAAC,KAAK,KAAK;;;;;;GAQ1C;AAED,sGAAsG;AACtG,wBAAgB,cAAc,CAAC,QAAQ,KAAA,EAAE,QAAQ,QAAK;;;;GAarD;AAED,+FAA+F;AAC/F,wBAAgB,OAAO,CAAC,KAAK,KAAK;;;;;;;GAMjC;AAED,wFAAwF;AACxF,wBAAgB,eAAe,CAAC,KAAK,KAAK;;;;;;;;;GAGzC"}
@@ -0,0 +1,68 @@
1
+ /**
2
+ * delivery manifests verify immutable chunks and keep PWA registration caller-owned.
3
+ */
4
+ import { sha256 } from "../core/hash.js";
5
+ /** Creates an ordered immutable delivery manifest from verified chunk metadata. */
6
+ export function deliverymanifest(input = {}) {
7
+ const chunks = Array.isArray(input.chunks) ? input.chunks.map(normalizechunk) : [];
8
+ if (chunks.length === 0)
9
+ throw new TypeError("delivery manifest chunks are required");
10
+ const seen = new Set();
11
+ for (const chunk of chunks) {
12
+ if (seen.has(chunk.id))
13
+ throw new TypeError(`delivery manifest chunk id is duplicated: ${chunk.id}`);
14
+ seen.add(chunk.id);
15
+ }
16
+ const ordered = chunks.sort((left, right) => left.index - right.index || left.id.localeCompare(right.id));
17
+ for (let index = 0; index < ordered.length; index += 1)
18
+ if (ordered[index].index !== index)
19
+ throw new TypeError("delivery manifest chunk indexes must be contiguous");
20
+ return Object.freeze({ version: 1, id: nonempty(input.id, "delivery manifest id"), chunks: Object.freeze(ordered), totalbytes: ordered.reduce((total, chunk) => total + chunk.sizebytes, 0), visibility: input.visibility === "private" ? "private" : "public" });
21
+ }
22
+ /** Verifies supplied chunk bytes against a manifest without executing, importing, or caching them. */
23
+ export function verifydelivery(manifest, supplied = []) {
24
+ const expected = deliverymanifest(manifest);
25
+ if (!Array.isArray(supplied))
26
+ throw new TypeError("delivery chunks must be an array");
27
+ const values = new Map(supplied.map((value) => [String(value?.id ?? ""), value]));
28
+ const results = expected.chunks.map((chunk) => {
29
+ const suppliedchunk = values.get(chunk.id);
30
+ if (!suppliedchunk)
31
+ return Object.freeze({ id: chunk.id, state: "missing" });
32
+ const data = tobytes(suppliedchunk.data);
33
+ const digest = sha256(data);
34
+ if (data.byteLength !== chunk.sizebytes || digest !== chunk.sha256)
35
+ return Object.freeze({ id: chunk.id, state: "mismatch", sizebytes: data.byteLength, sha256: digest });
36
+ return Object.freeze({ id: chunk.id, state: "verified", sizebytes: data.byteLength, sha256: digest });
37
+ });
38
+ return Object.freeze({ version: 1, valid: results.every((result) => result.state === "verified"), results: Object.freeze(results) });
39
+ }
40
+ /** Produces a host PWA plan that never registers a service worker or mutates browser state. */
41
+ export function pwaplan(input = {}) {
42
+ const scope = String(input.scope ?? "");
43
+ if (!scope.startsWith("/"))
44
+ throw new TypeError("PWA scope must start with a slash");
45
+ const serviceworker = input.capabilities?.serviceworker === true;
46
+ const offline = input.offline === true;
47
+ return Object.freeze({ version: 1, scope, offline, state: serviceworker ? "caller-registers" : "unsupported", update: input.update === "manual" ? "manual" : "prompt", cache: offline ? "caller-configures" : "disabled" });
48
+ }
49
+ /** Validates a caller-reported CDN capability set without contacting a CDN provider. */
50
+ export function cdncapabilities(input = {}) {
51
+ const visibility = input.visibility === "private" ? "private" : "public";
52
+ return Object.freeze({ version: 1, immutable: input.immutable === true, purge: input.purge === true, range: input.range === true, integrityheaders: input.integrityheaders === true, cors: input.cors === true, visibility, state: "caller-reports" });
53
+ }
54
+ const contenttypes = new Set(["application/javascript", "application/wasm", "application/octet-stream", "application/json", "text/plain"]);
55
+ function normalizechunk(input, index) { const contenttype = String(input?.contenttype ?? "application/octet-stream"); if (!contenttypes.has(contenttype))
56
+ throw new TypeError(`delivery manifest content type is unsupported: ${contenttype}`); return Object.freeze({ id: nonempty(input?.id, "delivery manifest chunk id"), index: safeindex(input?.index ?? index), sha256: digest(input?.sha256, "delivery manifest chunk sha256"), sizebytes: positive(input?.sizebytes, "delivery manifest chunk sizebytes"), contenttype }); }
57
+ function nonempty(value, name) { const output = String(value ?? ""); if (!output)
58
+ throw new TypeError(`${name} is required`); return output; }
59
+ function digest(value, name) { const output = String(value ?? "").toLowerCase(); if (!/^[a-f0-9]{64}$/.test(output))
60
+ throw new TypeError(`${name} is invalid`); return output; }
61
+ function safeindex(value) { const output = Number(value); if (!Number.isSafeInteger(output) || output < 0)
62
+ throw new TypeError("delivery manifest chunk index is invalid"); return output; }
63
+ function positive(value, name) { const output = Number(value); if (!Number.isSafeInteger(output) || output < 1)
64
+ throw new TypeError(`${name} must be a positive safe integer`); return output; }
65
+ function tobytes(value) { if (value instanceof Uint8Array)
66
+ return value; if (value instanceof ArrayBuffer)
67
+ return new Uint8Array(value); throw new TypeError("delivery chunk data must be Uint8Array or ArrayBuffer"); }
68
+ //# sourceMappingURL=manifest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../delivery/manifest.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,mFAAmF;AACnF,MAAM,UAAU,gBAAgB,CAAC,KAAK,GAAG,EAAE;IACzC,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACnF,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,MAAM,IAAI,SAAS,CAAC,uCAAuC,CAAC,CAAC;IACtF,MAAM,IAAI,GAAG,IAAI,GAAG,EAAE,CAAC;IACvB,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAAC,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;YAA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C,WAAW,EAAE,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC;IAAE,MAAM,IAAI,SAAS,CAAC,GAAG,IAAI,aAAa,CAAC,CAAC,CAAC,OAAO,MAAM,CAAC,CAAC,CAAC;AAChL,SAAS,SAAS,CAAC,KAAK,IAAI,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,MAAM,GAAG,CAAC;IAAE,MAAM,IAAI,SAAS,CAAC,0CAA0C,CAAC,CAAC,CAAC,OAAO,MAAM,CAAC,CAAC,CAAC;AAC5L,SAAS,QAAQ,CAAC,KAAK,EAAE,IAAI,IAAI,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,MAAM,GAAG,CAAC;IAAE,MAAM,IAAI,SAAS,CAAC,GAAG,IAAI,kCAAkC,CAAC,CAAC,CAAC,OAAO,MAAM,CAAC,CAAC,CAAC;AAChM,SAAS,OAAO,CAAC,KAAK,IAAI,IAAI,KAAK,YAAY,UAAU;IAAE,OAAO,KAAK,CAAC,CAAC,IAAI,KAAK,YAAY,WAAW;IAAE,OAAO,IAAI,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,IAAI,SAAS,CAAC,uDAAuD,CAAC,CAAC,CAAC,CAAC"}
package/dist/index.d.ts CHANGED
@@ -15,6 +15,7 @@ export * from "./memory/objects.js";
15
15
  export * from "./memory/targets.js";
16
16
  export * from "./memory/transforms.js";
17
17
  export * from "./memory/engine.js";
18
+ export * from "./memory/planner.js";
18
19
  export * from "./runners/inprocess.js";
19
20
  export * from "./runners/scheduler.js";
20
21
  export * from "./runtime/engine.js";
@@ -22,8 +23,10 @@ export * from "./storage/adapter.js";
22
23
  export * from "./storage/cache.js";
23
24
  export * from "./storage/content.js";
24
25
  export * from "./storage/memory.js";
26
+ export * from "./storage/pool.js";
25
27
  export * from "./storage/sync.js";
26
28
  export * from "./runners/health.js";
29
+ export * from "./runners/chain.js";
27
30
  export * from "./runners/heartbeat.js";
28
31
  export * from "./workflow/triggers.js";
29
32
  export * from "./dispatch/resumable.js";
@@ -37,6 +40,7 @@ export * from "./mcp/browser.js";
37
40
  export * from "./apps/registry.js";
38
41
  export * from "./bot/permissions.js";
39
42
  export * from "./webhook/delivery.js";
43
+ export * from "./delivery/manifest.js";
40
44
  export * from "./storage/chunked.js";
41
45
  export * from "./storage/s3compatible.js";
42
46
  export * from "./modes/modes.js";
@@ -98,6 +102,7 @@ export * from "./surfaces/n8n.js";
98
102
  export * from "./surfaces/adapters.js";
99
103
  export * from "./surfaces/controls.js";
100
104
  export * from "./surfaces/operations.js";
105
+ export * from "./surfaces/requirements.js";
101
106
  export * from "./library/public.js";
102
107
  export * from "./runtime/retry.js";
103
108
  export * from "./storage/githubcontents.js";
@@ -108,6 +113,8 @@ export * from "./api/security.js";
108
113
  export * from "./modes/matrix.js";
109
114
  export * from "./modes/resolve.js";
110
115
  export * from "./binary/build.js";
116
+ export * from "./binary/archive.js";
117
+ export * from "./binary/transform.js";
111
118
  export * from "./api/rate.js";
112
119
  export * from "./api/http.js";
113
120
  export * from "./api/service.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc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