engine7 7.1.106 → 7.1.112
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/dist/cli.mjs +3584 -959
- package/dist/engine-startup.mjs +2075 -1405
- package/dist/main.mjs +2007 -1345
- package/package.json +11 -4
- package/templates/config.template.json +1 -1
- package/templates/workspace/prompts/proactive.md +40 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "engine7",
|
|
3
3
|
"license": "Apache-2.0",
|
|
4
|
-
"version": "7.1.
|
|
4
|
+
"version": "7.1.112",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Engine 7 — 给助手一个家 / A home for your AI assistant",
|
|
7
7
|
"main": "dist/main.mjs",
|
|
@@ -22,8 +22,9 @@
|
|
|
22
22
|
"test:goal:calendar": "tsx src/goals/calendar-adapter.test.ts",
|
|
23
23
|
"test:goal:restart": "powershell -NoProfile -Command \"$d = Join-Path ([System.IO.Path]::GetTempPath()) ('engine7-goal-' + [guid]::NewGuid()); New-Item -ItemType Directory -Path $d | Out-Null; $id = (npx tsx src/goals/restart-writer.ts $d); npx tsx src/goals/restart-reader.ts $d $id; Remove-Item -Recurse -Force $d\"",
|
|
24
24
|
"test:goal:e2e": "powershell -NoProfile -Command \"$d = Join-Path ([System.IO.Path]::GetTempPath()) ('engine7-goal-e2e-' + [guid]::NewGuid()); New-Item -ItemType Directory -Path $d | Out-Null; npx tsx src/goals/e2e-phase1.ts $d; if ($LASTEXITCODE -ne 0) { Remove-Item -Recurse -Force $d; exit 1 }; npx tsx src/goals/e2e-phase2.ts $d; $code = $LASTEXITCODE; Remove-Item -Recurse -Force $d; exit $code\"",
|
|
25
|
-
"test:reload": "tsx src/reload/orchestrator.test.ts && tsx src/hooks/config.test.ts && tsx src/channels/manager.reconcile.test.ts && tsx src/engine-startup.shouldSkipReload.test.ts && tsx src/optional/voice-chat/plugin.deps.test.ts && tsx src/cron/cron-plugin.resync.test.ts && tsx src/startup/message-pipeline.test.ts && tsx src/utils/sanitize-error.test.ts",
|
|
26
|
-
"test:installer": "tsx src/cli-events.test.ts && tsx src/cli-init-config.test.ts && tsx src/cli-init-answers.test.ts && tsx src/cli-init.headless.e2e.test.ts && tsx src/cli-reconfig.test.ts && tsx src/cli-doctor.test.ts && tsx src/config/secrets-env.test.ts && tsx src/startup/api-status.test.ts && tsx src/cli-service.test.ts && tsx src/emotion-hook.test.ts && tsx src/emotion-hook.golden.test.ts && tsx src/tools/tavily-pool.test.ts",
|
|
25
|
+
"test:reload": "tsx src/reload/orchestrator.test.ts && tsx src/reload/secrets-watch.test.ts && tsx src/hooks/config.test.ts && tsx src/channels/manager.reconcile.test.ts && tsx src/engine-startup.shouldSkipReload.test.ts && tsx src/optional/voice-chat/plugin.deps.test.ts && tsx src/optional/voice-chat/config.test.ts && tsx src/cron/cron-plugin.resync.test.ts && tsx src/startup/message-pipeline.test.ts && tsx src/utils/sanitize-error.test.ts",
|
|
26
|
+
"test:installer": "tsx src/cli-events.test.ts && tsx src/cli-init-config.test.ts && tsx src/cli-init-answers.test.ts && tsx src/cli-init.headless.e2e.test.ts && tsx src/cli-reconfig.test.ts && tsx src/cli-doctor.test.ts && tsx src/config/secrets-env.test.ts && tsx src/startup/api-status.test.ts && tsx src/cli-service.test.ts && tsx src/emotion-hook.test.ts && tsx src/emotion-hook.golden.test.ts && tsx src/tools/tavily-pool.test.ts && tsx src/tools/service.test.ts",
|
|
27
|
+
"test:persona": "tsx src/config/persona-files.test.ts && tsx src/light-mode.test.ts && tsx src/inner-voice/plugin.test.ts && tsx src/cli-init-config.test.ts",
|
|
27
28
|
"test:responses": "tsx src/models/openai-responses-provider.test.ts && tsx src/session/responses-reasoning-roundtrip.test.ts && tsx src/compact/tokenEstimate.test.ts",
|
|
28
29
|
"build:public": "node scripts/build.mjs --public",
|
|
29
30
|
"prepublishOnly": "npm run build:public",
|
|
@@ -31,8 +32,14 @@
|
|
|
31
32
|
"smoke:boot": "node scripts/boot-smoke.mjs",
|
|
32
33
|
"smoke:boot:baseline": "node scripts/boot-smoke.mjs --baseline",
|
|
33
34
|
"gen:template": "tsx scripts/gen-config-template.ts",
|
|
35
|
+
"test:config": "tsx src/config/registry.test.ts && tsx src/config/writer.test.ts && tsx src/config/secrets-io.test.ts && tsx src/config/secrets-env.test.ts && tsx src/config/migrations/index.test.ts && tsx src/config/migrations/persona.test.ts && tsx src/config/migrations/channel-secrets.test.ts && tsx src/config/cli-config.test.ts && tsx src/config/tts-providers.test.ts && tsx src/config/tts-voices.test.ts",
|
|
34
36
|
"test:time": "tsx src/time/tz-matrix.test.ts && tsx src/time/time-discipline.test.ts && tsx src/time/tsc-guard.test.ts",
|
|
35
|
-
"
|
|
37
|
+
"test:tts": "tsx src/config/tts-providers.test.ts && tsx src/tools/tts/pick.test.ts && tsx src/tools/tts/route.test.ts && tsx src/tools/tts/relay.test.ts && tsx src/tools/tts/providers.test.ts && tsx src/tools/tts/impl.test.ts && tsx src/tools/tts/usage.test.ts && tsx src/tools/my-voice.dispatch.test.ts",
|
|
38
|
+
"test:toolstate": "tsx src/core/names-from-history.test.ts",
|
|
39
|
+
"test:loopbrake": "tsx src/tools/loop-brake.test.ts",
|
|
40
|
+
"test:mcp": "tsx src/mcp/convert-input-schema.test.ts",
|
|
41
|
+
"test:proactive": "tsx src/memory/proactive/__tests__/verdict-parse.test.ts && tsx src/memory/proactive/__tests__/sweep.test.ts && tsx src/memory/proactive/__tests__/persistence.test.ts && tsx src/memory/proactive/__tests__/opportunity.test.ts && tsx src/memory/proactive/__tests__/calendar-bridge.test.ts && tsx src/memory/proactive/__tests__/timezone-fix.test.ts && tsx src/memory/proactive/__tests__/stale-fix.test.ts && tsx src/memory/proactive/__tests__/completion-evidence.test.ts && tsx src/memory/proactive/__tests__/plugin.test.ts",
|
|
42
|
+
"prepack": "npm run test:time && npm run test:proactive && npm run test:persona && npm run test:config && npm run test:toolstate && npm run test:loopbrake && npm run test:mcp && npm run test:tts"
|
|
36
43
|
},
|
|
37
44
|
"engines": {
|
|
38
45
|
"node": ">=22"
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Proactive 处理规则
|
|
2
|
+
|
|
3
|
+
> 本文件是 sweep 注入到期 action 后,agent 的处理规则。改了不用重启(每轮 sweep 现读)。
|
|
4
|
+
> 文件缺失或读失败时用引擎内置的同款兜底文案。
|
|
5
|
+
|
|
6
|
+
## 一、怎么落状态(硬要求)
|
|
7
|
+
|
|
8
|
+
**必须调工具**,不是"在回复里写一句":
|
|
9
|
+
|
|
10
|
+
| 判断结果 | 调用 |
|
|
11
|
+
|---|---|
|
|
12
|
+
| 处理完了(含已经告诉过 TA) | `proactive_done`(`action_id`;落进日历时带上 `calendar_id`) |
|
|
13
|
+
| 跳过(技术噪音 / 已过期 / 重复 / 马后炮) | `proactive_cancel`(`action_id` + `reason`) |
|
|
14
|
+
| 执行失败 | `proactive_cancel` 并在 reason 里说明 |
|
|
15
|
+
|
|
16
|
+
⚠️ **在回复正文里写 `act-xxx: cancelled` 不算标记**——那是留痕,不落库。
|
|
17
|
+
系统有一道兜底解析会从正文里捞(格式 `act-<id>: <status>` + 可选 `cancel_reason: "..."`),
|
|
18
|
+
但工具路径才是正路:理由更权威、能带 calendar_id 关联(正文解析不能)、也不依赖兜底是否认得你的写法。
|
|
19
|
+
(张小媒 0925 review 微抠:这里原写"能回填 calendar",会被读成 done 工具会往 calendar 里写东西——
|
|
20
|
+
它只是把 add-task 返回的 id **关联**到 action 上。)
|
|
21
|
+
|
|
22
|
+
`proactive_status` 可以随时查当前挂着的列表。
|
|
23
|
+
|
|
24
|
+
## 二、处理流程
|
|
25
|
+
|
|
26
|
+
1. **先核对再判**——正文里的"现在/今天"是**生成时刻**的,不是此刻。拿 `generated_at_local`
|
|
27
|
+
跟 `_received_at` 对一下;再跟 calendar/goal 里已有的对一遍,重复的直接 cancelled。
|
|
28
|
+
2. **批量处理**:先全部判断完,再统一调工具(不要每条调一次)。
|
|
29
|
+
3. **状态只有三选一**:`completed` / `cancelled` / `failed`。
|
|
30
|
+
⚠️ 没有 notified、没有 skipped。
|
|
31
|
+
|
|
32
|
+
## 三、参考量
|
|
33
|
+
|
|
34
|
+
- `urgency` 只是参考:urgent=几小时 / high=24h / medium=48h / low=一周,按实际情况判断。
|
|
35
|
+
- `stale_hint` / `stale_facts` 是机械算出来的过期提示,出现时优先核对。
|
|
36
|
+
- `recent_evidence` 是这条 action 生成之后的关联证据——里面若有"已经做完了",直接 cancelled。
|
|
37
|
+
|
|
38
|
+
## 四、通知 TA
|
|
39
|
+
|
|
40
|
+
决定告诉 TA 时用你自己的语气——这是你的主动关怀,不是系统通知。
|