@wolfx/opencode-magic-context 0.27.2 → 0.30.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.
Files changed (125) hide show
  1. package/dist/agents/language-directive.d.ts +27 -0
  2. package/dist/agents/language-directive.d.ts.map +1 -0
  3. package/dist/agents/magic-context-prompt.d.ts +1 -1
  4. package/dist/agents/magic-context-prompt.d.ts.map +1 -1
  5. package/dist/config/project-security.d.ts +1 -0
  6. package/dist/config/project-security.d.ts.map +1 -1
  7. package/dist/config/schema/magic-context.d.ts +15 -0
  8. package/dist/config/schema/magic-context.d.ts.map +1 -1
  9. package/dist/features/magic-context/dreamer/refresh-primers.d.ts +1 -0
  10. package/dist/features/magic-context/dreamer/refresh-primers.d.ts.map +1 -1
  11. package/dist/features/magic-context/dreamer/retrospective-raw-provider.d.ts +0 -1
  12. package/dist/features/magic-context/dreamer/retrospective-raw-provider.d.ts.map +1 -1
  13. package/dist/features/magic-context/dreamer/storage-task-schedule.d.ts +10 -0
  14. package/dist/features/magic-context/dreamer/storage-task-schedule.d.ts.map +1 -1
  15. package/dist/features/magic-context/dreamer/task-config.d.ts +1 -1
  16. package/dist/features/magic-context/dreamer/task-config.d.ts.map +1 -1
  17. package/dist/features/magic-context/dreamer/task-executor.d.ts +1 -3
  18. package/dist/features/magic-context/dreamer/task-executor.d.ts.map +1 -1
  19. package/dist/features/magic-context/dreamer/task-prompts.d.ts +1 -1
  20. package/dist/features/magic-context/dreamer/task-prompts.d.ts.map +1 -1
  21. package/dist/features/magic-context/dreamer/task-registry.d.ts +0 -1
  22. package/dist/features/magic-context/dreamer/task-registry.d.ts.map +1 -1
  23. package/dist/features/magic-context/dreamer/task-scheduler.d.ts +1 -0
  24. package/dist/features/magic-context/dreamer/task-scheduler.d.ts.map +1 -1
  25. package/dist/features/magic-context/dreamer/verify.d.ts +1 -0
  26. package/dist/features/magic-context/dreamer/verify.d.ts.map +1 -1
  27. package/dist/features/magic-context/memory/memory-migration.d.ts +1 -0
  28. package/dist/features/magic-context/memory/memory-migration.d.ts.map +1 -1
  29. package/dist/features/magic-context/sidekick/agent.d.ts +1 -0
  30. package/dist/features/magic-context/sidekick/agent.d.ts.map +1 -1
  31. package/dist/features/magic-context/smart-notes/sandbox-runner.d.ts.map +1 -1
  32. package/dist/features/magic-context/storage-db.d.ts +2 -21
  33. package/dist/features/magic-context/storage-db.d.ts.map +1 -1
  34. package/dist/features/magic-context/storage-schema-helpers.d.ts +30 -0
  35. package/dist/features/magic-context/storage-schema-helpers.d.ts.map +1 -0
  36. package/dist/features/magic-context/storage-tags.d.ts +0 -5
  37. package/dist/features/magic-context/storage-tags.d.ts.map +1 -1
  38. package/dist/features/magic-context/transform-decision-log.d.ts +1 -0
  39. package/dist/features/magic-context/transform-decision-log.d.ts.map +1 -1
  40. package/dist/features/magic-context/types.d.ts +12 -1
  41. package/dist/features/magic-context/types.d.ts.map +1 -1
  42. package/dist/features/magic-context/user-memory/review-user-memories.d.ts +1 -0
  43. package/dist/features/magic-context/user-memory/review-user-memories.d.ts.map +1 -1
  44. package/dist/hooks/magic-context/apply-operations.d.ts +8 -1
  45. package/dist/hooks/magic-context/apply-operations.d.ts.map +1 -1
  46. package/dist/hooks/magic-context/channel2-delivery.d.ts +9 -5
  47. package/dist/hooks/magic-context/channel2-delivery.d.ts.map +1 -1
  48. package/dist/hooks/magic-context/command-handler.d.ts +1 -0
  49. package/dist/hooks/magic-context/command-handler.d.ts.map +1 -1
  50. package/dist/hooks/magic-context/compartment-runner-historian.d.ts +1 -0
  51. package/dist/hooks/magic-context/compartment-runner-historian.d.ts.map +1 -1
  52. package/dist/hooks/magic-context/compartment-runner-incremental.d.ts.map +1 -1
  53. package/dist/hooks/magic-context/compartment-runner-partial-recomp.d.ts.map +1 -1
  54. package/dist/hooks/magic-context/compartment-runner-recomp.d.ts.map +1 -1
  55. package/dist/hooks/magic-context/compartment-runner-types.d.ts +1 -0
  56. package/dist/hooks/magic-context/compartment-runner-types.d.ts.map +1 -1
  57. package/dist/hooks/magic-context/compartment-runner-validation.d.ts +1 -1
  58. package/dist/hooks/magic-context/compartment-runner-validation.d.ts.map +1 -1
  59. package/dist/hooks/magic-context/ctx-reduce-nudge.d.ts +13 -3
  60. package/dist/hooks/magic-context/ctx-reduce-nudge.d.ts.map +1 -1
  61. package/dist/hooks/magic-context/edit-marker.d.ts +11 -0
  62. package/dist/hooks/magic-context/edit-marker.d.ts.map +1 -0
  63. package/dist/hooks/magic-context/event-handler.d.ts +1 -4
  64. package/dist/hooks/magic-context/event-handler.d.ts.map +1 -1
  65. package/dist/hooks/magic-context/hook-handlers.d.ts.map +1 -1
  66. package/dist/hooks/magic-context/hook.d.ts +2 -2
  67. package/dist/hooks/magic-context/hook.d.ts.map +1 -1
  68. package/dist/hooks/magic-context/read-session-formatting.d.ts.map +1 -1
  69. package/dist/hooks/magic-context/recomp-orchestrator.d.ts +1 -0
  70. package/dist/hooks/magic-context/recomp-orchestrator.d.ts.map +1 -1
  71. package/dist/hooks/magic-context/supersession-reclaim.d.ts +34 -0
  72. package/dist/hooks/magic-context/supersession-reclaim.d.ts.map +1 -0
  73. package/dist/hooks/magic-context/system-prompt-hash.d.ts +7 -0
  74. package/dist/hooks/magic-context/system-prompt-hash.d.ts.map +1 -1
  75. package/dist/hooks/magic-context/tag-messages.d.ts +8 -0
  76. package/dist/hooks/magic-context/tag-messages.d.ts.map +1 -1
  77. package/dist/hooks/magic-context/tool-drop-target.d.ts +2 -0
  78. package/dist/hooks/magic-context/tool-drop-target.d.ts.map +1 -1
  79. package/dist/hooks/magic-context/transform-postprocess-phase.d.ts +8 -0
  80. package/dist/hooks/magic-context/transform-postprocess-phase.d.ts.map +1 -1
  81. package/dist/hooks/magic-context/transform.d.ts +4 -0
  82. package/dist/hooks/magic-context/transform.d.ts.map +1 -1
  83. package/dist/index.d.ts.map +1 -1
  84. package/dist/index.js +3911 -5483
  85. package/dist/plugin/conflict-warning-hook.d.ts.map +1 -1
  86. package/dist/plugin/dream-timer.d.ts +1 -0
  87. package/dist/plugin/dream-timer.d.ts.map +1 -1
  88. package/dist/plugin/hooks/create-session-hooks.d.ts.map +1 -1
  89. package/dist/plugin/rpc-handlers.d.ts.map +1 -1
  90. package/dist/plugin/tool-registry.d.ts.map +1 -1
  91. package/dist/shared/announcement.d.ts +1 -1
  92. package/dist/shared/announcement.d.ts.map +1 -1
  93. package/dist/shared/commit-detection.d.ts +29 -0
  94. package/dist/shared/commit-detection.d.ts.map +1 -0
  95. package/dist/shared/exit-abort-registry.d.ts +25 -0
  96. package/dist/shared/exit-abort-registry.d.ts.map +1 -0
  97. package/dist/shared/harness-provider-map.d.ts +30 -0
  98. package/dist/shared/harness-provider-map.d.ts.map +1 -0
  99. package/dist/shared/tag-transcript.d.ts.map +1 -1
  100. package/dist/shared/transcript.d.ts +15 -0
  101. package/dist/shared/transcript.d.ts.map +1 -1
  102. package/dist/shared/tui-preferences.d.ts +1 -1
  103. package/dist/tools/ctx-note/tools.d.ts.map +1 -1
  104. package/dist/tui/badge-contrast.d.ts +46 -0
  105. package/dist/tui/badge-contrast.d.ts.map +1 -0
  106. package/package.json +78 -77
  107. package/src/shared/announcement.ts +2 -6
  108. package/src/shared/commit-detection.test.ts +63 -0
  109. package/src/shared/commit-detection.ts +53 -0
  110. package/src/shared/exit-abort-registry.test.ts +50 -0
  111. package/src/shared/exit-abort-registry.ts +46 -0
  112. package/src/shared/harness-provider-map.test.ts +63 -0
  113. package/src/shared/harness-provider-map.ts +56 -0
  114. package/src/shared/tag-transcript.ts +32 -0
  115. package/src/shared/transcript-opencode.ts +33 -0
  116. package/src/shared/transcript.ts +17 -0
  117. package/src/shared/tui-preferences.ts +2 -2
  118. package/src/tui/badge-contrast.test.ts +83 -0
  119. package/src/tui/badge-contrast.ts +84 -0
  120. package/src/tui/slots/sidebar-content.tsx +2 -1
  121. package/dist/hooks/is-anthropic-provider.d.ts +0 -2
  122. package/dist/hooks/is-anthropic-provider.d.ts.map +0 -1
  123. package/dist/shared/live-server-client.d.ts +0 -50
  124. package/dist/shared/live-server-client.d.ts.map +0 -1
  125. package/src/shared/live-server-client.ts +0 -152
