antpath 0.10.15 → 0.11.4

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/LICENSE +201 -0
  2. package/README.md +16 -8
  3. package/dist/_shared/blueprint.d.ts +93 -108
  4. package/dist/_shared/blueprint.js +144 -78
  5. package/dist/_shared/cleanup-policy.d.ts +2 -2
  6. package/dist/_shared/cleanup-policy.js +2 -5
  7. package/dist/_shared/http.d.ts +2 -2
  8. package/dist/_shared/index.d.ts +5 -1
  9. package/dist/_shared/index.js +5 -1
  10. package/dist/_shared/mcp-proxy-url.d.ts +55 -0
  11. package/dist/_shared/mcp-proxy-url.js +65 -0
  12. package/dist/_shared/operations.d.ts +7 -8
  13. package/dist/_shared/operations.js +14 -20
  14. package/dist/_shared/provider-proxy-url.d.ts +64 -0
  15. package/dist/_shared/provider-proxy-url.js +73 -0
  16. package/dist/_shared/proxy-validation.d.ts +1 -1
  17. package/dist/_shared/proxy-validation.js +2 -2
  18. package/dist/_shared/run-unit.d.ts +23 -36
  19. package/dist/_shared/run-unit.js +30 -46
  20. package/dist/_shared/runner-event.d.ts +120 -0
  21. package/dist/_shared/runner-event.js +193 -0
  22. package/dist/_shared/runner-job.d.ts +159 -0
  23. package/dist/_shared/runner-job.js +54 -0
  24. package/dist/_shared/runtime-manifest.d.ts +191 -0
  25. package/dist/_shared/runtime-manifest.js +221 -0
  26. package/dist/_shared/runtime-types.d.ts +7 -16
  27. package/dist/_shared/stable.d.ts +15 -10
  28. package/dist/_shared/stable.js +15 -10
  29. package/dist/_shared/submission.d.ts +221 -73
  30. package/dist/_shared/submission.js +442 -212
  31. package/dist/_shared/telemetry.d.ts +2 -2
  32. package/dist/_shared/telemetry.js +2 -2
  33. package/dist/_shared/template/index.d.ts +0 -1
  34. package/dist/_shared/template/index.js +0 -1
  35. package/dist/agents-md.d.ts +25 -67
  36. package/dist/agents-md.js +35 -121
  37. package/dist/agents-md.js.map +1 -1
  38. package/dist/asset-upload.d.ts +34 -0
  39. package/dist/asset-upload.js +34 -0
  40. package/dist/asset-upload.js.map +1 -1
  41. package/dist/blueprint.d.ts +3 -3
  42. package/dist/bundle.d.ts +2 -2
  43. package/dist/bundle.js +1 -1
  44. package/dist/cli.mjs +191 -100
  45. package/dist/cli.mjs.sha256 +1 -1
  46. package/dist/client.d.ts +56 -19
  47. package/dist/client.js +147 -125
  48. package/dist/client.js.map +1 -1
  49. package/dist/file.d.ts +28 -94
  50. package/dist/file.js +35 -175
  51. package/dist/file.js.map +1 -1
  52. package/dist/index.d.ts +5 -5
  53. package/dist/index.js +4 -0
  54. package/dist/index.js.map +1 -1
  55. package/dist/mcp-server.d.ts +10 -2
  56. package/dist/mcp-server.js +17 -2
  57. package/dist/mcp-server.js.map +1 -1
  58. package/dist/skill.d.ts +44 -214
  59. package/dist/skill.js +50 -284
  60. package/dist/skill.js.map +1 -1
  61. package/dist/version.d.ts +1 -1
  62. package/dist/version.js +1 -1
  63. package/dist/version.js.map +1 -1
  64. package/docs/cleanup.md +1 -1
  65. package/docs/credentials.md +2 -2
  66. package/docs/events.md +8 -8
  67. package/docs/outputs.md +2 -0
  68. package/docs/quickstart.md +18 -2
  69. package/docs/skills.md +1 -3
  70. package/docs/templates.md +6 -5
  71. package/package.json +3 -2
  72. package/dist/_shared/secrets.d.ts +0 -7
  73. package/dist/_shared/secrets.js +0 -20
  74. package/dist/_shared/template/mapper.d.ts +0 -11
  75. package/dist/_shared/template/mapper.js +0 -70
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for describing the origin of the Work and
141
+ reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 antpath contributors
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
200
+ implied. See the License for the specific language governing
201
+ permissions and limitations under the License.
package/README.md CHANGED
@@ -4,11 +4,11 @@ title: antpath
4
4
 
