@cortexkit/opencode-magic-context 0.43.1 → 0.43.2
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/{conflict-warning-hook-956fkedc.js → conflict-warning-hook-hyk9y29x.js} +3 -3
- package/dist/features/magic-context/dreamer/classify.d.ts +12 -0
- package/dist/features/magic-context/dreamer/classify.d.ts.map +1 -1
- package/dist/features/magic-context/store-generation-rebase.d.ts +62 -1
- package/dist/features/magic-context/store-generation-rebase.d.ts.map +1 -1
- package/dist/hooks/magic-context/command-handler.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-incremental.d.ts +6 -0
- package/dist/hooks/magic-context/compartment-runner-incremental.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-validation.d.ts +7 -0
- package/dist/hooks/magic-context/compartment-runner-validation.d.ts.map +1 -1
- package/dist/hooks/magic-context/ctx-reduce-availability.d.ts +60 -8
- package/dist/hooks/magic-context/ctx-reduce-availability.d.ts.map +1 -1
- package/dist/hooks/magic-context/hook.d.ts +3 -1
- package/dist/hooks/magic-context/hook.d.ts.map +1 -1
- package/dist/hooks/magic-context/system-prompt-hash.d.ts +9 -0
- package/dist/hooks/magic-context/system-prompt-hash.d.ts.map +1 -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-kpmmr8s0.js → index-6j8th2hd.js} +1 -1
- package/dist/{index-v8qr6tt2.js → index-bmzt6xgy.js} +2 -2
- package/dist/{index-7wpwr2e2.js → index-g6hpfkqa.js} +250 -36
- package/dist/{index-yc81txp4.js → index-jgnag7sa.js} +1 -1
- package/dist/{index-1gtwrdc4.js → index-pa67brzn.js} +2 -2
- package/dist/{index-j7cnyvq1.js → index-tdrv6nd0.js} +1 -1
- package/dist/index.js +238 -28
- package/dist/plugin/hooks/create-session-hooks.d.ts.map +1 -1
- package/dist/{read-session-chunk-z7fv0qjv.js → read-session-chunk-53a7qbrh.js} +2 -2
- package/dist/{recomp-orchestrator-r00aa5t3.js → recomp-orchestrator-adsgqgse.js} +4 -4
- package/dist/{send-session-notification-3warjyjp.js → send-session-notification-e28r4xx2.js} +2 -2
- package/dist/shared/opencode-db-path.d.ts.map +1 -1
- package/dist/shared/test-fake-executable.d.ts +38 -0
- package/dist/shared/test-fake-executable.d.ts.map +1 -0
- package/dist/shared/user-facing-codes.d.ts +10 -0
- package/dist/shared/user-facing-codes.d.ts.map +1 -1
- package/dist/v2/hooks/context.d.ts.map +1 -1
- package/dist/v2/hooks/refusal.d.ts +9 -1
- package/dist/v2/hooks/refusal.d.ts.map +1 -1
- package/dist/v2/hooks/restore-rows.d.ts +29 -0
- package/dist/v2/hooks/restore-rows.d.ts.map +1 -0
- package/dist/v2/hooks/update-check.d.ts +8 -0
- package/dist/v2/hooks/update-check.d.ts.map +1 -1
- package/dist/v2/server.js +470 -61
- package/dist/v2/store-reader.d.ts +8 -0
- package/dist/v2/store-reader.d.ts.map +1 -1
- package/dist/{wrapup-orchestrator-y0bs7t5a.js → wrapup-orchestrator-8xzbpvm8.js} +5 -5
- package/package.json +1 -1
- package/src/shared/opencode-db-path.test.ts +18 -0
- package/src/shared/opencode-db-path.ts +5 -2
- package/src/shared/test-fake-executable.test.ts +54 -0
- package/src/shared/test-fake-executable.ts +110 -0
- package/src/shared/user-facing-codes.ts +11 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/v2/hooks/context.ts"],"names":[],"mappings":"AAsDA,OAAO,EAAmB,KAAK,aAAa,EAAE,MAAM,qCAAqC,CAAC;AAc1F,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAGH,KAAK,oBAAoB,EAC5B,MAAM,qCAAqC,CAAC;
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/v2/hooks/context.ts"],"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,wBAAgB,yBAAyB,CACrC,KAAK,EAAE,cAAc,EACrB,OAAO,EAAE,oBAAoB,EAC7B,MAAM,EAAE,mBAAmB,GAAG,SAAS,GACxC,IAAI,CAUN;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,SAAS;IAAE,cAAc,CAAC,EAAE,IAAI,GAAG,MAAM,CAAA;CAAE,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,CAQjG;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,cAAc,GAAG,IAAI,CAgBnE;AAED,wBAAsB,eAAe,CAAC,OAAO,EAAE,SAAS;;eAy5BvD"}
|
|
@@ -2,6 +2,14 @@ import type { V2Context } from "./types";
|
|
|
2
2
|
export declare class V2ContextRefusal extends Error {
|
|
3
3
|
constructor(message?: string, options?: ErrorOptions);
|
|
4
4
|
}
|
|
5
|
+
/** How long the host gets to confirm an interrupt before the turn is refused anyway. */
|
|
6
|
+
export declare const INTERRUPT_CONFIRMATION_TIMEOUT_MS = 2000;
|
|
7
|
+
/** Timer functions the interrupt deadline uses. Tests pass a manual clock so the
|
|
8
|
+
* deadline fires when the test says so, not when a busy event loop gets to it. */
|
|
9
|
+
export interface InterruptTimers {
|
|
10
|
+
setTimeout(callback: () => void, ms: number): unknown;
|
|
11
|
+
clearTimeout(handle: unknown): void;
|
|
12
|
+
}
|
|
5
13
|
/** An idle no-op is not confirmation that the pending provider request was cancelled. */
|
|
6
|
-
export declare function interruptBeforeProvider(session: Pick<V2Context["session"], "interrupt">, sessionID: Parameters<V2Context["session"]["interrupt"]>[0]["sessionID"]): Promise<void>;
|
|
14
|
+
export declare function interruptBeforeProvider(session: Pick<V2Context["session"], "interrupt">, sessionID: Parameters<V2Context["session"]["interrupt"]>[0]["sessionID"], timers?: InterruptTimers): Promise<void>;
|
|
7
15
|
//# sourceMappingURL=refusal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"refusal.d.ts","sourceRoot":"","sources":["../../../src/v2/hooks/refusal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC,qBAAa,gBAAiB,SAAQ,KAAK;gBAEnC,OAAO,SAAqD,EAC5D,OAAO,CAAC,EAAE,YAAY;CAK7B;AAED,yFAAyF;AACzF,wBAAsB,uBAAuB,CACzC,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,WAAW,CAAC,EAChD,SAAS,EAAE,UAAU,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,
|
|
1
|
+
{"version":3,"file":"refusal.d.ts","sourceRoot":"","sources":["../../../src/v2/hooks/refusal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC,qBAAa,gBAAiB,SAAQ,KAAK;gBAEnC,OAAO,SAAqD,EAC5D,OAAO,CAAC,EAAE,YAAY;CAK7B;AAED,wFAAwF;AACxF,eAAO,MAAM,iCAAiC,OAAO,CAAC;AAEtD;kFACkF;AAClF,MAAM,WAAW,eAAe;IAC5B,UAAU,CAAC,QAAQ,EAAE,MAAM,IAAI,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC;IACtD,YAAY,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;CACvC;AAOD,yFAAyF;AACzF,wBAAsB,uBAAuB,CACzC,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,WAAW,CAAC,EAChD,SAAS,EAAE,UAAU,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,EACxE,MAAM,GAAE,eAA8B,GACvC,OAAO,CAAC,IAAI,CAAC,CAsBf"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { StoreRow, V2StoreReader } from "../store-reader";
|
|
2
|
+
/** The reader surface the restore needs: 100-row pages plus undecoded per-row stamps. */
|
|
3
|
+
export type RestoreRowReader = Pick<V2StoreReader, "page" | "spanRowStamps">;
|
|
4
|
+
/**
|
|
5
|
+
* Keeps the rows an OpenCode 2 host checkpoint hid from the context draft, so each
|
|
6
|
+
* pass decodes only the rows it has not seen yet.
|
|
7
|
+
*
|
|
8
|
+
* After a host checkpoint the draft starts at the checkpoint, and every pass has to put
|
|
9
|
+
* back the rows between the last Magic Context boundary and the checkpoint. With no
|
|
10
|
+
* boundary yet (a long session before its first compartment) that span is the whole
|
|
11
|
+
* history before the checkpoint, and reading it again on every pass decoded the whole
|
|
12
|
+
* session every turn. Instead each pass reads one stamp per row of the span, without
|
|
13
|
+
* decoding anything (id, update time and data size, see `spanRowStamps`), reuses every
|
|
14
|
+
* kept row whose stamp is unchanged, and decodes only the rows that are new or whose
|
|
15
|
+
* stamp changed, in 100-row pages. A row the host deleted is simply absent from the
|
|
16
|
+
* stamps, and a row it rewrote in place to a different size or with a new update time
|
|
17
|
+
* is read again, so the rows handed back are the rows a full read would return and what
|
|
18
|
+
* the transform serves does not change.
|
|
19
|
+
*/
|
|
20
|
+
export declare class RestoredRowCache {
|
|
21
|
+
private readonly capacity;
|
|
22
|
+
private readonly sessions;
|
|
23
|
+
constructor(capacity?: number);
|
|
24
|
+
/** Rows with `after < seq <= through`, ascending by seq. */
|
|
25
|
+
rows(reader: RestoreRowReader, sessionID: string, after: number, through: number): StoreRow[];
|
|
26
|
+
forget(sessionID: string): void;
|
|
27
|
+
clear(): void;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=restore-rows.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"restore-rows.d.ts","sourceRoot":"","sources":["../../../src/v2/hooks/restore-rows.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAE/D,yFAAyF;AACzF,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,aAAa,EAAE,MAAM,GAAG,eAAe,CAAC,CAAC;AAO7E;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,gBAAgB;IAGb,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAFrC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA2C;gBAEvC,QAAQ,SAAK;IAE1C,4DAA4D;IAC5D,IAAI,CAAC,MAAM,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,QAAQ,EAAE;IA6C7F,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;IAI/B,KAAK,IAAI,IAAI;CAGhB"}
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
import type { V2Context } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* OpenCode 2 owns plugin installs: it installs an `@latest` entry once, flags
|
|
4
|
+
* it outdated at startup, and installs a newer release only when the user asks
|
|
5
|
+
* it to (its plugins dialog, or `opencode plugin update`). The v1 auto-updater
|
|
6
|
+
* does not run on this host, so the notice names the host's own update path
|
|
7
|
+
* instead of promising an automatic one.
|
|
8
|
+
*/
|
|
9
|
+
export declare function formatUpdateAvailableMessage(latest: string, current: string): string;
|
|
2
10
|
/** GA eventMethods is exactly ["subscribe"] (promise/event.d.ts), not on.
|
|
3
11
|
* The v2 plugin domain supplies list only; version checks must never use the
|
|
4
12
|
* v1 checker's singular-plugin configuration writer against plural plugins.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-check.d.ts","sourceRoot":"","sources":["../../../src/v2/hooks/update-check.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAyBzC;;;GAGG;AACH,wBAAgB,iBAAiB,CAC7B,OAAO,EAAE,IAAI,CAAC,SAAS,EAAE,OAAO,GAAG,SAAS,CAAC,EAC7C,KAAK,GAAE,CAAC,MAAM,EAAE,WAAW,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAKpD;;;
|
|
1
|
+
{"version":3,"file":"update-check.d.ts","sourceRoot":"","sources":["../../../src/v2/hooks/update-check.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAyBzC;;;;;;GAMG;AACH,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAEpF;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC7B,OAAO,EAAE,IAAI,CAAC,SAAS,EAAE,OAAO,GAAG,SAAS,CAAC,EAC7C,KAAK,GAAE,CAAC,MAAM,EAAE,WAAW,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAKpD;;;EAgCJ"}
|