antpath 0.2.1 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/README.md +55 -40
  2. package/dist/_shared/cleanup-policy.d.ts +8 -0
  3. package/dist/_shared/cleanup-policy.js +24 -0
  4. package/dist/_shared/config.d.ts +47 -0
  5. package/dist/_shared/config.js +150 -0
  6. package/dist/_shared/dev-stack.d.ts +19 -0
  7. package/dist/_shared/dev-stack.js +105 -0
  8. package/dist/_shared/errors.d.ts +8 -0
  9. package/dist/_shared/errors.js +18 -0
  10. package/dist/_shared/http.d.ts +20 -0
  11. package/dist/_shared/http.js +94 -0
  12. package/dist/_shared/index.d.ts +17 -0
  13. package/dist/_shared/index.js +20 -0
  14. package/dist/{providers → _shared}/known-events.d.ts +10 -10
  15. package/dist/{providers → _shared}/known-events.js +9 -9
  16. package/dist/_shared/operations.d.ts +19 -0
  17. package/dist/_shared/operations.js +42 -0
  18. package/dist/_shared/proxy-protocol.d.ts +148 -0
  19. package/dist/_shared/proxy-protocol.js +113 -0
  20. package/dist/_shared/proxy-validation.d.ts +19 -0
  21. package/dist/_shared/proxy-validation.js +51 -0
  22. package/dist/_shared/runtime-types.d.ts +90 -0
  23. package/dist/_shared/runtime-types.js +2 -0
  24. package/dist/{errors.d.ts → _shared/sdk-errors.d.ts} +10 -1
  25. package/dist/{errors.js → _shared/sdk-errors.js} +15 -2
  26. package/dist/{utils/secrets.js → _shared/sdk-secrets.js} +1 -1
  27. package/dist/_shared/secrets.d.ts +7 -0
  28. package/dist/_shared/secrets.js +20 -0
  29. package/dist/_shared/status.d.ts +8 -0
  30. package/dist/_shared/status.js +46 -0
  31. package/dist/_shared/submission.d.ts +142 -0
  32. package/dist/_shared/submission.js +681 -0
  33. package/dist/{template → _shared/template}/compiler.js +3 -3
  34. package/dist/{template/index.d.ts → _shared/template/helpers.d.ts} +0 -2
  35. package/dist/{template/index.js → _shared/template/helpers.js} +1 -2
  36. package/dist/_shared/template/index.d.ts +4 -0
  37. package/dist/_shared/template/index.js +4 -0
  38. package/dist/_shared/template/mapper.d.ts +11 -0
  39. package/dist/_shared/template/mapper.js +70 -0
  40. package/dist/cli.mjs +1234 -64
  41. package/dist/cli.mjs.sha256 +1 -1
  42. package/dist/client.d.ts +93 -8
  43. package/dist/client.js +192 -30
  44. package/dist/client.js.map +1 -1
  45. package/dist/index.d.ts +16 -10
  46. package/dist/index.js +16 -7
  47. package/dist/index.js.map +1 -1
  48. package/docs/cleanup.md +7 -4
  49. package/docs/credentials.md +12 -12
  50. package/docs/events.md +19 -82
  51. package/docs/outputs.md +15 -4
  52. package/docs/quickstart.md +42 -5
  53. package/docs/skills.md +1 -1
  54. package/docs/templates.md +1 -1
  55. package/docs/testing.md +11 -8
  56. package/examples/mcp-static-bearer.ts +14 -9
  57. package/examples/quickstart.ts +8 -6
  58. package/package.json +4 -5
  59. package/references/implementation-plan.md +1 -1
  60. package/dist/credentials.d.ts +0 -3
  61. package/dist/credentials.js +0 -56
  62. package/dist/credentials.js.map +0 -1
  63. package/dist/errors.js.map +0 -1
  64. package/dist/files/downloader.d.ts +0 -3
  65. package/dist/files/downloader.js +0 -43
  66. package/dist/files/downloader.js.map +0 -1
  67. package/dist/platform/client.d.ts +0 -204
  68. package/dist/platform/client.js +0 -203
  69. package/dist/platform/client.js.map +0 -1
  70. package/dist/platform/index.d.ts +0 -1
  71. package/dist/platform/index.js +0 -2
  72. package/dist/platform/index.js.map +0 -1
  73. package/dist/providers/anthropic/provider.d.ts +0 -36
  74. package/dist/providers/anthropic/provider.js +0 -380
  75. package/dist/providers/anthropic/provider.js.map +0 -1
  76. package/dist/providers/known-events.js.map +0 -1
  77. package/dist/providers/types.d.ts +0 -42
  78. package/dist/providers/types.js.map +0 -1
  79. package/dist/run/controller.d.ts +0 -30
  80. package/dist/run/controller.js +0 -314
  81. package/dist/run/controller.js.map +0 -1
  82. package/dist/skills/packager.d.ts +0 -11
  83. package/dist/skills/packager.js +0 -76
  84. package/dist/skills/packager.js.map +0 -1
  85. package/dist/template/compiler.js.map +0 -1
  86. package/dist/template/index.js.map +0 -1
  87. package/dist/template/types.js +0 -2
  88. package/dist/template/types.js.map +0 -1
  89. package/dist/types.d.ts +0 -149
  90. package/dist/types.js +0 -2
  91. package/dist/types.js.map +0 -1
  92. package/dist/utils/events.d.ts +0 -27
  93. package/dist/utils/events.js +0 -120
  94. package/dist/utils/events.js.map +0 -1
  95. package/dist/utils/paths.d.ts +0 -3
  96. package/dist/utils/paths.js +0 -27
  97. package/dist/utils/paths.js.map +0 -1
  98. package/dist/utils/secrets.js.map +0 -1
  99. package/dist/utils/stable.js.map +0 -1
  100. /package/dist/{utils/secrets.d.ts → _shared/sdk-secrets.d.ts} +0 -0
  101. /package/dist/{utils → _shared}/stable.d.ts +0 -0
  102. /package/dist/{utils → _shared}/stable.js +0 -0
  103. /package/dist/{template → _shared/template}/compiler.d.ts +0 -0
  104. /package/dist/{template → _shared/template}/types.d.ts +0 -0
  105. /package/dist/{providers → _shared/template}/types.js +0 -0