5
5
  # antpath
6
6
 
7
- antpath is a TypeScript-first SDK + CLI for running autonomous Claude Managed Agents sessions through a managed antpath dashboard. Everything an agent or human needs is reachable through **one** import and **one** binary.
7
+ antpath is a TypeScript-first SDK + CLI for running autonomous Claude Managed Agents sessions through the managed antpath service. Everything an agent or human needs is reachable through **one** import and **one** binary.
8
8
 
9
9
  ```ts
10
10
  import {
11
- AntpathClient, // the only client class — submits durable runs to a dashboard
11
+ AntpathClient, // the only client class — submits durable runs to antpath
12
12
  Skill, // workspace / provider / inline skill bundles
13
13
  McpServer, // MCP server declarations (headers split into secrets server-side)
14
14
  ProxyEndpoint, // per-run managed HTTP proxy endpoint
@@ -34,12 +34,20 @@ antpath skills <upload|list|get|delete> [flags] --api-token …
34
34
 
35
35
  The SDK class and the CLI are backed by the same `@antpath/shared` operations module — any read or write you can do through one, you can do through the other, against the same durable run records. The same npm package also ships the in-container `antpath` CLI as its `bin` entry; the worker mounts that CLI inside every run at `/mnt/session/uploads/antpath/antpath` (Anthropic Managed Agents rebases every session-resource mount under `/mnt/session/uploads/`, and mounted files have no execute permission so they are invoked through `node`), so skills can call `node /mnt/session/uploads/antpath/antpath proxy …` against the per-run manifest. See [Agent-first surface design](../../references/development-principles.md#agent-first-surface-design).
36
36
 
37
- The dashboard URL defaults to `https://www.antpath.ai`. Self-hosted deployments override with `--dashboard-url` on the CLI or `baseUrl` on `AntpathClient`. The workspace is derived server-side from your API token (1:1 binding), so there is no `--workspace` flag and no `workspaceId` option.
37
+ The antpath URL defaults to `https://api.antpath.ai`. Self-hosted deployments override with `--antpath-url` on the CLI or `baseUrl` on `AntpathClient`. The workspace is derived server-side from your API token (1:1 binding), so there is no `--workspace` flag and no `workspaceId` option.
38
38
 
39
- ## MVP boundaries
39
+ ## Product boundaries
40
40
 
41
- - Claude Managed Agents only.
42
- - BYO Anthropic key + MCP credentials + skill references passed inline on every submission, vaulted for the lifetime of a single run, destroyed at cleanup.
41
+ - Multi-provider via the 2026 dual-runtime architecture. The published surface is the same regardless of provider:
42
+ - `provider: "anthropic"`defaults to the Anthropic Native runtime
43
+ (direct `/v1/messages` from the edge). Opt into the multi-provider
44
+ runner with `runtime: "managed"`.
45
+ - `provider: "deepseek" | "openai" | "gemini" | "mistral"` — Goose
46
+ Managed runtime, per-run Fly Machine spawning the `runner-image/`
47
+ container. BYOK provider-proxy on `api.antpath.ai` injects the
48
+ customer's key on the edge (the SDK never sees an upstream key).
49
+ - See `references/platform-rebuild-2026.md` for the full split.
50
+ - BYO provider key + MCP credentials + skill references — passed inline on every submission, vaulted for the lifetime of a single run, destroyed at cleanup. Cross-provider keys are rejected loudly at submission time.
43
51
  - Workspace is the tenant boundary. Workspace identity is derived server-side from the API token (1:1 binding); the SDK / CLI never name it.
44
52
  - No SDK-side storage of provider keys, MCP credentials, or output file contents.
45
53
  - Cleanup runs by default; opt into retention with `cleanup.session: "retain"`.
