antpath 0.10.14 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +16 -8
- package/dist/_shared/blueprint.d.ts +93 -108
- package/dist/_shared/blueprint.js +144 -78
- package/dist/_shared/cleanup-policy.d.ts +2 -2
- package/dist/_shared/cleanup-policy.js +2 -5
- package/dist/_shared/http.d.ts +2 -2
- package/dist/_shared/index.d.ts +7 -1
- package/dist/_shared/index.js +6 -1
- package/dist/_shared/mcp-proxy-url.d.ts +55 -0
- package/dist/_shared/mcp-proxy-url.js +65 -0
- package/dist/_shared/operations.d.ts +55 -8
- package/dist/_shared/operations.js +163 -20
- package/dist/_shared/provider-proxy-url.d.ts +64 -0
- package/dist/_shared/provider-proxy-url.js +73 -0
- package/dist/_shared/proxy-validation.d.ts +1 -1
- package/dist/_shared/proxy-validation.js +2 -2
- package/dist/_shared/run-unit.d.ts +23 -36
- package/dist/_shared/run-unit.js +30 -46
- package/dist/_shared/runner-event.d.ts +120 -0
- package/dist/_shared/runner-event.js +193 -0
- package/dist/_shared/runner-job.d.ts +159 -0
- package/dist/_shared/runner-job.js +54 -0
- package/dist/_shared/runtime-manifest.d.ts +191 -0
- package/dist/_shared/runtime-manifest.js +221 -0
- package/dist/_shared/runtime-types.d.ts +7 -16
- package/dist/_shared/sse.d.ts +74 -0
- package/dist/_shared/sse.js +0 -0
- package/dist/_shared/stable.d.ts +15 -10
- package/dist/_shared/stable.js +15 -10
- package/dist/_shared/submission.d.ts +199 -73
- package/dist/_shared/submission.js +409 -210
- package/dist/_shared/telemetry.d.ts +2 -2
- package/dist/_shared/telemetry.js +2 -2
- package/dist/_shared/template/index.d.ts +0 -1
- package/dist/_shared/template/index.js +0 -1
- package/dist/agents-md.d.ts +25 -67
- package/dist/agents-md.js +35 -121
- package/dist/agents-md.js.map +1 -1
- package/dist/asset-upload.d.ts +34 -0
- package/dist/asset-upload.js +34 -0
- package/dist/asset-upload.js.map +1 -1
- package/dist/blueprint.d.ts +3 -3
- package/dist/bundle.d.ts +2 -2
- package/dist/bundle.js +1 -1
- package/dist/cli.mjs +559 -105
- package/dist/cli.mjs.sha256 +1 -1
- package/dist/client.d.ts +53 -22
- package/dist/client.js +196 -130
- package/dist/client.js.map +1 -1
- package/dist/file.d.ts +28 -94
- package/dist/file.js +35 -175
- package/dist/file.js.map +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/mcp-server.d.ts +10 -2
- package/dist/mcp-server.js +17 -2
- package/dist/mcp-server.js.map +1 -1
- package/dist/skill.d.ts +44 -214
- package/dist/skill.js +50 -284
- package/dist/skill.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/docs/cleanup.md +1 -1
- package/docs/credentials.md +2 -2
- package/docs/events.md +8 -8
- package/docs/outputs.md +2 -0
- package/docs/quickstart.md +18 -2
- package/docs/skills.md +1 -3
- package/docs/templates.md +6 -5
- package/package.json +2 -1
- package/dist/_shared/secrets.d.ts +0 -7
- package/dist/_shared/secrets.js +0 -20
- package/dist/_shared/template/mapper.d.ts +0 -11
- 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://
|
|
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://
|
|
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://
|
|
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://
|
|
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";
|
package/dist/agents-md.d.ts
CHANGED
|
@@ -1,90 +1,48 @@
|
|
|
1
1
|
import type { AgentsMdRef } from "./_shared/index.js";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
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
|
-
*
|
|
7
|
+
* const rules = await AgentsMd.fromContent("# Be helpful", { name: "rules" });
|
|
8
|
+
* await client.submitRun({ agentsMd: [rules], ... });
|
|
10
9
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
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
|
|
28
|
-
get ref(): AgentsMdRef;
|
|
29
|
-
|
|
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
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
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
|
-
|
|
49
|
-
|
|
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
|
-
*
|
|
58
|
-
*
|
|
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
|
-
|
|
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
|
|
74
|
-
readonly
|
|
44
|
+
export interface DraftAgentsMdRef {
|
|
45
|
+
readonly kind: "draft";
|
|
75
46
|
readonly name: string;
|
|
76
|
-
readonly
|
|
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
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
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
|
-
*
|
|
9
|
+
* const rules = await AgentsMd.fromContent("# Be helpful", { name: "rules" });
|
|
10
|
+
* await client.submitRun({ agentsMd: [rules], ... });
|
|
12
11
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
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
|
-
#
|
|
30
|
-
#contentHash;
|
|
19
|
+
#zipBytes;
|
|
31
20
|
#consumed = false;
|
|
32
|
-
constructor(ref,
|
|
21
|
+
constructor(ref, zipBytes) {
|
|
33
22
|
this.#ref = ref;
|
|
34
|
-
this.#
|
|
35
|
-
this.#contentHash = contentHash;
|
|
23
|
+
this.#zipBytes = zipBytes;
|
|
36
24
|
}
|
|
37
25
|
get ref() {
|
|
38
26
|
return this.#ref;
|
|
39
27
|
}
|
|
40
|
-
|
|
41
|
-
|
|
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
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
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
|
-
|
|
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
|
|
94
|
-
|
|
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
|
-
*
|
|
99
|
-
*
|
|
57
|
+
* Internal: yield the draft's zipped bytes + metadata so
|
|
58
|
+
* `client.submitRun` can upload to R2.
|
|
100
59
|
*/
|
|
101
|
-
|
|
60
|
+
_takeDraftBundle() {
|
|
102
61
|
if (this.#consumed) {
|
|
103
|
-
throw new Error(
|
|
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 !== "
|
|
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
|
-
|
|
130
|
-
|
|
71
|
+
contentHash: this.#ref.contentHash,
|
|
72
|
+
bytes: this.#zipBytes
|
|
131
73
|
};
|
|
132
74
|
}
|
|
133
75
|
toJSON() {
|
|
134
|
-
if (this.#
|
|
135
|
-
throw new Error(
|
|
136
|
-
|
|
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
|
-
|
|
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
|
package/dist/agents-md.js.map
CHANGED
|
@@ -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
|
|
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;;;;;;;;;;;;GAYG;AACH,MAAM,OAAO,QAAQ;IACV,IAAI,CAAiC;IACrC,SAAS,CAAyB;IAC3C,SAAS,GAAG,KAAK,CAAC;IAElB,YAAY,GAAmC,EAAE,QAAqB;QACpE,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;QAChB,IAAI,CAAC,SAAS,GAAG,QA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,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"}
|
package/dist/asset-upload.d.ts
CHANGED
|
@@ -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>;
|
package/dist/asset-upload.js
CHANGED
|
@@ -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
|
package/dist/asset-upload.js.map
CHANGED
|
@@ -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,CAA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,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"}
|
package/dist/blueprint.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { JsonValue, PlatformCleanupPolicy,
|
|
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
|
|
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?:
|
|
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 `
|
|
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
|
-
* `
|
|
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
|
-
* `
|
|
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.
|