antpath 0.3.1 → 0.4.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/README.md +13 -14
- package/dist/_shared/http.d.ts +6 -1
- package/dist/_shared/http.js +3 -4
- package/dist/_shared/operations.d.ts +13 -8
- package/dist/_shared/operations.js +17 -12
- package/dist/_shared/stable.d.ts +14 -0
- package/dist/_shared/stable.js +14 -0
- package/dist/_shared/submission.d.ts +15 -0
- package/dist/cli.mjs +46 -57
- package/dist/cli.mjs.sha256 +1 -1
- package/dist/client.d.ts +13 -6
- package/dist/client.js +17 -16
- package/dist/client.js.map +1 -1
- package/docs/credentials.md +1 -3
- package/docs/quickstart.md +4 -7
- package/docs/release.md +57 -12
- package/examples/mcp-static-bearer.ts +1 -3
- package/examples/quickstart.ts +1 -3
- package/package.json +2 -3
- package/references/architecture-decisions.md +0 -473
- package/references/implementation-plan.md +0 -452
- package/references/research-sources.md +0 -41
- package/references/testing-strategy.md +0 -29
package/README.md
CHANGED
|
@@ -16,24 +16,26 @@ import {
|
|
|
16
16
|
```
|
|
17
17
|
|
|
18
18
|
```bash
|
|
19
|
-
antpath run ./template.json --api-token ant_…
|
|
19
|
+
antpath run ./template.json --api-token ant_… \
|
|
20
20
|
--anthropic-api-key sk-ant-… --follow
|
|
21
|
-
antpath status <run-id> --api-token …
|
|
22
|
-
antpath events <run-id> --api-token … --
|
|
23
|
-
antpath outputs <run-id> --api-token …
|
|
24
|
-
antpath download <run-id> <output-id> --out ./local --api-token …
|
|
25
|
-
antpath cancel <run-id> --api-token …
|
|
26
|
-
antpath delete <run-id> --api-token …
|
|
27
|
-
antpath whoami --api-token …
|
|
21
|
+
antpath status <run-id> --api-token …
|
|
22
|
+
antpath events <run-id> --api-token … --follow
|
|
23
|
+
antpath outputs <run-id> --api-token …
|
|
24
|
+
antpath download <run-id> <output-id> --out ./local --api-token …
|
|
25
|
+
antpath cancel <run-id> --api-token …
|
|
26
|
+
antpath delete <run-id> --api-token …
|
|
27
|
+
antpath whoami --api-token …
|
|
28
28
|
```
|
|
29
29
|
|
|
30
30
|
The SDK class and the CLI are backed by the same `@antpath/shared` operations module — any read or write you can do through one, you can do through the other, against the same durable run records. The same npm package also ships the in-container `antpath` CLI as its `bin` entry; the worker mounts that CLI at `/antpath/antpath` inside every run so skills can call `antpath proxy …` against the per-run manifest. See [Agent-first surface design](../../references/development-principles.md#agent-first-surface-design).
|
|
31
31
|
|
|
32
|
+
The dashboard URL defaults to `https://antpath.ai`. Self-hosted deployments override with `--dashboard-url` on the CLI or `baseUrl` on `AntpathClient`. The workspace is derived server-side from your API token (1:1 binding), so there is no `--workspace` flag and no `workspaceId` option.
|
|
33
|
+
|
|
32
34
|
## MVP boundaries
|
|
33
35
|
|
|
34
36
|
- Claude Managed Agents only.
|
|
35
37
|
- BYO Anthropic key + MCP credentials + skill references — passed inline on every submission, vaulted for the lifetime of a single run, destroyed at cleanup.
|
|
36
|
-
- Workspace is the tenant boundary.
|
|
38
|
+
- Workspace is the tenant boundary. Workspace identity is derived server-side from the API token (1:1 binding); the SDK / CLI never name it.
|
|
37
39
|
- No SDK-side storage of provider keys, MCP credentials, or output file contents.
|
|
38
40
|
- Cleanup runs by default; opt into retention with `cleanup.session: "retain"`.
|
|
39
41
|
|
|
@@ -43,9 +45,8 @@ The SDK class and the CLI are backed by the same `@antpath/shared` operations mo
|
|
|
43
45
|
import { AntpathClient, defineTemplate, string } from "antpath";
|
|
44
46
|
|
|
45
47
|
const client = new AntpathClient({
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
workspaceId: process.env.ANTPATH_WORKSPACE_ID!
|
|
48
|
+
apiToken: process.env.ANTPATH_API_TOKEN!
|
|
49
|
+
// baseUrl defaults to https://antpath.ai — set it for self-hosted deployments.
|
|
49
50
|
});
|
|
50
51
|
|
|
51
52
|
const template = defineTemplate({
|
|
@@ -84,8 +85,6 @@ The same flow from the CLI:
|
|
|
84
85
|
```bash
|
|
85
86
|
antpath run ./template.json \
|
|
86
87
|
--api-token "$ANTPATH_API_TOKEN" \
|
|
87
|
-
--workspace "$ANTPATH_WORKSPACE_ID" \
|
|
88
|
-
--dashboard-url https://antpath.example.com \
|
|
89
88
|
--anthropic-api-key "$ANTHROPIC_API_KEY" \
|
|
90
89
|
--var topic="agent-first SDK design" \
|
|
91
90
|
--follow
|
package/dist/_shared/http.d.ts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
export type FetchLike = (input: string | URL | Request, init?: RequestInit) => Promise<Response>;
|
|
2
2
|
export interface HttpClientOptions {
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Dashboard BFF root. Optional — defaults to `ANTPATH_DEFAULT_BASE_URL`
|
|
5
|
+
* (`https://antpath.ai`). Self-hosted deployments override with their
|
|
6
|
+
* own URL; no env var consults this value.
|
|
7
|
+
*/
|
|
8
|
+
readonly baseUrl?: string;
|
|
4
9
|
readonly apiToken: string;
|
|
5
10
|
readonly fetch?: FetchLike;
|
|
6
11
|
}
|
package/dist/_shared/http.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AntpathApiError } from "./sdk-errors.js";
|
|
2
|
+
import { ANTPATH_DEFAULT_BASE_URL } from "./stable.js";
|
|
2
3
|
/**
|
|
3
4
|
* Thin transport used by every BFF-bound operation. The SDK class and
|
|
4
5
|
* the CLI subcommands BOTH build an `HttpClient` and pass it to the
|
|
@@ -10,13 +11,11 @@ export class HttpClient {
|
|
|
10
11
|
#apiToken;
|
|
11
12
|
#fetch;
|
|
12
13
|
constructor(options) {
|
|
13
|
-
if (!options.baseUrl) {
|
|
14
|
-
throw new Error("HttpClient: baseUrl is required");
|
|
15
|
-
}
|
|
16
14
|
if (!options.apiToken) {
|
|
17
15
|
throw new Error("HttpClient: apiToken is required");
|
|
18
16
|
}
|
|
19
|
-
const
|
|
17
|
+
const raw = options.baseUrl ?? ANTPATH_DEFAULT_BASE_URL;
|
|
18
|
+
const normalized = raw.endsWith("/") ? raw : `${raw}/`;
|
|
20
19
|
this.#baseUrl = new URL(normalized);
|
|
21
20
|
this.#apiToken = options.apiToken;
|
|
22
21
|
this.#fetch = options.fetch ?? fetch;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { HttpClient } from "./http.js";
|
|
2
2
|
import type { Output, Run, RunEvent, SignedOutputLink, WhoAmI } from "./runtime-types.js";
|
|
3
|
-
import type {
|
|
3
|
+
import type { PlatformRunSubmissionInput } from "./submission.js";
|
|
4
4
|
/**
|
|
5
5
|
* The single source of truth for SDK<->BFF transport. The SDK class
|
|
6
6
|
* AND the CLI subcommands both call these functions; neither
|
|
@@ -8,12 +8,17 @@ import type { PlatformRunSubmissionRequest } from "./submission.js";
|
|
|
8
8
|
*
|
|
9
9
|
* Every function takes an HttpClient (so callers control auth + fetch
|
|
10
10
|
* injection) and returns parsed responses.
|
|
11
|
+
*
|
|
12
|
+
* Workspace identity is derived server-side from the API token on
|
|
13
|
+
* every request — callers do not pass `workspaceId`. See
|
|
14
|
+
* `references/development-principles.md` (Agent-first surface design,
|
|
15
|
+
* Concrete rule 3).
|
|
11
16
|
*/
|
|
12
|
-
export declare function submitRun(http: HttpClient, request:
|
|
13
|
-
export declare function getRun(http: HttpClient,
|
|
14
|
-
export declare function listRunEvents(http: HttpClient,
|
|
15
|
-
export declare function listOutputs(http: HttpClient,
|
|
16
|
-
export declare function createOutputLink(http: HttpClient,
|
|
17
|
-
export declare function cancelRun(http: HttpClient,
|
|
18
|
-
export declare function deleteRun(http: HttpClient,
|
|
17
|
+
export declare function submitRun(http: HttpClient, request: PlatformRunSubmissionInput): Promise<Run>;
|
|
18
|
+
export declare function getRun(http: HttpClient, runId: string): Promise<Run>;
|
|
19
|
+
export declare function listRunEvents(http: HttpClient, runId: string): Promise<readonly RunEvent[]>;
|
|
20
|
+
export declare function listOutputs(http: HttpClient, runId: string): Promise<readonly Output[]>;
|
|
21
|
+
export declare function createOutputLink(http: HttpClient, runId: string, outputId: string): Promise<SignedOutputLink>;
|
|
22
|
+
export declare function cancelRun(http: HttpClient, runId: string): Promise<void>;
|
|
23
|
+
export declare function deleteRun(http: HttpClient, runId: string): Promise<void>;
|
|
19
24
|
export declare function whoami(http: HttpClient): Promise<WhoAmI>;
|
|
@@ -5,6 +5,11 @@
|
|
|
5
5
|
*
|
|
6
6
|
* Every function takes an HttpClient (so callers control auth + fetch
|
|
7
7
|
* injection) and returns parsed responses.
|
|
8
|
+
*
|
|
9
|
+
* Workspace identity is derived server-side from the API token on
|
|
10
|
+
* every request — callers do not pass `workspaceId`. See
|
|
11
|
+
* `references/development-principles.md` (Agent-first surface design,
|
|
12
|
+
* Concrete rule 3).
|
|
8
13
|
*/
|
|
9
14
|
export async function submitRun(http, request) {
|
|
10
15
|
return http.request("/api/runs", {
|
|
@@ -12,26 +17,26 @@ export async function submitRun(http, request) {
|
|
|
12
17
|
body: JSON.stringify(request)
|
|
13
18
|
});
|
|
14
19
|
}
|
|
15
|
-
export async function getRun(http,
|
|
16
|
-
const result = await http.request(`/api/runs/${encodeURIComponent(runId)}
|
|
20
|
+
export async function getRun(http, runId) {
|
|
21
|
+
const result = await http.request(`/api/runs/${encodeURIComponent(runId)}`);
|
|
17
22
|
return hasRun(result) ? result.run : result;
|
|
18
23
|
}
|
|
19
|
-
export async function listRunEvents(http,
|
|
20
|
-
const result = await http.request(`/api/runs/${encodeURIComponent(runId)}/events
|
|
24
|
+
export async function listRunEvents(http, runId) {
|
|
25
|
+
const result = await http.request(`/api/runs/${encodeURIComponent(runId)}/events`);
|
|
21
26
|
return result.events;
|
|
22
27
|
}
|
|
23
|
-
export async function listOutputs(http,
|
|
24
|
-
const result = await http.request(`/api/runs/${encodeURIComponent(runId)}/outputs
|
|
28
|
+
export async function listOutputs(http, runId) {
|
|
29
|
+
const result = await http.request(`/api/runs/${encodeURIComponent(runId)}/outputs`);
|
|
25
30
|
return result.outputs;
|
|
26
31
|
}
|
|
27
|
-
export async function createOutputLink(http,
|
|
28
|
-
return http.request(`/api/runs/${encodeURIComponent(runId)}/outputs/${encodeURIComponent(outputId)}/link`, { method: "POST" }
|
|
32
|
+
export async function createOutputLink(http, runId, outputId) {
|
|
33
|
+
return http.request(`/api/runs/${encodeURIComponent(runId)}/outputs/${encodeURIComponent(outputId)}/link`, { method: "POST" });
|
|
29
34
|
}
|
|
30
|
-
export async function cancelRun(http,
|
|
31
|
-
await http.request(`/api/runs/${encodeURIComponent(runId)}/cancel`, { method: "POST" }
|
|
35
|
+
export async function cancelRun(http, runId) {
|
|
36
|
+
await http.request(`/api/runs/${encodeURIComponent(runId)}/cancel`, { method: "POST" });
|
|
32
37
|
}
|
|
33
|
-
export async function deleteRun(http,
|
|
34
|
-
await http.request(`/api/runs/${encodeURIComponent(runId)}`, { method: "DELETE" }
|
|
38
|
+
export async function deleteRun(http, runId) {
|
|
39
|
+
await http.request(`/api/runs/${encodeURIComponent(runId)}`, { method: "DELETE" });
|
|
35
40
|
}
|
|
36
41
|
export async function whoami(http) {
|
|
37
42
|
return http.request("/api/whoami");
|
package/dist/_shared/stable.d.ts
CHANGED
|
@@ -1,2 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical hosted antpath URL. Used as the default `baseUrl` for the
|
|
3
|
+
* SDK `AntpathClient` and the host-side CLI `--dashboard-url` flag.
|
|
4
|
+
*
|
|
5
|
+
* A single canonical default is not a "footnote mode" — it is the
|
|
6
|
+
* canonical product. Self-hosted deployments override via the
|
|
7
|
+
* explicit `baseUrl` / `--dashboard-url` parameter. The value lives in
|
|
8
|
+
* source (no env-var override) so the agent reading the SDK call site
|
|
9
|
+
* can see exactly where the call goes.
|
|
10
|
+
*
|
|
11
|
+
* See `references/development-principles.md` (Agent-first surface
|
|
12
|
+
* design, Concrete rule 3).
|
|
13
|
+
*/
|
|
14
|
+
export declare const ANTPATH_DEFAULT_BASE_URL = "https://antpath.ai";
|
|
1
15
|
export declare function stableStringify(value: unknown): string;
|
|
2
16
|
export declare function sha256(value: unknown): string;
|
package/dist/_shared/stable.js
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
|
+
/**
|
|
3
|
+
* Canonical hosted antpath URL. Used as the default `baseUrl` for the
|
|
4
|
+
* SDK `AntpathClient` and the host-side CLI `--dashboard-url` flag.
|
|
5
|
+
*
|
|
6
|
+
* A single canonical default is not a "footnote mode" — it is the
|
|
7
|
+
* canonical product. Self-hosted deployments override via the
|
|
8
|
+
* explicit `baseUrl` / `--dashboard-url` parameter. The value lives in
|
|
9
|
+
* source (no env-var override) so the agent reading the SDK call site
|
|
10
|
+
* can see exactly where the call goes.
|
|
11
|
+
*
|
|
12
|
+
* See `references/development-principles.md` (Agent-first surface
|
|
13
|
+
* design, Concrete rule 3).
|
|
14
|
+
*/
|
|
15
|
+
export const ANTPATH_DEFAULT_BASE_URL = "https://antpath.ai";
|
|
2
16
|
export function stableStringify(value) {
|
|
3
17
|
return JSON.stringify(sortValue(value));
|
|
4
18
|
}
|
|
@@ -125,6 +125,21 @@ export interface PlatformRunSubmissionRequest {
|
|
|
125
125
|
*/
|
|
126
126
|
readonly proxyEndpoints?: readonly PlatformProxyEndpoint[];
|
|
127
127
|
}
|
|
128
|
+
/**
|
|
129
|
+
* Wire shape posted by the SDK and CLI. `workspaceId` is **omitted by
|
|
130
|
+
* design** — token-authenticated clients never name the workspace
|
|
131
|
+
* because it is derived from their API token on the server. The BFF
|
|
132
|
+
* route resolves the workspace from the token and injects it before
|
|
133
|
+
* calling `parseRunSubmissionRequest`. The dashboard UI (Auth.js user
|
|
134
|
+
* principal, multi-workspace) is the only caller that supplies
|
|
135
|
+
* `workspaceId` itself.
|
|
136
|
+
*
|
|
137
|
+
* See `references/development-principles.md` (Agent-first surface
|
|
138
|
+
* design, Concrete rule 3).
|
|
139
|
+
*/
|
|
140
|
+
export type PlatformRunSubmissionInput = Omit<PlatformRunSubmissionRequest, "workspaceId"> & {
|
|
141
|
+
readonly workspaceId?: string;
|
|
142
|
+
};
|
|
128
143
|
/**
|
|
129
144
|
* Default caps for a proxy endpoint when the submission doesn't specify
|
|
130
145
|
* one. Conservative on purpose. Operators can override the platform-
|
package/dist/cli.mjs
CHANGED
|
@@ -65,6 +65,7 @@ var PROXY_ENDPOINT_DEFAULTS = {
|
|
|
65
65
|
|
|
66
66
|
// ../shared/dist/stable.js
|
|
67
67
|
import { createHash } from "node:crypto";
|
|
68
|
+
var ANTPATH_DEFAULT_BASE_URL = "https://antpath.ai";
|
|
68
69
|
function stableStringify(value) {
|
|
69
70
|
return JSON.stringify(sortValue(value));
|
|
70
71
|
}
|
|
@@ -329,13 +330,11 @@ var HttpClient = class {
|
|
|
329
330
|
#apiToken;
|
|
330
331
|
#fetch;
|
|
331
332
|
constructor(options) {
|
|
332
|
-
if (!options.baseUrl) {
|
|
333
|
-
throw new Error("HttpClient: baseUrl is required");
|
|
334
|
-
}
|
|
335
333
|
if (!options.apiToken) {
|
|
336
334
|
throw new Error("HttpClient: apiToken is required");
|
|
337
335
|
}
|
|
338
|
-
const
|
|
336
|
+
const raw = options.baseUrl ?? ANTPATH_DEFAULT_BASE_URL;
|
|
337
|
+
const normalized = raw.endsWith("/") ? raw : `${raw}/`;
|
|
339
338
|
this.#baseUrl = new URL(normalized);
|
|
340
339
|
this.#apiToken = options.apiToken;
|
|
341
340
|
this.#fetch = options.fetch ?? fetch;
|
|
@@ -428,26 +427,26 @@ async function submitRun(http, request) {
|
|
|
428
427
|
body: JSON.stringify(request)
|
|
429
428
|
});
|
|
430
429
|
}
|
|
431
|
-
async function getRun(http,
|
|
432
|
-
const result = await http.request(`/api/runs/${encodeURIComponent(runId)}
|
|
430
|
+
async function getRun(http, runId) {
|
|
431
|
+
const result = await http.request(`/api/runs/${encodeURIComponent(runId)}`);
|
|
433
432
|
return hasRun(result) ? result.run : result;
|
|
434
433
|
}
|
|
435
|
-
async function listRunEvents(http,
|
|
436
|
-
const result = await http.request(`/api/runs/${encodeURIComponent(runId)}/events
|
|
434
|
+
async function listRunEvents(http, runId) {
|
|
435
|
+
const result = await http.request(`/api/runs/${encodeURIComponent(runId)}/events`);
|
|
437
436
|
return result.events;
|
|
438
437
|
}
|
|
439
|
-
async function listOutputs(http,
|
|
440
|
-
const result = await http.request(`/api/runs/${encodeURIComponent(runId)}/outputs
|
|
438
|
+
async function listOutputs(http, runId) {
|
|
439
|
+
const result = await http.request(`/api/runs/${encodeURIComponent(runId)}/outputs`);
|
|
441
440
|
return result.outputs;
|
|
442
441
|
}
|
|
443
|
-
async function createOutputLink(http,
|
|
444
|
-
return http.request(`/api/runs/${encodeURIComponent(runId)}/outputs/${encodeURIComponent(outputId)}/link`, { method: "POST" }
|
|
442
|
+
async function createOutputLink(http, runId, outputId) {
|
|
443
|
+
return http.request(`/api/runs/${encodeURIComponent(runId)}/outputs/${encodeURIComponent(outputId)}/link`, { method: "POST" });
|
|
445
444
|
}
|
|
446
|
-
async function cancelRun(http,
|
|
447
|
-
await http.request(`/api/runs/${encodeURIComponent(runId)}/cancel`, { method: "POST" }
|
|
445
|
+
async function cancelRun(http, runId) {
|
|
446
|
+
await http.request(`/api/runs/${encodeURIComponent(runId)}/cancel`, { method: "POST" });
|
|
448
447
|
}
|
|
449
|
-
async function deleteRun(http,
|
|
450
|
-
await http.request(`/api/runs/${encodeURIComponent(runId)}`, { method: "DELETE" }
|
|
448
|
+
async function deleteRun(http, runId) {
|
|
449
|
+
await http.request(`/api/runs/${encodeURIComponent(runId)}`, { method: "DELETE" });
|
|
451
450
|
}
|
|
452
451
|
async function whoami(http) {
|
|
453
452
|
return http.request("/api/whoami");
|
|
@@ -489,10 +488,8 @@ var ANTPATH_RUN_TOKEN_PATH = "/antpath/run-token";
|
|
|
489
488
|
var SUCCESS = { code: 0 };
|
|
490
489
|
var USAGE_ERR = { code: 2 };
|
|
491
490
|
var RUNTIME_ERR = { code: 1 };
|
|
492
|
-
function parseCommonHostFlags(argv
|
|
493
|
-
const requireWorkspace = options.requireWorkspace ?? true;
|
|
491
|
+
function parseCommonHostFlags(argv) {
|
|
494
492
|
let apiToken = null;
|
|
495
|
-
let workspaceId = null;
|
|
496
493
|
let dashboardUrl = null;
|
|
497
494
|
const rest = [];
|
|
498
495
|
for (let i = 0; i < argv.length; i++) {
|
|
@@ -504,13 +501,6 @@ function parseCommonHostFlags(argv, options = {}) {
|
|
|
504
501
|
apiToken = v;
|
|
505
502
|
continue;
|
|
506
503
|
}
|
|
507
|
-
if (arg === "--workspace") {
|
|
508
|
-
const v = argv[++i];
|
|
509
|
-
if (v === void 0)
|
|
510
|
-
return { ok: false, reason: "--workspace requires a value" };
|
|
511
|
-
workspaceId = v;
|
|
512
|
-
continue;
|
|
513
|
-
}
|
|
514
504
|
if (arg === "--dashboard-url") {
|
|
515
505
|
const v = argv[++i];
|
|
516
506
|
if (v === void 0)
|
|
@@ -518,18 +508,19 @@ function parseCommonHostFlags(argv, options = {}) {
|
|
|
518
508
|
dashboardUrl = v;
|
|
519
509
|
continue;
|
|
520
510
|
}
|
|
511
|
+
if (arg === "--workspace" || arg === "--workspace-id") {
|
|
512
|
+
return {
|
|
513
|
+
ok: false,
|
|
514
|
+
reason: `unknown flag ${arg}: workspace is derived from --api-token on the server; drop this flag`
|
|
515
|
+
};
|
|
516
|
+
}
|
|
521
517
|
rest.push(arg);
|
|
522
518
|
}
|
|
523
519
|
if (!apiToken)
|
|
524
520
|
return { ok: false, reason: "--api-token is required" };
|
|
525
|
-
if (!dashboardUrl)
|
|
526
|
-
return { ok: false, reason: "--dashboard-url is required" };
|
|
527
|
-
if (requireWorkspace && !workspaceId) {
|
|
528
|
-
return { ok: false, reason: "--workspace is required" };
|
|
529
|
-
}
|
|
530
521
|
return {
|
|
531
522
|
ok: true,
|
|
532
|
-
flags: { apiToken,
|
|
523
|
+
flags: { apiToken, dashboardUrl: dashboardUrl ?? ANTPATH_DEFAULT_BASE_URL },
|
|
533
524
|
rest
|
|
534
525
|
};
|
|
535
526
|
}
|
|
@@ -1050,7 +1041,6 @@ async function runRunCmd(io2, argv) {
|
|
|
1050
1041
|
...proxyAuth.length ? { proxyEndpointAuth: proxyAuth } : {}
|
|
1051
1042
|
};
|
|
1052
1043
|
const submission = {
|
|
1053
|
-
workspaceId: common.flags.workspaceId,
|
|
1054
1044
|
idempotencyKey: idempotency.value ?? generateIdempotencyKey(),
|
|
1055
1045
|
template: toPlatformSubmissionTemplate(resolved),
|
|
1056
1046
|
secrets,
|
|
@@ -1072,7 +1062,7 @@ async function runRunCmd(io2, argv) {
|
|
|
1072
1062
|
while (!TERMINAL_STATUSES.has(currentStatus)) {
|
|
1073
1063
|
await sleep(2e3);
|
|
1074
1064
|
try {
|
|
1075
|
-
const events = await operations_exports.listRunEvents(http,
|
|
1065
|
+
const events = await operations_exports.listRunEvents(http, run.id);
|
|
1076
1066
|
for (let i = emittedEventCount; i < events.length; i++) {
|
|
1077
1067
|
io2.stdout(JSON.stringify(events[i]) + "\n");
|
|
1078
1068
|
}
|
|
@@ -1082,7 +1072,7 @@ async function runRunCmd(io2, argv) {
|
|
|
1082
1072
|
`);
|
|
1083
1073
|
}
|
|
1084
1074
|
try {
|
|
1085
|
-
const updated = await operations_exports.getRun(http,
|
|
1075
|
+
const updated = await operations_exports.getRun(http, run.id);
|
|
1086
1076
|
currentStatus = updated.status;
|
|
1087
1077
|
} catch (err) {
|
|
1088
1078
|
io2.stderr(`(transient) status poll failed: ${err.message}
|
|
@@ -1090,7 +1080,7 @@ async function runRunCmd(io2, argv) {
|
|
|
1090
1080
|
}
|
|
1091
1081
|
}
|
|
1092
1082
|
try {
|
|
1093
|
-
const final = await operations_exports.getRun(http,
|
|
1083
|
+
const final = await operations_exports.getRun(http, run.id);
|
|
1094
1084
|
io2.stdout(JSON.stringify(final) + "\n");
|
|
1095
1085
|
return final.status === "succeeded" ? SUCCESS : RUNTIME_ERR;
|
|
1096
1086
|
} catch (err) {
|
|
@@ -1183,7 +1173,7 @@ async function runStatusCmd(io2, argv) {
|
|
|
1183
1173
|
const runId = positional[0];
|
|
1184
1174
|
const http = makeHttpClient(io2, common.flags);
|
|
1185
1175
|
try {
|
|
1186
|
-
const run = await operations_exports.getRun(http,
|
|
1176
|
+
const run = await operations_exports.getRun(http, runId);
|
|
1187
1177
|
io2.stdout(JSON.stringify(run) + "\n");
|
|
1188
1178
|
return SUCCESS;
|
|
1189
1179
|
} catch (err) {
|
|
@@ -1219,7 +1209,7 @@ async function runEventsCmd(io2, argv) {
|
|
|
1219
1209
|
const http = makeHttpClient(io2, common.flags);
|
|
1220
1210
|
if (!followResult.present) {
|
|
1221
1211
|
try {
|
|
1222
|
-
const events = await operations_exports.listRunEvents(http,
|
|
1212
|
+
const events = await operations_exports.listRunEvents(http, runId);
|
|
1223
1213
|
for (const event of events) {
|
|
1224
1214
|
io2.stdout(JSON.stringify(event) + "\n");
|
|
1225
1215
|
}
|
|
@@ -1232,7 +1222,7 @@ async function runEventsCmd(io2, argv) {
|
|
|
1232
1222
|
while (true) {
|
|
1233
1223
|
let events;
|
|
1234
1224
|
try {
|
|
1235
|
-
events = await operations_exports.listRunEvents(http,
|
|
1225
|
+
events = await operations_exports.listRunEvents(http, runId);
|
|
1236
1226
|
} catch (err) {
|
|
1237
1227
|
io2.stderr(`(transient) event poll failed: ${err.message}
|
|
1238
1228
|
`);
|
|
@@ -1244,7 +1234,7 @@ async function runEventsCmd(io2, argv) {
|
|
|
1244
1234
|
}
|
|
1245
1235
|
emittedCount = events.length;
|
|
1246
1236
|
try {
|
|
1247
|
-
const run = await operations_exports.getRun(http,
|
|
1237
|
+
const run = await operations_exports.getRun(http, runId);
|
|
1248
1238
|
if (TERMINAL_STATUSES2.has(run.status)) {
|
|
1249
1239
|
return SUCCESS;
|
|
1250
1240
|
}
|
|
@@ -1277,7 +1267,7 @@ async function runOutputsCmd(io2, argv) {
|
|
|
1277
1267
|
const runId = positional[0];
|
|
1278
1268
|
const http = makeHttpClient(io2, common.flags);
|
|
1279
1269
|
try {
|
|
1280
|
-
const outputs = await operations_exports.listOutputs(http,
|
|
1270
|
+
const outputs = await operations_exports.listOutputs(http, runId);
|
|
1281
1271
|
for (const out of outputs) {
|
|
1282
1272
|
io2.stdout(JSON.stringify(out) + "\n");
|
|
1283
1273
|
}
|
|
@@ -1314,7 +1304,7 @@ async function runDownloadCmd(io2, argv) {
|
|
|
1314
1304
|
const http = makeHttpClient(io2, common.flags);
|
|
1315
1305
|
let link;
|
|
1316
1306
|
try {
|
|
1317
|
-
link = await operations_exports.createOutputLink(http,
|
|
1307
|
+
link = await operations_exports.createOutputLink(http, runId, outputId);
|
|
1318
1308
|
} catch (err) {
|
|
1319
1309
|
return emitJsonError(io2, "link_failed", err.message ?? "create link failed", { runId, outputId });
|
|
1320
1310
|
}
|
|
@@ -1370,7 +1360,7 @@ async function runCancelCmd(io2, argv) {
|
|
|
1370
1360
|
const runId = positional[0];
|
|
1371
1361
|
const http = makeHttpClient(io2, common.flags);
|
|
1372
1362
|
try {
|
|
1373
|
-
await operations_exports.cancelRun(http,
|
|
1363
|
+
await operations_exports.cancelRun(http, runId);
|
|
1374
1364
|
io2.stdout(JSON.stringify({ runId, status: "cancel_requested" }) + "\n");
|
|
1375
1365
|
return SUCCESS;
|
|
1376
1366
|
} catch (err) {
|
|
@@ -1396,7 +1386,7 @@ async function runDeleteCmd(io2, argv) {
|
|
|
1396
1386
|
const runId = positional[0];
|
|
1397
1387
|
const http = makeHttpClient(io2, common.flags);
|
|
1398
1388
|
try {
|
|
1399
|
-
await operations_exports.deleteRun(http,
|
|
1389
|
+
await operations_exports.deleteRun(http, runId);
|
|
1400
1390
|
io2.stdout(JSON.stringify({ runId, deleted: true }) + "\n");
|
|
1401
1391
|
return SUCCESS;
|
|
1402
1392
|
} catch (err) {
|
|
@@ -1408,7 +1398,7 @@ async function runDeleteCmd(io2, argv) {
|
|
|
1408
1398
|
async function runWhoamiCmd(io2, argv) {
|
|
1409
1399
|
if (await refuseInsideManagedRun(io2, "whoami"))
|
|
1410
1400
|
return USAGE_ERR;
|
|
1411
|
-
const common = parseCommonHostFlags(argv
|
|
1401
|
+
const common = parseCommonHostFlags(argv);
|
|
1412
1402
|
if (!common.ok) {
|
|
1413
1403
|
io2.stderr(`${common.reason}
|
|
1414
1404
|
`);
|
|
@@ -1496,19 +1486,18 @@ Protocol version: ${manifest.protocolVersion}
|
|
|
1496
1486
|
}
|
|
1497
1487
|
io2.stdout("antpath \u2014 unified CLI for the antpath platform (mirrors the SDK 1:1)\n\n");
|
|
1498
1488
|
io2.stdout("Usage:\n");
|
|
1499
|
-
io2.stdout(" antpath run <template-path> --api-token T
|
|
1500
|
-
io2.stdout(" antpath status <run-id> --api-token T
|
|
1501
|
-
io2.stdout(" antpath events <run-id> [--follow] --api-token T
|
|
1502
|
-
io2.stdout(" antpath outputs <run-id> --api-token T
|
|
1503
|
-
io2.stdout(" antpath download <run-id> <output-id> [--out path] --api-token T
|
|
1504
|
-
io2.stdout(" antpath cancel <run-id> --api-token T
|
|
1505
|
-
io2.stdout(" antpath delete <run-id> --api-token T
|
|
1506
|
-
io2.stdout(" antpath whoami --api-token T
|
|
1489
|
+
io2.stdout(" antpath run <template-path> --api-token T [flags]\n");
|
|
1490
|
+
io2.stdout(" antpath status <run-id> --api-token T\n");
|
|
1491
|
+
io2.stdout(" antpath events <run-id> [--follow] --api-token T\n");
|
|
1492
|
+
io2.stdout(" antpath outputs <run-id> --api-token T\n");
|
|
1493
|
+
io2.stdout(" antpath download <run-id> <output-id> [--out path] --api-token T\n");
|
|
1494
|
+
io2.stdout(" antpath cancel <run-id> --api-token T\n");
|
|
1495
|
+
io2.stdout(" antpath delete <run-id> --api-token T\n");
|
|
1496
|
+
io2.stdout(" antpath whoami --api-token T\n");
|
|
1507
1497
|
io2.stdout(" antpath --help\n\n");
|
|
1508
|
-
io2.stdout("
|
|
1509
|
-
io2.stdout(" --api-token <token>
|
|
1510
|
-
io2.stdout(" --
|
|
1511
|
-
io2.stdout(" --dashboard-url <url> Dashboard BFF root, e.g. https://antpath.example.com\n\n");
|
|
1498
|
+
io2.stdout("Common flags on every host subcommand:\n");
|
|
1499
|
+
io2.stdout(" --api-token <token> REQUIRED \u2014 antpath SDK API token (workspace is derived from it)\n");
|
|
1500
|
+
io2.stdout(" --dashboard-url <url> Optional; defaults to https://antpath.ai (set for self-hosted)\n\n");
|
|
1512
1501
|
io2.stdout("Submit flags (antpath run):\n");
|
|
1513
1502
|
io2.stdout(" --anthropic-api-key <key> REQUIRED \u2014 provider key (never stored)\n");
|
|
1514
1503
|
io2.stdout(" --var name=value Template variable (repeatable)\n");
|
package/dist/cli.mjs.sha256
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
a602b27fb33ed22e122096a17bbe0a1f132a6981e55db03ace316dddc048eac2 cli.mjs
|
package/dist/client.d.ts
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { type FetchLike, type Output, type PlatformInlineSecrets, type PlatformProxyEndpoint, type ResolvedTemplate, type Run, type RunEvent, type SignedOutputLink, type TemplateDefinition, type WhoAmI } from "./_shared/index.js";
|
|
2
2
|
export interface AntpathClientOptions {
|
|
3
|
-
/** Dashboard BFF root, e.g. `https://antpath.example.com`. */
|
|
4
|
-
readonly baseUrl: string;
|
|
5
3
|
/** Workspace-scoped SDK API token. */
|
|
6
4
|
readonly apiToken: string;
|
|
7
|
-
/**
|
|
8
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Dashboard BFF root, e.g. `https://antpath.example.com`. Optional —
|
|
7
|
+
* defaults to the canonical hosted URL (`https://antpath.ai`).
|
|
8
|
+
* Self-hosted deployments override; the default lives in source so
|
|
9
|
+
* the agent reading the SDK call site can see exactly where the call
|
|
10
|
+
* goes.
|
|
11
|
+
*/
|
|
12
|
+
readonly baseUrl?: string;
|
|
9
13
|
/** Optional `fetch` override for testing. */
|
|
10
14
|
readonly fetch?: FetchLike;
|
|
11
15
|
}
|
|
@@ -56,12 +60,15 @@ export declare class RunRef {
|
|
|
56
60
|
* powers the published `antpath` SDK and (under the hood) every host-side
|
|
57
61
|
* subcommand of the in-container `antpath` CLI. All operations talk to
|
|
58
62
|
* the dashboard BFF and operate on durable run records.
|
|
63
|
+
*
|
|
64
|
+
* The SDK never asks the caller for a workspace id — workspace identity
|
|
65
|
+
* is derived server-side from the API token on every request. Use
|
|
66
|
+
* `client.whoami()` if you want to introspect which workspace the
|
|
67
|
+
* token resolves to.
|
|
59
68
|
*/
|
|
60
69
|
export declare class AntpathClient {
|
|
61
70
|
#private;
|
|
62
71
|
constructor(options: AntpathClientOptions);
|
|
63
|
-
/** Workspace id this client is bound to (read-only). */
|
|
64
|
-
get workspaceId(): string;
|
|
65
72
|
/**
|
|
66
73
|
* Submit a run and wait for it to reach a terminal state. Returns the
|
|
67
74
|
* final `Run` record. For long-running flows, prefer `submitRun` +
|
package/dist/client.js
CHANGED
|
@@ -38,24 +38,23 @@ export class RunRef {
|
|
|
38
38
|
* powers the published `antpath` SDK and (under the hood) every host-side
|
|
39
39
|
* subcommand of the in-container `antpath` CLI. All operations talk to
|
|
40
40
|
* the dashboard BFF and operate on durable run records.
|
|
41
|
+
*
|
|
42
|
+
* The SDK never asks the caller for a workspace id — workspace identity
|
|
43
|
+
* is derived server-side from the API token on every request. Use
|
|
44
|
+
* `client.whoami()` if you want to introspect which workspace the
|
|
45
|
+
* token resolves to.
|
|
41
46
|
*/
|
|
42
47
|
export class AntpathClient {
|
|
43
48
|
#http;
|
|
44
|
-
#workspaceId;
|
|
45
49
|
constructor(options) {
|
|
46
|
-
if (!options.
|
|
47
|
-
throw new Error("AntpathClient:
|
|
50
|
+
if (!options.apiToken) {
|
|
51
|
+
throw new Error("AntpathClient: apiToken is required");
|
|
48
52
|
}
|
|
49
53
|
this.#http = new HttpClient({
|
|
50
|
-
baseUrl: options.baseUrl,
|
|
54
|
+
...(options.baseUrl ? { baseUrl: options.baseUrl } : {}),
|
|
51
55
|
apiToken: options.apiToken,
|
|
52
56
|
...(options.fetch ? { fetch: options.fetch } : {})
|
|
53
57
|
});
|
|
54
|
-
this.#workspaceId = options.workspaceId;
|
|
55
|
-
}
|
|
56
|
-
/** Workspace id this client is bound to (read-only). */
|
|
57
|
-
get workspaceId() {
|
|
58
|
-
return this.#workspaceId;
|
|
59
58
|
}
|
|
60
59
|
/**
|
|
61
60
|
* Submit a run and wait for it to reach a terminal state. Returns the
|
|
@@ -85,8 +84,10 @@ export class AntpathClient {
|
|
|
85
84
|
if (options.proxyEndpoints && options.proxyEndpoints.length > 0) {
|
|
86
85
|
validateProxyAuth(options.proxyEndpoints, options.secrets.proxyEndpointAuth);
|
|
87
86
|
}
|
|
87
|
+
// The BFF derives `workspaceId` from the API token; the SDK never
|
|
88
|
+
// names it. See `references/development-principles.md`
|
|
89
|
+
// (Agent-first surface design, Concrete rule 3).
|
|
88
90
|
const submission = {
|
|
89
|
-
workspaceId: this.#workspaceId,
|
|
90
91
|
idempotencyKey: options.idempotencyKey ?? generateIdempotencyKey(),
|
|
91
92
|
template: toPlatformSubmissionTemplate(template),
|
|
92
93
|
...(options.variables ? { variables: options.variables } : {}),
|
|
@@ -100,10 +101,10 @@ export class AntpathClient {
|
|
|
100
101
|
return new RunRef(this, run.id);
|
|
101
102
|
}
|
|
102
103
|
getRun(runId) {
|
|
103
|
-
return operations.getRun(this.#http,
|
|
104
|
+
return operations.getRun(this.#http, runId);
|
|
104
105
|
}
|
|
105
106
|
listEvents(runId) {
|
|
106
|
-
return operations.listRunEvents(this.#http,
|
|
107
|
+
return operations.listRunEvents(this.#http, runId);
|
|
107
108
|
}
|
|
108
109
|
/**
|
|
109
110
|
* Poll the events endpoint and yield new events as they arrive. Stops
|
|
@@ -149,16 +150,16 @@ export class AntpathClient {
|
|
|
149
150
|
throw new Error("AntpathClient.waitForRun: aborted");
|
|
150
151
|
}
|
|
151
152
|
listOutputs(runId) {
|
|
152
|
-
return operations.listOutputs(this.#http,
|
|
153
|
+
return operations.listOutputs(this.#http, runId);
|
|
153
154
|
}
|
|
154
155
|
createOutputLink(runId, outputId) {
|
|
155
|
-
return operations.createOutputLink(this.#http,
|
|
156
|
+
return operations.createOutputLink(this.#http, runId, outputId);
|
|
156
157
|
}
|
|
157
158
|
cancelRun(runId) {
|
|
158
|
-
return operations.cancelRun(this.#http,
|
|
159
|
+
return operations.cancelRun(this.#http, runId);
|
|
159
160
|
}
|
|
160
161
|
deleteRun(runId) {
|
|
161
|
-
return operations.deleteRun(this.#http,
|
|
162
|
+
return operations.deleteRun(this.#http, runId);
|
|
162
163
|
}
|
|
163
164
|
whoami() {
|
|
164
165
|
return operations.whoami(this.#http);
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,UAAU,EACV,4BAA4B,EAC5B,iBAAiB,EACjB,eAAe,EAYhB,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,UAAU,EACV,4BAA4B,EAC5B,iBAAiB,EACjB,eAAe,EAYhB,MAAM,iBAAiB,CAAC;AA2CzB;;;;GAIG;AACH,MAAM,OAAO,MAAM;IACR,KAAK,CAAS;IACd,OAAO,CAAgB;IAEhC,YAAY,MAAqB,EAAE,KAAa;QAC9C,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAED,GAAG;QACD,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACzC,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC7C,CAAC;IAED,MAAM,CAAC,OAA6B;QAClC,OAAO,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IACxD,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