@cortexkit/pi-magic-context 0.49.75 → 0.49.77
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/auto-search-worker.js +3 -3
- package/dist/{embedding-backfill-p0qszhx7.js → embedding-backfill-h1wjzh1n.js} +2 -2
- package/dist/{index-yk0ve8hn.js → index-0bmsfzqf.js} +12 -1
- package/dist/{index-mtpsqxev.js → index-0x61mf6t.js} +2 -2
- package/dist/{index-6t4m64m1.js → index-6bjc4pam.js} +90 -17
- package/dist/{index-w2snpk0j.js → index-gczr1m66.js} +13 -2
- package/dist/{index-cevw58nn.js → index-px5g7twk.js} +2 -2
- package/dist/{index-tygcydj7.js → index-xxjx713t.js} +7 -1
- package/dist/index.js +68 -61
- package/dist/{project-embedding-registry-2natnvdf.js → project-embedding-registry-zgzq9ehw.js} +6 -2
- package/dist/raw-ordinal-warmup-worker.js +2 -2
- package/dist/{render-cm4572er.js → render-gbeyky54.js} +1 -1
- package/dist/{search-archive-8kcsmnzt.js → search-archive-33p4gebn.js} +1 -1
- package/dist/{search-hm8dc1e8.js → search-zazd3b88.js} +3 -3
- package/dist/subagent-entry.js +6 -6
- package/dist/{v2-archive-reader-ycw2nxf1.js → v2-archive-reader-5cydt27v.js} +1 -1
- package/package.json +2 -2
|
@@ -27,11 +27,11 @@ serveWorkerJobs(async (initial, port) => {
|
|
|
27
27
|
{ Database, registerSqliteDiagnosticSink },
|
|
28
28
|
{ log }
|
|
29
29
|
] = await Promise.all([
|
|
30
|
-
import("./embedding-backfill-
|
|
30
|
+
import("./embedding-backfill-h1wjzh1n.js"),
|
|
31
31
|
import("./embedding-cache-7rp4gqzr.js"),
|
|
32
32
|
import("./storage-memory-0ndn65fm.js"),
|
|
33
|
-
import("./project-embedding-registry-
|
|
34
|
-
import("./search-
|
|
33
|
+
import("./project-embedding-registry-zgzq9ehw.js"),
|
|
34
|
+
import("./search-zazd3b88.js"),
|
|
35
35
|
import("./compartment-chunk-embedding-avkyp2df.js"),
|
|
36
36
|
import("./embedding-activity-ew6dshfd.js"),
|
|
37
37
|
import("./harness-9872e0ym.js"),
|
|
@@ -1729,6 +1729,7 @@ function registerProjectEmbedding2(db, projectIdentity, config, features, source
|
|
|
1729
1729
|
runtimeFingerprint,
|
|
1730
1730
|
provider: canReuseProvider ? prior.provider : null,
|
|
1731
1731
|
generation,
|
|
1732
|
+
searchBackfillAfterId: generationChanged ? undefined : prior.searchBackfillAfterId,
|
|
1732
1733
|
features: { ...features },
|
|
1733
1734
|
modelId: providerIdentity === OFF_PROVIDER_IDENTITY ? "off" : providerIdentity,
|
|
1734
1735
|
chunkModelId: providerIdentity === OFF_PROVIDER_IDENTITY ? "off" : chunkModelId,
|
|
@@ -2423,6 +2424,15 @@ function getProjectEmbeddingSnapshot2(projectIdentity) {
|
|
|
2423
2424
|
const registration = projectRegistrations.get(projectIdentity);
|
|
2424
2425
|
return registration ? snapshotFor(registration) : null;
|
|
2425
2426
|
}
|
|
2427
|
+
function readSearchBackfillCursor2(projectIdentity, generation) {
|
|
2428
|
+
const registration = projectRegistrations.get(projectIdentity);
|
|
2429
|
+
return registration?.generation === generation ? registration.searchBackfillAfterId : undefined;
|
|
2430
|
+
}
|
|
2431
|
+
function writeSearchBackfillCursor2(projectIdentity, generation, expected, afterId) {
|
|
2432
|
+
const registration = projectRegistrations.get(projectIdentity);
|
|
2433
|
+
if (registration?.generation === generation && registration.searchBackfillAfterId === expected)
|
|
2434
|
+
registration.searchBackfillAfterId = afterId;
|
|
2435
|
+
}
|
|
2426
2436
|
function installProjectEmbeddingSearchBridge2(snapshot, provider) {
|
|
2427
2437
|
projectRegistrations.set(snapshot.projectIdentity, {
|
|
2428
2438
|
projectIdentity: snapshot.projectIdentity,
|
|
@@ -2430,6 +2440,7 @@ function installProjectEmbeddingSearchBridge2(snapshot, provider) {
|
|
|
2430
2440
|
providerIdentity: snapshot.providerIdentity,
|
|
2431
2441
|
runtimeFingerprint: snapshot.runtimeFingerprint,
|
|
2432
2442
|
generation: snapshot.generation,
|
|
2443
|
+
searchBackfillAfterId: readSearchBackfillCursor2(snapshot.projectIdentity, snapshot.generation),
|
|
2433
2444
|
features: { ...snapshot.features },
|
|
2434
2445
|
modelId: snapshot.modelId,
|
|
2435
2446
|
chunkModelId: snapshot.chunkModelId,
|
|
@@ -3149,4 +3160,4 @@ function _resetProjectEmbeddingRegistryForTests2() {
|
|
|
3149
3160
|
setBootQuietPeriodForTests(null);
|
|
3150
3161
|
}
|
|
3151
3162
|
|
|
3152
|
-
export { withQueryEmbeddingDeadline, OpenAICompatibleEmbeddingProvider, saveCommitEmbedding, loadProjectCommitEmbeddings, loadUnembeddedCommits, countEmbeddedCommits, upsertCommits, getLatestIndexedCommitSha, enforceProjectCap, describeShadowBackfillWriteRefusal2, listShadowBackfillStalls2, getShadowBackfillStopReason2, markProjectLoadUntrusted2, contentSha2562, drainProjectEmbeddingIdentityMaintenance2, drainStaleEmbeddingIdentitiesForProject2, registerProjectEmbedding2, registerProjectShadowEmbedding2, getShadowEmbeddingMeasurementCohort2, getPrimaryEmbeddingMeasurementCohort2, embedShadowTextForProject2, enqueueShadowEmbeddingItems2, getShadowBackfillRemaining2, flushShadowEmbeddingBacklog2, registerProjectInObservationMode2, unregisterProjectShadowEmbedding2, unregisterProjectEmbedding2, getProjectEmbeddingSnapshot2, installProjectEmbeddingSearchBridge2, getProjectChunkEmbeddingModelId2, getProjectEmbeddingMaxInputTokens2, embedTextForProject2, embedBatchForProject2, embedItemsForProject2, embedItemsWindowBounded2, embedUnembeddedMemoriesForProject2, drainCommitBacklogForProject2, embedUnembeddedCompartmentChunksForProject2, embedSessionCompartmentChunks2, getEmbeddingCoverageStatus2, getAutoEmbeddingSessionCoverage2, sweepAllRegisteredProjects2, _setTestProviderFactoryForProject2, _resetProjectEmbeddingRegistryForTests2 };
|
|
3163
|
+
export { withQueryEmbeddingDeadline, OpenAICompatibleEmbeddingProvider, saveCommitEmbedding, loadProjectCommitEmbeddings, loadUnembeddedCommits, countEmbeddedCommits, upsertCommits, getLatestIndexedCommitSha, enforceProjectCap, describeShadowBackfillWriteRefusal2, listShadowBackfillStalls2, getShadowBackfillStopReason2, markProjectLoadUntrusted2, contentSha2562, drainProjectEmbeddingIdentityMaintenance2, drainStaleEmbeddingIdentitiesForProject2, registerProjectEmbedding2, registerProjectShadowEmbedding2, getShadowEmbeddingMeasurementCohort2, getPrimaryEmbeddingMeasurementCohort2, embedShadowTextForProject2, enqueueShadowEmbeddingItems2, getShadowBackfillRemaining2, flushShadowEmbeddingBacklog2, registerProjectInObservationMode2, unregisterProjectShadowEmbedding2, unregisterProjectEmbedding2, getProjectEmbeddingSnapshot2, readSearchBackfillCursor2, writeSearchBackfillCursor2, installProjectEmbeddingSearchBridge2, getProjectChunkEmbeddingModelId2, getProjectEmbeddingMaxInputTokens2, embedTextForProject2, embedBatchForProject2, embedItemsForProject2, embedItemsWindowBounded2, embedUnembeddedMemoriesForProject2, drainCommitBacklogForProject2, embedUnembeddedCompartmentChunksForProject2, embedSessionCompartmentChunks2, getEmbeddingCoverageStatus2, getAutoEmbeddingSessionCoverage2, sweepAllRegisteredProjects2, _setTestProviderFactoryForProject2, _resetProjectEmbeddingRegistryForTests2 };
|
|
@@ -140,8 +140,8 @@ async function serveV2ArchiveReads2(port, openConnections) {
|
|
|
140
140
|
import("./store-reader-mmfw2h48.js"),
|
|
141
141
|
import("./store-grcwn6hs.js"),
|
|
142
142
|
import("./read-session-chunk-ygwyfvtr.js"),
|
|
143
|
-
import("./render-
|
|
144
|
-
import("./search-archive-
|
|
143
|
+
import("./render-gbeyky54.js"),
|
|
144
|
+
import("./search-archive-33p4gebn.js"),
|
|
145
145
|
import("./expand-attachments-8sxeyj26.js")
|
|
146
146
|
]);
|
|
147
147
|
const pool = new V2StoreReaderPool;
|
|
@@ -70,7 +70,7 @@ import {
|
|
|
70
70
|
renderMessageByOrdinal2,
|
|
71
71
|
renderVerboseRange2,
|
|
72
72
|
renderItemByTag2
|
|
73
|
-
} from "./index-
|
|
73
|
+
} from "./index-xxjx713t.js";
|
|
74
74
|
import {
|
|
75
75
|
getLastIndexedOrdinal
|
|
76
76
|
} from "./index-mm9y1m77.js";
|
|
@@ -129,7 +129,7 @@ import {
|
|
|
129
129
|
unregisterProjectEmbedding2,
|
|
130
130
|
getProjectEmbeddingSnapshot2,
|
|
131
131
|
embedTextForProject2
|
|
132
|
-
} from "./index-
|
|
132
|
+
} from "./index-0bmsfzqf.js";
|
|
133
133
|
import {
|
|
134
134
|
directoryHasGitMetadata,
|
|
135
135
|
resolveProjectIdentityForSession,
|
|
@@ -142,7 +142,7 @@ import {
|
|
|
142
142
|
resolveMemoriesByIdsForSearch2,
|
|
143
143
|
unifiedSearch2,
|
|
144
144
|
formatSearchResults2
|
|
145
|
-
} from "./index-
|
|
145
|
+
} from "./index-px5g7twk.js";
|
|
146
146
|
import {
|
|
147
147
|
resolveOpenCodeDbPath,
|
|
148
148
|
assertOpenCodeStoreGeneration
|
|
@@ -7662,6 +7662,80 @@ async function reportSubagentStartupError(error) {
|
|
|
7662
7662
|
});
|
|
7663
7663
|
}
|
|
7664
7664
|
|
|
7665
|
+
// src/pi-tui-compat.ts
|
|
7666
|
+
import { realpathSync as realpathSync3 } from "node:fs";
|
|
7667
|
+
import { createRequire } from "node:module";
|
|
7668
|
+
import { pathToFileURL as pathToFileURL2 } from "node:url";
|
|
7669
|
+
function legacyExports(tui) {
|
|
7670
|
+
if (typeof tui?.Box === "function" && typeof tui.Text === "function" && typeof tui.matchesKey === "function" && typeof tui.truncateToWidth === "function" && typeof tui.visibleWidth === "function") {
|
|
7671
|
+
return tui;
|
|
7672
|
+
}
|
|
7673
|
+
}
|
|
7674
|
+
async function loadOmpRowsTui() {
|
|
7675
|
+
try {
|
|
7676
|
+
const width = await import("@oh-my-pi/pi-tui/text/width");
|
|
7677
|
+
const keys = await import("@oh-my-pi/pi-tui/driver/input/keys");
|
|
7678
|
+
if (width.visibleWidth && width.truncate && keys.decodeKey) {
|
|
7679
|
+
return {
|
|
7680
|
+
visibleWidth: width.visibleWidth,
|
|
7681
|
+
truncate: width.truncate,
|
|
7682
|
+
decodeKey: keys.decodeKey
|
|
7683
|
+
};
|
|
7684
|
+
}
|
|
7685
|
+
} catch {}
|
|
7686
|
+
}
|
|
7687
|
+
async function loadDisplayTui() {
|
|
7688
|
+
const piPeer = "@earendil-works/pi-tui";
|
|
7689
|
+
if ((await resolvePiHarnessDetection()).kind === "omp") {
|
|
7690
|
+
const tui = await import("@oh-my-pi/pi-tui").catch(() => {
|
|
7691
|
+
return;
|
|
7692
|
+
});
|
|
7693
|
+
const legacy = legacyExports(tui);
|
|
7694
|
+
if (legacy)
|
|
7695
|
+
return { legacy };
|
|
7696
|
+
if (typeof tui?.createSurface === "function") {
|
|
7697
|
+
return { rows: await loadOmpRowsTui() };
|
|
7698
|
+
}
|
|
7699
|
+
} else if (process.argv[1]) {
|
|
7700
|
+
try {
|
|
7701
|
+
const hostRequire = createRequire(realpathSync3(process.argv[1]));
|
|
7702
|
+
const peerUrl = pathToFileURL2(hostRequire.resolve(piPeer));
|
|
7703
|
+
const tui = legacyExports(await import(peerUrl.href));
|
|
7704
|
+
if (tui)
|
|
7705
|
+
return { legacy: tui };
|
|
7706
|
+
} catch {}
|
|
7707
|
+
}
|
|
7708
|
+
return { legacy: legacyExports(await import(piPeer).catch(() => {
|
|
7709
|
+
return;
|
|
7710
|
+
})) };
|
|
7711
|
+
}
|
|
7712
|
+
var { legacy, rows } = await loadDisplayTui();
|
|
7713
|
+
var legacyTui = legacy;
|
|
7714
|
+
var hasOmpRowsTui = rows !== undefined;
|
|
7715
|
+
var canRenderPiRows = legacyTui !== undefined || hasOmpRowsTui;
|
|
7716
|
+
function piTerminalRows(host) {
|
|
7717
|
+
return "size" in host ? host.size().rows : host.terminal.rows;
|
|
7718
|
+
}
|
|
7719
|
+
function piOverlayOptions(width) {
|
|
7720
|
+
return {
|
|
7721
|
+
overlay: true,
|
|
7722
|
+
...legacyTui && { overlayOptions: { anchor: "center", width } }
|
|
7723
|
+
};
|
|
7724
|
+
}
|
|
7725
|
+
function matchesKey(...args) {
|
|
7726
|
+
if (legacyTui)
|
|
7727
|
+
return legacyTui.matchesKey(...args);
|
|
7728
|
+
const [data, key] = args;
|
|
7729
|
+
const event = rows?.decodeKey(data, { kitty: false, backspaceIsCtrl: false });
|
|
7730
|
+
return event?.id === (key === "return" ? "enter" : key);
|
|
7731
|
+
}
|
|
7732
|
+
function truncateToWidth(...args) {
|
|
7733
|
+
return legacyTui?.truncateToWidth(...args) ?? rows?.truncate(...args) ?? args[0];
|
|
7734
|
+
}
|
|
7735
|
+
function visibleWidth(text) {
|
|
7736
|
+
return legacyTui?.visibleWidth(text) ?? rows?.visibleWidth(text) ?? text.length;
|
|
7737
|
+
}
|
|
7738
|
+
|
|
7665
7739
|
// src/pi-ordinal-alignment.ts
|
|
7666
7740
|
var ALIGNED = { kind: "aligned", offset: 0 };
|
|
7667
7741
|
var resolvedByEntries = new WeakMap;
|
|
@@ -10371,9 +10445,6 @@ function throwReturnedToolErrors(tool) {
|
|
|
10371
10445
|
}
|
|
10372
10446
|
|
|
10373
10447
|
// src/tools/todo-view-pi.ts
|
|
10374
|
-
import {
|
|
10375
|
-
truncateToWidth
|
|
10376
|
-
} from "@earendil-works/pi-tui";
|
|
10377
10448
|
var TODO_TOOL_NAME = "todowrite";
|
|
10378
10449
|
var TODOS_COMMAND_NAME = "todos";
|
|
10379
10450
|
var WIDGET_KEY = "magic-context-todos";
|
|
@@ -10664,7 +10735,7 @@ class TodoOverlay {
|
|
|
10664
10735
|
}
|
|
10665
10736
|
}
|
|
10666
10737
|
update(sessionId = this.sessionId) {
|
|
10667
|
-
if (!this.uiCtx || !this.sessionId || sessionId !== this.sessionId)
|
|
10738
|
+
if (!canRenderPiRows || !this.uiCtx || !this.sessionId || sessionId !== this.sessionId)
|
|
10668
10739
|
return;
|
|
10669
10740
|
const todos = getTodoSnapshot(this.sessionId).todos;
|
|
10670
10741
|
this.pruneCompletedDisplayState(todos);
|
|
@@ -10680,12 +10751,16 @@ class TodoOverlay {
|
|
|
10680
10751
|
if (!this.widgetRegistered) {
|
|
10681
10752
|
this.uiCtx.setWidget(WIDGET_KEY, (tui, theme) => {
|
|
10682
10753
|
this.tui = tui;
|
|
10754
|
+
const clearRegistration = () => {
|
|
10755
|
+
if (this.tui !== tui)
|
|
10756
|
+
return;
|
|
10757
|
+
this.widgetRegistered = false;
|
|
10758
|
+
this.tui = undefined;
|
|
10759
|
+
};
|
|
10683
10760
|
return {
|
|
10684
10761
|
render: (width) => this.renderWidget(theme, width),
|
|
10685
|
-
invalidate:
|
|
10686
|
-
|
|
10687
|
-
this.tui = undefined;
|
|
10688
|
-
}
|
|
10762
|
+
invalidate: clearRegistration,
|
|
10763
|
+
dispose: clearRegistration
|
|
10689
10764
|
};
|
|
10690
10765
|
}, { placement: "aboveEditor" });
|
|
10691
10766
|
this.widgetRegistered = true;
|
|
@@ -10872,11 +10947,9 @@ function createTodowriteTool() {
|
|
|
10872
10947
|
}
|
|
10873
10948
|
};
|
|
10874
10949
|
},
|
|
10875
|
-
|
|
10876
|
-
|
|
10877
|
-
|
|
10878
|
-
renderResult(result, _opts, theme, context) {
|
|
10879
|
-
return renderTodowriteResult(result, theme, context);
|
|
10950
|
+
...canRenderPiRows && {
|
|
10951
|
+
renderCall: (args, theme, context) => renderTodowriteCall(args, theme, hasOmpRowsTui ? undefined : context),
|
|
10952
|
+
renderResult: (result, _opts, theme, context) => renderTodowriteResult(result, theme, hasOmpRowsTui ? undefined : context)
|
|
10880
10953
|
}
|
|
10881
10954
|
};
|
|
10882
10955
|
}
|
|
@@ -10969,4 +11042,4 @@ function registerMagicContextTools(pi, opts) {
|
|
|
10969
11042
|
}
|
|
10970
11043
|
}
|
|
10971
11044
|
|
|
10972
|
-
export { COMPACTION_ENABLED_PATH, isDreamerRunnable, isCompactionEnabled, isCommitRetentionPaused, copyCommitRetentionRecovery, formatConfigParseStatusLine, formatConfigParseNotice, claimConfigParseFailuresOnce, parseJsoncRecovering, detectConfigFile, OPENCODE_OUTPUT_CAP, MIN_PLAUSIBLE_CONTEXT_LIMIT, catalogOutputReserve, deriveWindowGeometry, hasTrustedAbsoluteWall, applyProvenInputFloor, formatWindowDerivationLine, formatWindowSource, isSaneLimit, resolveOutputReserve, getSdkWindowGeometry, getSdkContextLimit, getSdkOutputLimit, getSdkInputLimit, cortexKitUserConfigBasePath, cortexKitProjectConfigBasePath, migrateMagicContextConfigLocations, getProtectedTokensTierOverrides, noteTouchedAt, noteNudgePickIndex, formatNoteNudge, systemPromptFingerprint, createPromptSurfaceRuntime, createPromptSurfaceGuidanceEpochCache, SYNTH_USER_ID_PREFIX, resolvePiStableId, resolvePiRealStableId, isPiContentFallbackId, isPiIndexFallbackId, piContentFallbackIds, readPiSessionSnapshot, readPiSessionMessages, readPiSessionMessagePage, findRestartModelSeedFromBranch, iterateEntriesToRawMessageRange, iterateAsyncEntriesToRawMessageRange, convertEntriesToRawMessages, convertPiAssistantEntryById, convertEntriesToRawMessagePage, countPiRawMessages, USER_MEMORY_CANDIDATE_TTL_MS, insertUserMemoryCandidates, getUserMemoryCandidates, deleteUserMemoryCandidates, pruneExpiredUserMemoryCandidates, insertUserMemory, getActiveUserMemories, updateUserMemoryContent, dismissUserMemory, getTaskScheduleState, getFailingDreamTasks, getSkippedDreamTasks, getMostRecentTaskRunAt, pruneNonCanonicalTaskRows, deleteTaskScheduleRowsForProject, seedTaskScheduleState, writeTaskScheduleState, isRetrospectiveWindowProcessed, recordRetrospectiveWindowProcessed, curateCategoryForMemoryCategory, peekCurateCategoryScope, beginCurateCategoryRun, curateTaskStateAfterSuccess, MEMORY_MURAL_BLOCK, buildMagicContextSection, resolveMuralWire, requestToolsFingerprint, classifyRequestToolsChange, requestToolSchemaDigest, updateCompactionMarkerAfterPublication, COMPARTMENT_RENDER_EPOCH, MEMORY_RENDER_FORMAT_EPOCH, encodeCachedM0UpgradeIdentity, decodeCachedM0UpgradeIdentity, withCachedM0MemoryIds, readCachedM0MemoryIds, renderBudgetIdentityChanged, renderedBudgetSnapshot, renderedBudgetShrinkReason, DEFAULT_HISTORY_BUDGET_TOKENS, renderCompartmentAtTier, renderDecayedCompartments, extractM0Block, TEMPORAL_MARKER_PATTERN, TEMPORAL_MARKER_REPLAY_PATTERN, temporalMarkerPrefix, renderUserProfileContent, clearInjectionCache, getVisibleMemoryIds, orderHistorianMemories, renderHistorianMemoryBlock, DEFAULT_MEMORY_BUDGET_TOKENS, DEFAULT_USER_PROFILE_BUDGET_TOKENS, resolveWorkspaceRenderContext, sourceNamesForMemories, readM0ProjectMemories, trimMemoriesToBudgetV2, trimWorkspaceMemoriesToBudgetV2, trimUserMemoriesToBudget, renderMemoryBlockV2, stripMemoryMuralBlock, resetPrefixTrimFallbackState, isDirectiveShapedProjectRule, takeCurateSafetyRefusalCount, wakePlaneStatus, loadPiConfig, loadPiConfigDetailed, unregisterPiProjectEmbeddings, ensureProjectRegisteredFromPiDirectory, neutralizeOmpMentions, restoreOmpMentions, resolvePiHarnessDetection, resolvePiHarnessKind, readSubagentStartupError, reportSubagentStartupError, inheritPiOrdinalAlignment, resolvePiOrdinalAlignment, piRawOrdinalOffsetSource, resolvePiOrdinalAlignmentForContext, isPiOrdinalAlignmentUnanchored, clearPiOrdinalAlignmentSession, rememberTodowriteToolCallTodos, parseTodos, setTodoSnapshot, registerTodoOverlay, registerTodoStateLifecycle, syncCtxMemoryToolEnabled, registerMagicContextTools };
|
|
11045
|
+
export { COMPACTION_ENABLED_PATH, isDreamerRunnable, isCompactionEnabled, isCommitRetentionPaused, copyCommitRetentionRecovery, formatConfigParseStatusLine, formatConfigParseNotice, claimConfigParseFailuresOnce, parseJsoncRecovering, detectConfigFile, OPENCODE_OUTPUT_CAP, MIN_PLAUSIBLE_CONTEXT_LIMIT, catalogOutputReserve, deriveWindowGeometry, hasTrustedAbsoluteWall, applyProvenInputFloor, formatWindowDerivationLine, formatWindowSource, isSaneLimit, resolveOutputReserve, getSdkWindowGeometry, getSdkContextLimit, getSdkOutputLimit, getSdkInputLimit, cortexKitUserConfigBasePath, cortexKitProjectConfigBasePath, migrateMagicContextConfigLocations, getProtectedTokensTierOverrides, noteTouchedAt, noteNudgePickIndex, formatNoteNudge, systemPromptFingerprint, createPromptSurfaceRuntime, createPromptSurfaceGuidanceEpochCache, SYNTH_USER_ID_PREFIX, resolvePiStableId, resolvePiRealStableId, isPiContentFallbackId, isPiIndexFallbackId, piContentFallbackIds, readPiSessionSnapshot, readPiSessionMessages, readPiSessionMessagePage, findRestartModelSeedFromBranch, iterateEntriesToRawMessageRange, iterateAsyncEntriesToRawMessageRange, convertEntriesToRawMessages, convertPiAssistantEntryById, convertEntriesToRawMessagePage, countPiRawMessages, USER_MEMORY_CANDIDATE_TTL_MS, insertUserMemoryCandidates, getUserMemoryCandidates, deleteUserMemoryCandidates, pruneExpiredUserMemoryCandidates, insertUserMemory, getActiveUserMemories, updateUserMemoryContent, dismissUserMemory, getTaskScheduleState, getFailingDreamTasks, getSkippedDreamTasks, getMostRecentTaskRunAt, pruneNonCanonicalTaskRows, deleteTaskScheduleRowsForProject, seedTaskScheduleState, writeTaskScheduleState, isRetrospectiveWindowProcessed, recordRetrospectiveWindowProcessed, curateCategoryForMemoryCategory, peekCurateCategoryScope, beginCurateCategoryRun, curateTaskStateAfterSuccess, MEMORY_MURAL_BLOCK, buildMagicContextSection, resolveMuralWire, requestToolsFingerprint, classifyRequestToolsChange, requestToolSchemaDigest, updateCompactionMarkerAfterPublication, COMPARTMENT_RENDER_EPOCH, MEMORY_RENDER_FORMAT_EPOCH, encodeCachedM0UpgradeIdentity, decodeCachedM0UpgradeIdentity, withCachedM0MemoryIds, readCachedM0MemoryIds, renderBudgetIdentityChanged, renderedBudgetSnapshot, renderedBudgetShrinkReason, DEFAULT_HISTORY_BUDGET_TOKENS, renderCompartmentAtTier, renderDecayedCompartments, extractM0Block, TEMPORAL_MARKER_PATTERN, TEMPORAL_MARKER_REPLAY_PATTERN, temporalMarkerPrefix, renderUserProfileContent, clearInjectionCache, getVisibleMemoryIds, orderHistorianMemories, renderHistorianMemoryBlock, DEFAULT_MEMORY_BUDGET_TOKENS, DEFAULT_USER_PROFILE_BUDGET_TOKENS, resolveWorkspaceRenderContext, sourceNamesForMemories, readM0ProjectMemories, trimMemoriesToBudgetV2, trimWorkspaceMemoriesToBudgetV2, trimUserMemoriesToBudget, renderMemoryBlockV2, stripMemoryMuralBlock, resetPrefixTrimFallbackState, isDirectiveShapedProjectRule, takeCurateSafetyRefusalCount, wakePlaneStatus, loadPiConfig, loadPiConfigDetailed, unregisterPiProjectEmbeddings, ensureProjectRegisteredFromPiDirectory, neutralizeOmpMentions, restoreOmpMentions, resolvePiHarnessDetection, resolvePiHarnessKind, readSubagentStartupError, reportSubagentStartupError, legacyTui, canRenderPiRows, piTerminalRows, piOverlayOptions, matchesKey, truncateToWidth, visibleWidth, inheritPiOrdinalAlignment, resolvePiOrdinalAlignment, piRawOrdinalOffsetSource, resolvePiOrdinalAlignmentForContext, isPiOrdinalAlignmentUnanchored, clearPiOrdinalAlignmentSession, rememberTodowriteToolCallTodos, parseTodos, setTodoSnapshot, registerTodoOverlay, registerTodoStateLifecycle, syncCtxMemoryToolEnabled, registerMagicContextTools };
|
|
@@ -7,8 +7,10 @@ import {
|
|
|
7
7
|
import {
|
|
8
8
|
contentSha2562,
|
|
9
9
|
getProjectEmbeddingSnapshot2,
|
|
10
|
+
readSearchBackfillCursor2,
|
|
11
|
+
writeSearchBackfillCursor2,
|
|
10
12
|
embedItemsWindowBounded2
|
|
11
|
-
} from "./index-
|
|
13
|
+
} from "./index-0bmsfzqf.js";
|
|
12
14
|
import {
|
|
13
15
|
saveEmbeddingIfHashMatches
|
|
14
16
|
} from "./index-yhzhdp3m.js";
|
|
@@ -23,7 +25,12 @@ async function ensureMemoryEmbeddings2(args) {
|
|
|
23
25
|
if (!snapshot?.enabled) {
|
|
24
26
|
return args.existingEmbeddings;
|
|
25
27
|
}
|
|
26
|
-
const
|
|
28
|
+
const missing = args.memories.filter((memory) => !args.existingEmbeddings.has(memory.id)).sort((a, b) => a.id - b.id);
|
|
29
|
+
const capped = missing.length > SEARCH_BACKFILL_LIMIT;
|
|
30
|
+
const cursor = capped ? readSearchBackfillCursor2(args.projectIdentity, snapshot.generation) : undefined;
|
|
31
|
+
const next = cursor === undefined ? 0 : missing.findIndex((memory) => memory.id > cursor);
|
|
32
|
+
const start = Math.max(0, next);
|
|
33
|
+
const missingMemories = missing.slice(start, start + SEARCH_BACKFILL_LIMIT);
|
|
27
34
|
if (missingMemories.length === 0) {
|
|
28
35
|
return args.existingEmbeddings;
|
|
29
36
|
}
|
|
@@ -53,6 +60,10 @@ async function ensureMemoryEmbeddings2(args) {
|
|
|
53
60
|
if (!currentSnapshot || currentSnapshot.generation !== result.generation) {
|
|
54
61
|
return args.existingEmbeddings;
|
|
55
62
|
}
|
|
63
|
+
if (capped && (cursor !== undefined || result.vectors.size < missingMemories.length)) {
|
|
64
|
+
const nextCursor = start + missingMemories.length < missing.length ? missingMemories.at(-1)?.id : undefined;
|
|
65
|
+
writeSearchBackfillCursor2(args.projectIdentity, snapshot.generation, cursor, nextCursor);
|
|
66
|
+
}
|
|
56
67
|
for (const [id, embedding] of staged) {
|
|
57
68
|
args.existingEmbeddings.set(id, embedding);
|
|
58
69
|
}
|
|
@@ -56,7 +56,7 @@ import {
|
|
|
56
56
|
getProjectEmbeddingSnapshot2,
|
|
57
57
|
embedTextForProject2,
|
|
58
58
|
embedItemsForProject2
|
|
59
|
-
} from "./index-
|
|
59
|
+
} from "./index-0bmsfzqf.js";
|
|
60
60
|
import {
|
|
61
61
|
recordEmbeddingMeasurement
|
|
62
62
|
} from "./index-hgd00nas.js";
|
|
@@ -69,7 +69,7 @@ import {
|
|
|
69
69
|
} from "./index-yhzhdp3m.js";
|
|
70
70
|
import {
|
|
71
71
|
ensureMemoryEmbeddings2
|
|
72
|
-
} from "./index-
|
|
72
|
+
} from "./index-gczr1m66.js";
|
|
73
73
|
import {
|
|
74
74
|
getMemorySelectColumns2,
|
|
75
75
|
isMemoryRow2,
|
|
@@ -1216,6 +1216,12 @@ function getLastCompartmentEndMessageId(db, sessionId) {
|
|
|
1216
1216
|
const id = row?.end_message_id;
|
|
1217
1217
|
return id && id.length > 0 ? id : null;
|
|
1218
1218
|
}
|
|
1219
|
+
function cachedHistoryCoversLatestCompartment(compartments, m0MaxSequence, historyEndMessageId) {
|
|
1220
|
+
const latest = compartments.at(-1);
|
|
1221
|
+
if (!latest || latest.sequence <= m0MaxSequence)
|
|
1222
|
+
return true;
|
|
1223
|
+
return !!historyEndMessageId && latest.endMessageId === historyEndMessageId && !compartments.some((other) => other !== latest && other.endMessageId === historyEndMessageId);
|
|
1224
|
+
}
|
|
1219
1225
|
function getCompartmentsByEndMessageId(db, sessionId, endMessageId) {
|
|
1220
1226
|
const rows = db.prepare("SELECT * FROM compartments WHERE session_id = ? AND end_message_id = ? ORDER BY sequence ASC").all(sessionId, endMessageId).filter(isCompartmentRow);
|
|
1221
1227
|
return rows.map(toCompartment);
|
|
@@ -4725,4 +4731,4 @@ function renderItemByTag2(db, sessionId, number, textIndexDomain = "part", attac
|
|
|
4725
4731
|
return selected ? renderPartFull(selected) ?? "" : `Tag ${number}'s original text part is no longer in stored history.`;
|
|
4726
4732
|
}
|
|
4727
4733
|
|
|
4728
|
-
export { LkgRecoveryFenceError, clearLkgFenceProcessState, lkgFenceRequiresRebuild, lkgRecoveryFenceUnclean, ownsLkgDirtyFence, invalidateCleanLkgRecoveryFence, markLkgRecoveryDirty, rememberUnpublishedAutoSearchNoHint, getUnpublishedAutoSearchNoHint, forgetUnpublishedAutoSearchNoHint, registerAutoSearchWork, cancelAutoSearchWork, PI_IDENTITY_FOLD_GUARD_LIMIT, readPiIdentityFoldGuards, writePiIdentityFoldGuards, readSessionActivity, observeSessionActivity, backfillSessionActivity, readSessionMeta, getOrCreateSessionMeta, updateSessionMeta, advanceToolReclaimWatermark, retryPendingSessionCleanups, retryPendingRustSessionCleanupsForProject, COMPARTMENT_LEASE_RENEWAL_MS, acquireCompartmentLease, renewCompartmentLease, releaseCompartmentLease, releaseCompartmentLeaseBestEffort, isCompartmentLeaseHeld, isNoContentCompartment, HAS_COMPARTMENT_CONTENT_SQL, queueM0Mutation, getMaxM0MutationId, getCompartments, getLastCompartmentEndMessage, getLastCompartmentEndMessageId, getCompartmentsByEndMessageId, appendCompartments, saveRecompStagingPass, getRecompStaging, clearRecompStaging, getRecompPartialRange, setRecompPartialRange, escapeXmlAttr, escapeXmlContent, getUncoveredCompartmentEndThrough, getUncoveredCompartmentEndsThrough, readProjectDocsCanonical, providerResponseFailed, isSuccessfulProviderCompletion, requestPendingMaterialization, pendingMaterializationOrigin, hasPendingMaterializationOrigin, hasExplicitRefreshRequest, clearPendingMaterialization, clearReclaimedMaterialization, clearPendingMaterializationOrigin, recordSystemRefreshOwnership, recordSystemPromptForRequest, recordHeldHeadForRequest, bindSystemPromptResponse, acknowledgeSystemPromptDelivery, deferDeliveredSystemRefresh, clearSystemPromptDelivery, saveLkgSlotToDb, loadPersistedLkgSlot, drainStaleLkgSlots, createDbLkgPersistence, replayLkg, beginServedRequest, noteServedPassPermission, noteServedReplay, countServedRefusal, dropServedRecord, commitServedRequest, registerLkgPersistence, LKG_SNAPSHOT_ARRAY, LKG_SNAPSHOT_OBJECT, LKG_SNAPSHOT_KEY, LKG_SNAPSHOT_STRING, LKG_SNAPSHOT_NUMBER, LKG_SNAPSHOT_BOOLEAN, LKG_SNAPSHOT_NULL, LKG_SNAPSHOT_UNDEFINED, contentSnapshotValue, signatureForFields, lkgContentFields, lkgContentDigestFromFields, isLegacyLkgDigest, legacyLkgDigestFromFields, lkgFieldsMatchDigest, exactReusablePrefix, incrementalLkgContentDigests, lkgSlotRejection, captureSlot, getInMemorySlot, getSlot, dropSlot, TOOL_SWEEP_SCOPED_MARKER, encodePiContentDecision, decodePiContentDecision, getPiContentDecisions, freezePiContentDecision, withNativeReplayWriteBarrier, getNativeReplayState, saveNativeToolInputs, addNativeReasoningIds, copySessionStateForClone, externalHistorianFailureReason, subprocessExitHistorianFailureReason, countHistorianRuns, getRecentFailedHistorianRunTimes, recordHistorianRun, summarizeImportance, tallyFactsByCategory, queueMemoryMutation, getMemoryMutationsForRender, getMemoryMutationsForRenderByProjects, getMaxMemoryMutationId, getMaxMemoryMutationIdForProjects, GLOBAL_USER_PROFILE_PROJECT_PATH, getProjectState, bumpProjectUserProfileVersion, saveSourceContent, getSourceContents, recordSubagentInvocation, getLatestHistorianInvocationId, renderMessageByOrdinal2, renderVerboseRange2, renderVerboseRangeForTool2, renderItemByTag2 };
|
|
4734
|
+
export { LkgRecoveryFenceError, clearLkgFenceProcessState, lkgFenceRequiresRebuild, lkgRecoveryFenceUnclean, ownsLkgDirtyFence, invalidateCleanLkgRecoveryFence, markLkgRecoveryDirty, rememberUnpublishedAutoSearchNoHint, getUnpublishedAutoSearchNoHint, forgetUnpublishedAutoSearchNoHint, registerAutoSearchWork, cancelAutoSearchWork, PI_IDENTITY_FOLD_GUARD_LIMIT, readPiIdentityFoldGuards, writePiIdentityFoldGuards, readSessionActivity, observeSessionActivity, backfillSessionActivity, readSessionMeta, getOrCreateSessionMeta, updateSessionMeta, advanceToolReclaimWatermark, retryPendingSessionCleanups, retryPendingRustSessionCleanupsForProject, COMPARTMENT_LEASE_RENEWAL_MS, acquireCompartmentLease, renewCompartmentLease, releaseCompartmentLease, releaseCompartmentLeaseBestEffort, isCompartmentLeaseHeld, isNoContentCompartment, HAS_COMPARTMENT_CONTENT_SQL, queueM0Mutation, getMaxM0MutationId, getCompartments, getLastCompartmentEndMessage, getLastCompartmentEndMessageId, cachedHistoryCoversLatestCompartment, getCompartmentsByEndMessageId, appendCompartments, saveRecompStagingPass, getRecompStaging, clearRecompStaging, getRecompPartialRange, setRecompPartialRange, escapeXmlAttr, escapeXmlContent, getUncoveredCompartmentEndThrough, getUncoveredCompartmentEndsThrough, readProjectDocsCanonical, providerResponseFailed, isSuccessfulProviderCompletion, requestPendingMaterialization, pendingMaterializationOrigin, hasPendingMaterializationOrigin, hasExplicitRefreshRequest, clearPendingMaterialization, clearReclaimedMaterialization, clearPendingMaterializationOrigin, recordSystemRefreshOwnership, recordSystemPromptForRequest, recordHeldHeadForRequest, bindSystemPromptResponse, acknowledgeSystemPromptDelivery, deferDeliveredSystemRefresh, clearSystemPromptDelivery, saveLkgSlotToDb, loadPersistedLkgSlot, drainStaleLkgSlots, createDbLkgPersistence, replayLkg, beginServedRequest, noteServedPassPermission, noteServedReplay, countServedRefusal, dropServedRecord, commitServedRequest, registerLkgPersistence, LKG_SNAPSHOT_ARRAY, LKG_SNAPSHOT_OBJECT, LKG_SNAPSHOT_KEY, LKG_SNAPSHOT_STRING, LKG_SNAPSHOT_NUMBER, LKG_SNAPSHOT_BOOLEAN, LKG_SNAPSHOT_NULL, LKG_SNAPSHOT_UNDEFINED, contentSnapshotValue, signatureForFields, lkgContentFields, lkgContentDigestFromFields, isLegacyLkgDigest, legacyLkgDigestFromFields, lkgFieldsMatchDigest, exactReusablePrefix, incrementalLkgContentDigests, lkgSlotRejection, captureSlot, getInMemorySlot, getSlot, dropSlot, TOOL_SWEEP_SCOPED_MARKER, encodePiContentDecision, decodePiContentDecision, getPiContentDecisions, freezePiContentDecision, withNativeReplayWriteBarrier, getNativeReplayState, saveNativeToolInputs, addNativeReasoningIds, copySessionStateForClone, externalHistorianFailureReason, subprocessExitHistorianFailureReason, countHistorianRuns, getRecentFailedHistorianRunTimes, recordHistorianRun, summarizeImportance, tallyFactsByCategory, queueMemoryMutation, getMemoryMutationsForRender, getMemoryMutationsForRenderByProjects, getMaxMemoryMutationId, getMaxMemoryMutationIdForProjects, GLOBAL_USER_PROFILE_PROJECT_PATH, getProjectState, bumpProjectUserProfileVersion, saveSourceContent, getSourceContents, recordSubagentInvocation, getLatestHistorianInvocationId, renderMessageByOrdinal2, renderVerboseRange2, renderVerboseRangeForTool2, renderItemByTag2 };
|
package/dist/index.js
CHANGED
|
@@ -145,6 +145,13 @@ import {
|
|
|
145
145
|
resolvePiHarnessDetection,
|
|
146
146
|
resolvePiHarnessKind,
|
|
147
147
|
readSubagentStartupError,
|
|
148
|
+
legacyTui,
|
|
149
|
+
canRenderPiRows,
|
|
150
|
+
piTerminalRows,
|
|
151
|
+
piOverlayOptions,
|
|
152
|
+
matchesKey,
|
|
153
|
+
truncateToWidth,
|
|
154
|
+
visibleWidth,
|
|
148
155
|
inheritPiOrdinalAlignment,
|
|
149
156
|
resolvePiOrdinalAlignment,
|
|
150
157
|
piRawOrdinalOffsetSource,
|
|
@@ -158,7 +165,7 @@ import {
|
|
|
158
165
|
registerTodoStateLifecycle,
|
|
159
166
|
syncCtxMemoryToolEnabled,
|
|
160
167
|
registerMagicContextTools
|
|
161
|
-
} from "./index-
|
|
168
|
+
} from "./index-6bjc4pam.js";
|
|
162
169
|
import"./index-4knyh1kt.js";
|
|
163
170
|
import {
|
|
164
171
|
canonicalModelIdentity,
|
|
@@ -500,6 +507,7 @@ import {
|
|
|
500
507
|
getCompartments,
|
|
501
508
|
getLastCompartmentEndMessage,
|
|
502
509
|
getLastCompartmentEndMessageId,
|
|
510
|
+
cachedHistoryCoversLatestCompartment,
|
|
503
511
|
getCompartmentsByEndMessageId,
|
|
504
512
|
appendCompartments,
|
|
505
513
|
saveRecompStagingPass,
|
|
@@ -590,7 +598,7 @@ import {
|
|
|
590
598
|
getSourceContents,
|
|
591
599
|
recordSubagentInvocation,
|
|
592
600
|
getLatestHistorianInvocationId
|
|
593
|
-
} from "./index-
|
|
601
|
+
} from "./index-xxjx713t.js";
|
|
594
602
|
import {
|
|
595
603
|
resolveOpenCodeDbPath,
|
|
596
604
|
assertOpenCodeStoreGeneration,
|
|
@@ -788,7 +796,7 @@ import {
|
|
|
788
796
|
embedSessionCompartmentChunks2,
|
|
789
797
|
getEmbeddingCoverageStatus2,
|
|
790
798
|
getAutoEmbeddingSessionCoverage2
|
|
791
|
-
} from "./index-
|
|
799
|
+
} from "./index-0bmsfzqf.js";
|
|
792
800
|
import {
|
|
793
801
|
USER_FACING_FAILURES,
|
|
794
802
|
renderUserFacingFailure,
|
|
@@ -823,8 +831,8 @@ import {
|
|
|
823
831
|
scheduleClearAndReindex,
|
|
824
832
|
clearSessionTracking,
|
|
825
833
|
createAutoSearchDiagnostics
|
|
826
|
-
} from "./index-
|
|
827
|
-
import"./index-
|
|
834
|
+
} from "./index-px5g7twk.js";
|
|
835
|
+
import"./index-gczr1m66.js";
|
|
828
836
|
import"./index-3s39a1md.js";
|
|
829
837
|
import {
|
|
830
838
|
DREAMER_PRIMER_INVESTIGATOR_ALLOWED_TOOLS,
|
|
@@ -857,7 +865,7 @@ import {
|
|
|
857
865
|
} from "./index-wmkkxwvf.js";
|
|
858
866
|
import"./index-71rg8j43.js";
|
|
859
867
|
import"./index-8d2z6503.js";
|
|
860
|
-
import"./index-
|
|
868
|
+
import"./index-0x61mf6t.js";
|
|
861
869
|
import"./index-cyzsn2hb.js";
|
|
862
870
|
import {
|
|
863
871
|
__toESM
|
|
@@ -3610,7 +3618,7 @@ function startHostStallProfilerSwitch() {
|
|
|
3610
3618
|
// package.json
|
|
3611
3619
|
var package_default = {
|
|
3612
3620
|
name: "@cortexkit/pi-magic-context",
|
|
3613
|
-
version: "0.49.
|
|
3621
|
+
version: "0.49.77",
|
|
3614
3622
|
type: "module",
|
|
3615
3623
|
description: "Pi and OMP coding agent extension for Magic Context — cross-session memory and context management",
|
|
3616
3624
|
main: "dist/index.js",
|
|
@@ -3639,7 +3647,7 @@ var package_default = {
|
|
|
3639
3647
|
],
|
|
3640
3648
|
"//": "The build intentionally bundles typebox (no --external typebox) and keeps it a regular dependency. OMP's extension loader rewrites every bare `typebox` import to its own omptype-based shim, whose schemas are callable objects rather than JSON Schema; they fail structuredClone during tool registration, so an external typebox import stops Magic Context loading on OMP. src/typebox-bundling.test.ts guards this.",
|
|
3641
3649
|
scripts: {
|
|
3642
|
-
build: "bun ../../scripts/check-bun.mjs && tsc -p ../retina-local-fs/tsconfig.build.json && bun ../../scripts/clean-dist-chunks.mjs dist index.js subagent-entry.js historian-calibration-extension.js embedding-worker-process.js raw-ordinal-warmup-worker.js tag-snapshot-worker-pi.js transformers-web.js transformers-node-wasm.js && bun build ../plugin/src/features/magic-context/memory/transformers-web-entry.ts --outfile dist/transformers-web.js --target browser --format esm --external onnxruntime-web && bun ../plugin/scripts/build-transformers-node-wasm.ts dist && bun build src/index.ts src/tag-snapshot-worker-pi.ts src/subagent-entry.ts src/historian-calibration-extension.ts ../plugin/src/features/magic-context/memory/embedding-worker.ts ../plugin/src/features/magic-context/memory/embedding-worker-process.ts ../plugin/src/features/magic-context/migration-worker.ts ../plugin/src/hooks/magic-context/auto-search-worker.ts ../plugin/src/hooks/magic-context/raw-ordinal-warmup-worker.ts ../plugin/src/features/magic-context/compaction-marker-candidates-worker.ts ../plugin/src/features/magic-context/chunk-embedding-write-worker.ts --outdir dist --entry-naming '[name].[ext]' --target node --format esm --splitting --external @earendil-works/pi-coding-agent --external @oh-my-pi/pi-coding-agent --external @earendil-works/pi-tui --external @earendil-works/pi-ai --external onnxruntime-node --external onnxruntime-web --external sharp --external bun:ffi --external node:sqlite",
|
|
3650
|
+
build: "bun ../../scripts/check-bun.mjs && tsc -p ../retina-local-fs/tsconfig.build.json && bun ../../scripts/clean-dist-chunks.mjs dist index.js subagent-entry.js historian-calibration-extension.js embedding-worker-process.js raw-ordinal-warmup-worker.js tag-snapshot-worker-pi.js transformers-web.js transformers-node-wasm.js && bun build ../plugin/src/features/magic-context/memory/transformers-web-entry.ts --outfile dist/transformers-web.js --target browser --format esm --external onnxruntime-web && bun ../plugin/scripts/build-transformers-node-wasm.ts dist && bun build src/index.ts src/tag-snapshot-worker-pi.ts src/subagent-entry.ts src/historian-calibration-extension.ts ../plugin/src/features/magic-context/memory/embedding-worker.ts ../plugin/src/features/magic-context/memory/embedding-worker-process.ts ../plugin/src/features/magic-context/migration-worker.ts ../plugin/src/hooks/magic-context/auto-search-worker.ts ../plugin/src/hooks/magic-context/raw-ordinal-warmup-worker.ts ../plugin/src/features/magic-context/compaction-marker-candidates-worker.ts ../plugin/src/features/magic-context/chunk-embedding-write-worker.ts --outdir dist --entry-naming '[name].[ext]' --target node --format esm --splitting --external @earendil-works/pi-coding-agent --external @oh-my-pi/pi-coding-agent --external @earendil-works/pi-tui --external @oh-my-pi/pi-tui --external '@oh-my-pi/pi-tui/*' --external @earendil-works/pi-ai --external onnxruntime-node --external onnxruntime-web --external sharp --external bun:ffi --external node:sqlite",
|
|
3643
3651
|
"build:e2e-argv": `bun ../../scripts/clean-dist-chunks.mjs ../../tests/docker/.generated subagent-runner-e2e.mjs && bun build src/subagent-runner.ts --outdir ../../tests/docker/.generated --entry-naming 'subagent-runner-e2e.mjs' --splitting --target node --format esm --external node:sqlite && node --input-type=module -e 'const { __test } = await import("../../tests/docker/.generated/subagent-runner-e2e.mjs"); if (typeof __test.buildArgs !== "function" || typeof __test.resolvePiInvocation !== "function") throw new Error("argv renderer exports missing"); console.log("Node argv renderer: 2 exports loaded")'`,
|
|
3644
3652
|
typecheck: "tsc -p ../retina-local-fs/tsconfig.build.json && tsc --noEmit",
|
|
3645
3653
|
test: "bun ../../scripts/check-bun.mjs && bun install --frozen-lockfile && MC_SLOW_TESTS=0 BUN_JSC_useOMGJIT=0 bun test --parallel=4 --timeout 30000",
|
|
@@ -12818,11 +12826,9 @@ function validateDocsProposal(projectDir, output, budget, expected) {
|
|
|
12818
12826
|
while (result.tokens > budget && result.kept.length) {
|
|
12819
12827
|
const reason = `over budget: ${result.tokens} > ${budget}`;
|
|
12820
12828
|
const latestGrowth = [...result.kept].reverse().find((item) => item.grew);
|
|
12821
|
-
if (latestGrowth)
|
|
12822
|
-
|
|
12823
|
-
|
|
12824
|
-
for (const item of result.kept)
|
|
12825
|
-
overBudget.set(item.index, reason);
|
|
12829
|
+
if (!latestGrowth)
|
|
12830
|
+
break;
|
|
12831
|
+
overBudget.set(latestGrowth.index, reason);
|
|
12826
12832
|
result = applyChanges(items, originals, overBudget);
|
|
12827
12833
|
}
|
|
12828
12834
|
const diffs = FILES.filter((file) => originals[file] !== result.docs[file]).map((file) => diff(file, originals[file], result.docs[file])).join("");
|
|
@@ -22182,10 +22188,11 @@ function buildArgs(options, opts) {
|
|
|
22182
22188
|
args.push("--extension", historianCalibrationEntryPath);
|
|
22183
22189
|
}
|
|
22184
22190
|
const strictTools = STRICT_TOOL_ALLOWLIST.get(options.agent);
|
|
22191
|
+
const emptyToolFlag = ompTarget ? "--tools=" : "--no-tools";
|
|
22185
22192
|
let activeToolNames = [];
|
|
22186
22193
|
if (strictTools === undefined) {
|
|
22187
|
-
sessionLog2(options.accountingSessionId ?? "pi-subagent", `Pi subagent agent "${options.agent}" has no strict tool allow-list; forcing
|
|
22188
|
-
args.push(
|
|
22194
|
+
sessionLog2(options.accountingSessionId ?? "pi-subagent", `Pi subagent agent "${options.agent}" has no strict tool allow-list; forcing an empty tool list`);
|
|
22195
|
+
args.push(emptyToolFlag);
|
|
22189
22196
|
} else {
|
|
22190
22197
|
const resolution = resolveHostToolAllowlistDetails(strictTools, ompTarget, ompTarget ? opts?.hostToolNames : undefined);
|
|
22191
22198
|
const hostTools = resolution.tools;
|
|
@@ -22203,7 +22210,7 @@ function buildArgs(options, opts) {
|
|
|
22203
22210
|
if (hostTools.length > 0) {
|
|
22204
22211
|
args.push("--tools", hostTools.join(","));
|
|
22205
22212
|
} else {
|
|
22206
|
-
args.push(
|
|
22213
|
+
args.push(emptyToolFlag);
|
|
22207
22214
|
}
|
|
22208
22215
|
}
|
|
22209
22216
|
if (ompTarget) {
|
|
@@ -23528,7 +23535,6 @@ function makeMessage(role, parts) {
|
|
|
23528
23535
|
}
|
|
23529
23536
|
|
|
23530
23537
|
// src/commands/pi-command-utils.ts
|
|
23531
|
-
import { Box, matchesKey, Text } from "@earendil-works/pi-tui";
|
|
23532
23538
|
var CTX_STATUS_CUSTOM_TYPE = "ctx-status";
|
|
23533
23539
|
var statusLifecycleSignals = new WeakMap;
|
|
23534
23540
|
function registerCtxStatusLifecycleSignal(pi, signal) {
|
|
@@ -23550,11 +23556,13 @@ function resolveSessionId(ctx) {
|
|
|
23550
23556
|
}
|
|
23551
23557
|
}
|
|
23552
23558
|
async function showCtxStatusDialog(ctx, content) {
|
|
23559
|
+
if (!canRenderPiRows)
|
|
23560
|
+
return false;
|
|
23553
23561
|
let factoryInvoked = false;
|
|
23554
23562
|
await ctx.ui.custom((_tui, theme, _keybindings, done) => {
|
|
23555
23563
|
factoryInvoked = true;
|
|
23556
23564
|
return new CtxStatusDialog(content, theme, done);
|
|
23557
|
-
},
|
|
23565
|
+
}, piOverlayOptions(92));
|
|
23558
23566
|
return factoryInvoked;
|
|
23559
23567
|
}
|
|
23560
23568
|
|
|
@@ -23598,13 +23606,13 @@ function statusTitleColor(level) {
|
|
|
23598
23606
|
}
|
|
23599
23607
|
var renderCtxStatusEntry = (entry, _options, theme) => {
|
|
23600
23608
|
const data = entry?.data;
|
|
23601
|
-
if (!data || typeof data !== "object" || typeof data.title !== "string" || typeof data.text !== "string") {
|
|
23609
|
+
if (!legacyTui || !data || typeof data !== "object" || typeof data.title !== "string" || typeof data.text !== "string") {
|
|
23602
23610
|
return;
|
|
23603
23611
|
}
|
|
23604
23612
|
const title = theme.bold(theme.fg(statusTitleColor(data.level), `[${data.title}]`));
|
|
23605
23613
|
const body = theme.fg("customMessageText", data.text);
|
|
23606
|
-
const box = new Box(1, 0, (text) => theme.bg("customMessageBg", text));
|
|
23607
|
-
box.addChild(new Text(`${title}
|
|
23614
|
+
const box = new legacyTui.Box(1, 0, (text) => theme.bg("customMessageBg", text));
|
|
23615
|
+
box.addChild(new legacyTui.Text(`${title}
|
|
23608
23616
|
${body}`));
|
|
23609
23617
|
return box;
|
|
23610
23618
|
};
|
|
@@ -36311,14 +36319,16 @@ function softRefreshCachedM1Pi(args) {
|
|
|
36311
36319
|
throw new PiMaterializeContentionError(`missing sibling cached m[0]/m[1] for ${args.state.sessionId}`);
|
|
36312
36320
|
}
|
|
36313
36321
|
const siblingCompartments = getRenderableCompartmentsPi(args.db, args.state);
|
|
36322
|
+
const replayed = applyCachedPiRow({
|
|
36323
|
+
row: sibling,
|
|
36324
|
+
state: args.state,
|
|
36325
|
+
compartmentsForNormalization: siblingCompartments
|
|
36326
|
+
});
|
|
36314
36327
|
return {
|
|
36315
|
-
...
|
|
36316
|
-
row: sibling,
|
|
36317
|
-
state: args.state,
|
|
36318
|
-
compartmentsForNormalization: siblingCompartments
|
|
36319
|
-
}),
|
|
36328
|
+
...replayed,
|
|
36320
36329
|
memoryUpdateCount: 0,
|
|
36321
|
-
recomputed: false
|
|
36330
|
+
recomputed: false,
|
|
36331
|
+
wrapupPublicationUnconfirmed: args.state.skipPressureRefold === true && !cachedHistoryCoversLatestCompartment(siblingCompartments, replayed.markers.maxCompartmentSeq, replayed.markers.lastBaselineEndMessageId)
|
|
36322
36332
|
};
|
|
36323
36333
|
}
|
|
36324
36334
|
steps.mark("staleCheck");
|
|
@@ -36481,6 +36491,7 @@ function injectM0M1Pi(state, db, piMessages, entryIds, recomputeM1ThisPass = fal
|
|
|
36481
36491
|
let contentionExhausted = false;
|
|
36482
36492
|
let memoryUpdateCount = 0;
|
|
36483
36493
|
let m1Recomputed = false;
|
|
36494
|
+
let wrapupPublicationUnconfirmed;
|
|
36484
36495
|
let freshFallbackRenderedMemoryIds = null;
|
|
36485
36496
|
if (decision.value) {
|
|
36486
36497
|
try {
|
|
@@ -36559,6 +36570,7 @@ function injectM0M1Pi(state, db, piMessages, entryIds, recomputeM1ThisPass = fal
|
|
|
36559
36570
|
markers = refreshed.markers;
|
|
36560
36571
|
memoryUpdateCount = refreshed.memoryUpdateCount;
|
|
36561
36572
|
m1Recomputed = refreshed.recomputed;
|
|
36573
|
+
wrapupPublicationUnconfirmed = refreshed.wrapupPublicationUnconfirmed;
|
|
36562
36574
|
} catch (error) {
|
|
36563
36575
|
if (!state.allowFreshContentionFallback)
|
|
36564
36576
|
throw error;
|
|
@@ -36641,6 +36653,7 @@ function injectM0M1Pi(state, db, piMessages, entryIds, recomputeM1ThisPass = fal
|
|
|
36641
36653
|
m0Bytes: m0.length,
|
|
36642
36654
|
m1Bytes: m1.length,
|
|
36643
36655
|
contentionExhausted,
|
|
36656
|
+
wrapupPublicationUnconfirmed,
|
|
36644
36657
|
renderedBoundary,
|
|
36645
36658
|
m1RenderedCoverage,
|
|
36646
36659
|
syntheticLeadingCount: insertionIndex + 2
|
|
@@ -37696,9 +37709,6 @@ function resolvePiUsableContextLimit(args) {
|
|
|
37696
37709
|
return resolvePiWindowGeometry(args)?.usableSoft;
|
|
37697
37710
|
}
|
|
37698
37711
|
|
|
37699
|
-
// src/pi-context-refusal.ts
|
|
37700
|
-
import { Text as Text2 } from "@earendil-works/pi-tui";
|
|
37701
|
-
|
|
37702
37712
|
// src/omp-diagnostic-context.ts
|
|
37703
37713
|
function isOmpDumpContextStack(stack) {
|
|
37704
37714
|
if (!stack)
|
|
@@ -43885,8 +43895,8 @@ function piImageWirePlaceholder(args) {
|
|
|
43885
43895
|
return args.role === "toolResult" ? PI_NON_VISION_TOOL_IMAGE_PLACEHOLDER : PI_NON_VISION_USER_IMAGE_PLACEHOLDER;
|
|
43886
43896
|
return;
|
|
43887
43897
|
}
|
|
43888
|
-
function
|
|
43889
|
-
const placeholder = piImageWirePlaceholder(
|
|
43898
|
+
function piImageWireTokens(args) {
|
|
43899
|
+
const placeholder = piImageWirePlaceholder(args);
|
|
43890
43900
|
return placeholder === undefined ? PI_IMAGE_TOKENS : estimateTokens(placeholder);
|
|
43891
43901
|
}
|
|
43892
43902
|
function piMessagesWithWireImages(messages, args) {
|
|
@@ -44715,7 +44725,10 @@ function registerPiGuardedContext(pi, handler, options = {}) {
|
|
|
44715
44725
|
return operation?.refused ? piRefusedPayload(operation.refusalMessage ?? RETRY_MESSAGE) : undefined;
|
|
44716
44726
|
});
|
|
44717
44727
|
}
|
|
44718
|
-
|
|
44728
|
+
if (legacyTui) {
|
|
44729
|
+
const { Text } = legacyTui;
|
|
44730
|
+
pi.registerEntryRenderer?.(ENTRY_TYPE, (entry) => new Text(entry.data?.message ?? RETRY_MESSAGE, 0, 0));
|
|
44731
|
+
}
|
|
44719
44732
|
pi.on("context", async (event, ctx) => {
|
|
44720
44733
|
if (fenceEnabled && isOmpDumpContext())
|
|
44721
44734
|
return { messages: event.messages };
|
|
@@ -47764,8 +47777,8 @@ function createPiTranscript(source, sessionId, entryIds, options = {}) {
|
|
|
47764
47777
|
toolRemovals.set(working, removals);
|
|
47765
47778
|
if (options.authorizeToolRemoval)
|
|
47766
47779
|
toolRemovalAuthorization.set(working, options.authorizeToolRemoval);
|
|
47767
|
-
if (options.
|
|
47768
|
-
|
|
47780
|
+
if (options.imageTokens)
|
|
47781
|
+
imageTokenCost.set(working, options.imageTokens);
|
|
47769
47782
|
const emptyRemovedMessages = new Set;
|
|
47770
47783
|
const toolInputChanges = new Map;
|
|
47771
47784
|
const transcriptMessages = buildTranscriptView(working, sessionId, (messageIndex, toolCallId) => {
|
|
@@ -48028,7 +48041,7 @@ function createPiUserArrayPart(working, messageIndex, partIndex, markDirty) {
|
|
|
48028
48041
|
ignored: msg.ignored || part?.ignored,
|
|
48029
48042
|
imageTokens() {
|
|
48030
48043
|
const current = working[messageIndex].content;
|
|
48031
|
-
return Array.isArray(current) && current[partIndex]?.type === "image" ? PI_IMAGE_TOKENS : 0;
|
|
48044
|
+
return Array.isArray(current) && current[partIndex]?.type === "image" ? imageTokenCost.get(working)?.(messageIndex, partIndex) ?? PI_IMAGE_TOKENS : 0;
|
|
48032
48045
|
},
|
|
48033
48046
|
id: undefined,
|
|
48034
48047
|
getText() {
|
|
@@ -48239,8 +48252,7 @@ function createPiToolResultPart(working, messageIndex, partIndex, markDirty) {
|
|
|
48239
48252
|
imageTokens() {
|
|
48240
48253
|
if (working[messageIndex].content[partIndex]?.type !== "image")
|
|
48241
48254
|
return 0;
|
|
48242
|
-
|
|
48243
|
-
return cost ? cost(messageIndex, partIndex) : PI_IMAGE_TOKENS;
|
|
48255
|
+
return imageTokenCost.get(working)?.(messageIndex, partIndex) ?? PI_IMAGE_TOKENS;
|
|
48244
48256
|
},
|
|
48245
48257
|
remove() {
|
|
48246
48258
|
return markToolRemoval(working, messageIndex, partIndex);
|
|
@@ -48339,7 +48351,7 @@ function extractStableId(msg, index, entryIds) {
|
|
|
48339
48351
|
}
|
|
48340
48352
|
var toolRemovals = new WeakMap;
|
|
48341
48353
|
var toolRemovalAuthorization = new WeakMap;
|
|
48342
|
-
var
|
|
48354
|
+
var imageTokenCost = new WeakMap;
|
|
48343
48355
|
function markToolRemoval(working, messageIndex, partIndex) {
|
|
48344
48356
|
const removals = toolRemovals.get(working);
|
|
48345
48357
|
if (!removals)
|
|
@@ -52918,9 +52930,10 @@ async function runPipeline(args) {
|
|
|
52918
52930
|
saved: nativeRemovalInputs,
|
|
52919
52931
|
canApply: isCacheBustingPass
|
|
52920
52932
|
}),
|
|
52921
|
-
|
|
52933
|
+
imageTokens: (messageIndex, partIndex) => {
|
|
52922
52934
|
const message = args.messages[messageIndex];
|
|
52923
|
-
return
|
|
52935
|
+
return piImageWireTokens({
|
|
52936
|
+
role: message?.role,
|
|
52924
52937
|
block: Array.isArray(message?.content) ? message.content[partIndex] : undefined,
|
|
52925
52938
|
stripped: imageStrippedMessage(message, messageIndex),
|
|
52926
52939
|
modelAcceptsImages: args.modelAcceptsImages !== false
|
|
@@ -53899,7 +53912,7 @@ async function runPipeline(args) {
|
|
|
53899
53912
|
}
|
|
53900
53913
|
}
|
|
53901
53914
|
if (!heldHeadReleasedForSystemChange) {
|
|
53902
|
-
if (wrapupPending && isCacheBustingPass && !protectedSignedPrefix && wireInjectionResult.injected && !wireInjectionResult.contentionExhausted) {
|
|
53915
|
+
if (wrapupPending && isCacheBustingPass && !protectedSignedPrefix && wireInjectionResult.injected && !wireInjectionResult.contentionExhausted && !wireInjectionResult.wrapupPublicationUnconfirmed) {
|
|
53903
53916
|
clearPendingMaterializationOrigin(pendingMaterializationSessions, args.sessionId, "user_wrapup");
|
|
53904
53917
|
historyWasConsumedThisPass = true;
|
|
53905
53918
|
}
|
|
@@ -55128,13 +55141,6 @@ function inferLevel(text) {
|
|
|
55128
55141
|
return "info";
|
|
55129
55142
|
}
|
|
55130
55143
|
|
|
55131
|
-
// src/dialogs/status-dialog.ts
|
|
55132
|
-
import {
|
|
55133
|
-
matchesKey as matchesKey2,
|
|
55134
|
-
truncateToWidth,
|
|
55135
|
-
visibleWidth
|
|
55136
|
-
} from "@earendil-works/pi-tui";
|
|
55137
|
-
|
|
55138
55144
|
// ../plugin/src/features/magic-context/memory/memory-diagnostics.ts
|
|
55139
55145
|
function emptyMemoryImportanceHistogram() {
|
|
55140
55146
|
return {
|
|
@@ -56179,6 +56185,10 @@ async function showStatusDialog(pi, ctx, deps) {
|
|
|
56179
56185
|
const sessionId = resolveSessionId(ctx);
|
|
56180
56186
|
if (!sessionId)
|
|
56181
56187
|
throw new Error("No active Pi session is available.");
|
|
56188
|
+
if (!canRenderPiRows) {
|
|
56189
|
+
ctx.ui.notify(formatPiStatusSummary(buildPiStatusDetail(pi, ctx, deps, sessionId)), "info");
|
|
56190
|
+
return;
|
|
56191
|
+
}
|
|
56182
56192
|
await ctx.ui.custom((tui, theme, _keybindings, done) => new StatusDialogComponent({
|
|
56183
56193
|
pi,
|
|
56184
56194
|
ctx,
|
|
@@ -56187,10 +56197,7 @@ async function showStatusDialog(pi, ctx, deps) {
|
|
|
56187
56197
|
theme,
|
|
56188
56198
|
tui,
|
|
56189
56199
|
done
|
|
56190
|
-
}),
|
|
56191
|
-
overlay: true,
|
|
56192
|
-
overlayOptions: { anchor: "center", width: 78 }
|
|
56193
|
-
});
|
|
56200
|
+
}), piOverlayOptions(78));
|
|
56194
56201
|
}
|
|
56195
56202
|
var openStatusDialogs = new Set;
|
|
56196
56203
|
function stopStatusDialogRefresh() {
|
|
@@ -56224,22 +56231,22 @@ class StatusDialogComponent {
|
|
|
56224
56231
|
handleInput(data) {
|
|
56225
56232
|
if (this.closed)
|
|
56226
56233
|
return;
|
|
56227
|
-
if (
|
|
56234
|
+
if (matchesKey(data, "escape") || matchesKey(data, "ctrl+c") || matchesKey(data, "return")) {
|
|
56228
56235
|
this.close();
|
|
56229
56236
|
return;
|
|
56230
56237
|
}
|
|
56231
56238
|
let offset = this.scrollOffset;
|
|
56232
|
-
if (
|
|
56239
|
+
if (matchesKey(data, "up"))
|
|
56233
56240
|
offset -= 1;
|
|
56234
|
-
else if (
|
|
56241
|
+
else if (matchesKey(data, "down"))
|
|
56235
56242
|
offset += 1;
|
|
56236
|
-
else if (
|
|
56243
|
+
else if (matchesKey(data, "pageUp"))
|
|
56237
56244
|
offset -= this.viewportHeight;
|
|
56238
|
-
else if (
|
|
56245
|
+
else if (matchesKey(data, "pageDown"))
|
|
56239
56246
|
offset += this.viewportHeight;
|
|
56240
|
-
else if (
|
|
56247
|
+
else if (matchesKey(data, "home"))
|
|
56241
56248
|
offset = 0;
|
|
56242
|
-
else if (
|
|
56249
|
+
else if (matchesKey(data, "end"))
|
|
56243
56250
|
offset = this.maxScrollOffset;
|
|
56244
56251
|
else
|
|
56245
56252
|
return;
|
|
@@ -56257,7 +56264,7 @@ class StatusDialogComponent {
|
|
|
56257
56264
|
const frameWidth = BORDER_COLUMNS + PADDING_COLUMNS;
|
|
56258
56265
|
const innerWidth = Math.max(1, width - frameWidth);
|
|
56259
56266
|
const inner = renderPiStatusOverlay(this.detail, this.props.theme, innerWidth);
|
|
56260
|
-
const rows = Math.max(0, this.props.tui
|
|
56267
|
+
const rows = Math.max(0, piTerminalRows(this.props.tui));
|
|
56261
56268
|
const header = inner.slice(0, 1);
|
|
56262
56269
|
const footer = inner.slice(-1);
|
|
56263
56270
|
const body = inner.slice(header.length, inner.length - footer.length);
|
package/dist/{project-embedding-registry-2natnvdf.js → project-embedding-registry-zgzq9ehw.js}
RENAMED
|
@@ -18,6 +18,8 @@ import {
|
|
|
18
18
|
unregisterProjectShadowEmbedding2,
|
|
19
19
|
unregisterProjectEmbedding2,
|
|
20
20
|
getProjectEmbeddingSnapshot2,
|
|
21
|
+
readSearchBackfillCursor2,
|
|
22
|
+
writeSearchBackfillCursor2,
|
|
21
23
|
installProjectEmbeddingSearchBridge2,
|
|
22
24
|
getProjectChunkEmbeddingModelId2,
|
|
23
25
|
getProjectEmbeddingMaxInputTokens2,
|
|
@@ -34,7 +36,7 @@ import {
|
|
|
34
36
|
sweepAllRegisteredProjects2,
|
|
35
37
|
_setTestProviderFactoryForProject2,
|
|
36
38
|
_resetProjectEmbeddingRegistryForTests2
|
|
37
|
-
} from "./index-
|
|
39
|
+
} from "./index-0bmsfzqf.js";
|
|
38
40
|
import"./index-9p40dgkm.js";
|
|
39
41
|
import"./index-hgd00nas.js";
|
|
40
42
|
import"./index-yhzhdp3m.js";
|
|
@@ -85,10 +87,12 @@ export {
|
|
|
85
87
|
installProjectEmbeddingSearchBridge2 as installProjectEmbeddingSearchBridge,
|
|
86
88
|
listShadowBackfillStalls2 as listShadowBackfillStalls,
|
|
87
89
|
markProjectLoadUntrusted2 as markProjectLoadUntrusted,
|
|
90
|
+
readSearchBackfillCursor2 as readSearchBackfillCursor,
|
|
88
91
|
registerProjectEmbedding2 as registerProjectEmbedding,
|
|
89
92
|
registerProjectInObservationMode2 as registerProjectInObservationMode,
|
|
90
93
|
registerProjectShadowEmbedding2 as registerProjectShadowEmbedding,
|
|
91
94
|
sweepAllRegisteredProjects2 as sweepAllRegisteredProjects,
|
|
92
95
|
unregisterProjectEmbedding2 as unregisterProjectEmbedding,
|
|
93
|
-
unregisterProjectShadowEmbedding2 as unregisterProjectShadowEmbedding
|
|
96
|
+
unregisterProjectShadowEmbedding2 as unregisterProjectShadowEmbedding,
|
|
97
|
+
writeSearchBackfillCursor2 as writeSearchBackfillCursor
|
|
94
98
|
};
|
|
@@ -19,7 +19,7 @@ serveWorkerJobs(async (input, port) => {
|
|
|
19
19
|
await main();
|
|
20
20
|
async function main() {
|
|
21
21
|
if (input.v2ArchiveReader) {
|
|
22
|
-
const { serveV2ArchiveReads } = await import("./v2-archive-reader-
|
|
22
|
+
const { serveV2ArchiveReads } = await import("./v2-archive-reader-5cydt27v.js");
|
|
23
23
|
await serveV2ArchiveReads(port, openConnections);
|
|
24
24
|
return;
|
|
25
25
|
}
|
|
@@ -51,7 +51,7 @@ serveWorkerJobs(async (input, port) => {
|
|
|
51
51
|
await runMessageFtsRowidMapBackfill(db);
|
|
52
52
|
reply = { kind: "fts-rowid-backfill" };
|
|
53
53
|
} else if (input.searchArchive) {
|
|
54
|
-
const { renderSearchArchive } = await import("./search-archive-
|
|
54
|
+
const { renderSearchArchive } = await import("./search-archive-33p4gebn.js");
|
|
55
55
|
const { readRawSessionMessageIdOrdinalsForRangeFromDb } = await import("./read-session-raw-0tytrjye.js");
|
|
56
56
|
const archive = input.searchArchive;
|
|
57
57
|
let raw;
|
|
@@ -5,13 +5,13 @@ import {
|
|
|
5
5
|
resolveMemoriesByIdsForSearch2,
|
|
6
6
|
unifiedSearch2,
|
|
7
7
|
formatSearchResults2
|
|
8
|
-
} from "./index-
|
|
8
|
+
} from "./index-px5g7twk.js";
|
|
9
9
|
import"./index-k7a8x7ba.js";
|
|
10
10
|
import"./index-mm9y1m77.js";
|
|
11
11
|
import"./index-8d2z6503.js";
|
|
12
|
-
import"./index-
|
|
12
|
+
import"./index-gczr1m66.js";
|
|
13
13
|
import"./index-29nw7n1r.js";
|
|
14
|
-
import"./index-
|
|
14
|
+
import"./index-0bmsfzqf.js";
|
|
15
15
|
import"./index-9p40dgkm.js";
|
|
16
16
|
import"./index-hgd00nas.js";
|
|
17
17
|
import"./index-yhzhdp3m.js";
|
package/dist/subagent-entry.js
CHANGED
|
@@ -34,27 +34,27 @@ import {
|
|
|
34
34
|
resolvePiHarnessKind,
|
|
35
35
|
reportSubagentStartupError,
|
|
36
36
|
registerMagicContextTools
|
|
37
|
-
} from "./index-
|
|
37
|
+
} from "./index-6bjc4pam.js";
|
|
38
38
|
import"./index-vcegxfwg.js";
|
|
39
39
|
import"./index-5rcjs14a.js";
|
|
40
40
|
import"./index-cxczethe.js";
|
|
41
41
|
import"./index-txcs0vnj.js";
|
|
42
|
-
import"./index-
|
|
42
|
+
import"./index-0bmsfzqf.js";
|
|
43
43
|
import"./index-hgd00nas.js";
|
|
44
44
|
import"./index-9p40dgkm.js";
|
|
45
45
|
import"./index-79xfn84y.js";
|
|
46
46
|
import"./index-yhzhdp3m.js";
|
|
47
|
-
import"./index-
|
|
48
|
-
import"./index-
|
|
47
|
+
import"./index-px5g7twk.js";
|
|
48
|
+
import"./index-xxjx713t.js";
|
|
49
49
|
import"./index-mm9y1m77.js";
|
|
50
50
|
import"./index-6gwasf0v.js";
|
|
51
51
|
import"./index-6x556c2q.js";
|
|
52
52
|
import"./index-nvh6d3bz.js";
|
|
53
53
|
import"./index-k7a8x7ba.js";
|
|
54
54
|
import"./index-8d2z6503.js";
|
|
55
|
-
import"./index-
|
|
55
|
+
import"./index-0x61mf6t.js";
|
|
56
56
|
import"./index-cyzsn2hb.js";
|
|
57
|
-
import"./index-
|
|
57
|
+
import"./index-gczr1m66.js";
|
|
58
58
|
import"./index-29nw7n1r.js";
|
|
59
59
|
import"./index-3s39a1md.js";
|
|
60
60
|
import"./index-1ts77n1b.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cortexkit/pi-magic-context",
|
|
3
|
-
"version": "0.49.
|
|
3
|
+
"version": "0.49.77",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Pi and OMP coding agent extension for Magic Context — cross-session memory and context management",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
],
|
|
30
30
|
"//": "The build intentionally bundles typebox (no --external typebox) and keeps it a regular dependency. OMP's extension loader rewrites every bare `typebox` import to its own omptype-based shim, whose schemas are callable objects rather than JSON Schema; they fail structuredClone during tool registration, so an external typebox import stops Magic Context loading on OMP. src/typebox-bundling.test.ts guards this.",
|
|
31
31
|
"scripts": {
|
|
32
|
-
"build": "bun ../../scripts/check-bun.mjs && tsc -p ../retina-local-fs/tsconfig.build.json && bun ../../scripts/clean-dist-chunks.mjs dist index.js subagent-entry.js historian-calibration-extension.js embedding-worker-process.js raw-ordinal-warmup-worker.js tag-snapshot-worker-pi.js transformers-web.js transformers-node-wasm.js && bun build ../plugin/src/features/magic-context/memory/transformers-web-entry.ts --outfile dist/transformers-web.js --target browser --format esm --external onnxruntime-web && bun ../plugin/scripts/build-transformers-node-wasm.ts dist && bun build src/index.ts src/tag-snapshot-worker-pi.ts src/subagent-entry.ts src/historian-calibration-extension.ts ../plugin/src/features/magic-context/memory/embedding-worker.ts ../plugin/src/features/magic-context/memory/embedding-worker-process.ts ../plugin/src/features/magic-context/migration-worker.ts ../plugin/src/hooks/magic-context/auto-search-worker.ts ../plugin/src/hooks/magic-context/raw-ordinal-warmup-worker.ts ../plugin/src/features/magic-context/compaction-marker-candidates-worker.ts ../plugin/src/features/magic-context/chunk-embedding-write-worker.ts --outdir dist --entry-naming '[name].[ext]' --target node --format esm --splitting --external @earendil-works/pi-coding-agent --external @oh-my-pi/pi-coding-agent --external @earendil-works/pi-tui --external @earendil-works/pi-ai --external onnxruntime-node --external onnxruntime-web --external sharp --external bun:ffi --external node:sqlite",
|
|
32
|
+
"build": "bun ../../scripts/check-bun.mjs && tsc -p ../retina-local-fs/tsconfig.build.json && bun ../../scripts/clean-dist-chunks.mjs dist index.js subagent-entry.js historian-calibration-extension.js embedding-worker-process.js raw-ordinal-warmup-worker.js tag-snapshot-worker-pi.js transformers-web.js transformers-node-wasm.js && bun build ../plugin/src/features/magic-context/memory/transformers-web-entry.ts --outfile dist/transformers-web.js --target browser --format esm --external onnxruntime-web && bun ../plugin/scripts/build-transformers-node-wasm.ts dist && bun build src/index.ts src/tag-snapshot-worker-pi.ts src/subagent-entry.ts src/historian-calibration-extension.ts ../plugin/src/features/magic-context/memory/embedding-worker.ts ../plugin/src/features/magic-context/memory/embedding-worker-process.ts ../plugin/src/features/magic-context/migration-worker.ts ../plugin/src/hooks/magic-context/auto-search-worker.ts ../plugin/src/hooks/magic-context/raw-ordinal-warmup-worker.ts ../plugin/src/features/magic-context/compaction-marker-candidates-worker.ts ../plugin/src/features/magic-context/chunk-embedding-write-worker.ts --outdir dist --entry-naming '[name].[ext]' --target node --format esm --splitting --external @earendil-works/pi-coding-agent --external @oh-my-pi/pi-coding-agent --external @earendil-works/pi-tui --external @oh-my-pi/pi-tui --external '@oh-my-pi/pi-tui/*' --external @earendil-works/pi-ai --external onnxruntime-node --external onnxruntime-web --external sharp --external bun:ffi --external node:sqlite",
|
|
33
33
|
"build:e2e-argv": "bun ../../scripts/clean-dist-chunks.mjs ../../tests/docker/.generated subagent-runner-e2e.mjs && bun build src/subagent-runner.ts --outdir ../../tests/docker/.generated --entry-naming 'subagent-runner-e2e.mjs' --splitting --target node --format esm --external node:sqlite && node --input-type=module -e 'const { __test } = await import(\"../../tests/docker/.generated/subagent-runner-e2e.mjs\"); if (typeof __test.buildArgs !== \"function\" || typeof __test.resolvePiInvocation !== \"function\") throw new Error(\"argv renderer exports missing\"); console.log(\"Node argv renderer: 2 exports loaded\")'",
|
|
34
34
|
"typecheck": "tsc -p ../retina-local-fs/tsconfig.build.json && tsc --noEmit",
|
|
35
35
|
"test": "bun ../../scripts/check-bun.mjs && bun install --frozen-lockfile && MC_SLOW_TESTS=0 BUN_JSC_useOMGJIT=0 bun test --parallel=4 --timeout 30000",
|