dsh-context-core 0.1.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 (45) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +80 -0
  3. package/README.zh-CN.md +80 -0
  4. package/dist/compat/@deepseek-ai__dsh-session@0.1.7-rc.2.patch +25 -0
  5. package/dist/compat/DSH-LICENSE +21 -0
  6. package/dist/compat/README.md +28 -0
  7. package/dist/compat/README.zh-CN.md +28 -0
  8. package/dist/compat/dsh-session-source.patch +16 -0
  9. package/dist/config.d.ts +4 -0
  10. package/dist/config.d.ts.map +1 -0
  11. package/dist/config.js +27 -0
  12. package/dist/config.js.map +1 -0
  13. package/dist/host.d.ts +30 -0
  14. package/dist/host.d.ts.map +1 -0
  15. package/dist/host.js +185 -0
  16. package/dist/host.js.map +1 -0
  17. package/dist/index.d.ts +8 -0
  18. package/dist/index.d.ts.map +1 -0
  19. package/dist/index.js +5 -0
  20. package/dist/index.js.map +1 -0
  21. package/dist/pipeline.d.ts +104 -0
  22. package/dist/pipeline.d.ts.map +1 -0
  23. package/dist/pipeline.js +2 -0
  24. package/dist/pipeline.js.map +1 -0
  25. package/dist/plugin.d.ts +38 -0
  26. package/dist/plugin.d.ts.map +1 -0
  27. package/dist/plugin.js +180 -0
  28. package/dist/plugin.js.map +1 -0
  29. package/dist/tools/create-profile-patch.mjs +187 -0
  30. package/dist/transaction.d.ts +29 -0
  31. package/dist/transaction.d.ts.map +1 -0
  32. package/dist/transaction.js +122 -0
  33. package/dist/transaction.js.map +1 -0
  34. package/dist/types.d.ts +82 -0
  35. package/dist/types.d.ts.map +1 -0
  36. package/dist/types.js +2 -0
  37. package/dist/types.js.map +1 -0
  38. package/package.json +61 -0
  39. package/src/config.ts +18 -0
  40. package/src/host.ts +189 -0
  41. package/src/index.ts +7 -0
  42. package/src/pipeline.ts +114 -0
  43. package/src/plugin.ts +160 -0
  44. package/src/transaction.ts +121 -0
  45. package/src/types.ts +81 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 dsh-context-zoo contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,80 @@
