@cortexkit/opencode-magic-context 0.40.0 → 0.41.0
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 +1 -1
- package/dist/agents/permissions.d.ts +5 -3
- package/dist/agents/permissions.d.ts.map +1 -1
- package/dist/{announcement-5eg4t64s.js → announcement-3g9xg433.js} +2 -2
- package/dist/{conflict-warning-hook-f406ggbw.js → conflict-warning-hook-xj1r88a7.js} +4 -4
- package/dist/{derive-budgets-xk8cy5e6.js → derive-budgets-3xfyphvk.js} +3 -3
- package/dist/features/builtin-commands/commands.d.ts +35 -2
- package/dist/features/builtin-commands/commands.d.ts.map +1 -1
- package/dist/features/magic-context/context-authority.d.ts +10 -0
- package/dist/features/magic-context/context-authority.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/classify.d.ts +1 -0
- package/dist/features/magic-context/dreamer/classify.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/lease.d.ts +12 -27
- package/dist/features/magic-context/dreamer/lease.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/map-memories-prompt.d.ts +1 -1
- package/dist/features/magic-context/dreamer/map-memories-prompt.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/map-memories.d.ts +2 -0
- package/dist/features/magic-context/dreamer/map-memories.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/memory-claim-safety.d.ts +9 -0
- package/dist/features/magic-context/dreamer/memory-claim-safety.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/task-executor.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/task-registry.d.ts +2 -0
- package/dist/features/magic-context/dreamer/task-registry.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/verify-prompt.d.ts +7 -2
- package/dist/features/magic-context/dreamer/verify-prompt.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/verify.d.ts +13 -10
- package/dist/features/magic-context/dreamer/verify.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding-local.d.ts +19 -0
- package/dist/features/magic-context/memory/embedding-local.d.ts.map +1 -1
- package/dist/features/magic-context/memory/storage-memory-verifications.d.ts +5 -1
- package/dist/features/magic-context/memory/storage-memory-verifications.d.ts.map +1 -1
- package/dist/features/magic-context/memory/storage-memory.d.ts.map +1 -1
- package/dist/features/magic-context/migrations.d.ts.map +1 -1
- package/dist/features/magic-context/project-embedding-registry.d.ts +3 -0
- package/dist/features/magic-context/project-embedding-registry.d.ts.map +1 -1
- package/dist/features/magic-context/storage-db.d.ts +1 -1
- package/dist/features/magic-context/storage-db.d.ts.map +1 -1
- package/dist/features/magic-context/storage-identity-merge.d.ts.map +1 -1
- package/dist/features/magic-context/storage-meta-persisted.d.ts +29 -3
- package/dist/features/magic-context/storage-meta-persisted.d.ts.map +1 -1
- package/dist/features/magic-context/storage-meta-session.d.ts.map +1 -1
- package/dist/features/magic-context/storage-meta.d.ts +1 -1
- package/dist/features/magic-context/storage-meta.d.ts.map +1 -1
- package/dist/features/magic-context/storage-tags.d.ts +7 -0
- package/dist/features/magic-context/storage-tags.d.ts.map +1 -1
- package/dist/features/magic-context/storage.d.ts +1 -1
- package/dist/features/magic-context/storage.d.ts.map +1 -1
- package/dist/hooks/magic-context/channel2-delivery.d.ts +2 -4
- package/dist/hooks/magic-context/channel2-delivery.d.ts.map +1 -1
- package/dist/hooks/magic-context/command-handler.d.ts +7 -0
- package/dist/hooks/magic-context/command-handler.d.ts.map +1 -1
- package/dist/hooks/magic-context/compaction-marker-manager.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-incremental.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-recomp.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-trigger.d.ts +1 -0
- package/dist/hooks/magic-context/compartment-trigger.d.ts.map +1 -1
- package/dist/hooks/magic-context/ctx-reduce-nudge.d.ts +15 -14
- package/dist/hooks/magic-context/ctx-reduce-nudge.d.ts.map +1 -1
- package/dist/hooks/magic-context/emergency-drop.d.ts +6 -8
- package/dist/hooks/magic-context/emergency-drop.d.ts.map +1 -1
- package/dist/hooks/magic-context/event-resolvers.d.ts +2 -2
- package/dist/hooks/magic-context/execute-status.d.ts +4 -1
- package/dist/hooks/magic-context/execute-status.d.ts.map +1 -1
- package/dist/hooks/magic-context/heuristic-cleanup.d.ts +6 -0
- package/dist/hooks/magic-context/heuristic-cleanup.d.ts.map +1 -1
- package/dist/hooks/magic-context/hook-handlers.d.ts +21 -8
- package/dist/hooks/magic-context/hook-handlers.d.ts.map +1 -1
- package/dist/hooks/magic-context/hook.d.ts +16 -1
- package/dist/hooks/magic-context/hook.d.ts.map +1 -1
- package/dist/hooks/magic-context/inject-compartments.d.ts +6 -16
- package/dist/hooks/magic-context/inject-compartments.d.ts.map +1 -1
- package/dist/hooks/magic-context/maintenance-authority.d.ts +3 -0
- package/dist/hooks/magic-context/maintenance-authority.d.ts.map +1 -0
- package/dist/hooks/magic-context/module-transport.d.ts.map +1 -1
- package/dist/hooks/magic-context/module-wire.d.ts.map +1 -1
- package/dist/hooks/magic-context/protected-tail-boundary.d.ts.map +1 -1
- package/dist/hooks/magic-context/read-session-true-raw-tokens.d.ts +1 -0
- package/dist/hooks/magic-context/read-session-true-raw-tokens.d.ts.map +1 -1
- package/dist/hooks/magic-context/rust-mode-transform.d.ts +9 -0
- package/dist/hooks/magic-context/rust-mode-transform.d.ts.map +1 -1
- package/dist/hooks/magic-context/strip-content.d.ts +8 -0
- package/dist/hooks/magic-context/strip-content.d.ts.map +1 -1
- package/dist/hooks/magic-context/stripped-command.d.ts +19 -0
- package/dist/hooks/magic-context/stripped-command.d.ts.map +1 -0
- package/dist/hooks/magic-context/supersession-reclaim.d.ts +11 -0
- package/dist/hooks/magic-context/supersession-reclaim.d.ts.map +1 -1
- package/dist/hooks/magic-context/tag-messages.d.ts +6 -0
- package/dist/hooks/magic-context/tag-messages.d.ts.map +1 -1
- package/dist/hooks/magic-context/tail-hygiene-walk.d.ts +11 -0
- package/dist/hooks/magic-context/tail-hygiene-walk.d.ts.map +1 -1
- package/dist/hooks/magic-context/temporal-awareness.d.ts +1 -1
- package/dist/hooks/magic-context/temporal-awareness.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform-operations.d.ts +1 -1
- package/dist/hooks/magic-context/transform-operations.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts +5 -1
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform.d.ts.map +1 -1
- package/dist/{index-pck9vadr.js → index-26ds03jd.js} +1 -1
- package/dist/{index-mg1yx1ph.js → index-2bykz3bx.js} +2 -2
- package/dist/{index-mmrhhk9a.js → index-37yzyeca.js} +36 -8
- package/dist/{index-btj2qhmc.js → index-88za3sz8.js} +3 -3
- package/dist/index-b4gv9f7g.js +284 -0
- package/dist/{index-ehpzdy0v.js → index-bf799gbq.js} +8 -1
- package/dist/{index-1h9t9xb5.js → index-dmgbar7r.js} +2 -2
- package/dist/{index-qf20mv7e.js → index-dmvy29z0.js} +1 -1
- package/dist/{index-sw8gnq34.js → index-jmwq2wxr.js} +2 -2
- package/dist/{index-3dkzzh0t.js → index-knna83k0.js} +1 -1
- package/dist/{index-axpym70t.js → index-w8rkbhn6.js} +617 -324
- package/dist/{index-rw0qrkvq.js → index-x9dmzyp5.js} +17 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2901 -2305
- package/dist/{model-resolution-r9jbcz86.js → model-resolution-jgrkt0z2.js} +3 -1
- package/dist/plugin/dream-timer.d.ts.map +1 -1
- package/dist/plugin/hooks/create-session-hooks.d.ts +14 -0
- package/dist/plugin/hooks/create-session-hooks.d.ts.map +1 -1
- package/dist/plugin/rpc-handlers.d.ts +10 -0
- package/dist/plugin/rpc-handlers.d.ts.map +1 -1
- package/dist/{recomp-orchestrator-dmyvqekw.js → recomp-orchestrator-1w4xj6jt.js} +7 -7
- package/dist/{safe-notification-target-tepzc2xa.js → safe-notification-target-p0c0csxw.js} +3 -3
- package/dist/{send-session-notification-6v5b72b4.js → send-session-notification-kn34g7mx.js} +4 -4
- package/dist/shared/data-path.d.ts +12 -3
- package/dist/shared/data-path.d.ts.map +1 -1
- package/dist/shared/logger.d.ts.map +1 -1
- package/dist/shared/model-resolution.d.ts +1 -0
- package/dist/shared/model-resolution.d.ts.map +1 -1
- package/dist/shared/rpc-types.d.ts +5 -0
- package/dist/shared/rpc-types.d.ts.map +1 -1
- package/dist/shared/rust-mode-status.d.ts +3 -0
- package/dist/shared/rust-mode-status.d.ts.map +1 -0
- package/dist/shared/status-detail-text.d.ts.map +1 -1
- package/dist/shared/subagent-runner.d.ts +4 -0
- package/dist/shared/subagent-runner.d.ts.map +1 -1
- package/dist/shared/write-transaction-timing.d.ts +11 -0
- package/dist/shared/write-transaction-timing.d.ts.map +1 -0
- package/dist/{storage-meta-session-yvtbaw7c.js → storage-meta-session-snbzd26z.js} +4 -4
- package/dist/{task-config-a1qmj9bx.js → task-config-ty08ptc2.js} +2 -2
- package/dist/tools/ctx-expand/tools.d.ts.map +1 -1
- package/dist/tools/ctx-memory/tools.d.ts.map +1 -1
- package/dist/tui/data/context-db.d.ts +10 -3
- package/dist/tui/data/context-db.d.ts.map +1 -1
- package/dist/tui-compiled/data/context-db.d.ts +10 -3
- package/dist/tui-compiled/data/context-db.d.ts.map +1 -1
- package/package.json +2 -1
- package/src/agents/permissions.ts +14 -4
- package/src/config/index.test.ts +38 -0
- package/src/features/magic-context/dreamer/task-registry.ts +2 -0
- package/src/shared/data-path.test.ts +44 -4
- package/src/shared/data-path.ts +54 -11
- package/src/shared/logger.test.ts +15 -0
- package/src/shared/logger.ts +9 -4
- package/src/shared/model-resolution.test.ts +39 -0
- package/src/shared/model-resolution.ts +8 -0
- package/src/shared/redaction.ts +2 -2
- package/src/shared/rpc-types.ts +5 -0
- package/src/shared/rust-mode-status.ts +3 -0
- package/src/shared/status-detail-text.test.ts +13 -0
- package/src/shared/status-detail-text.ts +2 -0
- package/src/shared/subagent-runner.ts +4 -0
- package/src/shared/write-transaction-timing.ts +25 -0
- package/src/tui/data/context-db.test.ts +31 -1
- package/src/tui/data/context-db.ts +17 -61
- package/src/tui/index.tsx +36 -5
- package/src/tui-compiled/data/context-db.ts +17 -61
- package/src/tui-compiled/index.tsx +229 -191
- package/dist/index-8pqfcghm.js +0 -81
package/dist/index-8pqfcghm.js
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
getMagicContextLogPath
|
|
3
|
-
} from "./index-mmrhhk9a.js";
|
|
4
|
-
|
|
5
|
-
// src/shared/logger.ts
|
|
6
|
-
import * as fs from "node:fs";
|
|
7
|
-
import * as path from "node:path";
|
|
8
|
-
var isTestEnv = false;
|
|
9
|
-
var buffer = [];
|
|
10
|
-
var flushTimer = null;
|
|
11
|
-
var FLUSH_INTERVAL_MS = 500;
|
|
12
|
-
var BUFFER_SIZE_LIMIT = 50;
|
|
13
|
-
var swallowedWriteCount = 0;
|
|
14
|
-
var lastErrorMessage = null;
|
|
15
|
-
var lastErrorTime = null;
|
|
16
|
-
function recordSwallowedWrite(error) {
|
|
17
|
-
try {
|
|
18
|
-
swallowedWriteCount++;
|
|
19
|
-
lastErrorMessage = error instanceof Error ? error.message : String(error);
|
|
20
|
-
lastErrorTime = new Date().toISOString();
|
|
21
|
-
} catch {}
|
|
22
|
-
}
|
|
23
|
-
function ensureDir(filePath) {
|
|
24
|
-
fs.mkdirSync(path.dirname(filePath), { recursive: true });
|
|
25
|
-
}
|
|
26
|
-
function flush() {
|
|
27
|
-
if (flushTimer) {
|
|
28
|
-
clearTimeout(flushTimer);
|
|
29
|
-
flushTimer = null;
|
|
30
|
-
}
|
|
31
|
-
if (buffer.length === 0)
|
|
32
|
-
return;
|
|
33
|
-
const data = buffer.join("");
|
|
34
|
-
buffer = [];
|
|
35
|
-
try {
|
|
36
|
-
const logFile = getMagicContextLogPath();
|
|
37
|
-
ensureDir(logFile);
|
|
38
|
-
fs.appendFileSync(logFile, data);
|
|
39
|
-
} catch (error) {
|
|
40
|
-
recordSwallowedWrite(error);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
function scheduleFlush() {
|
|
44
|
-
if (flushTimer)
|
|
45
|
-
return;
|
|
46
|
-
flushTimer = setTimeout(() => {
|
|
47
|
-
flushTimer = null;
|
|
48
|
-
flush();
|
|
49
|
-
}, FLUSH_INTERVAL_MS);
|
|
50
|
-
}
|
|
51
|
-
function log(message, data) {
|
|
52
|
-
if (isTestEnv)
|
|
53
|
-
return;
|
|
54
|
-
try {
|
|
55
|
-
const timestamp = new Date().toISOString();
|
|
56
|
-
const serialized = data === undefined ? "" : data instanceof Error ? ` ${data.message}${data.stack ? `
|
|
57
|
-
${data.stack}` : ""}` : ` ${JSON.stringify(data)}`;
|
|
58
|
-
buffer.push(`[${timestamp}] ${message}${serialized}
|
|
59
|
-
`);
|
|
60
|
-
if (buffer.length >= BUFFER_SIZE_LIMIT) {
|
|
61
|
-
flush();
|
|
62
|
-
} else {
|
|
63
|
-
scheduleFlush();
|
|
64
|
-
}
|
|
65
|
-
} catch {}
|
|
66
|
-
}
|
|
67
|
-
function sessionLog(sessionId, message, data) {
|
|
68
|
-
log(`[magic-context][${sessionId}] ${message}`, data);
|
|
69
|
-
}
|
|
70
|
-
function getLoggerDiagnostics() {
|
|
71
|
-
return {
|
|
72
|
-
swallowedWriteCount,
|
|
73
|
-
lastErrorMessage,
|
|
74
|
-
lastErrorTime
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
if (!isTestEnv) {
|
|
78
|
-
process.on("exit", flush);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
export { log, sessionLog, getLoggerDiagnostics };
|