From d7ba1ced3f876b267d54b93ea0e087632dee4f2c Mon Sep 17 00:00:00 2001 From: Khaliq Date: Fri, 8 May 2026 14:32:26 +0200 Subject: [PATCH] fix(sdk): finish agentToken doc cleanup in types.ts #819 updated the JSDoc on `agentToken` for `SpawnOptions` and `SpawnerSpawnOptions` (in relay.ts), but missed three other interfaces in types.ts that carry the same field: `SpawnPtyInput`, `SpawnHeadlessInput`, and `SpawnProviderInput`. The published `dist/types.d.ts` therefore still shipped the old, misleading comment ("JWT token for relayauth/relayfile permissions"), which is exactly what the spec's Fix 3 was meant to retire. Apply the same corrected JSDoc everywhere agentToken appears. Co-Authored-By: Claude Opus 4.7 (1M context) --- packages/sdk/src/types.ts | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/packages/sdk/src/types.ts b/packages/sdk/src/types.ts index c9b782d82..f9062bbeb 100644 --- a/packages/sdk/src/types.ts +++ b/packages/sdk/src/types.ts @@ -19,8 +19,13 @@ export interface SpawnPtyInput { restartPolicy?: RestartPolicy; continueFrom?: string; skipRelayPrompt?: boolean; - /** JWT token for relayauth/relayfile permissions. When set, the broker - * injects RELAY_AGENT_TOKEN into the agent's environment. */ + /** Optional pre-minted relaycast agent token (`at_live_`, from + * `registerAgent(workspaceKey, name)` in `@agent-relay/sdk/http`). The + * broker plumbs this as `RELAY_AGENT_TOKEN`, which the relaycast MCP + * authenticates with. When omitted, the relaycast MCP auto-mints a token + * using `RELAY_API_KEY` + the spawn name; that is the recommended path. + * Note: this is a relaycast credential, NOT a relayfile/relayauth token — + * override `env.RELAYFILE_TOKEN` on the constructor for relayfile auth. */ agentToken?: string; } @@ -31,8 +36,13 @@ export interface SpawnHeadlessInput { channels?: string[]; task?: string; skipRelayPrompt?: boolean; - /** JWT token for relayauth/relayfile permissions. When set, the broker - * injects RELAY_AGENT_TOKEN into the agent's environment. */ + /** Optional pre-minted relaycast agent token (`at_live_`, from + * `registerAgent(workspaceKey, name)` in `@agent-relay/sdk/http`). The + * broker plumbs this as `RELAY_AGENT_TOKEN`, which the relaycast MCP + * authenticates with. When omitted, the relaycast MCP auto-mints a token + * using `RELAY_API_KEY` + the spawn name; that is the recommended path. + * Note: this is a relaycast credential, NOT a relayfile/relayauth token — + * override `env.RELAYFILE_TOKEN` on the constructor for relayfile auth. */ agentToken?: string; } @@ -54,8 +64,13 @@ export interface SpawnProviderInput { restartPolicy?: RestartPolicy; continueFrom?: string; skipRelayPrompt?: boolean; - /** JWT token for relayauth/relayfile permissions. When set, the broker - * injects RELAY_AGENT_TOKEN into the agent's environment. */ + /** Optional pre-minted relaycast agent token (`at_live_`, from + * `registerAgent(workspaceKey, name)` in `@agent-relay/sdk/http`). The + * broker plumbs this as `RELAY_AGENT_TOKEN`, which the relaycast MCP + * authenticates with. When omitted, the relaycast MCP auto-mints a token + * using `RELAY_API_KEY` + the spawn name; that is the recommended path. + * Note: this is a relaycast credential, NOT a relayfile/relayauth token — + * override `env.RELAYFILE_TOKEN` on the constructor for relayfile auth. */ agentToken?: string; }