@byok-sdk/client 0.12.0 → 0.13.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.
@@ -177,6 +177,15 @@ export type ResultDocumentExtractor = (finalOutput: string, task: ResultDocument
177
177
  * opt-out pin.
178
178
  */
179
179
  export declare const DEFAULT_MAX_TASK_OUTPUT_BYTES: number;
180
+ /**
181
+ * WP0: default number of Attempts allowed to execute concurrently in one
182
+ * canonical Agent home. One — the canonical home is every Agent session's
183
+ * cwd, so a second concurrent Attempt is a second writer of the same
184
+ * `MEMORY.md`, `notes/` and `.git`. Raising it is an explicit host choice
185
+ * (`DaemonConfig.maxConcurrentMutableSessionsPerAgentHome`) that re-enables
186
+ * the 0.12.0 co-writing exposure; there is no implicit fallback to it.
187
+ */
188
+ export declare const DEFAULT_MAX_CONCURRENT_MUTABLE_SESSIONS_PER_AGENT_HOME = 1;
180
189
  export interface TaskRunnerDeps {
181
190
  adapters: RuntimeAdapter[];
182
191
  runtimeAllowlist?: string[];
@@ -204,6 +213,13 @@ export interface TaskRunnerDeps {
204
213
  agentHome?: AgentHomeManager;
205
214
  /** Local authority: legacy offers are declined after journal/dedup/cancel precedence. */
206
215
  strictAgentOnly?: boolean;
216
+ /**
217
+ * WP0: how many Attempts may execute concurrently in ONE canonical Agent
218
+ * home — see `DaemonConfig.maxConcurrentMutableSessionsPerAgentHome`'s own
219
+ * doc comment (`create-daemon.ts`) for the validated contract. Unset
220
+ * defaults to {@link DEFAULT_MAX_CONCURRENT_MUTABLE_SESSIONS_PER_AGENT_HOME}.
221
+ */
222
+ maxConcurrentMutableSessionsPerAgentHome?: number;
207
223
  /** Exact host-selected policy accepted by `task.offer_for_agent_with_egress`. */
208
224
  agentEgressPolicy?: Readonly<AgentEgressPolicy>;
209
225
  /** Always-present projection/sanitizer consumer; it defaults to metadata-only. */
@@ -553,6 +569,8 @@ export declare class TaskRunner {
553
569
  usesAgentEgress(taskId: string): boolean;
554
570
  /** M5 batch-3 (workstream 2): effective `maxTaskOutputBytes` cap for this daemon — see {@link DEFAULT_MAX_TASK_OUTPUT_BYTES}'s own doc comment. */
555
571
  private get maxTaskOutputBytes();
572
+ /** WP0: effective per-canonical-Agent-home Attempt cap — see {@link DEFAULT_MAX_CONCURRENT_MUTABLE_SESSIONS_PER_AGENT_HOME}. */
573
+ private get maxConcurrentMutableSessionsPerAgentHome();
556
574
  /**
557
575
  * M4 Phase 4 (part B.3, observability): per-active-task queue watermarks
558
576
  * for the control socket's `status` result — see
@@ -1,7 +1,5 @@
1
- /** Normalize a configured `serverUrl` (http/https/ws/wss, any path) to an http(s) base with no path/query. */
1
+ /** Normalize a configured HTTP(S) `serverUrl` (any path) to a base with no path/query. */
2
2
  export declare function toHttpBase(serverUrl: string): string;
3
- /** Derive the `/byok/ws` WebSocket URL from a configured `serverUrl`. */
4
- export declare function toWsUrl(serverUrl: string): string;
5
3
  /**
6
4
  * Which route a transport diagnostic is about, in the only two fields that
7
5
  * are safe to keep: the host (with port) and the path.
@@ -15,7 +13,7 @@ export declare function toWsUrl(serverUrl: string): string;
15
13
  * by formatting a raw URL of its own.
16
14
  */
17
15
  export interface TransportEndpoint {
18
- readonly transport: 'ws' | 'long-poll';
16
+ readonly transport: 'long-poll';
19
17
  /** `URL.host` — hostname plus port when non-default. Never userinfo. */
20
18
  readonly host: string;
21
19
  /** `URL.pathname` — no query, no fragment. */
@@ -43,7 +41,7 @@ export declare class InsecureServerUrlError extends Error {
43
41
  }
44
42
  export interface AssertServerUrlAllowedOptions {
45
43
  /**
46
- * Explicit escape hatch: when `true`, a `http:`/`ws:` `serverUrl` whose
44
+ * Explicit escape hatch: when `true`, an `http:` `serverUrl` whose
47
45
  * host is NOT loopback is allowed through instead of throwing. Does
48
46
  * nothing for an unsupported scheme (see {@link assertServerUrlAllowed}'s
49
47
  * own doc comment) — that rejection is unconditional. Threaded from
@@ -57,25 +55,25 @@ export interface AssertServerUrlAllowedOptions {
57
55
  }
58
56
  /**
59
57
  * M5: transport-security gate for a configured `serverUrl` — refuses
60
- * plaintext (`ws:`/`http:`) transport to any non-loopback host, so a device
58
+ * plaintext (`http:`) transport to any non-loopback host, so a device
61
59
  * can never be talked into pairing with (and sending its pairing code /
62
60
  * device credentials to) a remote host in the clear. Call this ONCE at each
63
61
  * real entry point a raw, operator-supplied `serverUrl` first enters the
64
62
  * client (`create-daemon.ts`'s `pair()`/`start()`) rather than inside
65
- * `toHttpBase`/`toWsUrl` themselves: ws-transport, the long-poll fallback,
66
- * and blob-client all read `serverUrl` from that SAME `DaemonConfig`, never
63
+ * `toHttpBase` itself: long-poll and blob-client both read `serverUrl` from
64
+ * that same `DaemonConfig`, never
67
65
  * an independently-supplied URL of their own, so those two call sites are
68
66
  * already the single common path every one of them goes through.
69
67
  *
70
68
  * Rules, checked in order:
71
- * - `https:`/`wss:` — always allowed, any host (TLS is the actual
69
+ * - `https:` — always allowed, any host (TLS is the actual
72
70
  * plaintext-network defense; this gate has nothing further to add there).
73
- * - `http:`/`ws:` — allowed only when the hostname is loopback: exactly
71
+ * - `http:` — allowed only when the hostname is loopback: exactly
74
72
  * `localhost` or any `*.localhost` subdomain, an IPv4 literal in
75
73
  * `127.0.0.0/8`, or the IPv6 loopback `::1` — see {@link isLoopbackHostname}.
76
- * - `http:`/`ws:` to any other host — refused with a clear, typed
74
+ * - `http:` to any other host — refused with a clear, typed
77
75
  * {@link InsecureServerUrlError} naming the redacted scheme/host/path and the fix
78
- * (use `wss:`/`https:`, or pass `dangerouslyAllowInsecureRemote: true` if
76
+ * (use `https:`, or pass `dangerouslyAllowInsecureRemote: true` if
79
77
  * this is a deliberate, understood exception) — UNLESS
80
78
  * `opts.dangerouslyAllowInsecureRemote` is `true`.
81
79
  * - Any other scheme (or a `serverUrl` that fails to parse as a URL at
@@ -28,7 +28,7 @@ export interface SupportBundle {
28
28
  status: 'online';
29
29
  pid: number;
30
30
  uptimeMs: number;
31
- transport: 'connecting' | 'open' | 'closed' | 'degraded' | 'revoked' | 'unavailable';
31
+ transport: 'connecting' | 'open' | 'closed' | 'revoked' | 'unavailable';
32
32
  activeTaskCount: number;
33
33
  pendingApprovalCount: number;
34
34
  operationalHealth: {
package/dist/index.d.ts CHANGED
@@ -3,7 +3,7 @@ export type { AgentRef } from './agent-home';
3
3
  export { AgentHomeError, AgentRefValidationError, AgentHomeResolutionError, AgentHomeCollisionError, AgentHomeBusyError, AgentHomeLeaseCorruptError, AgentHomeLayout, AgentHomeLeaseManager, AgentHomeManager, createAgentHomeProjection, createAgentHomeProjectionConsumer, AGENT_HOME_PROJECTION_STATE_FILE, stableAgentHomeOwnerId, validateAgentRef, } from './agent-home';
4
4
  export { AgentSessionHandoffStore, AgentSessionHandoffStoreError, AgentSessionHandoffCorruptError, AgentSessionHandoffMismatchError, } from './daemon/agent-session-handoff-store';
5
5
  export type { AgentSessionHandoff, AgentSessionHandoffMatch, AgentTaskTerminalEvidence, AgentTaskTerminalMatch, AgentTerminalCause, } from './daemon/agent-session-handoff-store';
6
- export type { AgentHomeResolution, AgentHomeProjection, AgentHomeProjectionInput, AgentHomeProjectionApplyInput, AgentHomeProjectionFunction, AgentHomeProjectionApplyFunction, AgentHomeLease, AgentHomeBinding, AgentHomeExecutionLease, AgentHomeExecutionBinding, } from './agent-home';
6
+ export type { AgentHomeResolution, AgentHomeProjection, AgentHomeProjectionInput, AgentHomeProjectionApplyInput, AgentHomeProjectionFunction, AgentHomeProjectionApplyFunction, AgentHomeLease, AgentHomeBinding, AgentHomeExecutionLease, AgentHomeExecutionBinding, AgentHomeExecutionStatus, } from './agent-home';
7
7
  export { localStateRelocation, LocalStateRelocationError, LocalStateRelocationBusyError, LocalStateRelocationIntegrityError, } from './local-state-relocation';
8
8
  export type { LocalStateRelocationInput, LocalStateRelocationLease, } from './local-state-relocation';
9
9
  export { PolicyUnsupportedError, SteerUnsupportedError, freezeRuntimeAdapterDescriptor, sealRuntimeOperationManifest } from './types';
@@ -61,7 +61,7 @@ export { SKILL_PACKS_CAPABILITY, SKILL_PACKS_DIRNAME, SKILL_PACK_AUDIT_FILENAME,
61
61
  export type { InstallSkillPacksOptions, InstalledSkillPack, ProjectedSkillPack, SkillPackInstallErrorCode, SkillPackInstallResult, SkillPackLock, } from './daemon/skill-pack-installer';
62
62
  export { TruthMemoryClient, TruthMemoryClientError } from './daemon/truth-memory-client';
63
63
  export type { LocalMemoryFilter, MemorySelector, TruthManifestQueryInput, TruthManifestRecord, TruthMemoryClientErrorCode, TruthMemoryClientOptions, TruthMemoryMetric, TruthSnapshotCandidateInput, TruthSnapshotWriteInput, TruthTerminalWriteInput, TruthWriteBody, TruthWriteResult, VerifiedTruthRecord, } from './daemon/truth-memory-client';
64
- export type { ConnectionState } from './daemon/ws-transport';
64
+ export type { ConnectionState } from './daemon/connection-manager';
65
65
  export { ReplayCursorTooOldError } from './daemon/replay-cursor';
66
66
  export { BlobClient, BlobRequestAbortedError } from './daemon/blob-client';
67
67
  export type { BlobClientOptions, BlobRequestAbortReason, BlobRequestOptions, BlobResolver } from './daemon/blob-client';