1
+ # dsh-context-core
2
+
3
+ English | [简体中文](README.zh-CN.md)
4
+
5
+ The DSH integration layer for independent context plugins. Core provides session observations, model calls, file reads subject to host permissions, and commit transactions. Each plugin chooses its thresholds, history ranges, prompts, retries, and recovery content.
6
+
7
+ DSH peer dependencies are pinned to `0.1.7-rc.2`; Cordis is `~4.0.4`. Apply the [Session patch](https://github.com/zonemeen/dsh-context-zoo/blob/main/patches/README.md) to the actual host dependencies before use.
8
+
9
+ ## Published tools
10
+
11
+ The package includes the `dsh-context-patch` CLI for generating a profile overlay and exports `./compat/*` with the required Session patches, instructions, and license. The files are stored in `dist/compat/`. See the [npm guide](https://github.com/zonemeen/dsh-context-zoo/blob/main/docs/publishing.md#using-the-published-packages) for commands. Applying a host patch remains an explicit operation.
12
+
13
+ ## Interface
14
+
15
+ ```ts
16
+ import { createContextPlugin } from 'dsh-context-core';
17
+ import { createPipeline } from './pipeline.js';
18
+
19
+ export default createContextPlugin({ id: 'my-agent', create: createPipeline });
20
+ ```
21
+
22
+ `ContextPipeline.run(host, trigger)` owns one complete workflow. The trigger is `pressure`, `manual`, `context-overflow`, or `request-too-large`; explicit range compaction uses `summarizeRange()`. Each session has its own pipeline instance. State needed after restoration is written with `host.record()` and read with `host.records()`.
23
+
24
+ `ContextHost` provides:
25
+
26
+ | Method | Behavior |
27
+ | --- | --- |
28
+ | `snapshot()` | Current messages, the full message archive, usage, routing, capacity, tools, time, and session identity |
29
+ | `summarize()` | Call the model with the plugin's messages and instructions; record the actual input, output, finish reason, and errors |
30
+ | `replace()` | Record replayable replacements for selected user/tool content while preserving role, identity, and source |
31
+ | `compact()` | Lock a selected contiguous range, run summarization and recovery, validate the result, and commit the checkpoint |
32
+ | `readFile()` | Stream a bounded number of characters through DSH `fs`; return null and record the reason if unavailable |
33
+ | `record()` / `records()` | Append and read durable state scoped to the plugin |
34
+
35
+ A `Checkpoint` can contain `beforeSummary`, `summary`, and `restored`. All three are committed in one checkpoint. The plugin must explicitly adapt recovered content when the native role structure differs. This interface does not create another agent's session tree or tool cache.
36
+
37
+ ## Commit and recovery
38
+
39
+ Core checks tool-call pairing, contiguous ranges, concurrent compaction locks, and history stability after summarization. Automatic compaction requires the whole current history to remain unchanged. Manual compaction allows context to be appended outside its selected range. The replacement must be smaller than that range, and system and developer messages remain in place. When those messages occur within history, each plugin applies its selection algorithm to contiguous conversation segments, skipping segments already summarized or unable to shrink further.
40
+
41
+ Auxiliary calls are recorded individually, including Pi's two summaries, failed retries, and model fallback. `compaction/summary` carries the single-call marker only when exactly one model call occurred. The summary event and its replacement `user/message` stay adjacent; original records remain in the log.
42
+
43
+ Manual workflows run under the DSH maintenance lock and wait for the session to flush. Cancellation reaches the model and file services and prevents checkpoint submission. Model overflow requests a retry only after the plugin has durably replaced history and the operation remains active. The plugin owns retry limits and failure counts.
44
+
45
+ ## Configuration
46
+
47
+ Configuration is validated at load time. These fields form the shared configuration vocabulary; a plugin uses the fields supported by its source workflow. Defaults are documented in each package README.
48
+
49
+ | Field | Purpose |
50
+ | --- | --- |
51
+ | `auto` | Enable automatic event hooks; explicit compaction methods remain available |
52
+ | `reserveTokens`, `thresholdRatio`, `keepRecentTokens` | Source-specific trigger and retention budgets |
53
+ | `maxSummaryTokens`, `summaryToolChars` | Summary output limit and auxiliary tool-text length |
54
+ | `summarizationProvider`, `summarizationModel` | Summary routing; both must be set together |
55
+ | `maxOverflowRetries`, `maxConsecutiveFailures` | Overflow recovery and consecutive-failure limits |
56
+ | `maxSummaryAttempts`, `summaryRetryDelayMs` | Model attempt count and retry delay where supported |
57
+ | `prune`, `keepRecentTools`, `protectToolTokens`, `minPruneTokens` | Microcompaction controls where supported |
58
+ | `idleMinutes`, `toolHighWaterChars`, `toolLowWaterChars` | Idle-time and tool-output size thresholds |
59
+ | `tailTurns` | OpenCode's retained turn count |
60
+ | `screenshotTriggerImages` | Qwen's tool-screenshot trigger count; 0 disables it |
61
+ | `restoreContext`, `maxRestoredFiles`, `maxFileTokens`, `maxRestoreTokens` | File and context recovery budgets |
62
+ | `maxRestoredImages`, `maxSkillTokens` | Image and skill recovery budgets |
63
+
64
+ Budgets, counts, and delays are nonnegative safe integers. Summary output, summary attempt count, and the consecutive-failure limit must be positive. Ratios must be in `(0, 1]`. Each plugin documents the meaning of zero where applicable.
65
+
66
+ ## Host integration
67
+
68
+ External runtimes can return observed `approvedPlanPath`, `transcriptPath`, `wirePath`, `windowLines`, `todos`, `reminders`, or `replStateCleared` values through the `context-zoo/recovery` waterfall. Call `next()` when there are no observations. Return `replStateCleared: true` only after actually clearing the REPL. Core requires observed file locations and log recovery information.
69
+
70
+ Pi branch navigation calls:
71
+
72
+ ```ts
73
+ import { summarizeBranch } from 'dsh-context-core';
74
+
75
+ const summary = await summarizeBranch(ctx, idleAgent, abandonedBranchSeqs, signal);
76
+ ```
77
+
78
+ This function runs the plugin's branch workflow under the maintenance lock, records the summary, and flushes it. The navigation integration writes the returned text into a model-visible message in the target branch. Plugins without a branch workflow return `undefined`.
79
+
80
+ `ContextStrategy` and `budget()` expose metadata for budget comparisons. `ContextPipeline` executes the actual workflow. History selection and tool-pruning algorithms belong to the individual plugins.
@@ -0,0 +1,80 @@
1
+ # dsh-context-core
2
+
3
+ [English](README.md) | 简体中文
4
+
5
+ 独立上下文插件的 DSH 接入层。core 提供会话观察、模型调用、受宿主权限约束的文件读取和提交事务,不选择压缩阈值、历史范围、提示词、重试次数或恢复内容。
6
+
7
+ DSH peer dependencies 固定为 `0.1.7-rc.2`,Cordis 为 `~4.0.4`。使用前须按仓库的 [Session 补丁说明](https://github.com/zonemeen/dsh-context-zoo/blob/main/patches/README.zh-CN.md) 处理实际宿主依赖。
8
+
9
+ ## 随包发布的工具
10
+
11
+ 本包包含用于生成 profile 覆盖补丁的 `dsh-context-patch` CLI,并通过 `./compat/*` 导出所需的 Session 补丁、说明和许可证;文件位于 `dist/compat/`。命令见 [npm 指南](https://github.com/zonemeen/dsh-context-zoo/blob/main/docs/publishing.zh-CN.md#使用已发布的包)。宿主补丁仍需显式应用。
12
+
13
+ ## 接口
14
+
15
+ ```ts
16
+ import { createContextPlugin } from 'dsh-context-core';
17
+ import { createPipeline } from './pipeline.js';
18
+
19
+ export default createContextPlugin({ id: 'my-agent', create: createPipeline });
20
+ ```
21
+
22
+ `ContextPipeline` 的 `run(host, trigger)` 拥有一次完整执行流程。触发原因是 `pressure`、`manual`、`context-overflow` 或 `request-too-large`;显式范围压缩调用 `summarizeRange()`。每个会话有自己的 pipeline 实例,需恢复的状态通过 `host.record()` 和 `host.records()` 存取。
23
+
24
+ `ContextHost` 提供:
25
+
26
+ | 方法 | 行为 |
27
+ | --- | --- |
28
+ | `snapshot()` | 当前消息、完整消息归档、usage、路由、窗口、工具、时间与会话标识 |
29
+ | `summarize()` | 按插件给出的消息和指令调用模型,记录实际输入、输出、finish 和错误 |
30
+ | `replace()` | 把插件选中的 user/tool 内容写成可回放的替换;保留角色、标识和来源 |
31
+ | `compact()` | 对选定连续范围加锁,运行摘要与恢复,校验后提交检查点 |
32
+ | `readFile()` | 经 DSH `fs` 流式读取指定字符数;不可用时返回 null 并记录原因 |
33
+ | `record()` / `records()` | 追加与读取带插件命名空间的持久状态 |
34
+
35
+ `Checkpoint` 可包含 `beforeSummary`、`summary` 和 `restored`。三部分在一个检查点中提交。原生角色结构不同的恢复内容需要插件做明确适配;这个接口不会创建其他 agent 的会话树或工具缓存。
36
+
37
+ ## 提交和恢复
38
+
39
+ core 校验工具调用配对、连续范围、并发压缩锁和摘要后的历史稳定性。自动压缩要求整个当前历史保持一致;手动压缩允许范围外追加上下文。替换后的总内容必须小于被替换范围;系统和开发者消息不参与替换。遇到历史中途的系统或开发者更新,各插件分别在连续会话段上运行自己的选择算法,跳过已经压缩或无法继续缩减的段,保留这些更新的位置。
40
+
41
+ 辅助调用单独记录,所以 Pi 的两次摘要、失败重试和模型回退都可追查。`compaction/summary` 只在恰好一次模型调用时写入单调用标记。`compaction/summary` 和对应 `user/message` 保持相邻;原始记录仍在日志中。
42
+
43
+ 手动流程在 DSH maintenance 锁内执行,并等待会话 flush。取消信号传入模型与文件服务;取消后不提交检查点。模型溢出仅在插件造成实际历史替换且未取消时请求重试,次数和失败计数由插件决定。
44
+
45
+ ## 配置
46
+
47
+ 配置在加载时验证。以下字段属于统一配置词汇,各插件只使用有对应源流程的字段;默认值见对应包 README。
48
+
49
+ | 字段 | 用途 |
50
+ | --- | --- |
51
+ | `auto` | 自动事件钩子开关;不禁止显式调用压缩方法 |
52
+ | `reserveTokens`, `thresholdRatio`, `keepRecentTokens` | 来源特定的触发与保留预算 |
53
+ | `maxSummaryTokens`, `summaryToolChars` | 摘要输出上限、辅助输入的工具文本长度 |
54
+ | `summarizationProvider`, `summarizationModel` | 摘要路由;必须一起设置 |
55
+ | `maxOverflowRetries`, `maxConsecutiveFailures` | 溢出恢复和连续失败限制 |
56
+ | `maxSummaryAttempts`, `summaryRetryDelayMs` | 源流程支持的模型重试次数和延迟 |
57
+ | `prune`, `keepRecentTools`, `protectToolTokens`, `minPruneTokens` | 源流程支持的微压缩控制 |
58
+ | `idleMinutes`, `toolHighWaterChars`, `toolLowWaterChars` | 空闲与工具输出体积阈值 |
59
+ | `tailTurns` | OpenCode 的保留回合数 |
60
+ | `screenshotTriggerImages` | Qwen 工具截图触发数;0 关闭 |
61
+ | `restoreContext`, `maxRestoredFiles`, `maxFileTokens`, `maxRestoreTokens` | 文件和上下文恢复预算 |
62
+ | `maxRestoredImages`, `maxSkillTokens` | 图片与技能恢复预算 |
63
+
64
+ 预算、计数和延迟使用非负安全整数;摘要输出、摘要尝试数与连续失败上限必须大于零。比例属于 `(0, 1]`。值为零的含义由各插件说明。
65
+
66
+ ## 宿主集成
67
+
68
+ 外部运行时可以通过 `context-zoo/recovery` waterfall 返回实际观察到的 `approvedPlanPath`、`transcriptPath`、`wirePath`、`windowLines`、`todos`、`reminders` 或 `replStateCleared`。没有观察时调用 `next()`;只有确实清理了 REPL 才能返回 `replStateCleared: true`。文件路径和日志恢复提示不会由 core 猜测。
69
+
70
+ Pi 分支导航调用:
71
+
72
+ ```ts
73
+ import { summarizeBranch } from 'dsh-context-core';
74
+
75
+ const summary = await summarizeBranch(ctx, idleAgent, abandonedBranchSeqs, signal);
76
+ ```
77
+
78
+ 该函数在 maintenance 锁内调用插件分支流程,记录并 flush 摘要。导航集成负责把返回文本写入目标分支的模型可见消息;没有分支流程的插件返回 `undefined`。
79
+
80
+ `ContextStrategy` 和 `budget()` 是预算比较所需的元数据,实际流程由 `ContextPipeline` 执行。core 不再导出公共历史选择器或工具裁剪算法。
@@ -0,0 +1,25 @@
1
+ diff --git a/lib/index.js b/lib/index.js
2
+ index 48bc365ca7021dcf0d69a2d07ac49995034357c4..141fb92e59c0b7b8190fabf4f10a61ff6a60d788 100644
3
+ --- a/lib/index.js
4
+ +++ b/lib/index.js
5
+ @@ -1401,6 +1401,7 @@ var Session = class Session {
6
+ append(type, data, ...opts) {
7
+ const surfaceOpts = opts[0];
8
+ const surfaceMetadata = {
9
+ + ...surfaceOpts?.ignorable === true ? { ignorable: true } : {},
10
+ ...surfaceOpts?.sourceEventSeqs === void 0 ? {} : { sourceEventSeqs: surfaceOpts.sourceEventSeqs },
11
+ ...surfaceOpts?.surfaceOp === void 0 ? {} : { surfaceOp: surfaceOpts.surfaceOp }
12
+ };
13
+ diff --git a/lib/types/index.d.ts b/lib/types/index.d.ts
14
+ index 3d6aa837b6ab4c40b4c84c178a9579e261731010..912e93b0c2ee86bafe025470941748a2bda266ef 100644
15
+ --- a/lib/types/index.d.ts
16
+ +++ b/lib/types/index.d.ts
17
+ @@ -243,7 +243,7 @@ export declare class Session {
18
+ * append reentered while this acceptance/publication boundary is open also
19
+ * rejects before the log changes.
20
+ */
21
+ - append<T extends SessionEventType>(type: T, data: SessionEventMap[T], ...opts: T extends SurfaceEventType ? [opts: SurfaceIntent<T>] : []): SessionEvent<T>;
22
+ + append<T extends SessionEventType>(type: T, data: SessionEventMap[T], ...opts: T extends SurfaceEventType ? [opts: SurfaceIntent<T>] : [opts?: { ignorable: true }]): SessionEvent<T>;
23
+ /** Cached fold of the request-header events — see {@link requestHeader}. */
24
+ private headerFold;
25
+ /** Log position (events consumed) the header fold has reached. */
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 DeepSeek
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,28 @@
1
+ # DSH Session Compatibility Patch
2
+
3
+ English | [简体中文](README.zh-CN.md)
4
+
5
+ DSH `0.1.7-rc.2` can restore external plugin events marked `ignorable: true`, but `Session.append()` does not expose an argument for writing that marker. Context plugins need durable failure counts, file lists, and auxiliary model-call records so these values survive session restoration.
6
+
7
+ This patch allows non-message events to call `append(type, data, { ignorable: true })` and writes the marker into the event envelope. It leaves the session format version, existing events, and compaction algorithms unchanged. Model-visible changes still use standard DSH message and compaction events.
8
+
9
+ ## This repository
10
+
11
+ `pnpm-workspace.yaml` declares the published-package patch in `patchedDependencies`. Running `pnpm install` applies it automatically. Tests use DSH's `validateStoredEvents()` to check that the resulting records can be restored.
12
+
13
+ ## The actual DSH host
14
+
15
+ **Apply the patch to the DSH runtime that creates the actual sessions.** Patching this library's development dependency does not patch a separate host installation. The plugin probes both its imported Session class and the active session implementation in isolation; these probes do not write to user sessions.
16
+
17
+ For a DSH host installed through a pnpm project, copy `@deepseek-ai__dsh-session@0.1.7-rc.2.patch` from this directory into that project's `patches/` directory. Merge the following entry into its `pnpm-workspace.yaml`, then run `pnpm install`:
18
+
19
+ ```yaml
20
+ patchedDependencies:
21
+ '@deepseek-ai/dsh-session@0.1.7-rc.2': patches/@deepseek-ai__dsh-session@0.1.7-rc.2.patch
22
+ ```
23
+
24
+ When running DSH from its source workspace, the published-package patch does not change workspace source. Check and apply `dsh-session-source.patch` from the DSH repository root, then rebuild according to DSH's development instructions. The patch targets the source location used by this library's pinned version. Run `git apply --check <absolute-patch-path>` first to confirm that it applies to your checkout.
25
+
26
+ This repository does not automatically modify a user's DSH installation or profile. If the host lacks the patch, the plugin rejects workflows that require durable records and reports the reason. Once DSH exposes this parameter publicly, the patch can be removed when updating the pinned dependency version.
27
+
28
+ The patch includes a small amount of DSH context code under the [MIT license](DSH-LICENSE).
@@ -0,0 +1,28 @@
1
+ # DSH Session 兼容补丁
2
+
3
+ [English](README.md) | 简体中文
4
+
5
+ DSH `0.1.7-rc.2` 的持久化读取器接受 `ignorable: true` 的外部插件事件,但 `Session.append()` 没有暴露写入该标记的参数。上下文插件需要记录失败计数、文件清单以及多次摘要调用,否则会话恢复后会丢失这些状态。
6
+
7
+ 这里的补丁只允许非消息事件调用 `append(type, data, { ignorable: true })`,并把标记写入事件信封。它不修改会话格式版本、已有事件或压缩算法。插件的模型可见变化仍使用标准 DSH 消息与 compaction 事件。
8
+
9
+ ## 本仓库
10
+
11
+ `pnpm-workspace.yaml` 已声明 `patchedDependencies`,执行 `pnpm install` 自动应用发布包补丁。测试调用 DSH 的 `validateStoredEvents()` 检查这些记录可以恢复。
12
+
13
+ ## 实际 DSH 宿主
14
+
15
+ **补丁必须应用到创建实际会话的 DSH 运行时。** 仅在本库的开发依赖上应用补丁,不能代替宿主补丁。插件对其导入的 Session 类和实际会话的实现分别做隔离探测;探测不会写入用户会话。
16
+
17
+ 如果 DSH 由 pnpm 项目安装,在该宿主项目中复制本目录的 `@deepseek-ai__dsh-session@0.1.7-rc.2.patch`,并合并以下配置到它的 `pnpm-workspace.yaml`,随后执行 `pnpm install`:
18
+
19
+ ```yaml
20
+ patchedDependencies:
21
+ '@deepseek-ai/dsh-session@0.1.7-rc.2': patches/@deepseek-ai__dsh-session@0.1.7-rc.2.patch
22
+ ```
23
+
24
+ 如果从 DSH 源码工作区启动,发布包补丁不会改变 workspace source。可在 DSH 仓库根目录检查并应用本目录的 `dsh-session-source.patch`,再按 DSH 的开发说明重建。补丁对应本库固定版本的源码位置;先用 `git apply --check <absolute-patch-path>` 确认当前 checkout 可以应用。
25
+
26
+ 本仓库不会自动修改用户的 DSH 安装或 profile。宿主缺少补丁时,插件拒绝执行需要持久记录的流程并报告原因。DSH 将来公开支持这个参数后,可以删除这份补丁并更新固定依赖版本。
27
+
28
+ 补丁包含 DSH 的少量上下文代码,使用 [MIT 许可证](DSH-LICENSE)。
@@ -0,0 +1,16 @@
1
+ --- a/packages/core/session/src/index.ts
2
+ +++ b/packages/core/session/src/index.ts
3
+ @@ -722,10 +722,11 @@
4
+ append<T extends SessionEventType>(
5
+ type: T,
6
+ data: SessionEventMap[T],
7
+ - ...opts: T extends SurfaceEventType ? [opts: SurfaceIntent<T>] : []
8
+ + ...opts: T extends SurfaceEventType ? [opts: SurfaceIntent<T>] : [opts?: { ignorable: true }]
9
+ ): SessionEvent<T> {
10
+ - const surfaceOpts: SurfaceIntent | undefined = opts[0]
11
+ + const surfaceOpts: (Partial<SurfaceIntent> & { ignorable?: true }) | undefined = opts[0]
12
+ const surfaceMetadata = {
13
+ + ...surfaceOpts?.ignorable === true ? { ignorable: true as const } : {},
14
+ ...surfaceOpts?.sourceEventSeqs === undefined ? {} : { sourceEventSeqs: surfaceOpts.sourceEventSeqs },
15
+ ...surfaceOpts?.surfaceOp === undefined ? {} : { surfaceOp: surfaceOpts.surfaceOp },
16
+ }
@@ -0,0 +1,4 @@
1
+ import type { ContextConfig } from './types.js';
2
+ /** Validate YAML/JSON plugin settings before registering any listeners. */
3
+ export declare function validateConfig(config: ContextConfig): void;
4
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAKhD,2EAA2E;AAC3E,wBAAgB,cAAc,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI,CAW1D"}
package/dist/config.js ADDED
@@ -0,0 +1,27 @@
1
+ const integerKeys = ['reserveTokens', 'keepRecentTokens', 'maxSummaryTokens', 'summaryToolChars', 'maxOverflowRetries', 'maxConsecutiveFailures', 'keepRecentTools', 'protectToolTokens', 'minPruneTokens', 'screenshotTriggerImages', 'tailTurns', 'summaryRetryDelayMs', 'idleMinutes', 'toolHighWaterChars', 'toolLowWaterChars', 'maxSummaryAttempts', 'maxRestoredFiles', 'maxFileTokens', 'maxRestoreTokens', 'maxRestoredImages', 'maxSkillTokens'];
2
+ const keys = new Set([...integerKeys, 'auto', 'thresholdRatio', 'summarizationProvider', 'summarizationModel', 'prune', 'restoreContext']);
3
+ /** Validate YAML/JSON plugin settings before registering any listeners. */
4
+ export function validateConfig(config) {
5
+ for (const key of Object.keys(config))
6
+ if (!keys.has(key))
7
+ throw new Error(`Unknown context setting: ${key}`);
8
+ for (const key of integerKeys) {
9
+ const value = config[key];
10
+ if (value !== undefined && (!Number.isSafeInteger(value) || value < 0))
11
+ throw new Error(`${key} must be a non-negative safe integer`);
12
+ }
13
+ for (const key of ['maxSummaryTokens', 'maxConsecutiveFailures', 'maxSummaryAttempts'])
14
+ if (config[key] === 0)
15
+ throw new Error(`${key} must be positive`);
16
+ for (const key of ['auto', 'prune', 'restoreContext'])
17
+ if (config[key] !== undefined && typeof config[key] !== 'boolean')
18
+ throw new Error(`${key} must be a boolean`);
19
+ if (config.thresholdRatio !== undefined && (!Number.isFinite(config.thresholdRatio) || config.thresholdRatio <= 0 || config.thresholdRatio > 1))
20
+ throw new Error('thresholdRatio must be greater than 0 and at most 1');
21
+ for (const key of ['summarizationProvider', 'summarizationModel'])
22
+ if (config[key] !== undefined && (typeof config[key] !== 'string' || config[key].trim().length === 0))
23
+ throw new Error(`${key} must be a non-empty string`);
24
+ if ((config.summarizationProvider === undefined) !== (config.summarizationModel === undefined))
25
+ throw new Error('Set summarizationProvider and summarizationModel together');
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AC,GAAG,CAAC,KAAK,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,GAAG,GAAG,mBAAmB,CAAC,CAAC;IACnK,KAAK,MAAM,GAAG,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE,gBAAgB,CAAU;QAAE,IAAI,MAAM,CAAC,GAAG,CAAC,KAAK,SAAS,IAAI,OAAO,MAAM,CAAC,GAAG,CAAC,KAAK,SAAS;YAAE,MAAM,IAAI,KAAK,CAAC,GAAG,GAAG,oBAAoB,CAAC,CAAC;IAC/K,IAAI,MAAM,CAAC,cAAc,KAAK,SAAS,IAAI,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,MAAM,CAAC,cAAc,IAAI,CAAC,IAAI,MAAM,CAAC,cAAc,GAAG,CAAC,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;IACxN,KAAK,MAAM,GAAG,IAAI,CAAC,uBAAuB,EAAE,oBAAoB,CAAU;QAAE,IAAI,MAAM,CAAC,GAAG,CAAC,KAAK,SAAS,IAAI,CAAC,OAAO,MAAM,CAAC,GAAG,CAAC,KAAK,QAAQ,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,GAAG,GAAG,6BAA6B,CAAC,CAAC;IACxO,IAAI,CAAC,MAAM,CAAC,qBAAqB,KAAK,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC,kBAAkB,KAAK,SAAS,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,2DAA2D,CAAC,CAAC;AAC/K,CAAC"}
package/dist/host.d.ts ADDED
@@ -0,0 +1,30 @@
1
+ /** DSH observations and transport for independently implemented context pipelines. */
2
+ import type { Context } from '@deepseek-ai/cordis';
3
+ import type { CommandId } from '@deepseek-ai/dsh-commands/brand';
4
+ import type { CompactionAgentContext } from '@deepseek-ai/dsh-compaction';
5
+ import type { ContextConfig } from './types.js';
6
+ import type { ContextHost, ContextRecovery } from './pipeline.js';
7
+ declare module '@deepseek-ai/dsh-session/types' {
8
+ interface SessionEventMap {
9
+ 'context-zoo/state': {
10
+ plugin: string;
11
+ kind: string;
12
+ data: Record<string, unknown>;
13
+ };
14
+ }
15
+ }
16
+ declare module '@deepseek-ai/cordis' {
17
+ interface Events {
18
+ /**
19
+ * Supply observed external runtime state, such as an actual transcript location.
20
+ * @param agent - session owner requesting recovery observations.
21
+ * @param signal - operation cancellation.
22
+ * @param next - delegate when this integration has no observations.
23
+ * @mode waterfall
24
+ */
25
+ 'context-zoo/recovery'(agent: CompactionAgentContext, signal: AbortSignal, next: () => Promise<ContextRecovery | undefined>): Promise<ContextRecovery | undefined>;
26
+ }
27
+ }
28
+ /** Build low-level operations scoped to one run and its cancellation signal. */
29
+ export declare function createHost(ctx: Context, agent: CompactionAgentContext, id: string, config: ContextConfig, signal: AbortSignal, manual?: boolean, sourceCommandId?: CommandId): ContextHost;
30
+ //# sourceMappingURL=host.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../src/host.ts"],"names":[],"mappings":"AAAA,sFAAsF;AACtF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAEnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAK1E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,KAAK,EAAgB,WAAW,EAAE,eAAe,EAAmB,MAAM,eAAe,CAAC;AAGjG,OAAO,QAAQ,gCAAgC,CAAC;IAC9C,UAAU,eAAe;QACvB,mBAAmB,EAAE;YAAE,MAAM,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;SAAE,CAAC;KACtF;CACF;AAED,OAAO,QAAQ,qBAAqB,CAAC;IACnC,UAAU,MAAM;QACd;;;;;;WAMG;QACH,sBAAsB,CAAC,KAAK,EAAE,sBAAsB,EAAE,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC,eAAe,GAAG,SAAS,CAAC,GAAG,OAAO,CAAC,eAAe,GAAG,SAAS,CAAC,CAAC;KACpK;CACF;AAaD,gFAAgF;AAChF,wBAAgB,UAAU,CAAC,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,sBAAsB,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,UAAQ,EAAE,eAAe,CAAC,EAAE,SAAS,GAAG,WAAW,CAgJxL"}
package/dist/host.js ADDED
@@ -0,0 +1,185 @@
1
+ import { assembleAssistantStream, BlockAssembler, freezeMessage, LlmError } from '@deepseek-ai/dsh-llm';
2
+ import { SessionId } from '@deepseek-ai/dsh-session';
3
+ import { assertInactive, compactTransaction } from './transaction.js';
4
+ const checkedSessionClasses = new WeakSet();
5
+ function checkSessionWriter(session, plugin) {
6
+ const implementation = session.constructor;
7
+ if (checkedSessionClasses.has(implementation))
8
+ return;
9
+ const probe = implementation.create(SessionId('context-zoo-runtime-probe'));
10
+ const marker = probe.append('context-zoo/state', { plugin, kind: 'probe', data: {} }, { ignorable: true });
11
+ if (marker.ignorable !== true)
12
+ throw new Error('The active DSH Session implementation needs the supplied ignorable-event patch; see dsh-context-core/dist/compat/README.md');
13
+ checkedSessionClasses.add(implementation);
14
+ }
15
+ /** Build low-level operations scoped to one run and its cancellation signal. */
16
+ export function createHost(ctx, agent, id, config, signal, manual = false, sourceCommandId) {
17
+ const session = agent.session;
18
+ checkSessionWriter(session, id);
19
+ const calls = [];
20
+ const target = () => {
21
+ const request = session.requestHeader()?.config;
22
+ const provider = request?.provider ?? agent.options.provider;
23
+ const model = request?.model ?? agent.options.model;
24
+ if (!provider || !model)
25
+ throw new Error('Context management needs a routed provider and model');
26
+ return { provider, model, maxTokens: request?.maxTokens };
27
+ };
28
+ const record = (kind, data) => {
29
+ // Durable metadata must contain JSON values, including no undefined properties.
30
+ const durable = JSON.parse(JSON.stringify(data));
31
+ const event = session.append('context-zoo/state', { plugin: id, kind, data: durable }, { ignorable: true });
32
+ if (event.ignorable !== true)
33
+ throw new Error('DSH Session.append needs the supplied ignorable-event patch; see dsh-context-core/dist/compat/README.md');
34
+ };
35
+ const host = {
36
+ signal,
37
+ record,
38
+ records: kind => session.snapshotEvents().flatMap(event => event.type === 'context-zoo/state' && event.data.plugin === id && event.data.kind === kind ? [event.data.data] : []),
39
+ async snapshot() {
40
+ signal.throwIfAborted();
41
+ const route = target();
42
+ const info = await ctx.llm.resolveModelInfo(route.provider, route.model, signal);
43
+ signal.throwIfAborted();
44
+ if (!info.context)
45
+ throw new Error(`No context window configured for ${route.provider}/${route.model}`);
46
+ const recovery = await ctx.waterfall('context-zoo/recovery', agent, signal, async () => undefined);
47
+ signal.throwIfAborted();
48
+ const measurement = ctx.tokenMeter.measure(session);
49
+ const prices = new Map(measurement.nodes.map(node => [node.seq, node.tokens]));
50
+ const tools = new Map();
51
+ let requestSeries = 'initial';
52
+ let turnKey;
53
+ const archive = [];
54
+ for (const event of session.snapshotEvents()) {
55
+ if (event.type === 'turn/start') {
56
+ turnKey = `turn:${event.seq}`;
57
+ requestSeries = turnKey;
58
+ }
59
+ if (event.type === 'tool/call')
60
+ tools.set(event.data.callId, event.data);
61
+ const message = session.deriveEventMessage(event) ?? (event.type === 'system/message' || event.type === 'developer/message' ? event.data.message : null);
62
+ if (message === null)
63
+ continue;
64
+ for (const block of message.content)
65
+ if (block.type === 'tool-call')
66
+ tools.set(block.id, { name: block.name, arguments: block.arguments });
67
+ const assembled = event.type === 'assistant/message' ? assembleAssistantStream(event.data.stream) : undefined;
68
+ if (event.type === 'assistant/message' && assembled?.finish.kind !== 'error' && assembled?.finish.kind !== 'aborted')
69
+ requestSeries = `response:${event.seq}`;
70
+ const usage = event.type === 'assistant/message' ? event.data.usage ?? assembled?.usage : undefined;
71
+ const tool = message.role === 'tool' ? tools.get(message.toolCallId) : undefined;
72
+ archive.push({
73
+ seq: event.seq, message, time: event.time, tokens: prices.get(event.seq) ?? ctx.tokenMeter.estimateMessage(message),
74
+ ...assembled === undefined ? {} : { finish: assembled.finish.kind, ...usage === undefined ? {} : { usage } },
75
+ ...tool === undefined ? {} : { toolName: tool.name, toolArguments: tool.arguments },
76
+ });
77
+ }
78
+ const bySeq = new Map(archive.map(entry => [entry.seq, entry]));
79
+ const entries = session.surface.nodes.map(seq => {
80
+ const entry = bySeq.get(seq);
81
+ if (!entry)
82
+ throw new Error(`Missing message for surface event ${seq}`);
83
+ return entry;
84
+ });
85
+ return {
86
+ entries, archive, contextWindow: info.context.contextWindow,
87
+ maxOutputTokens: route.maxTokens ?? info.defaultMaxTokens ?? 32_000,
88
+ provider: route.provider, model: route.model, tools: session.requestHeader()?.tools ?? [],
89
+ measuredTokens: measurement.totalTokens, now: Date.now(), cwd: session.header.cwd ?? '', sessionId: session.id, requestSeries, ...turnKey === undefined ? {} : { turnKey },
90
+ ...recovery === undefined ? {} : { recovery },
91
+ };
92
+ },
93
+ async summarize(request) {
94
+ signal.throwIfAborted();
95
+ const route = target();
96
+ const provider = request.provider ?? config.summarizationProvider ?? route.provider;
97
+ const model = request.model ?? config.summarizationModel ?? route.model;
98
+ const messages = [...request.messages, { role: 'user', content: [{ type: 'text', text: request.instruction }] }];
99
+ const tools = request.includeTools ? session.requestHeader()?.tools : undefined;
100
+ const requestData = { provider, model, maxTokens: request.maxTokens, messages, ...(tools === undefined ? {} : { tools }) };
101
+ const callId = `${id}:${session.seq}`;
102
+ record('model-request', { callId, ...requestData });
103
+ const callIndex = calls.push(undefined) - 1;
104
+ try {
105
+ const assembler = new BlockAssembler();
106
+ for await (const chunk of ctx.llm.stream({ ...requestData, toolHistory: session.toolHistory(), sessionId: session.id, purpose: 'compaction', signal }))
107
+ assembler.push(chunk);
108
+ signal.throwIfAborted();
109
+ const finish = assembler.finish;
110
+ const content = assembler.blocks();
111
+ const response = {
112
+ provider, model, maxTokens: request.maxTokens, content,
113
+ text: content.filter(block => block.type === 'text').map(block => block.text).join('\n'),
114
+ finish: finish.kind, ...assembler.usage === undefined ? {} : { usage: assembler.usage },
115
+ };
116
+ record('model-result', { callId, ...response, ...(finish.kind === 'error' || finish.kind === 'aborted' ? { failure: finish.failure } : {}) });
117
+ calls[callIndex] = response;
118
+ if (finish.kind === 'error' || finish.kind === 'aborted')
119
+ throw new LlmError(finish.failure.message, finish.failure.code, finish.failure);
120
+ return response;
121
+ }
122
+ catch (error) {
123
+ record('model-error', { callId, message: error instanceof Error ? error.message : String(error), ...error instanceof LlmError ? { failure: error.failure } : {} });
124
+ signal.throwIfAborted();
125
+ throw error;
126
+ }
127
+ },
128
+ replace(replacements) {
129
+ signal.throwIfAborted();
130
+ assertInactive(session);
131
+ const seen = new Set();
132
+ const changes = replacements.map(replacement => {
133
+ if (seen.has(replacement.seq))
134
+ throw new Error('Duplicate tool replacement');
135
+ seen.add(replacement.seq);
136
+ const event = session.eventAt(replacement.seq);
137
+ if (!session.surface.nodes.includes(replacement.seq) || (event?.type !== 'tool/result' && event?.type !== 'user/message'))
138
+ throw new Error('Replacement must target a current user message or tool result');
139
+ const original = event.type === 'tool/result' ? event.data.message : event.data;
140
+ const message = freezeMessage({ ...original, content: [...replacement.content] });
141
+ return { event, message, price: ctx.tokenMeter.estimateMessage(original) };
142
+ });
143
+ for (const { event, message, price } of changes) {
144
+ session.append('compaction/prune', { shadowedRange: { start: event.seq, end: event.seq }, shadowedSeqs: [event.seq], shadowedTokenCount: price });
145
+ const options = { surfaceOp: { op: 'replace', startSeq: event.seq, endSeq: event.seq }, sourceEventSeqs: [event.seq] };
146
+ if (event.type === 'tool/result' && message.role === 'tool')
147
+ session.append('tool/result', { ...event.data, message }, options);
148
+ else if (event.type === 'user/message' && message.role === 'user')
149
+ session.append('user/message', message, options);
150
+ }
151
+ },
152
+ compact(entries, summarize) {
153
+ const firstCall = calls.length;
154
+ return compactTransaction({ session, meter: ctx.tokenMeter, entries, signal, manual, sourceCommandId, summarize, calls: () => calls.slice(firstCall), target: target() });
155
+ },
156
+ async readFile(path, maxChars) {
157
+ signal.throwIfAborted();
158
+ const fs = ctx.get('fs');
159
+ if (!fs) {
160
+ record('file-unavailable', { path, reason: 'No DSH filesystem provider is installed' });
161
+ return null;
162
+ }
163
+ try {
164
+ const target = await fs.resolve(path, { cwd: session.header.cwd, signal });
165
+ const chunks = await fs.streamText(target, signal);
166
+ let text = '';
167
+ for await (const chunk of chunks) {
168
+ signal.throwIfAborted();
169
+ text += chunk.slice(0, Math.max(0, maxChars - text.length));
170
+ if (text.length >= maxChars)
171
+ break;
172
+ }
173
+ signal.throwIfAborted();
174
+ return text;
175
+ }
176
+ catch (error) {
177
+ signal.throwIfAborted();
178
+ record('file-unavailable', { path, reason: error instanceof Error ? error.message : String(error) });
179
+ return null;
180
+ }
181
+ },
182
+ };
183
+ return host;
184
+ }
185
+ //# sourceMappingURL=host.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"host.js","sourceRoot":"","sources":["../src/host.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,uBAAuB,EAAE,cAAc,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAExG,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAIrD,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAqBtE,MAAM,qBAAqB,GAAG,IAAI,OAAO,EAAY,CAAC;AAEtD,SAAS,kBAAkB,CAAC,OAAgB,EAAE,MAAc;IAC1D,MAAM,cAAc,GAAG,OAAO,CAAC,WAA6B,CAAC;IAC7D,IAAI,qBAAqB,CAAC,GAAG,CAAC,cAAc,CAAC;QAAE,OAAO;IACtD,MAAM,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,EAAE,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;oBACjC,MAAM,CAAC,cAAc,EAAE,CAAC;oBACxB,IAAI,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;oBAC5D,IAAI,IAAI,CAAC,MAAM,IAAI,QAAQ;wBAAE,MAAM;gBACrC,CAAC;gBACD,MAAM,CAAC,cAAc,EAAE,CAAC;gBACxB,OAAO,IAAI,CAAC;YACd,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,CAAC,cAAc,EAAE,CAAC;gBACxB,MAAM,CAAC,kBAAkB,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;gBACrG,OAAO,IAAI,CAAC;YACd,CAAC;QACH,CAAC;KACF,CAAC;IACF,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,8 @@
1
+ /** Independent agent pipelines and their DSH integration. */
2
+ import './host.js';
3
+ export type * from './types.js';
4
+ export { createContextPlugin, summarizeBranch } from './plugin.js';
5
+ export type { ContextPlugin } from './plugin.js';
6
+ export { validateConfig } from './config.js';
7
+ export type * from './pipeline.js';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,OAAO,WAAW,CAAC;AACnB,mBAAmB,YAAY,CAAC;AAChC,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnE,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,mBAAmB,eAAe,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,5 @@
1
+ /** Independent agent pipelines and their DSH integration. */
2
+ import './host.js';
3
+ export { createContextPlugin, summarizeBranch } from './plugin.js';
4
+ export { validateConfig } from './config.js';
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,OAAO,WAAW,CAAC;AAEnB,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnE,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC"}