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
@@ -14,7 +14,7 @@
14
14
  * defensive redaction pass before sending. Callers are also
15
15
  * expected to keep `context` shallow + non-sensitive.
16
16
  * 3. **Default on, env-configurable opt-out.** Default endpoint:
17
- * `https://www.antpath.ai/api/telemetry`. Override with
17
+ * `https://api.antpath.ai/api/telemetry`. Override with
18
18
  * `ANTPATH_TELEMETRY_ENDPOINT`; disable with
19
19
  * `ANTPATH_TELEMETRY_DISABLED=1`.
20
20
  * 4. **Bounded payload.** Stringified payload capped at 8 KiB; the
@@ -25,7 +25,7 @@
25
25
  * Default sink. Co-located with the SDK's default API base so we
26
26
  * don't introduce a second canonical host to keep in sync.
27
27
  */
28
- export declare const DEFAULT_TELEMETRY_ENDPOINT = "https://www.antpath.ai/api/telemetry";
28
+ export declare const DEFAULT_TELEMETRY_ENDPOINT = "https://api.antpath.ai/api/telemetry";
29
29
  /**
30
30
  * Hard cap on the JSON body sent to the sink. Anything above this is
31
31
  * either a coding mistake (huge context object) or an attempt to
@@ -14,7 +14,7 @@
14
14
  * defensive redaction pass before sending. Callers are also
15
15
  * expected to keep `context` shallow + non-sensitive.
16
16
  * 3. **Default on, env-configurable opt-out.** Default endpoint:
17
- * `https://www.antpath.ai/api/telemetry`. Override with
17
+ * `https://api.antpath.ai/api/telemetry`. Override with
18
18
  * `ANTPATH_TELEMETRY_ENDPOINT`; disable with
19
19
  * `ANTPATH_TELEMETRY_DISABLED=1`.
20
20
  * 4. **Bounded payload.** Stringified payload capped at 8 KiB; the
@@ -25,7 +25,7 @@
25
25
  * Default sink. Co-located with the SDK's default API base so we
26
26
  * don't introduce a second canonical host to keep in sync.
27
27
  */
28
- export const DEFAULT_TELEMETRY_ENDPOINT = "https://www.antpath.ai/api/telemetry";
28
+ export const DEFAULT_TELEMETRY_ENDPOINT = "https://api.antpath.ai/api/telemetry";
29
29
  /**
30
30
  * Hard cap on the JSON body sent to the sink. Anything above this is
31
31
  * either a coding mistake (huge context object) or an attempt to
@@ -1,4 +1,3 @@
1
1
  export type { CredentialRequirement, EnvironmentDefinition, McpServerDefinition, OutputDefinition, SkillDefinition, TemplateDefinition, TemplateVariableDefinition } from "./types.js";
2
2
  export { compileTemplate, type ResolvedMcpServer, type ResolvedTemplate } from "./compiler.js";
3
3
  export { defineTemplate, string, requiredStaticBearer, requiredOAuthAccessToken } from "./helpers.js";
4
- export { toPlatformSubmissionTemplate } from "./mapper.js";
@@ -1,4 +1,3 @@
1
1
  export { compileTemplate } from "./compiler.js";
2
2
  export { defineTemplate, string, requiredStaticBearer, requiredOAuthAccessToken } from "./helpers.js";
3
- export { toPlatformSubmissionTemplate } from "./mapper.js";
4
3
  //# sourceMappingURL=index.js.map
@@ -1,90 +1,48 @@
1
1
  import type { AgentsMdRef } from "./_shared/index.js";
2
2
  /**
3
- * The second of the three agent-context concepts (see
4
- * `references/agent-context-uploads.md`). An `AgentsMd` instance
5
- * carries the bytes of a single markdown file that antpath will
6
- * deliver to the agent as the **first user turn** of the session —
7
- * matching Claude Code's CLAUDE.md behaviour.
3
+ * AgentsMd a single markdown file delivered to the agent as the
4
+ * first user turn of the session (matches Claude Code's CLAUDE.md
5
+ * behaviour).
8
6
  *
9
- * Three usage modes mirror `Skill`:
7
+ * const rules = await AgentsMd.fromContent("# Be helpful", { name: "rules" });
8
+ * await client.submitRun({ agentsMd: [rules], ... });
10
9
  *
11
- * - **Workspace** `AgentsMd.fromId("amd_…")`. Persistent, reused
12
- * across runs.
13
- * - **Workspace via explicit upload**
14
- * `await AgentsMd.fromContent("…", { name }).upload(client)`.
15
- * Returns a workspace-backed instance; the original is consumed.
16
- * - **Inline per-run** — `await AgentsMd.fromContent("…", { name })`
17
- * passed directly to `submitRun({ agentsMd: [...] })`. The BFF
18
- * ingests it as a per-run-artifact workspace file with an
19
- * auto-suffixed name (mirrors `Skill`'s inline behaviour).
20
- *
21
- * The single canonical filename inside the zip is always `AGENTS.md`
22
- * so the canonical hash is a pure function of the markdown content —
23
- * dedup via `uploadIfChanged` works on bytes alone.
10
+ * `client.submitRun` materializes the bytes to R2 (content-addressable,
11
+ * workspace-scoped) before the run lands. The workspace pre-upload
12
+ * concept is gone R2 dedup at submit time handles the "I already
13
+ * uploaded these bytes" case automatically.
24
14
  */
