@myclaw163/clawclaw-cli 0.9.2 → 0.10.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.
- package/QUICKSTART_OTHER.md +5 -5
- package/README.md +7 -8
- package/bin/clawclaw-channel.mjs +2 -2
- package/bin/clawclaw-cli.mjs +2 -2
- package/docs/configuration.md +25 -99
- package/docs/custom-modules/README.md +23 -35
- package/docs/custom-modules/api-reference.md +95 -273
- package/docs/custom-modules/behavior.md +94 -78
- package/docs/custom-modules/examples/auto-escape.ts +5 -5
- package/docs/custom-modules/examples/go-to-point.ts +11 -11
- package/docs/custom-modules/examples/nearby-reflex.ts +2 -2
- package/docs/custom-modules/examples/task-reminder.ts +4 -5
- package/docs/custom-modules/perception.md +42 -603
- package/docs/custom-modules/skill.md +1 -1
- package/docs/desktop-event-push.md +3 -3
- package/docs/runtime/README.md +16 -17
- package/docs/runtime/agent-notifications.md +31 -12
- package/docs/runtime/behavior-runtime.md +47 -46
- package/docs/runtime/components-and-boundaries.md +70 -28
- package/docs/runtime/events-and-state.md +41 -18
- package/docs/runtime/framework-package.md +73 -0
- package/docs/runtime/official-perception-modules.md +5 -5
- package/docs/runtime/owner-lifecycle-and-observability.md +6 -6
- package/docs/runtime/short-commands-and-capabilities.md +8 -9
- package/docs/user-guide/README.md +10 -7
- package/docs/user-guide/api-reference.md +81 -164
- package/docs/user-guide/behavior.md +84 -68
- package/docs/user-guide/installation.md +7 -7
- package/docs/user-guide/perception.md +42 -586
- package/docs/user-guide/skill.md +1 -1
- package/package.json +24 -9
- package/scripts/check-framework-boundaries.mjs +27 -0
- package/scripts/check-skill-command-surface.mjs +8 -13
- package/scripts/install-local-runtime.mjs +35 -0
- package/scripts/qa-install.mjs +105 -0
- package/skills/clawclaw/SKILL.md +49 -49
- package/skills/clawclaw/references/BEHAVIORS.md +42 -73
- package/skills/clawclaw/references/CHANNELS.md +2 -2
- package/skills/clawclaw/references/COMMANDS.md +60 -101
- package/skills/clawclaw/references/CUSTOM-BEHAVIOR-DEVELOPMENT.md +94 -78
- package/skills/clawclaw/references/CUSTOM-MODULE-API.md +95 -180
- package/skills/clawclaw/references/CUSTOM-MODULES.md +24 -24
- package/skills/clawclaw/references/CUSTOM-PERCEPTION-DEVELOPMENT.md +42 -608
- package/skills/clawclaw/references/CUSTOM-SKILL-DEVELOPMENT.md +1 -1
- package/skills/clawclaw/references/HUB.md +1 -1
- package/skills/clawclaw/references/STREAM.md +8 -8
- package/skills/clawclaw/references/TACTICS.md +1 -1
- package/src/channel/claude-channel-ipc-server.ts +1 -0
- package/src/cli.ts +4 -2
- package/src/commands/behavior.ts +26 -10
- package/src/commands/capability.ts +3 -3
- package/src/commands/load.ts +3 -2
- package/src/commands/perception.ts +5 -0
- package/src/commands/strategy.ts +2 -0
- package/src/lib/capability-load-diagnostics.ts +3 -3
- package/src/lib/perception-config.ts +18 -6
- package/src/lib/runtime-cadence-config.ts +16 -0
- package/src/lib/workspace-runtime-lock.ts +3 -46
- package/src/pipeline/canonical-event-presentation.ts +23 -124
- package/src/pipeline/event-format.ts +12 -21
- package/src/pipeline/event-hints.ts +6 -6
- package/src/pipeline/game-sync-event-normalization.ts +57 -63
- package/src/runtime/clawclaw/behavior-decision.ts +7 -3
- package/src/runtime/clawclaw/behavior-input.ts +8 -4
- package/src/runtime/clawclaw/behavior-observation-memory.ts +3 -2
- package/src/runtime/clawclaw/notification-policy.ts +42 -0
- package/src/runtime/clawclaw/notification-turn.ts +19 -0
- package/src/runtime/clawclaw/observation-frame-projector.ts +3 -3
- package/src/runtime/clawclaw/owner.ts +18 -4
- package/src/runtime/clawclaw/perception-module-manifest.ts +8 -3
- package/src/runtime/clawclaw/perception-strategy-names.ts +17 -0
- package/src/runtime/clawclaw/persistence-compatibility.ts +36 -0
- package/src/runtime/clawclaw/plugins/action/action-plugin.ts +3 -3
- package/src/runtime/clawclaw/plugins/assembly.ts +7 -9
- package/src/runtime/clawclaw/plugins/behavior/activation-manager.ts +1 -495
- package/src/runtime/clawclaw/plugins/behavior/behavior-analysis-thread-host.ts +17 -190
- package/src/runtime/clawclaw/plugins/behavior/behavior-instance-snapshot.ts +1 -123
- package/src/runtime/clawclaw/plugins/behavior/behavior-plugin.ts +126 -1779
- package/src/runtime/clawclaw/plugins/behavior/behavior-runner.ts +13 -276
- package/src/runtime/clawclaw/plugins/behavior/behavior-source.ts +2 -2
- package/src/runtime/clawclaw/plugins/behavior/behavior-worker-bridge.ts +8 -0
- package/src/runtime/clawclaw/plugins/behavior/control-driver.ts +3 -180
- package/src/runtime/clawclaw/plugins/behavior/thread-behavior-executor.ts +13 -972
- package/src/runtime/clawclaw/plugins/derived-event/derived-event-plugin.ts +8 -109
- package/src/runtime/clawclaw/plugins/derived-event/derived-event-rules.ts +2 -2
- package/src/runtime/clawclaw/plugins/derived-event/reminder-plugin.ts +25 -17
- package/src/runtime/clawclaw/plugins/derived-event/reminder-runner.ts +1 -0
- package/src/runtime/clawclaw/plugins/derived-event/state-change-rules.ts +3 -3
- package/src/runtime/clawclaw/plugins/derived-event/task-change-tracker.ts +1 -259
- package/src/runtime/clawclaw/plugins/game-query/game-query-plugin.ts +4 -4
- package/src/runtime/clawclaw/plugins/mailbox/adapters/claude-channel-adapter.ts +9 -97
- package/src/runtime/clawclaw/plugins/mailbox/adapters/claude-channel-socket.ts +8 -343
- package/src/runtime/clawclaw/plugins/mailbox/agent-mailbox-coordinator.ts +60 -572
- package/src/runtime/clawclaw/plugins/mailbox/desktop-event-socket.ts +6 -434
- package/src/runtime/clawclaw/plugins/mailbox/mailbox-event-batch-delivery.ts +1 -266
- package/src/runtime/clawclaw/plugins/mailbox/mailbox-plugin.ts +6 -161
- package/src/runtime/clawclaw/plugins/mailbox/mailbox-presentation.ts +4 -23
- package/src/runtime/clawclaw/plugins/mailbox/mailbox-service.ts +49 -752
- package/src/runtime/clawclaw/plugins/perception/map-concurrent.ts +1 -0
- package/src/runtime/clawclaw/plugins/perception/notification-content.ts +60 -0
- package/src/runtime/clawclaw/plugins/perception/perception-module-plugin.ts +119 -297
- package/src/runtime/clawclaw/plugins/perception/perception-module-runner.ts +7 -56
- package/src/runtime/clawclaw/plugins/perception/perception-module-worker.ts +11 -33
- package/src/runtime/clawclaw/plugins/perception/perception-plugin.ts +18 -7
- package/src/runtime/clawclaw/plugins/perception/perception-source.ts +12 -6
- package/src/runtime/clawclaw/plugins/perception/task-baseline.ts +29 -0
- package/src/runtime/clawclaw/plugins/source/source-plugin.ts +6 -0
- package/src/runtime/clawclaw/plugins/system-perception/rule-runner.ts +107 -0
- package/src/runtime/clawclaw/plugins/system-perception/system-perceptions.ts +107 -0
- package/src/runtime/clawclaw/plugins/trigger/trigger-plugin.ts +8 -3
- package/src/runtime/clawclaw/reaction-behavior-resolution.ts +1 -23
- package/src/runtime/clawclaw/reminder-manifest.ts +5 -2
- package/src/runtime/clawclaw/runtime-cadence.ts +24 -0
- package/src/runtime/clawclaw/runtime-state.ts +11 -0
- package/src/runtime/clawclaw/runtime.ts +8 -0
- package/src/runtime/clawclaw/strategy-memory-rpc.ts +1 -63
- package/src/runtime/clawclaw/strategy-memory.ts +1 -77
- package/src/runtime/clawclaw-event-catalog.ts +12 -12
- package/src/runtime/framework/action-diagnostics.ts +3 -83
- package/src/runtime/framework/capability-registry.ts +2 -395
- package/src/runtime/framework/contracts.ts +2 -144
- package/src/runtime/framework/control/control-scheduler.ts +2 -1268
- package/src/runtime/framework/control/domain-set.ts +2 -81
- package/src/runtime/framework/control/index.ts +1 -3
- package/src/runtime/framework/control/types.ts +2 -191
- package/src/runtime/framework/control-coordinator.ts +2 -11
- package/src/runtime/framework/events/event-catalog.ts +2 -74
- package/src/runtime/framework/events/event-delivery-service.ts +2 -200
- package/src/runtime/framework/events/event-ingress.ts +2 -99
- package/src/runtime/framework/events/event-repository.ts +2 -82
- package/src/runtime/framework/events/index.ts +2 -7
- package/src/runtime/framework/events/memory-event-repository.ts +2 -1100
- package/src/runtime/framework/events/runtime-resume.ts +2 -20
- package/src/runtime/framework/events/sqlite-event-repository.ts +5 -2280
- package/src/runtime/framework/events/test-helpers.ts +1 -1
- package/src/runtime/framework/events/types.ts +2 -312
- package/src/runtime/framework/index.ts +3 -7
- package/src/runtime/framework/load-node-sqlite.ts +2 -17
- package/src/runtime/framework/mailbox/coalescer.ts +2 -83
- package/src/runtime/framework/mailbox/host-notification-sink.ts +2 -44
- package/src/runtime/framework/mailbox/identity.ts +2 -38
- package/src/runtime/framework/mailbox/index.ts +1 -7
- package/src/runtime/framework/mailbox/mailbox-dispatcher.ts +2 -282
- package/src/runtime/framework/mailbox/mailbox-repository.ts +2 -44
- package/src/runtime/framework/mailbox/notification-projector.ts +2 -65
- package/src/runtime/framework/mailbox/types.ts +2 -145
- package/src/runtime/framework/modules/runtime-module-loader-hooks.mjs +2 -154
- package/src/runtime/framework/modules/runtime-module-loader.ts +7 -51
- package/src/runtime/framework/modules/runtime-module-output.ts +2 -24
- package/src/runtime/framework/modules/runtime-module-worker-bootstrap.mjs +3 -23
- package/src/runtime/framework/participation-manager.ts +2 -253
- package/src/runtime/framework/persistence/async-sqlite-persistence-worker.ts +2 -77
- package/src/runtime/framework/persistence/memory-first-persistence.ts +4 -489
- package/src/runtime/framework/plugins/contracts.ts +2 -396
- package/src/runtime/framework/plugins/index.ts +1 -4
- package/src/runtime/framework/plugins/runtime-event-identity.ts +2 -17
- package/src/runtime/framework/plugins/runtime-input-journal.ts +2 -866
- package/src/runtime/framework/plugins/runtime-plugin-scheduler.ts +2 -2071
- package/src/runtime/framework/runtime.ts +5 -1843
- package/src/runtime/framework/serial-task-queue.ts +2 -14
- package/src/runtime/framework/state/contracts.ts +2 -49
- package/src/runtime/framework/state/current-state-store.ts +2 -184
- package/src/runtime/framework/state/durable-agent-state-snapshot.ts +2 -209
- package/src/runtime/framework/state/freshness.ts +2 -72
- package/src/runtime/framework/state/history/contracts.ts +2 -158
- package/src/runtime/framework/state/history/history-writer.ts +2 -194
- package/src/runtime/framework/state/history/memory-state-history-repository.ts +2 -230
- package/src/runtime/framework/state/history/sqlite-state-history-repository.ts +2 -648
- package/src/runtime/framework/state/history/trajectory-projector.ts +2 -209
- package/src/runtime/framework/state/index.ts +1 -13
- package/src/runtime/framework/state/state-ingress.ts +2 -95
- package/src/runtime/framework/state/state-provider.ts +2 -62
- package/src/runtime/framework/state/types.ts +2 -155
- package/src/runtime/host-monitor-rate-gate.ts +1 -123
- package/src/runtime/mailbox-host-relay.ts +1 -326
- package/src/runtime/observability/detail-capture.ts +4 -108
- package/src/runtime/observability/process-timing.ts +2 -59
- package/src/runtime/observability/recorder.ts +2 -238
- package/src/runtime/observability/redaction.ts +2 -181
- package/src/runtime/observability/reporter.ts +2 -154
- package/src/runtime/observability/sinks.ts +2 -135
- package/src/runtime/observability/types.ts +2 -92
- package/src/runtime/owner-control.ts +45 -320
- package/src/runtime/parent-process-watch.ts +1 -51
- package/src/runtime/process-identity.ts +1 -72
- package/src/sdk/behavior-plugin/index.ts +9 -3
- package/src/sdk/index.ts +40 -2
- package/src/sdk/module-input/index.ts +5 -0
- package/src/sdk/perception-plugin/index.ts +3 -1
- package/src/sdk/perception-plugin/module.ts +12 -2
- package/src/sdk/perception-plugin/reminder-rules.ts +8 -42
- package/src/sdk/perception-plugin/reminder.ts +2 -1
- package/src/sdk/perception-plugin/task-change-tracker.ts +258 -0
- package/src/sdk/strategy-memory.ts +1 -12
- package/src/sdk/strategy-plugin/index.ts +36 -0
- package/src/sdk/trigger-plugin/index.ts +1 -0
- package/docs/custom-modules/trigger.md +0 -295
|
@@ -4,16 +4,14 @@
|
|
|
4
4
|
|
|
5
5
|
- [开发策略](./behavior.md)
|
|
6
6
|
- [感知开发总览](./perception.md)
|
|
7
|
-
- [视觉感知](./perception.md#视觉感知)、[提醒型感知](./perception.md#提醒型感知)
|
|
8
7
|
- [自定义模块总览](./README.md)
|
|
9
8
|
|
|
10
|
-
本文按模块组织;每个模块内部依次说明 Runtime 主动输入、查询 API、允许输出和 Manifest
|
|
9
|
+
本文按模块组织;每个模块内部依次说明 Runtime 主动输入、查询 API、允许输出和 Manifest;策略与感知提供局内记忆 api.memory。策略与感知共用的数据结构统一放在文末。
|
|
11
10
|
|
|
12
11
|
| 模块 | Runtime 主动输入 | 查询与私有能力 | 允许输出 |
|
|
13
12
|
|---|---|---|---|
|
|
14
13
|
| 策略 | 当前 `GameState`、待处理 Event、Activation 参数 | 地图、路径距离、最近观察、api.memory | Action、Status、自定义 Event、结束结果 |
|
|
15
14
|
| 视觉感知 | `ObservationFrame` | 静态地图 | 视觉事件 |
|
|
16
|
-
| 提醒型感知 | 当前状态、可见帧、订阅事实、任务变化、配置和私有 state | 无查询 API | 任务或附近发言提醒、下一轮私有 state |
|
|
17
15
|
|
|
18
16
|
游戏输入和查询结果都是当前回调内的只读值;api.memory 则是显式读写的策略私有数据。任何模块都不能直接修改权威 `GameState`。
|
|
19
17
|
|
|
@@ -37,7 +35,7 @@
|
|
|
37
35
|
```ts
|
|
38
36
|
import {
|
|
39
37
|
getAvailableTasks, getTaskAvailability, isTaskAvailable,
|
|
40
|
-
} from '@myclaw163/clawclaw-cli/
|
|
38
|
+
} from '@myclaw163/clawclaw-cli/strategy-plugin';
|
|
41
39
|
|
|
42
40
|
const allTasks = input.gameState.you?.tasks; // 保留完整任务,可做后续规划
|
|
43
41
|
const candidates = getAvailableTasks(input.gameState); // 仅当前 ready 的个人任务
|
|
@@ -55,18 +53,33 @@ const maySelect = candidates[0] && isTaskAvailable(input.gameState, candidates[0
|
|
|
55
53
|
|
|
56
54
|
`ready` 不保证动作一定成功:距离、路径、队友占用等最终执行条件仍由 Action/服务端校验。任务动作只提交一次,之后从权威 State/Event 确认结果,不能每帧重复请求。未使用这些判断的第三方旧脚本需要修改,恢复完整列表不会自动修正它的选任务逻辑。
|
|
57
55
|
|
|
56
|
+
## 固定周期输入
|
|
57
|
+
|
|
58
|
+
生产 Owner 按本地固定周期调用 v3 感知和策略,默认 100ms;cycle 为可选 ProcessingCycleInfo,可从 Strategy 或 Perception SDK 导入。旧作者测试输入可以省略它。
|
|
59
|
+
|
|
60
|
+
| `cycle` 字段 | 含义 |
|
|
61
|
+
|---|---|
|
|
62
|
+
| `id` / `intervalMs` | 本地周期编号与目标周期;慢计算时实际间隔可更长,不是游戏 tick |
|
|
63
|
+
| `nowMs` | 本地周期开始时间,与 input.nowMs 一致 |
|
|
64
|
+
| `hasNewState` | 相对上一正常 CCL 计算周期是否接纳了新 State;查询/通知排空不消耗该标记,不做内容深比较 |
|
|
65
|
+
| `stateVersion` | 最新 State 的接纳版本;脚本可与自己上次处理的版本比较 |
|
|
66
|
+
| `stateReceivedAtMs` / `stateAgeMs` | 实际状态接收时间及到本轮边界的年龄;本地空周期和查询不会刷新它 |
|
|
67
|
+
| `connectionState` | 当前连接状态,便于脚本判断是否等待恢复 |
|
|
68
|
+
|
|
69
|
+
没有可用 State 时,版本与接收时间可为 null。首次对局 State 到达前策略仍等待;有可用观察后,不因后端没有新 tick 而停止调用。感知与策略的私有记忆、decisionHistory、既有历史输入保持原有含义;不新增共同 State 历史接口。
|
|
70
|
+
|
|
58
71
|
## 统一感知 API v3
|
|
59
72
|
|
|
60
73
|
从公开 perception-plugin 入口导入 ClawclawPerception、PerceptionModuleInput、PerceptionModuleResult、PerceptionModuleEvent 和 PerceptionModuleManifest;版本常量为 PERCEPTION_MODULE_API_VERSION=3。新脚本没有三选一的 kind,通过同一个 evaluate(input) 组合观察、通知和私有记忆。
|
|
61
74
|
|
|
62
|
-
Manifest 的必需项为 apiVersion:3、id、description;可选 name、localizations、consumes、produces、inputs、config、
|
|
75
|
+
Manifest 的必需项为 apiVersion:3、id、description;可选 name、localizations、consumes、produces、inputs、config、strategies。输入包含 moduleId、scope、gameState、frame、events、taskChanges、boundary、nowMs、cycle、config、state、availableBindings、availableStrategies、enabledBindings。frame/gameState 可以为 null;events 只含订阅的源/后端原始事实,taskChanges 由该模块自己的基线与本轮权威任务列表比较得到,结合同轮后端事实;不是订阅 tasks_changed。 内置任务感知及 evaluateReminder('tasks') 只把后端 task_* 事实转为基础任务通知,不按 taskChanges 再输出同一信息;紧急生命周期和阈值由内置紧急感知负责。
|
|
63
76
|
|
|
64
77
|
结果为 { state?, events?, activations? }。events 项为 { type, key, wakeAgent?, payload },type 必须在 produces 中声明,key 是稳定发生标识,wakeAgent 省略为 true。false 不独立唤醒且保留事件;不生成事件表示没有这条通知。事件类型的可见范围仍受 Catalog 和配置约束,模块不能重写原始事件或其他模块的通知。
|
|
65
78
|
|
|
66
79
|
|
|
67
|
-
每次计算使用 fresh 实例,跨回调状态必须从 input.state 读取并作为结果 state 返回,由 Host 检查点恢复。新脚本不能订阅其他感知、
|
|
80
|
+
每次计算使用 fresh 实例,跨回调状态必须从 input.state 读取并作为结果 state 返回,由 Host 检查点恢复。新脚本不能订阅其他感知、Strategy 或 decision 输出;运行时还按 producerPluginId 过滤,只接纳 Source/后端原始事实。produces 不能冒充系统保留类型;reminder.task/reminder.speech 是兼容通知输出,不是权威任务事实。
|
|
68
81
|
|
|
69
|
-
|
|
82
|
+
感知可请求固定 Reflex,感知和策略分别装配。
|
|
70
83
|
|
|
71
84
|
|
|
72
85
|
## 策略 API
|
|
@@ -75,43 +88,44 @@ API v2 视觉和提醒接口继续兼容;旧 Reaction 与独立 Trigger 暂时
|
|
|
75
88
|
|
|
76
89
|
```ts
|
|
77
90
|
import {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
} from '@myclaw163/clawclaw-cli/
|
|
91
|
+
STRATEGY_PLUGIN_API_VERSION,
|
|
92
|
+
ClawclawStrategy,
|
|
93
|
+
} from '@myclaw163/clawclaw-cli/strategy-plugin';
|
|
81
94
|
|
|
82
|
-
//
|
|
95
|
+
// STRATEGY_PLUGIN_API_VERSION === 3
|
|
83
96
|
```
|
|
84
97
|
|
|
85
|
-
### Runtime 输入:`
|
|
98
|
+
### Runtime 输入:`StrategyInput<TInput>`
|
|
86
99
|
|
|
87
100
|
```ts
|
|
88
|
-
interface
|
|
101
|
+
interface StrategyInput<TInput extends Readonly<Record<string, unknown>>> {
|
|
89
102
|
readonly epochId: number;
|
|
103
|
+
readonly cycle?: ProcessingCycleInfo;
|
|
90
104
|
readonly scope: Readonly<{ sessionId: string; segmentId: string }>;
|
|
91
105
|
readonly nowMs: number;
|
|
92
106
|
readonly gameState: Readonly<GameState>;
|
|
93
107
|
readonly events: readonly Readonly<GameEvent>[];
|
|
94
108
|
readonly input: Readonly<TInput>;
|
|
95
|
-
readonly continuation?: Readonly<
|
|
109
|
+
readonly continuation?: Readonly<StrategyContinuation>;
|
|
96
110
|
}
|
|
97
111
|
```
|
|
98
112
|
|
|
99
113
|
| 字段 | 含义 |
|
|
100
114
|
|---|---|
|
|
101
|
-
| `epochId` | Runtime
|
|
115
|
+
| `epochId` | 本次计算的 Runtime 编号;本地周期编号看 cycle.id,不是游戏 tick |
|
|
102
116
|
| `scope` | 当前 Runtime session 与 segment |
|
|
103
|
-
| `nowMs` |
|
|
117
|
+
| `nowMs` | 本地计算周期的时间;后端观察接收时间看 cycle.stateReceivedAtMs |
|
|
104
118
|
| `gameState` | 当前玩家视角的权威 GameSync 快照 |
|
|
105
119
|
| `events` | 该 Activation 尚未消费的有序 Event 片段 |
|
|
106
120
|
| `input` | 按 Manifest 校验并经可选 `normalize()` 处理后的 Activation 参数 |
|
|
107
121
|
| `continuation` | 仅 long 委派的 short 结束并恢复后出现一次;包含 Runtime 生成的 child 终态 |
|
|
108
122
|
|
|
109
|
-
`events`
|
|
123
|
+
`events` 按本策略游标提供尚未消费的事实;正常周期不依赖后端 tick 前进。脚本返回空 Decision 也属于一次已处理输入;需要跨轮保留的信息应自行存入私有状态。
|
|
110
124
|
|
|
111
|
-
### 查询:`
|
|
125
|
+
### 查询:`StrategyReadApi`
|
|
112
126
|
|
|
113
127
|
```ts
|
|
114
|
-
interface
|
|
128
|
+
interface StrategyReadApi {
|
|
115
129
|
readonly spatial: SpatialApi;
|
|
116
130
|
readonly navigation: {
|
|
117
131
|
pathDistance(from: Readonly<Position>, to: Readonly<Position>): Promise<number | null>;
|
|
@@ -214,15 +228,15 @@ const corpse = api.observation.lastSeenCorpse(targetSeat);
|
|
|
214
228
|
|
|
215
229
|
省略 `targetSeat` 时返回最近观察到的尸体;没有记录时返回 `undefined`。最近观察是历史事实,使用前必须结合 `ageMs` 与当前 `gameState` 复核。
|
|
216
230
|
|
|
217
|
-
### 输出:`
|
|
231
|
+
### 输出:`StrategyDecision`
|
|
218
232
|
|
|
219
233
|
```ts
|
|
220
|
-
interface
|
|
234
|
+
interface StrategyDecision {
|
|
221
235
|
readonly actions?: readonly Readonly<GameAction>[];
|
|
222
|
-
readonly status?: Readonly<
|
|
223
|
-
readonly events?: readonly Readonly<
|
|
224
|
-
readonly delegate?: Readonly<
|
|
225
|
-
readonly finish?: Readonly<
|
|
236
|
+
readonly status?: Readonly<StrategyStatus>;
|
|
237
|
+
readonly events?: readonly Readonly<StrategyEventProposal>[];
|
|
238
|
+
readonly delegate?: Readonly<StrategyDelegation>;
|
|
239
|
+
readonly finish?: Readonly<StrategyFinish>;
|
|
226
240
|
}
|
|
227
241
|
```
|
|
228
242
|
|
|
@@ -315,10 +329,10 @@ interface BehaviorDecision {
|
|
|
315
329
|
|
|
316
330
|
会议投票不属于 `GameAction`。Agent 或用户在会议阶段使用现有 `ccl vote`,由 Action Plugin 直接提交后端;策略不预占 `meeting_vote` 控制域。
|
|
317
331
|
|
|
318
|
-
#### `
|
|
332
|
+
#### `StrategyStatus`
|
|
319
333
|
|
|
320
334
|
```ts
|
|
321
|
-
interface
|
|
335
|
+
interface StrategyStatus {
|
|
322
336
|
readonly summary: string;
|
|
323
337
|
readonly activity?: string;
|
|
324
338
|
readonly room?: string;
|
|
@@ -330,10 +344,10 @@ interface BehaviorStatus {
|
|
|
330
344
|
|
|
331
345
|
`summary` 必须是非空字符串,其余文本字段提供时也必须非空。Status 会发布到 Runtime 的 `behavior.status` 视图;它不是 `GameState` patch,也不是模块私有持久化存储。
|
|
332
346
|
|
|
333
|
-
#### `
|
|
347
|
+
#### `StrategyEventProposal`
|
|
334
348
|
|
|
335
349
|
```ts
|
|
336
|
-
interface
|
|
350
|
+
interface StrategyEventProposal {
|
|
337
351
|
readonly type: string;
|
|
338
352
|
readonly payload: Readonly<Record<string, unknown>>;
|
|
339
353
|
readonly occurredAt?: string;
|
|
@@ -342,21 +356,21 @@ interface BehaviorEventProposal {
|
|
|
342
356
|
|
|
343
357
|
`type` 必须先列在 `manifest.produces` 中;`payload` 必须是普通 JSON 对象。Event 应表示模块已经确认成立的事实。
|
|
344
358
|
|
|
345
|
-
#### `
|
|
359
|
+
#### `StrategyDelegation`
|
|
346
360
|
|
|
347
361
|
```ts
|
|
348
|
-
interface
|
|
349
|
-
readonly
|
|
362
|
+
interface StrategyDelegation {
|
|
363
|
+
readonly strategy: string;
|
|
350
364
|
readonly input?: Readonly<Record<string, unknown>>;
|
|
351
365
|
}
|
|
352
366
|
```
|
|
353
367
|
|
|
354
368
|
只有当前 long Activation 可以使用 `delegate` 启动一个 short。Runtime 会先通过策略 Catalog 校验目标与输入,再改变控制栈。`delegate` 不能与 `actions` 或 `finish` 同时返回;short 使用会让当前 Activation failed。委派 short 的终态通过 long 恢复后的 `continuation.delegatedBehavior` 一次性返回。
|
|
355
369
|
|
|
356
|
-
#### `
|
|
370
|
+
#### `StrategyFinish`
|
|
357
371
|
|
|
358
372
|
```ts
|
|
359
|
-
interface
|
|
373
|
+
interface StrategyFinish {
|
|
360
374
|
readonly outcome: 'completed' | 'failed';
|
|
361
375
|
readonly reason: string;
|
|
362
376
|
readonly summary?: string;
|
|
@@ -365,26 +379,26 @@ interface BehaviorFinish {
|
|
|
365
379
|
|
|
366
380
|
`reason` 必须是非空、稳定、适合程序判断的原因。Runtime 不允许同一 Decision 同时首次提交 Action 并 `finish` 或 `delegate`;应先请求 Action,再在后续权威输入确认目标后结束或委派。
|
|
367
381
|
|
|
368
|
-
### Manifest:`
|
|
382
|
+
### Manifest:`ClawclawStrategyManifest`
|
|
369
383
|
|
|
370
384
|
首次自动上传 Hub 时,默认展示名称取脚本 `id`,默认展示描述取脚本 `description`,分别按 Hub 的 50/600 字符限制截取。之后 Hub 名称、描述独立维护,CCL 随装配版本缓存,用于人类界面和当前策略上报;修改脚本说明不会覆盖 Hub 文案。`ccl load` 和模块详情仍向 Agent 提供脚本描述。本地尚未上传或离线时使用本地登记、缓存的展示信息。新脚本无需填写模块级 `name`,已有脚本仍可读取;感知事件的 `eventMetadata.name`、参数说明和玩家名字不受影响。
|
|
371
385
|
|
|
372
386
|
| 字段 | 类型 | 约束 |
|
|
373
387
|
|---|---|---|
|
|
374
|
-
| `apiVersion` | `3` | 必须等于 `
|
|
388
|
+
| `apiVersion` | `3` | 必须等于 `STRATEGY_PLUGIN_API_VERSION` |
|
|
375
389
|
| `id` | `string` | 稳定且唯一 |
|
|
376
390
|
| `description` | `string` | 非空的 Agent 能力说明 |
|
|
377
391
|
| `name` | `string`,可选 | 兼容已有脚本;新脚本省略,展示信息由 CCL 管理 |
|
|
378
392
|
| `localizations` | object,可选 | 兼容已有脚本的模块文案;人类展示优先采用本地登记或 Hub 下发的文案 |
|
|
379
|
-
| `inputs` | `
|
|
393
|
+
| `inputs` | `StrategyInputFieldSpec[]` | Activation 参数 schema |
|
|
380
394
|
| `execution` | `'parallel' \| 'serial'`,可选 | 省略为 parallel |
|
|
381
395
|
| `stateMode` | `'isolated' \| 'snapshot'`,可选 | 默认 isolated;snapshot 仅支持 parallel,继承同一 activation 内已完成计算的实例快照,不跨进程持久恢复 |
|
|
382
|
-
| `everyTicks` | `number`,可选 |
|
|
396
|
+
| `everyTicks` | `number`,可选 | 旧输入驱动执行器的兼容字段;固定周期 Owner 不据此跳过 decide |
|
|
383
397
|
| `produces` | `string[]`,可选 | 允许发布的自定义 Event type |
|
|
384
|
-
| `runtime` | `
|
|
398
|
+
| `runtime` | `StrategyRuntimeDefaults`,可选 | finite Activation 的默认运行预算 |
|
|
385
399
|
|
|
386
400
|
```ts
|
|
387
|
-
interface
|
|
401
|
+
interface StrategyRuntimeDefaults {
|
|
388
402
|
readonly defaultMs: number;
|
|
389
403
|
readonly deadlineOutcome?: 'completed' | 'failed';
|
|
390
404
|
readonly controlGraceMs?: number;
|
|
@@ -393,7 +407,7 @@ interface BehaviorRuntimeDefaults {
|
|
|
393
407
|
|
|
394
408
|
`defaultMs` 必须是 `1000..120000` 的安全整数;`controlGraceMs` 必须是 `0..30000` 的安全整数。
|
|
395
409
|
|
|
396
|
-
### 参数字段:`
|
|
410
|
+
### 参数字段:`StrategyInputFieldSpec`
|
|
397
411
|
|
|
398
412
|
每个字段都必须包含 `id`、`type` 和非空 `description`。`id` 必须匹配 `[A-Za-z][A-Za-z0-9_.-]{0,79}`。
|
|
399
413
|
|
|
@@ -410,13 +424,13 @@ interface BehaviorRuntimeDefaults {
|
|
|
410
424
|
`required: true` 不能同时声明 `default`。Runtime 不做字符串到数字等隐式转换;Activation 输入中的未知字段会被拒绝。
|
|
411
425
|
`string_list` 或 `player_seats` 标记为 required 时,数组本身也不能为空。
|
|
412
426
|
|
|
413
|
-
### 可选参数整理:`
|
|
427
|
+
### 可选参数整理:`StrategyNormalizationApi`
|
|
414
428
|
|
|
415
429
|
`normalize(input, api)` 只在一次 Activation 启动前调用一次。它可以使用:
|
|
416
430
|
|
|
417
431
|
```ts
|
|
418
|
-
interface
|
|
419
|
-
readonly manifest: Readonly<
|
|
432
|
+
interface StrategyNormalizationApi {
|
|
433
|
+
readonly manifest: Readonly<ClawclawStrategyManifest>;
|
|
420
434
|
timing(input: Readonly<Record<string, unknown>>):
|
|
421
435
|
{ readonly timeout_ms?: number; readonly duration_ms?: number };
|
|
422
436
|
string(value: unknown, field: string): string;
|
|
@@ -437,113 +451,6 @@ interface BehaviorNormalizationApi {
|
|
|
437
451
|
|
|
438
452
|
这里没有动态 `GameState` 或 Action 能力;动态判断放在 `decide()` 中。
|
|
439
453
|
|
|
440
|
-
## 感知 API
|
|
441
|
-
|
|
442
|
-
### `PerceptionFrame`
|
|
443
|
-
|
|
444
|
-
`PerceptionFrame` 是共享 `ObservationFrame` 的类型别名,字段见[共享观察帧](#共享观察帧)。普通感知的入口是:
|
|
445
|
-
|
|
446
|
-
```ts
|
|
447
|
-
update(
|
|
448
|
-
frame: Readonly<PerceptionFrame>,
|
|
449
|
-
api: PerceptionApi,
|
|
450
|
-
): readonly PerceptionEventProposal[] | void | Promise<readonly PerceptionEventProposal[] | void>;
|
|
451
|
-
```
|
|
452
|
-
|
|
453
|
-
需要 Worker 分析时继承 `ClawclawParallelPerception<TAnalysis>`:
|
|
454
|
-
|
|
455
|
-
```ts
|
|
456
|
-
interface PerceptionAnalysisInput {
|
|
457
|
-
readonly frame: Readonly<PerceptionFrame>;
|
|
458
|
-
readonly history: readonly Readonly<PerceptionFrame>[];
|
|
459
|
-
readonly gapBefore: boolean;
|
|
460
|
-
}
|
|
461
|
-
|
|
462
|
-
analyze(input: Readonly<PerceptionAnalysisInput>, api: PerceptionApi): TAnalysis | Promise<TAnalysis>;
|
|
463
|
-
|
|
464
|
-
commit(
|
|
465
|
-
frame: Readonly<PerceptionFrame>,
|
|
466
|
-
analysis: Readonly<TAnalysis>,
|
|
467
|
-
api: PerceptionApi,
|
|
468
|
-
): readonly PerceptionEventProposal[] | void | Promise<readonly PerceptionEventProposal[] | void>;
|
|
469
|
-
```
|
|
470
|
-
|
|
471
|
-
`history` 只包含旧帧,按时间升序且不包含当前 `frame`;整个窗口最多 10 帧。`gapBefore` 表示已存在前帧,但无法证明轨迹连续。执行模型与状态放置规则见[开发感知](./perception.md)。
|
|
472
|
-
|
|
473
|
-
### 查询:`PerceptionApi`
|
|
474
|
-
|
|
475
|
-
```ts
|
|
476
|
-
interface PerceptionApi {
|
|
477
|
-
readonly spatial: SpatialApi;
|
|
478
|
-
}
|
|
479
|
-
```
|
|
480
|
-
|
|
481
|
-
`SpatialApi` 与策略的 `api.spatial` 相同。感知不提供 navigation 或 observation 查询;它应只根据当前/历史观察帧和静态地图形成视觉事实。
|
|
482
|
-
|
|
483
|
-
### 输出:`PerceptionEventProposal`
|
|
484
|
-
|
|
485
|
-
```ts
|
|
486
|
-
interface PerceptionEventProposal {
|
|
487
|
-
wakeAgent?: boolean; // 覆盖 Manifest 默认值;省略时继承,最终默认 true
|
|
488
|
-
readonly type: string;
|
|
489
|
-
readonly dedupeKey: string;
|
|
490
|
-
readonly dedupeScope?: 'segment' | 'session';
|
|
491
|
-
readonly payload: Readonly<Record<string, unknown>>;
|
|
492
|
-
readonly occurredAt?: string;
|
|
493
|
-
}
|
|
494
|
-
```
|
|
495
|
-
|
|
496
|
-
| 字段 | 约束 |
|
|
497
|
-
|---|---|
|
|
498
|
-
| `type` | 非空,且必须列在 `manifest.produces` |
|
|
499
|
-
| `dedupeKey` | 同一 epoch、同一输出位置重放时的稳定非空键;跨轮不重复通知由模块状态控制 |
|
|
500
|
-
| `dedupeScope` | 省略时为 `segment`;可选 `session`,只选择身份命名空间,不表示跨 epoch 永久去重 |
|
|
501
|
-
| `payload` | 普通、可 clone 的 JSON 对象 |
|
|
502
|
-
| `occurredAt` | 可选的事件发生时间字符串 |
|
|
503
|
-
|
|
504
|
-
感知不能返回 Action、Status、State patch 或策略 Activation。
|
|
505
|
-
|
|
506
|
-
### 边界回调
|
|
507
|
-
|
|
508
|
-
```ts
|
|
509
|
-
interface PerceptionBoundary {
|
|
510
|
-
readonly kind:
|
|
511
|
-
| 'events_requested'
|
|
512
|
-
| 'phase_changed'
|
|
513
|
-
| 'trajectory_gap'
|
|
514
|
-
| 'segment_ending'
|
|
515
|
-
| 'shutdown';
|
|
516
|
-
readonly mode: 'snapshot' | 'close';
|
|
517
|
-
readonly through: Readonly<PerceptionFrame> | null;
|
|
518
|
-
}
|
|
519
|
-
|
|
520
|
-
flush?(boundary: Readonly<PerceptionBoundary>, api: PerceptionApi):
|
|
521
|
-
readonly PerceptionEventProposal[] | void | Promise<readonly PerceptionEventProposal[] | void>;
|
|
522
|
-
|
|
523
|
-
reset?(reason: 'phase_changed' | 'trajectory_gap' | 'segment_ending' | 'shutdown' | 'replay'):
|
|
524
|
-
void | Promise<void>;
|
|
525
|
-
|
|
526
|
-
debugSnapshot?(): unknown;
|
|
527
|
-
```
|
|
528
|
-
|
|
529
|
-
`flush()` 只在 Runtime 要求报告未关闭的长语义片段时调用;`debugSnapshot()` 仅进入诊断和离线 replay,不会成为 Agent Event。
|
|
530
|
-
|
|
531
|
-
### Manifest:`ClawclawPerceptionManifest`
|
|
532
|
-
|
|
533
|
-
| 字段 | 类型 | 约束 |
|
|
534
|
-
|---|---|---|
|
|
535
|
-
| `apiVersion` | `2` | 必须等于 `PERCEPTION_PLUGIN_API_VERSION` |
|
|
536
|
-
| `id` | `string` | 稳定的模块 ID |
|
|
537
|
-
| `description` | `string` | 非空的 Agent 能力说明 |
|
|
538
|
-
| `name` | `string`,可选 | 兼容已有脚本;新脚本省略,展示信息由 CCL 管理 |
|
|
539
|
-
| `localizations` | object,可选 | 兼容已有脚本的模块文案;人类展示优先采用本地登记或 Hub 下发的文案 |
|
|
540
|
-
| `subjectScope` | `'others' \| 'self_and_others' \| 'visible_pairs' \| 'corpses'` | 描述 Event 主体范围 |
|
|
541
|
-
| `produces` | `string[]` | 允许输出的 Event type |
|
|
542
|
-
| `wakeAgent` | boolean,可选 | 模块默认是否主动唤醒 Agent,省略为 true;单条 proposal 可覆盖 |
|
|
543
|
-
| `eventMetadata` | object,可选 | 每种 Event 的名称、说明和本地化 |
|
|
544
|
-
| `execution` | `'parallel_analysis'`,可选 | 启用 `analyze/commit` 接口 |
|
|
545
|
-
| `boundaryBaseline` | `'current_only'`,可选 | 声明边界重建能力 |
|
|
546
|
-
|
|
547
454
|
## 共享数据结构
|
|
548
455
|
|
|
549
456
|
### 基础引用
|
|
@@ -706,6 +613,8 @@ interface VisualCorpse {
|
|
|
706
613
|
|
|
707
614
|
### `GameEvent`
|
|
708
615
|
|
|
616
|
+
会议结果 `exile` / `no_exile` 的 `payload.votes` 可为 `Array<[number, number | null]>`:每项依次是投票者座位、被投者座位,`null` 表示弃票。数字是座位,不是数组下标或玩家 UUID;CCL 保留后端给出的顺序和空数组。感知输出的完整会议通知也保留这份结构,不从 State 重建票型。 原始 GameEvent 的 actor_name/actor_seat 仍可供内部模块读取;给 Agent 的放逐通知以 exiled_player 提供被放逐者信息,不重复输出这两个 actor 字段。
|
|
617
|
+
|
|
709
618
|
```ts
|
|
710
619
|
interface GameEvent {
|
|
711
620
|
readonly eventId: string;
|
|
@@ -722,7 +631,7 @@ interface GameEvent {
|
|
|
722
631
|
|
|
723
632
|
```ts
|
|
724
633
|
import type {
|
|
725
|
-
|
|
634
|
+
StrategyInput,
|
|
726
635
|
GameEvent,
|
|
727
636
|
GameState,
|
|
728
637
|
ObservationFrame,
|
|
@@ -737,38 +646,38 @@ import type {
|
|
|
737
646
|
|
|
738
647
|
## 独立感知的反射接口与局中控制
|
|
739
648
|
|
|
740
|
-
感知和
|
|
649
|
+
感知和 Strategy 是两个资源,必须分别装配。策略只需默认导出 ClawclawStrategy API v3;统一感知 Manifest 可声明固定绑定:
|
|
741
650
|
|
|
742
651
|
```ts
|
|
743
|
-
|
|
652
|
+
strategies: {
|
|
744
653
|
escape: { name: 'community.auto-escape', resourceId: '可选资源ID', layer: 'reflex',
|
|
745
654
|
input: {}, reflexPriority: 40, cooldownMs: 3000, rearm: 'after_clear', maxRuntimeMs: 10000 }
|
|
746
655
|
}
|
|
747
656
|
// evaluate 返回:
|
|
748
|
-
{ state, events, activations: [{
|
|
657
|
+
{ state, events, activations: [{ strategy: 'escape', input: {}, reason: 'player_nearby' }] }
|
|
749
658
|
```
|
|
750
659
|
|
|
751
660
|
binding 键必须为合法 ID,最多 16 项。name 必需;resourceId 优先于同名/同源别名匹配。layer 只允许 reflex。reflexPriority 是 -1000000..1000000 的整数;cooldownMs 为 0..86400000;maxRuntimeMs 为 1..120000。rearm 为 after_clear(默认)或 after_cooldown;优先级默认 0、冷却默认 1000ms、最长默认 10000ms。激活 input 覆盖绑定 input,再覆盖本局策略默认参数。未知绑定、重复绑定或非法输出被拒绝。
|
|
752
661
|
|
|
753
|
-
输入 availableBindings/
|
|
662
|
+
输入 availableBindings/availableStrategies 是实际可用依赖;enabledBindings 是其中当前允许自动激活的绑定。缺失或损坏策略只跳过对应绑定,感知其他通知与健康绑定继续运行。感知同时可发自己的通知,不直接执行 Action。
|
|
754
663
|
|
|
755
664
|
```powershell
|
|
756
|
-
ccl
|
|
665
|
+
ccl strategy update community.auto-escape --input '{"x":100,"y":200}'
|
|
757
666
|
ccl perception update community.nearby-reflex --input '{"triggerDistance":180}'
|
|
758
|
-
ccl
|
|
759
|
-
ccl
|
|
667
|
+
ccl strategy watch community.auto-escape
|
|
668
|
+
ccl strategy status community.auto-escape
|
|
760
669
|
ccl perception status community.nearby-reflex
|
|
761
|
-
ccl
|
|
670
|
+
ccl strategy unwatch community.auto-escape
|
|
762
671
|
```
|
|
763
672
|
|
|
764
|
-
|
|
673
|
+
strategy update 更新全部当前实例及后续启动默认值;显式补丁保留未修改的动态目标。可选 --activation 只改指定激活。保留 ID/截止时间,增加实例代际,暂停实例保持暂停。perception update 只更新判断参数,不清记忆。watch/unwatch 只管理自动激活开关;unwatch 取消关联 Reflex,感知继续观察、记忆和通知。cancel 只取消一次执行。status 返回执行栈、parameters、watches(perception_id/binding/available/reason/enabled/active/priority/armed/cooldown_remaining_ms);perception status 返回观察健康、配置和绑定。
|
|
765
674
|
|
|
766
|
-
设置本局有效,不写 Hub 或 gameplay.json;换局与 Owner
|
|
675
|
+
设置本局有效,不写 Hub 或 gameplay.json;换局与 Owner 重启恢复默认值及关闭状态。开启只要求两个资源已装配,不提前校验尚由感知动态选择的目标;激活时校验完整输入。
|
|
767
676
|
|
|
768
677
|
|
|
769
678
|
### api.memory:局内持续记忆
|
|
770
679
|
|
|
771
|
-
|
|
680
|
+
StrategyReadApi 和 PerceptionModuleApi 均提供以下接口:
|
|
772
681
|
|
|
773
682
|
```ts
|
|
774
683
|
type StrategyMemoryValue = null | boolean | number | string
|
|
@@ -786,10 +695,18 @@ await api.memory.delete('handled:corpse-id');
|
|
|
786
695
|
|
|
787
696
|
get 读取当前值并返回副本,缺失为 undefined;set 覆盖一个键,delete 删除一个键,删除不存在的键成功。调用成功即生效,不需要在 Decision 中返回 memory 字段,也不等待动作确认;后续 Decision 失败不会回滚已成功写入。模块仍须通过权威 State/Event 判断业务结果。回调失效后新的访问会拒绝,但不会撤回此前有效调用完成的写入。
|
|
788
697
|
|
|
789
|
-
感知的所有固定绑定均解析到同一个可用策略时,与该策略双向共享;没有绑定、存在不可用绑定或绑定多个策略时,感知使用自己的私有命名空间。同一策略的不同层/Activation/Worker 也共享。绑定由宿主固定到实际操作名,API 不接受其他策略 ID;不同策略、重名别名、账号和 Owner
|
|
698
|
+
感知的所有固定绑定均解析到同一个可用策略时,与该策略双向共享;没有绑定、存在不可用绑定或绑定多个策略时,感知使用自己的私有命名空间。同一策略的不同层/Activation/Worker 也共享。绑定由宿主固定到实际操作名,API 不接受其他策略 ID;不同策略、重名别名、账号和 Owner 相互隔离。
|
|
790
699
|
|
|
791
700
|
生命周期:跨回调、暂停恢复、实例更换、改参、完成重启及 watch/unwatch 保留;新游戏、game_over 或 Owner 退出清空。仅保存在当前进程内存中,不落盘或恢复旧检查点。它与感知私有 state、并行实例 snapshot 和 Agent 跨局 memory 文件是不同数据。
|
|
792
701
|
|
|
793
702
|
限制:JSON 值、最大 32 层嵌套;每资源最多 256 键/64 KiB(UTF-8 键值合计),键名 1–256 字节;游戏作用域总计最多 4 MiB。不支持 undefined、非有限数字、函数、访问器、Map/Set、循环对象。非法/超限写入失败且原值不变。不同键独立更新,同一键按宿主收到的写入顺序生效;多步读改写不是事务。
|
|
794
703
|
|
|
795
704
|
主要错误:strategy_memory_key_invalid、strategy_memory_value_invalid、strategy_memory_limit_exceeded、strategy_memory_inactive;无有效记忆宿主时为 strategy_memory_unavailable。await evaluate/decide 结束后不要保留 API 给异步定时器使用。
|
|
705
|
+
|
|
706
|
+
### 通知内容的归属
|
|
707
|
+
|
|
708
|
+
感知输出的 payload.hint 可为非空字符串,由感知执行器负责校验/保留;非字符串 hint 和旧 next_step/notice 被过滤。内置感知不信任输入事实中的提示,会生成自身的固定提示。通用 EventIngress 只校验和存储,不再承担这些业务字段过滤。通知正文在生产时保存,Mailbox 和 Adapter 不调用当前 State 来补内容。
|
|
709
|
+
|
|
710
|
+
会议发言顺序只接受后端 meeting_briefing.speech_order,不从 State 补齐。此变化不改变 Strategy 的 update/watch/unwatch、感知输入或通知轮次调度。
|
|
711
|
+
|
|
712
|
+
Source 会将 meeting_briefing.speech_order 的名字字符串按同一事件 all_seats 转换为 PlayerRef[];不按座位排序,不读取 State,不补缺失字段。已有数组继续按 PlayerRef 校验。无法唯一转换时保留原字符串,Source 记录 runtime.source.event_field_preserved 诊断,不丢弃会议事件或其同批事件。
|