@dsh-enhanced/assistant-dreaming 0.0.0-stage → 0.1.68
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/LICENSE +21 -0
- package/README.md +281 -2
- package/cordis.patch.yml +3 -0
- package/lib/config.d.ts +87 -0
- package/lib/config.d.ts.map +1 -0
- package/lib/config.js +145 -0
- package/lib/config.js.map +1 -0
- package/lib/dream-agent.d.ts +58 -0
- package/lib/dream-agent.d.ts.map +1 -0
- package/lib/dream-agent.js +188 -0
- package/lib/dream-agent.js.map +1 -0
- package/lib/index.d.ts +20 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +15 -0
- package/lib/index.js.map +1 -0
- package/lib/notify.d.ts +64 -0
- package/lib/notify.d.ts.map +1 -0
- package/lib/notify.js +52 -0
- package/lib/notify.js.map +1 -0
- package/lib/projection.d.ts +32 -0
- package/lib/projection.d.ts.map +1 -0
- package/lib/projection.js +89 -0
- package/lib/projection.js.map +1 -0
- package/lib/runtime.d.ts +43 -0
- package/lib/runtime.d.ts.map +1 -0
- package/lib/runtime.js +500 -0
- package/lib/runtime.js.map +1 -0
- package/lib/store.d.ts +113 -0
- package/lib/store.d.ts.map +1 -0
- package/lib/store.js +367 -0
- package/lib/store.js.map +1 -0
- package/lib/trigger.d.ts +134 -0
- package/lib/trigger.d.ts.map +1 -0
- package/lib/trigger.js +155 -0
- package/lib/trigger.js.map +1 -0
- package/lib/version.d.ts +2 -0
- package/lib/version.d.ts.map +1 -0
- package/lib/version.js +2 -0
- package/lib/version.js.map +1 -0
- package/package.json +95 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 dsh-enhanced 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
CHANGED
|
@@ -1,3 +1,282 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @dsh-enhanced/assistant-dreaming
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
默认关闭、owner 显式启用的"做梦/突发奇想"插件。启用后它以低频率、确定性随机、
|
|
4
|
+
空闲感知的方式回顾**已认证的历史投影**(可信任务投影、owner 目标、活动技能的
|
|
5
|
+
有界摘要),在随机时刻让一个冻结的单工具 Agent 产生少量结构化 idea,并只写入
|
|
6
|
+
插件私有的 SQLite 账本。
|
|
7
|
+
|
|
8
|
+
它**不是**成长复盘:输入是跨任务的模式与空白,输出是未验证假设。默认级别 L0
|
|
9
|
+
(仅私有 idea),默认不通知、不开 Goal/WorkItem、不形成候选、不自动采用;模型输出
|
|
10
|
+
schema 不允许任何评分/置信度/自收益字段,沉默不算正向。
|
|
11
|
+
|
|
12
|
+
## 召回抽奖("无事找事")
|
|
13
|
+
|
|
14
|
+
在触发门(活跃时段/空闲/日上限/概率抽签)全部通过后,wake 不会直接调用模型,
|
|
15
|
+
而是先跑一段纯代码的 per-subject 抽奖:每个可回顾对象(任务投影、目标、技能,以及
|
|
16
|
+
本 lane 尚未了结的已记录 idea)由 `HMAC(seed, lane+kind+key)` 派生出一个
|
|
17
|
+
`[0, 1_000_000)` 内的稳定**票号**并登记入账;每个 wake 槽位再由
|
|
18
|
+
`HMAC(seed, lane+occurrence)` 滚出一个**开奖号**,票号落在开奖号环形窗口
|
|
19
|
+
(默认 ±5,000,约 1%)内的对象被"召回"。已了结(validated/rejected/withdrawn)
|
|
20
|
+
的 idea 每 wake 清理其票,不再被召回。没有任何票命中是正常的无思考槽位:
|
|
21
|
+
执行器返回 no-effect success(`failureCode` 恒为 `none`,跳过原因保留在
|
|
22
|
+
`health().lastSkipReason === 'lottery-no-hit'`),完全不调用模型;命中时才启动
|
|
23
|
+
Agent,并把
|
|
24
|
+
被召回对象作为聚焦提示注入(recorded-idea 附带其 summary),模型围绕它展开思考。
|
|
25
|
+
全程确定性、可审计、可重放,随机性只来自 owner seed 的 HMAC,代码里没有
|
|
26
|
+
`Math.random`。
|
|
27
|
+
|
|
28
|
+
## 信任边界与权限
|
|
29
|
+
|
|
30
|
+
- Cordis 注入:`assistantAutomations`、`assistantDelivery`、`assistantEvaluation`、
|
|
31
|
+
`assistantGoals`、`assistantSkills`、`agents`、`sessions`、`tools`(全部是 Host
|
|
32
|
+
提供的服务)。模型调用本身经 `agents`/Agent Loop 与 Host 的 `llm` route 发生,
|
|
33
|
+
不直接持有 `llm` 服务;`assistantAutomations` 自带 `assistantPolicy` 依赖,授权与
|
|
34
|
+
预算检查发生在 Automations 边界。可选 `assistantPolicy` 存在时,插件会把 dream
|
|
35
|
+
Agent 绑定为 `background` initiator,避免前台规则/人工审批语义渗入无人值守 wake。
|
|
36
|
+
- 不读 Memory、不读原始 transcript/工具参数/验收回执、不读凭据;所有输入是 Host
|
|
37
|
+
投影后的有界摘要,每条带证据摘要,idea 必须引用本 wake 材料内的证据 digest。
|
|
38
|
+
- 工具面冻结为恰好一个 `dream_submit_ideas`;其余全局工具在 Agent setup 中
|
|
39
|
+
`restrict` 拒绝,并做精确 allowlist 断言。真实 Host 的 Policy 仍会检查这次工具
|
|
40
|
+
调用,默认拒绝的部署需要为它添加一条后台 allow 规则(见“安装与启用”)。
|
|
41
|
+
- 每次 occurrence 的预算预留/结算由 `assistant-automations` 持有;dreaming 执行器
|
|
42
|
+
不再重复预留,只在自己的账本里按 `maxDreamsPerDay` 计日上限。模型/工具调用
|
|
43
|
+
次数、输出 token、时长、输入字节、每日次数都有硬顶。
|
|
44
|
+
- 随机性是 `HMAC(seedDigest, lane+occurrence)` 的确定性抽签,可审计可重放,从不
|
|
45
|
+
调用 `Math.random`。
|
|
46
|
+
|
|
47
|
+
## 配置(全部默认关;未知字段拒绝)
|
|
48
|
+
|
|
49
|
+
| 键 | 默认 | 说明 |
|
|
50
|
+
| --- | --- | --- |
|
|
51
|
+
| `enabled` | `false` | 关闭时不注册 automation、不打开数据库、零写入。 |
|
|
52
|
+
| `retired` | `false` | owner 暂停开关:`enabled: true` 且 `retired: true` 时加载即把 system automation 收敛为 paused、不注册执行器(账本照常打开并执行保留期),用于暂停后再关闭/卸载。必须同时 `enabled: true`;`enabled: false` 时保留 `retired: true` 会 fail-closed 报错(disabled 路径无法 pause,不能让 owner 误以为已退役)。去掉该标志后的下一次加载用新的 reconcile key 恢复 active。 |
|
|
53
|
+
| `scope` | 无 | `workspace/preset/principalId/ownerRouteId`;启用时必填。 |
|
|
54
|
+
| `databasePath` | 无 | 私有 SQLite 绝对规范路径;启用时必填,目录不可组/全局可写。 |
|
|
55
|
+
| `baseIntervalMs` | `3600000` | 抽签节拍(15 分钟–24 小时),复用原生 Automations `every`。 |
|
|
56
|
+
| `runProbabilityPpm` | `250000` | 每节拍抽中率(0–1,000,000)。 |
|
|
57
|
+
| `idleMinMs` | `1800000` | 距最近可信活动至少 30 分钟才触发;缺活动标记 fail-closed。 |
|
|
58
|
+
| `lotteryWindow` | `5000` | 召回开奖号环形窗口半宽(0–500,000;0 = 仅精确票号命中),按命中率调节召回频率。 |
|
|
59
|
+
| `activeHours` | 无 | 同日窗口 `timezone/startMinute/endMinute`,不跨午夜。 |
|
|
60
|
+
| `randomSeed` | 无 | 可选 HMAC seed;只持久化其 digest。 |
|
|
61
|
+
| `maxDreamsPerDay` | `3` | 每日做梦次数硬顶(1–24)。 |
|
|
62
|
+
| `maxIdeasPerWake` | `3` | 每次 wake 最多 idea 数(1–5)。 |
|
|
63
|
+
| `maxModelCalls` / `maxToolCalls` / `maxOutputTokens` / `maxDurationMs` | `2/1/2048/90000` | 单轮冻结上限。 |
|
|
64
|
+
| `maxInputBytes` / `maxEvidenceRefs` | `16384/8` | 输入材料上限。 |
|
|
65
|
+
| `notifyOwner` | `false` | L1:开启后在每日/间隔门内发一条有界 owner 摘要(仅计数与前 3 条 summary,经 Delivery 认证通知通道;撤回/拒收不推断),默认关闭。 |
|
|
66
|
+
| `maxNotificationsPerDay` | `1` | L1 每日通知硬顶(0–3),不得超过 `maxDreamsPerDay`。 |
|
|
67
|
+
| `notifyMinIntervalMs` | `86400000` | 两次 L1 通知的最小间隔(1 分钟–7 天)。 |
|
|
68
|
+
| `budgetId` / `budgetAmount` | 无 | 必须成对;启用时必填,写入 system automation 定义,由 `assistant-automations` 在每个 occurrence 前预留并结算。Policy 里要有同 id、metric 为 `automation-runs` 的 budget。 |
|
|
69
|
+
| `provider` / `model` | 无 | 供应商中立通用字段,必须成对;启用时必填,必须是 Host 已注册的 LLM route。`reasoningEffort` 可选。 |
|
|
70
|
+
| `retentionDays` | `90` | idea 保留期;插件加载时与每次成功做梦后硬删除过期 idea。 |
|
|
71
|
+
|
|
72
|
+
启用时 fail-closed 校验:scope(含规范绝对 `workspace`)、规范绝对 `databasePath`、
|
|
73
|
+
provider/model 对、budget 对、`maxNotificationsPerDay <= maxDreamsPerDay`、activeHours
|
|
74
|
+
同日窗口;任何一项不满足直接拒绝装配。
|
|
75
|
+
|
|
76
|
+
## 安装与启用(真实部署)
|
|
77
|
+
|
|
78
|
+
插件默认关闭:安装后 `enabled: false`,不注册 automation、不打开 SQLite、零写入、
|
|
79
|
+
零模型调用。
|
|
80
|
+
|
|
81
|
+
1. 安装 bundle(npm 发布后)或把本地打包 tarball 装进目标 profile:
|
|
82
|
+
|
|
83
|
+
```sh
|
|
84
|
+
dsh plugin --profile <profile> add @dsh-enhanced/assistant-dreaming@0.1.67
|
|
85
|
+
# 或本地验证:pnpm --dir plugins/assistant-dreaming pack --pack-destination /tmp
|
|
86
|
+
# dsh plugin --profile <profile> add /tmp/dsh-enhanced-assistant-dreaming-0.1.67.tgz
|
|
87
|
+
dsh --profile <profile> --dump-config | grep -A2 assistant-dreaming
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
`dsh plugin add` 会把包注册进 profile 的 `dsh.profile.bundles`,bundle patch 插入
|
|
91
|
+
一行 `dsh-enhanced-assistant-dreaming`(无 config,即关闭状态)。
|
|
92
|
+
|
|
93
|
+
2. 在 profile 的 `cordis.patch.yml` 里按 id 覆盖该行,写入启用配置(值按实际 owner
|
|
94
|
+
替换;行内 config 是整段替换,不是深合并):
|
|
95
|
+
|
|
96
|
+
```yaml
|
|
97
|
+
- id: dsh-enhanced-assistant-dreaming
|
|
98
|
+
name: '@dsh-enhanced/assistant-dreaming'
|
|
99
|
+
config:
|
|
100
|
+
enabled: true
|
|
101
|
+
scope:
|
|
102
|
+
workspace: /Users/<owner>/.dsh/assistant-workspace # 规范绝对路径
|
|
103
|
+
preset: standard # 必须是该 workspace 的 Agent preset
|
|
104
|
+
principalId: <existing-delivery-principal-id>
|
|
105
|
+
ownerRouteId: <existing-delivery-owner-route-id>
|
|
106
|
+
databasePath: !!js dshHomePath('assistant-dreaming/dream.sqlite')
|
|
107
|
+
baseIntervalMs: 3600000 # 1 小时一个抽签槽
|
|
108
|
+
runProbabilityPpm: 250000 # 1/4 槽位通过触发门
|
|
109
|
+
idleMinMs: 1800000 # 距最近可信活动 ≥30 分钟
|
|
110
|
+
lotteryWindow: 5000 # 每个 subject 每槽约 1% 召回率
|
|
111
|
+
activeHours: { timezone: Asia/Shanghai, startMinute: 480, endMinute: 1380 }
|
|
112
|
+
randomSeed: "<owner 提供的 ≥16 字符 seed>"
|
|
113
|
+
maxDreamsPerDay: 3
|
|
114
|
+
maxIdeasPerWake: 3
|
|
115
|
+
budgetId: assistant-dreaming-runs
|
|
116
|
+
budgetAmount: 1
|
|
117
|
+
provider: <host-registered-llm-provider>
|
|
118
|
+
model: <host-registered-model-id>
|
|
119
|
+
# 可选 L1 摘要通知;默认关闭:
|
|
120
|
+
# notifyOwner: true
|
|
121
|
+
# maxNotificationsPerDay: 1
|
|
122
|
+
# notifyMinIntervalMs: 86400000
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
3. Host 侧前置条件(缺一不可,缺失时按 fail-closed 处理而不是伪造成功):
|
|
126
|
+
|
|
127
|
+
- **Automations 调度器**:目标 profile 的 `assistant-automations` 行必须
|
|
128
|
+
`schedulerEnabled: true`(插件默认 `false`),否则 automation 注册成功但永远
|
|
129
|
+
不会触发;同时 `allowUnbudgetedExecution` 保持默认 `false`。
|
|
130
|
+
- **Policy 预算**:`budgetId` 必须在 `assistant-policy` 的 `budgets` 里存在且
|
|
131
|
+
metric 精确为 `automation-runs`;Automations 在每个 occurrence 调用执行器前
|
|
132
|
+
预留、结束后结算 `budgetAmount`。因为**每个调度槽**都会消耗一次,budget 的
|
|
133
|
+
limit/period 至少要覆盖该周期内的槽位数(例如 1 小时节拍 + 每日 limit 24),
|
|
134
|
+
否则当天晚些槽位会因预算耗尽跳过。
|
|
135
|
+
|
|
136
|
+
```yaml
|
|
137
|
+
budgets:
|
|
138
|
+
- id: assistant-dreaming-runs
|
|
139
|
+
metric: automation-runs
|
|
140
|
+
limit: 24 # 1 小时节拍时覆盖一天 24 个槽
|
|
141
|
+
periodMs: 86400000
|
|
142
|
+
scope: subject
|
|
143
|
+
```
|
|
144
|
+
- **Policy 规则(默认 deny 的 profile 必须配,否则加载即失败)**:
|
|
145
|
+
`assistant-automations` 在**加载时**先以 background subject
|
|
146
|
+
`{kind: background, id: 'assistant-dreaming', workspace, principal}`、
|
|
147
|
+
action `reconcile` 请求授权(缺失时 `reconcileSystem` 抛 policy-denied,插件
|
|
148
|
+
等加载失败并已自行清理),每次 occurrence 又以
|
|
149
|
+
`{kind: background, id: <automationId>, ...}`、action `execute` 授权。
|
|
150
|
+
因此 automation 规则要同时覆盖 `reconcile` 与 `execute`,subject id 用
|
|
151
|
+
`'*'`(owner id 与 automation id 都会出现),workspace/principal 必须与
|
|
152
|
+
scope 精确一致(身份字段不能用通配)。冻结 Agent 里的唯一工具
|
|
153
|
+
`dream_submit_ideas` 也要 allow;dream Agent 已绑定 background initiator,
|
|
154
|
+
所以用 `initiators: [background]`。若 profile 已设
|
|
155
|
+
`toolDefaultEffect: allow`,工具规则可省略。示意:
|
|
156
|
+
|
|
157
|
+
```yaml
|
|
158
|
+
rules:
|
|
159
|
+
- id: assistant-dreaming-automation
|
|
160
|
+
effect: allow
|
|
161
|
+
subject: { kind: background, id: '*', workspace: /Users/<owner>/.dsh/assistant-workspace, principal: <principal> }
|
|
162
|
+
actions: [reconcile, execute]
|
|
163
|
+
resource: { kind: automation, id: 'dsh-enhanced-assistant-dreaming:*' }
|
|
164
|
+
context: { initiators: [background] }
|
|
165
|
+
- id: assistant-dreaming-submit
|
|
166
|
+
effect: allow
|
|
167
|
+
subject: { kind: agent, id: standard, workspace: /Users/<owner>/.dsh/assistant-workspace, principal: <principal> }
|
|
168
|
+
actions: [execute]
|
|
169
|
+
resource: { kind: tool, id: dream_submit_ideas }
|
|
170
|
+
context: { initiators: [background] }
|
|
171
|
+
# 仅 notifyOwner: true 时需要(L1 摘要走 Delivery 后台 send)
|
|
172
|
+
- id: assistant-dreaming-notify
|
|
173
|
+
effect: allow
|
|
174
|
+
subject: { kind: background, id: 'assistant-dreaming-idea-summary/v1', workspace: /Users/<owner>/.dsh/assistant-workspace }
|
|
175
|
+
actions: [send]
|
|
176
|
+
resource: { kind: message, id: '*' }
|
|
177
|
+
context: { initiators: [background] }
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
- **Delivery owner route**:`ownerRouteId` 必须是 Delivery 中既有的、已认证 active
|
|
181
|
+
route;生成输入材料前会用当前 route 重新校验,缺失/撤权时该 wake 以
|
|
182
|
+
`dream-material-unavailable`(配置类失败、零模型调用)结束。开启
|
|
183
|
+
`notifyOwner` 时还需要上面的 Delivery `send` 规则;Delivery 校验失败时不发送,
|
|
184
|
+
插件把通知失败当成“不影响做梦结果”,不伪造送达。
|
|
185
|
+
- **模型 route**:`provider`/`model` 必须是 Host LLM 插件已注册的 route;dreaming
|
|
186
|
+
不携带凭据,也不读环境变量里的 key。
|
|
187
|
+
|
|
188
|
+
4. 启用后产生的副作用:
|
|
189
|
+
|
|
190
|
+
- 每个通过触发门且召回抽奖命中的槽位会创建一次冻结 Agent 并调用**付费模型**
|
|
191
|
+
(上限 `maxModelCalls`/`maxToolCalls`/`maxOutputTokens`/`maxDurationMs`);
|
|
192
|
+
未命中抽奖的槽位零模型调用。
|
|
193
|
+
- 写入 `databasePath` 指向的插件私有 SQLite(WAL/SHM;目录必须 owner-private,
|
|
194
|
+
组/全局可写会拒绝启动):`dream_runs`/`dream_ideas`/`dream_idea_events`/
|
|
195
|
+
`dream_counters`/`dream_tickets`/`dream_recalls`。
|
|
196
|
+
- 默认只有私有 idea,不写 Goals/WorkItems、不创建候选、不自动采用、不发消息;
|
|
197
|
+
`notifyOwner: true` 时才通过 Delivery 认证通道发有界摘要(每日/间隔门内)。
|
|
198
|
+
- 自有 idea 读取:服务只读 `health()` / `inspectIdeas()`。`retire()` 方法会
|
|
199
|
+
暂停 system automation、注销执行器并保留账本,但**仓库当前没有普通 owner 可
|
|
200
|
+
直接调用的 retire 入口**(它是 Host 侧 service API,只有测试/新的 Host 调用方
|
|
201
|
+
会用到),所以 owner 的实际退役路径是配置项 `retired: true`:
|
|
202
|
+
1) 在 profile patch 里保持完整配置、加 `retired: true`,重载/重启 profile:
|
|
203
|
+
automation 收敛为 paused、执行器不注册;构造失败时插件会自行回滚
|
|
204
|
+
executor 与账本再抛错,不会留下半装状态;
|
|
205
|
+
2) 确认 paused 后,把 `enabled` 设为 `false`(或移除/卸载 bundle);**同一次
|
|
206
|
+
修改里必须删除 `retired`**:`enabled: false` + `retired: true` 会被配置
|
|
207
|
+
fail-closed 拒绝(disabled 路径在 reconcile 之前就返回,根本不会 pause,
|
|
208
|
+
接受该组合会制造“看起来已安全退役”的假象);
|
|
209
|
+
3) 恢复时删除 `retired`(或设 false)并重载:active 与 paused 的 reconcile key
|
|
210
|
+
都按每次加载生成(Automations 对相同 key 回放旧收据),所以 resume、
|
|
211
|
+
重复 retire、resume 后再 retire 都能收敛到目标状态,不会被旧收据挡住。
|
|
212
|
+
代价是每次加载多一条 system-reconcile 审计收据(已知限制 P2)。
|
|
213
|
+
若已误把 `enabled` 改成 false:Automations 在 materialize 阶段就找不到执行器,
|
|
214
|
+
会为每个到期 slot 记录 availability incident(**不产生 run**,也没有模型调用),
|
|
215
|
+
需要用 Automations 的 owner/system ownership 入口暂停或删除该
|
|
216
|
+
`dsh-enhanced-assistant-dreaming:*` 行,然后重载 profile。
|
|
217
|
+
|
|
218
|
+
## 账本
|
|
219
|
+
|
|
220
|
+
`dream_runs`(每次抽签/运行与 drawDigest)、`dream_ideas`(含状态机
|
|
221
|
+
`recorded → owner-acknowledged → validated/rejected` 或 `withdrawn`,同 lane 同日
|
|
222
|
+
同摘要去重)、`dream_idea_events`、`dream_counters`(每日做梦/通知计数)、
|
|
223
|
+
`dream_tickets`(每个 subject 的稳定票号,重复登记不覆盖原票)、`dream_recalls`
|
|
224
|
+
(每次开奖命中的审计行,槽位重放幂等)。
|
|
225
|
+
`PRAGMA user_version=2`(schema 2 仅对 1 做加法迁移),schema 变新即拒绝启动。
|
|
226
|
+
插件加载时把重启遗留的 running 行改为 `interrupted`,并按 `retentionDays` 硬删除
|
|
227
|
+
过期 idea(每次成功做梦后再执行一次);`dream_runs` 的审计摘要保留。
|
|
228
|
+
|
|
229
|
+
## 不做的事
|
|
230
|
+
|
|
231
|
+
- 除可选 L1 摘要通知外不发消息;不读 Memory(S4)、不读 web、不调用任何写工具或
|
|
232
|
+
Goal/WorkItem 候选 API。
|
|
233
|
+
- 不评分、不排序、不把工具成功或 owner 沉默当作收益证据;任何"采用"只认后续真实
|
|
234
|
+
owner 动作或独立验收轨道。
|
|
235
|
+
- 不新建循环或定时器:调度完全走 `assistant-automations`,`misfire: skip`、
|
|
236
|
+
`overlap: skip`、`retrySafety: never`、`maxRetries: 0`,重启后 running 仅转
|
|
237
|
+
`interrupted`,不自动重放;错过的 slot 不会补跑,避免停机后集中产生付费调用。
|
|
238
|
+
- 执行器不自行预留预算:每个 occurrence 的 Policy budget 由 `assistant-automations`
|
|
239
|
+
在调用执行器前预留并结算,执行结果只报告 outcome/副作用/可重试性,不报告预算结算。
|
|
240
|
+
|
|
241
|
+
## 已知限制
|
|
242
|
+
|
|
243
|
+
- P2:active 与 paused reconcile key 都带每次加载的 nonce,每次加载会向 Automations
|
|
244
|
+
的 system-reconcile 审计表追加一条收据;行数随插件加载次数增长(低频、只增不改)。
|
|
245
|
+
- P3:`retired` 参与 configDigest,而 configDigest 也用作 definition 的
|
|
246
|
+
`activationNonce`;切换 retired 会更新 system automation 的 definition hash。
|
|
247
|
+
这是 resume 时重新收敛定义的结果,不影响正确性,但审计上会看到 definition 版本变化。
|
|
248
|
+
- P5:两个真实 `HostAutomationExecutorRegistry` 用例在 sibling
|
|
249
|
+
`assistant-automations/lib` 不存在时跳过(`pnpm check` 先 build,正常会执行);
|
|
250
|
+
镜像终态断言始终执行。
|
|
251
|
+
- enabled:false 不会自动 pause 上次注册的 system automation(需要 Policy
|
|
252
|
+
`reconcile` 授权且与“关闭零写入”冲突);必须按上面的 retired 顺序退役。
|
|
253
|
+
|
|
254
|
+
## 测试
|
|
255
|
+
|
|
256
|
+
`pnpm --filter @dsh-enhanced/assistant-dreaming test`(54 个用例,6 个文件):
|
|
257
|
+
config fail-closed、确定性抽签/active-hours/idle/日上限门、确定性票号/环形窗口匹配、
|
|
258
|
+
SQLite 账本/状态机/保留期(含带生命周期事件的过期 idea)/schema 1→2 迁移/ownData
|
|
259
|
+
防护、L1 通知路由验证与 fail-closed、真实 AgentLoop 冻结单工具集成,以及真实
|
|
260
|
+
Cordis 装载测试:
|
|
261
|
+
|
|
262
|
+
- 默认导出服务类可被 `ctx.plugin` 以 `(ctx, config)` 装载;关闭态不注册 automation、
|
|
263
|
+
不注册执行器、不打开 SQLite。
|
|
264
|
+
- 启用态 reconcile 出的 system automation 定义(`every`/锚点/interval、
|
|
265
|
+
`misfire: skip`、`overlap: skip`、budget、Host execution spec)与注册的
|
|
266
|
+
`assistant-dreaming-v1` 执行器 allowlist。
|
|
267
|
+
- 执行器 4 条 wake 路径(preview / 触发门未过 / 抽奖未命中 / agent 失败 + 成功提交
|
|
268
|
+
idea)的终态在测试里用本地镜像断言检查,并在 `assistant-automations` 构建产物
|
|
269
|
+
存在时,额外用**真实** `HostAutomationExecutorRegistry.execute`(生产侧在
|
|
270
|
+
`host-executors.ts` 的 `validateHostExecutorResult` 校验)跑真实注册/执行路径;
|
|
271
|
+
镜像断言不是生产校验器,只为在无 sibling 构建时覆盖插件侧终态。
|
|
272
|
+
- 构造失败(例如 reconcile 被 Policy 拒绝)会回滚已注册 executor 与账本并抛错,
|
|
273
|
+
回归测试验证:失败后 registry 无残留 descriptor、下一次装载能成功(含真实
|
|
274
|
+
registry 的 duplicate-descriptor 断言)。
|
|
275
|
+
- 加载时按 `retentionDays` 清理过期 idea(先删事件再删 idea,事件外键不会让保留期
|
|
276
|
+
静默失效);`retire()` 暂停 automation 但保留账本;`retired: true` 加载为 paused
|
|
277
|
+
且不注册执行器。
|
|
278
|
+
- 状态收敛回归:retire 后重载恢复 active;**retired → resume → 再次 retired 必须
|
|
279
|
+
paused**;**reload 后调用 retire() 必须 paused**(paused reconcile key 也必须
|
|
280
|
+
每次加载唯一,否则旧 paused 收据会让行卡在 active 而插件已 dormant)。
|
|
281
|
+
|
|
282
|
+
完整真实模型长跑与真实通知发送留待运行验收;`test` 不访问网络、不调用真实模型。
|
package/cordis.patch.yml
ADDED
package/lib/config.d.ts
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import Schema from '@deepseek-ai/schemastery';
|
|
2
|
+
/**
|
|
3
|
+
* The dreaming plugin is opt-in and fail-closed: when disabled it registers no
|
|
4
|
+
* automation, opens no database and performs no work. Every bound below is an
|
|
5
|
+
* owner configuration value; model output can never supply paths, budgets or
|
|
6
|
+
* targets.
|
|
7
|
+
*/
|
|
8
|
+
export interface DreamingScopeConfig {
|
|
9
|
+
workspace: string;
|
|
10
|
+
preset: string;
|
|
11
|
+
principalId: string;
|
|
12
|
+
ownerRouteId: string;
|
|
13
|
+
}
|
|
14
|
+
export interface DreamingActiveHours {
|
|
15
|
+
timezone: string;
|
|
16
|
+
/** Minutes since local midnight; same-day window only, no midnight crossing. */
|
|
17
|
+
startMinute: number;
|
|
18
|
+
endMinute: number;
|
|
19
|
+
}
|
|
20
|
+
export interface DreamingConfig {
|
|
21
|
+
enabled?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Owner pause switch: load in the paused state (reconcile the system
|
|
24
|
+
* automation to paused, register no executor) while keeping full config.
|
|
25
|
+
* Removing the flag on the next load resumes with a fresh reconcile nonce.
|
|
26
|
+
*/
|
|
27
|
+
retired?: boolean;
|
|
28
|
+
scope?: DreamingScopeConfig;
|
|
29
|
+
databasePath?: string;
|
|
30
|
+
baseIntervalMs?: number;
|
|
31
|
+
runProbabilityPpm?: number;
|
|
32
|
+
idleMinMs?: number;
|
|
33
|
+
activeHours?: DreamingActiveHours;
|
|
34
|
+
/** Optional owner-supplied HMAC seed; randomness stays deterministic. */
|
|
35
|
+
randomSeed?: string;
|
|
36
|
+
/** Half-width of the recall lottery's circular window around the draw. */
|
|
37
|
+
lotteryWindow?: number;
|
|
38
|
+
maxDreamsPerDay?: number;
|
|
39
|
+
maxIdeasPerWake?: number;
|
|
40
|
+
maxModelCalls?: number;
|
|
41
|
+
maxToolCalls?: number;
|
|
42
|
+
maxOutputTokens?: number;
|
|
43
|
+
maxDurationMs?: number;
|
|
44
|
+
maxInputBytes?: number;
|
|
45
|
+
maxEvidenceRefs?: number;
|
|
46
|
+
notifyOwner?: boolean;
|
|
47
|
+
maxNotificationsPerDay?: number;
|
|
48
|
+
notifyMinIntervalMs?: number;
|
|
49
|
+
budgetId?: string;
|
|
50
|
+
budgetAmount?: number;
|
|
51
|
+
provider?: string;
|
|
52
|
+
model?: string;
|
|
53
|
+
reasoningEffort?: string;
|
|
54
|
+
retentionDays?: number;
|
|
55
|
+
}
|
|
56
|
+
export interface NormalizedDreamingConfig {
|
|
57
|
+
readonly enabled: boolean;
|
|
58
|
+
readonly retired: boolean;
|
|
59
|
+
readonly scope: DreamingScopeConfig | null;
|
|
60
|
+
readonly databasePath: string | null;
|
|
61
|
+
readonly baseIntervalMs: number;
|
|
62
|
+
readonly runProbabilityPpm: number;
|
|
63
|
+
readonly idleMinMs: number;
|
|
64
|
+
readonly lotteryWindow: number;
|
|
65
|
+
readonly activeHours: DreamingActiveHours | null;
|
|
66
|
+
readonly seedDigest: string | null;
|
|
67
|
+
readonly maxDreamsPerDay: number;
|
|
68
|
+
readonly maxIdeasPerWake: number;
|
|
69
|
+
readonly maxModelCalls: number;
|
|
70
|
+
readonly maxToolCalls: number;
|
|
71
|
+
readonly maxOutputTokens: number;
|
|
72
|
+
readonly maxDurationMs: number;
|
|
73
|
+
readonly maxInputBytes: number;
|
|
74
|
+
readonly maxEvidenceRefs: number;
|
|
75
|
+
readonly notifyOwner: boolean;
|
|
76
|
+
readonly maxNotificationsPerDay: number;
|
|
77
|
+
readonly notifyMinIntervalMs: number;
|
|
78
|
+
readonly budgetId: string | null;
|
|
79
|
+
readonly budgetAmount: number | null;
|
|
80
|
+
readonly provider: string | null;
|
|
81
|
+
readonly model: string | null;
|
|
82
|
+
readonly reasoningEffort: string | null;
|
|
83
|
+
readonly retentionDays: number;
|
|
84
|
+
}
|
|
85
|
+
export declare const Config: Schema<DreamingConfig>;
|
|
86
|
+
export declare function normalizeConfig(input?: DreamingConfig): Readonly<NormalizedDreamingConfig>;
|
|
87
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAEA,OAAO,MAAM,MAAM,0BAA0B,CAAA;AAE7C;;;;;GAKG;AAEH,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,MAAM,CAAA;IACd,WAAW,EAAE,MAAM,CAAA;IACnB,YAAY,EAAE,MAAM,CAAA;CACrB;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,CAAA;IAChB,gFAAgF;IAChF,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,KAAK,CAAC,EAAE,mBAAmB,CAAA;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAA;IAGrB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,WAAW,CAAC,EAAE,mBAAmB,CAAA;IACjC,yEAAyE;IACzE,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,0EAA0E;IAC1E,aAAa,CAAC,EAAE,MAAM,CAAA;IAGtB,eAAe,CAAC,EAAE,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Aa,EAAE,MAAM,CAAA;IAC9B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;IAC7B,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAA;IAChC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;IAC9B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;IAC9B,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAA;IAChC,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAA;IAC7B,QAAQ,CAAC,sBAAsB,EAAE,MAAM,CAAA;IACvC,QAAQ,CAAC,mBAAmB,EAAE,MAAM,CAAA;IACpC,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IAChC,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;IACpC,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IAChC,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,QAAQ,CAAC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAA;IACvC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;CAC/B;AA8DD,eAAO,MAAM,MAAM,EAab,MAAM,CAAC,cAAc,CAAC,CAAA;AAE5B,wBAAgB,eAAe,CAAC,KAAK,CAAC,EAAE,cAAc,GAAG,QAAQ,CAAC,wBAAwB,CAAC,CA0E1F"}
|
package/lib/config.js
ADDED
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
import { isAbsolute, resolve } from 'node:path';
|
|
3
|
+
import Schema from '@deepseek-ai/schemastery';
|
|
4
|
+
const fields = new Set([
|
|
5
|
+
'enabled', 'retired', 'scope', 'databasePath', 'baseIntervalMs', 'runProbabilityPpm', 'idleMinMs', 'lotteryWindow',
|
|
6
|
+
'activeHours', 'randomSeed', 'maxDreamsPerDay', 'maxIdeasPerWake', 'maxModelCalls', 'maxToolCalls',
|
|
7
|
+
'maxOutputTokens', 'maxDurationMs', 'maxInputBytes', 'maxEvidenceRefs', 'notifyOwner',
|
|
8
|
+
'maxNotificationsPerDay', 'notifyMinIntervalMs', 'budgetId', 'budgetAmount', 'provider', 'model',
|
|
9
|
+
'reasoningEffort', 'retentionDays',
|
|
10
|
+
]);
|
|
11
|
+
const boundedText = (max) => Schema.string().min(1).max(max);
|
|
12
|
+
const scopeSchema = Schema.object({
|
|
13
|
+
workspace: boundedText(4_096).required(),
|
|
14
|
+
preset: boundedText(256).required(),
|
|
15
|
+
principalId: boundedText(256).required(),
|
|
16
|
+
ownerRouteId: boundedText(256).required(),
|
|
17
|
+
}).default(undefined);
|
|
18
|
+
const activeHoursSchema = Schema.object({
|
|
19
|
+
timezone: boundedText(128).required(),
|
|
20
|
+
startMinute: Schema.natural().min(0).max(1_439).required(),
|
|
21
|
+
endMinute: Schema.natural().min(1).max(1_440).required(),
|
|
22
|
+
}).default(undefined);
|
|
23
|
+
const schema = Schema.object({
|
|
24
|
+
enabled: Schema.boolean().default(false),
|
|
25
|
+
retired: Schema.boolean().default(false),
|
|
26
|
+
scope: scopeSchema,
|
|
27
|
+
databasePath: boundedText(4_096),
|
|
28
|
+
baseIntervalMs: Schema.natural().min(900_000).max(86_400_000).default(3_600_000),
|
|
29
|
+
runProbabilityPpm: Schema.natural().min(0).max(1_000_000).default(250_000),
|
|
30
|
+
idleMinMs: Schema.natural().min(300_000).max(86_400_000).default(1_800_000),
|
|
31
|
+
lotteryWindow: Schema.natural().min(0).max(500_000).default(5_000),
|
|
32
|
+
activeHours: activeHoursSchema,
|
|
33
|
+
randomSeed: Schema.string().min(16).max(256),
|
|
34
|
+
maxDreamsPerDay: Schema.natural().min(1).max(24).default(3),
|
|
35
|
+
maxIdeasPerWake: Schema.natural().min(1).max(5).default(3),
|
|
36
|
+
maxModelCalls: Schema.natural().min(1).max(8).default(2),
|
|
37
|
+
maxToolCalls: Schema.natural().min(0).max(8).default(1),
|
|
38
|
+
maxOutputTokens: Schema.natural().min(1).max(4_096).default(2_048),
|
|
39
|
+
maxDurationMs: Schema.natural().min(1_000).max(300_000).default(90_000),
|
|
40
|
+
maxInputBytes: Schema.natural().min(1_024).max(65_536).default(16_384),
|
|
41
|
+
maxEvidenceRefs: Schema.natural().min(1).max(16).default(8),
|
|
42
|
+
notifyOwner: Schema.boolean().default(false),
|
|
43
|
+
maxNotificationsPerDay: Schema.natural().min(0).max(3).default(1),
|
|
44
|
+
notifyMinIntervalMs: Schema.natural().min(60_000).max(604_800_000).default(86_400_000),
|
|
45
|
+
budgetId: boundedText(128),
|
|
46
|
+
// Automations bounds the per-run budget amount to 10,000,000; reject larger
|
|
47
|
+
// values here instead of failing later while reconciling the definition.
|
|
48
|
+
budgetAmount: Schema.natural().min(1).max(10_000_000),
|
|
49
|
+
provider: boundedText(256),
|
|
50
|
+
model: boundedText(256),
|
|
51
|
+
reasoningEffort: boundedText(128),
|
|
52
|
+
retentionDays: Schema.natural().min(1).max(365).default(90),
|
|
53
|
+
}).default(undefined);
|
|
54
|
+
export const Config = new Proxy(schema, {
|
|
55
|
+
apply(target, thisArg, argumentsList) {
|
|
56
|
+
const value = argumentsList[0];
|
|
57
|
+
if (value !== undefined && (value === null || typeof value !== 'object' || Array.isArray(value))) {
|
|
58
|
+
throw new Error('assistant-dreaming: config must be an object');
|
|
59
|
+
}
|
|
60
|
+
if (value !== undefined) {
|
|
61
|
+
for (const key of Object.keys(value)) {
|
|
62
|
+
if (!fields.has(key))
|
|
63
|
+
throw new Error(`assistant-dreaming: unknown config field: ${key}`);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return Reflect.apply(target, thisArg, argumentsList);
|
|
67
|
+
},
|
|
68
|
+
});
|
|
69
|
+
export function normalizeConfig(input) {
|
|
70
|
+
const config = (Config(input) ?? {});
|
|
71
|
+
const normalized = Object.freeze({
|
|
72
|
+
enabled: config.enabled ?? false,
|
|
73
|
+
retired: config.retired ?? false,
|
|
74
|
+
scope: config.scope ? Object.freeze({ ...config.scope }) : null,
|
|
75
|
+
databasePath: config.databasePath ?? null,
|
|
76
|
+
baseIntervalMs: config.baseIntervalMs ?? 3_600_000,
|
|
77
|
+
runProbabilityPpm: config.runProbabilityPpm ?? 250_000,
|
|
78
|
+
idleMinMs: config.idleMinMs ?? 1_800_000,
|
|
79
|
+
lotteryWindow: config.lotteryWindow ?? 5_000,
|
|
80
|
+
activeHours: config.activeHours ? Object.freeze({ ...config.activeHours }) : null,
|
|
81
|
+
seedDigest: config.randomSeed === undefined
|
|
82
|
+
? null : createHash('sha256').update(config.randomSeed).digest('hex'),
|
|
83
|
+
maxDreamsPerDay: config.maxDreamsPerDay ?? 3,
|
|
84
|
+
maxIdeasPerWake: config.maxIdeasPerWake ?? 3,
|
|
85
|
+
maxModelCalls: config.maxModelCalls ?? 2,
|
|
86
|
+
maxToolCalls: config.maxToolCalls ?? 1,
|
|
87
|
+
maxOutputTokens: config.maxOutputTokens ?? 2_048,
|
|
88
|
+
maxDurationMs: config.maxDurationMs ?? 90_000,
|
|
89
|
+
maxInputBytes: config.maxInputBytes ?? 16_384,
|
|
90
|
+
maxEvidenceRefs: config.maxEvidenceRefs ?? 8,
|
|
91
|
+
notifyOwner: config.notifyOwner ?? false,
|
|
92
|
+
maxNotificationsPerDay: config.maxNotificationsPerDay ?? 1,
|
|
93
|
+
notifyMinIntervalMs: config.notifyMinIntervalMs ?? 86_400_000,
|
|
94
|
+
budgetId: config.budgetId ?? null,
|
|
95
|
+
budgetAmount: config.budgetAmount ?? null,
|
|
96
|
+
provider: config.provider ?? null,
|
|
97
|
+
model: config.model ?? null,
|
|
98
|
+
reasoningEffort: config.reasoningEffort ?? null,
|
|
99
|
+
retentionDays: config.retentionDays ?? 90,
|
|
100
|
+
});
|
|
101
|
+
if (normalized.enabled) {
|
|
102
|
+
if (!normalized.scope)
|
|
103
|
+
throw new Error('assistant-dreaming: enabled requires an explicit owner scope');
|
|
104
|
+
// The frozen workspace becomes an Automations definition field, so it must
|
|
105
|
+
// already be the canonical absolute path that definition normalization
|
|
106
|
+
// accepts; reject it at load time instead of failing reconciliation later.
|
|
107
|
+
if (!isAbsolute(normalized.scope.workspace) || resolve(normalized.scope.workspace) !== normalized.scope.workspace) {
|
|
108
|
+
throw new Error('assistant-dreaming: enabled requires a canonical absolute scope.workspace');
|
|
109
|
+
}
|
|
110
|
+
if (normalized.databasePath === null || !isAbsolute(normalized.databasePath)
|
|
111
|
+
|| resolve(normalized.databasePath) !== normalized.databasePath) {
|
|
112
|
+
throw new Error('assistant-dreaming: enabled requires a canonical absolute databasePath');
|
|
113
|
+
}
|
|
114
|
+
if (normalized.provider === null || normalized.model === null) {
|
|
115
|
+
throw new Error('assistant-dreaming: enabled requires an explicit provider and model');
|
|
116
|
+
}
|
|
117
|
+
if (normalized.budgetId === null || normalized.budgetAmount === null) {
|
|
118
|
+
throw new Error('assistant-dreaming: enabled requires a budgetId and budgetAmount pair');
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
if ((normalized.provider === null) !== (normalized.model === null)) {
|
|
122
|
+
throw new Error('assistant-dreaming: provider and model must be configured together');
|
|
123
|
+
}
|
|
124
|
+
if (normalized.reasoningEffort !== null && normalized.provider === null) {
|
|
125
|
+
throw new Error('assistant-dreaming: reasoningEffort requires an explicit provider and model');
|
|
126
|
+
}
|
|
127
|
+
if ((normalized.budgetId === null) !== (normalized.budgetAmount === null)) {
|
|
128
|
+
throw new Error('assistant-dreaming: budgetId and budgetAmount must be configured together');
|
|
129
|
+
}
|
|
130
|
+
if (normalized.activeHours && normalized.activeHours.startMinute >= normalized.activeHours.endMinute) {
|
|
131
|
+
throw new Error('assistant-dreaming: activeHours must be a same-day window with startMinute < endMinute');
|
|
132
|
+
}
|
|
133
|
+
if (normalized.maxNotificationsPerDay > normalized.maxDreamsPerDay) {
|
|
134
|
+
throw new Error('assistant-dreaming: maxNotificationsPerDay cannot exceed maxDreamsPerDay');
|
|
135
|
+
}
|
|
136
|
+
// `retired` only pauses through the enabled loading path (it reconciles the
|
|
137
|
+
// existing system automation to paused). A disabled row returns before that
|
|
138
|
+
// point and cannot pause anything, so accepting the combination would
|
|
139
|
+
// silently leave a previously active automation running. Fail closed instead.
|
|
140
|
+
if (normalized.retired && !normalized.enabled) {
|
|
141
|
+
throw new Error('assistant-dreaming: retired requires enabled: true; pause the enabled row first, then remove retired before disabling');
|
|
142
|
+
}
|
|
143
|
+
return normalized;
|
|
144
|
+
}
|
|
145
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAC/C,OAAO,MAAM,MAAM,0BAA0B,CAAA;AAmG7C,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC;IACrB,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,WAAW,EAAE,eAAe;IAClH,aAAa,EAAE,YAAY,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,eAAe,EAAE,cAAc;IAClG,iBAAiB,EAAE,eAAe,EAAE,eAAe,EAAE,iBAAiB,EAAE,aAAa;IACrF,wBAAwB,EAAE,qBAAqB,EAAE,UAAU,EAAE,cAAc,EAAE,UAAU,EAAE,OAAO;IAChG,iBAAiB,EAAE,eAAe;CACnC,CAAC,CAAA;AAEF,MAAM,WAAW,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;AAEpE,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC;IAChC,SAAS,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE;IACxC,MAAM,EAAE,WAAW,CAAC,GA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C,UAAU,CAAC,YAAY,KAAK,IAAI,CAAC,EAAE,CAAC;QAC1E,MAAM,IAAI,KAAK,CAAC,2EAA2E,CAAC,CAAA;IAC9F,CAAC;IACD,IAAI,UAAU,CAAC,WAAW,IAAI,UAAU,CAAC,WAAW,CAAC,WAAW,IAAI,UAAU,CAAC,WAAW,CAAC,SAAS,EAAE,CAAC;QACrG,MAAM,IAAI,KAAK,CAAC,wFAAwF,CAAC,CAAA;IAC3G,CAAC;IACD,IAAI,UAAU,CAAC,sBAAsB,GAAG,UAAU,CAAC,eAAe,EAAE,CAAC;QACnE,MAAM,IAAI,KAAK,CAAC,0EAA0E,CAAC,CAAA;IAC7F,CAAC;IACD,4EAA4E;IAC5E,4EAA4E;IAC5E,sEAAsE;IACtE,8EAA8E;IAC9E,IAAI,UAAU,CAAC,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC;QAC9C,MAAM,IAAI,KAAK,CAAC,uHAAuH,CAAC,CAAA;IAC1I,CAAC;IACD,OAAO,UAAU,CAAA;AACnB,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import type { NormalizedDreamingConfig, DreamingScopeConfig } from './config.js';
|
|
3
|
+
import type { DreamMaterial } from './projection.js';
|
|
4
|
+
/**
|
|
5
|
+
* Bounded dreaming child agent. The complete tool surface is exactly one
|
|
6
|
+
* model-callable tool (`dream_submit_ideas`); everything else is denied before
|
|
7
|
+
* the first request, and the run is pinned by a deadline, model and call caps.
|
|
8
|
+
*/
|
|
9
|
+
export interface DreamAgentModel {
|
|
10
|
+
provider: string;
|
|
11
|
+
model: string;
|
|
12
|
+
reasoningEffort?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface SubmittedIdea {
|
|
15
|
+
summary: string;
|
|
16
|
+
detail: string;
|
|
17
|
+
evidenceRefs: string[];
|
|
18
|
+
}
|
|
19
|
+
export interface DreamRecallFocus {
|
|
20
|
+
kind: string;
|
|
21
|
+
key: string;
|
|
22
|
+
ticketValue: number;
|
|
23
|
+
distance: number;
|
|
24
|
+
/** For subjects not inside the projection material (e.g. recorded ideas), the recalled text itself. */
|
|
25
|
+
summary?: string;
|
|
26
|
+
}
|
|
27
|
+
export interface DreamAgentInput {
|
|
28
|
+
ctx: Context;
|
|
29
|
+
wakeId: string;
|
|
30
|
+
config: NormalizedDreamingConfig;
|
|
31
|
+
model: DreamAgentModel;
|
|
32
|
+
scope: DreamingScopeConfig;
|
|
33
|
+
material: DreamMaterial;
|
|
34
|
+
/**
|
|
35
|
+
* Subjects recalled by the code-driven lottery for this wake. When present,
|
|
36
|
+
* the wake must focus its thought on them; they remain untrusted task data.
|
|
37
|
+
*/
|
|
38
|
+
recallHits?: readonly DreamRecallFocus[];
|
|
39
|
+
deadlineAt: number;
|
|
40
|
+
signal: AbortSignal;
|
|
41
|
+
/** Records the accepted ideas and returns the persisted count. */
|
|
42
|
+
onSubmit(ideas: readonly SubmittedIdea[]): number;
|
|
43
|
+
}
|
|
44
|
+
export interface DreamAgentResult {
|
|
45
|
+
outcome: 'succeeded' | 'failed' | 'cancelled' | 'unknown';
|
|
46
|
+
ideaCount: number;
|
|
47
|
+
}
|
|
48
|
+
export declare function runDreamAgent(input: DreamAgentInput): Promise<DreamAgentResult>;
|
|
49
|
+
declare module '@deepseek-ai/dsh-llm' {
|
|
50
|
+
interface MessageSourceMap {
|
|
51
|
+
'assistant-dreaming': {
|
|
52
|
+
kind: 'assistant-dreaming';
|
|
53
|
+
form?: 'notice';
|
|
54
|
+
summary?: string;
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=dream-agent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dream-agent.d.ts","sourceRoot":"","sources":["../src/dream-agent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAKlD,OAAO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