25
15
  export declare class AgentsMd {
26
16
  #private;
27
- constructor(ref: AgentsMdRef, content?: string, contentHash?: string);
28
- get ref(): AgentsMdRef;
29
- /** True for `AgentsMd.fromId(...)` and instances returned by `.upload(...)`. */
30
- get isWorkspace(): boolean;
31
- /** True only while the inline AgentsMd still carries bytes and has not been consumed. */
32
- get isUnstaged(): boolean;
17
+ constructor(ref: AgentsMdRef | DraftAgentsMdRef, zipBytes?: Uint8Array);
18
+ get ref(): AgentsMdRef | DraftAgentsMdRef;
19
+ get isDraft(): boolean;
33
20
  get isConsumed(): boolean;
34
21
  /**
35
- * Reference an existing workspace `amd_*` row. Does NOT validate
36
- * existence that check happens on the next `submitRun`, where the
37
- * BFF rejects unknown / soft-deleted ids before inserting the run.
38
- */
39
- static fromId(id: string): AgentsMd;
40
- /**
41
- * Build an inline AgentsMd from a markdown string. `name` becomes
42
- * the workspace name (per-run-artifact auto-suffixes it at ingest).
22
+ * Build a draft AgentsMd from a markdown string. The SDK zips the
23
+ * content under the canonical filename `AGENTS.md` so the hash is a
24
+ * pure function of the markdown text.
43
25
  */
44
26
  static fromContent(content: string, args: {
45
27
  readonly name: string;
46
28
  }): Promise<AgentsMd>;
47
- /**
48
- * Read a local markdown file and build an inline AgentsMd. Path
49
- * may point at AGENTS.md, CLAUDE.md, or any markdown file — the
50
- * filename inside the zip is always normalised to AGENTS.md so
51
- * the canonical hash is pure.
52
- */
53
- static fromPath(path: string, args?: {
54
- readonly name?: string;
29
+ /** Node-only convenience: read a markdown file from disk. */
30
+ static fromPath(path: string, args: {
31
+ readonly name: string;
55
32
  }): Promise<AgentsMd>;
56
33
  /**
57
- * Persist this inline AgentsMd as a workspace row and return a new
58
- * workspace-backed instance. The original is marked consumed.
59
- */
60
- upload(client: AgentsMdUploader): Promise<AgentsMd>;
61
- /**
62
- * Internal: yield the inline content + hash so client.submitRun
63
- * can build the `agentsmd:<slot>` multipart part. Not part of the
64
- * public API.
34
+ * Internal: yield the draft's zipped bytes + metadata so
35
+ * `client.submitRun` can upload to R2.
65
36
  */
66
- _takeUnstagedContent(): {
37
+ _takeDraftBundle(): {
67
38
  name: string;
68
- content: string;
69
39
  contentHash: string;
40
+ bytes: Uint8Array;
70
41
  } | undefined;
71
42
  toJSON(): AgentsMdRef;
72
43
  }
73
- export interface AgentsMdRecord {
74
- readonly id: string;
44
+ export interface DraftAgentsMdRef {
45
+ readonly kind: "draft";
75
46
  readonly name: string;
76
- readonly hash: string | null;
77
- readonly sizeBytes: number | null;
78
- }
79
- export interface AgentsMdUploader {
80
- readonly _uploadAgentsMd?: (args: {
81
- readonly name: string;
82
- readonly content: string;
83
- }) => Promise<AgentsMdRecord>;
84
- readonly agentsMd?: {
85
- readonly _uploadAgentsMd?: (args: {
86
- readonly name: string;
87
- readonly content: string;
88
- }) => Promise<AgentsMdRecord>;
89
- };
47
+ readonly contentHash: string;
90
48
  }
package/dist/agents-md.js CHANGED
@@ -2,69 +2,39 @@ import { readFile } from "node:fs/promises";
2
2
  import { hashSkillBundle } from "./bundle.js";
3
3
  import { strToU8, zipSync } from "fflate";
4
4
  /**
5
- * The second of the three agent-context concepts (see
6
- * `references/agent-context-uploads.md`). An `AgentsMd` instance
7
- * carries the bytes of a single markdown file that antpath will
8
- * deliver to the agent as the **first user turn** of the session —
9
- * matching Claude Code's CLAUDE.md behaviour.
5
+ * AgentsMd a single markdown file delivered to the agent as the
6
+ * first user turn of the session (matches Claude Code's CLAUDE.md
7
+ * behaviour).
10
8
  *
11
- * Three usage modes mirror `Skill`:
9
+ * const rules = await AgentsMd.fromContent("# Be helpful", { name: "rules" });
10
+ * await client.submitRun({ agentsMd: [rules], ... });
12
11
  *
13
- * - **Workspace** `AgentsMd.fromId("amd_…")`. Persistent, reused
14
- * across runs.
15
- * - **Workspace via explicit upload**
16
- * `await AgentsMd.fromContent("…", { name }).upload(client)`.
17
- * Returns a workspace-backed instance; the original is consumed.
18
- * - **Inline per-run** — `await AgentsMd.fromContent("…", { name })`
19
- * passed directly to `submitRun({ agentsMd: [...] })`. The BFF
20
- * ingests it as a per-run-artifact workspace file with an
21
- * auto-suffixed name (mirrors `Skill`'s inline behaviour).
22
- *
23
- * The single canonical filename inside the zip is always `AGENTS.md`
24
- * so the canonical hash is a pure function of the markdown content —
25
- * dedup via `uploadIfChanged` works on bytes alone.
12
+ * `client.submitRun` materializes the bytes to R2 (content-addressable,
13
+ * workspace-scoped) before the run lands. The workspace pre-upload
14
+ * concept is gone R2 dedup at submit time handles the "I already
15
+ * uploaded these bytes" case automatically.
26
16
  */
27
17
  export class AgentsMd {
28
18
  #ref;
29
- #content;
30
- #contentHash;
19
+ #zipBytes;
31
20
  #consumed = false;
32
- constructor(ref, content, contentHash) {
21
+ constructor(ref, zipBytes) {
33
22
  this.#ref = ref;
34
- this.#content = content;
35
- this.#contentHash = contentHash;
23
+ this.#zipBytes = zipBytes;
36
24
  }
37
25
  get ref() {
38
26
  return this.#ref;
39
27
  }
40
- /** True for `AgentsMd.fromId(...)` and instances returned by `.upload(...)`. */
41
- get isWorkspace() {
42
- return this.#ref.kind === "workspace_agentsmd";
43
- }
44
- /** True only while the inline AgentsMd still carries bytes and has not been consumed. */
45
- get isUnstaged() {
46
- return (this.#ref.kind === "transient_agentsmd" &&
47
- this.#ref.slot === UNSTAGED_SLOT &&
48
- !this.#consumed &&
49
- this.#content !== undefined);
28
+ get isDraft() {
29
+ return this.#ref.kind === "draft" && !this.#consumed;
50
30
  }
51
31
  get isConsumed() {
52
32
  return this.#consumed;
53
33
  }
54
34
  /**
55
- * Reference an existing workspace `amd_*` row. Does NOT validate
56
- * existence that check happens on the next `submitRun`, where the
57
- * BFF rejects unknown / soft-deleted ids before inserting the run.
58
- */
59
- static fromId(id) {
60
- if (typeof id !== "string" || id.length === 0) {
61
- throw new Error("AgentsMd.fromId: id is required");
62
- }
63
- return new AgentsMd({ kind: "workspace_agentsmd", id });
64
- }
65
- /**
66
- * Build an inline AgentsMd from a markdown string. `name` becomes
67
- * the workspace name (per-run-artifact auto-suffixes it at ingest).
35
+ * Build a draft AgentsMd from a markdown string. The SDK zips the
36
+ * content under the canonical filename `AGENTS.md` so the hash is a
37
+ * pure function of the markdown text.
68
38
  */
69
39
  static async fromContent(content, args) {
70
40
  if (typeof content !== "string" || content.length === 0) {
@@ -75,97 +45,41 @@ export class AgentsMd {
75
45
  }
76
46
  const zip = zipSync({ "AGENTS.md": [strToU8(content), { mtime: ZIP_EPOCH }] }, { level: 6 });
77
47
  const contentHash = await hashSkillBundle(zip);
78
- const ref = {
79
- kind: "transient_agentsmd",
80
- slot: UNSTAGED_SLOT,
81
- name: args.name,
82
- contentHash
83
- };
84
- return new AgentsMd(ref, content, contentHash);
48
+ const ref = { kind: "draft", name: args.name, contentHash };
49
+ return new AgentsMd(ref, zip);
85
50
  }
86
- /**
87
- * Read a local markdown file and build an inline AgentsMd. Path
88
- * may point at AGENTS.md, CLAUDE.md, or any markdown file — the
89
- * filename inside the zip is always normalised to AGENTS.md so
90
- * the canonical hash is pure.
91
- */
51
+ /** Node-only convenience: read a markdown file from disk. */
92
52
  static async fromPath(path, args) {
93
- const buffer = await readFile(path, "utf8");
94
- const inferredName = args?.name ?? inferNameFromPath(path);
95
- return AgentsMd.fromContent(buffer, { name: inferredName });
53
+ const content = await readFile(path, "utf8");
54
+ return AgentsMd.fromContent(content, args);
96
55
  }
97
56
  /**
98
- * Persist this inline AgentsMd as a workspace row and return a new
99
- * workspace-backed instance. The original is marked consumed.
57
+ * Internal: yield the draft's zipped bytes + metadata so
58
+ * `client.submitRun` can upload to R2.
100
59
  */
101
- async upload(client) {
60
+ _takeDraftBundle() {
102
61
  if (this.#consumed) {
103
- throw new Error(consumedMessage());
62
+ throw new Error("AgentsMd: cannot reuse a consumed AgentsMd in submitRun. Build a fresh one " +
63
+ "via AgentsMd.fromContent(...) / AgentsMd.fromPath(...) per submitRun call.");
104
64
  }
105
- if (this.#ref.kind !== "transient_agentsmd" || this.#content === undefined) {
106
- throw new Error("AgentsMd.upload: only inline (unstaged) instances can be uploaded");
107
- }
108
- const uploader = resolveUploader(client);
109
- const record = await uploader({ name: this.#ref.name, content: this.#content });
110
- this.#consumed = true;
111
- return new AgentsMd({ kind: "workspace_agentsmd", id: record.id });
112
- }
113
- /**
114
- * Internal: yield the inline content + hash so client.submitRun
115
- * can build the `agentsmd:<slot>` multipart part. Not part of the
116
- * public API.
117
- */
118
- _takeUnstagedContent() {
119
- if (this.#consumed) {
120
- throw new Error(consumedMessage());
121
- }
122
- if (!this.isUnstaged)
123
- return undefined;
124
- if (this.#ref.kind !== "transient_agentsmd" || this.#content === undefined || this.#contentHash === undefined) {
65
+ if (this.#ref.kind !== "draft" || !this.#zipBytes) {
125
66
  return undefined;
126
67
  }
68
+ this.#consumed = true;
127
69
  return {
128
70
  name: this.#ref.name,
129
- content: this.#content,
130
- contentHash: this.#contentHash
71
+ contentHash: this.#ref.contentHash,
72
+ bytes: this.#zipBytes
131
73
  };
132
74
  }
133
75
  toJSON() {
134
- if (this.#consumed)
135
- throw new Error(consumedMessage());
136
- if (this.isUnstaged) {
137
- throw new Error("Cannot JSON-serialise an inline AgentsMd — the content is not in the JSON. " +
138
- "Persist via agentsMd.upload(client) and serialise the returned workspace instance, " +
139
- "or pass the inline AgentsMd directly to submitRun without serialising.");
76
+ if (this.#ref.kind === "draft") {
77
+ throw new Error("AgentsMd: draft AgentsMd cannot be JSON-serialised — it only becomes a wire " +
78
+ "ref when client.submitRun uploads the bytes to R2.");
140
79
  }
141
80
  return this.#ref;
142
81
  }
143
82
  }
144
- const UNSTAGED_SLOT = "(unstaged)";
145
- const ZIP_EPOCH = new Date(Date.UTC(1980, 0, 1));
146
83
  const WORKSPACE_NAME_RE = /^[a-z0-9][a-z0-9-]{0,62}[a-z0-9]$/;
147
- function resolveUploader(client) {
148
- const direct = client._uploadAgentsMd;
149
- if (typeof direct === "function")
150
- return direct.bind(client);
151
- const nested = client.agentsMd?._uploadAgentsMd;
152
- if (typeof nested === "function")
153
- return nested.bind(client.agentsMd);
154
- throw new Error("AgentsMd.upload: client argument does not expose an upload entry point — " +
155
- "pass the AntpathClient instance or its `client.agentsMd`");
156
- }
157
- function consumedMessage() {
158
- return ("this AgentsMd was already uploaded via agentsMd.upload(client); use the returned instance " +
159
- "or AgentsMd.fromId(record.id) for subsequent runs");
160
- }
161
- function inferNameFromPath(path) {
162
- // Use the basename minus extension, lowercased and normalised to
163
- // match the workspace-name regex. Falls back to a timestamp slug.
164
- const base = path.replace(/\\/g, "/").split("/").at(-1) ?? "";
165
- const stem = base.replace(/\.[^.]+$/, "").toLowerCase();
166
- const slug = stem.replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
167
- if (slug && WORKSPACE_NAME_RE.test(slug))
168
- return slug;
169
- return `agentsmd-${Date.now().toString(36)}`;
170
- }
84
+ const ZIP_EPOCH = new Date(Date.UTC(1980, 0, 1));
171
85
  //# sourceMappingURL=agents-md.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"agents-md.js","sourceRoot":"","sources":["../src/agents-md.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAE1C;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,OAAO,QAAQ;IACV,IAAI,CAAc;IAClB,QAAQ,CAAqB;IAC7B,YAAY,CAAqB;IAC1C,SAAS,GAAG,KAAK,CAAC;IAElB,YAAY,GAAgB,EAAE,OAAgB,EAAE,WAAoB;QAClE,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;QAChB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;IAClC,CAAC;IAED,IAAI,GAAG;QACL,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED,gFAAgF;IAChF,IAAI,WAAW;QACb,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,oBAAoB,CAAC;IACjD,CAAC;IAED,yFAAyF;IACzF,IAAI,UAAU;QACZ,OAAO,CACL,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,oBAAoB;YACvC,IAAI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ChC,CAAC;IAED,6DAA6D;IAC7D,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAY,EAAE,IAA+B;QACjE,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAC7C,OAAO,QAAQ,CAAC,WAAW,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IAC7C,CAAC;IAED;;;OAGG;IACH,gBAAgB;QACd,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACnB,MAAM,IAAI,KAAK,CACb,6EAA6E;gBAC3E,4EAA4E,CAC/E,CAAC;QACJ,CAAC;QACD,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,OAAO,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC;YAClD,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACtB,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI;YACpB,WAAW,EAAE,IAAI,CAAC,IAAI,CAAC,WAAW;YAClC,KAAK,EAAE,IAAI,CAAC,SAAS;SACtB,CAAC;IACJ,CAAC;IAED,MAAM;QACJ,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;YAC/B,MAAM,IAAI,KAAK,CACb,8EAA8E;gBAC5E,oDAAoD,CACvD,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;CACF;AAQD,MAAM,iBAAiB,GAAG,mCAAmC,CAAC;AAC9D,MAAM,SAAS,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC"}
@@ -83,3 +83,37 @@ export interface UploadChunkedArgs {
83
83
  * `assetId`, `kind`, etc.).
84
84
  */
85
85
  export declare function uploadChunked(args: UploadChunkedArgs): Promise<void>;
86
+ /**
87
+ * Subset of `HttpClient` needed by the asset uploader. Defined as a
88
+ * structural type so tests can supply a thin stub without dragging in
89
+ * the full client.
90
+ */
91
+ export interface AssetsHttpClient {
92
+ request<T>(path: string, init?: RequestInit, query?: Record<string, string>): Promise<T>;
93
+ }
94
+ export interface UploadAssetToR2Args {
95
+ readonly http: AssetsHttpClient;
96
+ readonly bytes: Uint8Array;
97
+ /** `sha256:<hex>` — the canonical content hash declared on the wire. */
98
+ readonly hash: string;
99
+ readonly contentType?: string;
100
+ }
101
+ export interface UploadedR2Asset {
102
+ readonly path: string;
103
+ readonly hash: string;
104
+ readonly sizeBytes: number;
105
+ /** true if R2 already had identical bytes under this hash (dedup hit). */
106
+ readonly exists: boolean;
107
+ }
108
+ /**
109
+ * Upload `bytes` to the Worker's content-addressable R2 endpoint. The
110
+ * Worker scopes the key under the calling workspace (derived from the
111
+ * API token) so the returned `path` is `assets/<wsId>/<hash>` — safe
112
+ * to embed in a kind:"r2" submission ref.
113
+ *
114
+ * Verifies the advisory hash matches the bytes BEFORE sending so a
115
+ * mismatch fails fast on the client. The Worker re-verifies on
116
+ * receipt; a mismatch there is a 400 with code "hash_mismatch" that
117
+ * surfaces as an `AntpathApiError`.
118
+ */
119
+ export declare function uploadAssetToR2(args: UploadAssetToR2Args): Promise<UploadedR2Asset>;
@@ -121,4 +121,38 @@ function bufferToHex(buffer) {
121
121
  }
122
122
  return out;
123
123
  }
124
+ /**
125
+ * Upload `bytes` to the Worker's content-addressable R2 endpoint. The
126
+ * Worker scopes the key under the calling workspace (derived from the
127
+ * API token) so the returned `path` is `assets/<wsId>/<hash>` — safe
128
+ * to embed in a kind:"r2" submission ref.
129
+ *
130
+ * Verifies the advisory hash matches the bytes BEFORE sending so a
131
+ * mismatch fails fast on the client. The Worker re-verifies on
132
+ * receipt; a mismatch there is a 400 with code "hash_mismatch" that
133
+ * surfaces as an `AntpathApiError`.
134
+ */
135
+ export async function uploadAssetToR2(args) {
136
+ const expected = args.hash.startsWith("sha256:") ? args.hash.slice("sha256:".length) : args.hash;
137
+ const actual = await computeSha256Hex(args.bytes);
138
+ if (actual !== expected) {
139
+ throw new Error(`uploadAssetToR2: client-side hash mismatch — computed sha256:${actual} ` +
140
+ `but caller declared ${args.hash}. Aborting to avoid uploading corrupted data.`);
141
+ }
142
+ const body = await args.http.request("/assets/upload", {
143
+ method: "POST",
144
+ headers: {
145
+ "content-type": args.contentType ?? "application/zip",
146
+ "content-length": String(args.bytes.byteLength),
147
+ "x-asset-hash": `sha256:${actual}`
148
+ },
149
+ body: args.bytes
150
+ });
151
+ return {
152
+ path: body.path,
153
+ hash: body.hash,
154
+ sizeBytes: body.sizeBytes,
155
+ exists: body.exists
156
+ };
157
+ }
124
158
  //# sourceMappingURL=asset-upload.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"asset-upload.js","sourceRoot":"","sources":["../src/asset-upload.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,GAAG,MAAM,eAAe,CAAC;AAErC,uCAAuC;AACvC,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC;AAE9D,mEAAmE;AACnE,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC;AAE9C;;;;;;;;GAQG;AACH,MAAM,UAAU,oBAAoB,CAAC,SAAiB;IACpD,OAAO,SAAS,IAAI,8BAA8B,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;AAC3E,CAAC;AAkCD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,IAAuB;IACzD,0EAA0E;IAC1E,MAAM,UAAU,GAAG,MAAM,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACvD,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC;QAC9C,CAAC,CAAC,IAAI,CAA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AC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAmCD;;;;;;;;;;GAUG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,IAAyB;IAC7D,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;IACjG,MAAM,MAAM,GAAG,MAAM,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAClD,IAAI,MAAM,KAAK,QAAQ,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CACb,gEAAgE,MAAM,GAAG;YACvE,uBAAuB,IAAI,CAAC,IAAI,+CAA+C,CAClF,CAAC;IACJ,CAAC;IACD,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,CAMjC,gBAAgB,EAAE;QACnB,MAAM,EAAE,MAAM;QACd,OAAO,EAAE;YACP,cAAc,EAAE,IAAI,CAAC,WAAW,IAAI,iBAAiB;YACrD,gBAAgB,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC;YAC/C,cAAc,EAAE,UAAU,MAAM,EAAE;SACnC;QACD,IAAI,EAAE,IAAI,CAAC,KAAK;KACjB,CAAC,CAAC;IACH,OAAO;QACL,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,SAAS,EAAE,IAAI,CAAC,SAAS;QACzB,MAAM,EAAE,IAAI,CAAC,MAAM;KACpB,CAAC;AACJ,CAAC"}
@@ -1,4 +1,4 @@
1
- import type { JsonValue, PlatformCleanupPolicy, PlatformTemplateEnvironment } from "./_shared/index.js";
1
+ import type { JsonValue, PlatformCleanupPolicy, PlatformEnvironment } from "./_shared/index.js";
2
2
  import type { McpServer } from "./mcp-server.js";
3
3
  import type { ProxyEndpoint } from "./proxy-endpoint.js";
4
4
  import type { Skill } from "./skill.js";
@@ -14,7 +14,7 @@ import type { Skill } from "./skill.js";
14
14
  * "idempotencyKey" | "signal">` so it can be embedded as a reusable,
15
15
  * credential-free fragment via `defineRun`.
16
16
  *
17
- * Note: Blueprints can legally contain unstaged transient Skills built
17
+ * Note: Blueprints can legally contain unstaged inline Skills built
18
18
  * via `Skill.fromFiles` / `Skill.fromPath`. The transient bytes ride
19
19
  * via multipart at `submitRun` time and never persist anywhere —
20
20
  * exactly the right shape for a per-run, throwaway skill. Passing a
@@ -27,7 +27,7 @@ export interface Blueprint {
27
27
  readonly prompt: string | readonly string[];
28
28
  readonly skills?: readonly Skill[];
29
29
  readonly mcpServers?: readonly McpServer[];
30
- readonly environment?: PlatformTemplateEnvironment;
30
+ readonly environment?: PlatformEnvironment;
31
31
  readonly cleanup?: PlatformCleanupPolicy;
32
32
  readonly proxyEndpoints?: readonly ProxyEndpoint[];
33
33
  readonly metadata?: Record<string, JsonValue>;
package/dist/bundle.d.ts CHANGED
@@ -10,7 +10,7 @@
10
10
  *
11
11
  * For transient (per-run) skills the SDK does compute an advisory
12
12
  * `sha256` of the canonicalised zip via `hashSkillBundle()` — it travels
13
- * in the `TransientSkillRef.contentHash` field, is used for retry
13
+ * in the `InlineSkillRef.contentHash` field, is used for retry
14
14
  * de-dup and janitor reconciliation, and is recomputed server-side
15
15
  * (mismatch → submission rejected).
16
16
  */
@@ -25,7 +25,7 @@ export declare function bundleSkillFiles(files: SkillFiles): BundledSkill;
25
25
  /**
26
26
  * Compute `sha256:<hex>` of the given canonicalised zip bytes. Used by
27
27
  * `Skill.fromFiles` / `Skill.fromPath` to populate the
28
- * `TransientSkillRef.contentHash` field. The hash is advisory — the BFF
28
+ * `InlineSkillRef.contentHash` field. The hash is advisory — the BFF
29
29
  * recomputes server-side after re-canonicalising the zip; a mismatch is
30
30
  * rejected. Web-Crypto-only so the SDK works in Node, edge runtimes,
31
31
  * and browsers without polyfills.
package/dist/bundle.js CHANGED
@@ -57,7 +57,7 @@ const ZIP_EPOCH = new Date(Date.UTC(1980, 0, 1));
57
57
  /**
58
58
  * Compute `sha256:<hex>` of the given canonicalised zip bytes. Used by
59
59
  * `Skill.fromFiles` / `Skill.fromPath` to populate the
60
- * `TransientSkillRef.contentHash` field. The hash is advisory — the BFF
60
+ * `InlineSkillRef.contentHash` field. The hash is advisory — the BFF
61
61
  * recomputes server-side after re-canonicalising the zip; a mismatch is
62
62
  * rejected. Web-Crypto-only so the SDK works in Node, edge runtimes,
63
63
  * and browsers without polyfills.