@byok-sdk/client 0.8.0 → 0.9.0-rc.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 (39) hide show
  1. package/README.md +22 -1
  2. package/dist/adapters/index.js +14 -1
  3. package/dist/adapters/index.js.map +1 -1
  4. package/dist/agent-home.d.ts +29 -4
  5. package/dist/bin/agent-memory-mcp-server.d.ts +38 -0
  6. package/dist/bin/agent-message-mcp-server.d.ts +24 -0
  7. package/dist/bin/byok-agent-memory-mcp.d.ts +2 -0
  8. package/dist/bin/byok-agent-memory-mcp.js +432 -0
  9. package/dist/bin/byok-agent-memory-mcp.js.map +1 -0
  10. package/dist/bin/byok-agent-message-mcp.d.ts +2 -0
  11. package/dist/bin/byok-agent-message-mcp.js +441 -0
  12. package/dist/bin/byok-agent-message-mcp.js.map +1 -0
  13. package/dist/bin/byok-agent.js +7808 -5492
  14. package/dist/bin/byok-agent.js.map +1 -1
  15. package/dist/bin/byok-approval-mcp.js.map +1 -1
  16. package/dist/bin/commands/pair.d.ts +3 -0
  17. package/dist/daemon/agent-memory-filesystem.d.ts +23 -0
  18. package/dist/daemon/agent-memory-fs-helper.d.ts +10 -0
  19. package/dist/daemon/agent-memory.d.ts +160 -0
  20. package/dist/daemon/agent-message-outbox.d.ts +58 -0
  21. package/dist/daemon/auth-manager.d.ts +8 -0
  22. package/dist/daemon/control-protocol.d.ts +36 -0
  23. package/dist/daemon/create-daemon.d.ts +29 -2
  24. package/dist/daemon/daemon-owner.d.ts +9 -0
  25. package/dist/daemon/device-credential-store.d.ts +58 -0
  26. package/dist/daemon/device-proof-signer.d.ts +5 -4
  27. package/dist/daemon/memory-guidance.d.ts +8 -0
  28. package/dist/daemon/path-mutation-gate.d.ts +25 -0
  29. package/dist/daemon/resolve-agent-memory-mcp-bin.d.ts +6 -0
  30. package/dist/daemon/resolve-agent-message-mcp-bin.d.ts +6 -0
  31. package/dist/daemon/store.d.ts +45 -24
  32. package/dist/daemon/task-runner.d.ts +88 -3
  33. package/dist/daemon/toolset-registry.d.ts +2 -0
  34. package/dist/index.d.ts +7 -4
  35. package/dist/index.js +9976 -7469
  36. package/dist/index.js.map +1 -1
  37. package/dist/local-state-relocation.d.ts +24 -0
  38. package/dist/types.d.ts +2 -0
  39. package/package.json +7 -5
package/README.md CHANGED
@@ -4,7 +4,13 @@ The local BYOK daemon. It pairs a device, durably journals tasks, connects over
4
4
  WebSocket or long poll, dispatches to local Claude Code, Codex, or pi adapters,
5
5
  and exposes authenticated local diagnostics/control commands.
6
6
 
7
- The package installs `byok-agent` and `byok-approval-mcp` binaries. Provider
7
+ The package installs `byok-agent`, `byok-approval-mcp`, and the SDK-reserved
8
+ `byok-agent-message-mcp` task helper. The message helper exposes only bounded
9
+ plain text/Markdown; authenticated task, Agent, session, device, tenant, and
10
+ destination facts remain daemon/server authority and are never model input.
11
+ The helper receives only a daemon-issued single-task sealed context token;
12
+ it cannot select a task id or product destination.
13
+ Provider
8
14
  credentials are not read by the dispatch plane; `@byok-sdk/keys` is a separate
9
15
  install and keeps a zero dependency edge to this package.
10
16
 
