@agentproto/runtime 5.6.0 → 5.7.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.
@@ -4432,6 +4432,14 @@ interface SessionDescriptor {
4432
4432
  * process gone (pid 1234) — session crashed"). Not a stack trace or raw
4433
4433
  * error, just enough for a UI/log line. Absent unless something set it. */
4434
4434
  lastError?: string;
4435
+ /** BOOTSTRAP P7b — why the LAST device-mirror sync against this
4436
+ * session's host failed (`device-mirror.ts`), for readers to show
4437
+ * "host unreachable" instead of silently rendering a stale mirrored
4438
+ * transcript. Ephemeral: stamped on the descriptor at read time when a
4439
+ * sync fails, CLEARED by the next successful sync. Absent (never "")
4440
+ * for a session that is not device-mirrored or whose last sync passed.
4441
+ */
4442
+ mirrorError?: string;
4435
4443
  /** ISO 8601 timestamp of the crash-detect sweep that flipped this row to
4436
4444
  * `endedReason:"crashed"`. Absent for every other terminal path. */
4437
4445
  crashedAt?: string;
@@ -5301,6 +5309,27 @@ interface SessionDescriptor {
5301
5309
  remote?: boolean;
5302
5310
  /** Provider-assigned sandbox id (`BootedSandbox.sandboxId`), when `remote` is true. */
5303
5311
  sandboxId?: string;
5312
+ /**
5313
+ * BOOTSTRAP P7a — for a `device:<fp|name>` sandbox spawn: the id of the
5314
+ * session the HOST's own daemon created (`BootedSandbox`'s inner
5315
+ * `agent_start` descriptor.id, i.e. the sandbox proxy's `sessionId`). The
5316
+ * conversation with the remote device lives THERE, not under this
5317
+ * descriptor's id — `device_prompt` and the read paths use this to bridge
5318
+ * the twin daemons (issue #1637: a controller "sess_305be17c" vs host
5319
+ * "sess_cf318f00"). Absent for a local/cloud spawn, or when the host
5320
+ * failed to return a usable id at spawn time. Persisted via the same
5321
+ * descriptor spread as every other field.
5322
+ */
5323
+ hostSessionId?: string;
5324
+ /**
5325
+ * BOOTSTRAP P7a — for a `device:<fp|name>` sandbox spawn: the paired
5326
+ * host's identity as pinned by the spawn's own sandbox spec, resolved by
5327
+ * the device provider to the REAL fingerprint when it can (a saved
5328
+ * fallback keeps the raw `fp-or-name` target — every consumer matches
5329
+ * `HostRegistry.forwardHttp`'s `fingerprint OR name`). Only meaningful
5330
+ * alongside {@link hostSessionId}; absent for every other spawn.
5331
+ */
5332
+ hostFingerprint?: string;
5304
5333
  /** Sandbox provider slug (`agent_start.sandbox`'s provider, e.g. `"e2b"`,
5305
5334
  * `"local"`), when `remote` is true. Identifies WHERE the box lives, not
5306
5335
  * just THAT one exists — the VS Code panel's sandbox chip names it in its
@@ -5459,6 +5488,10 @@ interface SessionSummary {
5459
5488
  browserLocation?: "local" | "cloud";
5460
5489
  remote?: boolean;
5461
5490
  sandboxId?: string;
5491
+ /** Device-sandbox identity mapping — see `SessionDescriptor.hostSessionId`. */
5492
+ hostSessionId?: string;
5493
+ /** Device-sandbox identity mapping — see `SessionDescriptor.hostFingerprint`. */
5494
+ hostFingerprint?: string;
5462
5495
  sandboxTeardown?: "kill" | "pause";
5463
5496
  sandboxPorts?: Record<number, string>;
5464
5497
  appServe?: SessionAppServeInfo;
@@ -6448,6 +6481,33 @@ interface SessionsRegistry {
6448
6481
  * one. Returns false (no-op) for an unknown id or a non-`agent-cli`
6449
6482
  * session. */
6450
6483
  recordNotice(id: string, text: string): boolean;
6484
+ /**
6485
+ * BOOTSTRAP P7b — append pre-shaped MIRROR records (from
6486
+ * `device-mirror.ts`) into an agent-cli session's durable transcript.
6487
+ * Each record already carries its own `kind` + `origin: "device"` +
6488
+ * `hostSeq` fields; this assigns the controller-local `seq`/`ts` the
6489
+ * session's own writer would (`recordMirrorEvents`), in file order.
6490
+ * Deliberately BYPASSES `recordEvent`'s kind/coalescing logic — a mirror
6491
+ * replay must be byte-faithful to what was computed, never re-shaped or
6492
+ * debounced. Returns the number of records written; 0 for an unknown id,
6493
+ * a non-`agent-cli` session, or a session that is not device-mirrored at
6494
+ * all (the caller checked, but double-checks here to keep a local session's
6495
+ * transcript mirror-free even on a stale caller).
6496
+ */
6497
+ appendDeviceMirrorRecords(id: string, records: readonly Record<string, unknown>[]): number;
6498
+ /**
6499
+ * Scan the same transcript `appendDeviceMirrorRecords` writes, computed
6500
+ * against the registry's OWN transcript base dir (the mirror reader
6501
+ * `device-mirror.ts` must never re-derive the path). Returns the mirror
6502
+ * cursor (max `hostSeq` among `origin: "device"` records — 0 when this
6503
+ * session has never been mirrored) and the ordered controller-local
6504
+ * user-prompt texts (kind `user-prompt`, NOT device-tagged) the seed walk
6505
+ * matches against the host transcript. File absent/empty ⇒ all empty.
6506
+ */
6507
+ scanDeviceMirrorState(id: string): {
6508
+ cursor: number;
6509
+ localPromptTexts: readonly string[];
6510
+ };
6451
6511
  /** List permission requests currently parked in the pending-permissions
6452
6512
  * inbox across all permission-hold sessions, newest last. Optionally
6453
6513
  * filtered to one session. */
@@ -6665,6 +6725,15 @@ interface SpawnAgentInput {
6665
6725
  remote?: boolean;
6666
6726
  /** Provider-assigned sandbox id, when `remote` is true. */
6667
6727
  sandboxId?: string;
6728
+ /** Device-sandbox identity mapping (BOOTSTRAP P7a) — the HOST session id
6729
+ * the device provider's inner `agent_start` created; stamped onto
6730
+ * {@link SessionDescriptor.hostSessionId}. Omit for every non-device
6731
+ * spawn (or when the host returned no usable id). */
6732
+ hostSessionId?: string;
6733
+ /** Device-sandbox identity mapping (BOOTSTRAP P7a) — the paired host's
6734
+ * fingerprint (or the raw `device:<…>` target when the provider couldn't
6735
+ * resolve one); stamped onto {@link SessionDescriptor.hostFingerprint}. */
6736
+ hostFingerprint?: string;
6668
6737
  /** Sandbox provider slug, when `remote` is true — see
6669
6738
  * `SessionDescriptor.sandboxProvider`. */
6670
6739
  sandboxProvider?: string;
@@ -1,7 +1,7 @@
1
1
  import 'zod';
2
2
  import './session-config-DxIIuJFY.js';
3
3
  import './spawn-defaults-Cp9SGZex.js';
4
- export { c5 as RecentSpawnConfig, U as UserPreset, b8 as UserPresetsFile, bp as deleteUserPreset, c6 as deriveRecentSpawnConfigs, bw as getUserPreset, bC as listUserPresets, bE as loadUserPresets, c0 as saveUserPreset, c7 as touchUserPreset, c8 as userPresetSchema, c3 as userPresetsPath } from './sessions-DMzCgTVy.js';
4
+ export { c5 as RecentSpawnConfig, U as UserPreset, b8 as UserPresetsFile, bp as deleteUserPreset, c6 as deriveRecentSpawnConfigs, bw as getUserPreset, bC as listUserPresets, bE as loadUserPresets, c0 as saveUserPreset, c7 as touchUserPreset, c8 as userPresetSchema, c3 as userPresetsPath } from './sessions-DHSLsPHA.js';
5
5
  import '@agentproto/auth';
6
6
  import '@agentproto/acp';
7
7
  import '@agentproto/command-sandbox';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentproto/runtime",
3
- "version": "5.6.0",
3
+ "version": "5.7.0",
4
4
  "description": "@agentproto/runtime — long-running gateway that turns an agentproto workspace into a live runtime. Composes @agentproto/mcp-server (CRUD verbs) with HTTP transport, HEARTBEAT.md autonomy loop, and append-only conversation persistence. Drop a workspace dir, point your MCP client at it, and the agent ticks on its own.",
5
5
  "keywords": [
6
6
  "agentproto",
@@ -169,9 +169,9 @@
169
169
  "@agentproto/app-kit": "1.5.0",
170
170
  "@agentproto/apps": "0.17.2",
171
171
  "@agentproto/auth": "1.1.2",
172
- "@agentproto/driver": "0.3.0",
173
172
  "@agentproto/command-sandbox": "0.3.0",
174
- "@agentproto/driver-agent-cli": "2.6.3",
173
+ "@agentproto/driver": "0.3.0",
174
+ "@agentproto/driver-agent-cli": "2.6.4",
175
175
  "@agentproto/driver-browser": "0.2.0",
176
176
  "@agentproto/driver-http": "0.1.10",
177
177
  "@agentproto/eval-reporters": "0.2.20",
@@ -189,7 +189,7 @@
189
189
  "@agentproto/redaction": "0.2.3",
190
190
  "@agentproto/review": "0.4.0",
191
191
  "@agentproto/routine": "0.3.1",
192
- "@agentproto/sandbox": "0.7.4",
192
+ "@agentproto/sandbox": "0.8.0",
193
193
  "@agentproto/secrets": "1.2.1",
194
194
  "@agentproto/telemetry-langfuse": "0.2.18",
195
195
  "@agentproto/tool": "0.4.0",
@@ -199,7 +199,7 @@
199
199
  "@agentproto/workspace-brain": "0.4.10"
200
200
  },
201
201
  "optionalDependencies": {
202
- "@agentproto/sandbox-e2b": "0.5.11"
202
+ "@agentproto/sandbox-e2b": "0.5.12"
203
203
  },
204
204
  "devDependencies": {
205
205
  "@types/node": "^25.9.5",