@moxt-ai/mobius 0.0.417 → 0.0.420
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.
- package/dist/{chunk-K3YAUS5L.js → chunk-42NDUG4B.js} +2 -2
- package/dist/{chunk-K3YAUS5L.js.map → chunk-42NDUG4B.js.map} +1 -1
- package/dist/{chunk-NYCOWKU2.js → chunk-MCPMMRRU.js} +106 -23
- package/dist/{chunk-NYCOWKU2.js.map → chunk-MCPMMRRU.js.map} +3 -3
- package/dist/{cli-FLXN6UTM.js → cli-ZTM5WNZK.js} +3 -3
- package/dist/cli.js +2 -2
- package/dist/engine/runtime/command/registry/history.d.ts.map +1 -1
- package/dist/engine/runtime/command/registry/history.js +23 -1
- package/dist/engine/runtime/command/registry/history.js.map +1 -1
- package/dist/engine/session/live/agent-session.d.ts.map +1 -1
- package/dist/engine/session/live/agent-session.js +11 -2
- package/dist/engine/session/live/agent-session.js.map +1 -1
- package/dist/engine/session/prompt/prompt-lifecycle.d.ts +4 -2
- package/dist/engine/session/prompt/prompt-lifecycle.d.ts.map +1 -1
- package/dist/engine/session/prompt/prompt-lifecycle.js +2 -0
- package/dist/engine/session/prompt/prompt-lifecycle.js.map +1 -1
- package/dist/engine/session/turn/active-turn.d.ts +5 -2
- package/dist/engine/session/turn/active-turn.d.ts.map +1 -1
- package/dist/engine/session/turn/active-turn.js +9 -2
- package/dist/engine/session/turn/active-turn.js.map +1 -1
- package/dist/engine/session/turn/execution-receipts.d.ts +8 -1
- package/dist/engine/session/turn/execution-receipts.d.ts.map +1 -1
- package/dist/engine/session/turn/execution-receipts.js +32 -1
- package/dist/engine/session/turn/execution-receipts.js.map +1 -1
- package/dist/engine/session/turn/session-execution.d.ts.map +1 -1
- package/dist/engine/session/turn/session-execution.js +1 -1
- package/dist/engine/session/turn/session-execution.js.map +1 -1
- package/dist/engine/session/turn/session-turns.d.ts +1 -0
- package/dist/engine/session/turn/session-turns.d.ts.map +1 -1
- package/dist/engine.js +2 -2
- package/package.json +2 -2
- /package/dist/{cli-FLXN6UTM.js.map → cli-ZTM5WNZK.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.
|
|
83
|
+
version: "0.0.420",
|
|
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-
|
|
174
|
+
//# sourceMappingURL=chunk-42NDUG4B.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.
|
|
4
|
+
"sourcesContent": ["{\n \"name\": \"@moxt-ai/mobius\",\n \"version\": \"0.0.420\",\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-
|
|
6
|
+
} from "./chunk-42NDUG4B.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
|
-
|
|
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
|
-
|
|
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:
|
|
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) => {
|
|
@@ -21412,6 +21432,8 @@ var activeTurnSnapshotSchema = external_exports.object({
|
|
|
21412
21432
|
epoch: identifierStringSchema,
|
|
21413
21433
|
interaction: external_exports.discriminatedUnion("kind", [sessionPermissionRequestedEventSchema, sessionElicitationRequestedEventSchema]).nullable(),
|
|
21414
21434
|
sequence: external_exports.number().int().nonnegative(),
|
|
21435
|
+
// When the turn started, as the Runtime recorded it. Absent from older Runtimes.
|
|
21436
|
+
startedAt: external_exports.iso.datetime({ offset: true }).optional(),
|
|
21415
21437
|
state: external_exports.literal("running")
|
|
21416
21438
|
}).readonly();
|
|
21417
21439
|
var commandDeliverySchema = external_exports.discriminatedUnion("state", [
|
|
@@ -90470,10 +90492,12 @@ var AgentSession = class _AgentSession {
|
|
|
90470
90492
|
);
|
|
90471
90493
|
this.writeStoredSession((/* @__PURE__ */ new Date()).toISOString());
|
|
90472
90494
|
if (lifecycle !== void 0) {
|
|
90495
|
+
const messageId = result._meta?.messageId;
|
|
90473
90496
|
await this.recordLifecycleEvent({
|
|
90474
90497
|
payload: {
|
|
90475
90498
|
commandId: options.commandId,
|
|
90476
90499
|
kind: "prompt.completed",
|
|
90500
|
+
...messageId === void 0 ? {} : { messageId },
|
|
90477
90501
|
stopReason: result.stopReason
|
|
90478
90502
|
},
|
|
90479
90503
|
type: "lifecycle-metadata"
|
|
@@ -90483,13 +90507,20 @@ var AgentSession = class _AgentSession {
|
|
|
90483
90507
|
} catch (error62) {
|
|
90484
90508
|
const failure2 = error62 instanceof AcpExecutionError ? error62 : new AcpExecutionError("ACP agent execution failed", { cause: error62 });
|
|
90485
90509
|
if (lifecycle !== void 0) {
|
|
90510
|
+
const message = failure2 instanceof AcpPromptExecutionError ? { messageId: failure2.messageId } : {};
|
|
90486
90511
|
await this.recordLifecycleEvent({
|
|
90487
|
-
payload: options.cancellationRequested?.() === true ? {
|
|
90512
|
+
payload: options.cancellationRequested?.() === true ? {
|
|
90513
|
+
commandId: options.commandId,
|
|
90514
|
+
kind: "prompt.completed",
|
|
90515
|
+
...message,
|
|
90516
|
+
stopReason: "cancelled"
|
|
90517
|
+
} : {
|
|
90488
90518
|
attemptId: lifecycle.attemptId,
|
|
90489
90519
|
code: failure2.code,
|
|
90490
90520
|
commandId: options.commandId,
|
|
90491
90521
|
kind: "prompt.failed",
|
|
90492
|
-
message: truncate(failure2.message, 500)
|
|
90522
|
+
message: truncate(failure2.message, 500),
|
|
90523
|
+
...message
|
|
90493
90524
|
},
|
|
90494
90525
|
type: "lifecycle-metadata"
|
|
90495
90526
|
});
|
|
@@ -92285,6 +92316,8 @@ var PromptLifecycle = class {
|
|
|
92285
92316
|
this.#sink.publishOperationFailure(sessionId, commandId, code, message);
|
|
92286
92317
|
}
|
|
92287
92318
|
};
|
|
92319
|
+
/** The recorded terminal events of the Session's settled prompts that name the user message they recorded. */
|
|
92320
|
+
promptOutcomes = (sessionId) => this.#executions.promptOutcomes(sessionId);
|
|
92288
92321
|
promptRequestRecovery = (sessionId) => ({
|
|
92289
92322
|
queuedPromptRequests: [...this.#queued.values()].filter(
|
|
92290
92323
|
(request) => request.sessionId === sessionId && !this.#executions.hasStarted(request.commandId, sessionId)
|
|
@@ -92559,6 +92592,29 @@ var ExecutionReceipts = class {
|
|
|
92559
92592
|
};
|
|
92560
92593
|
}
|
|
92561
92594
|
};
|
|
92595
|
+
/** When the Session's running command started, while its receipt holds the time. */
|
|
92596
|
+
startedAt = (commandId, sessionId) => {
|
|
92597
|
+
const receipt = this.#executions.get(commandId);
|
|
92598
|
+
return receipt?.sessionId === sessionId && receipt.state.kind === "started" ? receipt.state.startedAt : void 0;
|
|
92599
|
+
};
|
|
92600
|
+
/**
|
|
92601
|
+
* The recorded terminal events of the Session's settled prompts whose Agent reported the user message they
|
|
92602
|
+
* recorded, while their receipts are retained.
|
|
92603
|
+
*/
|
|
92604
|
+
promptOutcomes = (sessionId) => {
|
|
92605
|
+
const outcomes = [];
|
|
92606
|
+
for (const [commandId, receipt] of this.#executions) {
|
|
92607
|
+
if (receipt.sessionId !== sessionId) {
|
|
92608
|
+
continue;
|
|
92609
|
+
}
|
|
92610
|
+
const outcome = this.restatedOutcome(commandId);
|
|
92611
|
+
const event = outcome?.event;
|
|
92612
|
+
if (outcome?.recordedAt !== void 0 && event?.type === "lifecycle-metadata" && (event.payload.kind === "prompt.completed" || event.payload.kind === "prompt.failed") && event.payload.messageId !== void 0) {
|
|
92613
|
+
outcomes.push({ payload: event.payload, recordedAt: outcome.recordedAt });
|
|
92614
|
+
}
|
|
92615
|
+
}
|
|
92616
|
+
return outcomes;
|
|
92617
|
+
};
|
|
92562
92618
|
/** Started identities remain authoritative after their detailed receipt is evicted. */
|
|
92563
92619
|
hasStarted = (commandId, sessionId) => {
|
|
92564
92620
|
const standing = this.#standing(commandId, sessionId);
|
|
@@ -92644,7 +92700,10 @@ var ExecutionReceipts = class {
|
|
|
92644
92700
|
if (payload.kind === "prompt.started") {
|
|
92645
92701
|
const receipt2 = this.#executions.get(payload.commandId);
|
|
92646
92702
|
if (receipt2?.state.kind === "pending") {
|
|
92647
|
-
this.#save(payload.commandId, {
|
|
92703
|
+
this.#save(payload.commandId, {
|
|
92704
|
+
...receipt2,
|
|
92705
|
+
state: { kind: "started", startedAt: event.recordedAt }
|
|
92706
|
+
});
|
|
92648
92707
|
}
|
|
92649
92708
|
return;
|
|
92650
92709
|
}
|
|
@@ -92851,16 +92910,21 @@ var ActiveRuntimeTurn = class {
|
|
|
92851
92910
|
#controller;
|
|
92852
92911
|
#finished = Promise.withResolvers();
|
|
92853
92912
|
#started;
|
|
92913
|
+
#startedAt;
|
|
92854
92914
|
#cancellationRequested = false;
|
|
92855
92915
|
#admission = { kind: "waiting" };
|
|
92856
92916
|
#sequence = 0;
|
|
92857
92917
|
#interaction = null;
|
|
92858
|
-
/**
|
|
92859
|
-
|
|
92918
|
+
/**
|
|
92919
|
+
* `started` and `startedAt` read the command's execution receipt, the single owner of whether and when the command
|
|
92920
|
+
* started.
|
|
92921
|
+
*/
|
|
92922
|
+
constructor(command, attemptId, started, startedAt) {
|
|
92860
92923
|
this.attemptId = attemptId;
|
|
92861
92924
|
this.command = command;
|
|
92862
92925
|
this.#controller = new AbortController();
|
|
92863
92926
|
this.#started = started;
|
|
92927
|
+
this.#startedAt = startedAt;
|
|
92864
92928
|
}
|
|
92865
92929
|
enqueue = () => {
|
|
92866
92930
|
if (this.#admission.kind !== "waiting") {
|
|
@@ -92935,11 +92999,13 @@ var ActiveRuntimeTurn = class {
|
|
|
92935
92999
|
if (!this.#started()) {
|
|
92936
93000
|
return null;
|
|
92937
93001
|
}
|
|
93002
|
+
const startedAt = this.#startedAt();
|
|
92938
93003
|
return {
|
|
92939
93004
|
commandId: decodeIdentifier(this.command.commandId),
|
|
92940
93005
|
epoch: this.epoch,
|
|
92941
93006
|
interaction: this.#interaction,
|
|
92942
93007
|
sequence: this.#sequence,
|
|
93008
|
+
...startedAt === void 0 ? {} : { startedAt },
|
|
92943
93009
|
state: "running"
|
|
92944
93010
|
};
|
|
92945
93011
|
};
|
|
@@ -93006,7 +93072,8 @@ var SessionExecutionState = class {
|
|
|
93006
93072
|
const turn = new ActiveRuntimeTurn(
|
|
93007
93073
|
command,
|
|
93008
93074
|
attemptId,
|
|
93009
|
-
() => this.#operations.hasStarted(command.commandId, this.#sessionId)
|
|
93075
|
+
() => this.#operations.hasStarted(command.commandId, this.#sessionId),
|
|
93076
|
+
() => this.#operations.startedAt(command.commandId, this.#sessionId)
|
|
93010
93077
|
);
|
|
93011
93078
|
this.#turnsByCommandId.set(command.commandId, turn);
|
|
93012
93079
|
return turn;
|
|
@@ -95072,6 +95139,15 @@ async function resolveSessionDirectories(directories, bindingId, directoryId, ad
|
|
|
95072
95139
|
}
|
|
95073
95140
|
|
|
95074
95141
|
// src/engine/runtime/command/registry/history.ts
|
|
95142
|
+
function onPage(outcomes, events) {
|
|
95143
|
+
const messageIds = /* @__PURE__ */ new Set();
|
|
95144
|
+
for (const event of events) {
|
|
95145
|
+
if (event.type === "acp" && event.payload.sessionUpdate === "user_message_chunk" && event.payload.messageId !== void 0 && event.payload.messageId !== null) {
|
|
95146
|
+
messageIds.add(event.payload.messageId);
|
|
95147
|
+
}
|
|
95148
|
+
}
|
|
95149
|
+
return outcomes.filter(({ payload }) => payload.messageId !== void 0 && messageIds.has(payload.messageId));
|
|
95150
|
+
}
|
|
95075
95151
|
async function loadHistoryPage(sessionId, eventLimit, initialCursor, queuedPromptRequests, load) {
|
|
95076
95152
|
let cursor = initialCursor;
|
|
95077
95153
|
let loaded = [];
|
|
@@ -95145,6 +95221,7 @@ async function executeSessionHistoryPageLoad(socket, command, config2, resolveAg
|
|
|
95145
95221
|
signal
|
|
95146
95222
|
};
|
|
95147
95223
|
const recovery = eventProjection.promptRequestRecovery(command.sessionId);
|
|
95224
|
+
const settled = eventProjection.promptOutcomes(command.sessionId);
|
|
95148
95225
|
const events = await loadHistoryPage(
|
|
95149
95226
|
command.sessionId,
|
|
95150
95227
|
command.eventLimit,
|
|
@@ -95154,7 +95231,13 @@ async function executeSessionHistoryPageLoad(socket, command, config2, resolveAg
|
|
|
95154
95231
|
);
|
|
95155
95232
|
signal.throwIfAborted();
|
|
95156
95233
|
send(socket, {
|
|
95157
|
-
events
|
|
95234
|
+
events: {
|
|
95235
|
+
...events,
|
|
95236
|
+
events: {
|
|
95237
|
+
...events.events,
|
|
95238
|
+
promptOutcomes: onPage(settled, events.events.events)
|
|
95239
|
+
}
|
|
95240
|
+
},
|
|
95158
95241
|
kind: SESSION_HISTORY_PAGE_LOADED_KIND,
|
|
95159
95242
|
requestId: command.requestId,
|
|
95160
95243
|
sessionId: command.sessionId
|
|
@@ -97599,4 +97682,4 @@ export {
|
|
|
97599
97682
|
* MIT Licensed
|
|
97600
97683
|
*)
|
|
97601
97684
|
*/
|
|
97602
|
-
//# sourceMappingURL=chunk-
|
|
97685
|
+
//# sourceMappingURL=chunk-MCPMMRRU.js.map
|