femo-plugin 1.0.4 → 1.0.6
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 +1 -1
- package/NOTICE +8 -0
- package/README.md +12 -1
- package/docs/ActiveRoadmaps/Func/345/201/234/346/255/242/350/257/255/344/271/211-/351/201/227/345/274/203/346/216/245/347/273/255-/346/226/275/345/267/245/346/270/205/345/215/225.md +91 -0
- package/docs/ActiveRoadmaps//345/217/214user/346/226/275/345/267/245/346/270/205/345/215/225.md +326 -0
- package/docs/Specs//346/212/225/345/275/261/344/270/255/345/277/203/350/241/214/345/215/217/350/256/256.md +616 -569
- package/femo2host/AGENTS.md +1 -1
- package/femo2host/femoGenConnector/engine-client.mjs +7 -2
- package/femo2host/femoGenConnector/file-dialogs.mjs +108 -2
- package/femo2host/femoToolcall/chronica.py +99 -19
- package/femo2host/femo_api.py +14 -1
- package/femo2host/host/actor-core.d.mts +25 -0
- package/femo2host/host/actor-core.mjs +72 -0
- package/femo2host/host/cast-core.d.mts +3 -0
- package/femo2host/host/cast-core.mjs +14 -0
- package/femo2host/host/daemon-client.mjs +59 -10
- package/femo2host/host/hub-render-core.d.mts +2 -0
- package/femo2host/host/hub-render-core.mjs +6 -2
- package/femo2host/host/run-state-core.d.mts +4 -0
- package/femo2host/host/run-state-core.mjs +4 -0
- package/femo2host/host/speech-core.mjs +11 -4
- package/femo2host/host/tools-core.d.mts +11 -0
- package/femo2host/host/tools-core.mjs +39 -0
- package/femo2host/mailbox.py +630 -545
- package/femo2host/projectionCenter/app.css +61 -0
- package/femo2host/projectionCenter/composer.mjs +233 -20
- package/femo2host/projectionCenter/identity.mjs +131 -0
- package/femo2host/projectionCenter/index.html +55 -1
- package/femo2host/projectionCenter/main.mjs +231 -35
- package/femo2host/projectionCenter/panels.mjs +108 -16
- package/femo2host/projectionCenter/render.mjs +813 -695
- package/femo2host/projectionCenter/state.mjs +30 -0
- package/femo2host/projectionCenter/util.mjs +28 -0
- package/femo2host/projection_hub.py +1796 -230
- package/femo2host/python/femo_bridge.py +303 -33
- package/femo2host/python/femo_daemon.py +1528 -1209
- package/femo2host/python/mirror_window.py +237 -0
- package/femoBridges/ContextExample.py +113 -71
- package/femoCompiler/AGENTS.md +1 -0
- package/femoCompiler/FEMO_parser.py +2641 -2567
- package/femoCompiler/FEMO_runtime.py +217 -44
- package/femoCompiler/FEMO_scope_resolver.py +26 -12
- package/femoCompiler/block_collector.py +24 -27
- package/femoCompiler/db_utils.py +560 -503
- package/femoCompiler/femoAsync.py +466 -436
- package/femoCompiler/func_registry.py +74 -0
- package/femoCompiler/protocol.py +127 -127
- package/femoCompiler/save_dialog.py +497 -446
- package/femoExamples/AI/350/201/212/345/244/251/345/256/244/AI/350/201/212/345/244/251/345/256/244-/345/270/246agent/347/211/210.femo +229 -142
- package/femoExamples/AI/350/201/212/345/244/251/345/256/244/random_wait_time.py +91 -2
- package/femoExamples/LuxFiat/luxfiat-loop.femo +0 -1
- package/femoExamples/LuxFiat/luxfiat-simple.femo +23 -24
- package/femoExamples/debug/347/245/236/345/231/250/debug/347/245/236/345/231/250.femo +221 -222
- package/femoExamples/discussion.femo +72 -72
- package/femoExamples//347/213/274/344/272/272/346/235/200//347/213/274/344/272/272/346/235/200-/350/255/246/351/225/277/347/211/210-9/344/272/272/351/242/204/345/245/263/347/214/216.femo +1 -2
- package/femoExamples//347/213/274/344/272/272/346/235/200//347/213/274/344/272/272/346/235/200-/350/255/246/351/225/277/347/211/210.femo +1 -2
- package/femoExamples//347/213/274/344/272/272/346/235/200//347/213/274/344/272/272/346/235/200.femo +1 -2
- package/femoExamples//350/260/201/346/230/257/345/215/247/345/272/225//350/260/201/346/230/257/345/215/247/345/272/225-/350/217/234/345/270/202/345/234/272/345/261/200.femo +1 -1
- package/femoExamples//350/260/201/346/230/257/345/215/247/345/272/225//350/260/201/346/230/257/345/215/247/345/272/225.femo +1 -1
- package/femoGen/document_ch.html +1 -0
- package/femoGen/document_en.html +1 -0
- package/femoGen/index.html +1 -0
- package/femoGen/intro_ch.html +1 -0
- package/femoGen/intro_en.html +1 -0
- package/femoGen/package.json +7 -0
- package/femoGen/public/femo-logo-slogan.svg +5 -0
- package/femoGen/public/femo-logo.svg +6 -1
- package/femoGen/src/femoParser.jsx +14 -0
- package/hostAdapter/dshAdapter/host/femo-skill.ts +23 -10
- package/hostAdapter/dshAdapter/host/routes/projection-input.ts +3 -0
- package/hostAdapter/dshAdapter/lib/client.js +20 -2
- package/hostAdapter/dshAdapter/lib/client.js.map +2 -2
- package/hostAdapter/dshAdapter/lib/main.js +161 -18
- package/hostAdapter/dshAdapter/lib/main.js.map +3 -3
- package/hostAdapter/dshAdapter/package.json +11 -1
- package/hostAdapter/webAdapter/console/index.html +13 -4
- package/hostAdapter/webAdapter/extension/background.js +16 -5
- package/hostAdapter/webAdapter/extension/seat-agent-core.js +836 -791
- package/hostAdapter/webAdapter/extension/sidepanel/actors.mjs +101 -0
- package/hostAdapter/webAdapter/extension/sidepanel/main.mjs +81 -20
- package/hostAdapter/webAdapter/extension/sidepanel/reconnect.mjs +33 -0
- package/hostAdapter/webAdapter/extension/sidepanel/run-control.mjs +22 -11
- package/hostAdapter/webAdapter/extension/sidepanel/seats.mjs +6 -20
- package/hostAdapter/webAdapter/extension/sidepanel.html +31 -8
- package/hostAdapter/webAdapter/native/install-native-host.mjs +1 -0
- package/hostAdapter/webAdapter/native/register-core.mjs +69 -28
- package/hostAdapter/webAdapter/native/web-launcher.sh +37 -0
- package/hostAdapter/webAdapter/package.json +7 -0
- package/hostAdapter/webAdapter/readme.md +51 -10
- package/hostAdapter/webAdapter/server/bridge.mjs +1 -1
- package/hostAdapter/webAdapter/server/runtime.mjs +51 -5
- package/hostAdapter/webAdapter/server/seats.mjs +11 -6
- package/hostAdapter/webAdapter/server/service.mjs +108 -15
- package/hostAdapter/webAdapter/shared/seats-core.mjs +31 -6
- package/hostAdapter/webAdapter/sites/chat.deepseek.com/SITE.md +7 -0
- package/hostAdapter/webAdapter/sites/chat.deepseek.com/content.js +83 -68
- package/hostAdapter/webAdapter/sites/chatglm.cn/inject.js +76 -4
- package/hostAdapter/webAdapter/sites/chatgpt.com/SITE.md +7 -1
- package/hostAdapter/webAdapter/sites/chatgpt.com/content.js +37 -5
- package/hostAdapter/webAdapter/sites/chatgpt.com/inject.js +40 -4
- package/hostAdapter/webAdapter/start-service.command +16 -0
- package/hostAdapter/webAdapter/tests/chatgpt-input.test.mjs +58 -0
- package/hostAdapter/webAdapter/tests/chatgpt-parser.test.mjs +37 -0
- package/hostAdapter/webAdapter/tests/deepseek-sanitize.test.mjs +68 -0
- package/hostAdapter/webAdapter/tests/runtime.test.mjs +42 -0
- package/hostAdapter/webAdapter/tests/seats-core.test.mjs +37 -1
- package/hostAdapter/webAdapter/tests/smoke-service.mjs +261 -232
- package/hostAdapter/zcodeAdapter/runtime/speech-collect.mjs +6 -0
- package/hostAdapter/zcodeAdapter/skills/femo/SKILL.md +3 -0
- package/hostAdapter/zcodeAdapter/tests/unbound-actors.test.mjs +51 -0
- package/package.json +7 -1
- package//350/257/255/346/263/225/346/226/207/346/241/243.md +1224 -1202
|
@@ -1,232 +1,261 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* smoke-service.mjs — 本地服务冒烟(手动运行,不拉真桥、不碰真浏览器)。
|
|
4
|
-
*
|
|
5
|
-
* 起 service.mjs(随机端口+一次性沙盒),打一遍扩展协议面与操作台协议面:
|
|
6
|
-
* /health /console /seats /seats/bind /extension/register /extension/poll
|
|
7
|
-
* /extension/report /seats/deliver /state /tools
|
|
8
|
-
* 运行:node tests/smoke-service.mjs
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import { mkdtempSync, readFileSync } from 'node:fs';
|
|
12
|
-
import { tmpdir } from 'node:os';
|
|
13
|
-
import { join } from 'node:path';
|
|
14
|
-
import { spawn } from 'node:child_process';
|
|
15
|
-
import { fileURLToPath } from 'node:url';
|
|
16
|
-
import { dirname } from 'node:path';
|
|
17
|
-
|
|
18
|
-
const ADAPTER_ROOT = join(dirname(fileURLToPath(import.meta.url)), '..');
|
|
19
|
-
process.env.FEMO_DATA_DIR = mkdtempSync(join(tmpdir(), 'femo-web-svc-smoke-'));
|
|
20
|
-
process.env.FEMO_WEB_PORT = '18796';
|
|
21
|
-
|
|
22
|
-
const child = spawn(process.execPath, [join(ADAPTER_ROOT, 'server', 'service.mjs')], {
|
|
23
|
-
env: process.env,
|
|
24
|
-
stdio: ['ignore', 'pipe', 'pipe'],
|
|
25
|
-
});
|
|
26
|
-
child.stdout.on('data', c => process.stdout.write(`[svc] ${c}`));
|
|
27
|
-
child.stderr.on('data', c => process.stdout.write(`[svc:err] ${c}`));
|
|
28
|
-
|
|
29
|
-
const BASE = 'http://127.0.0.1:18796';
|
|
30
|
-
const sleep = ms => new Promise(r => setTimeout(r, ms));
|
|
31
|
-
|
|
32
|
-
async function waitHealthy() {
|
|
33
|
-
for (let i = 0; i < 30; i++) {
|
|
34
|
-
try {
|
|
35
|
-
const r = await fetch(`${BASE}/health`);
|
|
36
|
-
if (r.ok) return r.json();
|
|
37
|
-
} catch { /* 还没起 */ }
|
|
38
|
-
await sleep(300);
|
|
39
|
-
}
|
|
40
|
-
throw new Error('service did not become healthy in 9s');
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
async function post(path, body) {
|
|
44
|
-
const r = await fetch(`${BASE}${path}`, { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify(body) });
|
|
45
|
-
return { status: r.status, json: await r.json() };
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
let ok = true;
|
|
49
|
-
try {
|
|
50
|
-
const health = await waitHealthy();
|
|
51
|
-
console.log('health =>', JSON.stringify(health).slice(0, 140));
|
|
52
|
-
assertEq(health.host, 'web', 'host 自称');
|
|
53
|
-
|
|
54
|
-
const seats0 = await (await fetch(`${BASE}/seats`)).json();
|
|
55
|
-
assertEq(seats0.seats.length, 0, '初始无席位');
|
|
56
|
-
|
|
57
|
-
// 会话引用形态(`<域名>:<id>`,见 sites.mjs)——多站在役后的正字 id
|
|
58
|
-
const REF = 'chat.deepseek.com:12345678-abcd';
|
|
59
|
-
const reg = await post('/extension/register', { connId: 'conn-test', tabs: [{ tabId: 11, sessionId: REF, site: 'chat.deepseek.com', title: '冒烟会话', busy: false }] });
|
|
60
|
-
assertEq(reg.json.ok, true, '注册成功');
|
|
61
|
-
assertEq(reg.status, 200);
|
|
62
|
-
|
|
63
|
-
const seats1 = await (await fetch(`${BASE}/seats`)).json();
|
|
64
|
-
assertEq(seats1.seats.length, 1, '注册后一席');
|
|
65
|
-
assertEq(seats1.seats[0].online, true);
|
|
66
|
-
assertEq(seats1.seats[0].present, true, '在场=页开着');
|
|
67
|
-
assertEq(seats1.seats[0].siteLabel, 'DeepSeek', '视图派生来源显示名');
|
|
68
|
-
assertEq(seats1.seats[0].sidShort, '12345678', '视图派生短 id(剥来源前缀)');
|
|
69
|
-
|
|
70
|
-
// 冻结页登记(2026-10-01 按需唤醒):online:false 的页照样在场(present:true);
|
|
71
|
-
// 页关了(下轮没报到)才出账;恢复上报后席位复活(后面的绑定/下发要用它)。
|
|
72
|
-
await post('/extension/register', { connId: 'conn-test', tabs: [{ tabId: 11, sessionId: REF, site: 'chat.deepseek.com', title: '冒烟会话', busy: false, online: false }] });
|
|
73
|
-
const seatsFrozen = await (await fetch(`${BASE}/seats`)).json();
|
|
74
|
-
assertEq(seatsFrozen.seats[0].present, true, '冻结页照样在场');
|
|
75
|
-
assertEq(seatsFrozen.seats[0].online, false, '冻结页不在线');
|
|
76
|
-
await post('/extension/register', { connId: 'conn-test', tabs: [] });
|
|
77
|
-
const seatsGone = await (await fetch(`${BASE}/seats`)).json();
|
|
78
|
-
assertEq(seatsGone.seats[0].present, false, '页关了=出账');
|
|
79
|
-
assertEq(seatsGone.seats[0].online, false);
|
|
80
|
-
await post('/extension/register', { connId: 'conn-test', tabs: [{ tabId: 11, sessionId: REF, site: 'chat.deepseek.com', title: '冒烟会话', busy: false, online: true }] });
|
|
81
|
-
|
|
82
|
-
// 绑定要过 hub cast 账 + 角色库核查——先等桥/hub 就绪(投影中心地址解析出来即算)
|
|
83
|
-
let projPort = 0;
|
|
84
|
-
for (let i = 0; i < 40 && !projPort; i++) {
|
|
85
|
-
const st = await fetch(`${BASE}/state`).then(r => r.json()).catch(() => undefined);
|
|
86
|
-
projPort = st?.projection?.port ?? 0;
|
|
87
|
-
if (!projPort) await sleep(300);
|
|
88
|
-
}
|
|
89
|
-
assertOk(projPort > 0, 'hub 就绪(投影中心地址已解析)');
|
|
90
|
-
|
|
91
|
-
const soulsR = await post('/tools/femo_soul', { action: 'list' });
|
|
92
|
-
const soulId = soulsR.json?.result?.souls?.map(s => s.soul_id).find(id => id && id !== 'human');
|
|
93
|
-
assertOk(Boolean(soulId), `角色库可读(取 ${soulId} 冒烟;human 不可绑)`);
|
|
94
|
-
|
|
95
|
-
const bind = await post('/seats/bind', { sessionId: REF, soul: soulId });
|
|
96
|
-
assertEq(bind.json.ok, true, '绑定灵魂(hub cast 正身账 + 本地席位)');
|
|
97
|
-
assertEq(bind.json.hub, true, '绑定写进 hub 正身账');
|
|
98
|
-
|
|
99
|
-
const miss = await post('/seats/bind', { sessionId: 'nope', soul: soulId });
|
|
100
|
-
assertEq(miss.status, 404, '无此席位 404');
|
|
101
|
-
|
|
102
|
-
const rebind = await post('/seats/bind', { sessionId: REF, soul: soulId });
|
|
103
|
-
assertEq(rebind.json.ok, true, '同魂同椅重复绑定幂等');
|
|
104
|
-
|
|
105
|
-
// 长轮询:挂一个 poll,然后 deliver 应立刻送出
|
|
106
|
-
const pollP = fetch(`${BASE}/extension/poll?conn=conn-test&timeout=3000`).then(r => r.json());
|
|
107
|
-
await sleep(300);
|
|
108
|
-
const dv = await post('/seats/deliver', { sessionId: REF, text: '冒烟测试一句话' });
|
|
109
|
-
assertEq(dv.json.ok, true, '手工发消息受理');
|
|
110
|
-
const pollR = await pollP;
|
|
111
|
-
assertEq(pollR.frames.length, 1, 'poll 拿到下发帧');
|
|
112
|
-
assertEq(pollR.frames[0].type, 'deliver');
|
|
113
|
-
|
|
114
|
-
// 上行报告:busy/reply(reply 是 manual 帧 → runtime 无此 deliveryId,handled=false 也算通)
|
|
115
|
-
const rep = await post('/extension/report', { type: 'busy', sessionId: REF, busy: true });
|
|
116
|
-
assertEq(rep.json.handled, true, 'busy 上行受理');
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
//
|
|
120
|
-
//
|
|
121
|
-
//
|
|
122
|
-
//
|
|
123
|
-
//
|
|
124
|
-
//
|
|
125
|
-
//
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
const
|
|
133
|
-
const
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
assertOk(
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
assertOk(consoleHtml.includes('
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
//
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
assertOk(canvasHtml.includes(
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
//
|
|
179
|
-
//
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
assertEq(save1.json.
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* smoke-service.mjs — 本地服务冒烟(手动运行,不拉真桥、不碰真浏览器)。
|
|
4
|
+
*
|
|
5
|
+
* 起 service.mjs(随机端口+一次性沙盒),打一遍扩展协议面与操作台协议面:
|
|
6
|
+
* /health /console /seats /seats/bind /extension/register /extension/poll
|
|
7
|
+
* /extension/report /seats/deliver /state /tools
|
|
8
|
+
* 运行:node tests/smoke-service.mjs
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { mkdtempSync, readFileSync } from 'node:fs';
|
|
12
|
+
import { tmpdir } from 'node:os';
|
|
13
|
+
import { join } from 'node:path';
|
|
14
|
+
import { spawn } from 'node:child_process';
|
|
15
|
+
import { fileURLToPath } from 'node:url';
|
|
16
|
+
import { dirname } from 'node:path';
|
|
17
|
+
|
|
18
|
+
const ADAPTER_ROOT = join(dirname(fileURLToPath(import.meta.url)), '..');
|
|
19
|
+
process.env.FEMO_DATA_DIR = mkdtempSync(join(tmpdir(), 'femo-web-svc-smoke-'));
|
|
20
|
+
process.env.FEMO_WEB_PORT = '18796';
|
|
21
|
+
|
|
22
|
+
const child = spawn(process.execPath, [join(ADAPTER_ROOT, 'server', 'service.mjs')], {
|
|
23
|
+
env: process.env,
|
|
24
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
25
|
+
});
|
|
26
|
+
child.stdout.on('data', c => process.stdout.write(`[svc] ${c}`));
|
|
27
|
+
child.stderr.on('data', c => process.stdout.write(`[svc:err] ${c}`));
|
|
28
|
+
|
|
29
|
+
const BASE = 'http://127.0.0.1:18796';
|
|
30
|
+
const sleep = ms => new Promise(r => setTimeout(r, ms));
|
|
31
|
+
|
|
32
|
+
async function waitHealthy() {
|
|
33
|
+
for (let i = 0; i < 30; i++) {
|
|
34
|
+
try {
|
|
35
|
+
const r = await fetch(`${BASE}/health`);
|
|
36
|
+
if (r.ok) return r.json();
|
|
37
|
+
} catch { /* 还没起 */ }
|
|
38
|
+
await sleep(300);
|
|
39
|
+
}
|
|
40
|
+
throw new Error('service did not become healthy in 9s');
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
async function post(path, body) {
|
|
44
|
+
const r = await fetch(`${BASE}${path}`, { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify(body) });
|
|
45
|
+
return { status: r.status, json: await r.json() };
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
let ok = true;
|
|
49
|
+
try {
|
|
50
|
+
const health = await waitHealthy();
|
|
51
|
+
console.log('health =>', JSON.stringify(health).slice(0, 140));
|
|
52
|
+
assertEq(health.host, 'web', 'host 自称');
|
|
53
|
+
|
|
54
|
+
const seats0 = await (await fetch(`${BASE}/seats`)).json();
|
|
55
|
+
assertEq(seats0.seats.length, 0, '初始无席位');
|
|
56
|
+
|
|
57
|
+
// 会话引用形态(`<域名>:<id>`,见 sites.mjs)——多站在役后的正字 id
|
|
58
|
+
const REF = 'chat.deepseek.com:12345678-abcd';
|
|
59
|
+
const reg = await post('/extension/register', { connId: 'conn-test', tabs: [{ tabId: 11, sessionId: REF, site: 'chat.deepseek.com', title: '冒烟会话', busy: false }] });
|
|
60
|
+
assertEq(reg.json.ok, true, '注册成功');
|
|
61
|
+
assertEq(reg.status, 200);
|
|
62
|
+
|
|
63
|
+
const seats1 = await (await fetch(`${BASE}/seats`)).json();
|
|
64
|
+
assertEq(seats1.seats.length, 1, '注册后一席');
|
|
65
|
+
assertEq(seats1.seats[0].online, true);
|
|
66
|
+
assertEq(seats1.seats[0].present, true, '在场=页开着');
|
|
67
|
+
assertEq(seats1.seats[0].siteLabel, 'DeepSeek', '视图派生来源显示名');
|
|
68
|
+
assertEq(seats1.seats[0].sidShort, '12345678', '视图派生短 id(剥来源前缀)');
|
|
69
|
+
|
|
70
|
+
// 冻结页登记(2026-10-01 按需唤醒):online:false 的页照样在场(present:true);
|
|
71
|
+
// 页关了(下轮没报到)才出账;恢复上报后席位复活(后面的绑定/下发要用它)。
|
|
72
|
+
await post('/extension/register', { connId: 'conn-test', tabs: [{ tabId: 11, sessionId: REF, site: 'chat.deepseek.com', title: '冒烟会话', busy: false, online: false }] });
|
|
73
|
+
const seatsFrozen = await (await fetch(`${BASE}/seats`)).json();
|
|
74
|
+
assertEq(seatsFrozen.seats[0].present, true, '冻结页照样在场');
|
|
75
|
+
assertEq(seatsFrozen.seats[0].online, false, '冻结页不在线');
|
|
76
|
+
await post('/extension/register', { connId: 'conn-test', tabs: [] });
|
|
77
|
+
const seatsGone = await (await fetch(`${BASE}/seats`)).json();
|
|
78
|
+
assertEq(seatsGone.seats[0].present, false, '页关了=出账');
|
|
79
|
+
assertEq(seatsGone.seats[0].online, false);
|
|
80
|
+
await post('/extension/register', { connId: 'conn-test', tabs: [{ tabId: 11, sessionId: REF, site: 'chat.deepseek.com', title: '冒烟会话', busy: false, online: true }] });
|
|
81
|
+
|
|
82
|
+
// 绑定要过 hub cast 账 + 角色库核查——先等桥/hub 就绪(投影中心地址解析出来即算)
|
|
83
|
+
let projPort = 0;
|
|
84
|
+
for (let i = 0; i < 40 && !projPort; i++) {
|
|
85
|
+
const st = await fetch(`${BASE}/state`).then(r => r.json()).catch(() => undefined);
|
|
86
|
+
projPort = st?.projection?.port ?? 0;
|
|
87
|
+
if (!projPort) await sleep(300);
|
|
88
|
+
}
|
|
89
|
+
assertOk(projPort > 0, 'hub 就绪(投影中心地址已解析)');
|
|
90
|
+
|
|
91
|
+
const soulsR = await post('/tools/femo_soul', { action: 'list' });
|
|
92
|
+
const soulId = soulsR.json?.result?.souls?.map(s => s.soul_id).find(id => id && id !== 'human');
|
|
93
|
+
assertOk(Boolean(soulId), `角色库可读(取 ${soulId} 冒烟;human 不可绑)`);
|
|
94
|
+
|
|
95
|
+
const bind = await post('/seats/bind', { sessionId: REF, soul: soulId });
|
|
96
|
+
assertEq(bind.json.ok, true, '绑定灵魂(hub cast 正身账 + 本地席位)');
|
|
97
|
+
assertEq(bind.json.hub, true, '绑定写进 hub 正身账');
|
|
98
|
+
|
|
99
|
+
const miss = await post('/seats/bind', { sessionId: 'nope', soul: soulId });
|
|
100
|
+
assertEq(miss.status, 404, '无此席位 404');
|
|
101
|
+
|
|
102
|
+
const rebind = await post('/seats/bind', { sessionId: REF, soul: soulId });
|
|
103
|
+
assertEq(rebind.json.ok, true, '同魂同椅重复绑定幂等');
|
|
104
|
+
|
|
105
|
+
// 长轮询:挂一个 poll,然后 deliver 应立刻送出
|
|
106
|
+
const pollP = fetch(`${BASE}/extension/poll?conn=conn-test&timeout=3000`).then(r => r.json());
|
|
107
|
+
await sleep(300);
|
|
108
|
+
const dv = await post('/seats/deliver', { sessionId: REF, text: '冒烟测试一句话' });
|
|
109
|
+
assertEq(dv.json.ok, true, '手工发消息受理');
|
|
110
|
+
const pollR = await pollP;
|
|
111
|
+
assertEq(pollR.frames.length, 1, 'poll 拿到下发帧');
|
|
112
|
+
assertEq(pollR.frames[0].type, 'deliver');
|
|
113
|
+
|
|
114
|
+
// 上行报告:busy/reply(reply 是 manual 帧 → runtime 无此 deliveryId,handled=false 也算通)
|
|
115
|
+
const rep = await post('/extension/report', { type: 'busy', sessionId: REF, busy: true });
|
|
116
|
+
assertEq(rep.json.handled, true, 'busy 上行受理');
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
// ── 别家宿主绑定的灵魂:本场由 web 开、事件流全量送到 web,但信按设计留驿站等
|
|
120
|
+
// 对方自取——web 一步都不许动(不派工、不弹提醒横条)。2026-10-06 用户实报:
|
|
121
|
+
// 贴顶横条写「ai7 绑定的网页没能自动唤醒(Cannot access 'sid' before
|
|
122
|
+
// initialization)」——service.resolveSeat 的外宿主闸引用未初始化的 sid 撞
|
|
123
|
+
// TDZ,真正的「绑在别家」被 ReferenceError 顶掉,于是被当成唤醒失败 park 了。
|
|
124
|
+
// 本段是这条链的端到端锁(真服务 + 真 hub 选角账 + 真驿站上门口):外宿主判定
|
|
125
|
+
// 要抛得出来(服务日志见 skip 行),且一个提醒帧都不许发给扩展(全页面贴顶横条
|
|
126
|
+
// 的真身就是消息通道里的提醒帧)。
|
|
127
|
+
const hubCast = await fetch(`http://127.0.0.1:${projPort}/cast`, {
|
|
128
|
+
method: 'POST', headers: { 'content-type': 'application/json' },
|
|
129
|
+
body: JSON.stringify({ job_id: 2716, soul: 'ai7', sid: 'sess-zcode-1', host: 'zcode' }),
|
|
130
|
+
}).then(r => r.json());
|
|
131
|
+
assertEq(hubCast.ok, true, 'hub 选角账写入外宿主绑定(job 2716 / ai7 → zcode)');
|
|
132
|
+
const logFile = join(process.env.FEMO_DATA_DIR, 'service.log');
|
|
133
|
+
const logMark = readFileSync(logFile, 'utf8').length;
|
|
134
|
+
const foreignPush = await post('/femo-plugin/mailbox-push', {
|
|
135
|
+
letters: [{ kind: 'context', job_id: 2716, ref: 'wk-foreign' }],
|
|
136
|
+
brief: {
|
|
137
|
+
job_id: 2716, wait_key: 'wk-foreign', node_name: '[AI发言]', actor_name: '@Zcode(AI-7)',
|
|
138
|
+
source: '', actor_info: { soul: 'ai7' }, blocks: { prompt: '轮到你发言' },
|
|
139
|
+
},
|
|
140
|
+
});
|
|
141
|
+
assertEq(foreignPush.status, 200, '外宿主料包信上门照旧收下(驿站回执)');
|
|
142
|
+
await sleep(800); // 派工在路由返回之后异步跑
|
|
143
|
+
const afterLog = readFileSync(logFile, 'utf8').slice(logMark);
|
|
144
|
+
assertOk(afterLog.includes('绑定在别家宿主(zcode)'), '外宿主灵魂被认出来并静默跳过(日志留痕)');
|
|
145
|
+
assertOk(!/Cannot access 'sid'/.test(afterLog) && !afterLog.includes('没能自动唤醒'),
|
|
146
|
+
'没有任何「唤醒失败」降级——TDZ 天书与提醒横条都不许出现');
|
|
147
|
+
const pollAfter = await fetch(`${BASE}/extension/poll?conn=conn-test&timeout=300`).then(r => r.json()).catch(() => ({ frames: [] }));
|
|
148
|
+
assertEq((pollAfter.frames ?? []).filter(f => f.type === 'remind').length, 0, '提醒横条一帧都没发(别家会话没响应不是本宿主的事)');
|
|
149
|
+
|
|
150
|
+
const st = await (await fetch(`${BASE}/state`)).json();
|
|
151
|
+
assertEq(st.host, 'web');
|
|
152
|
+
assertOk(Array.isArray(st.runlog), 'state 带 runlog');
|
|
153
|
+
|
|
154
|
+
const tools = await (await fetch(`${BASE}/tools`)).json();
|
|
155
|
+
assertOk(Array.isArray(tools.tools) && tools.tools.length >= 6, `FEMO 运行控制工具 ${tools.tools?.length ?? 0} 个在册`);
|
|
156
|
+
|
|
157
|
+
const consoleHtml = await (await fetch(`${BASE}/console`)).text();
|
|
158
|
+
assertOk(consoleHtml.includes('操作台'), 'console 页可取');
|
|
159
|
+
|
|
160
|
+
// 本地服务卡(2026-09-30 定名并收编侧栏快捷卡三钮):标题与三钮接线要在页面上。
|
|
161
|
+
assertOk(consoleHtml.includes('本地服务') && consoleHtml.includes('id="svcAddr"'), '/console 有「本地服务」卡');
|
|
162
|
+
assertOk(consoleHtml.includes('id="restartService"') && consoleHtml.includes('id="stopService"') && consoleHtml.includes('id="mirrorToggle"'),
|
|
163
|
+
'/console 本地服务卡收编重启/关闭/镜窗三钮');
|
|
164
|
+
|
|
165
|
+
// 共享判断层(侧栏/操作台单份磁盘文件):操作台侧经本路由取到。
|
|
166
|
+
const sharedDom = await (await fetch(`${BASE}/console/shared/dom.mjs`)).text();
|
|
167
|
+
assertOk(sharedDom.includes('export function escapeHtml'), '/console/shared/ 伺候判断层模块');
|
|
168
|
+
|
|
169
|
+
// 画布(流程画布,server/canvas.mjs):页面两段播种脚本齐全(主题/后端 +
|
|
170
|
+
// 自动挂载);自动挂载面在冒烟里没挂载过任何东西,应 ok:false 不给文本。
|
|
171
|
+
const canvasHtml = await (await fetch(`${BASE}/canvas`)).text();
|
|
172
|
+
assertOk(canvasHtml.includes('femo_backend_host'), '/canvas 注入主题与后端播种');
|
|
173
|
+
assertOk(canvasHtml.includes("fetch('/canvas/mounted')") && canvasHtml.includes('femo_canvas_mount_applied'),
|
|
174
|
+
'/canvas 注入自动挂载播种段');
|
|
175
|
+
const mountedFace = await (await fetch(`${BASE}/canvas/mounted`)).json();
|
|
176
|
+
assertEq(mountedFace.ok, false, '/canvas/mounted 未挂载时 ok:false');
|
|
177
|
+
|
|
178
|
+
// femoGen 自有文件面(2026-09-30):path 槽 → 按名存(三态)→ 清单出现 →
|
|
179
|
+
// 打开回读(槽跟随)→ 目录浮层面(新建/浏览/围栏)→ 移除。系统对话框
|
|
180
|
+
// (pick-* 两个)要弹真窗口,不进冒烟,覆盖面在单测围栏 + 人工验收。
|
|
181
|
+
const path0 = await (await fetch(`${BASE}/api/canvas/path`)).json();
|
|
182
|
+
assertOk(path0.ok && (path0.path === null || typeof path0.path === 'string'), '/api/canvas/path 可读');
|
|
183
|
+
const save1 = await post('/api/save-script', { dir: '', name: '冒烟剧本', femo: 'flow x=1' });
|
|
184
|
+
assertEq(save1.json.ok, true, '/api/save-script 按名存盘');
|
|
185
|
+
assertEq(save1.json.changed, true, '首存=真写');
|
|
186
|
+
const save2 = await post('/api/save-script', { dir: '', name: '冒烟剧本', femo: 'flow x=1' });
|
|
187
|
+
assertEq(save2.json.changed, false, '同内容再存=未改动不重写');
|
|
188
|
+
const list1 = await post('/api/femo-files', {});
|
|
189
|
+
assertOk(Array.isArray(list1.json.files) && list1.json.files.some(f => f.path === save1.json.path),
|
|
190
|
+
'存盘后 /api/femo-files 清单出现该文件');
|
|
191
|
+
const open1 = await post('/api/femo-files/open', { path: save1.json.path });
|
|
192
|
+
assertEq(open1.json.content, 'flow x=1', '/api/femo-files/open 回读正文');
|
|
193
|
+
const path1 = await (await fetch(`${BASE}/api/canvas/path`)).json();
|
|
194
|
+
assertEq(path1.path, save1.json.path, 'path 槽跟随打开动作');
|
|
195
|
+
const mk = await post('/api/projects/mkdir', { dir: '', name: '冒烟目录' });
|
|
196
|
+
assertEq(mk.json.ok, true, '/api/projects/mkdir 新建文件夹');
|
|
197
|
+
const br = await post('/api/projects/browser', { dir: '冒烟目录' });
|
|
198
|
+
assertEq(br.json.ok, true, '/api/projects/browser 围栏内浏览');
|
|
199
|
+
assertOk(br.json.dirs.length === 0 && br.json.files.length === 0, '新目录为空清单');
|
|
200
|
+
const deny = await post('/api/projects/browser', { dir: '..' });
|
|
201
|
+
assertEq(deny.status, 400, '围栏拒绝 .. 越界');
|
|
202
|
+
const forget1 = await post('/api/femo-files/forget', { path: save1.json.path });
|
|
203
|
+
assertEq(forget1.json.removed, true, '/api/femo-files/forget 移除');
|
|
204
|
+
|
|
205
|
+
// ── 演员绑定链路(2026-10-10):正身=hub actor-preferences,键=@actor 全名;
|
|
206
|
+
// 校验口径与灵魂不同(用户拍板「以 femo 脚本为先」):绑了剧本里没有的
|
|
207
|
+
// 演员=报错拦下;少绑=warning 不拦(点名 actorCheck.warnings)。 ─────────
|
|
208
|
+
const actorScript = `meta:\n name: 演员冒烟\nactors:\n ai @AI1 = soul:${soulId}\n human @玩家1 =\nmainflow:\n - say @AI1: "hi"\n`;
|
|
209
|
+
const mountR = await post('/tools/femo_mount', { femo_text: actorScript });
|
|
210
|
+
assertEq(mountR.json.mounted, true, '挂载带演员表的冒烟剧本');
|
|
211
|
+
const noAt = await post('/seats/actor-bind', { sessionId: REF, actor: 'AI1' });
|
|
212
|
+
assertEq(noAt.status, 400, '不带 @ 的演员名当场拦(@ 是名字的一部分)');
|
|
213
|
+
const ghost = await post('/seats/actor-bind', { sessionId: REF, actor: '@幽灵' });
|
|
214
|
+
assertEq(ghost.status, 404, '绑剧本里没有的演员=报错拦下');
|
|
215
|
+
const abind = await post('/seats/actor-bind', { sessionId: REF, actor: '@AI1' });
|
|
216
|
+
assertEq(abind.json.ok, true, '绑演员 @AI1(hub 正身账)');
|
|
217
|
+
assertEq(abind.json.hub, true, '演员绑定写进 hub 正身账');
|
|
218
|
+
const seatsA = await (await fetch(`${BASE}/seats`)).json();
|
|
219
|
+
assertEq(seatsA.seats[0].actor, '@AI1', '席位展示镜像带演员(@ 全名照抄)');
|
|
220
|
+
const at1 = await post('/seats/attendance', {});
|
|
221
|
+
assertEq(at1.json.actorCheck.errors.length, 0, '点名:多绑为零');
|
|
222
|
+
assertOk(at1.json.actorCheck.warnings.some(w => w.includes('@玩家1')), '点名:少绑 @玩家1 出 warning');
|
|
223
|
+
const ahub = await fetch(`http://127.0.0.1:${projPort}/sessions/actor-preferences`).then(r => r.json());
|
|
224
|
+
assertEq(ahub.bindings['@AI1']?.type, 'ai', 'hub 账:type=ai(本宿主会话绑定)');
|
|
225
|
+
const aunbind = await post('/seats/actor-bind', { sessionId: REF, actor: '' });
|
|
226
|
+
assertEq(aunbind.json.ok, true, '解绑演员');
|
|
227
|
+
const seatsA2 = await (await fetch(`${BASE}/seats`)).json();
|
|
228
|
+
assertOk(!seatsA2.seats[0].actor, '解绑后展示镜像清空');
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
console.log('SMOKE OK');
|
|
234
|
+
} catch (e) {
|
|
235
|
+
ok = false;
|
|
236
|
+
console.log('SMOKE FAIL:', String(e).slice(0, 500));
|
|
237
|
+
} finally {
|
|
238
|
+
child.kill();
|
|
239
|
+
// 【2026-09-26 常驻化第 3 步】服务直连后会把常驻引擎代拉成脱离母进程的
|
|
240
|
+
// 进程——按沙盒 hub.json 的 pid 收尸,不留野 daemon。
|
|
241
|
+
await sleep(300);
|
|
242
|
+
try {
|
|
243
|
+
const { existsSync, readFileSync } = await import('node:fs');
|
|
244
|
+
const hubJson = join(process.env.FEMO_DATA_DIR || '', 'femo', 'projection', 'hub.json');
|
|
245
|
+
if (existsSync(hubJson)) {
|
|
246
|
+
const pid = Number(JSON.parse(readFileSync(hubJson, 'utf8'))?.pid) || 0;
|
|
247
|
+
if (pid > 0) { try { process.kill(pid); console.log('[cleanup] killed sandbox daemon pid', pid); } catch { /* 已死 */ } }
|
|
248
|
+
}
|
|
249
|
+
} catch { /* 无账 */ }
|
|
250
|
+
await sleep(300);
|
|
251
|
+
process.exitCode = ok ? 0 : 1;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
function assertEq(actual, expected, label) {
|
|
255
|
+
if (actual !== expected) throw new Error(`${label}: 期望 ${JSON.stringify(expected)},实际 ${JSON.stringify(actual)}`);
|
|
256
|
+
console.log(` ok: ${label}`);
|
|
257
|
+
}
|
|
258
|
+
function assertOk(cond, label) {
|
|
259
|
+
if (!cond) throw new Error(`${label}: 不成立`);
|
|
260
|
+
console.log(` ok: ${label}`);
|
|
261
|
+
}
|
|
@@ -482,6 +482,11 @@ export async function submitSpeech(femoRoot, marker, speech, steps, modelId) {
|
|
|
482
482
|
envelope = core.executorSpeechArgs({
|
|
483
483
|
jobId: Number(marker.job_id), waitKey: String(marker.ref), soul: String(marker.soul),
|
|
484
484
|
...(marker.node ? { node: String(marker.node) } : {}),
|
|
485
|
+
// actor 随行格(2026-10-10):牌上全信随行(marker.letter),信封若有
|
|
486
|
+
// actor 格(本刀起桥产信都带)就透传——链路各点从此能带上角色名;
|
|
487
|
+
// 老牌无信无格时自然不带,零回归。
|
|
488
|
+
...(String(marker?.letter?.actor ?? '').trim()
|
|
489
|
+
? { actor: String(marker.letter.actor).trim() } : {}),
|
|
485
490
|
output: speech,
|
|
486
491
|
steps: own ? [...stepList, { step: stepList.length }] : stepList,
|
|
487
492
|
// model_id 落账(2026-10-02 存储层):本轮实际响应模型 provider/model,
|
|
@@ -512,6 +517,7 @@ export async function submitSpeech(femoRoot, marker, speech, steps, modelId) {
|
|
|
512
517
|
job_id: Number(envelope.job_id), wait_key: String(envelope.wait_key),
|
|
513
518
|
soul: String(envelope.soul), payload: String(envelope.payload),
|
|
514
519
|
...(envelope.node ? { node: String(envelope.node) } : {}),
|
|
520
|
+
...(envelope.actor ? { actor: String(envelope.actor) } : {}),
|
|
515
521
|
body: envelope.body,
|
|
516
522
|
},
|
|
517
523
|
}),
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: femo
|
|
3
3
|
description: "FEMO 多智能体编排系统:把\"多个 AI 、多步骤\"编排成自动化脚本(.femo),将流程固化,方便当下运行和未来复用。FEMO 引擎将运行你设计的任何 AI 智能体流程。适用场景包括但不限于:你想固化踩坑经验、to do 清单、多步骤工作流;多个AI分头调研、讨论、互评;狼人杀等游戏流程;用户想跟你一起玩游戏;想找更多AI聊天;斯坦福小镇式AI涌现生活。当场景合适时,你可以提议用femo,详细信息你应主动查阅 Skill.md。"
|
|
4
|
+
license: Apache-2.0
|
|
5
|
+
metadata:
|
|
6
|
+
author: Phant0Meow (jovielher)
|
|
4
7
|
---
|
|
5
8
|
|
|
6
9
|
# FEMO模式(zcode 版)
|
|
@@ -46,3 +46,54 @@ test('开演校验:缺提名的列出来(原措辞),齐了过;裸 ai
|
|
|
46
46
|
'角色@幽灵 在剧本里没有指定灵魂(soul),无法绑定窗口',
|
|
47
47
|
]);
|
|
48
48
|
});
|
|
49
|
+
|
|
50
|
+
// ── 演员绑定账 accompanying 解析(2026-10-10)────────────────────────────────
|
|
51
|
+
// scriptActors=全量演员表(ai/human 都收、actor 带 @ 全名);actorBindingDeltas
|
|
52
|
+
// =多绑报错/少绑警告两桶(web 运行前点名消费;判据与 soul 那把尺不同)。
|
|
53
|
+
|
|
54
|
+
import { scriptActors, actorBindingDeltas } from '../../../femo2host/host/tools-core.mjs';
|
|
55
|
+
|
|
56
|
+
test('scriptActors:全量演员表带 @ 全名(ai/human 都收;source:main 也在内;blueprint 不收)', () => {
|
|
57
|
+
assert.deepEqual(scriptActors(SCRIPT), [
|
|
58
|
+
{ actor: '@AI1', kind: 'ai' },
|
|
59
|
+
{ actor: '@AI2', kind: 'ai' },
|
|
60
|
+
{ actor: '@导演', kind: 'ai' }, // source:main 也算——他的戏份也要有人接
|
|
61
|
+
{ actor: '@人类', kind: 'human' },
|
|
62
|
+
{ actor: '@幽灵', kind: 'ai' }, // 裸执行者(无 soul)也是剧本角色,照样要绑
|
|
63
|
+
]);
|
|
64
|
+
assert.deepEqual(scriptActors(undefined), []);
|
|
65
|
+
assert.deepEqual(scriptActors('meta:\n name: x\n'), []);
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
test('scriptActors:中文角色名与 @ 全名照抄(@ 是名字的一部分)', () => {
|
|
69
|
+
const s = `actors:
|
|
70
|
+
ai @1号 = soul:ai1
|
|
71
|
+
human @玩家1 =
|
|
72
|
+
ai @小猫咪 = soul:littlecat
|
|
73
|
+
mainflow:
|
|
74
|
+
- say @1号: "hi"
|
|
75
|
+
`;
|
|
76
|
+
assert.deepEqual(scriptActors(s), [
|
|
77
|
+
{ actor: '@1号', kind: 'ai' },
|
|
78
|
+
{ actor: '@玩家1', kind: 'human' },
|
|
79
|
+
{ actor: '@小猫咪', kind: 'ai' },
|
|
80
|
+
]);
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
test('actorBindingDeltas:多绑=errors(拦),少绑=warnings(不拦),齐绑=两空', () => {
|
|
84
|
+
const actors = [{ actor: '@1号', kind: 'ai' }, { actor: '@玩家1', kind: 'human' }];
|
|
85
|
+
// 少绑:账里只有 @1号
|
|
86
|
+
assert.deepEqual(actorBindingDeltas(actors, ['@1号']), {
|
|
87
|
+
errors: [],
|
|
88
|
+
warnings: ['演员 @玩家1 还没绑定——轮到它时按缺员处置'],
|
|
89
|
+
});
|
|
90
|
+
// 多绑:账里多了剧本没有的 @幽灵
|
|
91
|
+
const d = actorBindingDeltas(actors, ['@1号', '@玩家1', '@幽灵']);
|
|
92
|
+
assert.deepEqual(d.errors, ['绑定的演员 @幽灵 不在剧本演员表里——检查名字(演员名带 @,照剧本里写的那样)']);
|
|
93
|
+
assert.deepEqual(d.warnings, []);
|
|
94
|
+
// 齐绑:两空
|
|
95
|
+
assert.deepEqual(actorBindingDeltas(actors, ['@1号', '@玩家1']), { errors: [], warnings: [] });
|
|
96
|
+
// 空表/空账不炸
|
|
97
|
+
assert.deepEqual(actorBindingDeltas([], []), { errors: [], warnings: [] });
|
|
98
|
+
assert.deepEqual(actorBindingDeltas(undefined, undefined), { errors: [], warnings: [] });
|
|
99
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "femo-plugin",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "femo (Flow Emerges Mag Opus) — 用写脚本的方式编排多智能体世界。dsh 插件版:引擎、桥接器、可视化编辑器全在一个文件夹里,自包含,整个文件夹搬走即用。",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"deepseek-harness",
|
|
@@ -12,6 +12,12 @@
|
|
|
12
12
|
"script"
|
|
13
13
|
],
|
|
14
14
|
"license": "Apache-2.0",
|
|
15
|
+
"author": {
|
|
16
|
+
"name": "Phant0Meow (jovielher)",
|
|
17
|
+
"url": "https://github.com/Phant0Meow"
|
|
18
|
+
},
|
|
19
|
+
"homepage": "https://github.com/Phant0Meow/femo-plugin#readme",
|
|
20
|
+
"bugs": "https://github.com/Phant0Meow/femo-plugin/issues",
|
|
15
21
|
"repository": {
|
|
16
22
|
"type": "git",
|
|
17
23
|
"url": "git+https://github.com/Phant0Meow/femo-plugin.git"
|