@cortexkit/opencode-magic-context 0.24.1 → 0.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -2
- package/dist/agents/magic-context-prompt.d.ts.map +1 -1
- package/dist/agents/permissions.d.ts +6 -0
- package/dist/agents/permissions.d.ts.map +1 -1
- package/dist/config/schema/magic-context.d.ts +22 -0
- package/dist/config/schema/magic-context.d.ts.map +1 -1
- package/dist/features/magic-context/compartment-chunk-embedding.d.ts +25 -0
- package/dist/features/magic-context/compartment-chunk-embedding.d.ts.map +1 -1
- package/dist/features/magic-context/compartment-embedding.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/task-prompts.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding-local.d.ts +7 -3
- package/dist/features/magic-context/memory/embedding-local.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding-openai.d.ts +8 -4
- package/dist/features/magic-context/memory/embedding-openai.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding-provider.d.ts +8 -4
- package/dist/features/magic-context/memory/embedding-provider.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding.d.ts.map +1 -1
- package/dist/features/magic-context/memory/relocate-memory.d.ts +58 -0
- package/dist/features/magic-context/memory/relocate-memory.d.ts.map +1 -0
- package/dist/features/magic-context/memory/storage-memory-embeddings.d.ts +6 -0
- package/dist/features/magic-context/memory/storage-memory-embeddings.d.ts.map +1 -1
- package/dist/features/magic-context/migrations.d.ts.map +1 -1
- package/dist/features/magic-context/project-embedding-registry.d.ts +41 -3
- package/dist/features/magic-context/project-embedding-registry.d.ts.map +1 -1
- package/dist/features/magic-context/storage-db.d.ts +2 -1
- package/dist/features/magic-context/storage-db.d.ts.map +1 -1
- package/dist/features/magic-context/storage-meta-persisted.d.ts +37 -0
- package/dist/features/magic-context/storage-meta-persisted.d.ts.map +1 -1
- package/dist/features/magic-context/storage-meta-session.d.ts +1 -0
- package/dist/features/magic-context/storage-meta-session.d.ts.map +1 -1
- package/dist/features/magic-context/storage-meta-shared.d.ts +4 -1
- package/dist/features/magic-context/storage-meta-shared.d.ts.map +1 -1
- package/dist/features/magic-context/storage-meta.d.ts +2 -2
- package/dist/features/magic-context/storage-meta.d.ts.map +1 -1
- package/dist/features/magic-context/storage-tags.d.ts +58 -2
- package/dist/features/magic-context/storage-tags.d.ts.map +1 -1
- package/dist/features/magic-context/storage.d.ts +3 -3
- package/dist/features/magic-context/storage.d.ts.map +1 -1
- package/dist/features/magic-context/tagger.d.ts +1 -1
- package/dist/features/magic-context/tagger.d.ts.map +1 -1
- package/dist/features/magic-context/transform-decision-log.d.ts +49 -0
- package/dist/features/magic-context/transform-decision-log.d.ts.map +1 -0
- package/dist/features/magic-context/types.d.ts +1 -0
- package/dist/features/magic-context/types.d.ts.map +1 -1
- package/dist/features/magic-context/v22-deferred-backfill.d.ts.map +1 -1
- package/dist/hooks/magic-context/apply-operations.d.ts +3 -25
- 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/caveman-cleanup.d.ts +1 -0
- package/dist/hooks/magic-context/caveman-cleanup.d.ts.map +1 -1
- package/dist/hooks/magic-context/channel2-delivery.d.ts +2 -0
- package/dist/hooks/magic-context/channel2-delivery.d.ts.map +1 -1
- package/dist/hooks/magic-context/command-handler.d.ts +7 -5
- package/dist/hooks/magic-context/command-handler.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-incremental.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-trigger.d.ts +1 -1
- package/dist/hooks/magic-context/compartment-trigger.d.ts.map +1 -1
- package/dist/hooks/magic-context/ctx-reduce-nudge.d.ts +7 -2
- package/dist/hooks/magic-context/ctx-reduce-nudge.d.ts.map +1 -1
- package/dist/hooks/magic-context/derive-budgets.d.ts +5 -9
- package/dist/hooks/magic-context/derive-budgets.d.ts.map +1 -1
- package/dist/hooks/magic-context/embed-session-state.d.ts +14 -0
- package/dist/hooks/magic-context/embed-session-state.d.ts.map +1 -0
- package/dist/hooks/magic-context/event-handler.d.ts.map +1 -1
- package/dist/hooks/magic-context/event-payloads.d.ts +1 -0
- package/dist/hooks/magic-context/event-payloads.d.ts.map +1 -1
- package/dist/hooks/magic-context/format-embed-status.d.ts +9 -0
- package/dist/hooks/magic-context/format-embed-status.d.ts.map +1 -0
- package/dist/hooks/magic-context/heuristic-cleanup.d.ts +2 -0
- package/dist/hooks/magic-context/heuristic-cleanup.d.ts.map +1 -1
- package/dist/hooks/magic-context/hook-handlers.d.ts.map +1 -1
- package/dist/hooks/magic-context/hook.d.ts.map +1 -1
- package/dist/hooks/magic-context/protected-tail-boundary.d.ts +10 -0
- package/dist/hooks/magic-context/protected-tail-boundary.d.ts.map +1 -1
- package/dist/hooks/magic-context/read-session-chunk.d.ts.map +1 -1
- package/dist/hooks/magic-context/read-session-true-raw-tokens.d.ts +1 -1
- package/dist/hooks/magic-context/read-session-true-raw-tokens.d.ts.map +1 -1
- package/dist/hooks/magic-context/strip-content.d.ts +0 -1
- package/dist/hooks/magic-context/strip-content.d.ts.map +1 -1
- package/dist/hooks/magic-context/tag-content-primitives.d.ts +2 -0
- package/dist/hooks/magic-context/tag-content-primitives.d.ts.map +1 -1
- package/dist/hooks/magic-context/tag-id-fallback.d.ts.map +1 -1
- package/dist/hooks/magic-context/tag-messages.d.ts +10 -0
- package/dist/hooks/magic-context/tag-messages.d.ts.map +1 -1
- package/dist/hooks/magic-context/tool-drop-target.d.ts +1 -1
- package/dist/hooks/magic-context/tool-drop-target.d.ts.map +1 -1
- package/dist/hooks/magic-context/tool-reclaim.d.ts +12 -0
- package/dist/hooks/magic-context/tool-reclaim.d.ts.map +1 -0
- package/dist/hooks/magic-context/transform-compartment-phase.d.ts +32 -1
- package/dist/hooks/magic-context/transform-compartment-phase.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform-operations.d.ts +1 -1
- package/dist/hooks/magic-context/transform-operations.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts +6 -0
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform.d.ts +2 -0
- package/dist/hooks/magic-context/transform.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1767 -613
- package/dist/plugin/conflict-warning-hook.d.ts.map +1 -1
- 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/rpc-handlers.d.ts.map +1 -1
- package/dist/shared/announcement.d.ts +1 -1
- package/dist/shared/index.d.ts +0 -1
- package/dist/shared/index.d.ts.map +1 -1
- package/dist/shared/model-suggestion-retry.d.ts.map +1 -1
- package/dist/shared/resolve-fallbacks.d.ts +16 -16
- package/dist/shared/resolve-fallbacks.d.ts.map +1 -1
- package/dist/shared/rpc-types.d.ts +20 -0
- package/dist/shared/rpc-types.d.ts.map +1 -1
- package/dist/shared/sqlite.d.ts +5 -1
- package/dist/shared/sqlite.d.ts.map +1 -1
- package/dist/tools/ctx-expand/constants.d.ts +1 -1
- package/dist/tools/ctx-expand/constants.d.ts.map +1 -1
- package/dist/tools/ctx-expand/render.d.ts +43 -0
- package/dist/tools/ctx-expand/render.d.ts.map +1 -0
- package/dist/tools/ctx-expand/tools.d.ts.map +1 -1
- package/dist/tools/ctx-expand/types.d.ts +6 -2
- package/dist/tools/ctx-expand/types.d.ts.map +1 -1
- package/dist/tools/ctx-reduce/constants.d.ts +1 -1
- package/dist/tools/ctx-reduce/constants.d.ts.map +1 -1
- package/dist/tools/ctx-search/tools.d.ts.map +1 -1
- package/dist/tui/data/context-db.d.ts +4 -2
- package/dist/tui/data/context-db.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/shared/announcement.ts +6 -6
- package/src/shared/index.ts +0 -1
- package/src/shared/model-suggestion-retry.test.ts +61 -1
- package/src/shared/model-suggestion-retry.ts +22 -0
- package/src/shared/resolve-fallbacks.test.ts +37 -71
- package/src/shared/resolve-fallbacks.ts +16 -26
- package/src/shared/rpc-types.ts +11 -0
- package/src/shared/sqlite-bind-style.test.ts +82 -0
- package/src/shared/sqlite.ts +30 -1
- package/src/shared/tag-transcript.test.ts +3 -1
- package/src/shared/tag-transcript.ts +19 -17
- package/src/tui/data/context-db.ts +34 -2
- package/src/tui/index.tsx +58 -4
- package/src/tui/slots/sidebar-content.tsx +18 -9
- package/dist/shared/model-requirements.d.ts +0 -26
- package/dist/shared/model-requirements.d.ts.map +0 -1
- package/src/shared/model-requirements.ts +0 -86
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conflict-warning-hook.d.ts","sourceRoot":"","sources":["../../src/plugin/conflict-warning-hook.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAsLlE;;GAEG;AACH,wBAAsB,mBAAmB,CACrC,MAAM,EAAE,OAAO,EACf,SAAS,EAAE,MAAM,EACjB,cAAc,EAAE,cAAc,GAC/B,OAAO,CAAC,IAAI,CAAC,CAqDf;AAED;;;GAGG;AACH,wBAAsB,uBAAuB,CACzC,MAAM,EAAE,OAAO,EACf,SAAS,EAAE,MAAM,EACjB,SAAS,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,IAAI,CAAC,CAwHf;AAkCD;;;GAGG;AACH,wBAAsB,wBAAwB,CAC1C,MAAM,EAAE,OAAO,EACf,SAAS,EAAE,MAAM,EACjB,SAAS,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,IAAI,CAAC,CAsEf;AAED;;;;;;;;GAQG;AACH,wBAAsB,sBAAsB,CACxC,MAAM,EAAE,OAAO,EACf,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE;IAAE,gBAAgB,EAAE,MAAM,CAAC;IAAC,gBAAgB,EAAE,MAAM,CAAA;CAAE,GAC/D,OAAO,CAAC,IAAI,CAAC,CAsCf;AAED;;;;;;;;GAQG;AACH,wBAAsB,uBAAuB,CACzC,MAAM,EAAE,OAAO,EACf,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,aAAa,CAAC,MAAM,CAAC,EAC/B,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,GACpC,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"conflict-warning-hook.d.ts","sourceRoot":"","sources":["../../src/plugin/conflict-warning-hook.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAsLlE;;GAEG;AACH,wBAAsB,mBAAmB,CACrC,MAAM,EAAE,OAAO,EACf,SAAS,EAAE,MAAM,EACjB,cAAc,EAAE,cAAc,GAC/B,OAAO,CAAC,IAAI,CAAC,CAqDf;AAED;;;GAGG;AACH,wBAAsB,uBAAuB,CACzC,MAAM,EAAE,OAAO,EACf,SAAS,EAAE,MAAM,EACjB,SAAS,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,IAAI,CAAC,CAwHf;AAkCD;;;GAGG;AACH,wBAAsB,wBAAwB,CAC1C,MAAM,EAAE,OAAO,EACf,SAAS,EAAE,MAAM,EACjB,SAAS,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,IAAI,CAAC,CAsEf;AAED;;;;;;;;GAQG;AACH,wBAAsB,sBAAsB,CACxC,MAAM,EAAE,OAAO,EACf,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE;IAAE,gBAAgB,EAAE,MAAM,CAAC;IAAC,gBAAgB,EAAE,MAAM,CAAA;CAAE,GAC/D,OAAO,CAAC,IAAI,CAAC,CAsCf;AAED;;;;;;;;GAQG;AACH,wBAAsB,uBAAuB,CACzC,MAAM,EAAE,OAAO,EACf,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,aAAa,CAAC,MAAM,CAAC,EAC/B,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,GACpC,OAAO,CAAC,IAAI,CAAC,CAkFf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dream-timer.d.ts","sourceRoot":"","sources":["../../src/plugin/dream-timer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dream-timer.d.ts","sourceRoot":"","sources":["../../src/plugin/dream-timer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAkBpE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAK7C;;;;;GAKG;AACH,UAAU,mBAAmB;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;IAChC,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,wBAAwB,CAAC,EAAE;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,kBAAkB,EAAE,MAAM,CAAA;KAAE,CAAC;IAC5E,uBAAuB,CAAC,EAAE;QACtB,OAAO,EAAE,OAAO,CAAC;QACjB,YAAY,EAAE,MAAM,CAAC;QACrB,SAAS,EAAE,MAAM,CAAC;KACrB,CAAC;IACF,iBAAiB,CAAC,EAAE;QAChB,OAAO,EAAE,OAAO,CAAC;QACjB,UAAU,EAAE,MAAM,CAAC;QACnB,WAAW,EAAE,MAAM,CAAC;KACvB,CAAC;IACF,gBAAgB,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACxE;AA2BD;;;;;;;;;;GAUG;AACH,wBAAsB,uBAAuB,CACzC,IAAI,EAAE,mBAAmB,GAC1B,OAAO,CAAC,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAC,CA6DnC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-session-hooks.d.ts","sourceRoot":"","sources":["../../../src/plugin/hooks/create-session-hooks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAO7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAC;AACrF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C,wBAAgB,kBAAkB,CAAC,IAAI,EAAE;IACrC,GAAG,EAAE,aAAa,CAAC;IACnB,YAAY,EAAE,wBAAwB,CAAC;IACvC,gBAAgB,EAAE,gBAAgB,CAAC;CACtC;;;;;;qBAuDizK,CAAC;;;;;;;;;;;;qBAA93D,CAAC;mBAAyB,CAAC;iBAAuB,CAAC;iBAAuB,CAAC;0BAAc,CAAC;uBAAiB,CAAC;;;;;;0BAA+
|
|
1
|
+
{"version":3,"file":"create-session-hooks.d.ts","sourceRoot":"","sources":["../../../src/plugin/hooks/create-session-hooks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAO7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAC;AACrF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C,wBAAgB,kBAAkB,CAAC,IAAI,EAAE;IACrC,GAAG,EAAE,aAAa,CAAC;IACnB,YAAY,EAAE,wBAAwB,CAAC;IACvC,gBAAgB,EAAE,gBAAgB,CAAC;CACtC;;;;;;qBAuDizK,CAAC;;;;;;;;;;;;qBAA93D,CAAC;mBAAyB,CAAC;iBAAuB,CAAC;iBAAuB,CAAC;0BAAc,CAAC;uBAAiB,CAAC;;;;;;0BAA+ykC,CAAC;;;;;;EADh1rC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rpc-handlers.d.ts","sourceRoot":"","sources":["../../src/plugin/rpc-handlers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"rpc-handlers.d.ts","sourceRoot":"","sources":["../../src/plugin/rpc-handlers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAGzE,OAAO,EACH,KAAK,eAAe,IAAI,QAAQ,EAGnC,MAAM,mCAAmC,CAAC;AAc3C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAqBlF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,KAAK,EAAe,eAAe,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AA0FtF,wBAAgB,oBAAoB,CAChC,EAAE,EAAE,QAAQ,EACZ,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,gBAAgB,CAAC,EAAE,gBAAgB,EACnC,qBAAqB,CAAC,EAAE,MAAM,EAK9B,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACjC,eAAe,CA2VjB;AAED,wBAAgB,iBAAiB,CAC7B,EAAE,EAAE,QAAQ,EACZ,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,QAAQ,CAAC,EAAE,MAAM,EACjB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,gBAAgB,CAAC,EAAE,gBAAgB,EACnC,qBAAqB,CAAC,EAAE,MAAM,GAC/B,YAAY,CA+Jd;AA4BD;;GAEG;AACH,wBAAgB,mBAAmB,CAC/B,SAAS,EAAE,qBAAqB,EAChC,IAAI,EAAE;IACF,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,kBAAkB,CAAC;IAC3B,MAAM,EAAE,OAAO,CAAC;IAChB,gBAAgB,EAAE,gBAAgB,CAAC;CACtC,GACF,IAAI,CA4ON"}
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
* Bump only when there are user-visible changes worth a startup dialog.
|
|
19
19
|
* Does NOT need to match the published package version.
|
|
20
20
|
*/
|
|
21
|
-
export declare const ANNOUNCEMENT_VERSION = "0.
|
|
21
|
+
export declare const ANNOUNCEMENT_VERSION = "0.26.0";
|
|
22
22
|
/**
|
|
23
23
|
* Short, user-facing bullet strings. Keep each line ~80 chars or shorter so the
|
|
24
24
|
* TUI dialog renders cleanly without horizontal scroll on a typical terminal.
|
package/dist/shared/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/shared/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/shared/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-suggestion-retry.d.ts","sourceRoot":"","sources":["../../src/shared/model-suggestion-retry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAM7D,KAAK,MAAM,GAAG,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAEtD,KAAK,UAAU,GAAG;IACd,KAAK,CAAC,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAChD,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CAC1B,CAAC;AAEF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MAAM,GAAG,OAAO,CAAC;CAC1B,CAAC;AAEF,MAAM,WAAW,kBAAkB;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wFAAwF;IACxF,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB;;;;;;;;;;;;;;OAcG;IACH,cAAc,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,mBAAmB;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;CACtB;AAiBD,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,mBAAmB,GAAG,IAAI,CA4C/E;AA6JD;;;;;;;;;;;;;GAaG;AACH,wBAAsB,kCAAkC,CACpD,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,UAAU,EAChB,OAAO,GAAE,kBAAuB,GACjC,OAAO,CAAC,IAAI,CAAC,CAgFf"}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Resolve the
|
|
3
|
-
* call.
|
|
2
|
+
* Resolve the fallback model list to attempt for a hidden-agent (historian /
|
|
3
|
+
* dreamer / sidekick) call when its configured primary fails.
|
|
4
4
|
*
|
|
5
|
-
* Policy
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
5
|
+
* Policy: ONLY the user's explicitly-configured `fallback_models` for this
|
|
6
|
+
* agent. There is NO builtin provider-agnostic chain — a hardcoded chain
|
|
7
|
+
* inevitably names providers the user doesn't have (e.g. a metapi-only user got
|
|
8
|
+
* a chain of google/github-copilot/opencode entries, every one a
|
|
9
|
+
* `Model not found` retry), which produced confusing errors and wasted
|
|
10
|
+
* attempts. If the user configured nothing, this returns an empty list and the
|
|
11
|
+
* runner's session-model last resort (the model the user is actually using) is
|
|
12
|
+
* the only fallback.
|
|
11
13
|
*
|
|
12
|
-
* The returned list does NOT include the primary model — it's the ordered
|
|
13
|
-
*
|
|
14
|
-
* "provider/modelID" form.
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* "provider/modelID" shape (must contain a "/" with non-empty parts) are
|
|
18
|
-
* also dropped — defensive guard against malformed user config.
|
|
14
|
+
* The returned list does NOT include the primary model — it's the ordered list
|
|
15
|
+
* of *alternates* to try after the primary fails. Each entry is
|
|
16
|
+
* "provider/modelID" form. Duplicates and empty strings are filtered; entries
|
|
17
|
+
* that don't match the "provider/modelID" shape (a "/" with non-empty parts) are
|
|
18
|
+
* dropped as a defensive guard against malformed user config.
|
|
19
19
|
*/
|
|
20
|
-
export declare function resolveFallbackChain(
|
|
20
|
+
export declare function resolveFallbackChain(userFallbacks: readonly string[] | string | undefined): string[];
|
|
21
21
|
/**
|
|
22
22
|
* Parse a "provider/modelID" string into the OpenCode `model` object shape.
|
|
23
23
|
* Returns null on invalid input.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-fallbacks.d.ts","sourceRoot":"","sources":["../../src/shared/resolve-fallbacks.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"resolve-fallbacks.d.ts","sourceRoot":"","sources":["../../src/shared/resolve-fallbacks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,oBAAoB,CAChC,aAAa,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,GACtD,MAAM,EAAE,CAGV;AA2BD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAO/F"}
|
|
@@ -123,6 +123,26 @@ export interface StatusDetail extends SidebarSnapshot {
|
|
|
123
123
|
compressionBudget: number | null;
|
|
124
124
|
compressionUsage: string | null;
|
|
125
125
|
}
|
|
126
|
+
/** Embedding coverage for `/ctx-embed` status (mirrors getEmbeddingCoverageStatus). */
|
|
127
|
+
export interface EmbedDetail {
|
|
128
|
+
enabled: boolean;
|
|
129
|
+
model: string;
|
|
130
|
+
provider: string;
|
|
131
|
+
session: {
|
|
132
|
+
embedded: number;
|
|
133
|
+
total: number;
|
|
134
|
+
};
|
|
135
|
+
memories: {
|
|
136
|
+
embedded: number;
|
|
137
|
+
total: number;
|
|
138
|
+
};
|
|
139
|
+
commits: {
|
|
140
|
+
embedded: number;
|
|
141
|
+
total: number;
|
|
142
|
+
gitEnabled: boolean;
|
|
143
|
+
};
|
|
144
|
+
statusText: string;
|
|
145
|
+
}
|
|
126
146
|
export interface RpcNotificationMessage {
|
|
127
147
|
id: number;
|
|
128
148
|
type: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rpc-types.d.ts","sourceRoot":"","sources":["../../src/shared/rpc-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,eAAe;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,gBAAgB,EAAE,MAAM,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,MAAM,CAAC;IACzB,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,qBAAqB,EAAE,OAAO,CAAC;IAC/B,gBAAgB,EAAE,MAAM,CAAC;IACzB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,iBAAiB,E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CACtB;AAED,MAAM,WAAW,sBAAsB;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB"}
|
package/dist/shared/sqlite.d.ts
CHANGED
|
@@ -25,12 +25,16 @@
|
|
|
25
25
|
* - db.transaction(fn) → wrapped function ← shimmed for node:sqlite
|
|
26
26
|
* - db.close()
|
|
27
27
|
*
|
|
28
|
-
* The
|
|
28
|
+
* The three backend differences we bridge for node:sqlite:
|
|
29
29
|
* 1. node:sqlite has no `db.transaction(fn)` helper — we add a savepoint-aware
|
|
30
30
|
* shim (below) that matches better-sqlite3/bun semantics.
|
|
31
31
|
* 2. node:sqlite's constructor option is `readOnly` (camel-case), not
|
|
32
32
|
* better-sqlite3/bun's `readonly` — we translate it so call sites are
|
|
33
33
|
* unchanged.
|
|
34
|
+
* 3. node:sqlite reads a lone array bind arg (`.run([a,b])`) as NAMED params
|
|
35
|
+
* and throws `Unknown named parameter '0'`; bun binds it positionally. We
|
|
36
|
+
* normalize it in the `prepare()` override (below) so the bind surface is
|
|
37
|
+
* identical (issue #151 / Pi /ctx-dream).
|
|
34
38
|
* Everything else (named params with bare keys, ATTACH under defensive mode,
|
|
35
39
|
* `run()` → {changes,lastInsertRowid}) is identical and was verified directly.
|
|
36
40
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sqlite.d.ts","sourceRoot":"","sources":["../../src/shared/sqlite.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"sqlite.d.ts","sourceRoot":"","sources":["../../src/shared/sqlite.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAMH,OAAO,KAAK,aAAa,MAAM,gBAAgB,CAAC;AAyHhD,eAAO,MAAM,QAAQ,EAAE,OAAO,aAA4B,CAAC;AAE3D,+DAA+D;AAC/D,MAAM,MAAM,QAAQ,GAAG,aAAa,CAAC,QAAQ,CAAC;AAE9C;;;;;;;;;GASG;AACH,MAAM,MAAM,SAAS,GAAG,aAAa,CAAC,SAAS,CAAC,OAAO,EAAE,EAAE,OAAO,CAAC,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const CTX_EXPAND_DESCRIPTION = "Recover the original conversation from your compacted history.\n\nOlder parts of this session are summarized into <compartment> blocks inside <session-history> \u2014 e.g. <compartment start=\"120\" end=\"245\" title=\"Fixed tagger collision\">. Each one replaces the raw messages in that ordinal range with a summary. When the summary isn't enough \u2014 you need exact wording, a specific value, an error message, or the reasoning behind a decision \u2014 expand the range:\n\nctx_expand(start=120, end=245) \u2190 the compartment's own start/end attributes\n\nReturns the raw transcript as [N] U:/A: lines, capped at ~15K tokens; an oversized range returns the head and tells you where to continue. Also works with ordinals from ctx_search message results \u2014 expand a window around a hit (e.g. start=N-10, end=N+5). Ranges after the last compartment are your live tail \u2014 already visible in context, not expandable.";
|
|
1
|
+
export declare const CTX_EXPAND_DESCRIPTION = "Recover the original conversation from your compacted history.\n\nOlder parts of this session are summarized into <compartment> blocks inside <session-history> \u2014 e.g. <compartment start=\"120\" end=\"245\" title=\"Fixed tagger collision\">. Each one replaces the raw messages in that ordinal range with a summary. When the summary isn't enough \u2014 you need exact wording, a specific value, an error message, or the reasoning behind a decision \u2014 expand the range:\n\nctx_expand(start=120, end=245) \u2190 the compartment's own start/end attributes\n\nReturns the raw transcript as [N] U:/A: lines, capped at ~15K tokens; an oversized range returns the head and tells you where to continue. Also works with ordinals from ctx_search message results \u2014 expand a window around a hit (e.g. start=N-10, end=N+5). Ranges after the last compartment are your live tail \u2014 already visible in context, not expandable.\n\nTwo recovery modes for finer detail:\n- ctx_expand(start=120, end=245, verbose=true) \u2014 lists each message SEPARATELY with its ordinal [N] and a per-part preview (each tool call shown with its output size). Use this to find the exact message or tool call you want, then recover it in full by ordinal.\n- ctx_expand(message=138) \u2014 returns the FULL untruncated content of the message at that ordinal: every text part, and every tool call's complete input + output, read from stored history. This is the cheap way to get back a tool output you dropped with ctx_reduce \u2014 the original is still in storage even though the wire shows [dropped \u00A7N\u00A7]. If the message was deleted from history (session prune/revert), it says so.";
|
|
2
2
|
export declare const CTX_EXPAND_TOKEN_BUDGET = 15000;
|
|
3
3
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/tools/ctx-expand/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,sBAAsB,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/tools/ctx-expand/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,sBAAsB,6oDAU6X,CAAC;AAEja,eAAO,MAAM,uBAAuB,QAAS,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Verbose / by-id rendering for ctx_expand.
|
|
3
|
+
*
|
|
4
|
+
* The default ctx_expand range view returns a CONDENSED digest (turns merged,
|
|
5
|
+
* tool calls collapsed to `TC: name(arg)`). These two renderers add the recovery
|
|
6
|
+
* modes:
|
|
7
|
+
*
|
|
8
|
+
* - `renderVerboseRange`: every message shown SEPARATELY with its message id
|
|
9
|
+
* and a per-part preview, so the agent can see exactly what's in a range and
|
|
10
|
+
* pick the id of a specific message/tool call to recover in full.
|
|
11
|
+
* - `renderMessageById`: the FULL untruncated content of one message (any
|
|
12
|
+
* role) — every text part, and every tool call's complete input + output —
|
|
13
|
+
* read straight from the harness's stored history (opencode.db / Pi JSONL).
|
|
14
|
+
* This is the cheap way back from a `ctx_reduce` drop: the wire placeholder
|
|
15
|
+
* is `[dropped §N§]`, but the original output still lives in storage until
|
|
16
|
+
* the row is genuinely deleted (session prune/revert), in which case we say
|
|
17
|
+
* so rather than re-running the tool (which could now give a different
|
|
18
|
+
* answer).
|
|
19
|
+
*
|
|
20
|
+
* Both read through the shared provider-aware helpers, so Pi works by registering
|
|
21
|
+
* its `RawMessageProvider` for the call exactly like the range view does.
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* Full untruncated recovery of one message by its ORDINAL — the same `[N]`
|
|
25
|
+
* identifier the agent already uses everywhere (compartment start/end, ctx_search
|
|
26
|
+
* hits, the verbose range view). Returns a "deleted" message when no message sits
|
|
27
|
+
* at that ordinal (pruned/reverted or wrong ordinal).
|
|
28
|
+
*/
|
|
29
|
+
export declare function renderMessageByOrdinal(sessionId: string, ordinal: number): string;
|
|
30
|
+
export interface VerboseRangeResult {
|
|
31
|
+
text: string;
|
|
32
|
+
/** Last ordinal actually rendered (for the continuation hint). */
|
|
33
|
+
lastOrdinal: number;
|
|
34
|
+
/** True when the budget cut the range short. */
|
|
35
|
+
truncated: boolean;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Verbose range view: every message in [start, end] shown separately, with its
|
|
39
|
+
* id and a per-part preview, bounded by `tokenBudget`. The agent reads the ids
|
|
40
|
+
* here and recovers any one message in full with ctx_expand(id=...).
|
|
41
|
+
*/
|
|
42
|
+
export declare function renderVerboseRange(sessionId: string, start: number, end: number, tokenBudget: number): VerboseRangeResult;
|
|
43
|
+
//# sourceMappingURL=render.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../../src/tools/ctx-expand/render.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAoLH;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAkBjF;AAED,MAAM,WAAW,kBAAkB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,kEAAkE;IAClE,WAAW,EAAE,MAAM,CAAC;IACpB,gDAAgD;IAChD,SAAS,EAAE,OAAO,CAAC;CACtB;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAC9B,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,MAAM,EACX,WAAW,EAAE,MAAM,GACpB,kBAAkB,CA0BpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../src/tools/ctx-expand/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAQ,MAAM,qBAAqB,CAAC;AAEhE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../src/tools/ctx-expand/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAQ,MAAM,qBAAqB,CAAC;AAEhE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAM5E,MAAM,WAAW,iBAAiB;IAC9B,EAAE,EAAE,eAAe,CAAC;CACvB;AA8GD,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAI5F"}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
export interface CtxExpandArgs {
|
|
2
|
-
start
|
|
3
|
-
end
|
|
2
|
+
start?: number;
|
|
3
|
+
end?: number;
|
|
4
|
+
/** Verbose range view: each message + tool call shown separately, with ordinals. */
|
|
5
|
+
verbose?: boolean;
|
|
6
|
+
/** Full untruncated recovery of one message (any role) by its ordinal. */
|
|
7
|
+
message?: number;
|
|
4
8
|
}
|
|
5
9
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/tools/ctx-expand/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC1B,KAAK,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/tools/ctx-expand/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,oFAAoF;IACpF,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,0EAA0E;IAC1E,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const CTX_REDUCE_DESCRIPTION = "
|
|
1
|
+
export declare const CTX_REDUCE_DESCRIPTION = "Mark spent tagged content as discardable to reclaim context space. This is NOT an immediate delete. Use \u00A7N\u00A7 identifiers visible in the conversation. The `drop` param accepts ranges: \"3-5\", \"1,2,9\", \"1-5,8\".\n\nHow it works:\n- Marking QUEUES content for release. It stays fully visible to you until context space is actually needed \u2014 which may be as soon as the next turn if you are already under pressure, or many turns later if not. So mark spent outputs as soon as you finish with them; don't hoard the call for the end of the turn.\n- The newest tags are protected: marking one just queues it until it ages out of the recent window, so marking recent output is harmless.\n- When content is finally released it becomes a short placeholder, and re-running the tool is the only way to get it back. So mark only what you are genuinely DONE with \u2014 the test is \"have I extracted what I need from this?\", not \"is it safe / do I have time before it drops?\".\n\nMark discardable once processed: large outputs you've summarized, repeated or redundant dumps, data written to disk, status/log output that only confirmed an expected state.\nKeep: user messages, unresolved errors, raw evidence you haven't extracted yet, and outputs whose exact wording may matter later.\nNever blanket-mark large ranges (e.g. \"1-50\") \u2014 review what each tag holds first.";
|
|
2
2
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/tools/ctx-reduce/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,sBAAsB,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/tools/ctx-reduce/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,sBAAsB,02CASoD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../src/tools/ctx-search/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAQ,MAAM,qBAAqB,CAAC;AAahE,OAAO,KAAK,EAAkC,iBAAiB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../src/tools/ctx-search/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAQ,MAAM,qBAAqB,CAAC;AAahE,OAAO,KAAK,EAAkC,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAyLjF,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAI5F"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { SidebarSnapshot, StatusDetail } from "../../shared/rpc-types";
|
|
2
|
-
export type { SidebarSnapshot, StatusDetail };
|
|
1
|
+
import type { EmbedDetail, SidebarSnapshot, StatusDetail } from "../../shared/rpc-types";
|
|
2
|
+
export type { EmbedDetail, SidebarSnapshot, StatusDetail };
|
|
3
3
|
/** Initialize the RPC client. Call once on TUI startup. */
|
|
4
4
|
export declare function initRpcClient(directory: string): void;
|
|
5
5
|
export declare function getRpcGeneration(): number;
|
|
@@ -9,6 +9,8 @@ export declare function closeRpc(): void;
|
|
|
9
9
|
export declare function loadSidebarSnapshot(sessionId: string, directory: string): Promise<SidebarSnapshot>;
|
|
10
10
|
/** Fetch full status detail from the server via RPC. */
|
|
11
11
|
export declare function loadStatusDetail(sessionId: string, directory: string, modelKey?: string): Promise<StatusDetail>;
|
|
12
|
+
/** Fetch embedding coverage status for `/ctx-embed` via RPC. */
|
|
13
|
+
export declare function loadEmbedDetail(sessionId: string, directory: string): Promise<EmbedDetail>;
|
|
12
14
|
/** Get compartment count via RPC. */
|
|
13
15
|
export declare function getCompartmentCount(sessionId: string): Promise<number>;
|
|
14
16
|
/** Send recomp request to server via RPC. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-db.d.ts","sourceRoot":"","sources":["../../../src/tui/data/context-db.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"context-db.d.ts","sourceRoot":"","sources":["../../../src/tui/data/context-db.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACR,WAAW,EAEX,eAAe,EACf,YAAY,EACf,MAAM,wBAAwB,CAAC;AAEhC,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,YAAY,EAAE,CAAC;AAe3D,2DAA2D;AAC3D,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAOrD;AAED,wBAAgB,gBAAgB,IAAI,MAAM,CAEzC;AAED,+BAA+B;AAC/B,wBAAgB,QAAQ,IAAI,IAAI,CAO/B;AA4FD,sDAAsD;AACtD,wBAAsB,mBAAmB,CACrC,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,GAClB,OAAO,CAAC,eAAe,CAAC,CA4B1B;AAED,wDAAwD;AACxD,wBAAsB,gBAAgB,CAClC,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,QAAQ,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,YAAY,CAAC,CAyCvB;AAYD,gEAAgE;AAChE,wBAAsB,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAchG;AAED,qCAAqC;AACrC,wBAAsB,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAQ5E;AAED,6CAA6C;AAC7C,wBAAsB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAQvE;AAED;mFACmF;AACnF,wBAAsB,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAQxE;AAED;;iDAEiD;AACjD,wBAAsB,sBAAsB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAUhF;AAED,MAAM,WAAW,UAAU;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACjC,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,wBAAsB,eAAe,IAAI,OAAO,CAAC,oBAAoB,CAAC,CAkBrE;AAED,wEAAwE;AACxE,wBAAsB,aAAa,IAAI,OAAO,CAAC,OAAO,CAAC,CAQtD;AAED,yDAAyD;AACzD,wBAAsB,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,CAyBjF;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,GAAG,IAAI,CAWtF"}
|
package/package.json
CHANGED
|
@@ -23,18 +23,18 @@ import { getMagicContextStorageDir } from "./data-path";
|
|
|
23
23
|
* Bump only when there are user-visible changes worth a startup dialog.
|
|
24
24
|
* Does NOT need to match the published package version.
|
|
25
25
|
*/
|
|
26
|
-
export const ANNOUNCEMENT_VERSION = "0.
|
|
26
|
+
export const ANNOUNCEMENT_VERSION = "0.26.0";
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
29
|
* Short, user-facing bullet strings. Keep each line ~80 chars or shorter so the
|
|
30
30
|
* TUI dialog renders cleanly without horizontal scroll on a typical terminal.
|
|
31
31
|
*/
|
|
32
32
|
export const ANNOUNCEMENT_FEATURES: ReadonlyArray<string> = [
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
33
|
+
"Faster on large sessions: per-message transform overhead is at least 2x lower on typical passes and up to ~10x lower when history summarization fires (no more multi-second pause on big sessions).",
|
|
34
|
+
"No more surprise models: the built-in fallback chain is gone. Hidden agents only use the model (and fallback_models) you configure — no confusing 'model not found' for providers you never set up. `doctor` now records every historian run so real failures are visible.",
|
|
35
|
+
"Anthropic thinking-block fix: clearing old reasoning no longer risks a stale-signature rejection on Claude / Bedrock / proxied-Claude routes. Plus fewer prompt-cache busts.",
|
|
36
|
+
"Community fixes: TUI crash on the upgrade progress panel (#168), historian.disallowed_tools for weak models that loop on tool calls (#166), and a Pi-only config key leak (#167).",
|
|
37
|
+
"New: doctor migrate-session re-homes a session (and optionally its memories) to another project, with a dry-run preview.",
|
|
38
38
|
];
|
|
39
39
|
|
|
40
40
|
/**
|
package/src/shared/index.ts
CHANGED
|
@@ -7,10 +7,11 @@ type PromptCall = {
|
|
|
7
7
|
signal?: AbortSignal;
|
|
8
8
|
};
|
|
9
9
|
|
|
10
|
-
function createClient(prompt: ReturnType<typeof mock>) {
|
|
10
|
+
function createClient(prompt: ReturnType<typeof mock>, abort?: ReturnType<typeof mock>) {
|
|
11
11
|
return {
|
|
12
12
|
session: {
|
|
13
13
|
prompt,
|
|
14
|
+
abort: abort ?? mock(async () => ({})),
|
|
14
15
|
},
|
|
15
16
|
} as never;
|
|
16
17
|
}
|
|
@@ -164,6 +165,65 @@ describe("promptSyncWithModelSuggestionRetry", () => {
|
|
|
164
165
|
expect(prompt).toHaveBeenCalledTimes(1);
|
|
165
166
|
});
|
|
166
167
|
|
|
168
|
+
// #154: our timeout must force-stop the child's SERVER-SIDE run loop via
|
|
169
|
+
// session.abort — cancelling our client fetch alone leaves the child looping
|
|
170
|
+
// the LLM past the timeout (uncancellable, only dies on process exit).
|
|
171
|
+
test("timeout fires session.abort on the child session", async () => {
|
|
172
|
+
// A prompt that respects the AbortController by hanging until aborted,
|
|
173
|
+
// then throwing — mirrors a real in-flight request our timeout cancels.
|
|
174
|
+
const prompt = mock((opts: { signal?: AbortSignal }) => {
|
|
175
|
+
return new Promise((_resolve, reject) => {
|
|
176
|
+
opts.signal?.addEventListener("abort", () => reject(new Error("aborted")));
|
|
177
|
+
});
|
|
178
|
+
});
|
|
179
|
+
const abort = mock(async () => ({}));
|
|
180
|
+
const client = createClient(prompt as never, abort);
|
|
181
|
+
|
|
182
|
+
await expect(
|
|
183
|
+
promptSyncWithModelSuggestionRetry(client, createArgs(), { timeoutMs: 20 }),
|
|
184
|
+
).rejects.toThrow(/timed out/);
|
|
185
|
+
expect(abort).toHaveBeenCalledTimes(1);
|
|
186
|
+
expect((abort.mock.calls[0]?.[0] as { path: { id: string } }).path.id).toBe("ses-test");
|
|
187
|
+
});
|
|
188
|
+
|
|
189
|
+
// External abort (e.g. dreamer lease loss) mid-flight must also stop the
|
|
190
|
+
// server-side loop, not just our fetch.
|
|
191
|
+
test("external abort fires session.abort on the child session", async () => {
|
|
192
|
+
const controller = new AbortController();
|
|
193
|
+
const prompt = mock((opts: { signal?: AbortSignal }) => {
|
|
194
|
+
return new Promise((_resolve, reject) => {
|
|
195
|
+
opts.signal?.addEventListener("abort", () => reject(new Error("aborted")));
|
|
196
|
+
});
|
|
197
|
+
});
|
|
198
|
+
const abort = mock(async () => ({}));
|
|
199
|
+
const client = createClient(prompt as never, abort);
|
|
200
|
+
|
|
201
|
+
setTimeout(() => controller.abort(), 10);
|
|
202
|
+
await expect(
|
|
203
|
+
promptSyncWithModelSuggestionRetry(client, createArgs(), { signal: controller.signal }),
|
|
204
|
+
).rejects.toThrow(/aborted by external signal/);
|
|
205
|
+
expect(abort).toHaveBeenCalledTimes(1);
|
|
206
|
+
expect((abort.mock.calls[0]?.[0] as { path: { id: string } }).path.id).toBe("ses-test");
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
// A failing session.abort must not mask the original timeout/abort error.
|
|
210
|
+
test("session.abort failure does not mask the timeout error", async () => {
|
|
211
|
+
const prompt = mock((opts: { signal?: AbortSignal }) => {
|
|
212
|
+
return new Promise((_resolve, reject) => {
|
|
213
|
+
opts.signal?.addEventListener("abort", () => reject(new Error("aborted")));
|
|
214
|
+
});
|
|
215
|
+
});
|
|
216
|
+
const abort = mock(async () => {
|
|
217
|
+
throw new Error("abort endpoint 500");
|
|
218
|
+
});
|
|
219
|
+
const client = createClient(prompt as never, abort);
|
|
220
|
+
|
|
221
|
+
await expect(
|
|
222
|
+
promptSyncWithModelSuggestionRetry(client, createArgs(), { timeoutMs: 20 }),
|
|
223
|
+
).rejects.toThrow(/timed out/);
|
|
224
|
+
expect(abort).toHaveBeenCalledTimes(1);
|
|
225
|
+
});
|
|
226
|
+
|
|
167
227
|
test("suggestion retry within attempt succeeds", async () => {
|
|
168
228
|
const suggestionError = new Error("model not found");
|
|
169
229
|
suggestionError.name = "ProviderModelNotFoundError";
|
|
@@ -143,9 +143,17 @@ async function promptWithTimeout(
|
|
|
143
143
|
} as Parameters<typeof client.session.prompt>[0]);
|
|
144
144
|
} catch (error) {
|
|
145
145
|
if (signal?.aborted) {
|
|
146
|
+
// External abort (e.g. dreamer lease loss): the child run loop is an
|
|
147
|
+
// independent SERVER-SIDE fiber — cancelling our client fetch alone
|
|
148
|
+
// leaves it looping the LLM forever (issue #154). Force-stop it.
|
|
149
|
+
await abortChildRun(client, args.path.id);
|
|
146
150
|
throw new Error("prompt aborted by external signal");
|
|
147
151
|
}
|
|
148
152
|
if (controller.signal.aborted) {
|
|
153
|
+
// Our timeout fired. Same problem: abort the server-side run loop, not
|
|
154
|
+
// just our fetch, or the child keeps re-calling the LLM past the
|
|
155
|
+
// timeout (uncancellable by the user's ESC — issue #154).
|
|
156
|
+
await abortChildRun(client, args.path.id);
|
|
149
157
|
throw new Error(`prompt timed out after ${timeoutMs}ms`);
|
|
150
158
|
}
|
|
151
159
|
throw error;
|
|
@@ -155,6 +163,20 @@ async function promptWithTimeout(
|
|
|
155
163
|
}
|
|
156
164
|
}
|
|
157
165
|
|
|
166
|
+
/**
|
|
167
|
+
* Force-stop a spawned child session's server-side run loop. `controller.abort()`
|
|
168
|
+
* on the prompt signal only cancels OUR client fetch; the run loop is a separate
|
|
169
|
+
* instance-scoped fiber that `POST /session/{id}/abort` interrupts. Best-effort —
|
|
170
|
+
* a failure here must not mask the original timeout/abort error.
|
|
171
|
+
*/
|
|
172
|
+
async function abortChildRun(client: Client, sessionId: string): Promise<void> {
|
|
173
|
+
try {
|
|
174
|
+
await client.session.abort({ path: { id: sessionId } });
|
|
175
|
+
} catch (error) {
|
|
176
|
+
log(`[model-retry] child session abort failed for ${sessionId}: ${String(error)}`);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
158
180
|
/**
|
|
159
181
|
* Returns true if the error indicates a NON-RETRYABLE condition where iterating
|
|
160
182
|
* to a fallback model would be pointless or harmful:
|