@cortexkit/opencode-magic-context 0.42.3 → 0.42.5
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/README.md +3 -1
- package/dist/{announcement-3c1vertn.js → announcement-8mgn61fw.js} +1 -1
- package/dist/{conflict-warning-hook-aedp084d.js → conflict-warning-hook-jyj54gbe.js} +4 -4
- package/dist/{derive-budgets-s2pgnnm4.js → derive-budgets-v1fkhjjr.js} +2 -2
- package/dist/features/magic-context/context-authority.d.ts +13 -0
- package/dist/features/magic-context/context-authority.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/classify.d.ts +3 -1
- package/dist/features/magic-context/dreamer/classify.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/curate-category-rotation.d.ts +26 -0
- package/dist/features/magic-context/dreamer/curate-category-rotation.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/storage-task-schedule.d.ts +7 -5
- package/dist/features/magic-context/dreamer/storage-task-schedule.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/task-executor.d.ts +6 -2
- package/dist/features/magic-context/dreamer/task-executor.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/task-gates.d.ts +1 -0
- package/dist/features/magic-context/dreamer/task-gates.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/task-prompts.d.ts +3 -0
- package/dist/features/magic-context/dreamer/task-prompts.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/task-registry.d.ts +9 -0
- package/dist/features/magic-context/dreamer/task-registry.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/task-scheduler.d.ts +5 -1
- package/dist/features/magic-context/dreamer/task-scheduler.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding-local.d.ts +11 -0
- package/dist/features/magic-context/memory/embedding-local.d.ts.map +1 -1
- package/dist/features/magic-context/mural/compress-cues.d.ts +3 -1
- package/dist/features/magic-context/mural/compress-cues.d.ts.map +1 -1
- package/dist/features/magic-context/transform-decision-log.d.ts +4 -0
- package/dist/features/magic-context/transform-decision-log.d.ts.map +1 -1
- package/dist/hooks/magic-context/apply-operations.d.ts +4 -1
- package/dist/hooks/magic-context/apply-operations.d.ts.map +1 -1
- package/dist/hooks/magic-context/caveman-cleanup.d.ts +4 -0
- package/dist/hooks/magic-context/caveman-cleanup.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-historian.d.ts +5 -2
- package/dist/hooks/magic-context/compartment-runner-historian.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-incremental.d.ts +2 -2
- package/dist/hooks/magic-context/compartment-runner-incremental.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-types.d.ts +61 -2
- package/dist/hooks/magic-context/compartment-runner-types.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner.d.ts +2 -2
- package/dist/hooks/magic-context/compartment-runner.d.ts.map +1 -1
- package/dist/hooks/magic-context/dropped-token-estimate.d.ts +20 -0
- package/dist/hooks/magic-context/dropped-token-estimate.d.ts.map +1 -0
- package/dist/hooks/magic-context/heuristic-cleanup.d.ts +2 -0
- package/dist/hooks/magic-context/heuristic-cleanup.d.ts.map +1 -1
- package/dist/hooks/magic-context/hook.d.ts +2 -2
- package/dist/hooks/magic-context/hook.d.ts.map +1 -1
- package/dist/hooks/magic-context/module-transport.d.ts +4 -1
- package/dist/hooks/magic-context/module-transport.d.ts.map +1 -1
- package/dist/hooks/magic-context/rust-mode-transform.d.ts +2 -0
- package/dist/hooks/magic-context/rust-mode-transform.d.ts.map +1 -1
- package/dist/hooks/magic-context/tail-hygiene-walk.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform-compartment-phase.d.ts +3 -0
- package/dist/hooks/magic-context/transform-compartment-phase.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts +8 -0
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform.d.ts +21 -0
- package/dist/hooks/magic-context/transform.d.ts.map +1 -1
- package/dist/{index-sf6x1ga9.js → index-1ar7b3e9.js} +3 -3
- package/dist/{index-wde5446v.js → index-3wbd8sdq.js} +225 -67
- package/dist/{index-3fe78beq.js → index-4ftb5hcq.js} +9 -1
- package/dist/{index-may8skc8.js → index-4wwr6cz0.js} +18 -1
- package/dist/{index-ecz14qke.js → index-d8mgqezq.js} +2 -2
- package/dist/{index-xdtge3y2.js → index-f9gem5cr.js} +2 -2
- package/dist/{index-z8552w7e.js → index-jkrqhc7y.js} +1 -1
- package/dist/{index-3wzdwt6p.js → index-ntbmt6rq.js} +1 -1
- package/dist/{index-gynz8qdc.js → index-p474rw9p.js} +3 -3
- package/dist/{index-dkv2dn46.js → index-qp20p2py.js} +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1625 -148
- package/dist/plugin/hooks/create-session-hooks.d.ts.map +1 -1
- package/dist/plugin/rpc-handlers.d.ts +18 -0
- package/dist/plugin/rpc-handlers.d.ts.map +1 -1
- package/dist/plugin/rust-tool-backends.d.ts +3 -1
- package/dist/plugin/rust-tool-backends.d.ts.map +1 -1
- package/dist/{recomp-orchestrator-447vycpt.js → recomp-orchestrator-k20sfpm2.js} +6 -6
- package/dist/{safe-notification-target-q9z81zt3.js → safe-notification-target-fepvcbsj.js} +1 -1
- package/dist/{send-session-notification-2mzgd3zf.js → send-session-notification-xnypkxpx.js} +3 -3
- package/dist/shared/harness.d.ts +2 -1
- package/dist/shared/harness.d.ts.map +1 -1
- package/dist/shared/model-suggestion-retry.d.ts +5 -1
- package/dist/shared/model-suggestion-retry.d.ts.map +1 -1
- package/dist/shared/prompt-surface-runtime.d.ts.map +1 -1
- package/dist/shared/rpc-types.d.ts +13 -0
- package/dist/shared/rpc-types.d.ts.map +1 -1
- package/dist/shared/status-detail-text.d.ts.map +1 -1
- package/dist/shared/status-summary.d.ts.map +1 -1
- package/dist/shared/user-facing-codes.d.ts +10 -0
- package/dist/shared/user-facing-codes.d.ts.map +1 -1
- package/dist/{storage-meta-session-fkmfhswa.js → storage-meta-session-x3j0q9qy.js} +3 -3
- package/dist/{task-config-hnv93r7p.js → task-config-cv8k9y8r.js} +1 -1
- package/dist/tools/ctx-memory/tools.d.ts.map +1 -1
- package/dist/tools/ctx-note/tools.d.ts.map +1 -1
- package/dist/v2/fold/markers.d.ts +7 -0
- package/dist/v2/fold/markers.d.ts.map +1 -0
- package/dist/v2/fold/owner.d.ts +40 -0
- package/dist/v2/fold/owner.d.ts.map +1 -0
- package/dist/v2/fold/restore.d.ts +11 -0
- package/dist/v2/fold/restore.d.ts.map +1 -0
- package/dist/v2/hidden-completion.d.ts +20 -0
- package/dist/v2/hidden-completion.d.ts.map +1 -0
- package/dist/v2/hooks/channel2.d.ts +8 -0
- package/dist/v2/hooks/channel2.d.ts.map +1 -0
- package/dist/v2/hooks/context.d.ts +7 -0
- package/dist/v2/hooks/context.d.ts.map +1 -0
- package/dist/v2/hooks/dream-trigger.d.ts +19 -0
- package/dist/v2/hooks/dream-trigger.d.ts.map +1 -0
- package/dist/v2/hooks/payload.d.ts +12 -0
- package/dist/v2/hooks/payload.d.ts.map +1 -0
- package/dist/v2/hooks/refusal.d.ts +7 -0
- package/dist/v2/hooks/refusal.d.ts.map +1 -0
- package/dist/v2/hooks/store.d.ts +6 -0
- package/dist/v2/hooks/store.d.ts.map +1 -0
- package/dist/v2/hooks/types.d.ts +90 -0
- package/dist/v2/hooks/types.d.ts.map +1 -0
- package/dist/v2/hooks/update-check.d.ts +10 -0
- package/dist/v2/hooks/update-check.d.ts.map +1 -0
- package/dist/v2/server.d.ts +3 -1
- package/dist/v2/server.d.ts.map +1 -1
- package/dist/v2/server.js +116641 -4
- package/dist/v2/store-reader.d.ts +2 -0
- package/dist/v2/store-reader.d.ts.map +1 -1
- package/index.js +1 -0
- package/package.json +5 -4
- package/src/features/magic-context/dreamer/task-registry.ts +29 -0
- package/src/shared/harness.ts +2 -1
- package/src/shared/model-suggestion-retry.ts +66 -14
- package/src/shared/prompt-surface-runtime.ts +5 -1
- package/src/shared/rpc-types.ts +13 -0
- package/src/shared/status-detail-text.test.ts +26 -0
- package/src/shared/status-detail-text.ts +11 -0
- package/src/shared/status-summary.ts +2 -0
- package/src/shared/user-facing-codes.test.ts +1 -1
- package/src/shared/user-facing-codes.ts +10 -0
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
// src/shared/harness.ts
|
|
2
2
|
var currentHarness = "opencode";
|
|
3
|
+
var harnessLocked = false;
|
|
4
|
+
function setHarness(value) {
|
|
5
|
+
if (harnessLocked && currentHarness !== value) {
|
|
6
|
+
throw new Error(`Magic Context: harness already locked to "${currentHarness}"; cannot change to "${value}"`);
|
|
7
|
+
}
|
|
8
|
+
currentHarness = value;
|
|
9
|
+
harnessLocked = true;
|
|
10
|
+
}
|
|
3
11
|
function getHarness() {
|
|
4
12
|
return currentHarness;
|
|
5
13
|
}
|
|
@@ -95,4 +103,4 @@ function getLegacyOpenCodeMagicContextStorageDir() {
|
|
|
95
103
|
return path.join(getOpenCodeStorageDir(), "plugin", "magic-context");
|
|
96
104
|
}
|
|
97
105
|
|
|
98
|
-
export { getHarness, getDataDir, getMagicContextLogPath, ensureCortexKitArtifactGitignore, getProjectMagicContextHistorianDir, getOpenCodeStorageDir, getMagicContextStorageResolution, getMagicContextStorageDir, getLegacyOpenCodeMagicContextStorageDir };
|
|
106
|
+
export { setHarness, getHarness, getDataDir, getMagicContextLogPath, ensureCortexKitArtifactGitignore, getProjectMagicContextHistorianDir, getOpenCodeStorageDir, getMagicContextStorageResolution, getMagicContextStorageDir, getLegacyOpenCodeMagicContextStorageDir };
|
|
@@ -17,9 +17,26 @@ var CANONICAL_DREAM_TASKS = [
|
|
|
17
17
|
"promote-primers",
|
|
18
18
|
"refresh-primers"
|
|
19
19
|
];
|
|
20
|
+
var DREAM_TASK_CAPABILITIES = {
|
|
21
|
+
"map-memories": { requiresTools: true },
|
|
22
|
+
verify: { requiresTools: true },
|
|
23
|
+
"verify-broad": { requiresTools: true },
|
|
24
|
+
curate: { requiresTools: true },
|
|
25
|
+
"compress-cues": { requiresTools: false },
|
|
26
|
+
"classify-memories": { requiresTools: false },
|
|
27
|
+
retrospective: { requiresTools: true },
|
|
28
|
+
"maintain-docs": { requiresTools: true },
|
|
29
|
+
"evaluate-smart-notes": { requiresTools: true },
|
|
30
|
+
"review-user-memories": { requiresTools: true },
|
|
31
|
+
"promote-primers": { requiresTools: true },
|
|
32
|
+
"refresh-primers": { requiresTools: true }
|
|
33
|
+
};
|
|
20
34
|
function formatDreamTaskBacklogs(backlogs, tasks = CANONICAL_DREAM_TASKS) {
|
|
21
35
|
return tasks.filter((task) => backlogs[task] !== undefined).map((task) => {
|
|
22
36
|
const backlog = backlogs[task];
|
|
37
|
+
if (task === "curate" && backlog?.category) {
|
|
38
|
+
return `- curate: ${backlog.category} (${backlog.pending})`;
|
|
39
|
+
}
|
|
23
40
|
return `- ${task}: ${backlog?.pending ?? 0} pending / ${backlog?.total ?? 0} total`;
|
|
24
41
|
}).join(`
|
|
25
42
|
`);
|
|
@@ -92,4 +109,4 @@ function userMemoryCollectionEnabled2(dreamer) {
|
|
|
92
109
|
const schedule = dreamer?.tasks?.["review-user-memories"]?.schedule;
|
|
93
110
|
return typeof schedule === "string" && schedule.trim() !== "";
|
|
94
111
|
}
|
|
95
|
-
export { CANONICAL_DREAM_TASKS, formatDreamTaskBacklogs, processedDreamTaskItems, leaseKindFor, leaseKeyFor, isCanonicalDreamTask, compareTaskOrder, buildDreamTaskRuntimeConfigs2, userMemoryCollectionEnabled2 };
|
|
112
|
+
export { CANONICAL_DREAM_TASKS, DREAM_TASK_CAPABILITIES, formatDreamTaskBacklogs, processedDreamTaskItems, leaseKindFor, leaseKeyFor, isCanonicalDreamTask, compareTaskOrder, buildDreamTaskRuntimeConfigs2, userMemoryCollectionEnabled2 };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
sessionLog
|
|
3
|
-
} from "./index-
|
|
3
|
+
} from "./index-qp20p2py.js";
|
|
4
4
|
import {
|
|
5
5
|
modelRefLookupOrder
|
|
6
6
|
} from "./index-avwt563y.js";
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
getHarness,
|
|
9
9
|
getDataDir,
|
|
10
10
|
getMagicContextStorageDir
|
|
11
|
-
} from "./index-
|
|
11
|
+
} from "./index-4ftb5hcq.js";
|
|
12
12
|
|
|
13
13
|
// src/shared/models-dev-cache.ts
|
|
14
14
|
import { mkdirSync, readFileSync as readFileSync2, renameSync, writeFileSync } from "node:fs";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
sessionLog
|
|
3
|
-
} from "./index-
|
|
3
|
+
} from "./index-qp20p2py.js";
|
|
4
4
|
import {
|
|
5
5
|
shouldHoldIgnoredNotification
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-jkrqhc7y.js";
|
|
7
7
|
|
|
8
8
|
// src/shared/error-message.ts
|
|
9
9
|
function getErrorMessage(error) {
|
|
@@ -183,7 +183,7 @@ async function sendIgnoredMessageNow(client, sessionId, text, params, forcePersi
|
|
|
183
183
|
holdIgnoredNotification({ client, sessionId, text, params, forcePersist }, "during target checks");
|
|
184
184
|
return "queued";
|
|
185
185
|
}
|
|
186
|
-
const { waitForSafeNotificationTarget } = await import("./safe-notification-target-
|
|
186
|
+
const { waitForSafeNotificationTarget } = await import("./safe-notification-target-fepvcbsj.js");
|
|
187
187
|
if (await waitForSafeNotificationTarget(client, sessionId) === "skip") {
|
|
188
188
|
sessionLog(sessionId, "notification skipped (session not titled yet)");
|
|
189
189
|
return "skipped";
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,YAAY,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,YAAY,EAAE,MAAM,qBAAqB,CAAC;AA4FvE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAq6BpC,QAAA,MAAM,MAAM,EAAE,YAAY,GAAG;IAAE,KAAK,EAAE,OAAO,KAAK,CAAA;CAIjD,CAAC;AAEF,eAAe,MAAM,CAAC"}
|