lody 0.51.0 → 0.52.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.
- package/dist/index.js +78 -52
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -36822,7 +36822,7 @@ Mongoose Error Code: ${error2.code}` : ""}`
|
|
|
36822
36822
|
return client;
|
|
36823
36823
|
}
|
|
36824
36824
|
const name = "lody";
|
|
36825
|
-
const version$4 = "0.
|
|
36825
|
+
const version$4 = "0.52.0";
|
|
36826
36826
|
const description$1 = "Lody Agent CLI tool for managing remote command execution";
|
|
36827
36827
|
const type$2 = "module";
|
|
36828
36828
|
const main$3 = "dist/index.js";
|
|
@@ -36865,7 +36865,7 @@ Mongoose Error Code: ${error2.code}` : ""}`
|
|
|
36865
36865
|
"node": ">=18.0.0"
|
|
36866
36866
|
};
|
|
36867
36867
|
const optionalDependencies = {
|
|
36868
|
-
"acp-extension-claude": "0.
|
|
36868
|
+
"acp-extension-claude": "0.34.1",
|
|
36869
36869
|
"acp-extension-codex": "0.14.3"
|
|
36870
36870
|
};
|
|
36871
36871
|
const devDependencies = {
|
|
@@ -37076,7 +37076,7 @@ Mongoose Error Code: ${error2.code}` : ""}`
|
|
|
37076
37076
|
const runtimeEnv = getRuntimeEnv();
|
|
37077
37077
|
const environment$1 = "production";
|
|
37078
37078
|
const dsn = "https://080f9de535ff335a1a0440d0e385f796@o4510491299086336.ingest.us.sentry.io/4510559045681152";
|
|
37079
|
-
const postHogHost = process.env.LODY_POSTHOG_HOST ?? "https://
|
|
37079
|
+
const postHogHost = process.env.LODY_POSTHOG_HOST ?? "https://m.lody.ai";
|
|
37080
37080
|
const postHogKey = process.env.LODY_POSTHOG_KEY ?? "phc_LFS5i5WIwg4irAhrG5oJR04iYPhReVZ3DdFZOKqCkjG";
|
|
37081
37081
|
const tracesSampleRate = Number(process.env.SENTRY_TRACES_SAMPLE_RATE) || 0.2;
|
|
37082
37082
|
const profilesSampleRate = Number(process.env.SENTRY_PROFILES_SAMPLE_RATE) || 0.1;
|
|
@@ -77781,6 +77781,9 @@ Task description:
|
|
|
77781
77781
|
}
|
|
77782
77782
|
return void 0;
|
|
77783
77783
|
};
|
|
77784
|
+
function getLocalProjectHistoryProviderKey(provider2) {
|
|
77785
|
+
return `${provider2.cliType}:${provider2.agentType}`;
|
|
77786
|
+
}
|
|
77784
77787
|
const DEFAULT_BASE_BRANCH = "main";
|
|
77785
77788
|
function getTrimmedBranch(value) {
|
|
77786
77789
|
if (typeof value !== "string") {
|
|
@@ -78662,10 +78665,10 @@ Task description:
|
|
|
78662
78665
|
localProjectId: LocalProjectIdSchema,
|
|
78663
78666
|
branchName: string$2()
|
|
78664
78667
|
}).strict();
|
|
78665
|
-
const LocalProjectHistoryProviderSchema =
|
|
78666
|
-
|
|
78667
|
-
|
|
78668
|
-
|
|
78668
|
+
const LocalProjectHistoryProviderSchema = object$1({
|
|
78669
|
+
cliType: AgentConfigCliTypeSchema,
|
|
78670
|
+
agentType: string$2().trim().min(1)
|
|
78671
|
+
}).strict();
|
|
78669
78672
|
const LocalProjectSyncHistoryRequestSchema = object$1({
|
|
78670
78673
|
type: literal("local-project/sync-history"),
|
|
78671
78674
|
machineId: MachineIdSchema,
|
|
@@ -82556,8 +82559,8 @@ Task description:
|
|
|
82556
82559
|
function createUserEntry(args2) {
|
|
82557
82560
|
const inputConfig = {
|
|
82558
82561
|
prompt: args2.text,
|
|
82559
|
-
cliType:
|
|
82560
|
-
agentType: args2.agentType,
|
|
82562
|
+
cliType: args2.provider.cliType,
|
|
82563
|
+
agentType: args2.provider.agentType,
|
|
82561
82564
|
...{}
|
|
82562
82565
|
};
|
|
82563
82566
|
return {
|
|
@@ -82582,7 +82585,7 @@ Task description:
|
|
|
82582
82585
|
const now2 = options.now ?? defaultNow;
|
|
82583
82586
|
const createId = options.createId ?? defaultCreateId;
|
|
82584
82587
|
const mode2 = options.mode;
|
|
82585
|
-
const
|
|
82588
|
+
const provider2 = options.provider;
|
|
82586
82589
|
let history = [];
|
|
82587
82590
|
let lastWasUserChunk = false;
|
|
82588
82591
|
let droppedNotifications = 0;
|
|
@@ -82604,7 +82607,7 @@ Task description:
|
|
|
82604
82607
|
text,
|
|
82605
82608
|
timestamp: now2(),
|
|
82606
82609
|
userId: options.userId,
|
|
82607
|
-
|
|
82610
|
+
provider: provider2,
|
|
82608
82611
|
mode: mode2
|
|
82609
82612
|
}));
|
|
82610
82613
|
}
|
|
@@ -121114,6 +121117,9 @@ ${this.stack.split("\n").slice(1).join("\n")}` : this.toString();
|
|
|
121114
121117
|
nes_reject: "nes/reject",
|
|
121115
121118
|
nes_start: "nes/start",
|
|
121116
121119
|
nes_suggest: "nes/suggest",
|
|
121120
|
+
providers_disable: "providers/disable",
|
|
121121
|
+
providers_list: "providers/list",
|
|
121122
|
+
providers_set: "providers/set",
|
|
121117
121123
|
session_cancel: "session/cancel",
|
|
121118
121124
|
session_close: "session/close",
|
|
121119
121125
|
session_fork: "session/fork",
|
|
@@ -121315,6 +121321,15 @@ ${this.stack.split("\n").slice(1).join("\n")}` : this.toString();
|
|
|
121315
121321
|
async authenticate(params) {
|
|
121316
121322
|
return await this.connection.sendRequest(AGENT_METHODS.authenticate, params) ?? {};
|
|
121317
121323
|
}
|
|
121324
|
+
async unstable_listProviders(params) {
|
|
121325
|
+
return await this.connection.sendRequest(AGENT_METHODS.providers_list, params);
|
|
121326
|
+
}
|
|
121327
|
+
async unstable_setProvider(params) {
|
|
121328
|
+
return await this.connection.sendRequest(AGENT_METHODS.providers_set, params) ?? {};
|
|
121329
|
+
}
|
|
121330
|
+
async unstable_disableProvider(params) {
|
|
121331
|
+
return await this.connection.sendRequest(AGENT_METHODS.providers_disable, params) ?? {};
|
|
121332
|
+
}
|
|
121318
121333
|
async unstable_logout(params) {
|
|
121319
121334
|
return await this.connection.sendRequest(AGENT_METHODS.logout, params) ?? {};
|
|
121320
121335
|
}
|
|
@@ -122413,7 +122428,7 @@ ${this.stack.split("\n").slice(1).join("\n")}` : this.toString();
|
|
|
122413
122428
|
const BuiltinACPSetting = {
|
|
122414
122429
|
claude: {
|
|
122415
122430
|
packageName: "acp-extension-claude",
|
|
122416
|
-
version: "0.
|
|
122431
|
+
version: "0.34.1",
|
|
122417
122432
|
binName: "acp-extension-claude"
|
|
122418
122433
|
},
|
|
122419
122434
|
codex: {
|
|
@@ -126014,14 +126029,10 @@ $mem | ConvertTo-Json -Compress
|
|
|
126014
126029
|
}
|
|
126015
126030
|
function getImportedAcpSourceAcpSessionId(meta) {
|
|
126016
126031
|
const externalHistory = meta.externalHistory;
|
|
126017
|
-
|
|
126018
|
-
if (!externalHistory || provider2 !== "codex" && provider2 !== "claude") {
|
|
126019
|
-
return void 0;
|
|
126020
|
-
}
|
|
126021
|
-
return externalHistory.sourceAcpSessionId;
|
|
126032
|
+
return externalHistory?.sourceAcpSessionId;
|
|
126022
126033
|
}
|
|
126023
126034
|
function isImportedAcpReplayUserTurn(entry2, meta) {
|
|
126024
|
-
const provider2 = meta.externalHistory
|
|
126035
|
+
const provider2 = meta.externalHistory ? getLocalProjectHistoryProviderKey(meta.externalHistory.provider) : null;
|
|
126025
126036
|
const sourceAcpSessionId = getImportedAcpSourceAcpSessionId(meta);
|
|
126026
126037
|
return !!provider2 && !!sourceAcpSessionId && entry2.id.startsWith(`${provider2}:${sourceAcpSessionId}:turn:`);
|
|
126027
126038
|
}
|
|
@@ -131099,27 +131110,24 @@ ${escapeHtmlScriptContent(VISUAL_ANNOTATION_INSPECTOR_BROWSER_SCRIPT)}
|
|
|
131099
131110
|
}
|
|
131100
131111
|
}
|
|
131101
131112
|
function getProviderLabel$1(provider2) {
|
|
131102
|
-
return provider2
|
|
131113
|
+
return getLocalProjectHistoryProviderKey(provider2);
|
|
131103
131114
|
}
|
|
131104
131115
|
async function createHistoryAcpConnection(args2) {
|
|
131105
|
-
const setting = resolveACPSetting(
|
|
131106
|
-
cliType: "builtin",
|
|
131107
|
-
agentType: args2.provider
|
|
131108
|
-
});
|
|
131116
|
+
const setting = resolveACPSetting(args2.provider);
|
|
131109
131117
|
const env2 = setting.exec.env ? {
|
|
131110
131118
|
...process.env,
|
|
131111
131119
|
...setting.exec.env
|
|
131112
131120
|
} : process.env;
|
|
131113
131121
|
const agentProcess = spawnAcpProcess({
|
|
131114
|
-
cliType:
|
|
131115
|
-
agentType: args2.provider,
|
|
131122
|
+
cliType: args2.provider.cliType,
|
|
131123
|
+
agentType: args2.provider.agentType,
|
|
131116
131124
|
workdir: args2.workdir,
|
|
131117
131125
|
env: env2
|
|
131118
131126
|
});
|
|
131119
131127
|
agentProcess.stderr?.setEncoding("utf8");
|
|
131120
131128
|
agentProcess.stderr?.on("data", (chunk) => {
|
|
131121
131129
|
if (!chunk) return;
|
|
131122
|
-
args2.logger.debug(`[${args2.provider}-history-sync] ACP stderr: ${chunk.slice(0, 1200)}`);
|
|
131130
|
+
args2.logger.debug(`[${getProviderLabel$1(args2.provider)}-history-sync] ACP stderr: ${chunk.slice(0, 1200)}`);
|
|
131123
131131
|
});
|
|
131124
131132
|
if (!agentProcess.stdout || !agentProcess.stdin) {
|
|
131125
131133
|
await terminateChildProcess(agentProcess);
|
|
@@ -131230,7 +131238,8 @@ ${escapeHtmlScriptContent(VISUAL_ANNOTATION_INSPECTOR_BROWSER_SCRIPT)}
|
|
|
131230
131238
|
}), `${getProviderLabel$1(args2.provider)} ACP loadSession (${args2.acpSessionId})`);
|
|
131231
131239
|
return collector.notifications;
|
|
131232
131240
|
} catch (error2) {
|
|
131233
|
-
|
|
131241
|
+
const message = `Failed to load ${getProviderLabel$1(args2.provider)} session ${args2.acpSessionId}: ${formatErrorMessage(error2)}`;
|
|
131242
|
+
throw new Error(message, {
|
|
131234
131243
|
cause: error2
|
|
131235
131244
|
});
|
|
131236
131245
|
} finally {
|
|
@@ -131295,17 +131304,18 @@ ${escapeHtmlScriptContent(VISUAL_ANNOTATION_INSPECTOR_BROWSER_SCRIPT)}
|
|
|
131295
131304
|
function materializeReplay(args2) {
|
|
131296
131305
|
let tempId = 0;
|
|
131297
131306
|
const nowIso = new Date(getServerNow()).toISOString();
|
|
131307
|
+
const providerKey = getLocalProjectHistoryProviderKey(args2.provider);
|
|
131298
131308
|
const replay = buildHistoryReplayImport(args2.replayNotifications, {
|
|
131299
|
-
|
|
131309
|
+
provider: args2.provider,
|
|
131300
131310
|
userId: args2.userId,
|
|
131301
131311
|
now: () => nowIso,
|
|
131302
|
-
createId: () => `${
|
|
131312
|
+
createId: () => `${providerKey}:${args2.acpSessionId}:tmp:${tempId++}`,
|
|
131303
131313
|
mode: "imported_snapshot"
|
|
131304
131314
|
});
|
|
131305
131315
|
const turnHashes = replay.history.map(hashHistoryEntry);
|
|
131306
131316
|
const history = replay.history.map((entry2, index2) => ({
|
|
131307
131317
|
...entry2,
|
|
131308
|
-
id: `${
|
|
131318
|
+
id: `${providerKey}:${args2.acpSessionId}:turn:${index2}:${turnHashes[index2].slice(0, 16)}`
|
|
131309
131319
|
}));
|
|
131310
131320
|
return {
|
|
131311
131321
|
history,
|
|
@@ -131391,12 +131401,13 @@ ${escapeHtmlScriptContent(VISUAL_ANNOTATION_INSPECTOR_BROWSER_SCRIPT)}
|
|
|
131391
131401
|
}
|
|
131392
131402
|
function buildExistingHistorySessionIndex(metas, machineId, provider2) {
|
|
131393
131403
|
const index2 = /* @__PURE__ */ new Map();
|
|
131404
|
+
const providerKey = getLocalProjectHistoryProviderKey(provider2);
|
|
131394
131405
|
for (const entry2 of metas) {
|
|
131395
131406
|
if (entry2.meta.machineId !== machineId) continue;
|
|
131396
|
-
if (entry2.meta.cliType !==
|
|
131397
|
-
if (entry2.meta.agentType !== provider2) continue;
|
|
131407
|
+
if (entry2.meta.cliType !== provider2.cliType) continue;
|
|
131408
|
+
if (entry2.meta.agentType !== provider2.agentType) continue;
|
|
131398
131409
|
const acpSessionIds = /* @__PURE__ */ new Set();
|
|
131399
|
-
if (entry2.meta.externalHistory
|
|
131410
|
+
if (entry2.meta.externalHistory && getLocalProjectHistoryProviderKey(entry2.meta.externalHistory.provider) === providerKey) {
|
|
131400
131411
|
const sourceAcpSessionId = entry2.meta.externalHistory.sourceAcpSessionId;
|
|
131401
131412
|
if (sourceAcpSessionId) {
|
|
131402
131413
|
acpSessionIds.add(sourceAcpSessionId);
|
|
@@ -131414,7 +131425,7 @@ ${escapeHtmlScriptContent(VISUAL_ANNOTATION_INSPECTOR_BROWSER_SCRIPT)}
|
|
|
131414
131425
|
return index2;
|
|
131415
131426
|
}
|
|
131416
131427
|
function getProviderLabel(provider2) {
|
|
131417
|
-
return provider2
|
|
131428
|
+
return getLocalProjectHistoryProviderKey(provider2);
|
|
131418
131429
|
}
|
|
131419
131430
|
function resolveSessionTitle(info, provider2) {
|
|
131420
131431
|
const title2 = info.title?.trim();
|
|
@@ -131468,7 +131479,7 @@ ${escapeHtmlScriptContent(VISUAL_ANNOTATION_INSPECTOR_BROWSER_SCRIPT)}
|
|
|
131468
131479
|
function buildExternalHistoryMeta(args2) {
|
|
131469
131480
|
return {
|
|
131470
131481
|
provider: args2.provider,
|
|
131471
|
-
source:
|
|
131482
|
+
source: "local-acp-history",
|
|
131472
131483
|
sourceAcpSessionId: args2.sourceAcpSessionId,
|
|
131473
131484
|
sourceUpdatedAt: args2.sourceUpdatedAt ?? void 0,
|
|
131474
131485
|
replayDigest: args2.materialized.replayDigest,
|
|
@@ -131482,7 +131493,7 @@ ${escapeHtmlScriptContent(VISUAL_ANNOTATION_INSPECTOR_BROWSER_SCRIPT)}
|
|
|
131482
131493
|
function buildMetadataOnlyExternalHistoryMeta(args2) {
|
|
131483
131494
|
return {
|
|
131484
131495
|
provider: args2.provider,
|
|
131485
|
-
source:
|
|
131496
|
+
source: "local-acp-history",
|
|
131486
131497
|
sourceAcpSessionId: args2.sourceAcpSessionId,
|
|
131487
131498
|
sourceUpdatedAt: args2.sourceUpdatedAt ?? void 0,
|
|
131488
131499
|
importedTurnCount: 0,
|
|
@@ -131492,15 +131503,17 @@ ${escapeHtmlScriptContent(VISUAL_ANNOTATION_INSPECTOR_BROWSER_SCRIPT)}
|
|
|
131492
131503
|
};
|
|
131493
131504
|
}
|
|
131494
131505
|
class LocalProjectHistorySyncService {
|
|
131495
|
-
constructor(manager, logger2, context2, provider2
|
|
131506
|
+
constructor(manager, logger2, context2, provider2) {
|
|
131496
131507
|
this.manager = manager;
|
|
131497
131508
|
this.logger = logger2;
|
|
131498
131509
|
this.context = context2;
|
|
131499
131510
|
this.provider = provider2;
|
|
131511
|
+
this.providerKey = getLocalProjectHistoryProviderKey(provider2);
|
|
131500
131512
|
}
|
|
131501
131513
|
provider;
|
|
131514
|
+
providerKey;
|
|
131502
131515
|
async syncLocalProject(args2) {
|
|
131503
|
-
const leaseKey = `${this.
|
|
131516
|
+
const leaseKey = `${this.providerKey}:${this.context.workspaceId}:${this.context.machineId}:${args2.localProjectId}`;
|
|
131504
131517
|
if (syncLeases.has(leaseKey)) {
|
|
131505
131518
|
throw new Error(`${getProviderLabel(this.provider)} history sync is already running for this local project`);
|
|
131506
131519
|
}
|
|
@@ -131520,7 +131533,7 @@ ${escapeHtmlScriptContent(VISUAL_ANNOTATION_INSPECTOR_BROWSER_SCRIPT)}
|
|
|
131520
131533
|
});
|
|
131521
131534
|
}
|
|
131522
131535
|
async importLocalProjectSessions(args2) {
|
|
131523
|
-
const leaseKey = `${this.
|
|
131536
|
+
const leaseKey = `${this.providerKey}:${this.context.workspaceId}:${this.context.machineId}:${args2.localProjectId}`;
|
|
131524
131537
|
if (syncLeases.has(leaseKey)) {
|
|
131525
131538
|
throw new Error(`${getProviderLabel(this.provider)} history sync is already running for this local project`);
|
|
131526
131539
|
}
|
|
@@ -131577,7 +131590,7 @@ ${escapeHtmlScriptContent(VISUAL_ANNOTATION_INSPECTOR_BROWSER_SCRIPT)}
|
|
|
131577
131590
|
acpSessionId,
|
|
131578
131591
|
message: formatErrorMessage(error2)
|
|
131579
131592
|
});
|
|
131580
|
-
this.logger.debug(`[${this.
|
|
131593
|
+
this.logger.debug(`[${this.providerKey}-history-sync] Failed to import ${getProviderLabel(this.provider)} session ${acpSessionId}: ${formatErrorMessage(error2)}`);
|
|
131581
131594
|
}
|
|
131582
131595
|
}
|
|
131583
131596
|
const catalog = await this.writeCatalogResult({
|
|
@@ -131627,7 +131640,7 @@ ${escapeHtmlScriptContent(VISUAL_ANNOTATION_INSPECTOR_BROWSER_SCRIPT)}
|
|
|
131627
131640
|
...previous,
|
|
131628
131641
|
history: {
|
|
131629
131642
|
...previous.history ?? {},
|
|
131630
|
-
[this.
|
|
131643
|
+
[this.providerKey]: {
|
|
131631
131644
|
lastListedAt,
|
|
131632
131645
|
sessions: Object.fromEntries(sessions.map((item) => [
|
|
131633
131646
|
item.acpSessionId,
|
|
@@ -131653,9 +131666,9 @@ ${escapeHtmlScriptContent(VISUAL_ANNOTATION_INSPECTOR_BROWSER_SCRIPT)}
|
|
|
131653
131666
|
userId: this.context.userId,
|
|
131654
131667
|
status: SessionStatusFactory.idle(),
|
|
131655
131668
|
isArchived: false,
|
|
131656
|
-
origin:
|
|
131657
|
-
cliType:
|
|
131658
|
-
agentType: this.provider,
|
|
131669
|
+
origin: "external-acp",
|
|
131670
|
+
cliType: this.provider.cliType,
|
|
131671
|
+
agentType: this.provider.agentType,
|
|
131659
131672
|
project: args2.project,
|
|
131660
131673
|
title: resolveSessionTitle(args2.info, this.provider),
|
|
131661
131674
|
lastMessageAt,
|
|
@@ -131673,7 +131686,7 @@ ${escapeHtmlScriptContent(VISUAL_ANNOTATION_INSPECTOR_BROWSER_SCRIPT)}
|
|
|
131673
131686
|
}
|
|
131674
131687
|
async refreshExistingSession(args2) {
|
|
131675
131688
|
const externalHistory = args2.existing.meta.externalHistory;
|
|
131676
|
-
if (externalHistory
|
|
131689
|
+
if (!externalHistory || getLocalProjectHistoryProviderKey(externalHistory.provider) !== this.providerKey) {
|
|
131677
131690
|
return "skipped";
|
|
131678
131691
|
}
|
|
131679
131692
|
if (shouldSkipBySourceUpdatedAt(args2.info, externalHistory)) {
|
|
@@ -131698,7 +131711,7 @@ ${escapeHtmlScriptContent(VISUAL_ANNOTATION_INSPECTOR_BROWSER_SCRIPT)}
|
|
|
131698
131711
|
});
|
|
131699
131712
|
if (replayDecision.reason === "digest_match") {
|
|
131700
131713
|
await this.manager.repo.upsertDocMeta(getSessionRoomId(args2.existing.sessionId), {
|
|
131701
|
-
origin:
|
|
131714
|
+
origin: "external-acp",
|
|
131702
131715
|
externalHistory: buildExternalHistoryMeta({
|
|
131703
131716
|
provider: this.provider,
|
|
131704
131717
|
sourceAcpSessionId: args2.acpSessionId,
|
|
@@ -131724,7 +131737,7 @@ ${escapeHtmlScriptContent(VISUAL_ANNOTATION_INSPECTOR_BROWSER_SCRIPT)}
|
|
|
131724
131737
|
await this.markConflict(args2.existing.sessionId, args2.info, materialized, appendDecision.reason);
|
|
131725
131738
|
const synced2 = await sessionDoc.waitUntilSynced();
|
|
131726
131739
|
if (!synced2) {
|
|
131727
|
-
this.logger.debug(`[${this.
|
|
131740
|
+
this.logger.debug(`[${this.providerKey}-history-sync] Conflict marker for ${args2.existing.sessionId} did not confirm sync before unload; clients may see the previous state until next sync.`);
|
|
131728
131741
|
}
|
|
131729
131742
|
await this.manager.cleanSessionDoc(args2.existing.sessionId, {
|
|
131730
131743
|
preserveStatus: true
|
|
@@ -131737,7 +131750,7 @@ ${escapeHtmlScriptContent(VISUAL_ANNOTATION_INSPECTOR_BROWSER_SCRIPT)}
|
|
|
131737
131750
|
...suffix
|
|
131738
131751
|
]);
|
|
131739
131752
|
await this.manager.repo.upsertDocMeta(getSessionRoomId(args2.existing.sessionId), {
|
|
131740
|
-
origin:
|
|
131753
|
+
origin: "external-acp",
|
|
131741
131754
|
lastMessageAt: resolveSourceUpdatedAtMs(args2.info, getServerNow()),
|
|
131742
131755
|
externalHistory: buildExternalHistoryMeta({
|
|
131743
131756
|
provider: this.provider,
|
|
@@ -131748,7 +131761,7 @@ ${escapeHtmlScriptContent(VISUAL_ANNOTATION_INSPECTOR_BROWSER_SCRIPT)}
|
|
|
131748
131761
|
});
|
|
131749
131762
|
const synced = await sessionDoc.waitUntilSynced();
|
|
131750
131763
|
if (!synced) {
|
|
131751
|
-
this.logger.debug(`[${this.
|
|
131764
|
+
this.logger.debug(`[${this.providerKey}-history-sync] Appended history for ${args2.existing.sessionId} did not confirm sync before unload; other clients may see the previous state until next sync.`);
|
|
131752
131765
|
}
|
|
131753
131766
|
await this.manager.cleanSessionDoc(args2.existing.sessionId, {
|
|
131754
131767
|
preserveStatus: true
|
|
@@ -131757,7 +131770,7 @@ ${escapeHtmlScriptContent(VISUAL_ANNOTATION_INSPECTOR_BROWSER_SCRIPT)}
|
|
|
131757
131770
|
}
|
|
131758
131771
|
async markConflict(sessionId, info, materialized, reason) {
|
|
131759
131772
|
await this.manager.repo.upsertDocMeta(getSessionRoomId(sessionId), {
|
|
131760
|
-
origin:
|
|
131773
|
+
origin: "external-acp",
|
|
131761
131774
|
externalHistory: buildExternalHistoryMeta({
|
|
131762
131775
|
provider: this.provider,
|
|
131763
131776
|
sourceAcpSessionId: info.sessionId,
|
|
@@ -134545,8 +134558,15 @@ ${escapeHtmlScriptContent(VISUAL_ANNOTATION_INSPECTOR_BROWSER_SCRIPT)}
|
|
|
134545
134558
|
if (meta.processingUserMsgId) {
|
|
134546
134559
|
return true;
|
|
134547
134560
|
}
|
|
134561
|
+
if (meta.lastGoalCommand) {
|
|
134562
|
+
return true;
|
|
134563
|
+
}
|
|
134548
134564
|
return Boolean(meta.latestUserMsgId && meta.latestUserMsgId !== meta.lastHandledUserMsgId);
|
|
134549
134565
|
}
|
|
134566
|
+
async hasActiveGoal(sessionId) {
|
|
134567
|
+
const meta = (await this.workspaceDocument.repo.getDocMeta(getSessionRoomId(sessionId)))?.meta;
|
|
134568
|
+
return isSessionGoalWorking(meta?.latestGoal);
|
|
134569
|
+
}
|
|
134550
134570
|
isArchiveInFlight(sessionId) {
|
|
134551
134571
|
return this.archiveInFlight.has(sessionId);
|
|
134552
134572
|
}
|
|
@@ -135124,6 +135144,9 @@ ${escapeHtmlScriptContent(VISUAL_ANNOTATION_INSPECTOR_BROWSER_SCRIPT)}
|
|
|
135124
135144
|
if (this.deps.hasActiveTurn(sessionId)) {
|
|
135125
135145
|
return false;
|
|
135126
135146
|
}
|
|
135147
|
+
if (await this.deps.hasActiveGoal(sessionId)) {
|
|
135148
|
+
return false;
|
|
135149
|
+
}
|
|
135127
135150
|
if (this.deps.hasPendingUpdates(sessionId)) {
|
|
135128
135151
|
return false;
|
|
135129
135152
|
}
|
|
@@ -135263,6 +135286,7 @@ ${escapeHtmlScriptContent(VISUAL_ANNOTATION_INSPECTOR_BROWSER_SCRIPT)}
|
|
|
135263
135286
|
this.gcManager = new SessionGCManager(gcConfig, {
|
|
135264
135287
|
getSessionLastActivity: (sessionId) => handler.getLastActivity(sessionId),
|
|
135265
135288
|
hasActiveTurn: (sessionId) => handler.hasActiveTurn(sessionId),
|
|
135289
|
+
hasActiveGoal: async (sessionId) => await handler.hasActiveGoal(sessionId),
|
|
135266
135290
|
hasPendingUpdates: (sessionId) => handler.hasPendingUpdates(sessionId),
|
|
135267
135291
|
hasPendingUserWork: async (sessionId) => await handler.hasPendingUserWork(sessionId),
|
|
135268
135292
|
isArchiveInFlight: (sessionId) => handler.isArchiveInFlight(sessionId),
|
|
@@ -144598,7 +144622,8 @@ export PATH=${toSingleQuotedShellString(ghShimBinDir)}:"$PATH"
|
|
|
144598
144622
|
const existing = rawExisting && typeof rawExisting === "object" ? rawExisting : {};
|
|
144599
144623
|
const previous = existing[entry2.localProjectId];
|
|
144600
144624
|
const nowMs = getServerNow();
|
|
144601
|
-
|
|
144625
|
+
const repo = runtime.lody.documentManager.repo;
|
|
144626
|
+
await repo.upsertDocMeta(machineRoomId, {
|
|
144602
144627
|
localProjects: {
|
|
144603
144628
|
...existing,
|
|
144604
144629
|
[entry2.localProjectId]: {
|
|
@@ -144624,7 +144649,8 @@ export PATH=${toSingleQuotedShellString(ghShimBinDir)}:"$PATH"
|
|
|
144624
144649
|
...existing
|
|
144625
144650
|
};
|
|
144626
144651
|
delete next[localProjectId];
|
|
144627
|
-
|
|
144652
|
+
const repo = runtime.lody.documentManager.repo;
|
|
144653
|
+
await repo.upsertDocMeta(machineRoomId, {
|
|
144628
144654
|
localProjects: next
|
|
144629
144655
|
});
|
|
144630
144656
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lody",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.52.0",
|
|
4
4
|
"description": "Lody Agent CLI tool for managing remote command execution",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -20,11 +20,11 @@
|
|
|
20
20
|
"node": ">=18.0.0"
|
|
21
21
|
},
|
|
22
22
|
"optionalDependencies": {
|
|
23
|
-
"acp-extension-claude": "0.
|
|
23
|
+
"acp-extension-claude": "0.34.1",
|
|
24
24
|
"acp-extension-codex": "0.14.3"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@agentclientprotocol/sdk": "^0.
|
|
27
|
+
"@agentclientprotocol/sdk": "^0.21.0",
|
|
28
28
|
"@better-auth/api-key": "1.5.5",
|
|
29
29
|
"@convex-dev/better-auth": "0.11.2",
|
|
30
30
|
"@loro-dev/flock-wasm": "^0.3.3",
|
|
@@ -76,8 +76,8 @@
|
|
|
76
76
|
"@lody/cli-supervisor": "0.0.1",
|
|
77
77
|
"@lody/convex": "0.0.1",
|
|
78
78
|
"@lody/loro-streams-rpc": "0.0.1",
|
|
79
|
-
"
|
|
80
|
-
"
|
|
79
|
+
"loro-code": "0.0.1",
|
|
80
|
+
"@lody/shared": "0.0.1"
|
|
81
81
|
},
|
|
82
82
|
"files": [
|
|
83
83
|
"dist",
|