@@ -1 +1 @@
1
- e4adb3ee5b4053a78a8ddaf9cd653fbaf6a0ddf98432411308964c8fd40909f8 cli.mjs
1
+ f82b4c41f4eae3e5c68b987e485b9018d9003f0d2c5ba1d82e0df220c7ac6520 cli.mjs
package/dist/client.d.ts CHANGED
@@ -1,14 +1,99 @@
1
- import type { ManagedAgentProvider } from "./providers/types.js";
2
- import type { TemplateDefinition } from "./template/types.js";
3
- import type { CleanupPolicy, RunHandle, RunOptions } from "./types.js";
4
- import { SecretString } from "./utils/secrets.js";
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";
5
2
  export interface AntpathClientOptions {
6
- anthropicApiKey?: string | SecretString;
7
- provider?: ManagedAgentProvider;
8
- cleanupPolicy?: CleanupPolicy;
3
+ /** Dashboard BFF root, e.g. `https://antpath.example.com`. */
4
+ readonly baseUrl: string;
5
+ /** Workspace-scoped SDK API token. */
6
+ readonly apiToken: string;
7
+ /** Workspace id (UUID or slug). Every operation is scoped to this workspace. */
8
+ readonly workspaceId: string;
9
+ /** Optional `fetch` override for testing. */
10
+ readonly fetch?: FetchLike;
9
11
  }
