@retaw106/mmc-oc 2.1.2 → 2.2.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/dist/agents/memory-maintainer.d.ts +9 -0
- package/dist/agents/memory-maintainer.d.ts.map +1 -1
- package/dist/cli.js +0 -1
- package/dist/config/project-security.d.ts +0 -2
- package/dist/config/project-security.d.ts.map +1 -1
- package/dist/config/schema/magic-context.d.ts +0 -5
- package/dist/config/schema/magic-context.d.ts.map +1 -1
- package/dist/config-init.js +0 -1
- package/dist/{context-gxm0q7tz.js → context-mrvm92n8.js} +3462 -3133
- package/dist/features/magic-context/memory-maintainer/oc2-adapter.d.ts +0 -6
- package/dist/features/magic-context/memory-maintainer/oc2-adapter.d.ts.map +1 -1
- package/dist/features/magic-context/migrations.d.ts +5 -0
- package/dist/features/magic-context/migrations.d.ts.map +1 -1
- package/dist/features/magic-context/session-project-backfill.d.ts +1 -1
- package/dist/features/magic-context/session-project-backfill.d.ts.map +1 -1
- package/dist/features/magic-context/storage-clone.d.ts.map +1 -1
- package/dist/features/magic-context/storage-db.d.ts +8 -0
- package/dist/features/magic-context/storage-db.d.ts.map +1 -1
- 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/cache-busting-signals.d.ts +6 -3
- package/dist/hooks/magic-context/cache-busting-signals.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-incremental.d.ts +0 -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.map +1 -1
- package/dist/hooks/magic-context/default-protection-pressure.test-support.d.ts +37 -0
- package/dist/hooks/magic-context/default-protection-pressure.test-support.d.ts.map +1 -0
- package/dist/hooks/magic-context/drop-stale-reduce-calls.d.ts +4 -0
- package/dist/hooks/magic-context/drop-stale-reduce-calls.d.ts.map +1 -1
- package/dist/hooks/magic-context/inject-compartments.d.ts.map +1 -1
- package/dist/hooks/magic-context/latest-thinking-recovery.d.ts +61 -0
- package/dist/hooks/magic-context/latest-thinking-recovery.d.ts.map +1 -0
- package/dist/hooks/magic-context/lkg-replay.d.ts +9 -0
- package/dist/hooks/magic-context/lkg-replay.d.ts.map +1 -1
- package/dist/hooks/magic-context/lkg-slot.d.ts +2 -0
- package/dist/hooks/magic-context/lkg-slot.d.ts.map +1 -1
- package/dist/hooks/magic-context/read-session-chunk.d.ts +8 -1
- package/dist/hooks/magic-context/read-session-chunk.d.ts.map +1 -1
- package/dist/hooks/magic-context/strip-content.d.ts +4 -2
- package/dist/hooks/magic-context/strip-content.d.ts.map +1 -1
- package/dist/hooks/magic-context/system-injection-stripper.d.ts +7 -0
- package/dist/hooks/magic-context/system-injection-stripper.d.ts.map +1 -1
- package/dist/hooks/magic-context/tail-hygiene-walk.d.ts.map +1 -1
- package/dist/hooks/magic-context/tool-drop-target.d.ts +5 -0
- package/dist/hooks/magic-context/tool-drop-target.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts +23 -7
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform.d.ts +0 -6
- package/dist/hooks/magic-context/transform.d.ts.map +1 -1
- package/dist/{index-ys43j25b.js → index-5b7x80ec.js} +126 -44
- package/dist/{index-cszxqtev.js → index-btp5tdc8.js} +180 -31
- package/dist/{index-pynrjyjy.js → index-g2z2k5m4.js} +1 -1
- package/dist/index.js +1 -1
- package/dist/plugin/rpc-handlers.d.ts.map +1 -1
- package/dist/{read-session-chunk-e4dby3pb.js → read-session-chunk-2xm4sc4y.js} +1 -1
- package/dist/{recomp-orchestrator-xg3jm3s2.js → recomp-orchestrator-frmwj9hz.js} +3 -3
- package/dist/shared/pi-executable.d.ts +1 -1
- package/dist/shared/pi-executable.d.ts.map +1 -1
- package/dist/shared/prompt-surface-runtime.d.ts +1 -1
- package/dist/shared/subagent-runner.d.ts +22 -1
- package/dist/shared/subagent-runner.d.ts.map +1 -1
- package/dist/tools/light-descriptions.d.ts +1 -1
- package/dist/tools/light-descriptions.d.ts.map +1 -1
- package/dist/tools/parameter-descriptions.d.ts +1 -3
- package/dist/tools/parameter-descriptions.d.ts.map +1 -1
- package/dist/v2/hooks/context.d.ts.map +1 -1
- package/dist/v2/hooks/hidden-child.d.ts +15 -2
- package/dist/v2/hooks/hidden-child.d.ts.map +1 -1
- package/dist/v2/server.js +3463 -2906
- package/dist/web/main.js +8 -2
- package/dist/{wrapup-orchestrator-9spy01n8.js → wrapup-orchestrator-yknks3ad.js} +3 -3
- package/package.json +1 -1
- package/src/agents/memory-maintainer.ts +12 -0
- package/src/config/index.test.ts +0 -17
- package/src/config/project-security.test.ts +0 -8
- package/src/config/project-security.ts +0 -9
- package/src/config/protected-tools.test.ts +72 -0
- package/src/config/schema/magic-context.test.ts +0 -6
- package/src/config/schema/magic-context.ts +1 -10
- package/src/shared/fold-render-lock-fence.test.ts +84 -0
- package/src/shared/fold-render-lock-fixtures.test.ts +270 -0
- package/src/shared/pi-executable.ts +3 -3
- package/src/shared/rpc-utils.test.ts +4 -5
- package/src/shared/sqlite-640-review.test.ts +184 -0
- package/src/shared/sqlite-context-pragmas.test.ts +105 -0
- package/src/shared/sqlite-writer-diagnostics.test.ts +136 -0
- package/src/shared/subagent-runner.ts +24 -0
- package/src/shared/tag-transcript.test.ts +55 -0
- package/src/shared/tag-transcript.ts +6 -0
- package/src/shared/write-transaction-attribution.test.ts +4 -0
- package/src/shared/write-transaction-timing.test.ts +39 -0
- package/dist/hooks/magic-context/historian-state-file.d.ts +0 -43
- package/dist/hooks/magic-context/historian-state-file.d.ts.map +0 -1
- package/dist/shared/auto-update-provenance.d.ts +0 -9
- package/dist/shared/auto-update-provenance.d.ts.map +0 -1
- package/src/shared/auto-update-provenance.ts +0 -42
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Historian state-file offloading.
|
|
3
|
-
*
|
|
4
|
-
* When the existing-state XML (prior compartments + facts + project memory)
|
|
5
|
-
* exceeds {@link HISTORIAN_STATE_INLINE_THRESHOLD} characters, the historian
|
|
6
|
-
* caller writes it to a temp file under the project-local historian dir
|
|
7
|
-
* (`<project>/.opencode/magic-context/historian/`) and the prompt instructs
|
|
8
|
-
* the model to `Read this file first`. This avoids pushing 100K+ chars of
|
|
9
|
-
* inline reference state through the model's input on long sessions, which
|
|
10
|
-
* on some provider/model combinations (notably github-copilot/gpt-5.4 via
|
|
11
|
-
* the openai-responses API) causes the model to stall before emitting any
|
|
12
|
-
* output tokens.
|
|
13
|
-
*
|
|
14
|
-
* The state file lives INSIDE the project directory rather than under
|
|
15
|
-
* `os.tmpdir()` because OpenCode's `external_directory` permission system
|
|
16
|
-
* asks the user before letting the historian subagent's Read tool open any
|
|
17
|
-
* file outside the project. Anchoring under `<project>/.opencode/` keeps
|
|
18
|
-
* the file inside the project boundary so historian runs never trigger a
|
|
19
|
-
* permission prompt.
|
|
20
|
-
*
|
|
21
|
-
* The caller MUST delete the file in finally{} via
|
|
22
|
-
* {@link cleanupHistorianStateFile}.
|
|
23
|
-
*
|
|
24
|
-
* Shared between OpenCode (`compartment-runner-incremental.ts`,
|
|
25
|
-
* `compartment-runner-recomp.ts`) and Pi (`pi-historian-runner.ts`). The
|
|
26
|
-
* directory is resolved from the project directory the caller passes in —
|
|
27
|
-
* both harnesses already track this on their runner deps.
|
|
28
|
-
*/
|
|
29
|
-
export declare const HISTORIAN_STATE_INLINE_THRESHOLD = 30000;
|
|
30
|
-
/**
|
|
31
|
-
* When existingState is large, write it to a project-local file and return the
|
|
32
|
-
* path. Returns undefined when existingState is small enough to inline OR when
|
|
33
|
-
* writing fails (in which case the caller should fall back to inline).
|
|
34
|
-
*
|
|
35
|
-
* `directory` is the project directory; the helper writes under
|
|
36
|
-
* `<directory>/.opencode/magic-context/historian/`. The dir is created
|
|
37
|
-
* recursively on first write, so the call is safe on fresh projects that have
|
|
38
|
-
* never had a `.opencode/` subtree.
|
|
39
|
-
*/
|
|
40
|
-
export declare function maybeWriteHistorianStateFile(sessionId: string, existingState: string, directory: string): string | undefined;
|
|
41
|
-
/** Delete a previously written state file. Safe to call with undefined. */
|
|
42
|
-
export declare function cleanupHistorianStateFile(path: string | undefined): void;
|
|
43
|
-
//# sourceMappingURL=historian-state-file.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"historian-state-file.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/historian-state-file.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,gCAAgC,QAAS,CAAC;AAEvD;;;;;;;;;GASG;AACH,wBAAgB,4BAA4B,CACxC,SAAS,EAAE,MAAM,EACjB,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,MAAM,GAClB,MAAM,GAAG,SAAS,CAapB;AAED,2EAA2E;AAC3E,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAOxE"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export declare const AUTO_UPDATE_CHECK_STATE_FILENAME = "last-update-check.json";
|
|
2
|
-
export interface AutoUpdateCheckState {
|
|
3
|
-
lastCheckedMs?: number;
|
|
4
|
-
updaterPinnedSpec?: string;
|
|
5
|
-
updaterPinnedAt?: number;
|
|
6
|
-
}
|
|
7
|
-
export declare function readAutoUpdateCheckState(path: string): AutoUpdateCheckState | null;
|
|
8
|
-
export declare function isUpdaterPinnedSpec(state: AutoUpdateCheckState | null, configuredSpec: string): boolean;
|
|
9
|
-
//# sourceMappingURL=auto-update-provenance.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auto-update-provenance.d.ts","sourceRoot":"","sources":["../../src/shared/auto-update-provenance.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,gCAAgC,2BAA2B,CAAC;AAEzE,MAAM,WAAW,oBAAoB;IACjC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,eAAe,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,oBAAoB,GAAG,IAAI,CAoBlF;AAED,wBAAgB,mBAAmB,CAC/B,KAAK,EAAE,oBAAoB,GAAG,IAAI,EAClC,cAAc,EAAE,MAAM,GACvB,OAAO,CAMT"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { existsSync, readFileSync } from "node:fs";
|
|
2
|
-
|
|
3
|
-
export const AUTO_UPDATE_CHECK_STATE_FILENAME = "last-update-check.json";
|
|
4
|
-
|
|
5
|
-
export interface AutoUpdateCheckState {
|
|
6
|
-
lastCheckedMs?: number;
|
|
7
|
-
updaterPinnedSpec?: string;
|
|
8
|
-
updaterPinnedAt?: number;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export function readAutoUpdateCheckState(path: string): AutoUpdateCheckState | null {
|
|
12
|
-
if (!existsSync(path)) return null;
|
|
13
|
-
try {
|
|
14
|
-
const value = JSON.parse(readFileSync(path, "utf-8")) as unknown;
|
|
15
|
-
if (!value || typeof value !== "object" || Array.isArray(value)) return null;
|
|
16
|
-
const raw = value as Record<string, unknown>;
|
|
17
|
-
const state: AutoUpdateCheckState = {};
|
|
18
|
-
if (typeof raw.lastCheckedMs === "number" && Number.isFinite(raw.lastCheckedMs)) {
|
|
19
|
-
state.lastCheckedMs = raw.lastCheckedMs;
|
|
20
|
-
}
|
|
21
|
-
if (typeof raw.updaterPinnedSpec === "string" && raw.updaterPinnedSpec.length > 0) {
|
|
22
|
-
state.updaterPinnedSpec = raw.updaterPinnedSpec;
|
|
23
|
-
}
|
|
24
|
-
if (typeof raw.updaterPinnedAt === "number" && Number.isFinite(raw.updaterPinnedAt)) {
|
|
25
|
-
state.updaterPinnedAt = raw.updaterPinnedAt;
|
|
26
|
-
}
|
|
27
|
-
return state;
|
|
28
|
-
} catch {
|
|
29
|
-
return null;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export function isUpdaterPinnedSpec(
|
|
34
|
-
state: AutoUpdateCheckState | null,
|
|
35
|
-
configuredSpec: string,
|
|
36
|
-
): boolean {
|
|
37
|
-
return (
|
|
38
|
-
state?.updaterPinnedSpec === configuredSpec &&
|
|
39
|
-
typeof state.updaterPinnedAt === "number" &&
|
|
40
|
-
Number.isFinite(state.updaterPinnedAt)
|
|
41
|
-
);
|
|
42
|
-
}
|