@adhdev/daemon-core 0.9.82-rc.472 → 0.9.82-rc.474
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.d.ts +4 -2
- package/dist/index.js +204 -58
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +200 -58
- package/dist/index.mjs.map +1 -1
- package/dist/mesh/mesh-missions.d.ts +55 -0
- package/package.json +3 -3
- package/src/index.ts +7 -2
- package/src/mesh/mesh-completion-synthesis.ts +19 -1
- package/src/mesh/mesh-events-stale.ts +13 -1
- package/src/mesh/mesh-missions.ts +127 -0
- package/src/providers/native-history/antigravity-cli-transcript.ts +138 -56
package/dist/index.d.ts
CHANGED
|
@@ -37,8 +37,8 @@ export { normalizeMeshNodeId, meshNodeIdMatches } from '@adhdev/mesh-shared';
|
|
|
37
37
|
export { CANONICAL_MESH_TOOL_NAMES, CANONICAL_MESH_TOOL_COUNT } from '@adhdev/mesh-shared';
|
|
38
38
|
export type { CanonicalMeshToolName } from '@adhdev/mesh-shared';
|
|
39
39
|
export { buildCoordinatorSystemPrompt } from './mesh/coordinator-prompt.js';
|
|
40
|
-
export { upsertMeshMission, getMeshMissions, getMeshMission, summarizeMissionTasks, summarizeMeshMission, getActiveMeshMissionSummaries, getMeshStatusMissionSummaries, getMeshStatusMissionsCompact, listMeshMissionSummaries, buildMissionPromptSection, GOAL_PREVIEW_MAX, COMPACT_STATUS_GOAL_PREVIEW_MAX, MESH_MISSION_STATUSES } from './mesh/mesh-missions.js';
|
|
41
|
-
export type { MeshMissionRecord, MeshMissionStatus, MeshMissionSummary, MeshMissionSlimSummary, MeshMissionTaskAggregate, MeshStatusMissionsCompact, MeshStatusMissionsHistoryFold } from './mesh/mesh-missions.js';
|
|
40
|
+
export { upsertMeshMission, getMeshMissions, getMeshMission, summarizeMissionTasks, summarizeMeshMission, getActiveMeshMissionSummaries, getMeshStatusMissionSummaries, getMeshStatusMissionsCompact, listMeshMissionSummaries, listMeshMissionsForTool, buildMissionPromptSection, GOAL_PREVIEW_MAX, COMPACT_STATUS_GOAL_PREVIEW_MAX, MESH_MISSION_LIST_HISTORY_ID_LIMIT, MESH_MISSION_LIST_STATUS_LIMIT, MESH_MISSION_STATUSES } from './mesh/mesh-missions.js';
|
|
41
|
+
export type { MeshMissionRecord, MeshMissionStatus, MeshMissionSummary, MeshMissionSlimSummary, MeshMissionTaskAggregate, MeshStatusMissionsCompact, MeshStatusMissionsHistoryFold, MeshMissionListResult } from './mesh/mesh-missions.js';
|
|
42
42
|
export { computeMeshTaskStats, computeMeshMissionStats } from './mesh/mesh-task-stats.js';
|
|
43
43
|
export type { MeshTaskStats, MeshMissionStats } from './mesh/mesh-task-stats.js';
|
|
44
44
|
export { deriveMeshReviewInboxItems } from './mesh/mesh-review-inbox.js';
|
|
@@ -71,6 +71,8 @@ export type { MeshSchedulingRuntime, MeshNodeSchedulingRuntime, MeshNodeProvider
|
|
|
71
71
|
export { buildMeshHostRequiredFailure, createDefaultMeshHostMetadata, isMeshHostOwner, normalizeMeshDaemonRole, requireMeshHostQueueOwner, resolveMeshHostStatus } from './mesh/mesh-host-ownership.js';
|
|
72
72
|
export { triggerMeshQueue, drainPendingMeshCoordinatorEvents, getPendingMeshCoordinatorEvents, clearPendingMeshCoordinatorEvents, queuePendingMeshCoordinatorEvent, requeueHeldMeshCoordinatorEvents, serializeV2EnvelopeToWire, readV2EnvelopeFromWire, reconcileDirectDispatchCompletionFromTranscript } from './mesh/mesh-events.js';
|
|
73
73
|
export type { PendingMeshCoordinatorEvent, MeshHeldEventRequeueFilter, MeshHeldEventRequeueResult } from './mesh/mesh-events.js';
|
|
74
|
+
export { coordinatorIdentityFromEmitFields } from './mesh/contracts.js';
|
|
75
|
+
export type { CoordinatorIdentity } from './mesh/contracts.js';
|
|
74
76
|
export { resolveMeshSurfacedSessionPreview, readMeshCompletionSummary, isWeakCompletionEvidence } from './mesh/mesh-events-utils.js';
|
|
75
77
|
export { resolveDeliveryDecision, createSessionDelivery, updateSessionDeliveryStatus, getActiveSessionDeliveries, markSessionDeliveriesTerminal } from './mesh/mesh-delivery-policy.js';
|
|
76
78
|
export type { MeshSessionDeliveryStatus, MeshSessionDeliveryKind, MeshDeliveryDecision, MeshDeliveryPolicyResult, SessionDeliveryRecord } from './mesh/mesh-delivery-policy.js';
|
package/dist/index.js
CHANGED
|
@@ -409,10 +409,10 @@ function readInjected(value) {
|
|
|
409
409
|
}
|
|
410
410
|
function getDaemonBuildInfo() {
|
|
411
411
|
if (cached) return cached;
|
|
412
|
-
const commit = readInjected(true ? "
|
|
413
|
-
const commitShort = readInjected(true ? "
|
|
414
|
-
const version = readInjected(true ? "0.9.82-rc.
|
|
415
|
-
const builtAt = readInjected(true ? "2026-07-
|
|
412
|
+
const commit = readInjected(true ? "cfb46b13fb8f556e4cb7179c4503ac3c86923d92" : void 0) ?? "unknown";
|
|
413
|
+
const commitShort = readInjected(true ? "cfb46b13" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
|
|
414
|
+
const version = readInjected(true ? "0.9.82-rc.474" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
|
|
415
|
+
const builtAt = readInjected(true ? "2026-07-06T03:34:46.223Z" : void 0);
|
|
416
416
|
cached = builtAt ? { commit, commitShort, version, builtAt } : { commit, commitShort, version };
|
|
417
417
|
return cached;
|
|
418
418
|
}
|
|
@@ -9129,6 +9129,8 @@ var mesh_missions_exports = {};
|
|
|
9129
9129
|
__export(mesh_missions_exports, {
|
|
9130
9130
|
COMPACT_STATUS_GOAL_PREVIEW_MAX: () => COMPACT_STATUS_GOAL_PREVIEW_MAX,
|
|
9131
9131
|
GOAL_PREVIEW_MAX: () => GOAL_PREVIEW_MAX,
|
|
9132
|
+
MESH_MISSION_LIST_HISTORY_ID_LIMIT: () => MESH_MISSION_LIST_HISTORY_ID_LIMIT,
|
|
9133
|
+
MESH_MISSION_LIST_STATUS_LIMIT: () => MESH_MISSION_LIST_STATUS_LIMIT,
|
|
9132
9134
|
MESH_MISSION_STATUSES: () => MESH_MISSION_STATUSES,
|
|
9133
9135
|
buildMissionPromptSection: () => buildMissionPromptSection,
|
|
9134
9136
|
getActiveMeshMissionSummaries: () => getActiveMeshMissionSummaries,
|
|
@@ -9138,6 +9140,7 @@ __export(mesh_missions_exports, {
|
|
|
9138
9140
|
getMeshStatusMissionsCompact: () => getMeshStatusMissionsCompact,
|
|
9139
9141
|
isMissionAllTasksTerminal: () => isMissionAllTasksTerminal,
|
|
9140
9142
|
listMeshMissionSummaries: () => listMeshMissionSummaries,
|
|
9143
|
+
listMeshMissionsForTool: () => listMeshMissionsForTool,
|
|
9141
9144
|
maybeEmitMissionCloseCandidate: () => maybeEmitMissionCloseCandidate,
|
|
9142
9145
|
summarizeMeshMission: () => summarizeMeshMission,
|
|
9143
9146
|
summarizeMissionTasks: () => summarizeMissionTasks,
|
|
@@ -9370,6 +9373,61 @@ function listMeshMissionSummaries(meshId, options) {
|
|
|
9370
9373
|
const full = missions.map((mission) => summarizeMeshMission(meshId, mission));
|
|
9371
9374
|
return options?.verbose ? full : full.map((summary) => slimMissionSummary(summary));
|
|
9372
9375
|
}
|
|
9376
|
+
function listMeshMissionsForTool(meshId, options) {
|
|
9377
|
+
const explicitStatuses = options?.statuses && options.statuses.length > 0 ? options.statuses : void 0;
|
|
9378
|
+
const includeMagi = options?.includeMagi === true;
|
|
9379
|
+
const verbose = options?.verbose === true;
|
|
9380
|
+
const withStats = options?.withStats === true;
|
|
9381
|
+
const limit = Math.max(1, options?.limit ?? MESH_MISSION_LIST_STATUS_LIMIT);
|
|
9382
|
+
const historyIdLimit = Math.max(0, options?.historyIdLimit ?? MESH_MISSION_LIST_HISTORY_ID_LIMIT);
|
|
9383
|
+
const passesMagi = (m) => includeMagi || !(m.source === "magi" && m.status === "completed");
|
|
9384
|
+
const byUpdatedDesc = (a, b) => (b.updatedAt || "").localeCompare(a.updatedAt || "");
|
|
9385
|
+
const project = (mission) => {
|
|
9386
|
+
let summary = summarizeMeshMission(meshId, mission);
|
|
9387
|
+
if (withStats) {
|
|
9388
|
+
try {
|
|
9389
|
+
summary = { ...summary, stats: computeMeshMissionStats(meshId, mission.id) };
|
|
9390
|
+
} catch {
|
|
9391
|
+
}
|
|
9392
|
+
}
|
|
9393
|
+
return verbose ? summary : slimMissionSummary(summary);
|
|
9394
|
+
};
|
|
9395
|
+
const foldHistory = (history2) => {
|
|
9396
|
+
if (history2.length === 0) return null;
|
|
9397
|
+
const byStatus = {};
|
|
9398
|
+
for (const m of history2) byStatus[m.status] = (byStatus[m.status] ?? 0) + 1;
|
|
9399
|
+
return {
|
|
9400
|
+
count: history2.length,
|
|
9401
|
+
byStatus,
|
|
9402
|
+
missionIds: history2.slice(0, historyIdLimit).map((m) => m.id),
|
|
9403
|
+
note: 'Completed/abandoned missions are folded to counts + ids. Pass status (e.g. status:["completed"]) to list them in detail.'
|
|
9404
|
+
};
|
|
9405
|
+
};
|
|
9406
|
+
if (explicitStatuses) {
|
|
9407
|
+
const matched = getMeshMissions(meshId, explicitStatuses).filter(passesMagi).sort(byUpdatedDesc);
|
|
9408
|
+
const shown2 = matched.slice(0, limit);
|
|
9409
|
+
const overflow2 = matched.slice(limit);
|
|
9410
|
+
return {
|
|
9411
|
+
missions: shown2.map(project),
|
|
9412
|
+
historyFold: null,
|
|
9413
|
+
truncated: overflow2.length > 0,
|
|
9414
|
+
matched: matched.length,
|
|
9415
|
+
...overflow2.length > 0 ? { overflowIds: overflow2.map((m) => m.id) } : {}
|
|
9416
|
+
};
|
|
9417
|
+
}
|
|
9418
|
+
const all = getMeshMissions(meshId).filter(passesMagi);
|
|
9419
|
+
const live = all.filter((m) => m.status === "active" || m.status === "paused").sort(byUpdatedDesc);
|
|
9420
|
+
const history = all.filter((m) => m.status === "completed" || m.status === "abandoned").sort(byUpdatedDesc);
|
|
9421
|
+
const shown = live.slice(0, limit);
|
|
9422
|
+
const overflow = live.slice(limit);
|
|
9423
|
+
return {
|
|
9424
|
+
missions: shown.map(project),
|
|
9425
|
+
historyFold: foldHistory(history),
|
|
9426
|
+
truncated: overflow.length > 0,
|
|
9427
|
+
matched: live.length,
|
|
9428
|
+
...overflow.length > 0 ? { overflowIds: overflow.map((m) => m.id) } : {}
|
|
9429
|
+
};
|
|
9430
|
+
}
|
|
9373
9431
|
function buildMissionPromptSection(meshId) {
|
|
9374
9432
|
const summaries = getActiveMeshMissionSummaries(meshId);
|
|
9375
9433
|
if (summaries.length === 0) return "";
|
|
@@ -9388,7 +9446,7 @@ function buildMissionPromptSection(meshId) {
|
|
|
9388
9446
|
);
|
|
9389
9447
|
return lines.join("\n");
|
|
9390
9448
|
}
|
|
9391
|
-
var import_crypto8, LEDGER_GOAL_SUMMARY_MAX, MESH_MISSION_STATUSES, GOAL_PREVIEW_MAX, COMPACT_STATUS_GOAL_PREVIEW_MAX;
|
|
9449
|
+
var import_crypto8, LEDGER_GOAL_SUMMARY_MAX, MESH_MISSION_STATUSES, GOAL_PREVIEW_MAX, COMPACT_STATUS_GOAL_PREVIEW_MAX, MESH_MISSION_LIST_HISTORY_ID_LIMIT, MESH_MISSION_LIST_STATUS_LIMIT;
|
|
9392
9450
|
var init_mesh_missions = __esm({
|
|
9393
9451
|
"src/mesh/mesh-missions.ts"() {
|
|
9394
9452
|
"use strict";
|
|
@@ -9403,6 +9461,8 @@ var init_mesh_missions = __esm({
|
|
|
9403
9461
|
MESH_MISSION_STATUSES = ["active", "paused", "completed", "abandoned"];
|
|
9404
9462
|
GOAL_PREVIEW_MAX = 120;
|
|
9405
9463
|
COMPACT_STATUS_GOAL_PREVIEW_MAX = 80;
|
|
9464
|
+
MESH_MISSION_LIST_HISTORY_ID_LIMIT = 30;
|
|
9465
|
+
MESH_MISSION_LIST_STATUS_LIMIT = 50;
|
|
9406
9466
|
}
|
|
9407
9467
|
});
|
|
9408
9468
|
|
|
@@ -12885,6 +12945,7 @@ function reconcileDirectDispatchCompletionFromTranscript(args) {
|
|
|
12885
12945
|
}
|
|
12886
12946
|
};
|
|
12887
12947
|
const targetCoordinatorSessionId = readNonEmptyString2(args.targetCoordinatorSessionId) || readNonEmptyString2(dispatch?.payload?.coordinatorSessionId);
|
|
12948
|
+
const targetCoordinatorDaemonId = readNonEmptyString2(dispatch?.payload?.coordinatorDaemonId) || readNonEmptyString2(args.targetCoordinatorDaemonId);
|
|
12888
12949
|
queuePendingMeshCoordinatorEvent({
|
|
12889
12950
|
event: eventName,
|
|
12890
12951
|
meshId: args.meshId,
|
|
@@ -12893,7 +12954,7 @@ function reconcileDirectDispatchCompletionFromTranscript(args) {
|
|
|
12893
12954
|
metadataEvent,
|
|
12894
12955
|
coordinatorMessage: buildMeshSystemMessage({ event: eventName, nodeLabel, metadataEvent }),
|
|
12895
12956
|
queuedAt: Date.now(),
|
|
12896
|
-
...
|
|
12957
|
+
...targetCoordinatorDaemonId ? { targetCoordinatorDaemonId } : {},
|
|
12897
12958
|
...targetCoordinatorSessionId ? { targetCoordinatorSessionId } : {}
|
|
12898
12959
|
});
|
|
12899
12960
|
recordSynthCompletionGateTrace("synth-fire", {
|
|
@@ -20615,7 +20676,11 @@ async function reconcileUnterminatedDirectDispatches(components, mesh, selfIds,
|
|
|
20615
20676
|
continue;
|
|
20616
20677
|
}
|
|
20617
20678
|
const providerSessionId = readNonEmptyString2(payload.providerSessionId);
|
|
20618
|
-
const
|
|
20679
|
+
const workerSession = components.instanceManager.getInstance(sessionId);
|
|
20680
|
+
const workerCoordinatorDaemonId = readNonEmptyString2(
|
|
20681
|
+
workerSession?.getState()?.settings?.meshCoordinatorDaemonId
|
|
20682
|
+
);
|
|
20683
|
+
const coordinatorDaemonId = workerCoordinatorDaemonId || selfIds.find((id) => !!id);
|
|
20619
20684
|
try {
|
|
20620
20685
|
const result = reconcileDirectDispatchCompletionFromTranscript({
|
|
20621
20686
|
meshId: mesh.id,
|
|
@@ -20626,6 +20691,8 @@ async function reconcileUnterminatedDirectDispatches(components, mesh, selfIds,
|
|
|
20626
20691
|
taskId,
|
|
20627
20692
|
finalSummary: evidence.finalSummary,
|
|
20628
20693
|
...evidence.transcriptMessageAt ? { transcriptMessageAt: evidence.transcriptMessageAt } : {},
|
|
20694
|
+
// The ledger-recovered dispatching-coordinator daemon (inside the reconcile fn)
|
|
20695
|
+
// takes PRIORITY over this arg; this remains the best-available fallback.
|
|
20629
20696
|
...coordinatorDaemonId ? { targetCoordinatorDaemonId: coordinatorDaemonId } : {},
|
|
20630
20697
|
source: "daemon_reconcile_transcript_completion"
|
|
20631
20698
|
});
|
|
@@ -27107,6 +27174,8 @@ __export(index_exports, {
|
|
|
27107
27174
|
MESH_CONVERGE_REFINE_TAG: () => MESH_CONVERGE_REFINE_TAG,
|
|
27108
27175
|
MESH_MAX_PARALLEL_TASKS_MAX: () => MESH_MAX_PARALLEL_TASKS_MAX,
|
|
27109
27176
|
MESH_MAX_PARALLEL_TASKS_MIN: () => MESH_MAX_PARALLEL_TASKS_MIN,
|
|
27177
|
+
MESH_MISSION_LIST_HISTORY_ID_LIMIT: () => MESH_MISSION_LIST_HISTORY_ID_LIMIT,
|
|
27178
|
+
MESH_MISSION_LIST_STATUS_LIMIT: () => MESH_MISSION_LIST_STATUS_LIMIT,
|
|
27110
27179
|
MESH_MISSION_STATUSES: () => MESH_MISSION_STATUSES,
|
|
27111
27180
|
MESH_NODE_LIVE_TRUTH_MARKER: () => MESH_NODE_LIVE_TRUTH_MARKER,
|
|
27112
27181
|
MESH_REFINE_CONFIG_LOCATIONS: () => MESH_REFINE_CONFIG_LOCATIONS,
|
|
@@ -27196,6 +27265,7 @@ __export(index_exports, {
|
|
|
27196
27265
|
computeMeshTaskStats: () => computeMeshTaskStats,
|
|
27197
27266
|
configureDebugTraceStore: () => configureDebugTraceStore,
|
|
27198
27267
|
connectCdpManager: () => connectCdpManager,
|
|
27268
|
+
coordinatorIdentityFromEmitFields: () => coordinatorIdentityFromEmitFields,
|
|
27199
27269
|
createDebugTraceStore: () => createDebugTraceStore,
|
|
27200
27270
|
createDefaultGitCommandServices: () => createDefaultGitCommandServices,
|
|
27201
27271
|
createDefaultMeshHostMetadata: () => createDefaultMeshHostMetadata,
|
|
@@ -27312,6 +27382,7 @@ __export(index_exports, {
|
|
|
27312
27382
|
listMagiKindPanels: () => listMagiKindPanels,
|
|
27313
27383
|
listMagiPanels: () => listMagiPanels,
|
|
27314
27384
|
listMeshMissionSummaries: () => listMeshMissionSummaries,
|
|
27385
|
+
listMeshMissionsForTool: () => listMeshMissionsForTool,
|
|
27315
27386
|
listMeshes: () => listMeshes,
|
|
27316
27387
|
listWorktrees: () => listWorktrees,
|
|
27317
27388
|
loadChangeImpactConfig: () => loadChangeImpactConfig,
|
|
@@ -28835,6 +28906,7 @@ init_mesh_magi_status();
|
|
|
28835
28906
|
init_mesh_scheduling_runtime();
|
|
28836
28907
|
init_mesh_host_ownership();
|
|
28837
28908
|
init_mesh_events();
|
|
28909
|
+
init_contracts();
|
|
28838
28910
|
init_mesh_events_utils();
|
|
28839
28911
|
init_mesh_delivery_policy();
|
|
28840
28912
|
|
|
@@ -50448,6 +50520,35 @@ function historyJsonlPath() {
|
|
|
50448
50520
|
function brainRoot() {
|
|
50449
50521
|
return path32.join(antigravityRoot(), "brain");
|
|
50450
50522
|
}
|
|
50523
|
+
function conversationsRoot() {
|
|
50524
|
+
return path32.join(antigravityRoot(), "conversations");
|
|
50525
|
+
}
|
|
50526
|
+
function resolvePathInside(root, ...segments) {
|
|
50527
|
+
const rootPath = path32.resolve(root);
|
|
50528
|
+
const targetPath = path32.resolve(rootPath, ...segments);
|
|
50529
|
+
if (targetPath !== rootPath && !targetPath.startsWith(rootPath + path32.sep)) return null;
|
|
50530
|
+
return targetPath;
|
|
50531
|
+
}
|
|
50532
|
+
function findBrainTranscriptPath(sessionId) {
|
|
50533
|
+
if (!isUuidLike(sessionId)) return null;
|
|
50534
|
+
const logsRoot = resolvePathInside(brainRoot(), sessionId, ".system_generated", "logs");
|
|
50535
|
+
if (!logsRoot || !fs24.existsSync(logsRoot)) return null;
|
|
50536
|
+
const candidates = ["transcript_full.jsonl", "transcript.jsonl"].map((file) => resolvePathInside(logsRoot, file)).filter((p) => p !== null && fs24.existsSync(p));
|
|
50537
|
+
if (candidates.length === 0) {
|
|
50538
|
+
let entries = [];
|
|
50539
|
+
try {
|
|
50540
|
+
entries = fs24.readdirSync(logsRoot, { withFileTypes: true });
|
|
50541
|
+
} catch {
|
|
50542
|
+
return null;
|
|
50543
|
+
}
|
|
50544
|
+
const transcriptFiles = entries.filter((e) => e.isFile() && /^transcript.*\.jsonl$/.test(e.name)).map((e) => path32.join(logsRoot, e.name));
|
|
50545
|
+
if (transcriptFiles.length === 0) return null;
|
|
50546
|
+
transcriptFiles.sort((a, b) => statMtimeMs3(b) - statMtimeMs3(a));
|
|
50547
|
+
return transcriptFiles[0];
|
|
50548
|
+
}
|
|
50549
|
+
candidates.sort((a, b) => statMtimeMs3(b) - statMtimeMs3(a));
|
|
50550
|
+
return candidates[0];
|
|
50551
|
+
}
|
|
50451
50552
|
function extractUserRequestContent(content) {
|
|
50452
50553
|
const raw = content.trim();
|
|
50453
50554
|
const match = raw.match(/<USER_REQUEST>\s*([\s\S]*?)\s*<\/USER_REQUEST>/i);
|
|
@@ -50858,6 +50959,83 @@ function parseConversationDb(filePath, sessionId, workspace) {
|
|
|
50858
50959
|
}
|
|
50859
50960
|
return messages.length > 0 ? messages : null;
|
|
50860
50961
|
}
|
|
50962
|
+
function readHistoryJsonlSession(resolvedSessionId, workspace) {
|
|
50963
|
+
if (!isUuidLike(resolvedSessionId)) return null;
|
|
50964
|
+
const rows = readHistoryRows().filter((r) => r.conversationId === resolvedSessionId);
|
|
50965
|
+
if (rows.length === 0) return null;
|
|
50966
|
+
rows.sort((a, b) => a.receivedAt - b.receivedAt);
|
|
50967
|
+
const firstWorkspace = workspace || rows.find((r) => r.workspace)?.workspace || "";
|
|
50968
|
+
const messages = [];
|
|
50969
|
+
if (firstWorkspace) {
|
|
50970
|
+
messages.push({
|
|
50971
|
+
ts: new Date(rows[0].receivedAt).toISOString(),
|
|
50972
|
+
receivedAt: rows[0].receivedAt,
|
|
50973
|
+
role: "system",
|
|
50974
|
+
content: firstWorkspace,
|
|
50975
|
+
kind: "session_start",
|
|
50976
|
+
agent: "antigravity-cli",
|
|
50977
|
+
historySessionId: resolvedSessionId,
|
|
50978
|
+
workspace: firstWorkspace
|
|
50979
|
+
});
|
|
50980
|
+
}
|
|
50981
|
+
for (const row of rows) {
|
|
50982
|
+
const msg = {
|
|
50983
|
+
ts: new Date(row.receivedAt).toISOString(),
|
|
50984
|
+
receivedAt: row.receivedAt,
|
|
50985
|
+
role: "user",
|
|
50986
|
+
content: row.display,
|
|
50987
|
+
kind: "standard",
|
|
50988
|
+
agent: "antigravity-cli",
|
|
50989
|
+
historySessionId: resolvedSessionId
|
|
50990
|
+
};
|
|
50991
|
+
if (row.workspace) msg.workspace = row.workspace;
|
|
50992
|
+
messages.push(msg);
|
|
50993
|
+
}
|
|
50994
|
+
return {
|
|
50995
|
+
messages,
|
|
50996
|
+
providerSessionId: resolvedSessionId,
|
|
50997
|
+
source: "provider-native",
|
|
50998
|
+
sourcePath: historyJsonlPath(),
|
|
50999
|
+
sourceMtimeMs: statMtimeMs3(historyJsonlPath()),
|
|
51000
|
+
nativeHistoryCoverage: "partial",
|
|
51001
|
+
partialReason: "antigravity_cli_history_jsonl_contains_user_prompts_only"
|
|
51002
|
+
};
|
|
51003
|
+
}
|
|
51004
|
+
function readAntigravitySiblingFallback(sessionId, workspace) {
|
|
51005
|
+
if (!isUuidLike(sessionId)) return null;
|
|
51006
|
+
const brainPath = findBrainTranscriptPath(sessionId);
|
|
51007
|
+
if (brainPath && statMtimeMs3(brainPath) > 0) {
|
|
51008
|
+
const brainMessages = parseBrainTranscript(brainPath, sessionId, workspace);
|
|
51009
|
+
if (brainMessages && brainMessages.length > 0) {
|
|
51010
|
+
return {
|
|
51011
|
+
messages: brainMessages,
|
|
51012
|
+
providerSessionId: sessionId,
|
|
51013
|
+
source: "provider-native",
|
|
51014
|
+
sourcePath: brainPath,
|
|
51015
|
+
sourceMtimeMs: statMtimeMs3(brainPath),
|
|
51016
|
+
nativeHistoryCoverage: "full",
|
|
51017
|
+
workspace
|
|
51018
|
+
};
|
|
51019
|
+
}
|
|
51020
|
+
}
|
|
51021
|
+
const pbPath = resolvePathInside(conversationsRoot(), `${sessionId}.pb`);
|
|
51022
|
+
if (pbPath && fs24.existsSync(pbPath)) {
|
|
51023
|
+
const pbMessages = parsePbFile(pbPath, sessionId);
|
|
51024
|
+
if (pbMessages && pbMessages.length > 0) {
|
|
51025
|
+
return {
|
|
51026
|
+
messages: pbMessages,
|
|
51027
|
+
providerSessionId: sessionId,
|
|
51028
|
+
source: "provider-native",
|
|
51029
|
+
sourcePath: pbPath,
|
|
51030
|
+
sourceMtimeMs: statMtimeMs3(pbPath),
|
|
51031
|
+
nativeHistoryCoverage: "best-effort",
|
|
51032
|
+
partialReason: "antigravity_cli_pb_raw_text_extraction",
|
|
51033
|
+
workspace
|
|
51034
|
+
};
|
|
51035
|
+
}
|
|
51036
|
+
}
|
|
51037
|
+
return readHistoryJsonlSession(sessionId, workspace);
|
|
51038
|
+
}
|
|
50861
51039
|
function readSession3(sessionPath, sessionId, workspace) {
|
|
50862
51040
|
if (!sessionPath || !path32.isAbsolute(sessionPath)) return null;
|
|
50863
51041
|
if (!fs24.existsSync(sessionPath)) return null;
|
|
@@ -50884,16 +51062,20 @@ function readSession3(sessionPath, sessionId, workspace) {
|
|
|
50884
51062
|
const dbSessionId = sessionId || path32.basename(sessionPath, ".db");
|
|
50885
51063
|
if (!isUuidLike(dbSessionId)) return null;
|
|
50886
51064
|
const messages = parseConversationDb(sessionPath, dbSessionId, workspace);
|
|
50887
|
-
if (
|
|
50888
|
-
|
|
50889
|
-
|
|
50890
|
-
|
|
50891
|
-
|
|
50892
|
-
|
|
50893
|
-
|
|
50894
|
-
|
|
50895
|
-
|
|
50896
|
-
|
|
51065
|
+
if (messages && messages.length > 0) {
|
|
51066
|
+
return {
|
|
51067
|
+
messages,
|
|
51068
|
+
providerSessionId: dbSessionId,
|
|
51069
|
+
source: "provider-native",
|
|
51070
|
+
sourcePath: sessionPath,
|
|
51071
|
+
sourceMtimeMs,
|
|
51072
|
+
nativeHistoryCoverage: "full",
|
|
51073
|
+
workspace
|
|
51074
|
+
};
|
|
51075
|
+
}
|
|
51076
|
+
const siblingFallback = readAntigravitySiblingFallback(dbSessionId, workspace);
|
|
51077
|
+
if (siblingFallback) return siblingFallback;
|
|
51078
|
+
return null;
|
|
50897
51079
|
}
|
|
50898
51080
|
if (sessionPath.endsWith(".pb")) {
|
|
50899
51081
|
const pbSessionId = sessionId || path32.basename(sessionPath, ".pb");
|
|
@@ -50911,47 +51093,7 @@ function readSession3(sessionPath, sessionId, workspace) {
|
|
|
50911
51093
|
};
|
|
50912
51094
|
}
|
|
50913
51095
|
if (path32.basename(sessionPath) === "history.jsonl") {
|
|
50914
|
-
|
|
50915
|
-
if (!resolvedSessionId || !isUuidLike(resolvedSessionId)) return null;
|
|
50916
|
-
const rows = readHistoryRows().filter((r) => r.conversationId === resolvedSessionId);
|
|
50917
|
-
if (rows.length === 0) return null;
|
|
50918
|
-
rows.sort((a, b) => a.receivedAt - b.receivedAt);
|
|
50919
|
-
const firstWorkspace = workspace || rows.find((r) => r.workspace)?.workspace || "";
|
|
50920
|
-
const messages = [];
|
|
50921
|
-
if (firstWorkspace) {
|
|
50922
|
-
messages.push({
|
|
50923
|
-
ts: new Date(rows[0].receivedAt).toISOString(),
|
|
50924
|
-
receivedAt: rows[0].receivedAt,
|
|
50925
|
-
role: "system",
|
|
50926
|
-
content: firstWorkspace,
|
|
50927
|
-
kind: "session_start",
|
|
50928
|
-
agent: "antigravity-cli",
|
|
50929
|
-
historySessionId: resolvedSessionId,
|
|
50930
|
-
workspace: firstWorkspace
|
|
50931
|
-
});
|
|
50932
|
-
}
|
|
50933
|
-
for (const row of rows) {
|
|
50934
|
-
const msg = {
|
|
50935
|
-
ts: new Date(row.receivedAt).toISOString(),
|
|
50936
|
-
receivedAt: row.receivedAt,
|
|
50937
|
-
role: "user",
|
|
50938
|
-
content: row.display,
|
|
50939
|
-
kind: "standard",
|
|
50940
|
-
agent: "antigravity-cli",
|
|
50941
|
-
historySessionId: resolvedSessionId
|
|
50942
|
-
};
|
|
50943
|
-
if (row.workspace) msg.workspace = row.workspace;
|
|
50944
|
-
messages.push(msg);
|
|
50945
|
-
}
|
|
50946
|
-
return {
|
|
50947
|
-
messages,
|
|
50948
|
-
providerSessionId: resolvedSessionId,
|
|
50949
|
-
source: "provider-native",
|
|
50950
|
-
sourcePath: sessionPath,
|
|
50951
|
-
sourceMtimeMs,
|
|
50952
|
-
nativeHistoryCoverage: "partial",
|
|
50953
|
-
partialReason: "antigravity_cli_history_jsonl_contains_user_prompts_only"
|
|
50954
|
-
};
|
|
51096
|
+
return readHistoryJsonlSession(sessionId || "", workspace);
|
|
50955
51097
|
}
|
|
50956
51098
|
return null;
|
|
50957
51099
|
}
|
|
@@ -69219,6 +69361,8 @@ var V1_CONTRACT_VERSION = "1.0.0";
|
|
|
69219
69361
|
MESH_CONVERGE_REFINE_TAG,
|
|
69220
69362
|
MESH_MAX_PARALLEL_TASKS_MAX,
|
|
69221
69363
|
MESH_MAX_PARALLEL_TASKS_MIN,
|
|
69364
|
+
MESH_MISSION_LIST_HISTORY_ID_LIMIT,
|
|
69365
|
+
MESH_MISSION_LIST_STATUS_LIMIT,
|
|
69222
69366
|
MESH_MISSION_STATUSES,
|
|
69223
69367
|
MESH_NODE_LIVE_TRUTH_MARKER,
|
|
69224
69368
|
MESH_REFINE_CONFIG_LOCATIONS,
|
|
@@ -69308,6 +69452,7 @@ var V1_CONTRACT_VERSION = "1.0.0";
|
|
|
69308
69452
|
computeMeshTaskStats,
|
|
69309
69453
|
configureDebugTraceStore,
|
|
69310
69454
|
connectCdpManager,
|
|
69455
|
+
coordinatorIdentityFromEmitFields,
|
|
69311
69456
|
createDebugTraceStore,
|
|
69312
69457
|
createDefaultGitCommandServices,
|
|
69313
69458
|
createDefaultMeshHostMetadata,
|
|
@@ -69424,6 +69569,7 @@ var V1_CONTRACT_VERSION = "1.0.0";
|
|
|
69424
69569
|
listMagiKindPanels,
|
|
69425
69570
|
listMagiPanels,
|
|
69426
69571
|
listMeshMissionSummaries,
|
|
69572
|
+
listMeshMissionsForTool,
|
|
69427
69573
|
listMeshes,
|
|
69428
69574
|
listWorktrees,
|
|
69429
69575
|
loadChangeImpactConfig,
|