@@ -51,7 +59,7 @@ import { AntpathClient } from "antpath";
51
59
 
52
60
  const client = new AntpathClient({
53
61
  apiToken: process.env.ANTPATH_API_TOKEN!
54
- // baseUrl defaults to https://www.antpath.ai — set it for self-hosted deployments.
62
+ // baseUrl defaults to https://api.antpath.ai — set it for self-hosted deployments.
55
63
  });
56
64
 
57
65
  const ref = await client.submitRun({
@@ -120,7 +128,7 @@ antpath run \
120
128
 
121
129
  ```text
122
130
  pnpm test # unit (deterministic; uses fakes/snapshots)
123
- pnpm test:e2e:live # full top-to-bottom against a real dashboard + Anthropic
131
+ pnpm test:e2e:live # full top-to-bottom against a real antpath stack + Anthropic
124
132
  pnpm test:user # offline; exercises the published package via npm install
125
133
  pnpm test:user:live # live; same but hits the real platform
126
134
  ```
@@ -40,7 +40,7 @@
40
40
  * Skill custody) and `references/development-principles.md` (Agent-first
41
41
  * surface design) for the rationale.
42
42
  */
43
- import type { JsonValue, PlatformCleanupPolicy, PlatformProxyEndpoint, PlatformTemplateEnvironment } from "./submission.js";
43
+ import type { JsonValue, PlatformCleanupPolicy, PlatformProxyEndpoint, PlatformEnvironment } from "./submission.js";
44
44
  /**
45
45
  * Mirrors the CHECK constraint
46
46
  * `skill_bundles_id_format_chk = check (id ~ '^skl_[A-Za-z0-9_-]{8,128}$')`
@@ -78,10 +78,22 @@ export declare const SKILL_BUNDLE_LIMITS: {
78
78
  /** Stored directory mode. */
79
79
  readonly defaultDirMode: 493;
80
80
  };
