@moxt-ai/mobius 0.0.62 → 0.0.64
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/session-manager.d.ts +1 -0
- package/dist/acp/session-manager.d.ts.map +1 -1
- package/dist/acp/session-manager.js +9 -0
- package/dist/acp/session-manager.js.map +1 -1
- package/dist/cli.js +116 -6
- package/dist/cli.js.map +4 -4
- package/dist/index.js +115 -5
- package/dist/index.js.map +4 -4
- package/dist/run-daemon.d.ts.map +1 -1
- package/dist/run-daemon.js +47 -1
- package/dist/run-daemon.js.map +1 -1
- package/dist/runtime.js +115 -5
- package/dist/runtime.js.map +4 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -21176,6 +21176,39 @@ function decodeRecordedSessionEvent(encoded) {
|
|
|
21176
21176
|
}
|
|
21177
21177
|
var encodeRecordedSessionEvent = (event) => JSON.stringify(decodeRecordedSessionEvent(JSON.stringify(event)));
|
|
21178
21178
|
|
|
21179
|
+
// ../protocol/src/session-live-history.ts
|
|
21180
|
+
var SESSION_LIVE_HISTORY_LOAD_KIND = "session.live-history.load";
|
|
21181
|
+
var SESSION_LIVE_HISTORY_LOADED_KIND = "session.live-history.loaded";
|
|
21182
|
+
var identifier2 = external_exports.string().regex(/^[a-zA-Z0-9][a-zA-Z0-9._:-]{0,127}$/);
|
|
21183
|
+
var directoryIdentifier = external_exports.string().regex(/^[a-zA-Z0-9][a-zA-Z0-9_-]{0,2047}$/);
|
|
21184
|
+
var sessionLiveHistoryLoadSchema = external_exports.strictObject({
|
|
21185
|
+
additionalDirectoryIds: external_exports.array(directoryIdentifier).max(16).readonly(),
|
|
21186
|
+
agentId: identifier2,
|
|
21187
|
+
bindingId: identifier2,
|
|
21188
|
+
directoryId: directoryIdentifier,
|
|
21189
|
+
kind: external_exports.literal(SESSION_LIVE_HISTORY_LOAD_KIND),
|
|
21190
|
+
requestId: identifier2,
|
|
21191
|
+
sessionId: identifier2
|
|
21192
|
+
}).readonly();
|
|
21193
|
+
var sessionLiveHistoryLoadedSchema = external_exports.strictObject({
|
|
21194
|
+
history: sessionHistorySchema,
|
|
21195
|
+
kind: external_exports.literal(SESSION_LIVE_HISTORY_LOADED_KIND),
|
|
21196
|
+
requestId: identifier2,
|
|
21197
|
+
sessionId: identifier2
|
|
21198
|
+
}).readonly();
|
|
21199
|
+
function decode6(schema, encoded) {
|
|
21200
|
+
try {
|
|
21201
|
+
const value = JSON.parse(encoded);
|
|
21202
|
+
return schema.parse(value);
|
|
21203
|
+
} catch (cause) {
|
|
21204
|
+
throw new ProtocolMessageError("Invalid live Session history message", { cause });
|
|
21205
|
+
}
|
|
21206
|
+
}
|
|
21207
|
+
var decodeSessionLiveHistoryLoad = (encoded) => decode6(sessionLiveHistoryLoadSchema, encoded);
|
|
21208
|
+
var decodeSessionLiveHistoryLoaded = (encoded) => decode6(sessionLiveHistoryLoadedSchema, encoded);
|
|
21209
|
+
var encodeSessionLiveHistoryLoad = (value) => JSON.stringify(sessionLiveHistoryLoadSchema.parse(value));
|
|
21210
|
+
var encodeSessionLiveHistoryLoaded = (value) => JSON.stringify(sessionLiveHistoryLoadedSchema.parse(value));
|
|
21211
|
+
|
|
21179
21212
|
// ../protocol/src/daemon-transport.ts
|
|
21180
21213
|
function defineMessageSignature(kind, encoder, decoder) {
|
|
21181
21214
|
const schema = (message) => decoder(JSON.stringify(message));
|
|
@@ -21273,6 +21306,11 @@ var serviceToDaemonSignatures = {
|
|
|
21273
21306
|
encodeSessionEventRejection,
|
|
21274
21307
|
decodeSessionEventRejection
|
|
21275
21308
|
),
|
|
21309
|
+
[SESSION_LIVE_HISTORY_LOAD_KIND]: defineMessageSignature(
|
|
21310
|
+
SESSION_LIVE_HISTORY_LOAD_KIND,
|
|
21311
|
+
encodeSessionLiveHistoryLoad,
|
|
21312
|
+
decodeSessionLiveHistoryLoad
|
|
21313
|
+
),
|
|
21276
21314
|
[SESSION_PERMISSION_RESPOND_KIND]: defineMessageSignature(
|
|
21277
21315
|
SESSION_PERMISSION_RESPOND_KIND,
|
|
21278
21316
|
encodeSessionPermissionRespondCommand,
|
|
@@ -21378,6 +21416,11 @@ var daemonToServiceSignatures = {
|
|
|
21378
21416
|
encodeSessionOperationFailedEvent,
|
|
21379
21417
|
decodeSessionOperationFailedEvent
|
|
21380
21418
|
),
|
|
21419
|
+
[SESSION_LIVE_HISTORY_LOADED_KIND]: defineMessageSignature(
|
|
21420
|
+
SESSION_LIVE_HISTORY_LOADED_KIND,
|
|
21421
|
+
encodeSessionLiveHistoryLoaded,
|
|
21422
|
+
decodeSessionLiveHistoryLoaded
|
|
21423
|
+
),
|
|
21381
21424
|
[SESSION_READY_KIND]: defineMessageSignature(SESSION_READY_KIND, encodeSessionReadyEvent, decodeSessionReadyEvent),
|
|
21382
21425
|
[WORKSPACE_ENTRIES_KIND]: defineMessageSignature(
|
|
21383
21426
|
WORKSPACE_ENTRIES_KIND,
|
|
@@ -27055,7 +27098,7 @@ var titleBefore = {
|
|
|
27055
27098
|
};
|
|
27056
27099
|
function tokenizeDefinition(effects, ok2, nok) {
|
|
27057
27100
|
const self = this;
|
|
27058
|
-
let
|
|
27101
|
+
let identifier3;
|
|
27059
27102
|
return start;
|
|
27060
27103
|
function start(code) {
|
|
27061
27104
|
effects.enter("definition");
|
|
@@ -27074,7 +27117,7 @@ function tokenizeDefinition(effects, ok2, nok) {
|
|
|
27074
27117
|
)(code);
|
|
27075
27118
|
}
|
|
27076
27119
|
function labelAfter(code) {
|
|
27077
|
-
|
|
27120
|
+
identifier3 = normalizeIdentifier(self.sliceSerialize(self.events[self.events.length - 1][1]).slice(1, -1));
|
|
27078
27121
|
if (code === 58) {
|
|
27079
27122
|
effects.enter("definitionMarker");
|
|
27080
27123
|
effects.consume(code);
|
|
@@ -27108,7 +27151,7 @@ function tokenizeDefinition(effects, ok2, nok) {
|
|
|
27108
27151
|
function afterWhitespace(code) {
|
|
27109
27152
|
if (code === null || markdownLineEnding(code)) {
|
|
27110
27153
|
effects.exit("definition");
|
|
27111
|
-
self.parser.defined.push(
|
|
27154
|
+
self.parser.defined.push(identifier3);
|
|
27112
27155
|
return ok2(code);
|
|
27113
27156
|
}
|
|
27114
27157
|
return nok(code);
|
|
@@ -29239,9 +29282,9 @@ function preprocess2() {
|
|
|
29239
29282
|
// ../../node_modules/.pnpm/micromark-util-decode-string@2.0.1/node_modules/micromark-util-decode-string/index.js
|
|
29240
29283
|
var characterEscapeOrReference = /\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;
|
|
29241
29284
|
function decodeString(value) {
|
|
29242
|
-
return value.replace(characterEscapeOrReference,
|
|
29285
|
+
return value.replace(characterEscapeOrReference, decode7);
|
|
29243
29286
|
}
|
|
29244
|
-
function
|
|
29287
|
+
function decode7($0, $1, $2) {
|
|
29245
29288
|
if ($1) {
|
|
29246
29289
|
return $1;
|
|
29247
29290
|
}
|
|
@@ -33536,6 +33579,14 @@ var AcpSessionManager = class {
|
|
|
33536
33579
|
this.#nativeOperations.delete(key);
|
|
33537
33580
|
}
|
|
33538
33581
|
};
|
|
33582
|
+
loadSessionHistory = async (options) => {
|
|
33583
|
+
this.#beginSessionUse(options.sessionId);
|
|
33584
|
+
try {
|
|
33585
|
+
return await (await this.ensureSession(options)).loadHistory(options.signal);
|
|
33586
|
+
} finally {
|
|
33587
|
+
this.#endSessionUse(options.sessionId);
|
|
33588
|
+
}
|
|
33589
|
+
};
|
|
33539
33590
|
openNativeSession = async (options, origin) => {
|
|
33540
33591
|
const key = `${options.agent.id}:${origin.nativeSessionId}`;
|
|
33541
33592
|
if (this.#nativeOperations.has(key)) {
|
|
@@ -40476,6 +40527,52 @@ async function executeSessionPrepare(publisher, socket, command, config2, direct
|
|
|
40476
40527
|
reportOperationFailure(socket, command.requestId, command.sessionId, error62, metrics.snapshot());
|
|
40477
40528
|
}
|
|
40478
40529
|
}
|
|
40530
|
+
async function executeSessionLiveHistoryLoad(socket, command, config2, directories, audit, sessions, signal) {
|
|
40531
|
+
try {
|
|
40532
|
+
const resolved = await resolveSessionDirectories(
|
|
40533
|
+
directories,
|
|
40534
|
+
config2.bindingId,
|
|
40535
|
+
command.directoryId,
|
|
40536
|
+
command.additionalDirectoryIds,
|
|
40537
|
+
signal
|
|
40538
|
+
);
|
|
40539
|
+
const history = await sessions.loadSessionHistory({
|
|
40540
|
+
additionalDirectories: resolved.additionalDirectories,
|
|
40541
|
+
agent: config2.catalog.find(command.agentId),
|
|
40542
|
+
cwd: resolved.cwd,
|
|
40543
|
+
sessionId: command.sessionId,
|
|
40544
|
+
signal
|
|
40545
|
+
});
|
|
40546
|
+
signal.throwIfAborted();
|
|
40547
|
+
audit.record({
|
|
40548
|
+
commandId: command.requestId,
|
|
40549
|
+
event: "session_history_loaded",
|
|
40550
|
+
sessionId: command.sessionId
|
|
40551
|
+
});
|
|
40552
|
+
send(socket, {
|
|
40553
|
+
history,
|
|
40554
|
+
kind: "session.live-history.loaded",
|
|
40555
|
+
requestId: command.requestId,
|
|
40556
|
+
sessionId: command.sessionId
|
|
40557
|
+
});
|
|
40558
|
+
} catch (error62) {
|
|
40559
|
+
if (signal.aborted) {
|
|
40560
|
+
return;
|
|
40561
|
+
}
|
|
40562
|
+
audit.record({
|
|
40563
|
+
commandId: command.requestId,
|
|
40564
|
+
details: { code: operationErrorCode(error62) },
|
|
40565
|
+
event: "session_history_unavailable",
|
|
40566
|
+
sessionId: command.sessionId
|
|
40567
|
+
});
|
|
40568
|
+
send(socket, {
|
|
40569
|
+
history: { status: "unavailable" },
|
|
40570
|
+
kind: "session.live-history.loaded",
|
|
40571
|
+
requestId: command.requestId,
|
|
40572
|
+
sessionId: command.sessionId
|
|
40573
|
+
});
|
|
40574
|
+
}
|
|
40575
|
+
}
|
|
40479
40576
|
async function executeSessionConfigure(publisher, socket, command, config2, directories, audit, sessions, signal) {
|
|
40480
40577
|
try {
|
|
40481
40578
|
const resolved = await resolveSessionDirectories(
|
|
@@ -41317,6 +41414,19 @@ async function runRelayConnection(config2, directories, audit, sessions, install
|
|
|
41317
41414
|
}
|
|
41318
41415
|
return;
|
|
41319
41416
|
}
|
|
41417
|
+
if (kind === SESSION_LIVE_HISTORY_LOAD_KIND) {
|
|
41418
|
+
const command2 = decodeSessionLiveHistoryLoad(encoded);
|
|
41419
|
+
void executeSessionLiveHistoryLoad(
|
|
41420
|
+
socket,
|
|
41421
|
+
command2,
|
|
41422
|
+
config2,
|
|
41423
|
+
directories,
|
|
41424
|
+
audit,
|
|
41425
|
+
sessions,
|
|
41426
|
+
connectionController.signal
|
|
41427
|
+
);
|
|
41428
|
+
return;
|
|
41429
|
+
}
|
|
41320
41430
|
if (kind === NATIVE_SESSION_CANCEL_KIND) {
|
|
41321
41431
|
const command2 = message;
|
|
41322
41432
|
const pending = nativeRequests.get(command2.requestId);
|