@moxt-ai/mobius 0.0.144 → 0.0.146
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/acp/agent-runtime-manager.d.ts +1 -0
- package/dist/acp/agent-runtime-manager.d.ts.map +1 -1
- package/dist/acp/agent-runtime-manager.js +4 -0
- package/dist/acp/agent-runtime-manager.js.map +1 -1
- package/dist/cli.js +136 -30
- package/dist/cli.js.map +2 -2
- package/dist/daemon-active-turn.d.ts +1 -0
- package/dist/daemon-active-turn.d.ts.map +1 -1
- package/dist/daemon-active-turn.js +37 -8
- package/dist/daemon-active-turn.js.map +1 -1
- package/dist/daemon-command-handler.d.ts.map +1 -1
- package/dist/daemon-command-handler.js +18 -1
- package/dist/daemon-command-handler.js.map +1 -1
- package/dist/daemon-prompt-executor.d.ts +2 -1
- package/dist/daemon-prompt-executor.d.ts.map +1 -1
- package/dist/daemon-prompt-executor.js +8 -1
- package/dist/daemon-prompt-executor.js.map +1 -1
- package/dist/daemon-turn-registry.d.ts +13 -8
- package/dist/daemon-turn-registry.d.ts.map +1 -1
- package/dist/daemon-turn-registry.js +4 -0
- package/dist/daemon-turn-registry.js.map +1 -1
- package/dist/index.js +135 -29
- package/dist/index.js.map +2 -2
- package/dist/native-sessions/live-history-page.d.ts.map +1 -1
- package/dist/native-sessions/live-history-page.js +34 -17
- package/dist/native-sessions/live-history-page.js.map +1 -1
- package/dist/native-sessions/service.d.ts +2 -0
- package/dist/native-sessions/service.d.ts.map +1 -1
- package/dist/native-sessions/service.js +4 -2
- package/dist/native-sessions/service.js.map +1 -1
- package/dist/runtime.js +135 -29
- package/dist/runtime.js.map +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -19787,6 +19787,8 @@ var WORKSPACE_LIST_KIND = "workspace.list";
|
|
|
19787
19787
|
var WORKSPACE_ENTRIES_KIND = "workspace.entries";
|
|
19788
19788
|
var SESSION_PREPARE_KIND = "session.prepare";
|
|
19789
19789
|
var SESSION_READY_KIND = "session.ready";
|
|
19790
|
+
var SESSION_LIST_KIND = "session.list";
|
|
19791
|
+
var SESSION_LISTED_KIND = "session.listed";
|
|
19790
19792
|
var SESSION_QUERY_KIND = "session.query";
|
|
19791
19793
|
var SESSION_QUERIED_KIND = "session.queried";
|
|
19792
19794
|
var SESSION_CONFIGURE_KIND = "session.configure";
|
|
@@ -19838,6 +19840,16 @@ var sessionMetadataSchema = external_exports.strictObject({
|
|
|
19838
19840
|
title: external_exports.string().max(500),
|
|
19839
19841
|
updatedAt: external_exports.iso.datetime({ offset: true })
|
|
19840
19842
|
}).readonly();
|
|
19843
|
+
var sessionListCommandSchema = external_exports.strictObject({
|
|
19844
|
+
kind: external_exports.literal(SESSION_LIST_KIND),
|
|
19845
|
+
limit: external_exports.number().int().positive().max(500),
|
|
19846
|
+
requestId: identifierStringSchema
|
|
19847
|
+
}).readonly();
|
|
19848
|
+
var sessionsListedEventSchema = external_exports.strictObject({
|
|
19849
|
+
entries: external_exports.array(sessionMetadataSchema).max(500).readonly(),
|
|
19850
|
+
kind: external_exports.literal(SESSION_LISTED_KIND),
|
|
19851
|
+
requestId: identifierStringSchema
|
|
19852
|
+
}).readonly();
|
|
19841
19853
|
var sessionQueryCommandSchema = external_exports.strictObject({
|
|
19842
19854
|
kind: external_exports.literal(SESSION_QUERY_KIND),
|
|
19843
19855
|
requestId: identifierStringSchema,
|
|
@@ -20391,6 +20403,10 @@ var decodeWorkspaceListCommand = (encoded) => decode3(encoded, workspaceListComm
|
|
|
20391
20403
|
var encodeWorkspaceListCommand = (message) => encode3(message, workspaceListCommandSchema);
|
|
20392
20404
|
var decodeWorkspaceEntriesEvent = (encoded) => decode3(encoded, workspaceEntriesEventSchema);
|
|
20393
20405
|
var encodeWorkspaceEntriesEvent = (message) => encode3(message, workspaceEntriesEventSchema);
|
|
20406
|
+
var decodeSessionListCommand = (encoded) => decode3(encoded, sessionListCommandSchema);
|
|
20407
|
+
var encodeSessionListCommand = (message) => encode3(message, sessionListCommandSchema);
|
|
20408
|
+
var decodeSessionsListedEvent = (encoded) => decode3(encoded, sessionsListedEventSchema);
|
|
20409
|
+
var encodeSessionsListedEvent = (message) => encode3(message, sessionsListedEventSchema);
|
|
20394
20410
|
var decodeSessionQueryCommand = (encoded) => decode3(encoded, sessionQueryCommandSchema);
|
|
20395
20411
|
var encodeSessionQueryCommand = (message) => encode3(message, sessionQueryCommandSchema);
|
|
20396
20412
|
var decodeSessionsQueriedEvent = (encoded) => decode3(encoded, sessionsQueriedEventSchema);
|
|
@@ -21026,6 +21042,23 @@ var activeTurnActivitySchema = external_exports.strictObject({
|
|
|
21026
21042
|
title: external_exports.string().max(500),
|
|
21027
21043
|
toolKind: external_exports.string().max(64)
|
|
21028
21044
|
}).readonly();
|
|
21045
|
+
var activeTurnUserMessageSchema = external_exports.strictObject({
|
|
21046
|
+
id: identifierStringSchema,
|
|
21047
|
+
images: external_exports.array(promptImageSchema).max(8).readonly().optional(),
|
|
21048
|
+
role: external_exports.literal("user"),
|
|
21049
|
+
text: external_exports.string().max(SESSION_HISTORY_CHARACTER_LIMIT)
|
|
21050
|
+
}).readonly();
|
|
21051
|
+
var activeTurnAssistantMessageSchema = external_exports.strictObject({
|
|
21052
|
+
activities: external_exports.array(activeTurnActivitySchema).max(100).readonly().default([]),
|
|
21053
|
+
content: external_exports.array(displayContentSchema).max(100).readonly().default([]),
|
|
21054
|
+
id: identifierStringSchema,
|
|
21055
|
+
role: external_exports.literal("assistant"),
|
|
21056
|
+
text: external_exports.string().max(SESSION_HISTORY_CHARACTER_LIMIT)
|
|
21057
|
+
}).readonly();
|
|
21058
|
+
var activeTurnMessageSchema = external_exports.discriminatedUnion("role", [
|
|
21059
|
+
activeTurnUserMessageSchema,
|
|
21060
|
+
activeTurnAssistantMessageSchema
|
|
21061
|
+
]);
|
|
21029
21062
|
var activeTurnSnapshotSchema = external_exports.strictObject({
|
|
21030
21063
|
activities: external_exports.array(activeTurnActivitySchema).readonly(),
|
|
21031
21064
|
commandId: identifierStringSchema,
|
|
@@ -21035,7 +21068,7 @@ var activeTurnSnapshotSchema = external_exports.strictObject({
|
|
|
21035
21068
|
truncated: external_exports.boolean(),
|
|
21036
21069
|
epoch: identifierStringSchema,
|
|
21037
21070
|
interaction: external_exports.discriminatedUnion("kind", [sessionPermissionRequestedEventSchema, sessionElicitationRequestedEventSchema]).nullable(),
|
|
21038
|
-
messages: external_exports.array(
|
|
21071
|
+
messages: external_exports.array(activeTurnMessageSchema).max(SESSION_HISTORY_MESSAGE_LIMIT).readonly(),
|
|
21039
21072
|
sequence: external_exports.number().int().nonnegative(),
|
|
21040
21073
|
state: external_exports.literal("running")
|
|
21041
21074
|
}).readonly();
|
|
@@ -21361,6 +21394,7 @@ var serviceToDaemonSignatures = {
|
|
|
21361
21394
|
decodeAgentSettingsDiscoverCommand
|
|
21362
21395
|
),
|
|
21363
21396
|
[FILE_READ_KIND]: defineMessageSignature(FILE_READ_KIND, encodeFileReadCommand, decodeFileReadCommand),
|
|
21397
|
+
[SESSION_LIST_KIND]: defineMessageSignature(SESSION_LIST_KIND, encodeSessionListCommand, decodeSessionListCommand),
|
|
21364
21398
|
[SESSION_QUERY_KIND]: defineMessageSignature(
|
|
21365
21399
|
SESSION_QUERY_KIND,
|
|
21366
21400
|
encodeSessionQueryCommand,
|
|
@@ -21496,6 +21530,11 @@ var daemonToServiceSignatures = {
|
|
|
21496
21530
|
[FILE_CHUNK_KIND]: defineMessageSignature(FILE_CHUNK_KIND, encodeFileChunkEvent, decodeFileChunkEvent),
|
|
21497
21531
|
[FILE_END_KIND]: defineMessageSignature(FILE_END_KIND, encodeFileEndEvent, decodeFileEndEvent),
|
|
21498
21532
|
[FILE_FAILED_KIND]: defineMessageSignature(FILE_FAILED_KIND, encodeFileFailedEvent, decodeFileFailedEvent),
|
|
21533
|
+
[SESSION_LISTED_KIND]: defineMessageSignature(
|
|
21534
|
+
SESSION_LISTED_KIND,
|
|
21535
|
+
encodeSessionsListedEvent,
|
|
21536
|
+
decodeSessionsListedEvent
|
|
21537
|
+
),
|
|
21499
21538
|
[SESSION_QUERIED_KIND]: defineMessageSignature(
|
|
21500
21539
|
SESSION_QUERIED_KIND,
|
|
21501
21540
|
encodeSessionsQueriedEvent,
|
|
@@ -32209,6 +32248,7 @@ var AgentRuntimeManager = class {
|
|
|
32209
32248
|
const stored = this.#store.read(sessionId);
|
|
32210
32249
|
return stored instanceof FoundAcpStoredSession ? [stored.session] : [];
|
|
32211
32250
|
});
|
|
32251
|
+
listSessions = (limit) => this.#store.list().filter((session) => session.prompted).slice(0, limit);
|
|
32212
32252
|
findLinkedSessions = (agentId, nativeSessionId) => this.#store.findNative(agentId, nativeSessionId);
|
|
32213
32253
|
hasPreparedSession = (sessionId, agentId, cwd, additionalDirectories) => this.#executionProcesses.get(sessionId)?.belongsTo(agentId, cwd, additionalDirectories) === true;
|
|
32214
32254
|
createNativeSession = async (options) => this.#operations.run(options, async (options2) => {
|
|
@@ -38658,7 +38698,7 @@ var ActiveDaemonTurn = class {
|
|
|
38658
38698
|
#text = "";
|
|
38659
38699
|
#activities = /* @__PURE__ */ new Map();
|
|
38660
38700
|
#content = /* @__PURE__ */ new Map();
|
|
38661
|
-
#timeline
|
|
38701
|
+
#timeline;
|
|
38662
38702
|
#sequence = 0;
|
|
38663
38703
|
#interaction = null;
|
|
38664
38704
|
#epoch = decodeIdentifier(randomUUID2());
|
|
@@ -38667,6 +38707,9 @@ var ActiveDaemonTurn = class {
|
|
|
38667
38707
|
this.command = command;
|
|
38668
38708
|
this.#controller = new AbortController();
|
|
38669
38709
|
this.#dispatch = { kind: "pending" };
|
|
38710
|
+
this.#timeline = [
|
|
38711
|
+
{ id: decodeIdentifier(command.commandId), images: command.images, kind: "user", text: command.prompt }
|
|
38712
|
+
];
|
|
38670
38713
|
}
|
|
38671
38714
|
enqueue = () => {
|
|
38672
38715
|
if (this.#dispatch.kind !== "pending") {
|
|
@@ -38710,7 +38753,10 @@ var ActiveDaemonTurn = class {
|
|
|
38710
38753
|
}
|
|
38711
38754
|
if (event.kind === AGENT_ACTIVITY_KIND) {
|
|
38712
38755
|
if (!this.#activities.has(event.activityId)) {
|
|
38713
|
-
this.#timeline = [
|
|
38756
|
+
this.#timeline = [
|
|
38757
|
+
...this.#timeline,
|
|
38758
|
+
{ activityId: event.activityId, id: decodeIdentifier(randomUUID2()), kind: "activity" }
|
|
38759
|
+
];
|
|
38714
38760
|
}
|
|
38715
38761
|
this.#activities.set(event.activityId, {
|
|
38716
38762
|
activityId: event.activityId,
|
|
@@ -38728,7 +38774,10 @@ var ActiveDaemonTurn = class {
|
|
|
38728
38774
|
} else if (event.kind === AGENT_ACTIVITY_NARRATION_KIND) {
|
|
38729
38775
|
const previous = this.#activities.get(event.activityId);
|
|
38730
38776
|
if (previous === void 0) {
|
|
38731
|
-
this.#timeline = [
|
|
38777
|
+
this.#timeline = [
|
|
38778
|
+
...this.#timeline,
|
|
38779
|
+
{ activityId: event.activityId, id: decodeIdentifier(randomUUID2()), kind: "activity" }
|
|
38780
|
+
];
|
|
38732
38781
|
}
|
|
38733
38782
|
this.#activities.set(event.activityId, {
|
|
38734
38783
|
activityId: event.activityId,
|
|
@@ -38746,15 +38795,16 @@ var ActiveDaemonTurn = class {
|
|
|
38746
38795
|
} else if (event.kind === AGENT_CONTENT_KIND) {
|
|
38747
38796
|
this.#content.set(event.contentId, event.content);
|
|
38748
38797
|
const target = this.#timeline.findLastIndex(
|
|
38749
|
-
(entry) => entry.kind === "message" && entry.
|
|
38798
|
+
(entry) => entry.kind === "message" && entry.sourceMessageId === event.messageId
|
|
38750
38799
|
);
|
|
38751
38800
|
if (target < 0) {
|
|
38752
38801
|
this.#timeline = [
|
|
38753
38802
|
...this.#timeline,
|
|
38754
38803
|
{
|
|
38755
38804
|
content: /* @__PURE__ */ new Map([[event.contentId, event.content]]),
|
|
38805
|
+
id: decodeIdentifier(randomUUID2()),
|
|
38756
38806
|
kind: "message",
|
|
38757
|
-
|
|
38807
|
+
sourceMessageId: event.messageId,
|
|
38758
38808
|
text: ""
|
|
38759
38809
|
}
|
|
38760
38810
|
];
|
|
@@ -38777,7 +38827,7 @@ var ActiveDaemonTurn = class {
|
|
|
38777
38827
|
let remaining = text2;
|
|
38778
38828
|
while (remaining.length > 0) {
|
|
38779
38829
|
const latest = this.#timeline.at(-1);
|
|
38780
|
-
if (latest?.kind === "message" && latest.
|
|
38830
|
+
if (latest?.kind === "message" && latest.sourceMessageId === messageId) {
|
|
38781
38831
|
const available = SESSION_HISTORY_CHARACTER_LIMIT - latest.text.length;
|
|
38782
38832
|
if (available > 0) {
|
|
38783
38833
|
this.#timeline = [
|
|
@@ -38792,28 +38842,43 @@ var ActiveDaemonTurn = class {
|
|
|
38792
38842
|
...this.#timeline,
|
|
38793
38843
|
{
|
|
38794
38844
|
content: /* @__PURE__ */ new Map(),
|
|
38845
|
+
id: decodeIdentifier(randomUUID2()),
|
|
38795
38846
|
kind: "message",
|
|
38796
|
-
messageId,
|
|
38847
|
+
sourceMessageId: messageId,
|
|
38797
38848
|
text: remaining.slice(0, SESSION_HISTORY_CHARACTER_LIMIT)
|
|
38798
38849
|
}
|
|
38799
38850
|
];
|
|
38800
38851
|
remaining = remaining.slice(SESSION_HISTORY_CHARACTER_LIMIT);
|
|
38801
38852
|
}
|
|
38802
38853
|
}
|
|
38854
|
+
recordSteeringPrompt = (command) => {
|
|
38855
|
+
if (this.#dispatch.kind !== "running" || command.sessionId !== this.command.sessionId || command.targetCommandId !== this.command.commandId) {
|
|
38856
|
+
return null;
|
|
38857
|
+
}
|
|
38858
|
+
this.#timeline = [
|
|
38859
|
+
...this.#timeline,
|
|
38860
|
+
{ id: decodeIdentifier(command.commandId), images: command.images, kind: "user", text: command.prompt }
|
|
38861
|
+
];
|
|
38862
|
+
return this.updated();
|
|
38863
|
+
};
|
|
38803
38864
|
timelineMessages() {
|
|
38804
38865
|
return this.#timeline.flatMap((entry) => {
|
|
38866
|
+
if (entry.kind === "user") {
|
|
38867
|
+
return [{ id: entry.id, images: entry.images, role: "user", text: entry.text }];
|
|
38868
|
+
}
|
|
38805
38869
|
if (entry.kind === "message") {
|
|
38806
38870
|
return [
|
|
38807
38871
|
{
|
|
38808
38872
|
activities: [],
|
|
38809
38873
|
content: [...entry.content.values()],
|
|
38874
|
+
id: entry.id,
|
|
38810
38875
|
role: "assistant",
|
|
38811
38876
|
text: entry.text
|
|
38812
38877
|
}
|
|
38813
38878
|
];
|
|
38814
38879
|
}
|
|
38815
38880
|
const activity2 = this.#activities.get(entry.activityId);
|
|
38816
|
-
return activity2 === void 0 ? [] : [{ activities: [activity2], content: [], role: "assistant", text: "" }];
|
|
38881
|
+
return activity2 === void 0 ? [] : [{ activities: [activity2], content: [], id: entry.id, role: "assistant", text: "" }];
|
|
38817
38882
|
});
|
|
38818
38883
|
}
|
|
38819
38884
|
updated = () => {
|
|
@@ -38923,6 +38988,10 @@ var DaemonTurnRegistry = class {
|
|
|
38923
38988
|
}
|
|
38924
38989
|
return event;
|
|
38925
38990
|
};
|
|
38991
|
+
recordSteeringPrompt = (command) => {
|
|
38992
|
+
const target = this.#turns.get(command.targetCommandId);
|
|
38993
|
+
return target?.recordSteeringPrompt(command) ?? null;
|
|
38994
|
+
};
|
|
38926
38995
|
executionSnapshot = async (matches) => {
|
|
38927
38996
|
const matching = [];
|
|
38928
38997
|
for (const turn of this.#turns.values()) {
|
|
@@ -40074,9 +40143,11 @@ var NativeSessionService = class {
|
|
|
40074
40143
|
title: target.info.title ?? "Untitled session"
|
|
40075
40144
|
};
|
|
40076
40145
|
};
|
|
40077
|
-
|
|
40146
|
+
listSessions = async (limit, signal) => await this.describeSessions(this.#sessions.listSessions(limit), signal);
|
|
40147
|
+
querySessions = async (sessionIds, signal) => await this.describeSessions(this.#sessions.findSessions(sessionIds), signal);
|
|
40148
|
+
describeSessions = async (sessions, signal) => {
|
|
40078
40149
|
const entries = [];
|
|
40079
|
-
for (const session of
|
|
40150
|
+
for (const session of sessions) {
|
|
40080
40151
|
signal.throwIfAborted();
|
|
40081
40152
|
const directory = await this.#directories.identify(this.#config.bindingId, session.cwd, signal);
|
|
40082
40153
|
const additionalDirectories = [];
|
|
@@ -41332,6 +41403,14 @@ function boundedActiveMessages(messages, messageLimit, characterLimit) {
|
|
|
41332
41403
|
truncated: selected.length !== messages.length
|
|
41333
41404
|
};
|
|
41334
41405
|
}
|
|
41406
|
+
function nativeActiveMessage(message) {
|
|
41407
|
+
return message.role === "user" ? { role: "user", text: message.text } : {
|
|
41408
|
+
activities: message.activities,
|
|
41409
|
+
content: message.content,
|
|
41410
|
+
role: "assistant",
|
|
41411
|
+
text: message.text
|
|
41412
|
+
};
|
|
41413
|
+
}
|
|
41335
41414
|
function paginateAcpSessionHistory(history, sessionId, cursor, limit) {
|
|
41336
41415
|
if (history.status === "unavailable") {
|
|
41337
41416
|
if (cursor !== null) {
|
|
@@ -41364,20 +41443,27 @@ function paginateLiveSessionHistory(history, activeTurn, sessionId, cursor, limi
|
|
|
41364
41443
|
}
|
|
41365
41444
|
if (history.status === "unavailable") {
|
|
41366
41445
|
const bounded3 = boundedActiveMessages(
|
|
41367
|
-
activeTurn.messages,
|
|
41368
|
-
|
|
41369
|
-
|
|
41446
|
+
activeTurn.messages.map(nativeActiveMessage),
|
|
41447
|
+
limit,
|
|
41448
|
+
SESSION_HISTORY_CHARACTER_LIMIT
|
|
41370
41449
|
);
|
|
41371
41450
|
return {
|
|
41372
41451
|
coveredCommandIds: [],
|
|
41373
41452
|
coveredMessageIds: [],
|
|
41374
|
-
messages:
|
|
41453
|
+
messages: bounded3.messages,
|
|
41375
41454
|
nextCursor: null,
|
|
41376
41455
|
status: "available",
|
|
41377
41456
|
truncated: activeTurn.truncated || bounded3.truncated
|
|
41378
41457
|
};
|
|
41379
41458
|
}
|
|
41380
|
-
const
|
|
41459
|
+
const activeRoot = activeTurn.messages.find(
|
|
41460
|
+
(message) => message.role === "user" && message.id === activeTurn.commandId
|
|
41461
|
+
);
|
|
41462
|
+
const coveredActiveRoot = history.coveredCommandIds.includes(activeTurn.commandId);
|
|
41463
|
+
const matchingActiveUserIndex = coveredActiveRoot ? history.messages.findLastIndex(
|
|
41464
|
+
(message) => message.role === "user" && message.text === (activeRoot?.text ?? activeTurn.prompt)
|
|
41465
|
+
) : -1;
|
|
41466
|
+
const activeUserIndex = matchingActiveUserIndex >= 0 ? matchingActiveUserIndex : liveHistoryCoveredTurnRanges(history).find((range) => range.commandId === activeTurn.commandId)?.userIndex ?? -1;
|
|
41381
41467
|
if (activeUserIndex >= 0) {
|
|
41382
41468
|
history = {
|
|
41383
41469
|
...history,
|
|
@@ -41389,19 +41475,13 @@ function paginateLiveSessionHistory(history, activeTurn, sessionId, cursor, limi
|
|
|
41389
41475
|
};
|
|
41390
41476
|
}
|
|
41391
41477
|
const latestNativeMessage = history.messages.at(-1);
|
|
41392
|
-
const
|
|
41393
|
-
const
|
|
41394
|
-
|
|
41395
|
-
|
|
41396
|
-
Math.max(0, SESSION_HISTORY_CHARACTER_LIMIT - (includeActivePrompt ? activeTurn.prompt.length : 0))
|
|
41397
|
-
);
|
|
41398
|
-
const activeMessages = [
|
|
41399
|
-
...includeActivePrompt ? [{ role: "user", text: activeTurn.prompt }] : [],
|
|
41400
|
-
...bounded2.messages
|
|
41401
|
-
];
|
|
41478
|
+
const firstActiveMessage = activeTurn.messages[0];
|
|
41479
|
+
const preserveNativeRoot = activeUserIndex >= 0 || firstActiveMessage?.role === "user" && latestNativeMessage?.role === "user" && latestNativeMessage.text === firstActiveMessage.text;
|
|
41480
|
+
const activeMessages = activeTurn.messages.slice(preserveNativeRoot ? 1 : 0).map(nativeActiveMessage);
|
|
41481
|
+
const bounded2 = boundedActiveMessages(activeMessages, limit, SESSION_HISTORY_CHARACTER_LIMIT);
|
|
41402
41482
|
let historicalMessageCount = 0;
|
|
41403
|
-
let remainingCharacters = SESSION_HISTORY_CHARACTER_LIMIT - bounded2.characters
|
|
41404
|
-
const historicalMessageLimit = Math.max(0, limit -
|
|
41483
|
+
let remainingCharacters = SESSION_HISTORY_CHARACTER_LIMIT - bounded2.characters;
|
|
41484
|
+
const historicalMessageLimit = Math.max(0, limit - bounded2.messages.length);
|
|
41405
41485
|
for (let index = history.messages.length - 1; index >= 0 && historicalMessageCount < historicalMessageLimit; index -= 1) {
|
|
41406
41486
|
const message = history.messages[index];
|
|
41407
41487
|
if (message === void 0) {
|
|
@@ -41424,7 +41504,7 @@ function paginateLiveSessionHistory(history, activeTurn, sessionId, cursor, limi
|
|
|
41424
41504
|
} : paginateAcpSessionHistory(history, sessionId, null, historicalMessageCount);
|
|
41425
41505
|
return {
|
|
41426
41506
|
...page,
|
|
41427
|
-
messages: [...page.messages, ...
|
|
41507
|
+
messages: [...page.messages, ...bounded2.messages],
|
|
41428
41508
|
truncated: page.truncated || activeTurn.truncated || bounded2.truncated
|
|
41429
41509
|
};
|
|
41430
41510
|
}
|
|
@@ -41875,6 +41955,7 @@ async function executePrompt({
|
|
|
41875
41955
|
timer,
|
|
41876
41956
|
signal,
|
|
41877
41957
|
recordLiveEvent,
|
|
41958
|
+
recordSteeringPrompt,
|
|
41878
41959
|
cancellationRequested
|
|
41879
41960
|
}) {
|
|
41880
41961
|
const events = new CoalescingAgentEventPublisher(timer, (event) => {
|
|
@@ -41955,6 +42036,17 @@ async function executePrompt({
|
|
|
41955
42036
|
sessionId: command.sessionId
|
|
41956
42037
|
});
|
|
41957
42038
|
operations.transitionExecution(command.commandId, "running");
|
|
42039
|
+
if (availability.disposition === SessionPromptDisposition.Steer) {
|
|
42040
|
+
const updated = recordSteeringPrompt();
|
|
42041
|
+
if (updated === null) {
|
|
42042
|
+
throw new AcpExecutionError(
|
|
42043
|
+
"The steering target is unavailable",
|
|
42044
|
+
{},
|
|
42045
|
+
"prompt_queue_target_unavailable"
|
|
42046
|
+
);
|
|
42047
|
+
}
|
|
42048
|
+
publisher.publish(command.sessionId, updated);
|
|
42049
|
+
}
|
|
41958
42050
|
const stream = activateAttempt();
|
|
41959
42051
|
publisher.publish(command.sessionId, {
|
|
41960
42052
|
commandId: command.commandId,
|
|
@@ -42470,6 +42562,19 @@ function createDaemonCommandHandler({
|
|
|
42470
42562
|
void executeSessionConfigure(publisher, socket, command2, config2, directories, audit, sessions, signal);
|
|
42471
42563
|
return;
|
|
42472
42564
|
}
|
|
42565
|
+
if (kind === SESSION_LIST_KIND) {
|
|
42566
|
+
const command2 = message;
|
|
42567
|
+
void nativeSessions.listSessions(command2.limit, signal).then((entries) => {
|
|
42568
|
+
send(socket, {
|
|
42569
|
+
entries,
|
|
42570
|
+
kind: SESSION_LISTED_KIND,
|
|
42571
|
+
requestId: command2.requestId
|
|
42572
|
+
});
|
|
42573
|
+
}).catch((error62) => {
|
|
42574
|
+
reportOperationFailure(socket, command2.requestId, "", error62);
|
|
42575
|
+
});
|
|
42576
|
+
return;
|
|
42577
|
+
}
|
|
42473
42578
|
if (kind === SESSION_QUERY_KIND) {
|
|
42474
42579
|
const command2 = message;
|
|
42475
42580
|
void nativeSessions.querySessions(command2.sessionIds, signal).then((entries) => {
|
|
@@ -42574,6 +42679,7 @@ function createDaemonCommandHandler({
|
|
|
42574
42679
|
timer,
|
|
42575
42680
|
signal: turn.signal,
|
|
42576
42681
|
recordLiveEvent: turn.recordEvent,
|
|
42682
|
+
recordSteeringPrompt: () => activeTurns.recordSteeringPrompt(command),
|
|
42577
42683
|
cancellationRequested: turn.cancellationRequested
|
|
42578
42684
|
}).catch((error62) => {
|
|
42579
42685
|
console.error("Mobius daemon turn failed", error62);
|