12
+ /**
13
+ * Per-run submission options. `secrets.anthropic.apiKey` is REQUIRED on
14
+ * every call — the dashboard does not store provider credentials on
15
+ * your behalf. Optional `mcpServers`, `skills`, and `proxyEndpointAuth`
16
+ * round out the session-scoped credential bundle.
17
+ */
18
+ export interface RunSubmitOptions {
19
+ readonly variables?: Record<string, string>;
20
+ readonly secrets: PlatformInlineSecrets;
21
+ readonly proxyEndpoints?: readonly PlatformProxyEndpoint[];
22
+ readonly cleanup?: {
23
+ readonly session?: "retain" | "delete";
24
+ };
25
+ readonly idempotencyKey?: string;
26
+ readonly signal?: AbortSignal;
27
+ }
28
+ export interface StreamEventsOptions {
29
+ readonly intervalMs?: number;
30
+ readonly signal?: AbortSignal;
31
+ }
32
+ export interface WaitForRunOptions {
33
+ readonly intervalMs?: number;
34
+ readonly timeoutMs?: number;
35
+ readonly signal?: AbortSignal;
36
+ }
37
+ /**
38
+ * Lightweight reference to a submitted run. All read-back operations
39
+ * delegate to the same `AntpathClient` and the same operations module
40
+ * the CLI uses, so SDK and CLI never drift.
41
+ */
42
+ export declare class RunRef {
43
+ #private;
44
+ readonly runId: string;
45
+ constructor(client: AntpathClient, runId: string);
46
+ get(): Promise<Run>;
47
+ events(): Promise<readonly RunEvent[]>;
48
+ stream(options?: StreamEventsOptions): AsyncIterable<RunEvent>;
49
+ wait(options?: WaitForRunOptions): Promise<Run>;
50
+ outputs(): Promise<readonly Output[]>;
51
+ cancel(): Promise<void>;
52
+ delete(): Promise<void>;
53
+ }
54
+ /**
55
+ * Unified user-facing client for the antpath platform. The same class
56
+ * powers the published `antpath` SDK and (under the hood) every host-side
57
+ * subcommand of the in-container `antpath` CLI. All operations talk to
58
+ * the dashboard BFF and operate on durable run records.
59
+ */
10
60
  export declare class AntpathClient {
11
61
  #private;
12
62
  constructor(options: AntpathClientOptions);
13
- run(template: TemplateDefinition, options?: RunOptions): Promise<RunHandle>;
63
+ /** Workspace id this client is bound to (read-only). */
64
+ get workspaceId(): string;
65
+ /**
66
+ * Submit a run and wait for it to reach a terminal state. Returns the
67
+ * final `Run` record. For long-running flows, prefer `submitRun` +
68
+ * `streamEvents` + `waitForRun`.
69
+ */
70
+ run(template: TemplateDefinition, options: RunSubmitOptions): Promise<Run>;
71
+ /**
72
+ * Submit a run and return a `RunRef` immediately. Use the ref to
73
+ * stream events, fetch outputs, cancel, or delete the run.
74
+ */
75
+ submitRun(template: TemplateDefinition, options: RunSubmitOptions): Promise<RunRef>;
76
+ /**
77
+ * Same as `submitRun` but accepts an already-compiled `ResolvedTemplate`.
78
+ * Useful when consuming a `.json` template directly.
79
+ */
80
+ submitResolvedRun(template: ResolvedTemplate, options: RunSubmitOptions): Promise<RunRef>;
81
+ getRun(runId: string): Promise<Run>;
82
+ listEvents(runId: string): Promise<readonly RunEvent[]>;
83
+ /**
84
+ * Poll the events endpoint and yield new events as they arrive. Stops
85
+ * when the run reaches a terminal state, when the signal is aborted,
86
+ * or when the caller breaks out of the iterator.
87
+ */
88
+ streamEvents(runId: string, options?: StreamEventsOptions): AsyncIterable<RunEvent>;
89
+ /**
90
+ * Poll the run record until it reaches a terminal status (succeeded,
91
+ * failed, terminated). Throws if `timeoutMs` elapses first.
92
+ */
93
+ waitForRun(runId: string, options?: WaitForRunOptions): Promise<Run>;
94
+ listOutputs(runId: string): Promise<readonly Output[]>;
95
+ createOutputLink(runId: string, outputId: string): Promise<SignedOutputLink>;
96
+ cancelRun(runId: string): Promise<void>;
97
+ deleteRun(runId: string): Promise<void>;
98
+ whoami(): Promise<WhoAmI>;
14
99
  }
