antpath 0.10.4 → 0.10.7
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/dist/_shared/operations.d.ts +85 -10
- package/dist/_shared/operations.js +148 -12
- package/dist/_shared/runtime-types.d.ts +47 -0
- package/dist/asset-upload.d.ts +85 -0
- package/dist/asset-upload.js +124 -0
- package/dist/asset-upload.js.map +1 -0
- package/dist/cli.mjs +111 -3
- package/dist/cli.mjs.sha256 +1 -1
- package/dist/client.d.ts +90 -1
- package/dist/client.js +199 -8
- package/dist/client.js.map +1 -1
- package/dist/file.d.ts +117 -0
- package/dist/file.js +287 -0
- package/dist/file.js.map +1 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/skill.d.ts +29 -0
- package/dist/skill.js +38 -1
- package/dist/skill.js.map +1 -1
- package/package.json +3 -2
package/dist/file.d.ts
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import type { FileRef } from "./_shared/index.js";
|
|
2
|
+
/**
|
|
3
|
+
* The third of the three agent-context concepts (see
|
|
4
|
+
* `references/agent-context-uploads.md`). A `File` instance
|
|
5
|
+
* carries the bytes of a single file or a folder tree that antpath
|
|
6
|
+
* will:
|
|
7
|
+
*
|
|
8
|
+
* 1. Upload to the Anthropic Files API at session create, mounting
|
|
9
|
+
* each entry at `/antpath/files/<f_id>/<rel-path>`.
|
|
10
|
+
* 2. List all mount paths in the synthetic first user message so the
|
|
11
|
+
* agent knows what's available without a directory-listing tool.
|
|
12
|
+
*
|
|
13
|
+
* Use `File` for anything that isn't a Claude skill (`Skill`) or an
|
|
14
|
+
* instructions file (`AgentsMd`): settings files, helper data folders,
|
|
15
|
+
* dotfiles, sample inputs, config blobs.
|
|
16
|
+
*
|
|
17
|
+
* Three usage modes:
|
|
18
|
+
*
|
|
19
|
+
* - **Workspace** — `File.fromId("f_…")`. Persistent, reused across runs.
|
|
20
|
+
* - **Workspace via explicit upload** —
|
|
21
|
+
* `await File.fromPath('./data/').upload(client)`. Returns a
|
|
22
|
+
* workspace-backed instance; the original is consumed.
|
|
23
|
+
* - **Inline per-run** — `File.fromPath('./settings.json')` passed
|
|
24
|
+
* directly to `submitRun({ files: [...] })`. The BFF ingests it as
|
|
25
|
+
* a per-run-artifact workspace file with an auto-suffixed name.
|
|
26
|
+
*
|
|
27
|
+
* Folder inputs (`File.fromPath('./scripts/')`) walk the local directory
|
|
28
|
+
* and zip the whole tree into a single canonical bundle. The zip is what
|
|
29
|
+
* gets stored and transferred; unpacking happens worker-side when
|
|
30
|
+
* materialising into `SessionResourceUpload` entries.
|
|
31
|
+
*/
|
|
32
|
+
export declare class File {
|
|
33
|
+
#private;
|
|
34
|
+
constructor(ref: FileRef, bytes?: Uint8Array, contentHash?: string);
|
|
35
|
+
get ref(): FileRef;
|
|
36
|
+
/** True for `File.fromId(...)` and instances returned by `.upload(...)`. */
|
|
37
|
+
get isWorkspace(): boolean;
|
|
38
|
+
/** True only while the inline File still carries bytes and has not been consumed. */
|
|
39
|
+
get isUnstaged(): boolean;
|
|
40
|
+
get isConsumed(): boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Reference an existing workspace `f_*` row. Does NOT validate existence —
|
|
43
|
+
* that check happens on the next `submitRun`, where the BFF rejects
|
|
44
|
+
* unknown / soft-deleted ids before inserting the run.
|
|
45
|
+
*/
|
|
46
|
+
static fromId(id: string): File;
|
|
47
|
+
/**
|
|
48
|
+
* Build an inline File from raw bytes. `name` becomes the workspace
|
|
49
|
+
* name (per-run-artifact auto-suffixes it at ingest). `mountPath` is
|
|
50
|
+
* optional and overrides the default `/antpath/files/<id>/<rel>` mount.
|
|
51
|
+
*
|
|
52
|
+
* When `bytes` is a single file (not a directory tree), the zip has one
|
|
53
|
+
* entry using `name` as the filename inside the archive. Pass a zip
|
|
54
|
+
* already containing multiple entries if you want a tree-in-bytes.
|
|
55
|
+
*/
|
|
56
|
+
static fromBytes(args: {
|
|
57
|
+
readonly name: string;
|
|
58
|
+
readonly bytes: Uint8Array;
|
|
59
|
+
readonly mountPath?: string;
|
|
60
|
+
}): Promise<File>;
|
|
61
|
+
/**
|
|
62
|
+
* Read a local file or directory and build an inline File. Paths pointing
|
|
63
|
+
* at a directory walk the whole tree and bundle it into a canonical zip
|
|
64
|
+
* (sorted, deterministic mtime epoch). Single-file paths are also wrapped
|
|
65
|
+
* in a one-entry canonical zip. Name is inferred from the basename when
|
|
66
|
+
* not supplied via `args.name`.
|
|
67
|
+
*/
|
|
68
|
+
static fromPath(path: string, args?: {
|
|
69
|
+
readonly name?: string;
|
|
70
|
+
readonly mountPath?: string;
|
|
71
|
+
}): Promise<File>;
|
|
72
|
+
/**
|
|
73
|
+
* Persist this inline File as a workspace row and return a new
|
|
74
|
+
* workspace-backed instance. The original is marked consumed.
|
|
75
|
+
*
|
|
76
|
+
* Bundles ≤ 6 MiB use the existing multipart POST path.
|
|
77
|
+
* Bundles > 6 MiB use the three-step TUS chunked path (init → TUS → finalize).
|
|
78
|
+
*/
|
|
79
|
+
upload(client: FileUploader): Promise<File>;
|
|
80
|
+
/**
|
|
81
|
+
* Internal: yield the inline bytes + hash so client.submitRun can build
|
|
82
|
+
* the `file:<slot>` multipart part. Not part of the public API.
|
|
83
|
+
*/
|
|
84
|
+
_takeUnstagedBundle(): {
|
|
85
|
+
name: string;
|
|
86
|
+
bytes: Uint8Array;
|
|
87
|
+
contentHash: string;
|
|
88
|
+
mountPath?: string;
|
|
89
|
+
} | undefined;
|
|
90
|
+
toJSON(): FileRef;
|
|
91
|
+
}
|
|
92
|
+
export interface FileRecord {
|
|
93
|
+
readonly id: string;
|
|
94
|
+
readonly name: string;
|
|
95
|
+
readonly hash: string | null;
|
|
96
|
+
readonly sizeBytes: number | null;
|
|
97
|
+
readonly fileCount?: number | null;
|
|
98
|
+
}
|
|
99
|
+
export interface FileUploader {
|
|
100
|
+
readonly _uploadFile?: (args: {
|
|
101
|
+
readonly name: string;
|
|
102
|
+
readonly bytes: Uint8Array;
|
|
103
|
+
}) => Promise<FileRecord>;
|
|
104
|
+
readonly files?: {
|
|
105
|
+
readonly _uploadFile?: (args: {
|
|
106
|
+
readonly name: string;
|
|
107
|
+
readonly bytes: Uint8Array;
|
|
108
|
+
}) => Promise<FileRecord>;
|
|
109
|
+
};
|
|
110
|
+
/**
|
|
111
|
+
* Optional chunked-upload entry point. Present on `AntpathClient`
|
|
112
|
+
* when the BFF supports `POST /api/assets/upload-init` and
|
|
113
|
+
* `POST /api/assets/finalize`. When absent, bundles > 6 MiB throw
|
|
114
|
+
* an informative error.
|
|
115
|
+
*/
|
|
116
|
+
readonly _chunkedUpload?: import("./skill.js").ChunkedUploadClient;
|
|
117
|
+
}
|
package/dist/file.js
ADDED
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
import { readdir, readFile, stat } from "node:fs/promises";
|
|
2
|
+
import { join, relative } from "node:path";
|
|
3
|
+
import { hashSkillBundle } from "./bundle.js";
|
|
4
|
+
import { zipSync } from "fflate";
|
|
5
|
+
import { chooseUploadStrategy, uploadChunked } from "./asset-upload.js";
|
|
6
|
+
/**
|
|
7
|
+
* The third of the three agent-context concepts (see
|
|
8
|
+
* `references/agent-context-uploads.md`). A `File` instance
|
|
9
|
+
* carries the bytes of a single file or a folder tree that antpath
|
|
10
|
+
* will:
|
|
11
|
+
*
|
|
12
|
+
* 1. Upload to the Anthropic Files API at session create, mounting
|
|
13
|
+
* each entry at `/antpath/files/<f_id>/<rel-path>`.
|
|
14
|
+
* 2. List all mount paths in the synthetic first user message so the
|
|
15
|
+
* agent knows what's available without a directory-listing tool.
|
|
16
|
+
*
|
|
17
|
+
* Use `File` for anything that isn't a Claude skill (`Skill`) or an
|
|
18
|
+
* instructions file (`AgentsMd`): settings files, helper data folders,
|
|
19
|
+
* dotfiles, sample inputs, config blobs.
|
|
20
|
+
*
|
|
21
|
+
* Three usage modes:
|
|
22
|
+
*
|
|
23
|
+
* - **Workspace** — `File.fromId("f_…")`. Persistent, reused across runs.
|
|
24
|
+
* - **Workspace via explicit upload** —
|
|
25
|
+
* `await File.fromPath('./data/').upload(client)`. Returns a
|
|
26
|
+
* workspace-backed instance; the original is consumed.
|
|
27
|
+
* - **Inline per-run** — `File.fromPath('./settings.json')` passed
|
|
28
|
+
* directly to `submitRun({ files: [...] })`. The BFF ingests it as
|
|
29
|
+
* a per-run-artifact workspace file with an auto-suffixed name.
|
|
30
|
+
*
|
|
31
|
+
* Folder inputs (`File.fromPath('./scripts/')`) walk the local directory
|
|
32
|
+
* and zip the whole tree into a single canonical bundle. The zip is what
|
|
33
|
+
* gets stored and transferred; unpacking happens worker-side when
|
|
34
|
+
* materialising into `SessionResourceUpload` entries.
|
|
35
|
+
*/
|
|
36
|
+
export class File {
|
|
37
|
+
#ref;
|
|
38
|
+
#bytes;
|
|
39
|
+
#contentHash;
|
|
40
|
+
#consumed = false;
|
|
41
|
+
constructor(ref, bytes, contentHash) {
|
|
42
|
+
this.#ref = ref;
|
|
43
|
+
this.#bytes = bytes;
|
|
44
|
+
this.#contentHash = contentHash;
|
|
45
|
+
}
|
|
46
|
+
get ref() {
|
|
47
|
+
return this.#ref;
|
|
48
|
+
}
|
|
49
|
+
/** True for `File.fromId(...)` and instances returned by `.upload(...)`. */
|
|
50
|
+
get isWorkspace() {
|
|
51
|
+
return this.#ref.kind === "workspace_file";
|
|
52
|
+
}
|
|
53
|
+
/** True only while the inline File still carries bytes and has not been consumed. */
|
|
54
|
+
get isUnstaged() {
|
|
55
|
+
return (this.#ref.kind === "transient_file" &&
|
|
56
|
+
this.#ref.slot === UNSTAGED_SLOT &&
|
|
57
|
+
!this.#consumed &&
|
|
58
|
+
this.#bytes !== undefined);
|
|
59
|
+
}
|
|
60
|
+
get isConsumed() {
|
|
61
|
+
return this.#consumed;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Reference an existing workspace `f_*` row. Does NOT validate existence —
|
|
65
|
+
* that check happens on the next `submitRun`, where the BFF rejects
|
|
66
|
+
* unknown / soft-deleted ids before inserting the run.
|
|
67
|
+
*/
|
|
68
|
+
static fromId(id) {
|
|
69
|
+
if (typeof id !== "string" || id.length === 0) {
|
|
70
|
+
throw new Error("File.fromId: id is required");
|
|
71
|
+
}
|
|
72
|
+
return new File({ kind: "workspace_file", id });
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Build an inline File from raw bytes. `name` becomes the workspace
|
|
76
|
+
* name (per-run-artifact auto-suffixes it at ingest). `mountPath` is
|
|
77
|
+
* optional and overrides the default `/antpath/files/<id>/<rel>` mount.
|
|
78
|
+
*
|
|
79
|
+
* When `bytes` is a single file (not a directory tree), the zip has one
|
|
80
|
+
* entry using `name` as the filename inside the archive. Pass a zip
|
|
81
|
+
* already containing multiple entries if you want a tree-in-bytes.
|
|
82
|
+
*/
|
|
83
|
+
static async fromBytes(args) {
|
|
84
|
+
if (!args || typeof args.name !== "string" || !WORKSPACE_NAME_RE.test(args.name)) {
|
|
85
|
+
throw new Error(`File.fromBytes: name must match ${WORKSPACE_NAME_RE.source}`);
|
|
86
|
+
}
|
|
87
|
+
if (!(args.bytes instanceof Uint8Array) || args.bytes.byteLength === 0) {
|
|
88
|
+
throw new Error("File.fromBytes: bytes must be a non-empty Uint8Array");
|
|
89
|
+
}
|
|
90
|
+
// Wrap in a single-entry canonical zip so storage stays uniform (all files
|
|
91
|
+
// are canonical zips), matching `canonicaliseFileBundle` on the BFF side.
|
|
92
|
+
const zip = zipSync({ [args.name]: [args.bytes, { mtime: ZIP_EPOCH }] }, { level: 6 });
|
|
93
|
+
const contentHash = await hashSkillBundle(zip);
|
|
94
|
+
const ref = {
|
|
95
|
+
kind: "transient_file",
|
|
96
|
+
slot: UNSTAGED_SLOT,
|
|
97
|
+
name: args.name,
|
|
98
|
+
contentHash,
|
|
99
|
+
...(args.mountPath ? { mountPath: args.mountPath } : {})
|
|
100
|
+
};
|
|
101
|
+
return new File(ref, zip, contentHash);
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Read a local file or directory and build an inline File. Paths pointing
|
|
105
|
+
* at a directory walk the whole tree and bundle it into a canonical zip
|
|
106
|
+
* (sorted, deterministic mtime epoch). Single-file paths are also wrapped
|
|
107
|
+
* in a one-entry canonical zip. Name is inferred from the basename when
|
|
108
|
+
* not supplied via `args.name`.
|
|
109
|
+
*/
|
|
110
|
+
static async fromPath(path, args) {
|
|
111
|
+
const stats = await stat(path);
|
|
112
|
+
const inferredName = args?.name ?? inferNameFromPath(path);
|
|
113
|
+
if (!WORKSPACE_NAME_RE.test(inferredName)) {
|
|
114
|
+
throw new Error(`File.fromPath: inferred name ${JSON.stringify(inferredName)} does not match ${WORKSPACE_NAME_RE.source}; ` +
|
|
115
|
+
`pass an explicit name via args.name`);
|
|
116
|
+
}
|
|
117
|
+
let zip;
|
|
118
|
+
if (stats.isDirectory()) {
|
|
119
|
+
zip = await buildDirZip(path);
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
const bytes = await readFile(path);
|
|
123
|
+
const filename = path.replace(/\\/g, "/").split("/").at(-1) ?? inferredName;
|
|
124
|
+
zip = zipSync({ [filename]: [bytes, { mtime: ZIP_EPOCH }] }, { level: 6 });
|
|
125
|
+
}
|
|
126
|
+
const contentHash = await hashSkillBundle(zip);
|
|
127
|
+
const ref = {
|
|
128
|
+
kind: "transient_file",
|
|
129
|
+
slot: UNSTAGED_SLOT,
|
|
130
|
+
name: inferredName,
|
|
131
|
+
contentHash,
|
|
132
|
+
...(args?.mountPath ? { mountPath: args.mountPath } : {})
|
|
133
|
+
};
|
|
134
|
+
return new File(ref, zip, contentHash);
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Persist this inline File as a workspace row and return a new
|
|
138
|
+
* workspace-backed instance. The original is marked consumed.
|
|
139
|
+
*
|
|
140
|
+
* Bundles ≤ 6 MiB use the existing multipart POST path.
|
|
141
|
+
* Bundles > 6 MiB use the three-step TUS chunked path (init → TUS → finalize).
|
|
142
|
+
*/
|
|
143
|
+
async upload(client) {
|
|
144
|
+
if (this.#consumed) {
|
|
145
|
+
throw new Error(consumedMessage());
|
|
146
|
+
}
|
|
147
|
+
if (this.#ref.kind !== "transient_file" || this.#bytes === undefined) {
|
|
148
|
+
throw new Error("File.upload: only inline (unstaged) instances can be uploaded");
|
|
149
|
+
}
|
|
150
|
+
const bytes = this.#bytes;
|
|
151
|
+
const strategy = chooseUploadStrategy(bytes.byteLength);
|
|
152
|
+
if (strategy === "chunked") {
|
|
153
|
+
const chunkedClient = resolveChunkedUploader(client);
|
|
154
|
+
if (!chunkedClient) {
|
|
155
|
+
throw new Error("File.upload: bundle exceeds 6 MiB but the client does not support chunked uploads. " +
|
|
156
|
+
"Pass an AntpathClient instance to enable chunked (TUS) upload.");
|
|
157
|
+
}
|
|
158
|
+
const hash = this.#contentHash ?? (await hashSkillBundle(bytes));
|
|
159
|
+
const { init, finalize } = chunkedClient;
|
|
160
|
+
const session = await init({
|
|
161
|
+
kind: "file",
|
|
162
|
+
name: this.#ref.name,
|
|
163
|
+
sizeBytes: bytes.byteLength,
|
|
164
|
+
hash
|
|
165
|
+
});
|
|
166
|
+
await uploadChunked({
|
|
167
|
+
bundle: bytes,
|
|
168
|
+
tusUrl: session.tusUrl,
|
|
169
|
+
tusToken: session.tusToken,
|
|
170
|
+
uploadHeaders: session.uploadHeaders,
|
|
171
|
+
hash
|
|
172
|
+
});
|
|
173
|
+
await finalize({
|
|
174
|
+
assetId: session.assetId,
|
|
175
|
+
kind: "file",
|
|
176
|
+
hash,
|
|
177
|
+
storagePath: session.storagePath
|
|
178
|
+
});
|
|
179
|
+
this.#consumed = true;
|
|
180
|
+
return new File({ kind: "workspace_file", id: session.assetId });
|
|
181
|
+
}
|
|
182
|
+
// Small bundle: existing single-request multipart POST.
|
|
183
|
+
const uploader = resolveUploader(client);
|
|
184
|
+
const record = await uploader({ name: this.#ref.name, bytes });
|
|
185
|
+
this.#consumed = true;
|
|
186
|
+
return new File({ kind: "workspace_file", id: record.id });
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Internal: yield the inline bytes + hash so client.submitRun can build
|
|
190
|
+
* the `file:<slot>` multipart part. Not part of the public API.
|
|
191
|
+
*/
|
|
192
|
+
_takeUnstagedBundle() {
|
|
193
|
+
if (this.#consumed) {
|
|
194
|
+
throw new Error(consumedMessage());
|
|
195
|
+
}
|
|
196
|
+
if (!this.isUnstaged)
|
|
197
|
+
return undefined;
|
|
198
|
+
if (this.#ref.kind !== "transient_file" || this.#bytes === undefined || this.#contentHash === undefined) {
|
|
199
|
+
return undefined;
|
|
200
|
+
}
|
|
201
|
+
return {
|
|
202
|
+
name: this.#ref.name,
|
|
203
|
+
bytes: this.#bytes,
|
|
204
|
+
contentHash: this.#contentHash,
|
|
205
|
+
...(this.#ref.mountPath ? { mountPath: this.#ref.mountPath } : {})
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
toJSON() {
|
|
209
|
+
if (this.#consumed)
|
|
210
|
+
throw new Error(consumedMessage());
|
|
211
|
+
if (this.isUnstaged) {
|
|
212
|
+
throw new Error("Cannot JSON-serialise an inline File — the bytes are not in the JSON. " +
|
|
213
|
+
"Persist via file.upload(client) and serialise the returned workspace instance, " +
|
|
214
|
+
"or pass the inline File directly to submitRun without serialising.");
|
|
215
|
+
}
|
|
216
|
+
return this.#ref;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
const UNSTAGED_SLOT = "(unstaged)";
|
|
220
|
+
const ZIP_EPOCH = new Date(Date.UTC(1980, 0, 1));
|
|
221
|
+
const WORKSPACE_NAME_RE = /^[a-z0-9][a-z0-9-]{0,62}[a-z0-9]$/;
|
|
222
|
+
function resolveChunkedUploader(client) {
|
|
223
|
+
return client._chunkedUpload;
|
|
224
|
+
}
|
|
225
|
+
function resolveUploader(client) {
|
|
226
|
+
const direct = client._uploadFile;
|
|
227
|
+
if (typeof direct === "function")
|
|
228
|
+
return direct.bind(client);
|
|
229
|
+
const nested = client.files?._uploadFile;
|
|
230
|
+
if (typeof nested === "function")
|
|
231
|
+
return nested.bind(client.files);
|
|
232
|
+
throw new Error("File.upload: client argument does not expose an upload entry point — " +
|
|
233
|
+
"pass the AntpathClient instance or its `client.files`");
|
|
234
|
+
}
|
|
235
|
+
function consumedMessage() {
|
|
236
|
+
return ("this File was already uploaded via file.upload(client); use the returned instance " +
|
|
237
|
+
"or File.fromId(record.id) for subsequent runs");
|
|
238
|
+
}
|
|
239
|
+
function inferNameFromPath(path) {
|
|
240
|
+
// Use the basename (for dirs: the dir name), lowercased and normalised.
|
|
241
|
+
// Falls back to a timestamp slug if the result doesn't match.
|
|
242
|
+
const normalised = path.replace(/\\/g, "/").replace(/\/+$/, "");
|
|
243
|
+
const base = normalised.split("/").at(-1) ?? "";
|
|
244
|
+
// Strip file extension for single files.
|
|
245
|
+
const stem = base.replace(/\.[^.]+$/, "").toLowerCase();
|
|
246
|
+
const slug = stem.replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
|
|
247
|
+
if (slug.length >= 2 && WORKSPACE_NAME_RE.test(slug))
|
|
248
|
+
return slug;
|
|
249
|
+
return `file-${Date.now().toString(36)}`;
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Walk a directory recursively and produce a canonical zip (sorted paths,
|
|
253
|
+
* deterministic mtime epoch). Mirrors the `canonicaliseFileBundle` pipeline
|
|
254
|
+
* that runs server-side when a zip is uploaded to the BFF — the hash
|
|
255
|
+
* computed here is what the BFF will re-verify after ingest.
|
|
256
|
+
*/
|
|
257
|
+
async function buildDirZip(dirPath) {
|
|
258
|
+
const files = [];
|
|
259
|
+
await walkDir(dirPath, dirPath, files);
|
|
260
|
+
if (files.length === 0) {
|
|
261
|
+
throw new Error(`File.fromPath: directory ${JSON.stringify(dirPath)} is empty (no regular files)`);
|
|
262
|
+
}
|
|
263
|
+
// Sort by relative path for determinism (mirrors canonicaliseFileBundle).
|
|
264
|
+
files.sort((a, b) => (a.rel < b.rel ? -1 : a.rel > b.rel ? 1 : 0));
|
|
265
|
+
const zippable = {};
|
|
266
|
+
for (const { rel, bytes } of files) {
|
|
267
|
+
zippable[rel] = [bytes, { mtime: ZIP_EPOCH }];
|
|
268
|
+
}
|
|
269
|
+
return zipSync(zippable, { level: 6 });
|
|
270
|
+
}
|
|
271
|
+
async function walkDir(base, current, result) {
|
|
272
|
+
const entries = await readdir(current, { withFileTypes: true });
|
|
273
|
+
for (const entry of entries) {
|
|
274
|
+
const fullPath = join(current, entry.name);
|
|
275
|
+
if (entry.isDirectory()) {
|
|
276
|
+
await walkDir(base, fullPath, result);
|
|
277
|
+
}
|
|
278
|
+
else if (entry.isFile()) {
|
|
279
|
+
const bytes = await readFile(fullPath);
|
|
280
|
+
// Use forward-slash relative path (matches normaliseSkillBundlePath).
|
|
281
|
+
const rel = relative(base, fullPath).replace(/\\/g, "/");
|
|
282
|
+
result.push({ rel, bytes: new Uint8Array(bytes) });
|
|
283
|
+
}
|
|
284
|
+
// Skip symlinks, device files, etc.
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
//# sourceMappingURL=file.js.map
|
package/dist/file.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file.js","sourceRoot":"","sources":["../src/file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACjC,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAExE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,OAAO,IAAI;IACN,IAAI,CAAU;IACd,MAAM,CAAyB;IAC/B,YAAY,CAAqB;IAC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C;IACD,OAAO,OAAO,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;AACzC,CAAC;AAED,KAAK,UAAU,OAAO,CACpB,IAAY,EACZ,OAAe,EACf,MAAiD;IAEjD,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,OAAO,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;IAChE,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAC5B,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;QAC3C,IAAI,KAAK,CAAC,WAAW,EAAE,EAAE,CAAC;YACxB,MAAM,OAAO,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;QACxC,CAAC;aAAM,IAAI,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC;YAC1B,MAAM,KAAK,GAAG,MAAM,QAAQ,CAAC,QAAQ,CAAC,CAAC;YACvC,sEAAsE;YACtE,MAAM,GAAG,GAAG,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;YACzD,MAAM,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QACrD,CAAC;QACD,oCAAoC;IACtC,CAAC;AACH,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -7,11 +7,13 @@
|
|
|
7
7
|
* `Template` wrapper. Everything else is types, errors, and event type
|
|
8
8
|
* guards re-exported from `@antpath/shared`.
|
|
9
9
|
*/
|
|
10
|
-
export { AntpathClient, RunRef, SkillsClient } from "./client.js";
|
|
10
|
+
export { AgentsMdClient, AntpathClient, FilesClient, RunRef, SkillsClient } from "./client.js";
|
|
11
11
|
export type { AntpathClientOptions, StreamEventsOptions, SubmitRunOptions, WaitForRunOptions } from "./client.js";
|
|
12
12
|
export { Skill } from "./skill.js";
|
|
13
13
|
export { AgentsMd } from "./agents-md.js";
|
|
14
14
|
export type { AgentsMdRecord, AgentsMdUploader } from "./agents-md.js";
|
|
15
|
+
export { File } from "./file.js";
|
|
16
|
+
export type { FileRecord as FileAssetRecord, FileUploader } from "./file.js";
|
|
15
17
|
export { McpServer } from "./mcp-server.js";
|
|
16
18
|
export { ProxyEndpoint } from "./proxy-endpoint.js";
|
|
17
19
|
export type { BearerProxyEndpointOptions, BasicProxyEndpointOptions, HeaderProxyEndpointOptions, ProxyEndpointCommonOptions, QueryProxyEndpointOptions } from "./proxy-endpoint.js";
|
|
@@ -22,7 +24,7 @@ export type { BundledSkill, SkillFiles } from "./bundle.js";
|
|
|
22
24
|
export { AntpathApiError, AntpathError, CleanupError, CredentialValidationError, ProviderError, RunStateError } from "./_shared/index.js";
|
|
23
25
|
export { MCP_SERVER_NAME_PATTERN, SKILL_BUNDLE_LIMITS, SkillBundleValidationError, buildPlatformAllowedHosts, normaliseSkillBundlePath, validateSkillBundleEntry, validateSkillBundleManifest, validateProxyAuth } from "./_shared/index.js";
|
|
24
26
|
export type { AgentsMdRef, FileRef, McpServerRef, ProviderSkillRef, SkillBundleEntry, SkillBundleManifest, SkillRef, TransientAgentsMdRef, TransientFileRef, TransientSkillRef, WorkspaceAgentsMdRef, WorkspaceFileRef, WorkspaceSkillRef } from "./_shared/index.js";
|
|
25
|
-
export type { Output, ProviderEvent, Run, RunEvent, SignedOutputLink, Skill as SkillRecord, UsageSummary, WhoAmI } from "./_shared/index.js";
|
|
27
|
+
export type { AgentsMdRecord as AgentsMdRecordWire, FileRecord as FileRecordWire, Output, ProviderEvent, Run, RunEvent, SignedOutputLink, Skill as SkillRecord, UsageSummary, WhoAmI } from "./_shared/index.js";
|
|
26
28
|
export type { PlatformAnthropicSecrets as AnthropicSecrets, PlatformCleanupPolicy as CleanupPolicy, PlatformInlineSecrets as InlineSecrets, PlatformMcpServerSecret as McpServerSecret, PlatformProxyEndpoint, PlatformProxyEndpointAuth, PlatformProxyAuthValue as ProxyAuthValue, PlatformTemplateEnvironment as RunEnvironment, ProxyAuthShape, ProxyMethod, ProxyResponseMode } from "./_shared/index.js";
|
|
27
29
|
export { isAgentCustomToolUse, isAgentEvent, isAgentMcpToolResult, isAgentMcpToolUse, isAgentMessage, isAgentThinking, isAgentToolResult, isAgentToolUse, isSessionError, isSessionEvent, isSessionStatusIdle, isSessionStatusRescheduled, isSessionStatusRunning, isSessionStatusTerminated, isSpanEvent, isUserEvent, isUserMessage } from "./_shared/index.js";
|
|
28
30
|
export { SecretString, redactSecrets } from "./_shared/index.js";
|
package/dist/index.js
CHANGED
|
@@ -7,10 +7,11 @@
|
|
|
7
7
|
* `Template` wrapper. Everything else is types, errors, and event type
|
|
8
8
|
* guards re-exported from `@antpath/shared`.
|
|
9
9
|
*/
|
|
10
|
-
export { AntpathClient, RunRef, SkillsClient } from "./client.js";
|
|
10
|
+
export { AgentsMdClient, AntpathClient, FilesClient, RunRef, SkillsClient } from "./client.js";
|
|
11
11
|
// Composition primitives
|
|
12
12
|
export { Skill } from "./skill.js";
|
|
13
13
|
export { AgentsMd } from "./agents-md.js";
|
|
14
|
+
export { File } from "./file.js";
|
|
14
15
|
export { McpServer } from "./mcp-server.js";
|
|
15
16
|
export { ProxyEndpoint } from "./proxy-endpoint.js";
|
|
16
17
|
export { defineRun } from "./blueprint.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAQ/F,yBAAyB;AACzB,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAQpD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAGhE,SAAS;AACT,OAAO,EACL,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,yBAAyB,EACzB,aAAa,EACb,aAAa,EACd,MAAM,iBAAiB,CAAC;AAEzB,yBAAyB;AACzB,OAAO,EACL,uBAAuB,EACvB,mBAAmB,EACnB,0BAA0B,EAC1B,yBAAyB,EACzB,wBAAwB,EACxB,wBAAwB,EACxB,2BAA2B,EAC3B,iBAAiB,EAClB,MAAM,iBAAiB,CAAC;AAmDzB,oBAAoB;AACpB,OAAO,EACL,oBAAoB,EACpB,YAAY,EACZ,oBAAoB,EACpB,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,cAAc,EACd,mBAAmB,EACnB,0BAA0B,EAC1B,sBAAsB,EACtB,yBAAyB,EACzB,WAAW,EACX,WAAW,EACX,aAAa,EACd,MAAM,iBAAiB,CAAC;AAEzB,mBAAmB;AACnB,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC"}
|
package/dist/skill.d.ts
CHANGED
|
@@ -208,6 +208,35 @@ export interface SkillUploader {
|
|
|
208
208
|
readonly body: Uint8Array;
|
|
209
209
|
}) => Promise<SkillRecord>;
|
|
210
210
|
};
|
|
211
|
+
/**
|
|
212
|
+
* Optional chunked-upload entry point. Present on `AntpathClient`
|
|
213
|
+
* when the BFF supports `POST /api/assets/upload-init` and
|
|
214
|
+
* `POST /api/assets/finalize`. When absent, bundles > 6 MiB throw
|
|
215
|
+
* an informative error.
|
|
216
|
+
*/
|
|
217
|
+
readonly _chunkedUpload?: ChunkedUploadClient;
|
|
218
|
+
}
|
|
219
|
+
/** Internal interface for the three-step TUS upload flow. */
|
|
220
|
+
export interface ChunkedUploadClient {
|
|
221
|
+
readonly init: (args: {
|
|
222
|
+
readonly kind: "skill" | "file";
|
|
223
|
+
readonly name: string;
|
|
224
|
+
readonly sizeBytes: number;
|
|
225
|
+
readonly hash: string;
|
|
226
|
+
}) => Promise<{
|
|
227
|
+
readonly assetId: string;
|
|
228
|
+
readonly storagePath: string;
|
|
229
|
+
readonly tusUrl: string;
|
|
230
|
+
readonly tusToken: string;
|
|
231
|
+
readonly expiresAt: string;
|
|
232
|
+
readonly uploadHeaders: Readonly<Record<string, string>>;
|
|
233
|
+
}>;
|
|
234
|
+
readonly finalize: (args: {
|
|
235
|
+
readonly assetId: string;
|
|
236
|
+
readonly kind: "skill" | "file";
|
|
237
|
+
readonly hash: string;
|
|
238
|
+
readonly storagePath: string;
|
|
239
|
+
}) => Promise<void>;
|
|
211
240
|
}
|
|
212
241
|
/**
|
|
213
242
|
* Anything that can look up an existing workspace skill by hash. Used
|
package/dist/skill.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { SKILL_NAME_PATTERN } from "./_shared/index.js";
|
|
2
2
|
import { bundleSkillFiles, hashSkillBundle } from "./bundle.js";
|
|
3
3
|
import { readDirectoryAsFiles } from "./node-fs.js";
|
|
4
|
+
import { chooseUploadStrategy, uploadChunked } from "./asset-upload.js";
|
|
4
5
|
/**
|
|
5
6
|
* One `Skill` class, one mental model, three usage modes:
|
|
6
7
|
*
|
|
@@ -177,8 +178,41 @@ export class Skill {
|
|
|
177
178
|
throw new Error("Skill.upload: only unstaged transient Skills (built via Skill.fromFiles / Skill.fromPath) can be uploaded; " +
|
|
178
179
|
"use Skill.fromId(record.id) to reference an already-persisted skill");
|
|
179
180
|
}
|
|
181
|
+
const bytes = this.#transientBytes;
|
|
182
|
+
const strategy = chooseUploadStrategy(bytes.byteLength);
|
|
183
|
+
if (strategy === "chunked") {
|
|
184
|
+
// Large bundle: three-step TUS upload.
|
|
185
|
+
const chunkedClient = resolveChunkedUploader(client);
|
|
186
|
+
if (!chunkedClient) {
|
|
187
|
+
throw new Error("Skill.upload: bundle exceeds 6 MiB but the client does not support chunked uploads. " +
|
|
188
|
+
"Pass an AntpathClient instance to enable chunked (TUS) upload.");
|
|
189
|
+
}
|
|
190
|
+
const { init, finalize } = chunkedClient;
|
|
191
|
+
const session = await init({
|
|
192
|
+
kind: "skill",
|
|
193
|
+
name: this.#ref.name,
|
|
194
|
+
sizeBytes: bytes.byteLength,
|
|
195
|
+
hash: this.#ref.contentHash
|
|
196
|
+
});
|
|
197
|
+
await uploadChunked({
|
|
198
|
+
bundle: bytes,
|
|
199
|
+
tusUrl: session.tusUrl,
|
|
200
|
+
tusToken: session.tusToken,
|
|
201
|
+
uploadHeaders: session.uploadHeaders,
|
|
202
|
+
hash: this.#ref.contentHash
|
|
203
|
+
});
|
|
204
|
+
await finalize({
|
|
205
|
+
assetId: session.assetId,
|
|
206
|
+
kind: "skill",
|
|
207
|
+
hash: this.#ref.contentHash,
|
|
208
|
+
storagePath: session.storagePath
|
|
209
|
+
});
|
|
210
|
+
this.#consumed = true;
|
|
211
|
+
return new Skill({ kind: "workspace", id: session.assetId });
|
|
212
|
+
}
|
|
213
|
+
// Small bundle: existing single-request multipart POST.
|
|
180
214
|
const uploader = resolveUploader(client);
|
|
181
|
-
const record = await uploader({ name: this.#ref.name, body:
|
|
215
|
+
const record = await uploader({ name: this.#ref.name, body: bytes });
|
|
182
216
|
// Only mark consumed AFTER a successful upload — a failed upload
|
|
183
217
|
// leaves the original instance reusable so the caller can retry.
|
|
184
218
|
this.#consumed = true;
|
|
@@ -299,6 +333,9 @@ export class Skill {
|
|
|
299
333
|
}
|
|
300
334
|
/** Sentinel slot id used by unstaged transient Skills. */
|
|
301
335
|
const UNSTAGED_SLOT = "(unstaged)";
|
|
336
|
+
function resolveChunkedUploader(client) {
|
|
337
|
+
return client._chunkedUpload;
|
|
338
|
+
}
|
|
302
339
|
function resolveUploader(client) {
|
|
303
340
|
const direct = client._uploadSkillBundle;
|
|
304
341
|
if (typeof direct === "function") {
|
package/dist/skill.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skill.js","sourceRoot":"","sources":["../src/skill.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAKnB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAmB,MAAM,aAAa,CAAC;AACjF,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"skill.js","sourceRoot":"","sources":["../src/skill.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAKnB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAmB,MAAM,aAAa,CAAC;AACjF,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAExE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AACH,MAAM,OAAO,KAAK;IAChB,2FAA2F;IAClF,MAAM,CAA0B;IAEhC,IAAI,CAAW;IACf,eAAe,CAAyB;IACjD,SAAS,GAAY,KAAK,CAAC;IAE3B;;;OAGG;IACH,YAAY,GAAa,EAAE,MAAoB,EAAE,cAA2B;QAC1E,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;QAChB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,eAAe,GAAG,cA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C;IACpC,CAAC;IACD,MAAM,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC;IACjC,IAAI,OAAO,MAAM,KAAK,UAAU,EAAE,CAAC;QACjC,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC7B,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAS,eAAe;IACtB,OAAO,CACL,sFAAsF;QACpF,6CAA6C,CAChD,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "antpath",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.7",
|
|
4
4
|
"description": "TypeScript SDK for running autonomous Claude Managed Agents sessions.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -31,7 +31,8 @@
|
|
|
31
31
|
"node": ">=20"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"fflate": "0.8.2"
|
|
34
|
+
"fflate": "0.8.2",
|
|
35
|
+
"tus-js-client": "4.3.1"
|
|
35
36
|
},
|
|
36
37
|
"scripts": {
|
|
37
38
|
"build": "pnpm --filter @antpath/cli run build && pnpm --filter @antpath/shared run build && tsc -p tsconfig.build.json && node ./scripts/bundle-cli.mjs && node ./scripts/inline-shared.mjs",
|