@retaw106/mmc-oc 2.2.0 → 2.3.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/cli.js +2 -2
- package/dist/config/deprecated-config.d.ts +4 -0
- package/dist/config/deprecated-config.d.ts.map +1 -0
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/project-security.d.ts +2 -2
- package/dist/config/schema/magic-context.d.ts +3 -3
- package/dist/config/schema/magic-context.d.ts.map +1 -1
- package/dist/config-init.js +2 -2
- package/dist/{context-mrvm92n8.js → context-wt7g4f8k.js} +1641 -1543
- package/dist/{derive-budgets-rjjz5f7y.js → derive-budgets-s1p37t2g.js} +2 -2
- package/dist/features/magic-context/compaction-marker.d.ts.map +1 -1
- package/dist/features/magic-context/historian-failure-reason.d.ts +7 -0
- package/dist/features/magic-context/historian-failure-reason.d.ts.map +1 -0
- package/dist/features/magic-context/message-index-async.d.ts +21 -3
- package/dist/features/magic-context/message-index-async.d.ts.map +1 -1
- package/dist/features/magic-context/message-index.d.ts +7 -1
- package/dist/features/magic-context/message-index.d.ts.map +1 -1
- package/dist/features/magic-context/migrations.d.ts.map +1 -1
- package/dist/features/magic-context/pi-content-decisions.d.ts +7 -1
- package/dist/features/magic-context/pi-content-decisions.d.ts.map +1 -1
- package/dist/features/magic-context/search.d.ts +29 -0
- package/dist/features/magic-context/search.d.ts.map +1 -1
- package/dist/features/magic-context/storage-clone.d.ts +2 -0
- package/dist/features/magic-context/storage-clone.d.ts.map +1 -1
- package/dist/features/magic-context/storage-compartment-history-version.d.ts +4 -0
- package/dist/features/magic-context/storage-compartment-history-version.d.ts.map +1 -0
- 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-historian-runs.d.ts.map +1 -1
- package/dist/features/magic-context/storage-meta-persisted.d.ts +23 -5
- package/dist/features/magic-context/storage-meta-persisted.d.ts.map +1 -1
- package/dist/features/magic-context/storage-meta-session.d.ts +7 -1
- package/dist/features/magic-context/storage-meta-session.d.ts.map +1 -1
- package/dist/features/magic-context/storage-session-tables.d.ts +5 -1
- package/dist/features/magic-context/storage-session-tables.d.ts.map +1 -1
- package/dist/features/magic-context/storage-tag-identity-revision.d.ts +50 -0
- package/dist/features/magic-context/storage-tag-identity-revision.d.ts.map +1 -0
- package/dist/features/magic-context/storage-tags.d.ts +155 -5
- package/dist/features/magic-context/storage-tags.d.ts.map +1 -1
- package/dist/features/magic-context/tagger.d.ts +2 -0
- package/dist/features/magic-context/tagger.d.ts.map +1 -1
- package/dist/features/magic-context/transform-decision-log.d.ts +3 -0
- package/dist/features/magic-context/transform-decision-log.d.ts.map +1 -1
- package/dist/hooks/magic-context/active-anthropic-turn.d.ts +2 -0
- package/dist/hooks/magic-context/active-anthropic-turn.d.ts.map +1 -1
- package/dist/hooks/magic-context/apply-operations.d.ts +7 -0
- package/dist/hooks/magic-context/apply-operations.d.ts.map +1 -1
- package/dist/hooks/magic-context/auto-search-runner.d.ts +2 -2
- package/dist/hooks/magic-context/auto-search-runner.d.ts.map +1 -1
- package/dist/hooks/magic-context/heuristic-cleanup.d.ts.map +1 -1
- package/dist/hooks/magic-context/history-boundary-repair.d.ts +11 -2
- package/dist/hooks/magic-context/history-boundary-repair.d.ts.map +1 -1
- package/dist/hooks/magic-context/hook-handlers.d.ts.map +1 -1
- package/dist/hooks/magic-context/lkg-measured-request.d.ts +3 -1
- package/dist/hooks/magic-context/lkg-measured-request.d.ts.map +1 -1
- package/dist/hooks/magic-context/lkg-persist.d.ts +10 -13
- package/dist/hooks/magic-context/lkg-persist.d.ts.map +1 -1
- package/dist/hooks/magic-context/lkg-recovery-fence.d.ts +62 -0
- package/dist/hooks/magic-context/lkg-recovery-fence.d.ts.map +1 -0
- package/dist/hooks/magic-context/lkg-recovery-prefix.d.ts +38 -0
- package/dist/hooks/magic-context/lkg-recovery-prefix.d.ts.map +1 -0
- package/dist/hooks/magic-context/lkg-replay.d.ts +16 -9
- package/dist/hooks/magic-context/lkg-replay.d.ts.map +1 -1
- package/dist/hooks/magic-context/lkg-slot.d.ts +141 -2
- package/dist/hooks/magic-context/lkg-slot.d.ts.map +1 -1
- package/dist/hooks/magic-context/opaque-thinking.d.ts +12 -0
- package/dist/hooks/magic-context/opaque-thinking.d.ts.map +1 -0
- package/dist/hooks/magic-context/pass-outcome.d.ts +1 -0
- package/dist/hooks/magic-context/pass-outcome.d.ts.map +1 -1
- package/dist/hooks/magic-context/pending-materialization.d.ts +8 -0
- package/dist/hooks/magic-context/pending-materialization.d.ts.map +1 -0
- package/dist/hooks/magic-context/postprocess-read-cache.d.ts.map +1 -1
- package/dist/hooks/magic-context/provider-visible-parts.d.ts +45 -0
- package/dist/hooks/magic-context/provider-visible-parts.d.ts.map +1 -0
- package/dist/hooks/magic-context/read-session-chunk.d.ts +22 -1
- package/dist/hooks/magic-context/read-session-chunk.d.ts.map +1 -1
- package/dist/hooks/magic-context/read-session-db.d.ts +3 -0
- package/dist/hooks/magic-context/read-session-db.d.ts.map +1 -1
- package/dist/hooks/magic-context/read-session-formatting.d.ts +5 -0
- package/dist/hooks/magic-context/read-session-formatting.d.ts.map +1 -1
- package/dist/hooks/magic-context/read-session-raw.d.ts +123 -1
- package/dist/hooks/magic-context/read-session-raw.d.ts.map +1 -1
- package/dist/hooks/magic-context/read-session-true-raw-tokens.d.ts.map +1 -1
- package/dist/hooks/magic-context/reasoning-budget.d.ts.map +1 -1
- package/dist/hooks/magic-context/sentinel.d.ts +41 -1
- package/dist/hooks/magic-context/sentinel.d.ts.map +1 -1
- package/dist/hooks/magic-context/strict-thinking-prefix.d.ts +8 -0
- package/dist/hooks/magic-context/strict-thinking-prefix.d.ts.map +1 -0
- package/dist/hooks/magic-context/strip-content.d.ts +38 -24
- package/dist/hooks/magic-context/strip-content.d.ts.map +1 -1
- package/dist/hooks/magic-context/system-date-refresh.d.ts +29 -0
- package/dist/hooks/magic-context/system-date-refresh.d.ts.map +1 -0
- package/dist/hooks/magic-context/system-prompt-dates.d.ts +6 -0
- package/dist/hooks/magic-context/system-prompt-dates.d.ts.map +1 -0
- package/dist/hooks/magic-context/system-prompt-delivery.d.ts +47 -0
- package/dist/hooks/magic-context/system-prompt-delivery.d.ts.map +1 -0
- package/dist/hooks/magic-context/system-prompt-hash.d.ts +18 -5
- package/dist/hooks/magic-context/system-prompt-hash.d.ts.map +1 -1
- package/dist/hooks/magic-context/tag-messages.d.ts +19 -0
- package/dist/hooks/magic-context/tag-messages.d.ts.map +1 -1
- package/dist/hooks/magic-context/tag-owner-warmup.d.ts +14 -0
- package/dist/hooks/magic-context/tag-owner-warmup.d.ts.map +1 -0
- package/dist/hooks/magic-context/token-count-exact.d.ts +35 -0
- package/dist/hooks/magic-context/token-count-exact.d.ts.map +1 -0
- package/dist/hooks/magic-context/tool-drop-target.d.ts +2 -0
- package/dist/hooks/magic-context/tool-drop-target.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts +7 -0
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform.d.ts +21 -4
- package/dist/hooks/magic-context/transform.d.ts.map +1 -1
- package/dist/index-18yrysyj.js +1477 -0
- package/dist/{index-g2z2k5m4.js → index-3gj1ak4c.js} +2 -2
- package/dist/{index-5cep2r9n.js → index-5ty9rnbx.js} +60 -258
- package/dist/{index-amycb7b1.js → index-a5mw0xp3.js} +3 -3
- package/dist/{index-1j34a56j.js → index-czba8tw3.js} +266 -32
- package/dist/{index-qbkzdkk0.js → index-k59af64t.js} +6 -2
- package/dist/{index-53g38ggt.js → index-kmbme1v1.js} +1 -1
- package/dist/{index-5b7x80ec.js → index-kw21z5pe.js} +6055 -3973
- package/dist/{index-33gprt9g.js → index-yjv8dpht.js} +1 -1
- package/dist/{index-btp5tdc8.js → index-z2w1eq3y.js} +840 -456
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +114 -2
- package/dist/{message-time-backfill-phrwp2fz.js → message-time-backfill-sykevdax.js} +3 -3
- package/dist/plugin/rpc-handlers.d.ts.map +1 -1
- package/dist/{read-session-chunk-2xm4sc4y.js → read-session-chunk-863d6c06.js} +6 -4
- package/dist/recomp-orchestrator-wrjy3qym.js +21 -0
- package/dist/{safe-notification-target-ph3xd1ve.js → safe-notification-target-1jkf0m82.js} +2 -2
- package/dist/{send-session-notification-rnc4nrsr.js → send-session-notification-cz6ev088.js} +5 -5
- package/dist/shared/auto-search-lifecycle.d.ts +14 -0
- package/dist/shared/auto-search-lifecycle.d.ts.map +1 -1
- package/dist/shared/logger.d.ts.map +1 -1
- package/dist/shared/models-dev-cache.d.ts.map +1 -1
- package/dist/shared/models-dev-temperature.d.ts +18 -0
- package/dist/shared/models-dev-temperature.d.ts.map +1 -0
- package/dist/shared/processed-image-eligibility.d.ts +22 -0
- package/dist/shared/processed-image-eligibility.d.ts.map +1 -0
- package/dist/shared/project-directory-key.d.ts +16 -0
- package/dist/shared/project-directory-key.d.ts.map +1 -1
- package/dist/shared/recovery-reasoning-prefix.d.ts +9 -0
- package/dist/shared/recovery-reasoning-prefix.d.ts.map +1 -0
- package/dist/shared/sqlite.d.ts +33 -1
- package/dist/shared/sqlite.d.ts.map +1 -1
- package/dist/shared/stable-json.d.ts.map +1 -1
- package/dist/shared/storage-file-mutex.d.ts +9 -0
- package/dist/shared/storage-file-mutex.d.ts.map +1 -0
- package/dist/shared/storage-permissions.d.ts +6 -0
- package/dist/shared/storage-permissions.d.ts.map +1 -1
- package/dist/shared/subagent-temperature.d.ts +46 -0
- package/dist/shared/subagent-temperature.d.ts.map +1 -0
- package/dist/shared/tag-owner-id.d.ts +1 -0
- package/dist/shared/tag-owner-id.d.ts.map +1 -1
- package/dist/shared/tag-transcript.d.ts +9 -0
- package/dist/shared/tag-transcript.d.ts.map +1 -1
- package/dist/shared/window-geometry.d.ts +9 -66
- package/dist/shared/window-geometry.d.ts.map +1 -1
- package/dist/standalone-plugin-marker.d.ts +8 -0
- package/dist/standalone-plugin-marker.d.ts.map +1 -0
- package/dist/tools/ctx-expand/search-archive.d.ts +4 -0
- package/dist/tools/ctx-expand/search-archive.d.ts.map +1 -0
- package/dist/tools/ctx-expand/tools.d.ts.map +1 -1
- package/dist/tools/ctx-reduce/constants.d.ts +1 -2
- package/dist/tools/ctx-reduce/constants.d.ts.map +1 -1
- package/dist/tools/ctx-reduce/tools.d.ts +1 -1
- package/dist/tools/ctx-reduce/tools.d.ts.map +1 -1
- package/dist/v2/hooks/context.d.ts +1 -1
- package/dist/v2/hooks/context.d.ts.map +1 -1
- package/dist/v2/hooks/copied-tag-notation.d.ts +19 -0
- package/dist/v2/hooks/copied-tag-notation.d.ts.map +1 -0
- package/dist/v2/hooks/generate.d.ts +9 -2
- package/dist/v2/hooks/generate.d.ts.map +1 -1
- package/dist/v2/hooks/payload.d.ts.map +1 -1
- package/dist/v2/hooks/system-prompt-response.d.ts +5 -0
- package/dist/v2/hooks/system-prompt-response.d.ts.map +1 -0
- package/dist/v2/server.d.ts.map +1 -1
- package/dist/v2/server.js +34550 -30855
- package/dist/web/main.js +373 -19
- package/dist/{wrapup-orchestrator-yknks3ad.js → wrapup-orchestrator-bmybc5p5.js} +10 -10
- package/package.json +1 -1
- package/src/config/deprecated-config.ts +18 -0
- package/src/config/index.test.ts +13 -37
- package/src/config/index.ts +2 -2
- package/src/config/project-security.ts +3 -3
- package/src/config/schema/magic-context.ts +10 -6
- package/src/shared/auto-search-lifecycle.ts +43 -0
- package/src/shared/logger.ts +10 -2
- package/src/shared/models-dev-cache.ts +1 -7
- package/src/shared/models-dev-temperature.ts +107 -0
- package/src/shared/processed-image-eligibility.test.ts +68 -0
- package/src/shared/processed-image-eligibility.ts +41 -0
- package/src/shared/processed-image-position-review.json +20 -0
- package/src/shared/processed-image-position-review.test.ts +19 -0
- package/src/shared/project-directory-key.ts +20 -0
- package/src/shared/recovery-reasoning-prefix.test.ts +34 -0
- package/src/shared/recovery-reasoning-prefix.ts +35 -0
- package/src/shared/sqlite-acquisition-routing.test.ts +4 -3
- package/src/shared/sqlite-foreground-wait.test.ts +68 -0
- package/src/shared/sqlite-pass-scope.test.ts +4 -4
- package/src/shared/sqlite-writer-diagnostics.test.ts +52 -12
- package/src/shared/sqlite.ts +380 -39
- package/src/shared/stable-json.ts +37 -7
- package/src/shared/storage-file-mutex.test.ts +50 -0
- package/src/shared/storage-file-mutex.ts +130 -0
- package/src/shared/storage-permissions.ts +46 -0
- package/src/shared/subagent-temperature.ts +110 -0
- package/src/shared/tag-owner-id.ts +13 -0
- package/src/shared/tag-transcript.ts +118 -0
- package/src/shared/window-geometry.test.ts +102 -236
- package/src/shared/window-geometry.ts +23 -413
- package/dist/index-ramz5kkm.js +0 -514
- package/dist/recomp-orchestrator-frmwj9hz.js +0 -21
- package/src/shared/__fixtures__/window-overlay.v1.json +0 -337
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lkg-recovery-fence.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/lkg-recovery-fence.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAc1C,qBAAa,qBAAsB,SAAQ,KAAK;gBAChC,OAAO,EAAE,MAAM;CAI9B;AAED,QAAA,IAAI,QAAQ,EAAE,CAAC,CAAC,KAAK,EAAE,OAAO,GAAG,WAAW,GAAG,aAAa,GAAG,OAAO,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;AAS7F,QAAA,IAAI,UAAU,EAAE,CAAC,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,GAAG,OAAO,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;AAoB9E,wBAAgB,yBAAyB,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAGlE;AAOD,eAAO,MAAM,oBAAoB,UADZ,MAAM,WACa,CAAC;AACzC,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAE9D;AAkBD,wB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ED,6EAA6E;AAC7E,wBAAgB,oBAAoB,CAAC,IAAI,EAAE;IACvC,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,OAAO,CAAC;IACd,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,iBAAiB,EAAE,OAAO,CAAC;CAC9B,GAAG,MAAM,CAgCT;AAED,oGAAoG;AACpG,wBAAgB,0BAA0B,CAAC,IAAI,EAAE;IAC7C,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,MAAM,OAAO,GAAG,SAAS,CAAC;IAChC,MAAM,EAAE,MAAM,OAAO,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB,GAAG,OAAO,CAoDV;AAED,wBAAgB,qBAAqB,CAAC,CAAC,GAAG,IAAI,EAC1C,SAAS,EAAE,MAAM,EACjB,MAAM,CAAC,EAAE,MAAM,CAAC,EAChB,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,GAAG,SAAS,KAAK,OAAO,GAChD,CAAC,GAAG,SAAS,CAUf;AACD,eAAO,MAAM,MAAM;uBACI,MAAM,CAAC,QAAQ;uBAOf,OAAO,QAAQ;yBAMb,OAAO,UAAU;CAMzC,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { Database } from "../../shared/sqlite";
|
|
2
|
+
import { type LkgEntryProjection } from "./lkg-replay";
|
|
3
|
+
import { type LkgEntryNote } from "./lkg-slot";
|
|
4
|
+
import type { MessageLike } from "./transform-operations";
|
|
5
|
+
interface RecoveryPrefix {
|
|
6
|
+
inputs: {
|
|
7
|
+
id: string;
|
|
8
|
+
digest: string;
|
|
9
|
+
}[];
|
|
10
|
+
json: string;
|
|
11
|
+
untaggedInputIds: ReadonlySet<string>;
|
|
12
|
+
modelKey: string | null;
|
|
13
|
+
providerKey: string | null;
|
|
14
|
+
}
|
|
15
|
+
export declare function noteUncertifiedNormalLkg(sessionId: string, revision: string | undefined): void;
|
|
16
|
+
export declare function hasProcessLocalLkgProof(sessionId: string): boolean;
|
|
17
|
+
export declare function lkgDirtyRevision(sessionId: string): string | undefined;
|
|
18
|
+
export declare function rememberLkgDirtyRevision(sessionId: string, revision: string): void;
|
|
19
|
+
export declare function clearLkgRecoveryPrefixes(): void;
|
|
20
|
+
export declare function clearLkgRecoverySession(sessionId: string): void;
|
|
21
|
+
export declare function noteLkgCapturedPrefix(sessionId: string): void;
|
|
22
|
+
export declare function noteLkgRecoveryPrefix(args: {
|
|
23
|
+
sessionId: string;
|
|
24
|
+
entry: LkgEntryNote;
|
|
25
|
+
messages: MessageLike[];
|
|
26
|
+
modelKey: string | null;
|
|
27
|
+
providerKey: string | null;
|
|
28
|
+
}): boolean;
|
|
29
|
+
export declare function readLkgRecoveryPrefix(sessionId: string, inputs: Pick<LkgEntryProjection, "id" | "contentDigest">[], messages: MessageLike[], db?: Database): {
|
|
30
|
+
prefix?: RecoveryPrefix;
|
|
31
|
+
rebuildReason?: string;
|
|
32
|
+
};
|
|
33
|
+
/** Extend the immutable provider-output record only after saving the successful transformed request. */
|
|
34
|
+
export declare function noteLkgHealthyPrefix(sessionId: string, inputs: LkgEntryProjection[], messages: MessageLike[], release: boolean): void;
|
|
35
|
+
export declare function lkgRecoveryReplayUnproven(sessionId: string): boolean;
|
|
36
|
+
export declare function lkgRecoveryEntryUnproven(sessionId: string, entry: LkgEntryNote, messages: MessageLike[]): boolean;
|
|
37
|
+
export {};
|
|
38
|
+
//# sourceMappingURL=lkg-recovery-prefix.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lkg-recovery-prefix.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/lkg-recovery-prefix.ts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AE,MAAM,GAAG,IAAI,CAAC;CAC9B,GAAG,OAAO,CAuBV;AAED,wBAAgB,qBAAqB,CACjC,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,IAAI,CAAC,kBAAkB,EAAE,IAAI,GAAG,eAAe,CAAC,EAAE,EAC1D,QAAQ,EAAE,WAAW,EAAE,EACvB,EAAE,CAAC,EAAE,QAAQ,GACd;IAAE,MAAM,CAAC,EAAE,cAAc,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,CAAA;CAAE,CA4BrD;AAED,wGAAwG;AACxG,wBAAgB,oBAAoB,CAChC,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,kBAAkB,EAAE,EAC5B,QAAQ,EAAE,WAAW,EAAE,EACvB,OAAO,EAAE,OAAO,GACjB,IAAI,CAgBN;AAED,wBAAgB,yBAAyB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAGpE;AAED,wBAAgB,wBAAwB,CACpC,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,YAAY,EACnB,QAAQ,EAAE,WAAW,EAAE,GACxB,OAAO,CAQT"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type LkgEntryNote, type LkgSlot } from "./lkg-slot";
|
|
1
|
+
import { type LkgEntryDigestStats, type LkgEntryNote, type LkgSlot } from "./lkg-slot";
|
|
2
2
|
import type { MessageLike } from "./transform-operations";
|
|
3
3
|
export interface LkgModelKeys {
|
|
4
4
|
modelKey: string | null;
|
|
@@ -16,16 +16,21 @@ export interface LkgEntryProjection {
|
|
|
16
16
|
contentDigest?: () => string | null;
|
|
17
17
|
}
|
|
18
18
|
export declare function projectLkgEntry(messages: MessageLike[]): LkgEntryProjection[];
|
|
19
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* Project each pass's pristine input with per-message digests reused from the
|
|
21
|
+
* previous pass. Reuse needs the exact retained tokens of a message, not its id
|
|
22
|
+
* or a rolling hash; see {@link LkgEntryDigestCache}. By default the projector
|
|
23
|
+
* shares the cache {@link noteEntry} fills earlier in the same pass, so the
|
|
24
|
+
* messages it already digested are only compared again. An explicit `maxBytes`
|
|
25
|
+
* gives the projector its own cache bounded to that many bytes.
|
|
26
|
+
*/
|
|
20
27
|
export declare function createLkgEntryProjector(options?: {
|
|
21
28
|
maxBytes?: number;
|
|
22
|
-
onReuse?: (stats:
|
|
23
|
-
reused: number;
|
|
24
|
-
retained: number;
|
|
25
|
-
retainedBytes: number;
|
|
26
|
-
}) => void;
|
|
29
|
+
onReuse?: (stats: LkgEntryDigestStats) => void;
|
|
27
30
|
}): (sessionId: string, messages: MessageLike[]) => LkgEntryProjection[];
|
|
28
31
|
export interface LkgCaptureInput {
|
|
32
|
+
/** Certify the complete returned array, not just an early stable anchor. */
|
|
33
|
+
completeOutput?: boolean;
|
|
29
34
|
sessionId: string;
|
|
30
35
|
input: LkgEntryProjection[] | MessageLike[];
|
|
31
36
|
output: MessageLike[];
|
|
@@ -40,9 +45,11 @@ export declare function findLkgAnchor(messages: LkgEntryProjection[]): number |
|
|
|
40
45
|
/**
|
|
41
46
|
* Build the replay prefix and serialize it once. The returned `jsonPrefix` is
|
|
42
47
|
* the exact artifact stored in the last-known-good replay entry; callers must
|
|
43
|
-
* use it as-is rather than serialize the prefix again.
|
|
48
|
+
* use it as-is rather than serialize the prefix again. It holds the served
|
|
49
|
+
* messages as the provider receives them: tool-state fields no host sends are
|
|
50
|
+
* left out.
|
|
44
51
|
*/
|
|
45
|
-
export declare function buildLkgPrefix(input: LkgEntryProjection[] | MessageLike[], output: MessageLike[]): {
|
|
52
|
+
export declare function buildLkgPrefix(input: LkgEntryProjection[] | MessageLike[], output: MessageLike[], completeOutput?: boolean): {
|
|
46
53
|
anchorIndex: number;
|
|
47
54
|
anchorMessageId: string;
|
|
48
55
|
inputIdSeq: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lkg-replay.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/lkg-replay.ts"],"names":[],"m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AAS,CAAC,IAAI,EAAE;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,KAAK,CAAC,EAAE,YAAY,GAAG,IAAI,CAAC;IAC5B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,+FAA+F;IAC/F,aAAa,CAAC,EAAE,CAAC,QAAQ,EAAE,WAAW,EAAE,KAAK,IAAI,CAAC;CACrD,GAAG;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,EAAE,WAAW,EAAE,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,oBAAoB,CAAA;CAAE,CAsDtF;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAE3E"}
|
|
@@ -18,6 +18,11 @@ export interface LkgEntryNote {
|
|
|
18
18
|
pristineTail: MessageLike[];
|
|
19
19
|
entryInputIds: string[];
|
|
20
20
|
entryContentDigests: string[];
|
|
21
|
+
/**
|
|
22
|
+
* Legacy-format digests of the same prefix, present when the slot it was
|
|
23
|
+
* noted against was written before the current digest format.
|
|
24
|
+
*/
|
|
25
|
+
entryLegacyContentDigests?: (string | null)[];
|
|
21
26
|
anchorIndex: number;
|
|
22
27
|
}
|
|
23
28
|
/**
|
|
@@ -54,6 +59,11 @@ interface MessageContentFieldVisitor {
|
|
|
54
59
|
endObject(token: number, entryCount: number): boolean;
|
|
55
60
|
}
|
|
56
61
|
export declare function visitMessageContentFields(value: unknown, visitor: MessageContentFieldVisitor): boolean;
|
|
62
|
+
/**
|
|
63
|
+
* The value a content snapshot covers: what the provider receives of a message.
|
|
64
|
+
* Tool-state fields no host sends are left out (see provider-visible-parts.ts),
|
|
65
|
+
* so they are never walked or hashed and a change to them is no change.
|
|
66
|
+
*/
|
|
57
67
|
export declare function contentSnapshotValue(value: unknown): unknown;
|
|
58
68
|
export declare function messageContentFields(message: MessageLike): LkgContentField[];
|
|
59
69
|
export declare function signatureForFields(fields: readonly LkgContentField[]): string;
|
|
@@ -61,12 +71,59 @@ export declare function signatureForFields(fields: readonly LkgContentField[]):
|
|
|
61
71
|
export declare function messageContentSnapshot(message: MessageLike): MessageContentSnapshot;
|
|
62
72
|
/** Flatten a value into typed tokens while retaining strings without deep copies. */
|
|
63
73
|
export declare function lkgContentFields(value: unknown): LkgContentField[] | null;
|
|
74
|
+
/**
|
|
75
|
+
* The digest a replay compares to decide whether a message is unchanged, so
|
|
76
|
+
* two different token lists must never encode to the same bytes (or a changed
|
|
77
|
+
* message could replay stale content), and it runs over every new or changed
|
|
78
|
+
* message, so it must be cheap per token.
|
|
79
|
+
*
|
|
80
|
+
* sha256 over an unambiguous binary encoding of the tokens: a one-byte tag per
|
|
81
|
+
* token, then for a string its length in UTF-16 units (uint32) and its UTF-16
|
|
82
|
+
* code units (so lone surrogates stay distinct), for a number its float64
|
|
83
|
+
* bytes, and for a marker symbol nothing more. Tokens are packed into a 64 KiB
|
|
84
|
+
* chunk and hashed one chunk at a time; a string too large for the chunk is
|
|
85
|
+
* hashed on its own. Building a text per token and updating the hash three times
|
|
86
|
+
* per token ran at about 44 MB/s on diagnostics-heavy tool parts with about a
|
|
87
|
+
* million tokens each.
|
|
88
|
+
*/
|
|
64
89
|
export declare function lkgContentDigestFromFields(fields: readonly LkgContentField[]): string;
|
|
90
|
+
/**
|
|
91
|
+
* Marks a digest written by {@link lkgContentDigestFromFields}. Durable slots
|
|
92
|
+
* written before it carry unmarked digests over the whole message in a text
|
|
93
|
+
* encoding (base64url never contains "."), and those are checked with
|
|
94
|
+
* {@link legacyLkgDigestFromFields} instead, so an upgrade does not turn a
|
|
95
|
+
* replayable turn into a refusal. The next healthy capture writes the slot in
|
|
96
|
+
* the current format.
|
|
97
|
+
*/
|
|
98
|
+
export declare const LKG_DIGEST_FORMAT_PREFIX = "2.";
|
|
99
|
+
export declare function isLegacyLkgDigest(digest: string): boolean;
|
|
100
|
+
/**
|
|
101
|
+
* The digest durable slots carried before {@link LKG_DIGEST_FORMAT_PREFIX}:
|
|
102
|
+
* sha256 of the text `<type>:<length>:<value>\0` per token. Kept only to verify
|
|
103
|
+
* legacy slots; nothing writes it.
|
|
104
|
+
*/
|
|
105
|
+
export declare function legacyLkgDigestFromFields(fields: readonly LkgContentField[]): string;
|
|
106
|
+
/**
|
|
107
|
+
* The legacy digest of a message: over the whole message, tool metadata
|
|
108
|
+
* included, as slots were written before the provider view; only an empty user
|
|
109
|
+
* diff summary is left out, as it was then.
|
|
110
|
+
*/
|
|
111
|
+
export declare function legacyLkgContentDigest(message: unknown): string | null;
|
|
112
|
+
/**
|
|
113
|
+
* Whether tokens match a stored digest in either format. Callers whose tokens
|
|
114
|
+
* are the same in both formats (Pi) use this; the OpenCode entry note keeps a
|
|
115
|
+
* separate legacy digest because its legacy tokens covered the whole message.
|
|
116
|
+
*/
|
|
117
|
+
export declare function lkgFieldsMatchDigest(fields: readonly LkgContentField[], stored: string | undefined): boolean;
|
|
65
118
|
export interface LkgInputSnapshot {
|
|
66
119
|
id: string;
|
|
67
120
|
fields: readonly LkgContentField[];
|
|
68
121
|
}
|
|
69
|
-
/**
|
|
122
|
+
/**
|
|
123
|
+
* Id-keyed digest memo, bounded to 16 MiB, that reuses a digest only after an
|
|
124
|
+
* exact typed-field comparison. Entry capture and the entry projection now use
|
|
125
|
+
* {@link LkgEntryDigestCache} instead.
|
|
126
|
+
*/
|
|
70
127
|
export declare function memoizedLkgContentDigestFromFields(id: string, fields: readonly LkgContentField[]): string;
|
|
71
128
|
/** Compare captured tokens before reusing digests: a message can change without changing its id. */
|
|
72
129
|
export declare function exactReusablePrefix(current: readonly LkgInputSnapshot[], prior: readonly LkgInputSnapshot[] | null): number;
|
|
@@ -88,7 +145,11 @@ export declare function incrementalLkgContentDigests(entries: readonly LkgDigest
|
|
|
88
145
|
digests: string[];
|
|
89
146
|
reusedPrefix: number;
|
|
90
147
|
};
|
|
91
|
-
/**
|
|
148
|
+
/**
|
|
149
|
+
* Digest what the provider sees of a message to detect input drift before an
|
|
150
|
+
* LKG replay. Fields OpenCode never sends (see provider-visible-parts.ts) are
|
|
151
|
+
* left out, so they cost nothing and a change to them does not block a replay.
|
|
152
|
+
*/
|
|
92
153
|
export declare function lkgContentDigest(message: MessageLike): string | null;
|
|
93
154
|
/**
|
|
94
155
|
* Why {@link captureSlot} would refuse `slot` for `sessionId`, or null when it would
|
|
@@ -99,8 +160,86 @@ export declare function lkgSlotRejection(sessionId: string, slot: LkgSlot): stri
|
|
|
99
160
|
export declare function captureSlot(sessionId: string, slot: LkgSlot): boolean;
|
|
100
161
|
export declare function getInMemorySlot(sessionId: string): LkgSlot | undefined;
|
|
101
162
|
export declare function getSlot(sessionId: string): LkgSlot | undefined;
|
|
163
|
+
/** Evict only the process copy; durable replay authority is unchanged. */
|
|
164
|
+
export declare function forgetInMemorySlot(sessionId: string): void;
|
|
102
165
|
export declare function dropSlot(sessionId: string, _reason?: string): void;
|
|
103
166
|
export declare function noteEntry(sessionId: string, messages: MessageLike[]): LkgEntryNote | null;
|
|
167
|
+
/**
|
|
168
|
+
* Work the entry digest cache did since the last reset, for tests and the
|
|
169
|
+
* issue 653 benchmark: how many messages were flattened and hashed (and how many
|
|
170
|
+
* string characters that covered), and how many tokens and string characters
|
|
171
|
+
* were compared against retained tokens.
|
|
172
|
+
*/
|
|
173
|
+
export interface LkgEntryWork {
|
|
174
|
+
flattenedMessages: number;
|
|
175
|
+
flattenedChars: number;
|
|
176
|
+
hashedMessages: number;
|
|
177
|
+
comparedMessages: number;
|
|
178
|
+
comparedFields: number;
|
|
179
|
+
comparedChars: number;
|
|
180
|
+
}
|
|
181
|
+
/** @internal */
|
|
182
|
+
export declare function getLkgEntryWorkForTest(): LkgEntryWork;
|
|
183
|
+
export interface LkgEntryDigestStats {
|
|
184
|
+
reused: number;
|
|
185
|
+
retained: number;
|
|
186
|
+
retainedBytes: number;
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Per-message pristine digests for each session, reused from one pass to the
|
|
190
|
+
* next.
|
|
191
|
+
*
|
|
192
|
+
* Tokens cover only what the provider sees of a message (see
|
|
193
|
+
* provider-visible-parts.ts). Each retained message keeps its exact typed
|
|
194
|
+
* tokens. A message reuses its digest only when it has the same id as a
|
|
195
|
+
* retained entry and its visible content still flattens to that entry's tokens, checked by {@link contentMatchesFields}
|
|
196
|
+
* without building anything; neither the id nor the object alone is trusted.
|
|
197
|
+
* Anything else is flattened and hashed. So an ordinary pass flattens and hashes
|
|
198
|
+
* only new or changed messages, and compares the rest at memory speed.
|
|
199
|
+
*
|
|
200
|
+
* Retention is per session. A session keeps entries in message order up to
|
|
201
|
+
* its share of the total budget (the total divided by the number of sessions
|
|
202
|
+
* retained, never more than the per-session cap); when a session joins,
|
|
203
|
+
* sessions above the new share are trimmed rather than dropped. Two large
|
|
204
|
+
* sessions served alternately therefore both keep their entries, instead of
|
|
205
|
+
* evicting each other on every pass, and the total never exceeds its ceiling.
|
|
206
|
+
* Messages beyond a session's share are hashed on every pass.
|
|
207
|
+
*/
|
|
208
|
+
export declare class LkgEntryDigestCache {
|
|
209
|
+
private readonly limits;
|
|
210
|
+
private readonly sessions;
|
|
211
|
+
private totalBytes;
|
|
212
|
+
constructor(limits: {
|
|
213
|
+
sessionMaxBytes: number;
|
|
214
|
+
totalMaxBytes: number;
|
|
215
|
+
maxSessions: number;
|
|
216
|
+
});
|
|
217
|
+
digests(sessionId: string, messages: readonly MessageLike[]): {
|
|
218
|
+
digests: (string | null)[];
|
|
219
|
+
stats: LkgEntryDigestStats;
|
|
220
|
+
};
|
|
221
|
+
private store;
|
|
222
|
+
/** Retained bytes per session and in total, for tests and diagnostics. */
|
|
223
|
+
stats(): {
|
|
224
|
+
totalBytes: number;
|
|
225
|
+
sessions: Array<{
|
|
226
|
+
sessionId: string;
|
|
227
|
+
bytes: number;
|
|
228
|
+
}>;
|
|
229
|
+
};
|
|
230
|
+
clear(): void;
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Ceiling for the cache {@link noteEntry} and the transform's entry projection
|
|
234
|
+
* share. One session may use up to half of it, so two large sessions served
|
|
235
|
+
* alternately both stay resident; a 64 MiB total used to make two sessions of
|
|
236
|
+
* over 32 MiB evict each other on every pass.
|
|
237
|
+
*/
|
|
238
|
+
export declare const LKG_ENTRY_CACHE_TOTAL_BYTES: number;
|
|
239
|
+
export declare const LKG_ENTRY_CACHE_SESSION_BYTES: number;
|
|
240
|
+
export declare const sharedLkgEntryDigests: LkgEntryDigestCache;
|
|
241
|
+
/** @internal sha256 digests computed since the last reset. */
|
|
242
|
+
export declare function getLkgDigestsComputedForTest(): number;
|
|
104
243
|
export declare function resetLkgSlotsForTest(): void;
|
|
105
244
|
export interface LkgSlotHeapStats {
|
|
106
245
|
count: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lkg-slot.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/lkg-slot.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"lkg-slot.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/lkg-slot.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAE1D,MAAM,WAAW,OAAO;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,yFAAyF;IACzF,gBAAgB,CAAC,EAAE,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;IAC9C,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,iFAAiF;IACjF,sBAAsB,CAAC,EAAE,MAAM,EAAE,CAAC;IAClC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,QAAQ,EAAE,MAAM,GAAG,IAAI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A;KAAE;IA4C7D,OAAO,CAAC,KAAK;IAwCb,0EAA0E;IAC1E,KAAK,IAAI;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,KAAK,CAAC;YAAE,SAAS,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,CAAC,CAAA;KAAE;IAUtF,KAAK,IAAI,IAAI;CAIhB;AAED;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,QAAoB,CAAC;AAC7D,eAAO,MAAM,6BAA6B,QAAoB,CAAC;AAG/D,eAAO,MAAM,qBAAqB,qBAIhC,CAAC;AAIH,8DAA8D;AAC9D,wBAAgB,4BAA4B,IAAI,MAAM,CAErD;AAED,wBAAgB,oBAAoB,IAAI,IAAI,CAc3C;AAED,MAAM,WAAW,gBAAgB;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,KAAK,CAAC;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACzD;AAED,kFAAkF;AAClF,wBAAgB,mBAAmB,IAAI,gBAAgB,CAStD;AAED,wBAAgB,sBAAsB,IAAI;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAG9E;AAED,eAAO,MAAM,0BAA0B,6BAAuB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** Estimate encrypted thinking from the assistant's provider-reported reasoning
|
|
2
|
+
* tokens, or its total output tokens when no separate reasoning count exists.
|
|
3
|
+
* Without either count, use the shared 1,000-token unknown-step heuristic; it
|
|
4
|
+
* is not a mathematical upper bound. When a previous request prefix matches
|
|
5
|
+
* exactly, its provider-measured input plus the appended suffix replaces the
|
|
6
|
+
* local estimate for checking whether the request fits the model window.
|
|
7
|
+
*/
|
|
8
|
+
export declare function opaqueThinkingCost(reasoning: unknown, output: unknown): {
|
|
9
|
+
tokens: number;
|
|
10
|
+
fallback: boolean;
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=opaque-thinking.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"opaque-thinking.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/opaque-thinking.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAC9B,SAAS,EAAE,OAAO,EAClB,MAAM,EAAE,OAAO,GAChB;IACC,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,OAAO,CAAC;CACrB,CAMA"}
|
|
@@ -39,6 +39,7 @@ export declare const PASS_DEGRADATION_EFFECTS: {
|
|
|
39
39
|
readonly "auto-search-timeout": "served";
|
|
40
40
|
readonly "auto-search-search-failure": "served";
|
|
41
41
|
readonly "auto-search-cas-exhaustion": "served";
|
|
42
|
+
readonly "auto-search-storage-busy": "served";
|
|
42
43
|
readonly "auto-search-internal-failure": "served";
|
|
43
44
|
readonly "thinking-binding-recovery-persistence-failure": "changes-request";
|
|
44
45
|
readonly "merged-reasoning-strip-persistence-failure": "changes-request";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pass-outcome.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/pass-outcome.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,mBAAmB,GAAG,UAAU,GAAG,OAAO,CAAC;AAEvD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,wBAAwB
|
|
1
|
+
{"version":3,"file":"pass-outcome.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/pass-outcome.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,mBAAmB,GAAG,UAAU,GAAG,OAAO,CAAC;AAEvD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2C4B,CAAC;AAElE,MAAM,MAAM,mBAAmB,GAAG,MAAM,OAAO,wBAAwB,CAAC;AAExE,oHAAoH;AACpH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAE5E;AAED,MAAM,WAAW,eAAe;IAC5B,IAAI,EAAE,mBAAmB,CAAC;IAC1B,IAAI,EAAE,mBAAmB,CAAC;CAC7B;AAED,MAAM,WAAW,WAAW;IACxB,YAAY,EAAE,eAAe,EAAE,CAAC;IAChC,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,IAAI,EAAE,mBAAmB,EAAE,IAAI,CAAC,EAAE,mBAAmB,GAAG,IAAI,CAAC;IACpE,aAAa,IAAI,IAAI,CAAC;IACtB,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC;IAClC,iBAAiB,IAAI,OAAO,CAAC;CAChC;AAED,wBAAgB,iBAAiB,IAAI,WAAW,CAqB/C"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type PendingMaterializationOrigin = "fit_retry" | "system_hash" | "user_flush" | "variant_change" | "recomp" | "boundary_repair" | "host_history_change" | "host_compaction" | "tag_identity_repair" | "thinking_hold" | "mutation_drift";
|
|
2
|
+
export declare function requestPendingMaterialization(sessions: Set<string>, sessionId: string, origin: PendingMaterializationOrigin): void;
|
|
3
|
+
export declare function pendingMaterializationOrigin(sessions: Set<string>, sessionId: string): string;
|
|
4
|
+
export declare function clearPendingMaterialization(sessions: Set<string>, sessionId: string): void;
|
|
5
|
+
/** The first origin remains the log label, but subsequent requests still matter:
|
|
6
|
+
* a flush arriving while a system edit awaits its reply must not be deferred. */
|
|
7
|
+
export declare function hasOnlySystemHashMaterialization(sessions: Set<string>, sessionId: string): boolean;
|
|
8
|
+
//# sourceMappingURL=pending-materialization.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pending-materialization.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/pending-materialization.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,4BAA4B,GAClC,WAAW,GACX,aAAa,GACb,YAAY,GACZ,gBAAgB,GAChB,QAAQ,GACR,iBAAiB,GACjB,qBAAqB,GACrB,iBAAiB,GACjB,qBAAqB,GACrB,eAAe,GACf,gBAAgB,CAAC;AAQvB,wBAAgB,6BAA6B,CACzC,QAAQ,EAAE,GAAG,CAAC,MAAM,CAAC,EACrB,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,4BAA4B,GACrC,IAAI,CAcN;AAED,wBAAgB,4BAA4B,CAAC,QAAQ,EAAE,GAAG,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAI7F;AAED,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,GAAG,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAI1F;AAED;iFACiF;AACjF,wBAAgB,gCAAgC,CAC5C,QAAQ,EAAE,GAAG,CAAC,MAAM,CAAC,EACrB,SAAS,EAAE,MAAM,GAClB,OAAO,CAGT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postprocess-read-cache.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/postprocess-read-cache.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,KAAK,yBAAyB,EACjC,MAAM,qDAAqD,CAAC;AAC7D,OAAO,EACH,kCAAkC,EAErC,MAAM,2CAA2C,CAAC;AACnD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AAEnE,OAAO,KAAK,EAAE,QAAQ,EAAa,MAAM,qBAAqB,CAAC;AA0D/D,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,GAAG,QAAQ,EAAE,CAG/E;AAED,wBAAgB,qBAAqB,CACjC,EAAE,EAAE,QAAQ,EACZ,SAAS,EAAE,MAAM,EACjB,gBAAgB,EAAE,WAAW,CAAC,MAAM,CAAC,GACtC,UAAU,CAAC,OAAO,kCAAkC,CAAC,CAevD;AAED,wBAAgB,yBAAyB,CACrC,EAAE,EAAE,QAAQ,EACZ,SAAS,EAAE,MAAM,GAClB,yBAAyB,
|
|
1
|
+
{"version":3,"file":"postprocess-read-cache.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/postprocess-read-cache.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,KAAK,yBAAyB,EACjC,MAAM,qDAAqD,CAAC;AAC7D,OAAO,EACH,kCAAkC,EAErC,MAAM,2CAA2C,CAAC;AACnD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AAEnE,OAAO,KAAK,EAAE,QAAQ,EAAa,MAAM,qBAAqB,CAAC;AA0D/D,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,GAAG,QAAQ,EAAE,CAG/E;AAED,wBAAgB,qBAAqB,CACjC,EAAE,EAAE,QAAQ,EACZ,SAAS,EAAE,MAAM,EACjB,gBAAgB,EAAE,WAAW,CAAC,MAAM,CAAC,GACtC,UAAU,CAAC,OAAO,kCAAkC,CAAC,CAevD;AAED,wBAAgB,yBAAyB,CACrC,EAAE,EAAE,QAAQ,EACZ,SAAS,EAAE,MAAM,GAClB,yBAAyB,CAmB3B"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The part of a host message the provider receives, for comparisons and
|
|
3
|
+
* snapshots that must follow provider bytes and nothing else.
|
|
4
|
+
*
|
|
5
|
+
* Only a tool part's `state` is reduced; every other field of every part, and
|
|
6
|
+
* the message info, is kept as it is. The kept state fields are an explicit
|
|
7
|
+
* allowlist of what the hosts' model conversions read:
|
|
8
|
+
*
|
|
9
|
+
* - OpenCode 1 builds the request from the transformed messages only through
|
|
10
|
+
* `MessageV2.toModelMessagesEffect` (called right after the
|
|
11
|
+
* `experimental.chat.messages.transform` hook in
|
|
12
|
+
* packages/opencode/src/session/prompt.ts at v1.18.35). Its tool branch
|
|
13
|
+
* (packages/opencode/src/session/message-v2.ts) reads `state.status`,
|
|
14
|
+
* `state.input`, `state.output`, `state.error`, `state.attachments`,
|
|
15
|
+
* `state.time.compacted`, and on an `error` state `state.metadata.interrupted`
|
|
16
|
+
* and `state.metadata.output`.
|
|
17
|
+
* - OpenCode 2 receives the transformed messages back through the context
|
|
18
|
+
* hook's commit (src/v2/hooks/payload.ts), which reads `state.input`,
|
|
19
|
+
* `state.status`, `state.output`, `state.error` and `state.content`; its own
|
|
20
|
+
* lowering (packages/core/src/session/runner/to-llm-message.ts at v2.0.24)
|
|
21
|
+
* reads tool `input`, `content` and `error`.
|
|
22
|
+
*
|
|
23
|
+
* Everything else in a tool state is UI data: edit and write tools store
|
|
24
|
+
* workspace-wide LSP diagnostics, diffs and file snapshots in `state.metadata`,
|
|
25
|
+
* often several MiB per part and nearly all of a long coding session's bytes,
|
|
26
|
+
* plus `title`, the start and end times and the raw streamed input. Walking,
|
|
27
|
+
* copying, hashing or storing that on every pass cost tens of seconds, and a
|
|
28
|
+
* change to it, which no provider sees, must not count as a content change.
|
|
29
|
+
*
|
|
30
|
+
* A state field a future host version starts sending must be added to the
|
|
31
|
+
* allowlist; the provider-request test vendors the conversions above to catch
|
|
32
|
+
* a difference.
|
|
33
|
+
*/
|
|
34
|
+
/**
|
|
35
|
+
* The part as the provider sees it. Returns the same object when nothing needs
|
|
36
|
+
* removing, otherwise a shallow copy with a reduced `state`; the input is never
|
|
37
|
+
* changed.
|
|
38
|
+
*/
|
|
39
|
+
export declare function providerVisiblePart(part: unknown): unknown;
|
|
40
|
+
/**
|
|
41
|
+
* The message with each part reduced by {@link providerVisiblePart}. Returns the
|
|
42
|
+
* same object when no part changes.
|
|
43
|
+
*/
|
|
44
|
+
export declare function providerVisibleMessage<T>(message: T): T;
|
|
45
|
+
//# sourceMappingURL=provider-visible-parts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider-visible-parts.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/provider-visible-parts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAgEH;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAI1D;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,GAAG,CAAC,CAcvD"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ToolExpansionMap } from "../../shared/historian-tool-template";
|
|
2
2
|
import type { Database } from "../../shared/sqlite";
|
|
3
3
|
import { type SessionChunkLine } from "./read-session-formatting";
|
|
4
|
-
import { type RawMessage, type RawMessageOrdinalAnchor, type RawMessageOrdinalEntry, type RawMessageParts } from "./read-session-raw";
|
|
4
|
+
import { type RawBoundaryEndpoint, type RawMessage, type RawMessageOrdinalAnchor, type RawMessageOrdinalEntry, type RawMessageParts } from "./read-session-raw";
|
|
5
5
|
export { extractTexts, hasMeaningfulUserText } from "./read-session-formatting";
|
|
6
6
|
/**
|
|
7
7
|
* Per-session source override for raw message reading.
|
|
@@ -154,6 +154,7 @@ export declare function readRawSessionMessages(sessionId: string): RawMessage[];
|
|
|
154
154
|
export declare namespace readRawSessionMessages {
|
|
155
155
|
var readPage: typeof readRawSessionMessagePage;
|
|
156
156
|
var getCount: typeof getRawSessionMessageOrdinalCount;
|
|
157
|
+
var prepare: typeof prepareRawSessionOrdinals;
|
|
157
158
|
}
|
|
158
159
|
export declare function readRawSessionMessagePage(sessionId: string, afterOrdinal: number, limit: number, finalWatermark: number, after?: RawMessageOrdinalAnchor): RawMessage[];
|
|
159
160
|
export declare function getRawSessionMessageOrdinalCount(sessionId: string): number;
|
|
@@ -175,6 +176,17 @@ export declare function visitRawSessionMessages(sessionId: string, fromOrdinal:
|
|
|
175
176
|
}): void;
|
|
176
177
|
/** Read the requested absolute-ordinal interval from cache and source as needed. */
|
|
177
178
|
export declare function readRawSessionMessageRange(sessionId: string, fromOrdinal: number, toOrdinal: number): RawMessage[];
|
|
179
|
+
/**
|
|
180
|
+
* Prepare the canonical ordinal rank checkpoints for every newly touched file
|
|
181
|
+
* session. Fork adaptation (A/B): upstream builds them on a worker and the
|
|
182
|
+
* caller waits at most 250 ms; this fork has no worker infrastructure, so the
|
|
183
|
+
* scan runs synchronously in-process on the cached read-only connection (the
|
|
184
|
+
* first cold session pays one bounded scan, later reads are checkpoint-served).
|
|
185
|
+
* False means the store could not be scanned: callers defer or retry, and
|
|
186
|
+
* synchronous reads fall back to bounded/OFFSET paths. Registered providers and
|
|
187
|
+
* absent OpenCode stores need no SQLite preparation.
|
|
188
|
+
*/
|
|
189
|
+
export declare function prepareRawSessionOrdinals(sessionId: string): Promise<boolean>;
|
|
178
190
|
/**
|
|
179
191
|
* Prime the active raw-message cache with a TAIL-ONLY read (only messages
|
|
180
192
|
* at/after the last compartment boundary), so subsequent bounded reads inside
|
|
@@ -233,6 +245,12 @@ export declare function getRawSessionStoredMessageCount(sessionId: string): numb
|
|
|
233
245
|
export declare function readRawSessionMessageIdOrdinalsForRange(sessionId: string, fromOrdinal: number, toOrdinal: number): Map<string, number>;
|
|
234
246
|
export declare function readRawSessionMessageIdOrdinals(sessionId: string): Map<string, number>;
|
|
235
247
|
export declare function readRawSessionMessagePartsById(sessionId: string, messageId: string, onQuery?: () => void): RawMessageParts | null;
|
|
248
|
+
/**
|
|
249
|
+
* The facts compartment boundary resolution needs about each id (see
|
|
250
|
+
* RawBoundaryEndpoint), read from the OpenCode store in a bounded batch. Returns null when a raw-message provider
|
|
251
|
+
* serves the session; the caller then uses the provider-aware readers above.
|
|
252
|
+
*/
|
|
253
|
+
export declare function readRawSessionBoundaryEndpoints(sessionId: string, ids: readonly string[], blockIds: readonly string[]): Map<string, RawBoundaryEndpoint | null> | null;
|
|
236
254
|
export declare function hasRawSessionMessageById(sessionId: string, messageId: string): boolean;
|
|
237
255
|
export declare function readRawSessionMessageOrdinalById(sessionId: string, messageId: string): number | null;
|
|
238
256
|
/**
|
|
@@ -248,6 +266,9 @@ export declare function readRawSessionMessageOrdinalById(sessionId: string, mess
|
|
|
248
266
|
*/
|
|
249
267
|
export declare function compareRawSessionMessageOrder(sessionId: string, leftId: string, rightId: string): number | null;
|
|
250
268
|
export declare function readRawSessionMessageById(sessionId: string, messageId: string): RawMessage | null;
|
|
269
|
+
export declare namespace readRawSessionMessageById {
|
|
270
|
+
var prepare: typeof prepareRawSessionOrdinals;
|
|
271
|
+
}
|
|
251
272
|
export declare function getRawSessionMessageCount(sessionId: string): number;
|
|
252
273
|
/**
|
|
253
274
|
* Raw-session keys observed through a compartment boundary. Message and file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read-session-chunk.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/read-session-chunk.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAE7E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AASpD,OAAO,EAYH,KAAK,gBAAgB,EACxB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAIH,KAAK,UAAU,EACf,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,eAAe,
|
|
1
|
+
{"version":3,"file":"read-session-chunk.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/read-session-chunk.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAE7E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AASpD,OAAO,EAYH,KAAK,gBAAgB,EACxB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAIH,KAAK,mBAAmB,EACxB,KAAK,UAAU,EACf,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,eAAe,EAavB,MAAM,oBAAoB,CAAC;AAM5B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AAA;CAAO,GACnE,YAAY,CAsYd;AAED,wBAAgB,8BAA8B,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE,CAK9F;AAED,wBAAgB,sBAAsB,CAClC,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,GAAG,IAAI,EACzB,OAAO,CAAC,EAAE,MAAM,IAAI,GACrB,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAuBzB"}
|
|
@@ -47,6 +47,9 @@ export declare function shouldHoldIgnoredNotificationFromOpenCodeDb(db: Database
|
|
|
47
47
|
export declare function shouldHoldIgnoredNotification(sessionId: string): boolean;
|
|
48
48
|
export declare function assistantAwaitingToolsFromOpenCodeDb(db: Database, sessionId: string): boolean;
|
|
49
49
|
export declare function latestPersistedMessageForRecovery(sessionId: string): LatestPersistedMessage | null;
|
|
50
|
+
/** The real-user turn anchor used by thinking recovery, without reading text
|
|
51
|
+
* payloads. Synthetic users and tool-result-only carriers cannot own a turn. */
|
|
52
|
+
export declare function latestRealUserTurnIdFromOpenCodeDb(sessionId: string): string | undefined;
|
|
50
53
|
export declare function hasNewerRealUserMessage(db: Database, sessionId: string, latestAssistantTimeCreated: unknown): boolean;
|
|
51
54
|
/**
|
|
52
55
|
* Resolve `time_created` (ms since epoch) for a set of OpenCode message IDs.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read-session-db.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/read-session-db.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"read-session-db.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/read-session-db.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AA2B/C,MAAM,WAAW,sBAAsB;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAA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AED,wBAAgB,6BAA6B,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAexE;AAED,wBAAgB,oCAAoC,CAAC,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAwB7F;AAED,wBAAgB,iCAAiC,CAC7C,SAAS,EAAE,MAAM,GAClB,sBAAsB,GAAG,IAAI,CA8B/B;AAED;gFACgF;AAChF,wBAAgB,kCAAkC,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAwBxF;AAED,wBAAgB,uBAAuB,CACnC,EAAE,EAAE,QAAQ,EACZ,SAAS,EAAE,MAAM,EACjB,0BAA0B,EAAE,OAAO,GACpC,OAAO,CAuCT;AAkDD;;;;;;;GAOG;AACH,wBAAgB,6BAA6B,CACzC,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,SAAS,MAAM,EAAE,GAC9B,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAyBrB;AAED,wBAAgB,oCAAoC,CAChD,SAAS,EAAE,MAAM,GAClB;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CA2EhE"}
|
|
@@ -28,6 +28,11 @@ export declare function extractToolResultBodyTokens(parts: unknown[]): number;
|
|
|
28
28
|
/** Extract compact tool-call summaries from message parts.
|
|
29
29
|
* Returns lines like "TC: Fix lint errors" or "TC: read(src/index.ts)". */
|
|
30
30
|
export declare function extractToolCallSummaries(parts: unknown[]): string[];
|
|
31
|
+
/** Candidate `ai-tokenizer` package directories, in probe order. Exported for
|
|
32
|
+
* read-session-formatting-tokenizer-roots.test.ts, which pins the compiled-host
|
|
33
|
+
* case where only the extension's own install tree or the host plugin root can
|
|
34
|
+
* supply the dependency. */
|
|
35
|
+
export declare function tokenizerPackageRoots(): string[];
|
|
31
36
|
export interface TokenizerNativeMemoryStats {
|
|
32
37
|
loaded: boolean;
|
|
33
38
|
loadAttempted: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read-session-formatting.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/read-session-formatting.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"read-session-formatting.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/read-session-formatting.ts"],"names":[],"mappings":"AAUA,MAAM,WAAW,gBAAgB;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,UAAU;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,QAAQ,EAAE,KAAK,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,oBAAoB,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACnE,IAAI,EAAE,gBAAgB,EAAE,CAAC;IACzB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB;;;;;OAKG;IACH,UAAU,EAAE,OAAO,CAAC;CACvB;AAID,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,OAAO,CAiB/D;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,MAAM,EAAE,CAUvD;AAED,kGAAkG;AAClG,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,MAAM,CAcpE;AAED;4EAC4E;AAC5E,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,MAAM,EAAE,CA2BnE;AA4CD;;;6BAG6B;AAC7B,wBAAgB,qBAAqB,IAAI,MAAM,EAAE,CA+DhD;AA6ED,MAAM,WAAW,0BAA0B;IACvC,MAAM,EAAE,OAAO,CAAC;IAChB,aAAa,EAAE,OAAO,CAAC;IACvB,UAAU,EAAE,MAAM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