@@ -108,6 +114,14 @@ createDaemon({
108
114
  });
109
115
  ```
110
116
 
117
+ For task-free desired-state projection, use
118
+ `createAgentHomeProjectionConsumer`. Its hook must atomically and idempotently
119
+ ensure its opaque product bytes. BYOK may invoke it again under the same
120
+ canonical-home writer lease when a new request carries the exact current
121
+ revision/hash; the terminal outcome remains `idempotent`. This permits repair
122
+ of locally lost derived files without giving the SDK product path or schema
123
+ knowledge. Stale and same-revision/different-hash requests do not invoke it.
124
+
111
125
  Startup materializes and write-probes the canonical root before publishing
112
126
  `agent-home-contract`. `agentHome` and `gitWorkspace` are mutually exclusive;
113
127
  strict Agent execution has one workspace authority and never falls back to a
@@ -131,6 +145,13 @@ keeps runtime activity metadata/status-only; enabling it is an explicit product
131
145
  decision and requires the server capability. Reliable events are fsynced under
132
146
  the canonical Agent home and retire only after an exact ack.
133
147
 
148
+ Hosts that need cold setup or diagnostic state use
149
+ `readDeviceEnrollmentStatus({ productId, storeDir })`. It validates the
150
+ complete SDK-owned record but returns only `unpaired`, `paired` with
151
+ `deviceId`, or `re_pair_required`; tenant, token, expiry and device keys are
152
+ never projected. Only explicit pairing may replace `re_pair_required` state,
153
+ while filesystem-safety failures remain errors.
154
+
134
155
  ```ts
135
156
  createDaemon({
136
157
  // ...normal device, transport and agentHome configuration
@@ -2551,6 +2551,7 @@ var CodexAdapter = class {
2551
2551
  steer: false,
2552
2552
  resume: true,
2553
2553
  approvalInteractive: false,
2554
+ mcpToolsets: true,
2554
2555
  permissionModes: ["auto", "readonly"]
2555
2556
  },
2556
2557
  environmentRequirements: { credentialNames: [] }
@@ -2682,7 +2683,7 @@ ${withStreams.stderr ?? ""}`);
2682
2683
  resumeRef: startInput.manifest.sessionRef,
2683
2684
  instruction: startInput.instruction,
2684
2685
  modelId: manifestModelId,
2685
- policyArgs: [...policyArgs],
2686
+ policyArgs: [...policyArgs, ...codexMcpConfigArgs(startInput.mcpServers)],
2686
2687
  cwd: manifestCwd,
2687
2688
  env: runtimeEnv,
2688
2689
  spawnFn: this.options.spawnFn,
@@ -2712,6 +2713,18 @@ ${withStreams.stderr ?? ""}`);
2712
2713
  return (this.options.resolveBin ?? resolveCodexBin)();
2713
2714
  }
2714
2715
  };
2716
+ function codexMcpConfigArgs(servers) {
2717
+ if (servers === void 0 || Object.keys(servers).length === 0) return [];
2718
+ const args = ["--ignore-user-config"];
2719
+ for (const [name, server] of Object.entries(servers).sort(([left], [right]) => left.localeCompare(right))) {
2720
+ args.push("-c", `mcp_servers.${name}.command=${JSON.stringify(server.command)}`);
2721
+ if (server.args !== void 0) args.push("-c", `mcp_servers.${name}.args=${JSON.stringify([...server.args])}`);
2722
+ for (const [key, value] of Object.entries(server.env ?? {}).sort(([left], [right]) => left.localeCompare(right))) {
2723
+ args.push("-c", `mcp_servers.${name}.env.${key}=${JSON.stringify(value)}`);
2724
+ }
2725
+ }
2726
+ return args;
2727
+ }
2715
2728
  async function resolveRealWorkspaceDir(workspaceDir) {
2716
2729
  return promises.realpath(workspaceDir).catch(() => workspaceDir);
2717
2730
  }