@moxt-ai/mobius 0.0.419 → 0.0.421

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 (26) hide show
  1. package/dist/{chunk-WVPEYLOI.js → chunk-6U2E3V2K.js} +2 -2
  2. package/dist/{chunk-WVPEYLOI.js.map → chunk-6U2E3V2K.js.map} +1 -1
  3. package/dist/{chunk-MTPODNYQ.js → chunk-LEXJNTEB.js} +90 -30
  4. package/dist/{chunk-MTPODNYQ.js.map → chunk-LEXJNTEB.js.map} +3 -3
  5. package/dist/{cli-OSGZMSA7.js → cli-3N6O4CIO.js} +3 -3
  6. package/dist/cli.js +2 -2
  7. package/dist/engine/runtime/command/registry/history.d.ts.map +1 -1
  8. package/dist/engine/runtime/command/registry/history.js +23 -1
  9. package/dist/engine/runtime/command/registry/history.js.map +1 -1
  10. package/dist/engine/session/live/agent-session.d.ts.map +1 -1
  11. package/dist/engine/session/live/agent-session.js +11 -2
  12. package/dist/engine/session/live/agent-session.js.map +1 -1
  13. package/dist/engine/session/manager/session-manager.d.ts.map +1 -1
  14. package/dist/engine/session/manager/session-manager.js +6 -14
  15. package/dist/engine/session/manager/session-manager.js.map +1 -1
  16. package/dist/engine/session/prompt/prompt-lifecycle.d.ts +4 -2
  17. package/dist/engine/session/prompt/prompt-lifecycle.d.ts.map +1 -1
  18. package/dist/engine/session/prompt/prompt-lifecycle.js +2 -0
  19. package/dist/engine/session/prompt/prompt-lifecycle.js.map +1 -1
  20. package/dist/engine/session/turn/execution-receipts.d.ts +6 -1
  21. package/dist/engine/session/turn/execution-receipts.d.ts.map +1 -1
  22. package/dist/engine/session/turn/execution-receipts.js +21 -0
  23. package/dist/engine/session/turn/execution-receipts.js.map +1 -1
  24. package/dist/engine.js +2 -2
  25. package/package.json +2 -2
  26. /package/dist/{cli-OSGZMSA7.js.map → cli-3N6O4CIO.js.map} +0 -0
