@cortexkit/opencode-magic-context 0.43.2 → 0.44.1
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 +18 -2
- package/dist/agents/magic-context-prompt.d.ts +2 -0
- package/dist/agents/magic-context-prompt.d.ts.map +1 -1
- package/dist/{announcement-1a8bvswd.js → announcement-n8hs7kjw.js} +2 -2
- package/dist/config/index.d.ts +13 -0
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/live-child-output-cap.d.ts +18 -0
- package/dist/config/live-child-output-cap.d.ts.map +1 -0
- package/dist/config/project-security.d.ts +6 -3
- package/dist/config/project-security.d.ts.map +1 -1
- package/dist/config/schema/magic-context.d.ts +28 -1
- package/dist/config/schema/magic-context.d.ts.map +1 -1
- package/dist/{conflict-warning-hook-hyk9y29x.js → conflict-warning-hook-d14ah73v.js} +6 -6
- package/dist/{derive-budgets-b8ybssh9.js → derive-budgets-gd2270s0.js} +3 -3
- package/dist/features/magic-context/compaction-marker.d.ts.map +1 -1
- package/dist/features/magic-context/compartment-embedding.d.ts +3 -2
- package/dist/features/magic-context/compartment-embedding.d.ts.map +1 -1
- package/dist/features/magic-context/compartment-storage.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/classify.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/curate-category-rotation.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/curate-memory-safety.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/failed-invocation-evidence.d.ts +13 -0
- package/dist/features/magic-context/dreamer/failed-invocation-evidence.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/hidden-single-shot.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/lease.d.ts +5 -2
- package/dist/features/magic-context/dreamer/lease.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/map-memories.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/memory-claim-safety.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/module-apply.d.ts +1 -0
- package/dist/features/magic-context/dreamer/module-apply.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/open-opencode-db.d.ts +2 -0
- package/dist/features/magic-context/dreamer/open-opencode-db.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/primer-seed.d.ts +11 -5
- package/dist/features/magic-context/dreamer/primer-seed.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/refresh-primers.d.ts +2 -2
- package/dist/features/magic-context/dreamer/refresh-primers.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/retrospective-learnings.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/storage-dream-runs.d.ts +1 -1
- package/dist/features/magic-context/dreamer/storage-dream-runs.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/task-executor.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/task-scheduler.d.ts +2 -0
- package/dist/features/magic-context/dreamer/task-scheduler.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/verify.d.ts +19 -0
- package/dist/features/magic-context/dreamer/verify.d.ts.map +1 -1
- package/dist/features/magic-context/fail-closed-block.d.ts +7 -0
- package/dist/features/magic-context/fail-closed-block.d.ts.map +1 -1
- package/dist/features/magic-context/index.d.ts +1 -0
- package/dist/features/magic-context/index.d.ts.map +1 -1
- package/dist/features/magic-context/install-instance-id.d.ts +33 -0
- package/dist/features/magic-context/install-instance-id.d.ts.map +1 -0
- package/dist/features/magic-context/memory/constants.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding-backfill.d.ts.map +1 -1
- package/dist/features/magic-context/memory/project-identity.d.ts +7 -0
- package/dist/features/magic-context/memory/project-identity.d.ts.map +1 -1
- package/dist/features/magic-context/memory/single-store-embedding-drain.d.ts +35 -0
- package/dist/features/magic-context/memory/single-store-embedding-drain.d.ts.map +1 -0
- package/dist/features/magic-context/memory/verification-paths.d.ts.map +1 -1
- package/dist/features/magic-context/message-index.d.ts +23 -0
- package/dist/features/magic-context/message-index.d.ts.map +1 -1
- package/dist/features/magic-context/migrations.d.ts +7 -0
- package/dist/features/magic-context/migrations.d.ts.map +1 -1
- package/dist/features/magic-context/mural/mural-font.generated.d.ts.map +1 -1
- package/dist/features/magic-context/overflow-detection.d.ts +31 -8
- package/dist/features/magic-context/overflow-detection.d.ts.map +1 -1
- package/dist/features/magic-context/project-embedding-registry.d.ts +40 -1
- package/dist/features/magic-context/project-embedding-registry.d.ts.map +1 -1
- package/dist/features/magic-context/search.d.ts.map +1 -1
- package/dist/features/magic-context/session-cache-ttl.d.ts +10 -0
- package/dist/features/magic-context/session-cache-ttl.d.ts.map +1 -0
- package/dist/features/magic-context/session-decision-calibration.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-meta-persisted.d.ts +20 -5
- package/dist/features/magic-context/storage-meta-persisted.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-notes.d.ts +1 -0
- package/dist/features/magic-context/storage-notes.d.ts.map +1 -1
- package/dist/features/magic-context/storage-primers.d.ts.map +1 -1
- package/dist/features/magic-context/storage-tags.d.ts.map +1 -1
- package/dist/features/magic-context/storage-unavailable-reason.d.ts +17 -0
- package/dist/features/magic-context/storage-unavailable-reason.d.ts.map +1 -0
- package/dist/features/magic-context/storage.d.ts +1 -1
- package/dist/features/magic-context/storage.d.ts.map +1 -1
- package/dist/features/magic-context/store-generation-rebase.d.ts +33 -1
- package/dist/features/magic-context/store-generation-rebase.d.ts.map +1 -1
- package/dist/features/magic-context/subagent-token-capture.d.ts.map +1 -1
- package/dist/features/magic-context/transform-decision-log.d.ts +1 -1
- package/dist/features/magic-context/transform-decision-log.d.ts.map +1 -1
- package/dist/features/magic-context/types.d.ts +8 -3
- package/dist/features/magic-context/types.d.ts.map +1 -1
- package/dist/features/magic-context/user-memory/storage-user-memory.d.ts.map +1 -1
- package/dist/hooks/magic-context/apply-operations.d.ts +105 -9
- package/dist/hooks/magic-context/apply-operations.d.ts.map +1 -1
- package/dist/hooks/magic-context/auto-search-runner.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-parser.d.ts +2 -0
- package/dist/hooks/magic-context/compartment-parser.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-historian.d.ts +1 -0
- package/dist/hooks/magic-context/compartment-runner-historian.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-partial-recomp.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-recomp.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-types.d.ts +2 -0
- package/dist/hooks/magic-context/compartment-runner-types.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-validation.d.ts.map +1 -1
- package/dist/hooks/magic-context/context-limit-resolution.d.ts +31 -0
- package/dist/hooks/magic-context/context-limit-resolution.d.ts.map +1 -0
- package/dist/hooks/magic-context/embed-history-runner.d.ts +0 -1
- package/dist/hooks/magic-context/embed-history-runner.d.ts.map +1 -1
- package/dist/hooks/magic-context/event-handler.d.ts.map +1 -1
- package/dist/hooks/magic-context/event-resolvers.d.ts.map +1 -1
- package/dist/hooks/magic-context/execute-status.d.ts.map +1 -1
- package/dist/hooks/magic-context/final-wire-token-estimate.d.ts.map +1 -1
- package/dist/hooks/magic-context/format-embed-status.d.ts.map +1 -1
- package/dist/hooks/magic-context/heuristic-cleanup.d.ts.map +1 -1
- package/dist/hooks/magic-context/historian-host-runner.d.ts +233 -0
- package/dist/hooks/magic-context/historian-host-runner.d.ts.map +1 -0
- package/dist/hooks/magic-context/hook.d.ts +1 -3
- package/dist/hooks/magic-context/hook.d.ts.map +1 -1
- package/dist/hooks/magic-context/image-token-estimate.d.ts +9 -0
- package/dist/hooks/magic-context/image-token-estimate.d.ts.map +1 -1
- package/dist/hooks/magic-context/inject-compartments.d.ts +60 -1
- package/dist/hooks/magic-context/inject-compartments.d.ts.map +1 -1
- package/dist/hooks/magic-context/lkg-slot.d.ts +6 -0
- package/dist/hooks/magic-context/lkg-slot.d.ts.map +1 -1
- package/dist/hooks/magic-context/module-client.d.ts +21 -0
- package/dist/hooks/magic-context/module-client.d.ts.map +1 -0
- package/dist/hooks/magic-context/module-state-sync.d.ts +6 -2
- package/dist/hooks/magic-context/module-state-sync.d.ts.map +1 -1
- package/dist/hooks/magic-context/module-tool-backends.d.ts +47 -0
- package/dist/hooks/magic-context/module-tool-backends.d.ts.map +1 -0
- package/dist/hooks/magic-context/module-transport.d.ts +1 -1
- package/dist/hooks/magic-context/module-transport.d.ts.map +1 -1
- package/dist/hooks/magic-context/opencode-v1-store-fixture.d.ts +12 -0
- package/dist/hooks/magic-context/opencode-v1-store-fixture.d.ts.map +1 -0
- package/dist/hooks/magic-context/persist-filtered-noise.d.ts.map +1 -1
- package/dist/hooks/magic-context/read-session-chunk.d.ts +28 -0
- package/dist/hooks/magic-context/read-session-chunk.d.ts.map +1 -1
- package/dist/hooks/magic-context/read-session-db.d.ts +5 -1
- package/dist/hooks/magic-context/read-session-db.d.ts.map +1 -1
- package/dist/hooks/magic-context/read-session-raw.d.ts +10 -0
- package/dist/hooks/magic-context/read-session-raw.d.ts.map +1 -1
- package/dist/hooks/magic-context/rust-mode-transform.d.ts +35 -0
- package/dist/hooks/magic-context/rust-mode-transform.d.ts.map +1 -1
- package/dist/hooks/magic-context/rust-refusal-recovery.d.ts +18 -0
- package/dist/hooks/magic-context/rust-refusal-recovery.d.ts.map +1 -1
- package/dist/hooks/magic-context/rust-served-m0.d.ts +20 -0
- package/dist/hooks/magic-context/rust-served-m0.d.ts.map +1 -0
- package/dist/hooks/magic-context/store-ahead-refusal.d.ts +40 -0
- package/dist/hooks/magic-context/store-ahead-refusal.d.ts.map +1 -0
- package/dist/hooks/magic-context/strip-content.d.ts +5 -5
- package/dist/hooks/magic-context/strip-content.d.ts.map +1 -1
- 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/tail-hygiene-walk.d.ts.map +1 -1
- package/dist/hooks/magic-context/tool-drop-target.d.ts +14 -0
- package/dist/hooks/magic-context/tool-drop-target.d.ts.map +1 -1
- package/dist/hooks/magic-context/tool-input-size.d.ts +21 -0
- package/dist/hooks/magic-context/tool-input-size.d.ts.map +1 -0
- package/dist/hooks/magic-context/tool-sweep-policy.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts +124 -11
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform.d.ts +14 -0
- package/dist/hooks/magic-context/transform.d.ts.map +1 -1
- package/dist/{index-pa67brzn.js → index-0rp6pj54.js} +3 -3
- package/dist/{index-4b30nf6z.js → index-32b096cc.js} +1 -1
- package/dist/{index-wgzyeyf5.js → index-3bygzk2d.js} +23 -7
- package/dist/{index-jgnag7sa.js → index-a9vbtdzv.js} +4 -4
- package/dist/{index-bmzt6xgy.js → index-cz88kw0n.js} +13 -3
- package/dist/{index-6j8th2hd.js → index-d107az47.js} +2 -2
- package/dist/{index-g6hpfkqa.js → index-jtdrvmcn.js} +3290 -286
- package/dist/{index-9r1cbh9e.js → index-kr5qehbd.js} +1 -1
- package/dist/{index-febg06dy.js → index-kwe03yde.js} +1 -1
- package/dist/{index-tdrv6nd0.js → index-s6b7h12g.js} +352 -71
- package/dist/{index-6z9g64js.js → index-s70wtd8k.js} +4 -1
- package/dist/{index-0ccmyzbj.js → index-stb5fg12.js} +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5230 -5663
- package/dist/{message-time-backfill-0ccvyk9n.js → message-time-backfill-q374fxc5.js} +4 -4
- package/dist/plugin/dream-timer.d.ts +2 -0
- package/dist/plugin/dream-timer.d.ts.map +1 -1
- package/dist/plugin/hooks/create-session-hooks.d.ts.map +1 -1
- package/dist/plugin/messages-transform.d.ts.map +1 -1
- package/dist/plugin/native-compaction-guard.d.ts +22 -0
- package/dist/plugin/native-compaction-guard.d.ts.map +1 -0
- package/dist/plugin/rpc-handlers.d.ts +11 -0
- package/dist/plugin/rpc-handlers.d.ts.map +1 -1
- package/dist/{read-session-chunk-53a7qbrh.js → read-session-chunk-fkdv2g5b.js} +8 -4
- package/dist/{recomp-orchestrator-adsgqgse.js → recomp-orchestrator-k4h5n0p3.js} +9 -9
- package/dist/{safe-notification-target-vrkjrbgb.js → safe-notification-target-50gm9c58.js} +3 -3
- package/dist/{send-session-notification-e28r4xx2.js → send-session-notification-g2k03zyn.js} +5 -5
- package/dist/shared/cache-ttl-display.d.ts +3 -1
- package/dist/shared/cache-ttl-display.d.ts.map +1 -1
- package/dist/shared/harness.d.ts +11 -0
- package/dist/shared/harness.d.ts.map +1 -1
- package/dist/shared/index.d.ts +1 -0
- package/dist/shared/index.d.ts.map +1 -1
- package/dist/shared/logger.d.ts.map +1 -1
- package/dist/shared/model-cache-ttl.d.ts +9 -0
- package/dist/shared/model-cache-ttl.d.ts.map +1 -0
- package/dist/shared/model-suggestion-retry.d.ts +13 -1
- package/dist/shared/model-suggestion-retry.d.ts.map +1 -1
- package/dist/shared/prompt-async-transport.d.ts +25 -0
- package/dist/shared/prompt-async-transport.d.ts.map +1 -0
- package/dist/shared/rpc-server.d.ts +1 -0
- package/dist/shared/rpc-server.d.ts.map +1 -1
- package/dist/shared/rpc-types.d.ts +17 -1
- package/dist/shared/rpc-types.d.ts.map +1 -1
- package/dist/shared/rpc-utils.d.ts +3 -0
- package/dist/shared/rpc-utils.d.ts.map +1 -1
- package/dist/shared/sqlite-write-locker-test-support.d.ts +7 -0
- package/dist/shared/sqlite-write-locker-test-support.d.ts.map +1 -0
- package/dist/shared/status-summary.d.ts +9 -1
- package/dist/shared/status-summary.d.ts.map +1 -1
- package/dist/shared/status-view.d.ts +1 -1
- package/dist/shared/status-view.d.ts.map +1 -1
- package/dist/shared/tag-transcript.d.ts.map +1 -1
- package/dist/shared/user-facing-codes.d.ts +10 -5
- package/dist/shared/user-facing-codes.d.ts.map +1 -1
- package/dist/shared/window-geometry.d.ts +6 -3
- package/dist/shared/window-geometry.d.ts.map +1 -1
- package/dist/tools/ctx-expand/render.d.ts.map +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/tools/ctx-reduce/tools.d.ts.map +1 -1
- package/dist/tools/ctx-search/tools.d.ts.map +1 -1
- package/dist/v2/fold/boundary.d.ts +61 -0
- package/dist/v2/fold/boundary.d.ts.map +1 -0
- package/dist/v2/fold/restore.d.ts.map +1 -1
- package/dist/v2/hidden-completion.d.ts +16 -3
- package/dist/v2/hidden-completion.d.ts.map +1 -1
- package/dist/v2/hooks/context.d.ts +45 -14
- package/dist/v2/hooks/context.d.ts.map +1 -1
- package/dist/v2/hooks/hidden-child.d.ts +6 -0
- package/dist/v2/hooks/hidden-child.d.ts.map +1 -1
- package/dist/v2/hooks/payload.d.ts.map +1 -1
- package/dist/v2/hooks/rpc-live-state.d.ts +1 -1
- package/dist/v2/hooks/rpc-live-state.d.ts.map +1 -1
- package/dist/v2/hooks/rust-mode.d.ts +47 -0
- package/dist/v2/hooks/rust-mode.d.ts.map +1 -0
- package/dist/v2/hooks/session-project-backfill.d.ts +15 -0
- package/dist/v2/hooks/session-project-backfill.d.ts.map +1 -0
- package/dist/v2/hooks/storage-gate.d.ts +42 -0
- package/dist/v2/hooks/storage-gate.d.ts.map +1 -0
- package/dist/v2/hooks/storage-notice.d.ts +29 -0
- package/dist/v2/hooks/storage-notice.d.ts.map +1 -0
- package/dist/v2/hooks/store.d.ts +16 -0
- package/dist/v2/hooks/store.d.ts.map +1 -1
- package/dist/v2/hooks/tools.d.ts +11 -2
- package/dist/v2/hooks/tools.d.ts.map +1 -1
- package/dist/v2/hooks/types.d.ts +4 -0
- package/dist/v2/hooks/types.d.ts.map +1 -1
- package/dist/v2/hooks/usage-persist.d.ts +31 -0
- package/dist/v2/hooks/usage-persist.d.ts.map +1 -0
- package/dist/v2/server.js +27201 -22695
- package/dist/v2/store-reader.d.ts +9 -0
- package/dist/v2/store-reader.d.ts.map +1 -1
- package/dist/wrapup-orchestrator-35y56636.js +18 -0
- package/package.json +1 -1
- package/src/agents/magic-context-prompt.test.ts +125 -0
- package/src/agents/magic-context-prompt.ts +15 -10
- package/src/config/index.ts +40 -0
- package/src/config/live-child-output-cap.test.ts +75 -0
- package/src/config/live-child-output-cap.ts +70 -0
- package/src/config/live-run-config.test.ts +24 -11
- package/src/config/misplaced-agent-model.test.ts +61 -0
- package/src/config/project-security.test.ts +17 -0
- package/src/config/project-security.ts +28 -4
- package/src/config/schema/magic-context.test.ts +16 -1
- package/src/config/schema/magic-context.ts +35 -6
- package/src/shared/cache-ttl-display.ts +14 -20
- package/src/shared/harness.ts +14 -0
- package/src/shared/index.ts +1 -0
- package/src/shared/logger.test.ts +63 -2
- package/src/shared/logger.ts +23 -5
- package/src/shared/model-cache-ttl.test.ts +40 -0
- package/src/shared/model-cache-ttl.ts +58 -0
- package/src/shared/model-suggestion-retry.test.ts +115 -4
- package/src/shared/model-suggestion-retry.ts +57 -12
- package/src/shared/prompt-async-transport.test.ts +217 -0
- package/src/shared/prompt-async-transport.ts +242 -0
- package/src/shared/prompt-surface-a1-golden.md +17 -17
- package/src/shared/rpc-server.ts +13 -1
- package/src/shared/rpc-types.ts +18 -1
- package/src/shared/rpc-utils.ts +28 -0
- package/src/shared/sqlite-transaction-mode-guard.test.ts +198 -0
- package/src/shared/sqlite-write-locker-test-support.ts +62 -0
- package/src/shared/status-detail-text.test.ts +23 -0
- package/src/shared/status-summary.ts +25 -1
- package/src/shared/status-view.ts +1 -1
- package/src/shared/tag-transcript.ts +82 -19
- package/src/shared/user-facing-codes.ts +12 -5
- package/src/shared/window-geometry.ts +6 -3
- package/dist/v2/hooks/provider-admission.d.ts +0 -22
- package/dist/v2/hooks/provider-admission.d.ts.map +0 -1
- package/dist/wrapup-orchestrator-8xzbpvm8.js +0 -18
|
@@ -12,6 +12,7 @@ import { type TrailingBlankDecision, type TrailingBlankSourceDecisions } from ".
|
|
|
12
12
|
import { type MessageLike, type TagTarget } from "./transform-operations";
|
|
13
13
|
export declare function resetDegradedCacheCount(sessionId: string): void;
|
|
14
14
|
export type DeferredCompactionMarkerClearOutcome = "cleared" | "cas-lost-newer-pending" | "cas-lost-already-cleared";
|
|
15
|
+
export declare function isSyntheticHeadMessage(message: MessageLike): boolean;
|
|
15
16
|
/**
|
|
16
17
|
* Apply the synthetic todowrite pair with cache-safe live permission checks.
|
|
17
18
|
* Permission is refreshed only on a cache-busting pass; defer passes replay
|
|
@@ -30,6 +31,70 @@ export declare function applyTodoSynthesis(args: {
|
|
|
30
31
|
activeAgent?: string;
|
|
31
32
|
replaySnapshot?: Pick<PostprocessReplaySnapshot, "todoPermissionDenied" | "todoSyntheticAnchor">;
|
|
32
33
|
}): Promise<number>;
|
|
34
|
+
/** An armed binding-recovery flag consumed by one live pass. */
|
|
35
|
+
export interface ThinkingBindingRecoveryApplication {
|
|
36
|
+
/** The flag value read, so the caller clears only that value. */
|
|
37
|
+
flagTarget: string;
|
|
38
|
+
/** Every assistant whose reasoning this pass sends as an empty sentinel. */
|
|
39
|
+
messageIds: string[];
|
|
40
|
+
}
|
|
41
|
+
/** Thinking a busting pass removed on a prefix-bound model (Fable 5.1, Opus 5.5). */
|
|
42
|
+
export interface ProactiveThinkingStrip {
|
|
43
|
+
/** Assistants whose reasoning this pass froze into the binding-mismatch strip set. */
|
|
44
|
+
messageIds: string[];
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Freeze the reasoning of every assistant still sending it, on a busting pass
|
|
48
|
+
* of a prefix-bound model (Fable 5.1, Opus 5.5).
|
|
49
|
+
*
|
|
50
|
+
* On those models a signed thinking block is valid only while every byte
|
|
51
|
+
* before it is unchanged, and a busting pass is the pass that changes those
|
|
52
|
+
* bytes: older accounts then drop the blocks silently, `drop_block` drops
|
|
53
|
+
* them, and newer accounts reject the request with a 400. The pass therefore
|
|
54
|
+
* removes all of them itself. The newest assistant of an open tool round is
|
|
55
|
+
* included, and its tool call stays: a live probe on Fable 5.1 and Opus 5.5
|
|
56
|
+
* accepted that turn with its thinking removed
|
|
57
|
+
* (docs/reports/anthropic-open-tool-round-thinking.md).
|
|
58
|
+
*
|
|
59
|
+
* The ids are persisted into the binding-mismatch set before the pass serves
|
|
60
|
+
* any stripped byte, the same contract as the reactive recovery, so every
|
|
61
|
+
* later pass (defer passes and last-known-good replays included) removes the
|
|
62
|
+
* same blocks and a removed block never comes back. When the write fails,
|
|
63
|
+
* nothing is stripped on this pass and nothing is remembered; the reactive
|
|
64
|
+
* recovery remains the fallback. Reasoning produced after this pass is kept
|
|
65
|
+
* until the next busting pass.
|
|
66
|
+
*
|
|
67
|
+
* Callers must invoke this only on a pass that already busts the cache: it
|
|
68
|
+
* never originates a byte change on a defer pass.
|
|
69
|
+
*/
|
|
70
|
+
export declare function freezeReasoningOnBustingPass(args: {
|
|
71
|
+
db: ContextDatabase;
|
|
72
|
+
sessionId: string;
|
|
73
|
+
messages: MessageLike[];
|
|
74
|
+
alreadyFrozen: ReadonlySet<string>;
|
|
75
|
+
}): {
|
|
76
|
+
strip: ProactiveThinkingStrip | null;
|
|
77
|
+
persistenceFailed: boolean;
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* What a frozen-replay release knows about the array the session last served:
|
|
81
|
+
* the last-known-good snapshot's array (null when there is none), and whether
|
|
82
|
+
* the previous pass captured exactly the array it served into that snapshot.
|
|
83
|
+
*/
|
|
84
|
+
export interface FrozenReleaseLastServed {
|
|
85
|
+
messages: readonly unknown[] | null;
|
|
86
|
+
proven: boolean;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Index of the first message whose provider-visible fields differ from the
|
|
90
|
+
* array the session last served, or null when every message both arrays hold is
|
|
91
|
+
* equal. Messages past the end of the served array are not compared; the caller
|
|
92
|
+
* decides what they mean. `providerID` selects the parts that never reach the
|
|
93
|
+
* wire.
|
|
94
|
+
*/
|
|
95
|
+
export declare function firstServedDivergenceIndex(messages: readonly unknown[], lastServed: readonly unknown[], options?: {
|
|
96
|
+
providerID?: string;
|
|
97
|
+
}): number | null;
|
|
33
98
|
/** Reapply durable binding-mismatch strips when a Rust LKG snapshot is replayed. */
|
|
34
99
|
export declare function replayRustModeBindingMismatchStrips(args: {
|
|
35
100
|
db: ContextDatabase;
|
|
@@ -50,6 +115,8 @@ export interface RustMaterializedCompactionBoundary {
|
|
|
50
115
|
/** OpenCode message id owning the last covered flat block. */
|
|
51
116
|
endMessageId: string;
|
|
52
117
|
}
|
|
118
|
+
/** Logged when another process holds the write lock past busy_timeout. */
|
|
119
|
+
export declare const RUST_MARKER_LOCK_SKIP_LOG = "rust compaction-marker: pending target write skipped on lock contention; next pass retries";
|
|
53
120
|
/**
|
|
54
121
|
* Use the boundary carried in the module response as OpenCode's compaction target;
|
|
55
122
|
* do not replace it with a target read later from status. Store that target in the
|
|
@@ -61,7 +128,31 @@ export declare function applyRustModeDeferredCompactionMarker(args: {
|
|
|
61
128
|
sessionId: string;
|
|
62
129
|
boundary?: RustMaterializedCompactionBoundary;
|
|
63
130
|
sessionDirectory?: string;
|
|
131
|
+
/**
|
|
132
|
+
* How this host applies the boundary. The default writes a compaction row into
|
|
133
|
+
* OpenCode 1's own store; a host with no such row supplies a function that records
|
|
134
|
+
* the boundary instead.
|
|
135
|
+
*/
|
|
136
|
+
applyDeferred?: CompactionMarkerStrategy["applyDeferred"];
|
|
64
137
|
}): void;
|
|
138
|
+
/**
|
|
139
|
+
* Forget a recorded module boundary whose coordinates no longer describe the host.
|
|
140
|
+
*
|
|
141
|
+
* A host that renumbers the conversation invalidates the boundary's ordinal along
|
|
142
|
+
* with every other saved position, and the module is about to be deleted and
|
|
143
|
+
* re-seeded, so the record has nothing left to point at. Clearing it lets the
|
|
144
|
+
* next serve send the full history and accept whatever boundary the re-seeded
|
|
145
|
+
* module publishes.
|
|
146
|
+
*
|
|
147
|
+
* Only a recorded boundary is cleared. A boundary backed by a real OpenCode 1
|
|
148
|
+
* compaction row is left alone: that row still exists in the host's own store,
|
|
149
|
+
* and dropping the local state would orphan it. Recorded boundaries are
|
|
150
|
+
* recognisable by their empty summary message id, which is what a host that
|
|
151
|
+
* writes no marker rows stores.
|
|
152
|
+
*
|
|
153
|
+
* Returns true when a record was cleared.
|
|
154
|
+
*/
|
|
155
|
+
export declare function clearRustModeBoundaryRecord(db: ContextDatabase, sessionId: string): boolean;
|
|
65
156
|
export declare function runRustModePostprocess(args: {
|
|
66
157
|
db: ContextDatabase;
|
|
67
158
|
sessionId: string;
|
|
@@ -69,19 +160,36 @@ export declare function runRustModePostprocess(args: {
|
|
|
69
160
|
projectPath?: string;
|
|
70
161
|
sessionDirectory?: string;
|
|
71
162
|
materializedBoundary?: RustMaterializedCompactionBoundary;
|
|
163
|
+
compactionMarkerStrategy?: CompactionMarkerStrategy;
|
|
72
164
|
fullFeatureMode: boolean;
|
|
73
165
|
compactionOff?: boolean;
|
|
74
166
|
resolvedProviderID?: string;
|
|
75
167
|
thinkingBindingRecoveryEnabledForModel?: boolean;
|
|
168
|
+
/**
|
|
169
|
+
* The module's decision busts the cache on this pass (HARD, MIGRATE_HARD,
|
|
170
|
+
* EXECUTE, or SOFT). Such a pass rewrites the prompt from its start, so it
|
|
171
|
+
* may freeze every thinking block its own edit invalidated.
|
|
172
|
+
*/
|
|
173
|
+
cacheBustingPass?: boolean;
|
|
174
|
+
/**
|
|
175
|
+
* Set when the module deferred but this pass stops serving a frozen
|
|
176
|
+
* last-known-good replay. The frozen replay served the messages that arrived
|
|
177
|
+
* during the freeze as raw input, so the module's output changes bytes only
|
|
178
|
+
* from the first of those messages onward, not from the start. Only thinking
|
|
179
|
+
* at or after the first message that differs from the last-served array may
|
|
180
|
+
* be frozen: a block before that point sits behind unchanged bytes, so it
|
|
181
|
+
* stays valid and stripping it would rewrite cached content no other change
|
|
182
|
+
* touched. See `proactiveStripStartIndex` for a snapshot that is not provably
|
|
183
|
+
* the last-served array.
|
|
184
|
+
*/
|
|
185
|
+
frozenReleaseLastServed?: FrozenReleaseLastServed;
|
|
76
186
|
trailingBlankSourceDecisions?: TrailingBlankSourceDecisions;
|
|
77
187
|
trailingBlankNewestAssistantId?: string;
|
|
78
188
|
tagger: Tagger;
|
|
79
189
|
ctxReduceAvailability: CtxReduceAvailabilityVerdict;
|
|
80
190
|
}): {
|
|
81
|
-
thinkingBindingRecovery:
|
|
82
|
-
|
|
83
|
-
messageId: string;
|
|
84
|
-
} | null;
|
|
191
|
+
thinkingBindingRecovery: ThinkingBindingRecoveryApplication | null;
|
|
192
|
+
proactiveThinkingStrip: ProactiveThinkingStrip | null;
|
|
85
193
|
markerAt: string | null;
|
|
86
194
|
};
|
|
87
195
|
/**
|
|
@@ -245,7 +353,12 @@ interface RunPostTransformPhaseArgs {
|
|
|
245
353
|
* cannot diverge from the main transform on cold DB-recovered passes.
|
|
246
354
|
*/
|
|
247
355
|
resolvedProviderID?: string;
|
|
248
|
-
/**
|
|
356
|
+
/**
|
|
357
|
+
* True only when the live request uses a model whose signed thinking is
|
|
358
|
+
* bound to its prefix (isPrefixBoundThinkingModel: Anthropic Fable 5.1 or
|
|
359
|
+
* Opus 5.5). Gates both the reactive binding recovery and the proactive
|
|
360
|
+
* strip of thinking that a busting pass invalidates.
|
|
361
|
+
*/
|
|
249
362
|
thinkingBindingRecoveryEnabledForModel?: boolean;
|
|
250
363
|
/** Raw harness observations captured before any Magic Context insertion or sentinelization. */
|
|
251
364
|
trailingBlankSourceDecisions?: TrailingBlankSourceDecisions;
|
|
@@ -286,10 +399,9 @@ export interface PostTransformPhaseResult {
|
|
|
286
399
|
emergency: boolean;
|
|
287
400
|
bustedThisPass: boolean;
|
|
288
401
|
/** Pending flag applied to the live output; the caller clears it only after the live lane succeeds. */
|
|
289
|
-
thinkingBindingRecovery:
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
} | null;
|
|
402
|
+
thinkingBindingRecovery: ThinkingBindingRecoveryApplication | null;
|
|
403
|
+
/** Thinking this busting pass removed because its own edit invalidated it. */
|
|
404
|
+
proactiveThinkingStrip: ProactiveThinkingStrip | null;
|
|
293
405
|
}
|
|
294
406
|
export interface ConfirmedAbortClient {
|
|
295
407
|
session?: {
|
|
@@ -326,7 +438,7 @@ export declare function evaluateEmergencyFailClosed(input: {
|
|
|
326
438
|
/** A current-model limit parsed from a provider overflow response, never a catalog fallback. */
|
|
327
439
|
providerProvenLimitTokens?: number;
|
|
328
440
|
}): EmergencyFailClosedDecision;
|
|
329
|
-
export
|
|
441
|
+
export interface FinalizeMessageRepresentationOptions {
|
|
330
442
|
prependedMessageCount?: number;
|
|
331
443
|
reasoningMutatedMessages?: Iterable<MessageLike>;
|
|
332
444
|
reasoningMutationExemptMessage?: MessageLike;
|
|
@@ -335,7 +447,8 @@ export declare function finalizeMessageRepresentation(messages: MessageLike[], r
|
|
|
335
447
|
trailingBlankDecisions?: ReadonlyMap<string, TrailingBlankDecision>;
|
|
336
448
|
skipMergedReasoningStrip?: boolean;
|
|
337
449
|
skipTrailingWhitespaceStrip?: boolean;
|
|
338
|
-
}
|
|
450
|
+
}
|
|
451
|
+
export declare function finalizeMessageRepresentation(messages: MessageLike[], resolvedProviderID?: string, options?: FinalizeMessageRepresentationOptions): {
|
|
339
452
|
clearedParts: number;
|
|
340
453
|
mergedReasoningParts: number;
|
|
341
454
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transform-postprocess-phase.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/transform-postprocess-phase.ts"],"names":[],"mappings":"AAOA,OAAO,EAIH,KAAK,eAAe,EAepB,KAAK,uBAAuB,EAQ/B,MAAM,sCAAsC,CAAC;AAC9C,OAAO,
|
|
1
|
+
{"version":3,"file":"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,MAAM,EAC3B,OAAO,CAAC,EAAE,oCAAoC,GAC/C;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,oBAAoB,EAAE,MAAM,CAAA;CAAE,CAwCxD;AAED,wBAAsB,qBAAqB,CACvC,IAAI,EAAE,yBAAyB,GAChC,OAAO,CAAC,wBAAwB,CAAC,CA83DnC;AAED,wBAAgB,6BAA6B,CAAC,IAAI,EAAE;IAChD,EAAE,EAAE,eAAe,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,qBAAqB,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,8BAA8B,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC5C,sBAAsB,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CACxC,GAAG,OAAO,CAaV"}
|
|
@@ -62,6 +62,7 @@ export declare const EMERGENCY_REFUSAL_NOTICE = "Context full \u2014 /ctx-flush
|
|
|
62
62
|
export type HostRefusalNotice = (client: PluginContext["client"] | undefined, sessionId: string, message: string, notificationParams: import("./send-session-notification").NotificationParams) => Promise<void>;
|
|
63
63
|
export declare function sendEmergencyRefusalNotice(client: PluginContext["client"] | undefined, sessionId: string, message: string, notificationParams: import("./send-session-notification").NotificationParams): Promise<void>;
|
|
64
64
|
export interface TransformDeps {
|
|
65
|
+
cacheTtlConfig?: import("../../shared/model-cache-ttl").CacheTtlConfig;
|
|
65
66
|
hiddenCompletionExecutor?: import("./compartment-runner-types").HiddenCompletionExecutor;
|
|
66
67
|
/** Host marker lifecycle; omission preserves OpenCode 1 marker writes and replay. */
|
|
67
68
|
compactionMarkerStrategy?: CompactionMarkerStrategy & {
|
|
@@ -186,6 +187,19 @@ export interface TransformDeps {
|
|
|
186
187
|
};
|
|
187
188
|
/** False when historian.disable=true, blocking historian-backed child agents. */
|
|
188
189
|
historianRunnable?: boolean;
|
|
190
|
+
/**
|
|
191
|
+
* Which side runs the historian completion in Rust transform mode
|
|
192
|
+
* (`historian.runner`). Absent means the harness default, which for OpenCode 1
|
|
193
|
+
* and OpenCode 2 is the host: the module queues the completion and this
|
|
194
|
+
* process's pull loop runs it. Only "broca" leaves the pull loop unbuilt.
|
|
195
|
+
*/
|
|
196
|
+
historianRunner?: "broca" | "host";
|
|
197
|
+
/**
|
|
198
|
+
* Operator kill switch for this process's historian pull loop
|
|
199
|
+
* (`historian.host_runner.enabled`). Absent means enabled; it only matters
|
|
200
|
+
* when `historianRunner` is not "broca".
|
|
201
|
+
*/
|
|
202
|
+
historianHostRunnerEnabled?: boolean;
|
|
189
203
|
/**
|
|
190
204
|
* Compaction-off mode (issue #266), boot-resolved and process-stable.
|
|
191
205
|
* When true the transform runs additive-only: m[0]/m[1] memory/docs
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transform.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/transform.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,+BAA+B,CAAC;AAgBlF,OAAO,EACH,KAAK,2BAA2B,EAEnC,MAAM,kDAAkD,CAAC;AAG1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wCAAwC,CAAC;
|
|
1
|
+
{"version":3,"file":"transform.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/transform.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,+BAA+B,CAAC;AAgBlF,OAAO,EACH,KAAK,2BAA2B,EAEnC,MAAM,kDAAkD,CAAC;AAG1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wCAAwC,CAAC;AAKxE,OAAO,EACH,KAAK,eAAe,EAQvB,MAAM,sCAAsC,CAAC;AAsB9C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sDAAsD,CAAC;AAKjG,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAMlE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AACvE,OAA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E,MAAM,GAAG,SAAS,EAC3C,YAAY,EAAE,YAAY,EAC1B,0BAA0B,EACpB,MAAM,GACN;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,GAC/C,SAAS,EACf,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,sBAAsB,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;CAAE,EACrF,oBAAoB,CAAC,EAAE,MAAM,GAC9B,MAAM,GAAG,SAAS,CAqCpB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
sessionLog
|
|
3
|
-
} from "./index-
|
|
3
|
+
} from "./index-3bygzk2d.js";
|
|
4
4
|
import {
|
|
5
5
|
COMPARTMENT_LEASE_RENEWAL_MS,
|
|
6
6
|
acquireCompartmentLease,
|
|
@@ -23,13 +23,13 @@ import {
|
|
|
23
23
|
registerActiveCompartmentRun,
|
|
24
24
|
setRecompStarting2,
|
|
25
25
|
setRecompTerminal2
|
|
26
|
-
} from "./index-
|
|
26
|
+
} from "./index-jtdrvmcn.js";
|
|
27
27
|
import {
|
|
28
28
|
pushNotification2
|
|
29
29
|
} from "./index-jdxxq8cz.js";
|
|
30
30
|
import {
|
|
31
31
|
sendStatusNotification2
|
|
32
|
-
} from "./index-
|
|
32
|
+
} from "./index-a9vbtdzv.js";
|
|
33
33
|
|
|
34
34
|
// src/hooks/magic-context/wrapup-orchestrator.ts
|
|
35
35
|
import * as crypto from "node:crypto";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getMagicContextLogPath
|
|
3
|
-
} from "./index-
|
|
3
|
+
} from "./index-s70wtd8k.js";
|
|
4
4
|
|
|
5
5
|
// src/shared/logger.ts
|
|
6
6
|
import * as fs from "node:fs";
|
|
@@ -213,6 +213,15 @@ var buffer = [];
|
|
|
213
213
|
var flushTimer = null;
|
|
214
214
|
var FLUSH_INTERVAL_MS = 500;
|
|
215
215
|
var BUFFER_SIZE_LIMIT = 50;
|
|
216
|
+
var MAX_BUFFERED_BYTES = 1024 * 1024;
|
|
217
|
+
var bufferedBytes = 0;
|
|
218
|
+
var droppedLines = 0;
|
|
219
|
+
function boundBuffer() {
|
|
220
|
+
while (bufferedBytes > MAX_BUFFERED_BYTES && buffer.length > 0) {
|
|
221
|
+
bufferedBytes -= Buffer.byteLength(buffer.shift() ?? "");
|
|
222
|
+
droppedLines++;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
216
225
|
var MAX_LOG_FILE_BYTES = 32 * 1024 * 1024;
|
|
217
226
|
var SIZE_CHECK_INTERVAL_FLUSHES = 64;
|
|
218
227
|
var activeLogFile = null;
|
|
@@ -303,12 +312,12 @@ function flush() {
|
|
|
303
312
|
clearTimeout(flushTimer);
|
|
304
313
|
flushTimer = null;
|
|
305
314
|
}
|
|
306
|
-
if (buffer.length === 0)
|
|
315
|
+
if (buffer.length === 0 && droppedLines === 0)
|
|
307
316
|
return;
|
|
308
|
-
const
|
|
309
|
-
|
|
317
|
+
const notice = droppedLines ? `[${new Date().toISOString()}] [magic-context][global] logger dropped ${droppedLines} ${droppedLines === 1 ? "line" : "lines"}: buffer exceeded ${MAX_BUFFERED_BYTES} bytes while writes were pending
|
|
318
|
+
` : "";
|
|
310
319
|
try {
|
|
311
|
-
const data = capLogData(
|
|
320
|
+
const data = capLogData(notice + buffer.join(""));
|
|
312
321
|
const logFile = getMagicContextLogPath();
|
|
313
322
|
ensureDir(logFile);
|
|
314
323
|
let currentSize = getCurrentLogSize(logFile);
|
|
@@ -318,6 +327,9 @@ function flush() {
|
|
|
318
327
|
currentSize = 0;
|
|
319
328
|
}
|
|
320
329
|
fs.appendFileSync(logFile, data, { encoding: "utf8", mode: 384 });
|
|
330
|
+
buffer = [];
|
|
331
|
+
bufferedBytes = 0;
|
|
332
|
+
droppedLines = 0;
|
|
321
333
|
activeLogFile = logFile;
|
|
322
334
|
activeLogSize = currentSize + dataSize;
|
|
323
335
|
flushesSinceSizeCheck++;
|
|
@@ -326,6 +338,7 @@ function flush() {
|
|
|
326
338
|
activeLogSize = null;
|
|
327
339
|
flushesSinceSizeCheck = 0;
|
|
328
340
|
recordSwallowedWrite(error);
|
|
341
|
+
boundBuffer();
|
|
329
342
|
}
|
|
330
343
|
}
|
|
331
344
|
function scheduleFlush() {
|
|
@@ -343,8 +356,11 @@ function log(message, data) {
|
|
|
343
356
|
const timestamp = new Date().toISOString();
|
|
344
357
|
const serialized = data === undefined ? "" : data instanceof Error ? ` ${sanitizeDiagnosticText(`${data.message}${data.stack ? `
|
|
345
358
|
${data.stack}` : ""}`)}` : ` ${JSON.stringify(sanitizeConfigValue(data))}`;
|
|
346
|
-
|
|
347
|
-
|
|
359
|
+
const line = `[${timestamp}] ${sanitizeDiagnosticText(message)}${serialized}
|
|
360
|
+
`;
|
|
361
|
+
buffer.push(line);
|
|
362
|
+
bufferedBytes += Buffer.byteLength(line);
|
|
363
|
+
boundBuffer();
|
|
348
364
|
if (buffer.length >= BUFFER_SIZE_LIMIT) {
|
|
349
365
|
flush();
|
|
350
366
|
} else {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
sessionLog
|
|
3
|
-
} from "./index-
|
|
3
|
+
} from "./index-3bygzk2d.js";
|
|
4
4
|
import {
|
|
5
5
|
isDefaultSessionTitle2
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-kwe03yde.js";
|
|
7
7
|
import {
|
|
8
8
|
shouldHoldIgnoredNotification
|
|
9
|
-
} from "./index-
|
|
9
|
+
} from "./index-cz88kw0n.js";
|
|
10
10
|
|
|
11
11
|
// src/shared/error-message.ts
|
|
12
12
|
function getErrorMessage(error) {
|
|
@@ -186,7 +186,7 @@ async function sendIgnoredMessageNow(client, sessionId, text, params, forcePersi
|
|
|
186
186
|
holdIgnoredNotification({ client, sessionId, text, params, forcePersist }, "during target checks");
|
|
187
187
|
return "queued";
|
|
188
188
|
}
|
|
189
|
-
const { waitForSafeNotificationTarget } = await import("./safe-notification-target-
|
|
189
|
+
const { waitForSafeNotificationTarget } = await import("./safe-notification-target-50gm9c58.js");
|
|
190
190
|
if (await waitForSafeNotificationTarget(client, sessionId) === "skip") {
|
|
191
191
|
sessionLog(sessionId, "notification skipped (session not titled yet)");
|
|
192
192
|
return "skipped";
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import {
|
|
2
|
+
harnessOwnsOpenCodeStore
|
|
3
|
+
} from "./index-s70wtd8k.js";
|
|
1
4
|
import {
|
|
2
5
|
log
|
|
3
|
-
} from "./index-
|
|
6
|
+
} from "./index-3bygzk2d.js";
|
|
4
7
|
|
|
5
8
|
// src/shared/opencode-db-path.ts
|
|
6
9
|
import { existsSync, readdirSync, statSync } from "node:fs";
|
|
@@ -483,7 +486,7 @@ function withPrivilegedWriter(db, operation) {
|
|
|
483
486
|
|
|
484
487
|
// src/hooks/magic-context/read-session-db.ts
|
|
485
488
|
function openCodeDbExists() {
|
|
486
|
-
return openCodeDbPathExists(resolveOpenCodeDbPath());
|
|
489
|
+
return harnessOwnsOpenCodeStore() && openCodeDbPathExists(resolveOpenCodeDbPath());
|
|
487
490
|
}
|
|
488
491
|
var cachedReadOnlyDb = null;
|
|
489
492
|
function closeCachedReadOnlyDb() {
|
|
@@ -499,6 +502,9 @@ function closeCachedReadOnlyDb() {
|
|
|
499
502
|
}
|
|
500
503
|
}
|
|
501
504
|
function getReadOnlySessionDb() {
|
|
505
|
+
if (!harnessOwnsOpenCodeStore()) {
|
|
506
|
+
throw new Error("OpenCode session database is not readable from a Pi-compatible process; its history lives in Pi sessions");
|
|
507
|
+
}
|
|
502
508
|
const resolution = resolveOpenCodeDbPath();
|
|
503
509
|
const dbPath = resolution.path;
|
|
504
510
|
if (!openCodeDbPathExists(resolution)) {
|
|
@@ -684,6 +690,8 @@ function logProbeFailureOnce(resolution, error) {
|
|
|
684
690
|
}
|
|
685
691
|
function resolvedDbIsAvailable() {
|
|
686
692
|
const resolution = resolveOpenCodeDbPath();
|
|
693
|
+
if (!harnessOwnsOpenCodeStore())
|
|
694
|
+
return { resolution, available: false };
|
|
687
695
|
const available = openCodeDbPathExists(resolution);
|
|
688
696
|
if (available)
|
|
689
697
|
clearOpenCodeDbReadFailure(resolution.path);
|
|
@@ -825,7 +833,7 @@ function hasUnansweredRealUser(db, sessionId) {
|
|
|
825
833
|
}
|
|
826
834
|
function getMessageTimesFromOpenCodeDb(sessionId, messageIds) {
|
|
827
835
|
const result = new Map;
|
|
828
|
-
if (messageIds.length === 0)
|
|
836
|
+
if (messageIds.length === 0 || !harnessOwnsOpenCodeStore())
|
|
829
837
|
return result;
|
|
830
838
|
try {
|
|
831
839
|
withReadOnlySessionDb((db) => {
|
|
@@ -843,6 +851,8 @@ function getMessageTimesFromOpenCodeDb(sessionId, messageIds) {
|
|
|
843
851
|
return result;
|
|
844
852
|
}
|
|
845
853
|
function findLastAssistantModelFromOpenCodeDb(sessionId) {
|
|
854
|
+
if (!harnessOwnsOpenCodeStore())
|
|
855
|
+
return null;
|
|
846
856
|
const resolution = resolveOpenCodeDbPath();
|
|
847
857
|
try {
|
|
848
858
|
if (!openCodeDbPathExists(resolution)) {
|