@byok-sdk/client 0.10.2 → 0.11.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 +71 -3
- package/dist/adapters/claude/claude-adapter.d.ts +3 -2
- package/dist/adapters/claude/permission-mapping.d.ts +48 -1
- package/dist/adapters/claude/resolve-approval-mcp-bin.d.ts +3 -2
- package/dist/adapters/codex/permission-mapping.d.ts +16 -0
- package/dist/adapters/index.js +292 -23
- package/dist/adapters/index.js.map +1 -1
- package/dist/adapters/mcp-tool-grants.d.ts +36 -0
- package/dist/adapters/pi/resolve-extensions.d.ts +4 -1
- package/dist/adapters/pi/subagents-policy-config.d.ts +7 -0
- package/dist/adapters/pi/subagents-policy-extension.js +137 -0
- package/dist/adapters/pi/subagents-policy-extension.js.map +1 -0
- package/dist/agent-memory/index.d.ts +1 -1
- package/dist/agent-memory/index.js +4 -4
- package/dist/agent-memory/index.js.map +1 -1
- package/dist/bin/agent-memory-mcp-server.d.ts +2 -2
- package/dist/bin/agent-message-mcp-server.d.ts +0 -1
- package/dist/bin/byok-agent-memory-mcp.js +340 -7
- package/dist/bin/byok-agent-memory-mcp.js.map +1 -1
- package/dist/bin/byok-agent-message-mcp.js +331 -7
- package/dist/bin/byok-agent-message-mcp.js.map +1 -1
- package/dist/bin/byok-agent-team-mcp.d.ts +2 -0
- package/dist/bin/byok-agent-team-mcp.js +765 -0
- package/dist/bin/byok-agent-team-mcp.js.map +1 -0
- package/dist/bin/byok-agent.js +15889 -14610
- package/dist/bin/byok-agent.js.map +1 -1
- package/dist/bin/byok-approval-mcp.js +312 -45
- package/dist/bin/byok-approval-mcp.js.map +1 -1
- package/dist/bin/commands/team.d.ts +15 -0
- package/dist/bin/sdk-reserved-helper-runners.d.ts +2 -0
- package/dist/bin/team-mcp-server.d.ts +27 -0
- package/dist/bin/team-tmux-view.d.ts +19 -0
- package/dist/daemon/agent-message-mcp-preflight.d.ts +17 -0
- package/dist/daemon/control-protocol.d.ts +38 -0
- package/dist/daemon/create-daemon.d.ts +7 -0
- package/dist/daemon/mcp-tools-probe.d.ts +105 -0
- package/dist/daemon/resolve-agent-memory-mcp-bin.d.ts +2 -1
- package/dist/daemon/resolve-agent-message-mcp-bin.d.ts +2 -1
- package/dist/daemon/task-runner.d.ts +18 -1
- package/dist/daemon/team-workspace.d.ts +202 -0
- package/dist/daemon/toolset-registry.d.ts +0 -2
- package/dist/index.d.ts +4 -0
- package/dist/index.js +2682 -1090
- package/dist/index.js.map +1 -1
- package/dist/sdk-reserved-helper-host.d.ts +25 -0
- package/dist/sdk-reserved-mcp.d.ts +23 -0
- package/dist/types.d.ts +36 -0
- package/package.json +10 -5
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export declare const BYOK_SDK_HELPER_SUBCOMMAND = "__byok_sdk_helper";
|
|
2
|
+
export type SdkReservedHelperKind = 'agent-message-mcp' | 'agent-memory-mcp' | 'approval-mcp' | 'agent-team-mcp';
|
|
3
|
+
export interface SdkHelperHostConfig {
|
|
4
|
+
/**
|
|
5
|
+
* Run SDK-reserved helpers by re-entering the product's single-file/SEA
|
|
6
|
+
* executable. The product entrypoint must call
|
|
7
|
+
* {@link runSdkReservedHelperCommand} before its own argument parser.
|
|
8
|
+
*/
|
|
9
|
+
readonly mode: 'self-executable';
|
|
10
|
+
/** Absolute product executable path. Defaults to this process's executable. */
|
|
11
|
+
readonly executable?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface ResolvedSdkReservedHelperBin {
|
|
14
|
+
readonly command: string;
|
|
15
|
+
readonly args: readonly string[];
|
|
16
|
+
readonly source: 'dist-script' | 'self-executable';
|
|
17
|
+
}
|
|
18
|
+
/** SDK-owned launcher shape used by every reserved stdio helper. */
|
|
19
|
+
export declare function resolveSdkReservedHelperBin(kind: SdkReservedHelperKind, host?: SdkHelperHostConfig): ResolvedSdkReservedHelperBin;
|
|
20
|
+
/**
|
|
21
|
+
* Product entrypoint seam for single-file/SEA hosts. Returns `false` without
|
|
22
|
+
* side effects for normal product commands; a reserved command is handled to
|
|
23
|
+
* stdio EOF before this resolves `true`.
|
|
24
|
+
*/
|
|
25
|
+
export declare function runSdkReservedHelperCommand(argv?: readonly string[]): Promise<boolean>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** SDK-owned names shared by daemon injection, adapter policy, and MCP helpers. */
|
|
2
|
+
export declare const AGENT_MESSAGE_MCP_SERVER_NAME = "byokagentmessage";
|
|
3
|
+
export declare const AGENT_MESSAGE_TOOL_NAME = "send_agent_message";
|
|
4
|
+
export declare const AGENT_MEMORY_MCP_SERVER_NAME = "byokagentmemory";
|
|
5
|
+
export declare const AGENT_TEAM_MCP_SERVER_NAME = "byokagentteam";
|
|
6
|
+
/** The MCP server NAME the claude adapter registers `byok-approval-mcp` under in its generated `--mcp-config` — combined with `APPROVAL_TOOL_NAME` (single-sourced from `bin/approval-mcp-server.ts`) to form the `mcp__<server>__<tool>` identifier `--permission-prompt-tool` expects. Lives here, beside the other reserved names, so `toolset-registry.ts`'s host-config rejection and the adapters' own "never treat a reserved server as a projected toolset server" rule read from one list. */
|
|
7
|
+
export declare const APPROVAL_MCP_SERVER_NAME = "byokapproval";
|
|
8
|
+
/**
|
|
9
|
+
* Every MCP server name the SDK owns. A server under one of these names is
|
|
10
|
+
* never a projected host toolset server: `toolset-registry.ts` refuses to
|
|
11
|
+
* configure one, and the adapters grant each reserved server exactly the
|
|
12
|
+
* fixed tool its own protocol needs rather than anything observed.
|
|
13
|
+
*
|
|
14
|
+
* A frozen tuple rather than a `Set`: `Object.freeze` on a `Set` freezes the
|
|
15
|
+
* object's own properties and leaves `add`/`delete` fully functional, so the
|
|
16
|
+
* previous shape advertised an immutability it did not have. Three entries
|
|
17
|
+
* make `includes` the same cost as a hash lookup, and the array really is
|
|
18
|
+
* immutable. Use {@link isReservedMcpServerName} rather than reaching for
|
|
19
|
+
* membership directly.
|
|
20
|
+
*/
|
|
21
|
+
export declare const RESERVED_MCP_SERVER_NAMES: readonly ["byokagentmessage", "byokagentmemory", "byokapproval", "byokagentteam"];
|
|
22
|
+
/** Whether `name` is one of the SDK-owned MCP server names above. */
|
|
23
|
+
export declare function isReservedMcpServerName(name: string): boolean;
|
package/dist/types.d.ts
CHANGED
|
@@ -172,6 +172,26 @@ export interface RuntimeAdapterDescriptor {
|
|
|
172
172
|
readonly environmentRequirements: RuntimeEnvironmentRequirements;
|
|
173
173
|
/** Explicit opt-in to authoritative `task.offer.dispatchSelection` semantics. */
|
|
174
174
|
readonly supportsDispatchSelection: boolean;
|
|
175
|
+
/**
|
|
176
|
+
* Whether this adapter actually CONSUMES
|
|
177
|
+
* {@link RuntimeAdapterPrepareInput.mcpToolsetTools} — i.e. whether it
|
|
178
|
+
* pre-grants each projected toolset server's tools in the runtime's own
|
|
179
|
+
* grant surface (claude's `--allowedTools`, codex's `enabled_tools` +
|
|
180
|
+
* per-tool `approval_mode`) and therefore needs the daemon to observe
|
|
181
|
+
* them first.
|
|
182
|
+
*
|
|
183
|
+
* The daemon uses this, and only this, to decide whether to pay for the
|
|
184
|
+
* pre-admission `tools/list` probe of every projected server
|
|
185
|
+
* (`daemon/mcp-tools-probe.ts`). An adapter that projects toolsets through
|
|
186
|
+
* its own proxy and grants them itself (the pi adapter) declares nothing
|
|
187
|
+
* here and never makes an offer wait on a probe it has no use for.
|
|
188
|
+
*
|
|
189
|
+
* Omission is fail-closed in the direction that matters: no probe means no
|
|
190
|
+
* observation, and an adapter that does consume the observation rejects a
|
|
191
|
+
* projected server it has no tool names for (`adapters/mcp-tool-grants.ts`).
|
|
192
|
+
* A grant is never widened by a missing declaration.
|
|
193
|
+
*/
|
|
194
|
+
readonly requiresMcpToolsetToolObservation?: boolean;
|
|
175
195
|
}
|
|
176
196
|
/** The pure input to one adapter admission decision. It contains no credential values or workspace resources. */
|
|
177
197
|
export interface RuntimeAdapterPrepareInput {
|
|
@@ -181,7 +201,21 @@ export interface RuntimeAdapterPrepareInput {
|
|
|
181
201
|
requiredToolsetIds: readonly string[];
|
|
182
202
|
/** Locally resolved MCP authority; available for pure admission validation only. */
|
|
183
203
|
mcpServers?: Readonly<Record<string, McpStdioServerConfig>>;
|
|
204
|
+
/** {@link McpToolsetToolObservation} for exactly the projected toolset servers in `mcpServers`. */
|
|
205
|
+
mcpToolsetTools?: McpToolsetToolObservation;
|
|
184
206
|
}
|
|
207
|
+
/**
|
|
208
|
+
* Tool names observed by starting each projected toolset MCP server and
|
|
209
|
+
* reading its own `tools/list` answer (`daemon/mcp-tools-probe.ts`), keyed by
|
|
210
|
+
* the projected server name. SDK-reserved servers are never keyed here — they
|
|
211
|
+
* carry their own fixed, single-tool grants inside the adapters.
|
|
212
|
+
*
|
|
213
|
+
* This is the ONLY set of names an adapter may pre-grant to a runtime. Device
|
|
214
|
+
* toolset configuration carries `command`/`args` only, so a configured value
|
|
215
|
+
* could never be an authority on what a server exposes; a name absent from
|
|
216
|
+
* this observation is a name the runtime is never told to allow.
|
|
217
|
+
*/
|
|
218
|
+
export type McpToolsetToolObservation = Readonly<Record<string, readonly string[]>>;
|
|
185
219
|
/** A permanent or currently-unavailable pre-claim admission rejection. */
|
|
186
220
|
export interface RuntimeAdapterRejectedOperation {
|
|
187
221
|
kind: 'reject';
|
|
@@ -233,6 +267,8 @@ export interface RuntimeOperationStartInput {
|
|
|
233
267
|
readonly env: NodeJS.ProcessEnv;
|
|
234
268
|
/** Local MCP authority resolved from logical wire ids. */
|
|
235
269
|
readonly mcpServers?: Readonly<Record<string, McpStdioServerConfig>>;
|
|
270
|
+
/** {@link McpToolsetToolObservation} for exactly the projected toolset servers in `mcpServers`. */
|
|
271
|
+
readonly mcpToolsetTools?: McpToolsetToolObservation;
|
|
236
272
|
/** Optional, adapter-agnostic out-of-band approval channel. */
|
|
237
273
|
readonly approvalChannel?: ApprovalChannel;
|
|
238
274
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@byok-sdk/client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "BYOK SDK client daemon: runs on the end user's machine, pairs with a SaaS server, and drives a local coding-agent runtime",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -24,7 +24,8 @@
|
|
|
24
24
|
"byok-agent": "./dist/bin/byok-agent.js",
|
|
25
25
|
"byok-approval-mcp": "./dist/bin/byok-approval-mcp.js",
|
|
26
26
|
"byok-agent-message-mcp": "./dist/bin/byok-agent-message-mcp.js",
|
|
27
|
-
"byok-agent-memory-mcp": "./dist/bin/byok-agent-memory-mcp.js"
|
|
27
|
+
"byok-agent-memory-mcp": "./dist/bin/byok-agent-memory-mcp.js",
|
|
28
|
+
"byok-agent-team-mcp": "./dist/bin/byok-agent-team-mcp.js"
|
|
28
29
|
},
|
|
29
30
|
"exports": {
|
|
30
31
|
".": {
|
|
@@ -56,21 +57,25 @@
|
|
|
56
57
|
"test:watch": "vitest",
|
|
57
58
|
"typecheck": "tsc --noEmit",
|
|
58
59
|
"smoke:adapters": "node scripts/adapter-task-smoke.mjs",
|
|
60
|
+
"smoke:claude-toolset-permission": "node scripts/claude-toolset-permission-smoke.mjs",
|
|
61
|
+
"smoke:codex-toolset-permission": "node scripts/codex-toolset-permission-smoke.mjs",
|
|
59
62
|
"audit:adapter-task-smoke": "node scripts/adapter-task-smoke.mjs",
|
|
60
63
|
"audit:credentials": "node scripts/linux-credential-audit.mjs",
|
|
61
64
|
"clean": "rm -rf dist"
|
|
62
65
|
},
|
|
63
66
|
"dependencies": {
|
|
64
|
-
"@byok-sdk/core": "0.
|
|
65
|
-
"@byok-sdk/protocol": "0.
|
|
67
|
+
"@byok-sdk/core": "0.11.0",
|
|
68
|
+
"@byok-sdk/protocol": "0.11.0",
|
|
66
69
|
"@earendil-works/pi-coding-agent": "0.84.2",
|
|
70
|
+
"@juicesharp/rpiv-todo": "2.8.0",
|
|
67
71
|
"pi-mcp-adapter": "2.27.0",
|
|
72
|
+
"pi-subagents": "0.60.0",
|
|
68
73
|
"pi-web-access": "0.24.1",
|
|
69
74
|
"ws": "^8.21.1"
|
|
70
75
|
},
|
|
71
76
|
"devDependencies": {
|
|
72
77
|
"@types/ws": "^8.18.1",
|
|
73
|
-
"@byok-sdk/server": "0.
|
|
78
|
+
"@byok-sdk/server": "0.11.0",
|
|
74
79
|
"@hono/node-server": "^2.0.10"
|
|
75
80
|
}
|
|
76
81
|
}
|