81
- export type SkillRef = WorkspaceSkillRef | ProviderSkillRef | TransientSkillRef;
82
- export interface WorkspaceSkillRef {
83
- readonly kind: "workspace";
84
- readonly id: string;
81
+ export type SkillRef = ProviderSkillRef | R2SkillRef;
82
+ /**
83
+ * R2-anchored skill ref. Every non-provider skill goes through R2:
84
+ * the SDK uploads to `assets/<workspaceId>/<sha256-hex>` BEFORE
85
+ * submitting the run, so the Worker only ever sees content-addressable
86
+ * references. Validation: R2.head(path), size + workspace-prefix check.
87
+ *
88
+ * `path` is the full R2 key. `hash` is `sha256:<64-hex>`. `name` is
89
+ * the workspace-visible label the agent sees on disk.
90
+ */
91
+ export interface R2SkillRef {
92
+ readonly kind: "r2";
93
+ readonly path: string;
94
+ readonly hash: string;
95
+ readonly sizeBytes: number;
96
+ readonly name: string;
85
97
  }
86
98
  export interface ProviderSkillRef {
87
99
  readonly kind: "provider";
@@ -89,119 +101,63 @@ export interface ProviderSkillRef {
89
101
  readonly skillId: string;
90
102
  readonly version?: string;
91
103
  }
92
- /**
93
- * Per-run, non-persistent skill. The bytes ride alongside the JSON
94
- * submission as a `name="skill:<slot>"` multipart body part and are
95
- * uploaded by the BFF directly to the provider's per-run file storage.
96
- * No `skill_bundles` row, no `run_skill_snapshots` entry, no platform
97
- * storage stop — the BFF tears the file down at run terminal.
98
- *
99
- * `slot` is an SDK-assigned local id that pairs this ref with its
100
- * multipart part within a single `submitRun` call. The BFF rejects any
101
- * submission where the set of `kind:"transient"` refs doesn't have a
102
- * strict 1:1 match against `name="skill:<slot>"` body parts.
103
- *
104
- * `contentHash` is a client-side advisory hash of the canonicalised zip
105
- * (`sha256:<64 hex>`). The BFF recomputes server-side and rejects on
106
- * mismatch; the value is also used by the janitor for orphan
107
- * reconciliation. It MUST be deterministic across retries so the
108
- * idempotency hash converges.
109
- *
110
- * Transient refs DO NOT round-trip safely through JSON — the bytes are
111
- * not in the JSON and cannot be reconstructed. `parseBlueprint` rejects
112
- * them (Blueprints are JSON-persistable and bytes are gone by the time
113
- * `run.json` is loaded). `parseFlatSkills` accepts them (the BFF
114
- * multipart parser is the only place that carries the matching bytes).
115
- */
116
- export interface TransientSkillRef {
117
- readonly kind: "transient";
118
- readonly slot: string;
119
- readonly name: string;
120
- readonly contentHash: string;
121
- }
122
- /**
123
- * Slot id format: `^[a-z][a-z0-9_-]{0,63}$`. The SDK generates these
124
- * positionally as `transient-0`, `transient-1`, … but any client may
125
- * supply an explicit slot as long as it matches the pattern and is
126
- * unique within the submission.
127
- */
128
- export declare const TRANSIENT_SLOT_PATTERN: RegExp;
129
- /**
130
- * Content-hash format: `^sha256:[0-9a-f]{64}$` (lowercase hex). The
131
- * BFF accepts only this exact prefix; uppercase, base64, or any other
132
- * digest is rejected so the wire form has one stable representation.
133
- */
134
- export declare const TRANSIENT_CONTENT_HASH_PATTERN: RegExp;
135
- export declare function isWorkspaceSkillRef(ref: SkillRef): ref is WorkspaceSkillRef;
104
+ /** Content-hash format: `sha256:<64 lowercase hex>`. */
105
+ export declare const INLINE_CONTENT_HASH_PATTERN: RegExp;
136
106
  export declare function isProviderSkillRef(ref: SkillRef): ref is ProviderSkillRef;
137
- export declare function isTransientSkillRef(ref: SkillRef): ref is TransientSkillRef;
138
- export type AgentsMdRef = WorkspaceAgentsMdRef | TransientAgentsMdRef;
139
- export interface WorkspaceAgentsMdRef {
140
- readonly kind: "workspace_agentsmd";
141
- readonly id: string;
142
- }
107
+ export declare function isR2SkillRef(ref: SkillRef): ref is R2SkillRef;
143
108
  /**
144
- * Inline-supplied AgentsMd content that arrives as the
145
- * `agentsmd:<slot>` part of a multipart `submitRun` body. The BFF
146
- * ingests the bytes into `workspace_files` (kind='agentsmd') at
147
- * submission time and rewrites the ref to `WorkspaceAgentsMdRef`
148
- * before the rest of the run-submission pipeline runs.
149
- *
150
- * `name` becomes the prefix of the auto-suffixed workspace name,
151
- * mirroring the `Skill` per-run-artifact model. `contentHash` is
152
- * the SDK's advisory `sha256:<hex>` for tamper detection.
109
+ * R2 asset path pattern. The Worker validates inbound paths against
110
+ * this so a hostile body can't reach into a foreign workspace or
111
+ * outside the `assets/` prefix.
112
+ * workspaceId is a UUID v4
113
+ * hash is 64 lowercase hex chars (the sha256 digest)
153
114
  */
154
- export interface TransientAgentsMdRef {
155
- readonly kind: "transient_agentsmd";
156
- readonly slot: string;
115
+ export declare const R2_ASSET_PATH_PATTERN: RegExp;
116
+ export type AgentsMdRef = R2AgentsMdRef;
117
+ /** R2-anchored AgentsMd ref. Same materialization model as
118
+ * {@link R2SkillRef}: SDK uploads to `assets/<wsId>/<hash>` before
119
+ * submit; Worker validates + persists the path on the run. */
120
+ export interface R2AgentsMdRef {
121
+ readonly kind: "r2";
122
+ readonly path: string;
123
+ readonly hash: string;
124
+ readonly sizeBytes: number;
157
125
  readonly name: string;
158
- readonly contentHash: string;
159
- }
160
- export declare function isWorkspaceAgentsMdRef(ref: AgentsMdRef): ref is WorkspaceAgentsMdRef;
161
- export declare function isTransientAgentsMdRef(ref: AgentsMdRef): ref is TransientAgentsMdRef;
162
- export type FileRef = WorkspaceFileRef | TransientFileRef;
163
- export interface WorkspaceFileRef {
164
- readonly kind: "workspace_file";
165
- readonly id: string;
166
126
  }
167
- /**
168
- * Inline-supplied File content that arrives as the `file:<slot>`
169
- * part of a multipart `submitRun` body. Single file or a zipped
170
- * folder. The BFF ingests and rewrites the ref to
171
- * `WorkspaceFileRef` before run submission proceeds.
172
- *
173
- * `name` is the workspace-visible name prefix. `contentHash` is the
174
- * SDK's advisory `sha256:<hex>`. `mountPath` is optional — when
175
- * present it overrides the default `/antpath/files/<id>/<rel>`
176
- * `mount_path` we send to Anthropic (the agent sees the file at
177
- * `/mnt/session/uploads/antpath/files/<id>/<rel>` once Anthropic
178
- * rebases the mount).
179
- */
180
- export interface TransientFileRef {
181
- readonly kind: "transient_file";
182
- readonly slot: string;
127
+ export declare function isR2AgentsMdRef(ref: AgentsMdRef): ref is R2AgentsMdRef;
128
+ export type FileRef = R2FileRef;
129
+ /** R2-anchored File ref. Same model as {@link R2SkillRef}; carries
130
+ * `mountPath` for the Anthropic Files mount remap. */
131
+ export interface R2FileRef {
132
+ readonly kind: "r2";
133
+ readonly path: string;
134
+ readonly hash: string;
135
+ readonly sizeBytes: number;
183
136
  readonly name: string;
184
- readonly contentHash: string;
185
137
  readonly mountPath?: string;
186
138
  }
187
- export declare function isWorkspaceFileRef(ref: FileRef): ref is WorkspaceFileRef;
188
- export declare function isTransientFileRef(ref: FileRef): ref is TransientFileRef;
139
+ export declare function isR2FileRef(ref: FileRef): ref is R2FileRef;
189
140
  /**
190
- * Options accepted by `parseSkillRef`. The default (`allowTransient: true`)
191
- * is the BFF submission parser path. The Blueprint parser passes
192
- * `allowTransient: false` because Blueprints can be persisted to disk
193
- * (`antpath run --config run.json`) and the bytes carrying the
194
- * transient slot would already be gone.
141
+ * Parse a `SkillRef` from untrusted input. Used by the BFF run parser
142
+ * and by the operations module when deserialising API responses. Only
143
+ * `kind: "r2"` and `kind: "provider"` are valid; all other historical
144
+ * wire shapes (workspace, inline, transient) were retired when R2
145
+ * became the canonical asset store (Phase D, references/platform-rebuild-2026.md).
195
146
  */
196
- export interface ParseSkillRefOptions {
197
- readonly allowTransient?: boolean;
198
- }
147
+ export declare function parseSkillRef(input: unknown, path: string): SkillRef;
199
148
  /**
200
- * Parse a `SkillRef` from untrusted input. Used by the BFF run parser
201
- * and by the operations module when deserialising API responses. Throws
202
- * with a precise path so the caller can surface a usable error.
149
+ * Common parser for any `kind: "r2"` ref (skill / agentsMd / file).
150
+ * Skills and agentsMd ignore the optional `mountPath` field; file refs
151
+ * use it for the Anthropic Files mount remap.
203
152
  */
204
- export declare function parseSkillRef(input: unknown, path: string, options?: ParseSkillRefOptions): SkillRef;
153
+ export declare function parseR2RefFields(record: Record<string, unknown>, path: string): {
154
+ kind: "r2";
155
+ path: string;
156
+ hash: string;
157
+ sizeBytes: number;
158
+ name: string;
159
+ mountPath?: string;
160
+ };
205
161
  /**
206
162
  * Manifest entry persisted in `skill_bundles.manifest` and
207
163
  * `run_skill_snapshots.manifest`. `path` is forward-slash, relative,
@@ -286,14 +242,36 @@ export declare function validateSkillBundleManifest(input: ReadonlyArray<{
286
242
  * the attach layers can remain independent.
287
243
  */
288
244
  export declare function hasSkillMdAtRoot(manifest: SkillBundleManifest): boolean;
245
+ /**
246
+ * Remote MCP transports Antpath accepts. Both are over HTTP — `http`
247
+ * is the streamable-HTTP transport, `sse` is the event-stream
248
+ * transport. `stdio` is explicitly NOT a value here: local-process
249
+ * MCP is not implemented (see `references/deepseek-runtime-mcp-plan.md`).
250
+ */
251
+ export declare const REMOTE_MCP_TRANSPORTS: readonly ["http", "sse"];
252
+ export type RemoteMcpTransport = (typeof REMOTE_MCP_TRANSPORTS)[number];
253
+ /**
254
+ * Canonical error string for any attempt to declare a stdio-shaped MCP
255
+ * server (`transport: "stdio"`, or a stdio-only field like `command` /
256
+ * `args` / `env`). Pinned in source so every surface — shared parser,
257
+ * SDK builder, CLI flag parser, dashboard form — surfaces the same
258
+ * message and a user can find it via grep.
259
+ */
260
+ export declare const REMOTE_MCP_STDIO_REJECTED_MESSAGE = "stdio MCP servers are not supported by Antpath. Antpath supports remote MCP servers over HTTP/SSE only.";
289
261
  /**
290
262
  * The non-secret half of an MCP server declaration. This is what enters
291
263
  * the hashed submission, the run snapshot, and any audit log. `name`
292
264
  * keys into `secrets.mcpServers` for the per-request headers.
265
+ *
266
+ * `transport` is optional on the wire — when omitted, the runtime is
267
+ * free to pick the default remote transport (`http`). When present, it
268
+ * MUST be one of {@link REMOTE_MCP_TRANSPORTS}; stdio is rejected at
269
+ * parse time.
293
270
  */
294
271
  export interface McpServerRef {
295
272
  readonly name: string;
296
273
  readonly url: string;
274
+ readonly transport?: RemoteMcpTransport;
297
275
  }
298
276
  export declare const MCP_SERVER_NAME_PATTERN: RegExp;
299
277
  /**
@@ -306,6 +284,13 @@ export interface BlueprintMcpServer extends McpServerRef {
306
284
  readonly headers?: Readonly<Record<string, string>>;
307
285
  }
308
286
  export declare function parseMcpServerRef(input: unknown, path: string): McpServerRef;
287
+ /**
288
+ * Throw the canonical stdio-rejected error if the record carries any
289
+ * stdio-only marker (`transport: "stdio"`, `command`, `args`, `env`).
290
+ * Used by both the shared parser and the SDK `McpServer.remote`
291
+ * builder so every entry point surfaces the same message.
292
+ */
293
+ export declare function rejectStdioMcpShape(record: Record<string, unknown>): void;
309
294
  /**
310
295
  * What the user authors and passes to `client.submitRun({...blueprint, secrets})`.
311
296
  *
@@ -323,7 +308,7 @@ export interface Blueprint {
323
308
  readonly prompt: string | readonly string[];
324
309
  readonly skills?: readonly SkillRef[];
325
310
  readonly mcpServers?: readonly BlueprintMcpServer[];
326
- readonly environment?: PlatformTemplateEnvironment;
311
+ readonly environment?: PlatformEnvironment;
327
312
  readonly cleanup?: PlatformCleanupPolicy;
328
313
  readonly proxyEndpoints?: readonly PlatformProxyEndpoint[];
329
314
  readonly metadata?: Readonly<Record<string, JsonValue>>;
@@ -375,7 +360,7 @@ export interface NormalisedBlueprint {
375
360
  readonly prompt: readonly string[];
376
361
  readonly skills: readonly SkillRef[];
377
362
  readonly mcpServers: readonly McpServerRef[];
378
- readonly environment?: PlatformTemplateEnvironment;
363
+ readonly environment?: PlatformEnvironment;
379
364
  readonly cleanup?: PlatformCleanupPolicy;
380
365
  readonly proxyEndpoints?: readonly PlatformProxyEndpoint[];
381
366
  readonly metadata?: Readonly<Record<string, JsonValue>>;