@@ -80,7 +80,7 @@ var __callDispose = (stack, error, hasError) => {
80
80
  // package.json
81
81
  var package_default = {
82
82
  name: "@moxt-ai/mobius",
83
- version: "0.0.419",
83
+ version: "0.0.421",
84
84
  description: "Mobius CLI for pairing and running local AI agent services.",
85
85
  type: "module",
86
86
  bin: {
@@ -171,4 +171,4 @@ export {
171
171
  __callDispose,
172
172
  package_default
173
173
  };
174
- //# sourceMappingURL=chunk-WVPEYLOI.js.map
174
+ //# sourceMappingURL=chunk-6U2E3V2K.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../package.json"],
4
- "sourcesContent": ["{\n \"name\": \"@moxt-ai/mobius\",\n \"version\": \"0.0.419\",\n \"description\": \"Mobius CLI for pairing and running local AI agent services.\",\n \"type\": \"module\",\n \"bin\": {\n \"mobius\": \"dist/cli.js\"\n },\n \"exports\": {\n \"./engine\": {\n \"mobius-source\": \"./src/exports/engine.ts\",\n \"types\": \"./dist/exports/engine.d.ts\",\n \"default\": \"./dist/engine.js\"\n }\n },\n \"files\": [\n \"dist\",\n \"NOTICE\",\n \"THIRD-PARTY-NOTICES.txt\"\n ],\n \"engines\": {\n \"node\": \">=22.19.0\"\n },\n \"publishConfig\": {\n \"access\": \"public\",\n \"exports\": {\n \"./engine\": {\n \"types\": \"./dist/exports/engine.d.ts\",\n \"import\": \"./dist/engine.js\",\n \"default\": \"./dist/engine.js\"\n }\n }\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/moxt-ai/mobius.git\",\n \"directory\": \"packages/cli\"\n },\n \"scripts\": {\n \"prebuild\": \"tsc --project src/engine/acp/harness/claude/upstream/tsconfig.json && tsc --project src/engine/acp/harness/pi/upstream/tsconfig.json\",\n \"build\": \"node scripts/build.ts && tsc --project tsconfig.build.json\",\n \"dev\": \"node --watch src/cli/entrypoint.ts\",\n \"pretypecheck\": \"tsc --project src/engine/acp/harness/claude/upstream/tsconfig.json && tsc --project src/engine/acp/harness/pi/upstream/tsconfig.json\",\n \"prepack\": \"pnpm build\",\n \"start\": \"node dist/cli.js\",\n \"typecheck\": \"tsc --project tsconfig.json && tsc --project tests/tsconfig.json\",\n \"pretest:controlled\": \"pnpm build\",\n \"test:controlled\": \"vitest run tests/sessions tests/runtime\",\n \"pretest:manual\": \"pnpm pretest:controlled\",\n \"test:manual\": \"vitest run tests/manual\",\n \"pretest:agents\": \"pnpm build\",\n \"test:agents\": \"vitest run tests/agents --maxWorkers=2\",\n \"pretest:pressure\": \"tsc --project src/engine/acp/harness/claude/upstream/tsconfig.json && tsc --project src/engine/acp/harness/pi/upstream/tsconfig.json\",\n \"test:pressure\": \"node tests/pressure/concurrent-sessions.mjs\"\n },\n \"dependencies\": {\n \"undici\": \"8.12.2\"\n },\n \"devDependencies\": {\n \"@agentclientprotocol/sdk\": \"^1.4.0\",\n \"@anthropic-ai/claude-agent-sdk\": \"0.3.257\",\n \"@anthropic-ai/sdk\": \"0.122.0\",\n \"@moxt-ai/mobius-sdk\": \"workspace:*\",\n \"@moxt-ai/mobius-test\": \"workspace:*\",\n \"@types/node\": \"^24.13.5\",\n \"@types/semver\": \"^7.8.0\",\n \"@types/ws\": \"^8.18.1\",\n \"commander\": \"15.0.0\",\n \"drizzle-kit\": \"1.0.0-rc.4\",\n \"drizzle-orm\": \"1.0.0-rc.4\",\n \"esbuild\": \"0.28.2\",\n \"semver\": \"^7.8.5\",\n \"valibot\": \"1.5.0\",\n \"ws\": \"^8.21.3\",\n \"zod\": \"^4.6.7\"\n },\n \"keywords\": [],\n \"author\": \"Moxt\",\n \"license\": \"Apache-2.0\",\n \"bugs\": {\n \"url\": \"https://github.com/moxt-ai/mobius/issues\"\n },\n \"homepage\": \"https://github.com/moxt-ai/mobius#readme\"\n}\n"],
4
+ "sourcesContent": ["{\n \"name\": \"@moxt-ai/mobius\",\n \"version\": \"0.0.421\",\n \"description\": \"Mobius CLI for pairing and running local AI agent services.\",\n \"type\": \"module\",\n \"bin\": {\n \"mobius\": \"dist/cli.js\"\n },\n \"exports\": {\n \"./engine\": {\n \"mobius-source\": \"./src/exports/engine.ts\",\n \"types\": \"./dist/exports/engine.d.ts\",\n \"default\": \"./dist/engine.js\"\n }\n },\n \"files\": [\n \"dist\",\n \"NOTICE\",\n \"THIRD-PARTY-NOTICES.txt\"\n ],\n \"engines\": {\n \"node\": \">=22.19.0\"\n },\n \"publishConfig\": {\n \"access\": \"public\",\n \"exports\": {\n \"./engine\": {\n \"types\": \"./dist/exports/engine.d.ts\",\n \"import\": \"./dist/engine.js\",\n \"default\": \"./dist/engine.js\"\n }\n }\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/moxt-ai/mobius.git\",\n \"directory\": \"packages/cli\"\n },\n \"scripts\": {\n \"prebuild\": \"tsc --project src/engine/acp/harness/claude/upstream/tsconfig.json && tsc --project src/engine/acp/harness/pi/upstream/tsconfig.json\",\n \"build\": \"node scripts/build.ts && tsc --project tsconfig.build.json\",\n \"dev\": \"node --watch src/cli/entrypoint.ts\",\n \"pretypecheck\": \"tsc --project src/engine/acp/harness/claude/upstream/tsconfig.json && tsc --project src/engine/acp/harness/pi/upstream/tsconfig.json\",\n \"prepack\": \"pnpm build\",\n \"start\": \"node dist/cli.js\",\n \"typecheck\": \"tsc --project tsconfig.json && tsc --project tests/tsconfig.json\",\n \"pretest:controlled\": \"pnpm build\",\n \"test:controlled\": \"vitest run tests/sessions tests/runtime\",\n \"pretest:manual\": \"pnpm pretest:controlled\",\n \"test:manual\": \"vitest run tests/manual\",\n \"pretest:agents\": \"pnpm build\",\n \"test:agents\": \"vitest run tests/agents --maxWorkers=2\",\n \"pretest:pressure\": \"tsc --project src/engine/acp/harness/claude/upstream/tsconfig.json && tsc --project src/engine/acp/harness/pi/upstream/tsconfig.json\",\n \"test:pressure\": \"node tests/pressure/concurrent-sessions.mjs\"\n },\n \"dependencies\": {\n \"undici\": \"8.12.2\"\n },\n \"devDependencies\": {\n \"@agentclientprotocol/sdk\": \"^1.4.0\",\n \"@anthropic-ai/claude-agent-sdk\": \"0.3.257\",\n \"@anthropic-ai/sdk\": \"0.122.0\",\n \"@moxt-ai/mobius-sdk\": \"workspace:*\",\n \"@moxt-ai/mobius-test\": \"workspace:*\",\n \"@types/node\": \"^24.13.5\",\n \"@types/semver\": \"^7.8.0\",\n \"@types/ws\": \"^8.18.1\",\n \"commander\": \"15.0.0\",\n \"drizzle-kit\": \"1.0.0-rc.4\",\n \"drizzle-orm\": \"1.0.0-rc.4\",\n \"esbuild\": \"0.28.2\",\n \"semver\": \"^7.8.5\",\n \"valibot\": \"1.5.0\",\n \"ws\": \"^8.21.3\",\n \"zod\": \"^4.6.7\"\n },\n \"keywords\": [],\n \"author\": \"Moxt\",\n \"license\": \"Apache-2.0\",\n \"bugs\": {\n \"url\": \"https://github.com/moxt-ai/mobius/issues\"\n },\n \"homepage\": \"https://github.com/moxt-ai/mobius#readme\"\n}\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,EACI,MAAQ;AAAA,EACR,SAAW;AAAA,EACX,aAAe;AAAA,EACf,MAAQ;AAAA,EACR,KAAO;AAAA,IACH,QAAU;AAAA,EACd;AAAA,EACA,SAAW;AAAA,IACP,YAAY;AAAA,MACR,iBAAiB;AAAA,MACjB,OAAS;AAAA,MACT,SAAW;AAAA,IACf;AAAA,EACJ;AAAA,EACA,OAAS;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,EACJ;AAAA,EACA,SAAW;AAAA,IACP,MAAQ;AAAA,EACZ;AAAA,EACA,eAAiB;AAAA,IACb,QAAU;AAAA,IACV,SAAW;AAAA,MACP,YAAY;AAAA,QACR,OAAS;AAAA,QACT,QAAU;AAAA,QACV,SAAW;AAAA,MACf;AAAA,IACJ;AAAA,EACJ;AAAA,EACA,YAAc;AAAA,IACV,MAAQ;AAAA,IACR,KAAO;AAAA,IACP,WAAa;AAAA,EACjB;AAAA,EACA,SAAW;AAAA,IACP,UAAY;AAAA,IACZ,OAAS;AAAA,IACT,KAAO;AAAA,IACP,cAAgB;AAAA,IAChB,SAAW;AAAA,IACX,OAAS;AAAA,IACT,WAAa;AAAA,IACb,sBAAsB;AAAA,IACtB,mBAAmB;AAAA,IACnB,kBAAkB;AAAA,IAClB,eAAe;AAAA,IACf,kBAAkB;AAAA,IAClB,eAAe;AAAA,IACf,oBAAoB;AAAA,IACpB,iBAAiB;AAAA,EACrB;AAAA,EACA,cAAgB;AAAA,IACZ,QAAU;AAAA,EACd;AAAA,EACA,iBAAmB;AAAA,IACf,4BAA4B;AAAA,IAC5B,kCAAkC;AAAA,IAClC,qBAAqB;AAAA,IACrB,uBAAuB;AAAA,IACvB,wBAAwB;AAAA,IACxB,eAAe;AAAA,IACf,iBAAiB;AAAA,IACjB,aAAa;AAAA,IACb,WAAa;AAAA,IACb,eAAe;AAAA,IACf,eAAe;AAAA,IACf,SAAW;AAAA,IACX,QAAU;AAAA,IACV,SAAW;AAAA,IACX,IAAM;AAAA,IACN,KAAO;AAAA,EACX;AAAA,EACA,UAAY,CAAC;AAAA,EACb,QAAU;AAAA,EACV,SAAW;AAAA,EACX,MAAQ;AAAA,IACJ,KAAO;AAAA,EACX;AAAA,EACA,UAAY;AAChB;",
6
6
  "names": []
7
7
  }
@@ -3,7 +3,7 @@ import {
3
3
  __export,
4
4
  __using,
5
5
  package_default
6
- } from "./chunk-WVPEYLOI.js";
6
+ } from "./chunk-6U2E3V2K.js";
7
7
 
8
8
  // src/engine/runtime/relay/runtime-revocation.ts
9
9
  var runtimeRevocationCloseCode = 1008;
@@ -20726,11 +20726,27 @@ var acpSessionUpdateSchema = external_exports.discriminatedUnion("sessionUpdate"
20726
20726
  }).readonly()
20727
20727
  ]);
