ai-project-manage-cli 8.1.17 → 8.1.19
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/worker-script.js +29 -16
- package/package.json +1 -1
package/dist/worker-script.js
CHANGED
|
@@ -2692,27 +2692,38 @@ async function openSqliteLocalAgentStore(workspaceRef) {
|
|
|
2692
2692
|
sqliteByKey.set(cwd, pending2);
|
|
2693
2693
|
return pending2;
|
|
2694
2694
|
}
|
|
2695
|
+
function jsonSafePayload(value) {
|
|
2696
|
+
if (value == null) return null;
|
|
2697
|
+
try {
|
|
2698
|
+
return JSON.parse(JSON.stringify(value));
|
|
2699
|
+
} catch {
|
|
2700
|
+
return null;
|
|
2701
|
+
}
|
|
2702
|
+
}
|
|
2695
2703
|
function mirrorRunEventsForVisualization(cfg2, local) {
|
|
2696
2704
|
const api = createApmApiClient(cfg2);
|
|
2697
2705
|
return {
|
|
2698
2706
|
async append(input) {
|
|
2699
2707
|
const row = await local.append(input);
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2708
|
+
try {
|
|
2709
|
+
await api.cli.cursorStoreAppendRunEvents({
|
|
2710
|
+
events: [
|
|
2711
|
+
{
|
|
2712
|
+
runId: input.runId,
|
|
2713
|
+
eventType: input.eventType,
|
|
2714
|
+
payload: jsonSafePayload(input.payload),
|
|
2715
|
+
payloadRef: input.payloadRef ?? null,
|
|
2716
|
+
idempotencyKey: input.idempotencyKey ?? `${input.runId}:${row.seq}`,
|
|
2717
|
+
createdAt: row.createdAt
|
|
2718
|
+
}
|
|
2719
|
+
]
|
|
2720
|
+
});
|
|
2721
|
+
} catch (err) {
|
|
2711
2722
|
console.warn(
|
|
2712
|
-
`[apm] runEvents \u53EF\u89C6\u5316\u540C\u6B65\
|
|
2723
|
+
`[apm] runEvents \u53EF\u89C6\u5316\u540C\u6B65\u8DF3\u8FC7 runId=${input.runId} seq=${row.seq}:`,
|
|
2713
2724
|
err instanceof Error ? err.message : err
|
|
2714
2725
|
);
|
|
2715
|
-
}
|
|
2726
|
+
}
|
|
2716
2727
|
return row;
|
|
2717
2728
|
},
|
|
2718
2729
|
list: (input) => local.list(input),
|
|
@@ -2720,12 +2731,14 @@ function mirrorRunEventsForVisualization(cfg2, local) {
|
|
|
2720
2731
|
await local.delete(input);
|
|
2721
2732
|
const runIds = input.filter.runIds?.map((id) => id.trim()).filter(Boolean);
|
|
2722
2733
|
if (!runIds?.length) return;
|
|
2723
|
-
|
|
2734
|
+
try {
|
|
2735
|
+
await api.cli.cursorStoreDeleteRunEvents({ runIds });
|
|
2736
|
+
} catch (err) {
|
|
2724
2737
|
console.warn(
|
|
2725
|
-
`[apm] runEvents \u53EF\u89C6\u5316\u6E05\u7406\
|
|
2738
|
+
`[apm] runEvents \u53EF\u89C6\u5316\u6E05\u7406\u8DF3\u8FC7:`,
|
|
2726
2739
|
err instanceof Error ? err.message : err
|
|
2727
2740
|
);
|
|
2728
|
-
}
|
|
2741
|
+
}
|
|
2729
2742
|
}
|
|
2730
2743
|
};
|
|
2731
2744
|
}
|