@theokit/sdk 5.6.0 → 5.7.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/CHANGELOG.md +66 -0
- package/dist/{agent-G6g-uwcB.d.ts → agent-Bqzdhkqr.d.ts} +1 -1
- package/dist/{agent-82d_DrCL.d.cts → agent-Dya5SmhY.d.cts} +1 -1
- package/dist/{agent-JJZM2VIK.js → agent-EQ5HKTWV.js} +11 -10
- package/dist/{agent-JJZM2VIK.js.map → agent-EQ5HKTWV.js.map} +1 -1
- package/dist/{agent-47NS6ZVL.cjs → agent-KA63WDQH.cjs} +12 -11
- package/dist/{agent-47NS6ZVL.cjs.map → agent-KA63WDQH.cjs.map} +1 -1
- package/dist/agent.d.ts +11 -0
- package/dist/{chunk-VUHXC74Q.cjs → chunk-33A27NFX.cjs} +15 -15
- package/dist/{chunk-VUHXC74Q.cjs.map → chunk-33A27NFX.cjs.map} +1 -1
- package/dist/{chunk-HUDNLFY4.js → chunk-3VXQEQE4.js} +13 -4
- package/dist/chunk-3VXQEQE4.js.map +1 -0
- package/dist/{chunk-DZG77WU7.cjs → chunk-3XSWF5AP.cjs} +3 -3
- package/dist/{chunk-DZG77WU7.cjs.map → chunk-3XSWF5AP.cjs.map} +1 -1
- package/dist/{chunk-FPIY5CLV.js → chunk-6JG2RFGK.js} +3 -3
- package/dist/{chunk-FPIY5CLV.js.map → chunk-6JG2RFGK.js.map} +1 -1
- package/dist/{chunk-N2KAIZ5D.js → chunk-7C3HWGCW.js} +3 -19
- package/dist/chunk-7C3HWGCW.js.map +1 -0
- package/dist/{chunk-LD6HASA5.cjs → chunk-7KBNBPFK.cjs} +12 -2
- package/dist/chunk-7KBNBPFK.cjs.map +1 -0
- package/dist/{chunk-GCHZMH42.cjs → chunk-A575WPBL.cjs} +88 -84
- package/dist/chunk-A575WPBL.cjs.map +1 -0
- package/dist/{chunk-5NELQ6LB.js → chunk-A6PDYH55.js} +12 -3
- package/dist/chunk-A6PDYH55.js.map +1 -0
- package/dist/{chunk-2QKV4CGK.js → chunk-CZWN4C6A.js} +3 -3
- package/dist/{chunk-2QKV4CGK.js.map → chunk-CZWN4C6A.js.map} +1 -1
- package/dist/chunk-DQNI52VV.js +20 -0
- package/dist/chunk-DQNI52VV.js.map +1 -0
- package/dist/{chunk-52FDUJSV.cjs → chunk-E6QXZZKE.cjs} +8 -8
- package/dist/{chunk-52FDUJSV.cjs.map → chunk-E6QXZZKE.cjs.map} +1 -1
- package/dist/{chunk-EIOMN5VA.cjs → chunk-EFETPSJZ.cjs} +17 -8
- package/dist/chunk-EFETPSJZ.cjs.map +1 -0
- package/dist/{chunk-HG4UN4MN.cjs → chunk-ER5BOIYD.cjs} +4 -4
- package/dist/{chunk-HG4UN4MN.cjs.map → chunk-ER5BOIYD.cjs.map} +1 -1
- package/dist/{chunk-2UXQASTX.js → chunk-FUUSIT2T.js} +16 -12
- package/dist/chunk-FUUSIT2T.js.map +1 -0
- package/dist/{chunk-7IZKTQ5G.cjs → chunk-GK3UG7YQ.cjs} +2 -21
- package/dist/chunk-GK3UG7YQ.cjs.map +1 -0
- package/dist/{chunk-GFFBXSQT.cjs → chunk-HNAYCTX4.cjs} +5 -5
- package/dist/{chunk-GFFBXSQT.cjs.map → chunk-HNAYCTX4.cjs.map} +1 -1
- package/dist/{chunk-KZSKIUXZ.js → chunk-N7VAE6DZ.js} +31 -3
- package/dist/chunk-N7VAE6DZ.js.map +1 -0
- package/dist/{chunk-7MMTZBTT.js → chunk-P5S3WCSZ.js} +3 -3
- package/dist/{chunk-7MMTZBTT.js.map → chunk-P5S3WCSZ.js.map} +1 -1
- package/dist/{chunk-BZ3YMAMP.js → chunk-R3LBRQAN.js} +3 -3
- package/dist/{chunk-BZ3YMAMP.js.map → chunk-R3LBRQAN.js.map} +1 -1
- package/dist/{chunk-STGSMJMJ.js → chunk-YRLI5DVC.js} +3 -3
- package/dist/{chunk-STGSMJMJ.js.map → chunk-YRLI5DVC.js.map} +1 -1
- package/dist/chunk-YYN6BB7R.cjs +24 -0
- package/dist/chunk-YYN6BB7R.cjs.map +1 -0
- package/dist/{chunk-C4ZQPWXJ.cjs → chunk-ZLMU5EU3.cjs} +33 -4
- package/dist/chunk-ZLMU5EU3.cjs.map +1 -0
- package/dist/{compact-session-7FMYJXQ7.cjs → compact-session-75KD2FCM.cjs} +15 -11
- package/dist/{compact-session-7FMYJXQ7.cjs.map → compact-session-75KD2FCM.cjs.map} +1 -1
- package/dist/{compact-session-YSEK7NQF.js → compact-session-QT6RJOKO.js} +3 -3
- package/dist/{compact-session-YSEK7NQF.js.map → compact-session-QT6RJOKO.js.map} +1 -1
- package/dist/context/index.cjs +11 -7
- package/dist/context/index.cjs.map +1 -1
- package/dist/context/index.js +7 -3
- package/dist/context/index.js.map +1 -1
- package/dist/{context-HR4KMXMA.cjs → context-7RP5JXGM.cjs} +7 -6
- package/dist/{context-HR4KMXMA.cjs.map → context-7RP5JXGM.cjs.map} +1 -1
- package/dist/context-OJIIXJCV.js +7 -0
- package/dist/{context-J5BJ3LBS.js.map → context-OJIIXJCV.js.map} +1 -1
- package/dist/{cron-DWv69ZSD.d.cts → cron-BwxDUscv.d.cts} +1 -1
- package/dist/{cron-GynWtAax.d.ts → cron-D8uB1Xh5.d.ts} +1 -1
- package/dist/cron.cjs +11 -10
- package/dist/cron.d.cts +2 -2
- package/dist/cron.d.ts +2 -2
- package/dist/cron.js +10 -9
- package/dist/eval.cjs +10 -9
- package/dist/eval.cjs.map +1 -1
- package/dist/eval.js +9 -8
- package/dist/eval.js.map +1 -1
- package/dist/{index-manager-BBHDKMQS.cjs → index-manager-W7RHSL6G.cjs} +6 -6
- package/dist/{index-manager-BBHDKMQS.cjs.map → index-manager-W7RHSL6G.cjs.map} +1 -1
- package/dist/{index-manager-27WLNQEE.js → index-manager-Z4XMRVWQ.js} +5 -5
- package/dist/{index-manager-27WLNQEE.js.map → index-manager-Z4XMRVWQ.js.map} +1 -1
- package/dist/index.cjs +42 -41
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +32 -3
- package/dist/index.d.ts +32 -3
- package/dist/index.js +14 -13
- package/dist/index.js.map +1 -1
- package/dist/{inject-session-PC73TMP2.cjs → inject-session-L6MIIELT.cjs} +4 -4
- package/dist/{inject-session-PC73TMP2.cjs.map → inject-session-L6MIIELT.cjs.map} +1 -1
- package/dist/{inject-session-J4LBWAPH.js → inject-session-XWWN4DAA.js} +3 -3
- package/dist/{inject-session-J4LBWAPH.js.map → inject-session-XWWN4DAA.js.map} +1 -1
- package/dist/internal/memory/storage/index.cjs +32 -32
- package/dist/internal/memory/storage/index.js +3 -3
- package/dist/internal/runtime/context/context-discovery.d.ts +27 -0
- package/dist/internal/session/compact-session.d.ts +36 -0
- package/dist/project.cjs +3 -3
- package/dist/project.js +1 -1
- package/dist/subagents-loader.d.cts +1 -1
- package/dist/subagents-loader.d.ts +1 -1
- package/dist/types/agent.d.ts +1 -1
- package/package.json +1 -1
- package/dist/chunk-2UXQASTX.js.map +0 -1
- package/dist/chunk-5NELQ6LB.js.map +0 -1
- package/dist/chunk-7IZKTQ5G.cjs.map +0 -1
- package/dist/chunk-C4ZQPWXJ.cjs.map +0 -1
- package/dist/chunk-EIOMN5VA.cjs.map +0 -1
- package/dist/chunk-GCHZMH42.cjs.map +0 -1
- package/dist/chunk-HUDNLFY4.js.map +0 -1
- package/dist/chunk-KZSKIUXZ.js.map +0 -1
- package/dist/chunk-LD6HASA5.cjs.map +0 -1
- package/dist/chunk-N2KAIZ5D.js.map +0 -1
- package/dist/context-J5BJ3LBS.js +0 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,71 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 5.7.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#675](https://github.com/usetheokit/theokit-sdk/pull/675) [`cbbed19`](https://github.com/usetheokit/theokit-sdk/commit/cbbed19abff45b58c10de1bf694524fbd246d6c2) Thanks [@usetheodev](https://github.com/usetheodev)! - A repo-root instruction file now requires a grant a consumer can write.
|
|
8
|
+
|
|
9
|
+
`DEFAULT_DISCOVERY_SPECS` carries four repo-root instruction files whose bodies enter the system
|
|
10
|
+
prompt as if we had written them — `AGENTS.md`, `GEMINI.md`, `CLAUDE.md` and `.cursor/rules/*.mdc`.
|
|
11
|
+
Until now exactly ONE spec in that file carried a gate, and it was `.claude/rules/*.md`. A cloned
|
|
12
|
+
repository's `.claude/rules/*.md` needed a declaration; the `CLAUDE.md` one directory up did not,
|
|
13
|
+
while both carried the same risk.
|
|
14
|
+
|
|
15
|
+
**The vocabulary landed before the gate, and the order is the whole point.** `CompatSource` went
|
|
16
|
+
from two literals to five:
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
compatSources: ["agents"] // AGENTS.md is admitted; GEMINI.md is not
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Gating the four against the OLD union would have gated three formats on a grant nobody could write
|
|
23
|
+
and made them permanently unreachable — worse than the gap. A test asserts the invariant in both
|
|
24
|
+
directions and fails the moment a spec is gated on a token the union does not carry.
|
|
25
|
+
|
|
26
|
+
**Separate literals, not one `foreign` token**, so a consumer who wants `AGENTS.md` is not forced to
|
|
27
|
+
also admit `.cursor/rules/*.mdc`.
|
|
28
|
+
|
|
29
|
+
**BREAKING for a consumer who declares nothing**: they went from four repo-root files in the prompt
|
|
30
|
+
to none. That is the intended behaviour and it is LOUD — `withheldSpecs` reports every withheld file
|
|
31
|
+
by path with the grant that restores it, and the runner warns once naming each one. A count would be
|
|
32
|
+
a diagnosis with no remedy: you cannot decide whether to grant a dialect without knowing which file
|
|
33
|
+
it brings.
|
|
34
|
+
|
|
35
|
+
`undefined` and `[]` stay distinct: no gate configured admits everything, an empty declaration
|
|
36
|
+
withholds every gated spec. Collapsing them would restore the defect the first gate closed.
|
|
37
|
+
|
|
38
|
+
- [#675](https://github.com/usetheokit/theokit-sdk/pull/675) [`de40d9f`](https://github.com/usetheokit/theokit-sdk/commit/de40d9f3d398f84d5b145cec8bc56a4c6ec85a25) Thanks [@usetheodev](https://github.com/usetheodev)! - The pre-compaction seam now reaches the compaction path a consumer actually calls.
|
|
39
|
+
|
|
40
|
+
There are three compaction paths in this ecosystem. `withPreCompaction`, shipped in
|
|
41
|
+
`@theokit/agents@14.1.0`, covers one of them — the agents-layer strategy. The other two are
|
|
42
|
+
`autoCompactIfNeeded` and `Agent.compact(sessionId, { trigger })`, and **the second is the one a
|
|
43
|
+
person reaches**: `/compact` → `handleCompact` → `compactSession` → `Agent.compact`.
|
|
44
|
+
|
|
45
|
+
```ts
|
|
46
|
+
await Agent.compact(agentId, {
|
|
47
|
+
trigger: "manual",
|
|
48
|
+
onPreCompact: async ({ messages, trigger, signal }) => {
|
|
49
|
+
await archive(messages, { because: trigger }) // runs BEFORE the transcript is rewritten
|
|
50
|
+
},
|
|
51
|
+
onPreCompactError: (e) => report(e), // compaction proceeds either way
|
|
52
|
+
})
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
**One seam covers both SDK paths** because they converge on `compactSessionTranscript`. A seam per
|
|
56
|
+
caller would need each one to choose, and a caller that chooses wrong reintroduces the gap.
|
|
57
|
+
|
|
58
|
+
**`trigger` is received, not inferred.** It already existed in the options and already reached the
|
|
59
|
+
compaction boundary; the handler is simply told. Inferring it from the call site would be right today
|
|
60
|
+
and silently wrong the first time a third caller appears.
|
|
61
|
+
|
|
62
|
+
**Failure never blocks compaction.** A handler that throws is reported; one that exceeds its bound is
|
|
63
|
+
abandoned with its `AbortSignal` aborted first, so it can stop rather than be left running. A hook
|
|
64
|
+
that could block would turn a consumer's bug into a runtime that cannot reclaim its context.
|
|
65
|
+
|
|
66
|
+
**Nothing changes for a consumer who registers nothing** — the seam is not entered, asserted by a
|
|
67
|
+
test rather than left as an inference.
|
|
68
|
+
|
|
3
69
|
## 5.6.0
|
|
4
70
|
|
|
5
71
|
### Minor Changes
|
|
@@ -1046,7 +1046,7 @@ type SettingSource = "project" | "user" | "team" | "mdm" | "plugins" | "all";
|
|
|
1046
1046
|
*
|
|
1047
1047
|
* @public
|
|
1048
1048
|
*/
|
|
1049
|
-
type CompatSource = "claude-code" | "theokit" | CompatSourceAdapter;
|
|
1049
|
+
type CompatSource = "claude-code" | "theokit" | "agents" | "gemini" | "cursor" | CompatSourceAdapter;
|
|
1050
1050
|
/**
|
|
1051
1051
|
* A surface a foreign configuration source may be admitted to.
|
|
1052
1052
|
*
|
|
@@ -1046,7 +1046,7 @@ type SettingSource = "project" | "user" | "team" | "mdm" | "plugins" | "all";
|
|
|
1046
1046
|
*
|
|
1047
1047
|
* @public
|
|
1048
1048
|
*/
|
|
1049
|
-
type CompatSource = "claude-code" | "theokit" | CompatSourceAdapter;
|
|
1049
|
+
type CompatSource = "claude-code" | "theokit" | "agents" | "gemini" | "cursor" | CompatSourceAdapter;
|
|
1050
1050
|
/**
|
|
1051
1051
|
* A surface a foreign configuration source may be admitted to.
|
|
1052
1052
|
*
|
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
export { Agent } from './chunk-
|
|
1
|
+
export { Agent } from './chunk-FUUSIT2T.js';
|
|
2
2
|
import './chunk-K2VMFZQ5.js';
|
|
3
|
-
import './chunk-
|
|
3
|
+
import './chunk-CZWN4C6A.js';
|
|
4
4
|
import './chunk-K2BQQ445.js';
|
|
5
|
-
import './chunk-
|
|
6
|
-
import './chunk-
|
|
5
|
+
import './chunk-P5S3WCSZ.js';
|
|
6
|
+
import './chunk-DQNI52VV.js';
|
|
7
7
|
import './chunk-2SFBB54R.js';
|
|
8
8
|
import './chunk-55GB6JYQ.js';
|
|
9
9
|
import './chunk-H73MEMQB.js';
|
|
10
10
|
import './chunk-OR6XIWLB.js';
|
|
11
|
-
import './chunk-
|
|
11
|
+
import './chunk-R3LBRQAN.js';
|
|
12
12
|
import './chunk-AAEZSPTC.js';
|
|
13
|
-
import './chunk-
|
|
13
|
+
import './chunk-N7VAE6DZ.js';
|
|
14
14
|
import './chunk-UBR5PWD7.js';
|
|
15
15
|
import './chunk-2XC6KDJM.js';
|
|
16
16
|
import './chunk-XB4GI5RZ.js';
|
|
17
17
|
import './chunk-24MGQDK3.js';
|
|
18
18
|
import './chunk-2WXHA33T.js';
|
|
19
19
|
import './chunk-HKCKOAIO.js';
|
|
20
|
-
import './chunk-
|
|
20
|
+
import './chunk-3VXQEQE4.js';
|
|
21
|
+
import './chunk-7C3HWGCW.js';
|
|
21
22
|
import './chunk-KVNWIAO4.js';
|
|
22
23
|
import './chunk-SVQIW5RJ.js';
|
|
23
24
|
import './chunk-FD2UT76F.js';
|
|
@@ -27,7 +28,7 @@ import './chunk-NAF4L3T6.js';
|
|
|
27
28
|
import './chunk-CFE6QF2Q.js';
|
|
28
29
|
import './chunk-6X6ID4MO.js';
|
|
29
30
|
import './chunk-CA5VUAP3.js';
|
|
30
|
-
import './chunk-
|
|
31
|
+
import './chunk-A6PDYH55.js';
|
|
31
32
|
import './chunk-SAGRF4IB.js';
|
|
32
33
|
import './chunk-EH6XD3FY.js';
|
|
33
34
|
import './chunk-UKMBRMGT.js';
|
|
@@ -54,5 +55,5 @@ import './chunk-V22DZIXO.js';
|
|
|
54
55
|
import './chunk-NJWYQWDL.js';
|
|
55
56
|
import './chunk-ALUN2B4W.js';
|
|
56
57
|
import './chunk-CZJ6Q7CW.js';
|
|
57
|
-
//# sourceMappingURL=agent-
|
|
58
|
-
//# sourceMappingURL=agent-
|
|
58
|
+
//# sourceMappingURL=agent-EQ5HKTWV.js.map
|
|
59
|
+
//# sourceMappingURL=agent-EQ5HKTWV.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"agent-
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"agent-EQ5HKTWV.js"}
|
|
@@ -1,25 +1,26 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkA575WPBL_cjs = require('./chunk-A575WPBL.cjs');
|
|
4
4
|
require('./chunk-KVSAY6NZ.cjs');
|
|
5
|
-
require('./chunk-
|
|
5
|
+
require('./chunk-3XSWF5AP.cjs');
|
|
6
6
|
require('./chunk-BUUUWQMB.cjs');
|
|
7
|
-
require('./chunk-
|
|
8
|
-
require('./chunk-
|
|
7
|
+
require('./chunk-33A27NFX.cjs');
|
|
8
|
+
require('./chunk-YYN6BB7R.cjs');
|
|
9
9
|
require('./chunk-BV2MWEMV.cjs');
|
|
10
10
|
require('./chunk-D6POWE7E.cjs');
|
|
11
11
|
require('./chunk-GHX4P3V2.cjs');
|
|
12
12
|
require('./chunk-TMKTSYDS.cjs');
|
|
13
|
-
require('./chunk-
|
|
13
|
+
require('./chunk-HNAYCTX4.cjs');
|
|
14
14
|
require('./chunk-7FDKWDA2.cjs');
|
|
15
|
-
require('./chunk-
|
|
15
|
+
require('./chunk-ZLMU5EU3.cjs');
|
|
16
16
|
require('./chunk-FUSDYC2B.cjs');
|
|
17
17
|
require('./chunk-YJNYDJ2T.cjs');
|
|
18
18
|
require('./chunk-24SYBZPL.cjs');
|
|
19
19
|
require('./chunk-QOGNZMHD.cjs');
|
|
20
20
|
require('./chunk-YIFFF23U.cjs');
|
|
21
21
|
require('./chunk-2ZPEDVLM.cjs');
|
|
22
|
-
require('./chunk-
|
|
22
|
+
require('./chunk-EFETPSJZ.cjs');
|
|
23
|
+
require('./chunk-GK3UG7YQ.cjs');
|
|
23
24
|
require('./chunk-KRD3GQAA.cjs');
|
|
24
25
|
require('./chunk-RQMCOFAI.cjs');
|
|
25
26
|
require('./chunk-MUUQ2WFJ.cjs');
|
|
@@ -29,7 +30,7 @@ require('./chunk-FRITRLZQ.cjs');
|
|
|
29
30
|
require('./chunk-NQTD6QOW.cjs');
|
|
30
31
|
require('./chunk-NINIJCHU.cjs');
|
|
31
32
|
require('./chunk-MYJGWS2J.cjs');
|
|
32
|
-
require('./chunk-
|
|
33
|
+
require('./chunk-7KBNBPFK.cjs');
|
|
33
34
|
require('./chunk-IJ7M6GOG.cjs');
|
|
34
35
|
require('./chunk-7A6535RA.cjs');
|
|
35
36
|
require('./chunk-SA6K24NB.cjs');
|
|
@@ -61,7 +62,7 @@ require('./chunk-6LHQPOMI.cjs');
|
|
|
61
62
|
|
|
62
63
|
Object.defineProperty(exports, "Agent", {
|
|
63
64
|
enumerable: true,
|
|
64
|
-
get: function () { return
|
|
65
|
+
get: function () { return chunkA575WPBL_cjs.Agent; }
|
|
65
66
|
});
|
|
66
|
-
//# sourceMappingURL=agent-
|
|
67
|
-
//# sourceMappingURL=agent-
|
|
67
|
+
//# sourceMappingURL=agent-KA63WDQH.cjs.map
|
|
68
|
+
//# sourceMappingURL=agent-KA63WDQH.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"agent-
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"agent-KA63WDQH.cjs"}
|
package/dist/agent.d.ts
CHANGED
|
@@ -219,6 +219,17 @@ export declare class Agent {
|
|
|
219
219
|
static compact(agentId: string, options?: {
|
|
220
220
|
trigger?: "manual" | "auto";
|
|
221
221
|
summarize?: (messages: readonly import("./compaction.js").CompressibleMessage[]) => Promise<string>;
|
|
222
|
+
/**
|
|
223
|
+
* B-082 — work to run before the transcript is rewritten, on THIS path.
|
|
224
|
+
*
|
|
225
|
+
* `/compact` reaches here, and before this option the seam existed only on the agents-layer
|
|
226
|
+
* strategy, which this path never touches. The handler is awaited, bounded, and its failure is
|
|
227
|
+
* reported without stopping compaction — the same contract `withPreCompaction` carries, not a
|
|
228
|
+
* second one.
|
|
229
|
+
*/
|
|
230
|
+
onPreCompact?: import("./internal/session/compact-session.js").PreCompactHandler;
|
|
231
|
+
onPreCompactError?: (error: unknown) => void;
|
|
232
|
+
preCompactTimeoutMs?: number;
|
|
222
233
|
}): Promise<import("./internal/session/compact-session.js").CompactResult>;
|
|
223
234
|
/**
|
|
224
235
|
* M51 — inject a SYNTHETIC user+assistant pair into a LOCAL session's persisted transcript WITHOUT
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunkGHX4P3V2_cjs = require('./chunk-GHX4P3V2.cjs');
|
|
4
|
-
var
|
|
4
|
+
var chunkHNAYCTX4_cjs = require('./chunk-HNAYCTX4.cjs');
|
|
5
5
|
var chunkA4RAL2ER_cjs = require('./chunk-A4RAL2ER.cjs');
|
|
6
6
|
var chunkJ7J7J2GN_cjs = require('./chunk-J7J7J2GN.cjs');
|
|
7
7
|
var chunk6LHQPOMI_cjs = require('./chunk-6LHQPOMI.cjs');
|
|
@@ -86,13 +86,13 @@ function findWordBoundarySplit(text, maxChars) {
|
|
|
86
86
|
|
|
87
87
|
// src/internal/memory/corpus-sync.ts
|
|
88
88
|
async function syncCorpus(repo, memoryRoot) {
|
|
89
|
-
const files = await
|
|
89
|
+
const files = await chunkHNAYCTX4_cjs.collectMarkdownFiles(memoryRoot);
|
|
90
90
|
const existingByPath = repo.filesByPath();
|
|
91
91
|
let filesUpdated = 0;
|
|
92
92
|
let chunksWritten = 0;
|
|
93
93
|
for (const entry of files) {
|
|
94
94
|
const raw = await promises.readFile(entry.absolutePath, "utf8");
|
|
95
|
-
const hash =
|
|
95
|
+
const hash = chunkHNAYCTX4_cjs.sha256(raw);
|
|
96
96
|
if (existingByPath.get(entry.absolutePath)?.hash === hash) continue;
|
|
97
97
|
const stats = await promises.stat(entry.absolutePath);
|
|
98
98
|
const fileId = repo.upsertFile({
|
|
@@ -156,7 +156,7 @@ var LanceMemoryAdapter = class {
|
|
|
156
156
|
limit: maxResults * 2,
|
|
157
157
|
...options.sources !== void 0 ? { sources: options.sources } : {}
|
|
158
158
|
});
|
|
159
|
-
return lanceHits.filter((h) => h.score >= minScore).slice(0, maxResults).map((h) => translateLanceHit(h, query,
|
|
159
|
+
return lanceHits.filter((h) => h.score >= minScore).slice(0, maxResults).map((h) => translateLanceHit(h, query, chunkHNAYCTX4_cjs.resolveWeights(options)));
|
|
160
160
|
}
|
|
161
161
|
status() {
|
|
162
162
|
return {
|
|
@@ -211,7 +211,7 @@ async function openLanceIndex(opts) {
|
|
|
211
211
|
{ code: "lance_requires_embedding" }
|
|
212
212
|
);
|
|
213
213
|
}
|
|
214
|
-
const lance = await
|
|
214
|
+
const lance = await chunkHNAYCTX4_cjs.LanceIndex.open({
|
|
215
215
|
cwd: opts.cwd,
|
|
216
216
|
embedding: opts.embedding,
|
|
217
217
|
...opts.filePath !== void 0 ? { storagePath: opts.filePath } : {}
|
|
@@ -414,9 +414,9 @@ var IndexManager = class _IndexManager {
|
|
|
414
414
|
}
|
|
415
415
|
/** Internal SQLite-path open. Renamed from previous public `open`. */
|
|
416
416
|
static async openSqliteInternal(opts) {
|
|
417
|
-
const memoryRoot = opts.memoryRoot ??
|
|
418
|
-
const filePath = opts.filePath ??
|
|
419
|
-
const db = await
|
|
417
|
+
const memoryRoot = opts.memoryRoot ?? chunkHNAYCTX4_cjs.resolveMemoryRoot(opts.cwd);
|
|
418
|
+
const filePath = opts.filePath ?? chunkHNAYCTX4_cjs.defaultIndexPath(chunkHNAYCTX4_cjs.memoryIndexRoot(opts.cwd, memoryRoot));
|
|
419
|
+
const db = await chunkHNAYCTX4_cjs.openMemoryDb({ filePath });
|
|
420
420
|
const manager = new _IndexManager(memoryRoot, db, opts.embedding);
|
|
421
421
|
if (opts.embedding !== void 0) await manager.initVectorBackend(opts.embedding);
|
|
422
422
|
return manager;
|
|
@@ -497,7 +497,7 @@ var IndexManager = class _IndexManager {
|
|
|
497
497
|
endLine,
|
|
498
498
|
score: textScore,
|
|
499
499
|
textScore,
|
|
500
|
-
snippet:
|
|
500
|
+
snippet: chunkHNAYCTX4_cjs.truncateSnippet(String(row.text ?? "")),
|
|
501
501
|
source: String(row.source),
|
|
502
502
|
citation: `${path}:${startLine}-${endLine}`,
|
|
503
503
|
// sneak the chunk id through for the hybrid join below
|
|
@@ -525,7 +525,7 @@ var IndexManager = class _IndexManager {
|
|
|
525
525
|
score: 0.5,
|
|
526
526
|
// LIKE has no relevance score — use a neutral midpoint
|
|
527
527
|
textScore: 0.5,
|
|
528
|
-
snippet:
|
|
528
|
+
snippet: chunkHNAYCTX4_cjs.truncateSnippet(String(row.text ?? "")),
|
|
529
529
|
source: String(row.source),
|
|
530
530
|
citation: `${path}:${startLine}-${endLine}`,
|
|
531
531
|
chunkId: Number(row.id)
|
|
@@ -548,10 +548,10 @@ var IndexManager = class _IndexManager {
|
|
|
548
548
|
return out;
|
|
549
549
|
}
|
|
550
550
|
combineHybridScores(textHits, vectorHitsById, options) {
|
|
551
|
-
const weights =
|
|
551
|
+
const weights = chunkHNAYCTX4_cjs.resolveWeights(options);
|
|
552
552
|
const merged = this.mergeHits(textHits, vectorHitsById);
|
|
553
553
|
const combined = [...merged.values()].map(
|
|
554
|
-
(hit) =>
|
|
554
|
+
(hit) => chunkHNAYCTX4_cjs.blendScores(hit, vectorHitsById.get(hit.chunkId)?.vectorScore ?? 0, weights)
|
|
555
555
|
);
|
|
556
556
|
return combined.sort((a, b) => b.score - a.score);
|
|
557
557
|
}
|
|
@@ -579,7 +579,7 @@ var IndexManager = class _IndexManager {
|
|
|
579
579
|
endLine,
|
|
580
580
|
score: 0,
|
|
581
581
|
textScore: 0,
|
|
582
|
-
snippet:
|
|
582
|
+
snippet: chunkHNAYCTX4_cjs.truncateSnippet(String(row.text ?? "")),
|
|
583
583
|
source: String(row.source),
|
|
584
584
|
citation: `${path}:${startLine}-${endLine}`
|
|
585
585
|
};
|
|
@@ -591,5 +591,5 @@ var IndexManager = class _IndexManager {
|
|
|
591
591
|
};
|
|
592
592
|
|
|
593
593
|
exports.IndexManager = IndexManager;
|
|
594
|
-
//# sourceMappingURL=chunk-
|
|
595
|
-
//# sourceMappingURL=chunk-
|
|
594
|
+
//# sourceMappingURL=chunk-33A27NFX.cjs.map
|
|
595
|
+
//# sourceMappingURL=chunk-33A27NFX.cjs.map
|