20728
20728
  var lifecycleBase = { commandId: identifierStringSchema };
20729
+ var promptMessageId = external_exports.string().min(1).max(2048);
20729
20730
  var promptExecutionContextSchema = external_exports.object({
20730
20731
  agentId: identifierStringSchema,
20731
20732
  directoryId: DIRECTORY_IDENTIFIER,
20732
20733
  additionalDirectoryIds: external_exports.array(DIRECTORY_IDENTIFIER).max(16).readonly()
20733
20734
  }).readonly();
20735
+ var promptCompletedSchema = external_exports.object({
20736
+ ...lifecycleBase,
20737
+ kind: external_exports.literal("prompt.completed"),
20738
+ execution: external_exports.literal("not-started").optional(),
20739
+ messageId: promptMessageId.optional(),
20740
+ stopReason: shortString
20741
+ }).readonly();
20742
+ var promptFailedSchema = external_exports.object({
20743
+ ...lifecycleBase,
20744
+ attemptId: identifierStringSchema,
20745
+ code: identifierStringSchema,
20746
+ kind: external_exports.literal("prompt.failed"),
20747
+ message: external_exports.string().min(1).max(500),
20748
+ messageId: promptMessageId.optional()
20749
+ }).readonly();
20734
20750
  var lifecycleMetadataSchema = external_exports.discriminatedUnion("kind", [
20735
20751
  // `changedByCommandId` names the command whose admission to or departure from the queue changed it. Runtimes
20736
20752
  // before it existed omit it, so a reader must treat an unnamed change as possibly any command's.
@@ -20748,25 +20764,14 @@ var lifecycleMetadataSchema = external_exports.discriminatedUnion("kind", [
20748
20764
  targetCommandId: identifierStringSchema.optional()
20749
20765
  }).readonly(),
20750
20766
  external_exports.object({ ...lifecycleBase, attemptId: identifierStringSchema, epoch: identifierStringSchema, kind: external_exports.literal("prompt.started") }).readonly(),
20751
- external_exports.object({
20752
- ...lifecycleBase,
20753
- kind: external_exports.literal("prompt.completed"),
20754
- execution: external_exports.literal("not-started").optional(),
20755
- stopReason: shortString
20756
- }).readonly(),
20767
+ promptCompletedSchema,
20757
20768
  external_exports.object({
20758
20769
  ...lifecycleBase,
20759
20770
  code: identifierStringSchema,
20760
20771
  kind: external_exports.literal("prompt.failed-before-start"),
20761
20772
  message: external_exports.string().min(1).max(500)
20762
20773
  }).readonly(),
20763
- external_exports.object({
20764
- ...lifecycleBase,
20765
- attemptId: identifierStringSchema,
20766
- code: identifierStringSchema,
20767
- kind: external_exports.literal("prompt.failed"),
20768
- message: external_exports.string().min(1).max(500)
20769
- }).readonly()
20774
+ promptFailedSchema
20770
20775
  ]);