@@ -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,CAkFf"}
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,CA2Cf;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"}
@@ -14,6 +14,7 @@ interface ProjectRegistration {
14
14
  projectIdentity: string;
15
15
  client: PluginContext["client"];
16
16
  dreamerConfig?: DreamerConfig;
17
+ language?: string;
17
18
  gitCommitIndexing?: {
18
19
  enabled: boolean;
19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AAC,CAyDnC"}
@@ -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;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CAAC,YAAY,EAAE,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0BjF;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE;IACrC,GAAG,EAAE,aAAa,CAAC;IACnB,YAAY,EAAE,wBAAwB,CAAC;IACvC,gBAAgB,EAAE,gBAAgB,CAAC;CACtC;;;;;;qBA+B+zJ,CAAC;;;;;;;;;;;;qBAA7lD,CAAC;mBAAyB,CAAC;iBAAuB,CAAC;iBAAuB,CAAC;0BAAc,CAAC;uBAAiB,CAAC;;;;;;0BAAgjmC,CAAC;;;;;;EADh4sC"}
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;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CAAC,YAAY,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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,CAyKd;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,CAyPN"}
@@ -1 +1 @@
1
- {"version":3,"file":"tool-registry.d.ts","sourceRoot":"","sources":["../../src/plugin/tool-registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAiB1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,wBAAgB,kBAAkB,CAAC,IAAI,EAAE;IACrC,GAAG,EAAE,aAAa,CAAC;IACnB,YAAY,EAAE,wBAAwB,CAAC;CAC1C,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAiFjC"}
1
+ {"version":3,"file":"tool-registry.d.ts","sourceRoot":"","sources":["../../src/plugin/tool-registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAiB1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,wBAAgB,kBAAkB,CAAC,IAAI,EAAE;IACrC,GAAG,EAAE,aAAa,CAAC;IACnB,YAAY,EAAE,wBAAwB,CAAC;CAC1C,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAyFjC"}
@@ -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.27.0";
21
+ export declare const ANNOUNCEMENT_VERSION = "0.30.1";
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.
@@ -1 +1 @@
1
- {"version":3,"file":"announcement.d.ts","sourceRoot":"","sources":["../../src/shared/announcement.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAoBH;;;GAGG;AACH,eAAO,MAAM,oBAAoB,WAAW,CAAC;AAE7C;;;GAGG;AACH,eAAO,MAAM,qBAAqB,EAAE,aAAa,CAAC,MAAM,CAMvD,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,qDAAqD,CAAC;AAyBtF;;;;GAIG;AACH,wBAAgB,wBAAwB,IAAI,MAAM,CAGjD;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAS1D;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,sBAAsB,IAAI,OAAO,CA0BhD"}
1
+ {"version":3,"file":"announcement.d.ts","sourceRoot":"","sources":["../../src/shared/announcement.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAoBH;;;GAGG;AACH,eAAO,MAAM,oBAAoB,WAAW,CAAC;AAE7C;;;GAGG;AACH,eAAO,MAAM,qBAAqB,EAAE,aAAa,CAAC,MAAM,CAEvD,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,qDAAqD,CAAC;AAyBtF;;;;GAIG;AACH,wBAAgB,wBAAwB,IAAI,MAAM,CAGjD;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAS1D;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,sBAAsB,IAAI,OAAO,CA0BhD"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Boolean hash test. Non-global (stateless), so this single instance is safe to
3
+ * reuse with `.test()` across call sites — only `/g` regexes carry `lastIndex`.
4
+ */
5
+ export declare const COMMIT_HASH_TEST_PATTERN: RegExp;
6
+ /**
7
+ * Commit-ACTION verbs, with common inflections, each fully word-boundary-anchored
8
+ * (so they don't match e.g. "commitment"/"merger"). Non-global → safe to share.
9
+ *
10
+ * Scope decision: this is the commit-action set the OpenCode + Pi note-nudge
11
+ * detectors used and pin in tests ("commit/cherry-pick/merge/rebase"). It does
12
+ * NOT include the bare nouns "hash"/"sha" that the historian's old hint regex
13
+ * carried — a parity test asserts "hash <hex>" alone must NOT count as a commit,
14
+ * and those nouns only ever gated a cosmetic hash-strip in historian summaries
15
+ * (never a trigger), so unifying to the action set is behavior-preserving where
16
+ * it matters.
17
+ */
18
+ export declare const COMMIT_VERB_PATTERN: RegExp;
19
+ /** True when a text part mentions a commit hash in a commit context. Used by the
20
+ * OpenCode + Pi note-nudge detectors. */
21
+ export declare function textMentionsRecentCommit(text: string): boolean;
22
+ /**
23
+ * Fresh `/g` capturing, backtick-aware hash pattern for the historian's
24
+ * extract-and-strip path (matchAll + replace). Returned as a NEW instance per
25
+ * call: a `/g` regex carries `lastIndex`, so handing out a fresh one is
26
+ * bulletproof against accidental `.exec()` reuse across callers.
27
+ */
28
+ export declare function createCommitHashExtractPattern(): RegExp;
29
+ //# sourceMappingURL=commit-detection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commit-detection.d.ts","sourceRoot":"","sources":["../../src/shared/commit-detection.ts"],"names":[],"mappings":"AAiBA;;;GAGG;AACH,eAAO,MAAM,wBAAwB,QAAuC,CAAC;AAE7E;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,mBAAmB,QACsE,CAAC;AAEvG;0CAC0C;AAC1C,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE9D;AAED;;;;;GAKG;AACH,wBAAgB,8BAA8B,IAAI,MAAM,CAEvD"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Process-global registry of AbortControllers to abort on process exit, backed
3
+ * by a SINGLE `process.once("exit")` listener no matter how many controllers
4
+ * register.
5
+ *
6
+ * Why this exists: the plugin factory runs once per plugin instance, and
7
+ * OpenCode Desktop loads many instances in one Node process (one per open
8
+ * project). Registering a `process.once("exit")` per instance added one listener
9
+ * each, so past Node's default 10-listener cap it logged a
10
+ * `MaxListenersExceededWarning` ("11 exit listeners added to [process]"). One
11
+ * module-global listener that fans out to every registered controller keeps the
12
+ * count at one.
13
+ */
14
+ /**
15
+ * Abort `controller` when the process exits. The underlying `process.once("exit")`
16
+ * listener is installed on the first call only; subsequent calls just add to the
17
+ * fan-out set.
18
+ */
19
+ export declare function registerExitAbort(controller: AbortController): void;
20
+ /**
21
+ * Stop tracking `controller` (e.g. when its plugin instance is disposed) so the
22
+ * set doesn't grow without bound as Desktop opens and closes projects.
23
+ */
24
+ export declare function unregisterExitAbort(controller: AbortController): void;
25
+ //# sourceMappingURL=exit-abort-registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exit-abort-registry.d.ts","sourceRoot":"","sources":["../../src/shared/exit-abort-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAeH;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,eAAe,GAAG,IAAI,CAKnE;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,eAAe,GAAG,IAAI,CAErE"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Provider-id translation between the canonical (OpenCode) form stored in the
3
+ * shared magic-context config and Pi's harness-native provider ids.
4
+ *
5
+ * OpenCode and Pi now share ONE config, but a few auth-plugin providers were
6
+ * named differently on each side. The model id AFTER the slash is identical;
7
+ * only the provider prefix differs:
8
+ *
9
+ * canonical (OpenCode) Pi
10
+ * -------------------- -------------------
11
+ * openai/<model> openai-codex/<model>
12
+ * google/<model> google-antigravity/<model>
13
+ * anthropic/<model> anthropic/<model> (same; every other provider too)
14
+ *
15
+ * Canonical = OpenCode: the config always stores the OpenCode form. Pi
16
+ * translates at its edges:
17
+ * - read: canonical -> Pi when spawning a configured model (subagent-runner).
18
+ * - write: Pi -> canonical in the Pi setup wizard, so a config written from
19
+ * the Pi side stays readable by OpenCode.
20
+ *
21
+ * OpenCode needs no translation (canonical IS the OpenCode form).
22
+ */
23
+ /** Pi-native `provider/model` -> canonical (OpenCode). Identity when unmapped.
24
+ * Used by the Pi setup wizard so configs it writes stay OpenCode-readable. */
25
+ export declare function piModelRefToCanonical(ref: string): string;
26
+ /** Canonical (OpenCode) `provider/model` -> Pi-native, for spawning a model on
27
+ * Pi. Idempotent: normalizes any Pi-form prefix back to canonical first, so it
28
+ * is safe on a config that already holds Pi-form ids (hand-edited or pre-fix). */
29
+ export declare function resolveModelRefForPi(ref: string): string;
30
+ //# sourceMappingURL=harness-provider-map.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"harness-provider-map.d.ts","sourceRoot":"","sources":["../../src/shared/harness-provider-map.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAuBH;+EAC+E;AAC/E,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED;;mFAEmF;AACnF,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAExD"}
@@ -1 +1 @@
1
- {"version":3,"file":"tag-transcript.d.ts","sourceRoot":"","sources":["../../src/shared/tag-transcript.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AA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AAW,mBAAmB;IAChC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;CACnC;AA8DD,wBAAgB,aAAa,CACzB,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,MAAM,EACd,EAAE,EAAE,eAAe,EACnB,OAAO,GAAE,oBAAyB,GACnC,mBAAmB,CAiPrB"}
@@ -117,6 +117,21 @@ export interface TranscriptPart {
117
117
  inputByteSize: number;
118
118
  inputTokenCount: number;
119
119
  };
120
+ /**
121
+ * Non-mutating read of this tool invocation's input object, or null for
122
+ * non-tool parts / parts without an input. Used by smart-drops supersession
123
+ * selection (read `ctx_note`'s action, an edit's `filePath`) without
124
+ * touching the wire. Returns the live object reference; callers must NOT
125
+ * mutate it.
126
+ */
127
+ getToolInput?(): Record<string, unknown> | null;
128
+ /**
129
+ * Replace this tool invocation's input object with `input`. Used by the
130
+ * smart-drops edit_marker path to write back a filePath-preserving,
131
+ * region-hint-clamped copy of an edit's arguments. Returns true if the part
132
+ * carried a writable tool input. No-op (false) for non-tool parts.
133
+ */
134
+ setToolInput?(input: Record<string, unknown>): boolean;
120
135
  /**
121
136
  * Replace this part with a sentinel placeholder. Sentinels look like
122
137
  * `[dropped §N§]` or `[truncated §N§]` and survive cache-busting
@@ -1 +1 @@
1
- {"version":3,"file":"transcript.d.ts","sourceRoot":"","sources":["../../src/shared/transcript.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AAEH,2EAA2E;AAC3E,MAAM,MAAM,kBAAkB,GACxB,MAAM,GACN,UAAU,GACV,UAAU,GACV,aAAa,GACb,OAAO,GACP,MAAM,GACN,YAAY,GACZ,SAAS,CAAC;AAEhB;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,cAAc;IAC3B,+DAA+D;IAC/D,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAC;IAElC;;;;;;;;OAQG;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,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAEjE,wEAAwE;IACxE,QAAQ,CAAC,KAAK,EAAE,cAAc,EAAE,CAAC;CACpC;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,UAAU;IACvB,4CAA4C;IAC5C,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,EAAE,CAAC;IAEvC;;;;;;OAMG;IACH,QAAQ,CAAC,OAAO,EAAE,UAAU,GAAG,IAAI,CAAC;IAEpC;;;;;;;;;;;;;OAaG;IACH,MAAM,IAAI,IAAI,CAAC;CAClB;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,wBAAwB,EAAE,kBAAiC,CAAC"}
@@ -3,7 +3,7 @@ export declare function getTuiPreferencesFile(): string;
3
3
  export declare function readTuiPreferencesFile(): Promise<Record<string, unknown>>;
4
4
  export declare function readTuiPreferencesFileSync(): Record<string, unknown>;
5
5
  export declare const PLUGIN_KEY = "magic-context";
6
- export declare const DEFAULT_SLOT_ORDER = 200;
6
+ export declare const DEFAULT_SLOT_ORDER = 170;
7
7
  export interface MagicContextTuiPrefs {
8
8
  forceToTop: boolean;
9
9
  order: number;
@@ -1 +1 @@
1
- {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../src/tools/ctx-note/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAQ,MAAM,qBAAqB,CAAC;AAYhE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAIpD,MAAM,WAAW,eAAe;IAC5B,EAAE,EAAE,QAAQ,CAAC;IACb,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;;;OAKG;IACH,kBAAkB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;CACtD;AAoTD,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAIxF"}
1
+ {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../src/tools/ctx-note/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAQ,MAAM,qBAAqB,CAAC;AAYhE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAIpD,MAAM,WAAW,eAAe;IAC5B,EAAE,EAAE,QAAQ,CAAC;IACb,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;;;OAKG;IACH,kBAAkB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;CACtD;AAuTD,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAIxF"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Pick the text color for the sidebar header badge (a bold label drawn on a
3
+ * `theme.accent` background).
4
+ *
5
+ * Primary rule (matches AFT's sidebar by construction): paint the theme's own
6
+ * `background` color as the label, the inverse-of-panel look. Because it is a
7
+ * fixed theme token rather than an accent-derived computation, MC's badge and
8
+ * AFT's badge agree on EVERY accent automatically, so the same theme can never
9
+ * make one badge black and the other white (issue #198).
10
+ *
11
+ * Fallback rule (the reason a luminance pick exists at all): `theme.background`
12
+ * can be unusable as a label color in two degenerate cases, where it would
13
+ * render the label invisible on the accent:
14
+ * 1. Transparent background. Themes that respect terminal transparency set
15
+ * `background: "none"`, which resolves to `RGBA(0,0,0,0)`; drawing it as
16
+ * text renders fully transparent and the label disappears (issue #186).
17
+ * 2. Background ~= accent. If the theme's background and accent are nearly the
18
+ * same color, background-on-accent text has no contrast.
19
+ * In either case we fall back to a black/white pick that is guaranteed visible
20
+ * on the always-opaque accent.
21
+ *
22
+ * `RGBA` channels from @opentui/core are normalized 0..1 floats (alpha included).
23
+ * We accept the minimal `{ r, g, b, a? }` shape so this stays a pure, trivially
24
+ * testable function independent of the native color class, and we return the
25
+ * passed-in `background` object unchanged on the primary path so it stays the
26
+ * exact same theme token AFT uses.
27
+ */
28
+ type Color = {
29
+ r: number;
30
+ g: number;
31
+ b: number;
32
+ a?: number;
33
+ };
34
+ /**
35
+ * Pure black/white pick by accent luminance. Used as the badge fallback and kept
36
+ * exported for callers that only have the accent.
37
+ */
38
+ export declare function readableTextColorOn(bg: Color): string;
39
+ /**
40
+ * Badge label color on the accent: the theme background (AFT parity) when it is
41
+ * usable, else a guaranteed-visible black/white fallback. Returns the passed-in
42
+ * `background` reference unchanged on the primary path.
43
+ */
44
+ export declare function badgeTextColor<T extends Color>(accent: T, background: T): T | string;
45
+ export {};
46
+ //# sourceMappingURL=badge-contrast.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"badge-contrast.d.ts","sourceRoot":"","sources":["../../src/tui/badge-contrast.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,KAAK,KAAK,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAoC7D;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,KAAK,GAAG,MAAM,CAErD;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,GAAG,CAAC,GAAG,MAAM,CAMpF"}
package/package.json CHANGED
@@ -1,79 +1,80 @@
1
1
  {
2
- "name": "@wolfx/opencode-magic-context",
3
- "version": "0.27.2",
4
- "type": "module",
5
- "description": "OpenCode plugin for Magic Context — cross-session memory and context management",
6
- "main": "dist/index.js",
7
- "types": "dist/index.d.ts",
8
- "author": "ualtinok",
9
- "license": "MIT",
10
- "keywords": [
11
- "opencode",
12
- "plugin",
13
- "context",
14
- "memory",
15
- "ai",
16
- "llm",
17
- "prompt-caching",
18
- "session-history"
19
- ],
20
- "repository": {
21
- "type": "git",
22
- "url": "https://github.com/cortexkit/magic-context",
23
- "directory": "packages/plugin"
24
- },
25
- "files": [
26
- "dist",
27
- "src/tui",
28
- "src/shared",
29
- "README.md"
30
- ],
31
- "scripts": {
32
- "build": "bun build src/index.ts --outdir dist --target node --format esm --external @opencode-ai/plugin --external bun:sqlite --external node:sqlite && tsc --emitDeclarationOnly",
33
- "typecheck": "tsc --noEmit && tsc -p tsconfig.scripts.json",
34
- "test": "bun test",
35
- "lint": "biome check .",
36
- "lint:fix": "biome check --write .",
37
- "format": "biome format --write .",
38
- "format:check": "biome format .",
39
- "clean": "rm -rf dist",
40
- "prepublishOnly": "bun run build"
41
- },
42
- "dependencies": {
43
- "@jitl/quickjs-singlefile-cjs-release-asyncify": "0.32.0",
44
- "@opencode-ai/plugin": "^1.15.13",
45
- "@opencode-ai/sdk": "^1.15.13",
46
- "@opentui/core": "^0.4.2",
47
- "@opentui/solid": "^0.4.2",
48
- "ai-tokenizer": "^1.0.6",
49
- "comment-json": "^4.2.5",
50
- "quickjs-emscripten": "^0.32.0",
51
- "solid-js": "1.9.12",
52
- "zod": "^4.1.8"
53
- },
54
- "devDependencies": {
55
- "@biomejs/biome": "^2.4.7",
56
- "@types/better-sqlite3": "^7.6.13",
57
- "@types/bun": "^1.3.10",
58
- "@types/node": "^22.0.0",
59
- "bun-types": "^1.3.10",
60
- "typescript": "^5.8.0"
61
- },
62
- "exports": {
63
- ".": {
64
- "types": "./dist/index.d.ts",
65
- "import": "./dist/index.js"
66
- },
67
- "./tui": {
68
- "types": "./src/tui/index.tsx",
69
- "import": "./src/tui/index.tsx"
70
- }
71
- },
72
- "oc-plugin": [
73
- "server",
74
- "tui"
75
- ],
76
- "peerDependencies": {
77
- "@opencode-ai/plugin": ">=1.15.0"
78
- }
2
+ "name": "@wolfx/opencode-magic-context",
3
+ "version": "0.30.1",
4
+ "type": "module",
5
+ "description": "OpenCode plugin for Magic Context — cross-session memory and context management",
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "author": "ualtinok",
9
+ "license": "MIT",
10
+ "keywords": [
11
+ "opencode",
12
+ "plugin",
13
+ "context",
14
+ "memory",
15
+ "ai",
16
+ "llm",
17
+ "prompt-caching",
18
+ "session-history"
19
+ ],
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "https://github.com/cortexkit/magic-context",
23
+ "directory": "packages/plugin"
24
+ },
25
+ "files": [
26
+ "dist",
27
+ "src/tui",
28
+ "src/shared",
29
+ "README.md"
30
+ ],
31
+ "scripts": {
32
+ "build": "bun build src/index.ts --outdir dist --target node --format esm --external @opencode-ai/plugin --external bun:sqlite --external node:sqlite && tsc --emitDeclarationOnly",
33
+ "typecheck": "tsc --noEmit && tsc -p tsconfig.scripts.json",
34
+ "test": "bun test",
35
+ "lint": "biome check .",
36
+ "lint:fix": "biome check --write .",
37
+ "format": "biome format --write .",
38
+ "format:check": "biome format .",
39
+ "clean": "rm -rf dist",
40
+ "prepublishOnly": "bun run build"
41
+ },
42
+ "dependencies": {
43
+ "@huggingface/transformers": "^4.1.0",
44
+ "@jitl/quickjs-singlefile-cjs-release-asyncify": "0.32.0",
45
+ "@opencode-ai/plugin": "^1.17.11",
46
+ "@opencode-ai/sdk": "^1.17.11",
47
+ "@opentui/core": "^0.4.2",
48
+ "@opentui/solid": "^0.4.2",
49
+ "ai-tokenizer": "^1.0.6",
50
+ "comment-json": "^5.0.0",
51
+ "quickjs-emscripten": "^0.32.0",
52
+ "solid-js": "1.9.12",
53
+ "zod": "^4.1.8"
54
+ },
55
+ "devDependencies": {
56
+ "@biomejs/biome": "^2.5.1",
57
+ "@types/better-sqlite3": "^7.6.13",
58
+ "@types/bun": "^1.3.10",
59
+ "@types/node": "^22.20.0",
60
+ "bun-types": "^1.3.10",
61
+ "typescript": "^5.8.0"
62
+ },
63
+ "exports": {
64
+ ".": {
65
+ "types": "./dist/index.d.ts",
66
+ "import": "./dist/index.js"
67
+ },
68
+ "./tui": {
69
+ "types": "./src/tui/index.tsx",
70
+ "import": "./src/tui/index.tsx"
71
+ }
72
+ },
73
+ "oc-plugin": [
74
+ "server",
75
+ "tui"
76
+ ],
77
+ "peerDependencies": {
78
+ "@opencode-ai/plugin": ">=1.15.0"
79
+ }
79
80
  }
@@ -37,18 +37,14 @@ import { getMagicContextStorageDir } from "./data-path";
37
37
  * Bump only when there are user-visible changes worth a startup dialog.
38
38
  * Does NOT need to match the published package version.
39
39
  */
40
- export const ANNOUNCEMENT_VERSION = "0.27.0";
40
+ export const ANNOUNCEMENT_VERSION = "0.30.1";
41
41
 
42
42
  /**
43
43
  * Short, user-facing bullet strings. Keep each line ~80 chars or shorter so the
44
44
  * TUI dialog renders cleanly without horizontal scroll on a typical terminal.
45
45
  */
46
46
  export const ANNOUNCEMENT_FEATURES: ReadonlyArray<string> = [
47
- "Dreamer V2: each maintenance task now runs on its own schedule (cron), with its own model. Configure them in setup, the dashboard, or magic-context.jsonc.",
48
- "New 'classify' task scores each memory's importance so the most relevant stay in context as your work shifts; new 'retrospective' learns from moments you had to correct or re-explain. Both cache-safe, on by default, off anytime.",
49
- "New Primers: durable answers to the questions that keep coming up about your project, kept current by the dreamer investigating the actual code.",
50
- "Embedding storage no longer wipes your vectors when you change model or endpoint. Different models now coexist, so switching providers keeps your existing vectors.",
51
- "Config moved to a shared CortexKit location (~/.config/cortexkit/ and <project>/.cortexkit/). This happens automatically on first run; your old file is preserved.",
47
+ "Local embeddings work on OpenCode Desktop again (#195): /ctx-embed no longer fails with 'Unsupported device: cpu' on the Desktop app.",
52
48
  ];
53
49
 
54
50
  /**
@@ -0,0 +1,63 @@
1
+ /// <reference types="bun-types" />
2
+
3
+ import { describe, expect, it } from "bun:test";
4
+ import {
5
+ COMMIT_HASH_TEST_PATTERN,
6
+ COMMIT_VERB_PATTERN,
7
+ createCommitHashExtractPattern,
8
+ textMentionsRecentCommit,
9
+ } from "./commit-detection";
10
+
11
+ describe("textMentionsRecentCommit", () => {
12
+ it("fires on a hash + commit-action verb in the same text", () => {
13
+ expect(textMentionsRecentCommit("Committed abc1234 with the fix")).toBe(true);
14
+ expect(textMentionsRecentCommit("merged a1b2c3d into main")).toBe(true);
15
+ expect(textMentionsRecentCommit("rebased onto feedb4d cleanly")).toBe(true);
16
+ expect(textMentionsRecentCommit("cherry-picked deadbeef")).toBe(true);
17
+ });
18
+
19
+ it("does NOT fire on a hash alone, or the bare word 'hash'/'sha' + hex", () => {
20
+ expect(textMentionsRecentCommit("the value is abc1234")).toBe(false);
21
+ // 'hash'/'sha' are intentionally NOT commit-action verbs (parity contract).
22
+ expect(textMentionsRecentCommit("hash is abc1234567")).toBe(false);
23
+ expect(textMentionsRecentCommit("sha abc1234")).toBe(false);
24
+ });
25
+
26
+ it("does NOT fire on a verb alone (no hash)", () => {
27
+ expect(textMentionsRecentCommit("I will commit later")).toBe(false);
28
+ });
29
+
30
+ it("respects the 7-12 hex length bound", () => {
31
+ expect(textMentionsRecentCommit("committed abc12")).toBe(false); // too short
32
+ expect(textMentionsRecentCommit("committed abc1234567890abcdef")).toBe(false); // too long
33
+ });
34
+
35
+ it("does not match commit-ish words that are not commit actions", () => {
36
+ expect(COMMIT_VERB_PATTERN.test("commitment to abc1234")).toBe(false);
37
+ expect(COMMIT_VERB_PATTERN.test("a merger of abc1234")).toBe(false);
38
+ });
39
+ });
40
+
41
+ describe("shared regex instances are stateless across calls", () => {
42
+ it("COMMIT_HASH_TEST_PATTERN.test is repeatable (non-global)", () => {
43
+ expect(COMMIT_HASH_TEST_PATTERN.test("abc1234")).toBe(true);
44
+ expect(COMMIT_HASH_TEST_PATTERN.test("abc1234")).toBe(true); // no lastIndex drift
45
+ });
46
+
47
+ it("createCommitHashExtractPattern returns a fresh global regex each call", () => {
48
+ const a = createCommitHashExtractPattern();
49
+ const b = createCommitHashExtractPattern();
50
+ expect(a).not.toBe(b);
51
+ expect(a.global).toBe(true);
52
+ });
53
+ });
54
+
55
+ describe("createCommitHashExtractPattern (historian extraction)", () => {
56
+ it("captures backtick-wrapped and bare hashes, deduped via matchAll", () => {
57
+ const text = "Committed `abc1234` and def5678, also abc1234 again";
58
+ const found = [...text.matchAll(createCommitHashExtractPattern())].map((m) =>
59
+ m[1]?.toLowerCase(),
60
+ );
61
+ expect(found).toEqual(["abc1234", "def5678", "abc1234"]);
62
+ });
63
+ });
@@ -0,0 +1,53 @@
1
+ // Canonical commit-detection patterns — the SINGLE source of truth shared by:
2
+ // - the historian commit-cluster trigger + summary hash extraction
3
+ // (read-session-formatting.ts),
4
+ // - the OpenCode note-nudge `commit_detected` boundary (tag-messages.ts),
5
+ // - the Pi note-nudge detector (detect-recent-commit.ts).
6
+ //
7
+ // These three previously each carried their own hash/verb regexes that had
8
+ // drifted (hash length 6 vs 7; verb sets {hash, sha} vs {merge, rebas}). Keeping
9
+ // them here stops that drift: change the patterns once and every site follows.
10
+ //
11
+ // All three sites look for a short git hash AND a commit-related word in the
12
+ // SAME assistant text part — the pairing is what keeps false positives low.
13
+
14
+ /** A short git hash: 7-12 hex chars (git's default abbreviated hash is 7).
15
+ * 6 was too loose — more random-hex false positives. */
16
+ const HASH_HEX = "[0-9a-f]{7,12}";
17
+
18
+ /**
19
+ * Boolean hash test. Non-global (stateless), so this single instance is safe to
20
+ * reuse with `.test()` across call sites — only `/g` regexes carry `lastIndex`.
21
+ */
22
+ export const COMMIT_HASH_TEST_PATTERN = new RegExp(`\\b${HASH_HEX}\\b`, "i");
23
+
24
+ /**
25
+ * Commit-ACTION verbs, with common inflections, each fully word-boundary-anchored
26
+ * (so they don't match e.g. "commitment"/"merger"). Non-global → safe to share.
27
+ *
28
+ * Scope decision: this is the commit-action set the OpenCode + Pi note-nudge
29
+ * detectors used and pin in tests ("commit/cherry-pick/merge/rebase"). It does
30
+ * NOT include the bare nouns "hash"/"sha" that the historian's old hint regex
31
+ * carried — a parity test asserts "hash <hex>" alone must NOT count as a commit,
32
+ * and those nouns only ever gated a cosmetic hash-strip in historian summaries
33
+ * (never a trigger), so unifying to the action set is behavior-preserving where
34
+ * it matters.
35
+ */
36
+ export const COMMIT_VERB_PATTERN =
37
+ /\b(?:commit(?:ted|ting|s)?|cherry-?pick(?:ed|ing|s)?|merge[ds]?|merging|rebas(?:e|ed|es|ing))\b/i;
38
+
39
+ /** True when a text part mentions a commit hash in a commit context. Used by the
40
+ * OpenCode + Pi note-nudge detectors. */
41
+ export function textMentionsRecentCommit(text: string): boolean {
42
+ return COMMIT_HASH_TEST_PATTERN.test(text) && COMMIT_VERB_PATTERN.test(text);
43
+ }
44
+
45
+ /**
46
+ * Fresh `/g` capturing, backtick-aware hash pattern for the historian's
47
+ * extract-and-strip path (matchAll + replace). Returned as a NEW instance per
48
+ * call: a `/g` regex carries `lastIndex`, so handing out a fresh one is
49
+ * bulletproof against accidental `.exec()` reuse across callers.
50
+ */
51
+ export function createCommitHashExtractPattern(): RegExp {
52
+ return new RegExp(`\`?\\b(${HASH_HEX})\\b\`?`, "gi");
53
+ }
@@ -0,0 +1,50 @@
1
+ import { describe, expect, it } from "bun:test";
2
+ import { registerExitAbort, unregisterExitAbort } from "./exit-abort-registry";
3
+
4
+ // Captured before any registration so we can isolate the ONE listener the
5
+ // registry installs process-wide (it intentionally never removes it, mirroring
6
+ // production, so the suite must not strip it either).
7
+ const baseline = process.listenerCount("exit");
8
+
9
+ /** The registry's single 'exit' listener (the first one added past baseline). */
10
+ function registryListener(): () => void {
11
+ return process.listeners("exit").slice(baseline)[0] as () => void;
12
+ }
13
+
14
+ describe("exit-abort-registry", () => {
15
+ it("adds exactly ONE process exit listener no matter how many controllers register", () => {
16
+ registerExitAbort(new AbortController());
17
+ registerExitAbort(new AbortController());
18
+ registerExitAbort(new AbortController());
19
+ expect(process.listenerCount("exit") - baseline).toBe(1);
20
+ });
21
+
22
+ it("aborts every registered controller when the exit listener fires", () => {
23
+ const a = new AbortController();
24
+ const b = new AbortController();
25
+ registerExitAbort(a);
26
+ registerExitAbort(b);
27
+
28
+ // Invoke the registry's listener directly (emitting 'exit' would end the
29
+ // test process).
30
+ registryListener()();
31
+
32
+ expect(a.signal.aborted).toBe(true);
33
+ expect(b.signal.aborted).toBe(true);
34
+ // Still exactly one listener after firing.
35
+ expect(process.listenerCount("exit") - baseline).toBe(1);
36
+ });
37
+
38
+ it("does not abort a controller that was unregistered before exit", () => {
39
+ const keep = new AbortController();
40
+ const drop = new AbortController();
41
+ registerExitAbort(keep);
42
+ registerExitAbort(drop);
43
+ unregisterExitAbort(drop);
44
+
45
+ registryListener()();
46
+
47
+ expect(keep.signal.aborted).toBe(true);
48
+ expect(drop.signal.aborted).toBe(false);
49
+ });
50
+ });