stratagate-dsh 0.3.9 → 0.3.10
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/CHANGELOG.md +6 -0
- package/dist/client.js +4 -4
- package/dist/plugin.js +30 -37
- package/dist/plugin.js.map +1 -1
- package/package.json +1 -1
package/dist/plugin.js
CHANGED
|
@@ -13126,6 +13126,30 @@ async function topicEvents(runtime, url) {
|
|
|
13126
13126
|
items: page.map(({ id, title, status, createdAt }) => ({ id, title, status, createdAt }))
|
|
13127
13127
|
};
|
|
13128
13128
|
}
|
|
13129
|
+
function liveGraphProjection(snapshot) {
|
|
13130
|
+
const eventIds = new Set([...snapshot.events, ...snapshot.agentEvents].filter(({ status: status2 }) => status2 !== "forgotten" && status2 !== "archived").map(({ id }) => id));
|
|
13131
|
+
const jobs = snapshot.graphProjectionJobs.filter(({ sourceEventIds }) => sourceEventIds.some((id) => eventIds.has(id)));
|
|
13132
|
+
const status = summarizeDerivationJobs(jobs, (job) => job.status === "completed");
|
|
13133
|
+
const projected = new Set(jobs.filter(({ status: status2, projectorVersion }) => status2 === "completed" && projectorVersion === KNOWLEDGE_GRAPH_PROJECTOR_VERSION).flatMap(({ sourceEventIds }) => sourceEventIds.filter((id) => eventIds.has(id)))).size;
|
|
13134
|
+
const total = eventIds.size;
|
|
13135
|
+
const complete = projected === total && status.processing === 0 && status.terminalFailed === 0 && status.blocked === 0;
|
|
13136
|
+
const state = status.processing > 0 ? "processing" : status.terminalFailed > 0 ? "failed" : complete ? "complete" : "incomplete";
|
|
13137
|
+
return {
|
|
13138
|
+
jobs,
|
|
13139
|
+
status,
|
|
13140
|
+
migration: {
|
|
13141
|
+
projected,
|
|
13142
|
+
total,
|
|
13143
|
+
pending: jobs.filter(({ status: status2 }) => status2 === "pending").length,
|
|
13144
|
+
running: jobs.filter(({ status: status2 }) => status2 === "running").length,
|
|
13145
|
+
failed: status.terminalFailed,
|
|
13146
|
+
retryable: status.retryable,
|
|
13147
|
+
processing: status.processing,
|
|
13148
|
+
state,
|
|
13149
|
+
complete
|
|
13150
|
+
}
|
|
13151
|
+
};
|
|
13152
|
+
}
|
|
13129
13153
|
async function overview(runtime, cachedEntries) {
|
|
13130
13154
|
const entries = cachedEntries ?? await Promise.all((await runtime.adminNamespaces()).map(async (namespace) => ({
|
|
13131
13155
|
namespace,
|
|
@@ -13231,20 +13255,21 @@ async function overview(runtime, cachedEntries) {
|
|
|
13231
13255
|
const topicStatus = summarizeDerivationJobs(topicJobs, (job) => job.status === "completed");
|
|
13232
13256
|
const summaryStatus = summarizeDerivationJobs(snapshot.summaryJobs, (job) => job.status === "succeeded");
|
|
13233
13257
|
const extractionStatus = summarizeDerivationJobs(snapshot.extractionJobs, (job) => job.status === "succeeded" || job.status === "skipped");
|
|
13234
|
-
const
|
|
13258
|
+
const graphWork = liveGraphProjection(snapshot);
|
|
13259
|
+
const graphStatus = graphWork.status;
|
|
13235
13260
|
const failedJobs = summaryStatus.terminalFailed + extractionStatus.terminalFailed + graphStatus.terminalFailed + topicStatus.terminalFailed;
|
|
13236
13261
|
const processingJobs = summaryStatus.processing + extractionStatus.processing + graphStatus.processing + topicStatus.processing;
|
|
13237
13262
|
const failedJobDetails = [
|
|
13238
13263
|
...topicJobs.filter((job) => job.status === "failed").map(describeTopicJob),
|
|
13239
13264
|
...snapshot.summaryJobs.filter(({ status }) => status === "failed").map((job) => describeBlockJob("block-summary", job)),
|
|
13240
13265
|
...snapshot.extractionJobs.filter(({ status }) => status === "failed").map((job) => describeBlockJob("event-extraction", job)),
|
|
13241
|
-
...
|
|
13266
|
+
...graphWork.jobs.filter(({ status }) => status === "failed").map(describeGraphJob)
|
|
13242
13267
|
];
|
|
13243
13268
|
const processingJobDetails = [
|
|
13244
13269
|
...topicJobs.filter((job) => ["processing", "retryable"].includes(derivationJobState(job, job.status === "completed"))).map(describeTopicJob),
|
|
13245
13270
|
...snapshot.summaryJobs.filter((job) => derivationJobState(job, job.status === "succeeded") === "processing" || derivationJobState(job, job.status === "succeeded") === "retryable").map((job) => describeBlockJob("block-summary", job)),
|
|
13246
13271
|
...snapshot.extractionJobs.filter((job) => derivationJobState(job, job.status === "succeeded" || job.status === "skipped") === "processing" || derivationJobState(job, job.status === "succeeded" || job.status === "skipped") === "retryable").map((job) => describeBlockJob("event-extraction", job)),
|
|
13247
|
-
...
|
|
13272
|
+
...graphWork.jobs.filter(graphProjectionIsProcessing).map(describeGraphJob)
|
|
13248
13273
|
];
|
|
13249
13274
|
const timestamps = [
|
|
13250
13275
|
...snapshot.blocks.map(({ createdAt }) => createdAt),
|
|
@@ -13274,23 +13299,7 @@ async function overview(runtime, cachedEntries) {
|
|
|
13274
13299
|
graphProjection: graphStatus,
|
|
13275
13300
|
topicProjection: topicStatus
|
|
13276
13301
|
},
|
|
13277
|
-
graphMigration:
|
|
13278
|
-
const projected = new Set(snapshot.graphProjectionJobs.filter(({ status, projectorVersion }) => status === "completed" && projectorVersion === KNOWLEDGE_GRAPH_PROJECTOR_VERSION).flatMap(({ sourceEventIds }) => sourceEventIds)).size;
|
|
13279
|
-
const total = snapshot.events.filter(({ status }) => status !== "forgotten" && status !== "archived").length;
|
|
13280
|
-
const complete = projected >= total;
|
|
13281
|
-
const state = complete ? "complete" : graphStatus.processing > 0 ? "processing" : graphStatus.terminalFailed > 0 ? "failed" : "incomplete";
|
|
13282
|
-
return {
|
|
13283
|
-
projected,
|
|
13284
|
-
total,
|
|
13285
|
-
pending: snapshot.graphProjectionJobs.filter(({ status }) => status === "pending").length,
|
|
13286
|
-
running: snapshot.graphProjectionJobs.filter(({ status }) => status === "running").length,
|
|
13287
|
-
failed: graphStatus.terminalFailed,
|
|
13288
|
-
retryable: graphStatus.retryable,
|
|
13289
|
-
processing: graphStatus.processing,
|
|
13290
|
-
state,
|
|
13291
|
-
complete
|
|
13292
|
-
};
|
|
13293
|
-
})(),
|
|
13302
|
+
graphMigration: graphWork.migration,
|
|
13294
13303
|
usageReceipts: snapshot.usageReceipts.length,
|
|
13295
13304
|
memoryUseCount: snapshot.usageReceipts.filter((receipt) => receipt.eventIds.length > 0 || receipt.elementIds.length > 0).length,
|
|
13296
13305
|
failedJobs,
|
|
@@ -13677,23 +13686,7 @@ async function memories(runtime, url) {
|
|
|
13677
13686
|
})),
|
|
13678
13687
|
edges: snapshot.graphEdges,
|
|
13679
13688
|
clusters: clusterKnowledgeGraph(snapshot.graphNodes, snapshot.graphEdges),
|
|
13680
|
-
migration: (
|
|
13681
|
-
const projected = new Set(snapshot.graphProjectionJobs.filter(({ status, projectorVersion }) => status === "completed" && projectorVersion === KNOWLEDGE_GRAPH_PROJECTOR_VERSION).flatMap(({ sourceEventIds }) => sourceEventIds)).size;
|
|
13682
|
-
const graphStatus = summarizeDerivationJobs(snapshot.graphProjectionJobs, (job) => job.status === "completed");
|
|
13683
|
-
const total = snapshot.events.filter(({ status }) => status !== "forgotten" && status !== "archived").length;
|
|
13684
|
-
const complete = projected >= total;
|
|
13685
|
-
return {
|
|
13686
|
-
projected,
|
|
13687
|
-
total,
|
|
13688
|
-
pending: snapshot.graphProjectionJobs.filter(({ status }) => status === "pending").length,
|
|
13689
|
-
running: snapshot.graphProjectionJobs.filter(({ status }) => status === "running").length,
|
|
13690
|
-
failed: graphStatus.terminalFailed,
|
|
13691
|
-
retryable: graphStatus.retryable,
|
|
13692
|
-
processing: graphStatus.processing,
|
|
13693
|
-
state: complete ? "complete" : graphStatus.processing > 0 ? "processing" : graphStatus.terminalFailed > 0 ? "failed" : "incomplete",
|
|
13694
|
-
complete
|
|
13695
|
-
};
|
|
13696
|
-
})()
|
|
13689
|
+
migration: liveGraphProjection(snapshot).migration
|
|
13697
13690
|
};
|
|
13698
13691
|
} else if (kind === "elements") values = snapshot.elements.map(elementSummary);
|
|
13699
13692
|
else if (kind === "blocks") {
|