package/dist/client.js CHANGED
@@ -1,39 +1,201 @@
1
- import { validateCredentials } from "./credentials.js";
2
- import { AnthropicManagedAgentsProvider } from "./providers/anthropic/provider.js";
3
- import { RunController } from "./run/controller.js";
4
- import { compileTemplate } from "./template/compiler.js";
1
+ import { HttpClient, operations, toPlatformSubmissionTemplate, validateProxyAuth, compileTemplate } from "./_shared/index.js";
2
+ /**
3
+ * Lightweight reference to a submitted run. All read-back operations
4
+ * delegate to the same `AntpathClient` and the same operations module
5
+ * the CLI uses, so SDK and CLI never drift.
6
+ */
7
+ export class RunRef {
8
+ runId;
9
+ #client;
10
+ constructor(client, runId) {
11
+ this.#client = client;
12
+ this.runId = runId;
13
+ }
14
+ get() {
15
+ return this.#client.getRun(this.runId);
16
+ }
17
+ events() {
18
+ return this.#client.listEvents(this.runId);
19
+ }
20
+ stream(options) {
21
+ return this.#client.streamEvents(this.runId, options);
22
+ }
23
+ wait(options) {
24
+ return this.#client.waitForRun(this.runId, options);
25
+ }
26
+ outputs() {
27
+ return this.#client.listOutputs(this.runId);
28
+ }
29
+ cancel() {
30
+ return this.#client.cancelRun(this.runId);
31
+ }
32
+ delete() {
33
+ return this.#client.deleteRun(this.runId);
34
+ }
35
+ }
36
+ /**
37
+ * Unified user-facing client for the antpath platform. The same class
38
+ * powers the published `antpath` SDK and (under the hood) every host-side
39
+ * subcommand of the in-container `antpath` CLI. All operations talk to
40
+ * the dashboard BFF and operate on durable run records.
41
+ */
5
42
  export class AntpathClient {
6
- #provider;
7
- #cleanupPolicy;
43
+ #http;
44
+ #workspaceId;
8
45
  constructor(options) {
9
- if (options.provider) {
10
- this.#provider = options.provider;
46
+ if (!options.workspaceId) {
47
+ throw new Error("AntpathClient: workspaceId is required");
11
48
  }
12
- else if (options.anthropicApiKey) {
13
- this.#provider = new AnthropicManagedAgentsProvider({ apiKey: options.anthropicApiKey });
49
+ this.#http = new HttpClient({
50
+ baseUrl: options.baseUrl,
51
+ apiToken: options.apiToken,
52
+ ...(options.fetch ? { fetch: options.fetch } : {})
53
+ });
54
+ this.#workspaceId = options.workspaceId;
55
+ }
56
+ /** Workspace id this client is bound to (read-only). */
57
+ get workspaceId() {
58
+ return this.#workspaceId;
59
+ }
60
+ /**
61
+ * Submit a run and wait for it to reach a terminal state. Returns the
62
+ * final `Run` record. For long-running flows, prefer `submitRun` +
63
+ * `streamEvents` + `waitForRun`.
64
+ */
65
+ async run(template, options) {
66
+ const ref = await this.submitRun(template, options);
67
+ return ref.wait(options.signal ? { signal: options.signal } : {});
68
+ }
69
+ /**
70
+ * Submit a run and return a `RunRef` immediately. Use the ref to
71
+ * stream events, fetch outputs, cancel, or delete the run.
72
+ */
73
+ async submitRun(template, options) {
74
+ const resolved = compileTemplate(template, options.variables ?? {});
75
+ return this.submitResolvedRun(resolved, options);
76
+ }
77
+ /**
78
+ * Same as `submitRun` but accepts an already-compiled `ResolvedTemplate`.
79
+ * Useful when consuming a `.json` template directly.
80
+ */
81
+ async submitResolvedRun(template, options) {
82
+ if (!options.secrets || !options.secrets.anthropic?.apiKey) {
83
+ throw new Error("AntpathClient.submitRun: secrets.anthropic.apiKey is required");
14
84
  }
15
- else {
16
- throw new Error("AntpathClient requires anthropicApiKey or provider");
85
+ if (options.proxyEndpoints && options.proxyEndpoints.length > 0) {
86
+ validateProxyAuth(options.proxyEndpoints, options.secrets.proxyEndpointAuth);
17
87
  }
18
- this.#cleanupPolicy = options.cleanupPolicy ?? "manual";
88
+ const submission = {
89
+ workspaceId: this.#workspaceId,
90
+ idempotencyKey: options.idempotencyKey ?? generateIdempotencyKey(),
91
+ template: toPlatformSubmissionTemplate(template),
92
+ ...(options.variables ? { variables: options.variables } : {}),
93
+ ...(options.cleanup ? { cleanup: options.cleanup } : {}),
94
+ secrets: options.secrets,
95
+ ...(options.proxyEndpoints && options.proxyEndpoints.length > 0
96
+ ? { proxyEndpoints: options.proxyEndpoints }
97
+ : {})
98
+ };
99
+ const run = await operations.submitRun(this.#http, submission);
100
+ return new RunRef(this, run.id);
19
101
  }
20
- async run(template, options = {}) {
21
- const resolved = compileTemplate(template, options.variables ?? {});
22
- validateCredentials(resolved, options.credentials ?? {});
23
- const controller = new RunController({
24
- provider: this.#provider,
25
- template: resolved,
26
- credentials: options.credentials ?? {},
27
- cleanupPolicy: options.cleanupPolicy ?? this.#cleanupPolicy,
28
- timeoutMs: options.timeoutMs,
29
- signal: options.signal,
30
- logger: options.logger,
31
- onEvent: options.onEvent,
32
- onEventAbortOnError: options.onEventAbortOnError ?? false,
33
- sessionResources: options.sessionResources ?? []
34
- });
35
- await controller.start();
36
- return controller;
102
+ getRun(runId) {
103
+ return operations.getRun(this.#http, this.#workspaceId, runId);
104
+ }
105
+ listEvents(runId) {
106
+ return operations.listRunEvents(this.#http, this.#workspaceId, runId);
107
+ }
108
+ /**
109
+ * Poll the events endpoint and yield new events as they arrive. Stops
110
+ * when the run reaches a terminal state, when the signal is aborted,
111
+ * or when the caller breaks out of the iterator.
112
+ */
113
+ async *streamEvents(runId, options = {}) {
114
+ const intervalMs = options.intervalMs ?? 1_000;
115
+ const signal = options.signal;
116
+ let seenIds = new Set();
117
+ while (!signal?.aborted) {
118
+ const events = await this.listEvents(runId);
119
+ for (const event of events) {
120
+ if (!seenIds.has(event.id)) {
121
+ seenIds.add(event.id);
122
+ yield event;
123
+ }
124
+ }
125
+ const run = await this.getRun(runId);
126
+ if (isTerminal(run.status))
127
+ return;
128
+ await sleep(intervalMs, signal);
129
+ }
130
+ }
131
+ /**
132
+ * Poll the run record until it reaches a terminal status (succeeded,
133
+ * failed, terminated). Throws if `timeoutMs` elapses first.
134
+ */
135
+ async waitForRun(runId, options = {}) {
136
+ const intervalMs = options.intervalMs ?? 1_500;
137
+ const timeoutMs = options.timeoutMs;
138
+ const signal = options.signal;
139
+ const deadline = typeof timeoutMs === "number" ? Date.now() + timeoutMs : Number.POSITIVE_INFINITY;
140
+ while (!signal?.aborted) {
141
+ const run = await this.getRun(runId);
142
+ if (isTerminal(run.status))
143
+ return run;
144
+ if (Date.now() >= deadline) {
145
+ throw new Error(`AntpathClient.waitForRun: timeout after ${timeoutMs}ms`);
146
+ }
147
+ await sleep(intervalMs, signal);
148
+ }
149
+ throw new Error("AntpathClient.waitForRun: aborted");
150
+ }
151
+ listOutputs(runId) {
152
+ return operations.listOutputs(this.#http, this.#workspaceId, runId);
153
+ }
154
+ createOutputLink(runId, outputId) {
155
+ return operations.createOutputLink(this.#http, this.#workspaceId, runId, outputId);
37
156
  }
157
+ cancelRun(runId) {
158
+ return operations.cancelRun(this.#http, this.#workspaceId, runId);
159
+ }
160
+ deleteRun(runId) {
161
+ return operations.deleteRun(this.#http, this.#workspaceId, runId);
162
+ }
163
+ whoami() {
164
+ return operations.whoami(this.#http);
165
+ }
166
+ }
167
+ const TERMINAL_STATUSES = new Set([
168
+ "succeeded",
169
+ "failed",
170
+ "terminated",
171
+ "cancelled",
172
+ "canceled",
173
+ "cleaned_up"
174
+ ]);
175
+ function isTerminal(status) {
176
+ return typeof status === "string" && TERMINAL_STATUSES.has(status);
177
+ }
178
+ function sleep(ms, signal) {
179
+ return new Promise((resolve, reject) => {
180
+ if (signal?.aborted) {
181
+ reject(new Error("aborted"));
182
+ return;
183
+ }
184
+ const timer = setTimeout(() => {
185
+ signal?.removeEventListener("abort", onAbort);
186
+ resolve();
187
+ }, ms);
188
+ const onAbort = () => {
189
+ clearTimeout(timer);
190
+ reject(new Error("aborted"));
191
+ };
192
+ signal?.addEventListener("abort", onAbort, { once: true });
193
+ });
194
+ }
195
+ function generateIdempotencyKey() {
196
+ const cryptoObj = globalThis.crypto;
197
+ if (cryptoObj?.randomUUID)
198
+ return cryptoObj.randomUUID();
199
+ return `idem-${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`;
38
200
  }
39
201
  //# sourceMappingURL=client.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,8BAA8B,EAAE,MAAM,mCAAmC,CAAC;AAEnF,OAAO,EAAE,aAAa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AAO,QAAQ,IAAI,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;AAClF,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,10 +1,16 @@
1
- export { AntpathClient } from "./client.js";
2
- export { AntpathPlatformClient, PlatformApiError, validateProxyAuth, buildPlatformAllowedHosts, resetDefaultSecretsDeprecationWarning } from "./platform/index.js";
3
- export type { PlatformEvent, PlatformOutput, PlatformRun, SignedOutputLink, PlatformInlineSecrets, PlatformRunSubmissionRequest, PlatformProxyEndpoint, PlatformProxyEndpointAuth, PlatformProxyAuthShape, PlatformProxyMethod, PlatformProxyResponseMode, AntpathPlatformClientOptions } from "./platform/index.js";
4
- export { AnthropicManagedAgentsProvider } from "./providers/anthropic/provider.js";
5
- export type { ManagedAgentProvider, ProviderSkillRef, SessionResourceInput, UploadFileInput } from "./providers/types.js";
6
- export { isAgentEvent, isAgentCustomToolUse, isAgentMcpToolResult, isAgentMcpToolUse, isAgentMessage, isAgentThinking, isAgentToolResult, isAgentToolUse, isSessionError, isSessionEvent, isSessionStatusIdle, isSessionStatusRescheduled, isSessionStatusRunning, isSessionStatusTerminated, isSpanEvent, isUserEvent, isUserMessage } from "./providers/known-events.js";
7
- export { compileTemplate, defineTemplate, requiredOAuthAccessToken, requiredStaticBearer, string, type EnvironmentDefinition, type ResolvedTemplate, type TemplateDefinition, type TemplateVariableDefinition } from "./template/index.js";
8
- export type { CleanupPolicy, CleanupResult, CredentialInput, DownloadOutputsOptions, DownloadOutputsResult, Logger, OutputManifest, ProviderEvent, ProviderFile, ProviderResourceIds, RunEvent, RunEventHandler, RunHandle, RunOptions, RunResult, RunStatus, SessionResourceUpload, UsageSummary } from "./types.js";
9
- export { SecretString, redactSecrets } from "./utils/secrets.js";
10
- export { AntpathError, CleanupError, CredentialValidationError, ProviderError, RunStateError, TemplateValidationError } from "./errors.js";
1
+ /**
2
+ * Public surface of the `antpath` SDK.
3
+ *
4
+ * ONE class (`AntpathClient`) talks to the dashboard BFF. The CLI exposes
5
+ * the SAME operations via subcommands. Everything else is types, errors,
6
+ * template helpers, and event type guards re-exported from `@antpath/shared`.
7
+ */
8
+ export { AntpathClient, RunRef } from "./client.js";
9
+ export type { AntpathClientOptions, RunSubmitOptions, StreamEventsOptions, WaitForRunOptions } from "./client.js";
10
+ export { AntpathApiError, AntpathError, CleanupError, CredentialValidationError, ProviderError, RunStateError, TemplateValidationError } from "./_shared/index.js";
11
+ export { buildPlatformAllowedHosts, compileTemplate, defineTemplate, requiredOAuthAccessToken, requiredStaticBearer, string, toPlatformSubmissionTemplate, validateProxyAuth } from "./_shared/index.js";
12
+ export type { CredentialRequirement, EnvironmentDefinition, McpServerDefinition, OutputDefinition, ResolvedTemplate, ResolvedMcpServer, SkillDefinition, TemplateDefinition, TemplateVariableDefinition } from "./_shared/index.js";
13
+ export type { Output, ProviderEvent, Run, RunEvent, RunSubmissionInput, SignedOutputLink, UsageSummary, WhoAmI } from "./_shared/index.js";
14
+ export type { PlatformAnthropicSecrets as AnthropicSecrets, PlatformInlineSecrets as InlineSecrets, PlatformMcpServerSecret as McpServerSecret, PlatformProxyEndpoint as ProxyEndpoint, PlatformProxyEndpointAuth as ProxyEndpointAuth, PlatformProxyAuthValue as ProxyAuthValue, PlatformRunSubmissionRequest as RunSubmissionRequest, PlatformSkillReference as SkillReference, PlatformTemplateSubmission as TemplateSubmission, ProxyAuthShape, ProxyMethod, ProxyResponseMode } from "./_shared/index.js";
15
+ export { isAgentCustomToolUse, isAgentEvent, isAgentMcpToolResult, isAgentMcpToolUse, isAgentMessage, isAgentThinking, isAgentToolResult, isAgentToolUse, isSessionError, isSessionEvent, isSessionStatusIdle, isSessionStatusRescheduled, isSessionStatusRunning, isSessionStatusTerminated, isSpanEvent, isUserEvent, isUserMessage } from "./_shared/index.js";
16
+ export { SecretString, redactSecrets } from "./_shared/index.js";
package/dist/index.js CHANGED
@@ -1,8 +1,17 @@
1
- export { AntpathClient } from "./client.js";
2
- export { AntpathPlatformClient, PlatformApiError, validateProxyAuth, buildPlatformAllowedHosts, resetDefaultSecretsDeprecationWarning } from "./platform/index.js";
3
- export { AnthropicManagedAgentsProvider } from "./providers/anthropic/provider.js";
4
- export { isAgentEvent, isAgentCustomToolUse, isAgentMcpToolResult, isAgentMcpToolUse, isAgentMessage, isAgentThinking, isAgentToolResult, isAgentToolUse, isSessionError, isSessionEvent, isSessionStatusIdle, isSessionStatusRescheduled, isSessionStatusRunning, isSessionStatusTerminated, isSpanEvent, isUserEvent, isUserMessage } from "./providers/known-events.js";
5
- export { compileTemplate, defineTemplate, requiredOAuthAccessToken, requiredStaticBearer, string } from "./template/index.js";
6
- export { SecretString, redactSecrets } from "./utils/secrets.js";
7
- export { AntpathError, CleanupError, CredentialValidationError, ProviderError, RunStateError, TemplateValidationError } from "./errors.js";
1
+ /**
2
+ * Public surface of the `antpath` SDK.
3
+ *
4
+ * ONE class (`AntpathClient`) talks to the dashboard BFF. The CLI exposes
5
+ * the SAME operations via subcommands. Everything else is types, errors,
6
+ * template helpers, and event type guards re-exported from `@antpath/shared`.
7
+ */
8
+ export { AntpathClient, RunRef } from "./client.js";
9
+ // Errors
10
+ export { AntpathApiError, AntpathError, CleanupError, CredentialValidationError, ProviderError, RunStateError, TemplateValidationError } from "./_shared/index.js";
11
+ // Template helpers
12
+ export { buildPlatformAllowedHosts, compileTemplate, defineTemplate, requiredOAuthAccessToken, requiredStaticBearer, string, toPlatformSubmissionTemplate, validateProxyAuth } from "./_shared/index.js";
13
+ // Event type guards
14
+ export { isAgentCustomToolUse, isAgentEvent, isAgentMcpToolResult, isAgentMcpToolUse, isAgentMessage, isAgentThinking, isAgentToolResult, isAgentToolUse, isSessionError, isSessionEvent, isSessionStatusIdle, isSessionStatusRescheduled, isSessionStatusRunning, isSessionStatusTerminated, isSpanEvent, isUserEvent, isUserMessage } from "./_shared/index.js";
15
+ // Secret utilities
16
+ export { SecretString, redactSecrets } from "./_shared/index.js";
8
17
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EACL,qBAAqB,EACrB,gBAAgB,EAChB,iBAAiB,EACjB,yBAAyB,EACzB,qCAAqC,EACtC,MAAM,qBAAqB,CAAC;AAe7B,OAAO,EAAE,8BAA8B,EAAE,MAAM,mCAAmC,CAAC;AAEnF,OAAO,EACL,YAAY,EACZ,oBAAoB,EACpB,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,6BAA6B,CAAC;AACrC,OAAO,EACL,eAAe,EACf,cAAc,EACd,wBAAwB,EACxB,oBAAoB,EACpB,MAAM,EAKP,MAAM,qBAAqB,CAAC;AAqB7B,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,yBAAyB,EACzB,aAAa,EACb,aAAa,EACb,uBAAuB,EACxB,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAQpD,SAAS;AACT,OAAO,EACL,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,yBAAyB,EACzB,aAAa,EACb,aAAa,EACb,uBAAuB,EACxB,MAAM,iBAAiB,CAAC;AAEzB,mBAAmB;AACnB,OAAO,EACL,yBAAyB,EACzB,eAAe,EACf,cAAc,EACd,wBAAwB,EACxB,oBAAoB,EACpB,MAAM,EACN,4BAA4B,EAC5B,iBAAiB,EAClB,MAAM,iBAAiB,CAAC;AA4CzB,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/docs/cleanup.md CHANGED
@@ -4,12 +4,15 @@ title: Cleanup
4
4
 
5
5
  # Cleanup
6
6
 
7
- Cleanup is manual by default:
7
+ By default, the worker cleans up Claude resources after a run reaches a terminal status (`succeeded`, `failed`, `terminated`). Skip cleanup explicitly when you need provider-side files/events for inspection:
8
8
 
9
9
  ```ts
10
- await handle.cleanup();
10
+ const ref = await client.submitRun(template, {
11
+ secrets: { anthropic: { apiKey: process.env.ANTHROPIC_API_KEY! } },
12
+ cleanup: { session: "retain" }
13
+ });
11
14
  ```
12
15
 
13
- This preserves provider-side files/events for inspection and avoids deleting outputs before users download them.
16
+ The corresponding CLI flag is `--cleanup retain` (default `delete`).
14
17
 
15
- If the SDK process exits before cleanup, provider resources may remain in the user's provider workspace. The result includes provider IDs so a future cleanup helper can recover orphaned resources when the caller recreates a Client with the same key.
18
+ A retained session remains visible to Anthropic until the workspace's retention policy reclaims it. The dashboard records `cleanupStatus` (`succeeded` for delete, `retained` for retain, `failed` for crash-stranded resources) and `provider_resources` rows so a future repair operation can recover orphaned resources when needed.
@@ -4,11 +4,11 @@ title: Credentials
4
4
 
5
5
  # Credentials
6
6
 
7
- antpath does not store provider keys or MCP credential values.
7
+ antpath does not store provider keys or MCP credential values across runs.
8
8
 
9
- The caller creates `AntpathClient` with a provider key. MCP credentials are passed at run time and validated against Template requirements.
9
+ The caller passes a workspace-scoped SDK token and provider key inline on every `submitRun` call. The dashboard vaults the bundle for the lifetime of a single run and destroys it at cleanup. MCP credentials and skill references travel the same way.
10
10
 
11
- MVP credential types:
11
+ MVP credential types for MCP auth:
12
12
 
13
13
  - `static_bearer`;
14
14
  - `oauth_access_token`.
@@ -29,14 +29,15 @@ The platform's managed HTTP proxy is the agent-first alternative. The caller dec
29
29
 
30
30
  ```ts
31
31
  import {
32
- AntpathPlatformClient,
32
+ AntpathClient,
33
33
  validateProxyAuth,
34
34
  buildPlatformAllowedHosts
35
35
  } from "antpath";
36
36
 
37
- const client = new AntpathPlatformClient({
37
+ const client = new AntpathClient({
38
38
  baseUrl: "https://dashboard.antpath.dev",
39
- apiToken: "ant_..."
39
+ apiToken: "ant_...",
40
+ workspaceId: "ws_..."
40
41
  });
41
42
 
42
43
  const proxyEndpoints = [
@@ -65,8 +66,7 @@ const proxyEndpointAuth = [
65
66
  // Fail fast at submission time when policy and auth disagree.
66
67
  validateProxyAuth(proxyEndpoints, proxyEndpointAuth);
67
68
 
68
- const run = await client.submitRun({
69
- templateId: "tmpl_xxx",
69
+ const ref = await client.submitRun(template, {
70
70
  proxyEndpoints,
71
71
  secrets: {
72
72
  anthropic: { apiKey: process.env.ANTHROPIC_API_KEY! },
@@ -78,7 +78,7 @@ const run = await client.submitRun({
78
78
  Inside the run container, every session has the platform CLI mounted at `/antpath/antpath` (a Node ESM bundle) and a manifest at `/antpath/index.json` describing the declared endpoints. The skill calls the proxy via the CLI:
79
79
 
80
80
  ```bash
81
- node /antpath/antpath proxy stripe \
81
+ /antpath/antpath proxy stripe \
82
82
  --method GET \
83
83
  --path /v1/charges/ch_123 \
84
84
  --response-mode headers_only
@@ -86,7 +86,7 @@ node /antpath/antpath proxy stripe \
86
86
 
87
87
  The CLI reads the per-run bearer from `/antpath/run-token`, attaches the `X-Antpath-Proxy-Protocol` header, and the BFF injects the bearer/header/query/basic credential before dispatching the outbound call. Only the response (subject to `responseMode` and `maxResponseBytes`) reaches the container. `--response-mode` can only narrow below the policy ceiling.
88
88
 
89
- `node /antpath/antpath --help` reads endpoint details from `/antpath/index.json`. Runs that do not declare any `proxyEndpoints` still have the CLI and an empty manifest mounted, so agents never need to introspect whether the surface exists.
89
+ `/antpath/antpath --help` reads endpoint details from `/antpath/index.json`. Runs that do not declare any `proxyEndpoints` still have the CLI and an empty manifest mounted, so agents never need to introspect whether the surface exists.
90
90
 
91
91
  ### Networking
92
92
 
@@ -99,7 +99,7 @@ const allowedHosts = buildPlatformAllowedHosts({
99
99
  });
100
100
  ```
101
101
 
102
- ### Deprecation: `defaultSecrets`
102
+ ### Secrets are always explicit at the call site
103
103
 
104
- `AntpathPlatformClientOptions.defaultSecrets` is deprecated. Pass `secrets` explicitly on every `submitRun` call so the active credentials are visible at the call site (agent-first design). The client emits a one-time deprecation warning when constructed with `defaultSecrets`.
104
+ There is no `defaultSecrets` and no client-held secret state. Every `submitRun` call carries its full `secrets` bundle (Anthropic key + optional MCP credentials + optional skill references + optional `proxyEndpointAuth`). This is the agent-first invariant: the credentials being used on any given call are visible in the same line of code that submits the run.
105
105