antpath 0.1.1 → 0.2.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.
@@ -1,39 +1,118 @@
1
1
  export class AsyncEventBus {
2
2
  #history = [];
3
- #waiters = [];
3
+ #streamSubscribers = new Set();
4
+ #listeners = new Set();
4
5
  #closed = false;
5
6
  emit(event) {
6
7
  if (this.#closed) {
7
8
  return;
8
9
  }
9
10
  this.#history.push(event);
10
- const waiter = this.#waiters.shift();
11
- if (waiter) {
12
- waiter({ value: event, done: false });
11
+ for (const subscriber of this.#streamSubscribers) {
12
+ const wake = subscriber.wake;
13
+ if (wake) {
14
+ subscriber.wake = undefined;
15
+ wake();
16
+ }
17
+ }
18
+ for (const listener of this.#listeners) {
19
+ listener.chain = listener.chain.then(() => listener.handler(event)).catch((error) => {
20
+ try {
21
+ listener.onError(error, event);
22
+ }
23
+ catch {
24
+ // onError must never throw; swallow to keep the chain alive for future events.
25
+ }
26
+ });
13
27
  }
14
28
  }
15
29
  close() {
30
+ if (this.#closed) {
31
+ return;
32
+ }
16
33
  this.#closed = true;
17
- for (const waiter of this.#waiters.splice(0)) {
18
- waiter({ value: undefined, done: true });
34
+ for (const subscriber of this.#streamSubscribers) {
35
+ const wake = subscriber.wake;
36
+ if (wake) {
37
+ subscriber.wake = undefined;
38
+ wake();
39
+ }
19
40
  }
20
41
  }
42
+ closed() {
43
+ return this.#closed;
44
+ }
45
+ /**
46
+ * Register a callback that is invoked for every emitted event in order.
47
+ *
48
+ * Async handlers are serialized through a per-listener promise chain so
49
+ * invocation order matches emission order. Errors thrown synchronously or
50
+ * via rejected promises are routed to onError. The chain stays fulfilled
51
+ * even when handlers fail, so subsequent events still trigger the handler.
52
+ */
53
+ addListener(handler, onError) {
54
+ const listener = {
55
+ handler,
56
+ onError,
57
+ chain: Promise.resolve()
58
+ };
59
+ this.#listeners.add(listener);
60
+ return () => {
61
+ this.#listeners.delete(listener);
62
+ };
63
+ }
64
+ /**
65
+ * Await every queued listener invocation that has already been scheduled at
66
+ * the moment this method is called. Callers (e.g., the run controller)
67
+ * must finish emitting before invoking drainListeners; emits that happen
68
+ * after drainListeners is awaited are not guaranteed to be observed by the
69
+ * returned promise.
70
+ */
71
+ async drainListeners() {
72
+ if (this.#listeners.size === 0) {
73
+ return;
74
+ }
75
+ const snapshot = [...this.#listeners].map((listener) => listener.chain);
76
+ await Promise.all(snapshot);
77
+ }
21
78
  stream() {
22
79
  const self = this;
23
80
  return {
24
- async *[Symbol.asyncIterator]() {
25
- let index = 0;
26
- while (index < self.#history.length) {
27
- yield self.#history[index++];
28
- }
29
- while (!self.#closed) {
30
- const next = await new Promise((resolve) => self.#waiters.push(resolve));
31
- if (next.done) {
32
- return;
81
+ [Symbol.asyncIterator]() {
82
+ const subscriber = { wake: undefined, done: false };
83
+ self.#streamSubscribers.add(subscriber);
84
+ let cursor = 0;
85
+ return {
86
+ async next() {
87
+ while (true) {
88
+ if (subscriber.done) {
89
+ self.#streamSubscribers.delete(subscriber);
90
+ return { value: undefined, done: true };
91
+ }
92
+ if (cursor < self.#history.length) {
93
+ const value = self.#history[cursor++];
94
+ return { value, done: false };
95
+ }
96
+ if (self.#closed) {
97
+ self.#streamSubscribers.delete(subscriber);
98
+ return { value: undefined, done: true };
99
+ }
100
+ await new Promise((resolve) => {
101
+ subscriber.wake = resolve;
102
+ });
103
+ }
104
+ },
105
+ async return() {
106
+ subscriber.done = true;
107
+ const wake = subscriber.wake;
108
+ if (wake) {
109
+ subscriber.wake = undefined;
110
+ wake();
111
+ }
112
+ self.#streamSubscribers.delete(subscriber);
113
+ return { value: undefined, done: true };
33
114
  }
34
- index++;
35
- yield next.value;
36
- }
115
+ };
37
116
  }
38
117
  };
39
118
  }
@@ -1 +1 @@
1
- {"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/utils/events.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,aAAa;IACf,QAAQ,GAAQ,EAAE,CAAC;IACnB,QAAQ,G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AC/C,CAAC;iBACF,CAAC;YACJ,CAAC;SACF,CAAC;IACJ,CAAC;CACF"}
@@ -17,7 +17,89 @@ Unsupported in MVP:
17
17
 
18
18
  - arbitrary headers;
19
19
  - OAuth refresh;
20
- - persisted antpath vault;
21
- - antpath MCP proxy.
20
+ - persisted antpath vault.
22
21
 
23
22
  For Claude Managed Agents, the SDK creates per-run provider vault credentials and tracks provider IDs for cleanup.
23
+
24
+ ## Proxy endpoints (per-run custom HTTP credentials)
25
+
26
+ Some skills need to call non-MCP HTTP services (e.g. Stripe, internal APIs). Embedding the credential in the skill content puts the raw secret on disk in the agent container and in the model's context — both prompt-injection-readable.
27
+
28
+ The platform's managed HTTP proxy is the agent-first alternative. The caller declares **policy** at the top level of the submission (hashed for idempotency) and supplies the matching **auth value** inside `secrets` (not hashed, so key rotation does not collapse onto a stale run). The raw credential value never enters the container.
29
+
30
+ ```ts
31
+ import {
32
+ AntpathPlatformClient,
33
+ validateProxyAuth,
34
+ buildPlatformAllowedHosts
35
+ } from "antpath";
36
+
37
+ const client = new AntpathPlatformClient({
38
+ baseUrl: "https://dashboard.antpath.dev",
39
+ apiToken: "ant_..."
40
+ });
41
+
42
+ const proxyEndpoints = [
43
+ {
44
+ name: "stripe",
45
+ baseUrl: "https://api.stripe.com",
46
+ authShape: { type: "bearer" },
47
+ allowMethods: ["GET", "POST"],
48
+ allowPathPrefixes: ["/v1/charges", "/v1/refunds"],
49
+ maxRequestBytes: 65_536,
50
+ maxResponseBytes: 65_536,
51
+ timeoutMs: 10_000,
52
+ responseMode: "headers_only",
53
+ perCallBudget: 60,
54
+ responseByteBudget: 1_048_576
55
+ }
56
+ ] as const;
57
+
58
+ const proxyEndpointAuth = [
59
+ {
60
+ name: "stripe",
61
+ value: { type: "bearer", token: process.env.STRIPE_API_KEY! }
62
+ }
63
+ ] as const;
64
+
65
+ // Fail fast at submission time when policy and auth disagree.
66
+ validateProxyAuth(proxyEndpoints, proxyEndpointAuth);
67
+
68
+ const run = await client.submitRun({
69
+ templateId: "tmpl_xxx",
70
+ proxyEndpoints,
71
+ secrets: {
72
+ anthropic: { apiKey: process.env.ANTHROPIC_API_KEY! },
73
+ proxyEndpointAuth
74
+ }
75
+ });
76
+ ```
77
+
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
+
80
+ ```bash
81
+ node /antpath/antpath proxy stripe \
82
+ --method GET \
83
+ --path /v1/charges/ch_123 \
84
+ --response-mode headers_only
85
+ ```
86
+
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
+
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.
90
+
91
+ ### Networking
92
+
93
+ When a Template uses `limited` networking, the platform host must appear in `allowed_hosts`. The worker injects it automatically; for advance validation in user-built Templates use:
94
+
95
+ ```ts
96
+ const allowedHosts = buildPlatformAllowedHosts({
97
+ dashboardBaseUrl: "https://dashboard.antpath.dev",
98
+ extraHosts: ["api.stripe.com"]
99
+ });
100
+ ```
101
+
102
+ ### Deprecation: `defaultSecrets`
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`.
105
+
package/docs/events.md ADDED
@@ -0,0 +1,129 @@
1
+ ---
2
+ title: Events
3
+ ---
4
+
5
+ # Events
6
+
7
+ Claude Managed Agents sessions run autonomously on Anthropic's infrastructure.
8
+ They are **non-blocking**: the SDK opens a long-lived SSE stream while the
9
+ agent thinks, calls tools, and emits messages on its own schedule. The SDK
10
+ cannot intercept a tool call to return a value — `permission_policy` is
11
+ `always_allow`. This guide covers the observe-only event surface.
12
+
13
+ ## Two ways to consume events
14
+
15
+ ```ts
16
+ // Push: register a callback in RunOptions.
17
+ const handle = await client.run(template, {
18
+ onEvent: async (event) => {
19
+ if (event.type === "provider.event") {
20
+ // event.event is a ProviderEvent (typed via a type guard below).
21
+ }
22
+ }
23
+ });
24
+ await handle.wait();
25
+ ```
26
+
27
+ ```ts
28
+ // Pull: iterate the stream concurrently with handle.wait().
29
+ const handle = await client.run(template);
30
+ const collect = (async () => {
31
+ for await (const event of handle.streamEvents()) {
32
+ // ...
33
+ }
34
+ })();
35
+ const result = await handle.wait();
36
+ await collect;
37
+ ```
38
+
39
+ Both surfaces observe the same events. They can be used together; every
40
+ subscriber sees every event. A subscriber attached after `client.run()`
41
+ returns replays the events it missed (including the initial
42
+ `sdk.status` emitted while provider resources were being created), then
43
+ continues live.
44
+
45
+ ## Event shape
46
+
47
+ ```ts
48
+ type RunEvent =
49
+ | { type: "sdk.status"; status: RunStatus; at: string }
50
+ | { type: "sdk.message_sent"; index: number; at: string }
51
+ | { type: "sdk.cleanup"; ... } // see "Cleanup events" below
52
+ | { type: "provider.event"; event: ProviderEvent; at: string };
53
+
54
+ interface ProviderEvent {
55
+ type: string; // documented Claude event type, e.g. "agent.tool_use"
56
+ payload: unknown; // raw provider payload, redacted
57
+ receivedAt: string;
58
+ }
59
+ ```
60
+
61
+ All events pass through the SDK's secret redaction before reaching any
62
+ subscriber, so payloads do not contain the Anthropic key or MCP credentials
63
+ that were supplied to `client.run()`.
64
+
65
+ ## Drain-before-`wait()` guarantee
66
+
67
+ By the time `await handle.wait()` resolves, every `onEvent` invocation
68
+ triggered by events emitted before the terminal `sdk.status` has itself
69
+ resolved or rejected. Async handlers are invoked serially in event order on
70
+ a single per-listener promise chain, so callers can persist events in order
71
+ without their own queue.
72
+
73
+ The same drain applies to handlers that throw — both modes (warn-only and
74
+ abort-on-error, see below) wait for the offending invocation to settle
75
+ before resolving.
76
+
77
+ ## Error semantics
78
+
79
+ Default: a handler that throws (or returns a rejecting promise) is logged
80
+ via the SDK's configured `logger` at `warn`. The run continues, and the
81
+ final result is unaffected.
82
+
83
+ Opt-in: `onEventAbortOnError: true` upgrades the **first** pre-terminal
84
+ handler error into a `RunStateError` that fails the run. Once terminal
85
+ status has been reached, listener errors are always logged only — they
86
+ never mutate the result, and they cannot trigger recursion when the
87
+ terminal `sdk.status: failed` event itself causes another error.
88
+
89
+ `RunStateError.message` and its `cause` field pass through the same
90
+ redaction layer used for events.
91
+
92
+ ## Cleanup events
93
+
94
+ `sdk.cleanup` events are part of the `RunEvent` union, but they are
95
+ emitted by `handle.cleanup()` after `handle.wait()` has already resolved.
96
+ By that time the event bus has been closed; subscribers attached during
97
+ the run do **not** see them. Inspect cleanup outcomes via the
98
+ `CleanupResult.operations` array returned by `cleanup()` instead.
99
+
100
+ ## Typed helpers
101
+
102
+ `packages/sdk/src/providers/known-events.ts` exports conservative type
103
+ guards that narrow `ProviderEvent.type` to documented Claude event strings.
104
+ They do **not** assert payload field shapes — the raw provider payload
105
+ stays `unknown` until callers parse it themselves.
106
+
107
+ ```ts
108
+ import {
109
+ isAgentMessage,
110
+ isAgentToolUse,
111
+ isAgentToolResult,
112
+ isAgentMcpToolUse,
113
+ isAgentMcpToolResult,
114
+ isAgentCustomToolUse,
115
+ isAgentThinking,
116
+ isUserMessage,
117
+ isSessionStatusRunning,
118
+ isSessionStatusIdle,
119
+ isSessionStatusTerminated,
120
+ isSessionError,
121
+ isAgentEvent,
122
+ isUserEvent,
123
+ isSessionEvent,
124
+ isSpanEvent
125
+ } from "antpath";
126
+ ```
127
+
128
+ The official list of event types is maintained at
129
+ [`platform.claude.com/docs/en/managed-agents/events-and-streaming`](https://platform.claude.com/docs/en/managed-agents/events-and-streaming).
package/docs/skills.md CHANGED
@@ -14,3 +14,5 @@ MVP skill inputs:
14
14
  Local directories are packaged as zip files and mounted under `/antpath/skills/` unless overridden.
15
15
 
16
16
  Inline skills are uploaded as markdown files and mounted under `/antpath/skills/` unless overridden.
17
+
18
+ The platform also mounts the `antpath` CLI at `/antpath/antpath` and a per-run manifest at `/antpath/index.json` on **every** run. Skills can invoke the managed HTTP proxy via `node /antpath/antpath proxy …` — see `credentials.md` for the policy/auth model.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "antpath",
3
- "version": "0.1.1",
3
+ "version": "0.2.1",
4
4
  "description": "TypeScript SDK for running autonomous Claude Managed Agents sessions.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -15,6 +15,9 @@
15
15
  "import": "./dist/index.js"
16
16
  }
17
17
  },
18
+ "bin": {
19
+ "antpath": "./dist/cli.mjs"
20
+ },
18
21
  "files": [
19
22
  "dist",
20
23
  "README.md",
@@ -30,7 +33,7 @@
30
33
  "node": ">=20"
31
34
  },
32
35
  "scripts": {
33
- "build": "tsc -p tsconfig.build.json",
36
+ "build": "pnpm --filter @antpath/cli run build && tsc -p tsconfig.build.json && node ./scripts/bundle-cli.mjs",
34
37
  "lint": "tsc --noEmit",
35
38
  "test": "vitest run test/unit",
36
39
  "test:unit": "vitest run test/unit",