20771
20776
  var isPromptTerminal = (payload) => {
20772
20777
  switch (payload.kind) {
@@ -20859,9 +20864,16 @@ function isRecord2(value) {
20859
20864
  var sessionEventBatchSchema = external_exports.array(sessionEventSchema).min(1).max(SESSION_EVENT_BATCH_MAX_SIZE).readonly();
20860
20865
  var sessionLiveEventBatchSchema = external_exports.array(sessionLiveEventSchema).min(1).max(SESSION_EVENT_BATCH_MAX_SIZE).readonly();
20861
20866
  var sessionEventEnvelopeSchema = external_exports.object({ events: sessionLiveEventBatchSchema, kind: external_exports.literal(SESSION_EVENT_KIND) }).readonly();
20867
+ var promptMessageOutcomeSchema = external_exports.object({
20868
+ payload: external_exports.discriminatedUnion("kind", [promptCompletedSchema, promptFailedSchema]),
20869
+ recordedAt: external_exports.iso.datetime({ offset: true })
20870
+ }).readonly();
20862
20871
  var sessionEventLogPageSchema = external_exports.object({
20863
20872
  events: external_exports.array(sessionEventSchema).max(MAX_EVENT_COUNT).readonly(),
20864
20873
  nextCursor: external_exports.string().min(1).max(512).nullable(),
20874
+ // The settled prompts, among those the Runtime still retains, whose user message is on this page. Absent from
20875
+ // older Runtimes and from pages that are not a Session's own history.
20876
+ promptOutcomes: external_exports.array(promptMessageOutcomeSchema).max(MAX_EVENT_COUNT).readonly().optional(),
20865
20877
  sessionGenerationId: identifierStringSchema,
20866
20878
  tailCursor: external_exports.string().max(512),
20867
20879
  // The generation-scoped live position covered by this snapshot, including
@@ -20921,7 +20933,7 @@ function sanitizeConsumableNativeSessionEvents(value) {
20921
20933
  const queuedPromptRequests = input2["queuedPromptRequests"];
20922
20934
  return {
20923
20935
  ...input2,
20924
- events: isRecord2(page) ? { ...page, events: decodedEntries(page["events"], sessionEventSchema, MAX_EVENT_COUNT) } : page,
20936
+ events: sanitizeConsumableSessionEventLogPage(page),
20925
20937
  queuedPromptRequests: decodedEntries(
20926
20938
  queuedPromptRequests,
20927
20939
  queuedPromptRequestEventLogSchema,
@@ -20929,6 +20941,14 @@ function sanitizeConsumableNativeSessionEvents(value) {
20929
20941
  )
20930
20942
  };
20931
20943
  }
20944
+ function sanitizeConsumableSessionEventLogPage(value) {
20945
+ const input2 = inputValue(value);
20946
+ return isRecord2(input2) ? {
20947
+ ...input2,
20948
+ events: decodedEntries(input2["events"], sessionEventSchema, MAX_EVENT_COUNT),
20949
+ promptOutcomes: decodedEntries(input2["promptOutcomes"], promptMessageOutcomeSchema, MAX_EVENT_COUNT)
20950
+ } : input2;
20951
+ }
20932
20952
  var knownSessionLiveEventBatchSchema = external_exports.array(sessionLiveEventSchema).max(SESSION_EVENT_BATCH_MAX_SIZE).readonly();
20933
20953
  var decodeSessionEvent = (value) => decode3(value, sessionEventSchema);
20934
20954
  var decodeKnownSessionEventPayload = (value) => {
@@ -90472,10 +90492,12 @@ var AgentSession = class _AgentSession {
90472
90492
  );
90473
90493
  this.writeStoredSession((/* @__PURE__ */ new Date()).toISOString());
90474
90494
  if (lifecycle !== void 0) {
90495
+ const messageId = result._meta?.messageId;
90475
90496
  await this.recordLifecycleEvent({
90476
90497
  payload: {
90477
90498
  commandId: options.commandId,
90478
90499
  kind: "prompt.completed",
90500
+ ...messageId === void 0 ? {} : { messageId },
90479
90501
  stopReason: result.stopReason
90480
90502
  },
90481
90503
  type: "lifecycle-metadata"
@@ -90485,13 +90507,20 @@ var AgentSession = class _AgentSession {
90485
90507
  } catch (error62) {
90486
90508
  const failure2 = error62 instanceof AcpExecutionError ? error62 : new AcpExecutionError("ACP agent execution failed", { cause: error62 });
90487
90509
  if (lifecycle !== void 0) {
90510
+ const message = failure2 instanceof AcpPromptExecutionError ? { messageId: failure2.messageId } : {};
90488
90511
  await this.recordLifecycleEvent({
90489
- payload: options.cancellationRequested?.() === true ? { commandId: options.commandId, kind: "prompt.completed", stopReason: "cancelled" } : {
90512
+ payload: options.cancellationRequested?.() === true ? {
90513
+ commandId: options.commandId,
90514
+ kind: "prompt.completed",
90515
+ ...message,
90516
+ stopReason: "cancelled"
90517
+ } : {
90490
90518
  attemptId: lifecycle.attemptId,
90491
90519
  code: failure2.code,
90492
90520
  commandId: options.commandId,
90493
90521
  kind: "prompt.failed",
90494
- message: truncate(failure2.message, 500)
90522
+ message: truncate(failure2.message, 500),
90523
+ ...message
90495
90524
  },
90496
90525
  type: "lifecycle-metadata"
90497
90526
  });
@@ -90898,18 +90927,13 @@ var SessionManager2 = class {
90898
90927
  retireIdle: (runtime) => this.#stopSessionProcess(sessionId, runtime)
90899
90928
  };
90900
90929
  }
90930
+ /**
90931
+ * Retires a Session's process. The stored Session outlives it, whatever ended the process: only an operation
90932
+ * that ends the Session itself removes its title, settings and native identity.
90933
+ */
90901
90934
  async #retireSessionProcess(sessionId, runtime, close) {
90902
- const retained = this.#executionProcesses.detach(sessionId, runtime);
90903
- try {
90904
- await this.#processes.retire(runtime, close);
90905
- } finally {
90906
- if (retained && this.#sessionIdentity === "native") {
90907
- const stored = this.#store.read(sessionId);
90908
- if (stored instanceof FoundStoredSession && stored.session.nativeSessionId === sessionId && isNativeChatSessionId(stored.session.agentId, sessionId)) {
90909
- this.#store.remove(sessionId);
90910
- }
90911
- }
90912
- }
90935
+ this.#executionProcesses.detach(sessionId, runtime);
90936
+ await this.#processes.retire(runtime, close);
90913
90937
  }
90914
90938
  /**
90915
90939
  * Releases a closed or idle Session's process while keeping its title, settings and native
@@ -92287,6 +92311,8 @@ var PromptLifecycle = class {
92287
92311
  this.#sink.publishOperationFailure(sessionId, commandId, code, message);
92288
92312
  }
92289
92313
  };
92314
+ /** The recorded terminal events of the Session's settled prompts that name the user message they recorded. */
92315
+ promptOutcomes = (sessionId) => this.#executions.promptOutcomes(sessionId);
92290
92316
  promptRequestRecovery = (sessionId) => ({
92291
92317
  queuedPromptRequests: [...this.#queued.values()].filter(
92292
92318
  (request) => request.sessionId === sessionId && !this.#executions.hasStarted(request.commandId, sessionId)
@@ -92566,6 +92592,24 @@ var ExecutionReceipts = class {
92566
92592
  const receipt = this.#executions.get(commandId);
92567
92593
  return receipt?.sessionId === sessionId && receipt.state.kind === "started" ? receipt.state.startedAt : void 0;
92568
92594
  };
92595
+ /**
92596
+ * The recorded terminal events of the Session's settled prompts whose Agent reported the user message they
92597
+ * recorded, while their receipts are retained.
92598
+ */
92599
+ promptOutcomes = (sessionId) => {
92600
+ const outcomes = [];
92601
+ for (const [commandId, receipt] of this.#executions) {
92602
+ if (receipt.sessionId !== sessionId) {
92603
+ continue;
92604
+ }
92605
+ const outcome = this.restatedOutcome(commandId);
92606
+ const event = outcome?.event;
92607
+ if (outcome?.recordedAt !== void 0 && event?.type === "lifecycle-metadata" && (event.payload.kind === "prompt.completed" || event.payload.kind === "prompt.failed") && event.payload.messageId !== void 0) {
92608
+ outcomes.push({ payload: event.payload, recordedAt: outcome.recordedAt });
92609
+ }
92610
+ }
92611
+ return outcomes;
92612
+ };
92569
92613
  /** Started identities remain authoritative after their detailed receipt is evicted. */
92570
92614
  hasStarted = (commandId, sessionId) => {
92571
92615
  const standing = this.#standing(commandId, sessionId);
@@ -95090,6 +95134,15 @@ async function resolveSessionDirectories(directories, bindingId, directoryId, ad
95090
95134
  }
95091
95135
 
95092
95136
  // src/engine/runtime/command/registry/history.ts
95137
+ function onPage(outcomes, events) {
95138
+ const messageIds = /* @__PURE__ */ new Set();
95139
+ for (const event of events) {
95140
+ if (event.type === "acp" && event.payload.sessionUpdate === "user_message_chunk" && event.payload.messageId !== void 0 && event.payload.messageId !== null) {
95141
+ messageIds.add(event.payload.messageId);
95142
+ }
95143
+ }
95144
+ return outcomes.filter(({ payload }) => payload.messageId !== void 0 && messageIds.has(payload.messageId));
95145
+ }
95093
95146
  async function loadHistoryPage(sessionId, eventLimit, initialCursor, queuedPromptRequests, load) {
95094
95147
  let cursor = initialCursor;
95095
95148
  let loaded = [];
@@ -95163,6 +95216,7 @@ async function executeSessionHistoryPageLoad(socket, command, config2, resolveAg
95163
95216
  signal
95164
95217
  };
95165
95218
  const recovery = eventProjection.promptRequestRecovery(command.sessionId);
95219
+ const settled = eventProjection.promptOutcomes(command.sessionId);
95166
95220
  const events = await loadHistoryPage(
95167
95221
  command.sessionId,
95168
95222
  command.eventLimit,
@@ -95172,7 +95226,13 @@ async function executeSessionHistoryPageLoad(socket, command, config2, resolveAg
95172
95226
  );
95173
95227
  signal.throwIfAborted();
95174
95228
  send(socket, {
95175
- events,
95229
+ events: {
95230
+ ...events,
95231
+ events: {
95232
+ ...events.events,
95233
+ promptOutcomes: onPage(settled, events.events.events)
95234
+ }
95235
+ },
95176
95236
  kind: SESSION_HISTORY_PAGE_LOADED_KIND,
95177
95237
  requestId: command.requestId,
95178
95238
  sessionId: command.sessionId
@@ -97617,4 +97677,4 @@ export {
97617
97677
  * MIT Licensed
97618
97678
  *)
97619
97679
  */
97620
- //# sourceMappingURL=chunk-MTPODNYQ.js.map
97680
+ //# sourceMappingURL=chunk-LEXJNTEB.js.map