@byok-sdk/client 0.1.1 → 0.3.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.
Files changed (34) hide show
  1. package/README.md +46 -6
  2. package/dist/adapters/claude/claude-adapter.d.ts +3 -0
  3. package/dist/adapters/claude/resolve-bin.d.ts +2 -2
  4. package/dist/adapters/codex/codex-adapter.d.ts +5 -3
  5. package/dist/adapters/index.d.ts +1 -1
  6. package/dist/adapters/index.js +293 -100
  7. package/dist/adapters/index.js.map +1 -1
  8. package/dist/adapters/pi/events.d.ts +10 -37
  9. package/dist/adapters/pi/permission-mapping.d.ts +4 -20
  10. package/dist/adapters/pi/pi-adapter.d.ts +22 -0
  11. package/dist/adapters/pi/resolve-bin.d.ts +18 -14
  12. package/dist/adapters/pi/rpc-client.d.ts +1 -4
  13. package/dist/adapters/provider-credential-environment.d.ts +18 -0
  14. package/dist/bin/byok-agent.js +1839 -838
  15. package/dist/bin/byok-agent.js.map +1 -1
  16. package/dist/bin/byok-approval-mcp.js +2 -2
  17. package/dist/bin/byok-approval-mcp.js.map +1 -1
  18. package/dist/daemon/assertion-client.d.ts +68 -0
  19. package/dist/daemon/capabilities-client.d.ts +48 -0
  20. package/dist/daemon/control-protocol.d.ts +81 -4
  21. package/dist/daemon/create-daemon.d.ts +169 -1
  22. package/dist/daemon/daemon-owner.d.ts +35 -0
  23. package/dist/daemon/device-assertion-signer.d.ts +41 -0
  24. package/dist/daemon/device-keys.d.ts +15 -13
  25. package/dist/daemon/observer.d.ts +68 -3
  26. package/dist/daemon/presence-publisher.d.ts +69 -0
  27. package/dist/daemon/skill-pack-installer.d.ts +116 -0
  28. package/dist/daemon/task-runner.d.ts +129 -3
  29. package/dist/index.d.ts +22 -3
  30. package/dist/index.js +1872 -284
  31. package/dist/index.js.map +1 -1
  32. package/dist/lifecycle/create-service-lifecycle.d.ts +2 -2
  33. package/dist/types.d.ts +29 -0
  34. package/package.json +6 -5
@@ -34,8 +34,8 @@ export interface CreateServiceLifecycleOptions {
34
34
  *
35
35
  * Deliberately does NOT try to auto-resolve `ServiceDefinition.program`'s
36
36
  * `command`/`agentBin` from `import.meta.resolve`/`import.meta.url`-style
37
- * introspection the way `adapters/pi/resolve-bin.ts` does for pi's
38
- * optionalDependency. That pattern is a genuinely hazardous fit here: a
37
+ * introspection the way `adapters/pi/resolve-bin.ts` does for pi's required
38
+ * package. That pattern is a genuinely hazardous fit here: a
39
39
  * relative path from THIS source file to `bin/byok-agent.ts` (`../bin/...`,
40
40
  * since `lifecycle/` and `bin/` are sibling directories under `src/`) does
41
41
  * NOT survive tsup's bundling unchanged — `src/index.ts` and
package/dist/types.d.ts CHANGED
@@ -19,6 +19,12 @@ export interface RuntimeDetectResult {
19
19
  export interface RuntimeCapabilities {
20
20
  steer: boolean;
21
21
  resume: boolean;
22
+ /**
23
+ * Whether this adapter can project task-scoped, locally configured MCP
24
+ * servers into the runtime without accepting executable definitions from
25
+ * the remote task. Omission is fail-closed and means unsupported.
26
+ */
27
+ mcpToolsets?: boolean;
22
28
  /**
23
29
  * Whether this adapter can genuinely pause a running session on
24
30
  * `needs_approval` and resume it from an out-of-band decision — i.e.
@@ -36,6 +42,15 @@ export interface RuntimeCapabilities {
36
42
  /** Subset of {@link PermissionPolicy}'s `mode` values this adapter can express without widening. */
37
43
  permissionModes: string[];
38
44
  }
45
+ /** One local stdio MCP server definition. Remote task payloads can never supply this shape. */
46
+ export interface McpStdioServerConfig {
47
+ command: string;
48
+ args?: readonly string[];
49
+ }
50
+ /** A logical group of local MCP servers selectable by a wire-level toolset id. */
51
+ export interface McpToolsetConfig {
52
+ mcpServers: Readonly<Record<string, McpStdioServerConfig>>;
53
+ }
39
54
  /**
40
55
  * M4 Phase 3: the out-of-band approval channel `TaskRunner` (`daemon/
41
56
  * task-runner.ts`) hands to an adapter's `start()` via `TaskContext
@@ -80,6 +95,12 @@ export interface TaskContext {
80
95
  workspaceDir: string;
81
96
  policy: PermissionPolicy;
82
97
  env: NodeJS.ProcessEnv;
98
+ /**
99
+ * MCP servers resolved from this device's local registry for this task.
100
+ * The wire carries only logical toolset ids; command/args never originate
101
+ * from the SaaS task and are never copied into the task instruction.
102
+ */
103
+ mcpServers?: Readonly<Record<string, McpStdioServerConfig>>;
83
104
  /** Prepared local checkpoint repository metadata; absent for legacy plain workspaces. */
84
105
  gitWorkspace?: {
85
106
  workspaceId: string;
@@ -136,6 +157,14 @@ export interface Session {
136
157
  */
137
158
  export interface RuntimeAdapter {
138
159
  id: string;
160
+ /**
161
+ * Explicit opt-in to the authoritative `task.offer.dispatchSelection`
162
+ * contract. A custom adapter using a built-in runtime id must set this only
163
+ * when it validates and pins the exact lane/provider/model semantics; the
164
+ * daemon will otherwise withhold the connection-level capability so a
165
+ * server rejects the offer before sending it.
166
+ */
167
+ readonly supportsDispatchSelection?: true;
139
168
  detect(): Promise<RuntimeDetectResult>;
140
169
  capabilities(): RuntimeCapabilities;
141
170
  start(task: TaskOfferPayload, ctx: TaskContext): Promise<Session>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@byok-sdk/client",
3
- "version": "0.1.1",
3
+ "version": "0.3.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",
@@ -14,7 +14,7 @@
14
14
  },
15
15
  "homepage": "https://github.com/Ancienttwo/byok-sdk#readme",
16
16
  "engines": {
17
- "node": ">=20"
17
+ "node": ">=22.19.0"
18
18
  },
19
19
  "sideEffects": false,
20
20
  "main": "./dist/index.js",
@@ -44,14 +44,15 @@
44
44
  "access": "public"
45
45
  },
46
46
  "dependencies": {
47
+ "@earendil-works/pi-coding-agent": "0.84.1",
47
48
  "ws": "^8.21.1",
48
- "@byok-sdk/core": "0.1.1",
49
- "@byok-sdk/protocol": "0.1.1"
49
+ "@byok-sdk/core": "0.3.0",
50
+ "@byok-sdk/protocol": "0.3.0"
50
51
  },
51
52
  "devDependencies": {
52
53
  "@types/ws": "^8.18.1",
53
54
  "@hono/node-server": "^2.0.10",
54
- "@byok-sdk/server": "0.1.1"
55
+ "@byok-sdk/server": "0.3.0"
55
56
  },
56
57
  "scripts": {
57
58
  "build": "tsup && tsc -p tsconfig.build.json && node scripts/check-adapters-entry.mjs",