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
|
@@ -41,6 +41,18 @@
|
|
|
41
41
|
|
|
42
42
|
const INIT_QP = new URLSearchParams(location.search);
|
|
43
43
|
|
|
44
|
+
// 快照窗口化预算两本账(2026-10-12 第二刀):
|
|
45
|
+
// PAINT_BYTES=首屏预算——WS 连接串 ?win= 与整场回放 REST 拉取用它:hub 只送
|
|
46
|
+
// 头尾各这么多、中间省略。压到 256KB 是为了手机链路 0.5 秒级咬住首屏
|
|
47
|
+
// (用户拍板「能不能让它迅速的显示」)。
|
|
48
|
+
// WIN_BYTES=展开预算——省略号展开钮按请求带给 hub(ctrl range / 与
|
|
49
|
+
// /chronica/range 都收 per-request win),保住 10-08 拍板的「单侧 1MB」
|
|
50
|
+
// 形态:首屏快、展开一次一大块。
|
|
51
|
+
// 两本账都防巨行失灵——hub 侧配套「巨行不吞」(单行超预算不拉进首屏,
|
|
52
|
+
// 最末行例外),见 projection_hub._window_rows。
|
|
53
|
+
export const WIN_BYTES = 1024 * 1024;
|
|
54
|
+
export const PAINT_BYTES = 256 * 1024;
|
|
55
|
+
|
|
44
56
|
export const S = {
|
|
45
57
|
|
|
46
58
|
// ── 连接 ────────────────────────────────────────────────────────────
|
|
@@ -58,6 +70,13 @@ export const S = {
|
|
|
58
70
|
// headEnd/tailStart=已展开到的边界行号(随展开推进);*0=快照初值(身份
|
|
59
71
|
// 对账用);token=快照序号(rows-range 应答对账,防换场后的迟到处帧错插);
|
|
60
72
|
// _busy=一次一发,应答回来才放下一发。null=没有省略段(全量快照)。
|
|
73
|
+
// chronica 非 null(2026-10-12 整场回放窗口化):位置对账模式,展开走
|
|
74
|
+
// REST /chronica/range(panels.chronicaRange)。边界两本账——短列表
|
|
75
|
+
// (S.rows=窗口化后)与全量列表各记各的:headEnd=短列表头段末行下标
|
|
76
|
+
// (数值上恒等于展开请求的 lo,随 dn 展开同加块长);tailStart=短列表
|
|
77
|
+
// 尾段首行下标=省略块落点(任何一侧展开都同加块长);tailStartFull=
|
|
78
|
+
// 全量列表的 mid 终点(展开请求的 hi,随 up 展开递减)。hub elided 回的
|
|
79
|
+
// head_end/tail_start 是全量下标,loadChronicaView 换算成上面这本账。
|
|
61
80
|
elide: null,
|
|
62
81
|
// 打字机中的直播块:key → {actor, blockKind, text, host}。live/live-done
|
|
63
82
|
// 逐块增删,live-clear 换场全清,快照捎带的正在打块也落这里。
|
|
@@ -102,4 +121,15 @@ export const S = {
|
|
|
102
121
|
// 接线):抗刷新,busy 不进镜像——刷新即解锁可重发。
|
|
103
122
|
// 状态全在内存:全量重绘不丢草稿不丢焦点。
|
|
104
123
|
ihumanDrafts: {},
|
|
124
|
+
|
|
125
|
+
// ── 认领角色(2026-10-11 双user 刀I,用户拍板)───────────────────────
|
|
126
|
+
// 当前场剧本的 human 型演员 @名清单:hub views 载荷捎带(flow_start 由桥
|
|
127
|
+
// 把它随花名册一起登记进 cast.json,解析权在引擎),panels.applyViews 写、
|
|
128
|
+
// main.refreshActorBtn 读(决定「认领角色」钮显隐与下拉内容)。老 hub/
|
|
129
|
+
// 老场次没有这份名单=空表——钮不显,零回归。
|
|
130
|
+
scriptHumans: [],
|
|
131
|
+
// 演员绑定账当选视图的精简副本(actor → {sid,host,type?,user_id?}):
|
|
132
|
+
// main.fetchActorBindings 现取 /sessions/actor-preferences 后写。钮点亮
|
|
133
|
+
// (「我认领的」)与下拉三态(我的/别人绑的/没主)都从它对号现算。
|
|
134
|
+
actorBindings: {},
|
|
105
135
|
};
|
|
@@ -36,6 +36,7 @@ const ICONS = {
|
|
|
36
36
|
puzzle: { vb: '0 0 512 512', d: 'M192 104.8c0-9.2-5.8-17.3-13.2-22.8C167.2 73.3 160 61.3 160 48c0-26.5 28.7-48 64-48s64 21.5 64 48c0 13.3-7.2 25.3-18.8 34c-7.4 5.5-13.2 13.6-13.2 22.8c0 12.8 10.4 23.2 23.2 23.2H336c26.5 0 48 21.5 48 48v56.8c0 12.8 10.4 23.2 23.2 23.2c9.2 0 17.3-5.8 22.8-13.2c8.7-11.6 20.7-18.8 34-18.8c26.5 0 48 28.7 48 64s-21.5 64-48 64c-13.3 0-25.3-7.2-34-18.8c-5.5-7.4-13.6-13.2-22.8-13.2c-12.8 0-23.2 10.4-23.2 23.2V464c0 26.5-21.5 48-48 48H279.2c-12.8 0-23.2-10.4-23.2-23.2c0-9.2 5.8-17.3 13.2-22.8c11.6-8.7 18.8-20.7 18.8-34c0-26.5-28.7-48-64-48s-64 21.5-64 48c0 13.3 7.2 25.3 18.8 34c7.4 5.5 13.2 13.6 13.2 22.8c0 12.8-10.4 23.2-23.2 23.2H48c-26.5 0-48-21.5-48-48V343.2C0 330.4 10.4 320 23.2 320c9.2 0 17.3 5.8 22.8 13.2C54.7 344.8 66.7 352 80 352c26.5 0 48-28.7 48-64s-21.5-64-48-64c-13.3 0-25.3-7.2-34-18.8C40.5 250.2 32.4 256 23.2 256C10.4 256 0 245.6 0 232.8V176c0-26.5 21.5-48 48-48H168.8c12.8 0 23.2-10.4 23.2-23.2z' },
|
|
37
37
|
code: { vb: '0 0 640 512', d: 'M392.8 1.2c-17-4.9-34.7 5-39.6 22l-128 448c-4.9 17 5 34.7 22 39.6s34.7-5 39.6-22l128-448c4.9-17-5-34.7-22-39.6zm80.6 120.1c-12.5 12.5-12.5 32.8 0 45.3L562.7 256l-89.4 89.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l112-112c12.5-12.5 12.5-32.8 0-45.3l-112-112c-12.5-12.5-32.8-12.5-45.3 0zm-306.7 0c-12.5-12.5-32.8-12.5-45.3 0l-112 112c-12.5 12.5-12.5 32.8 0 45.3l112 112c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256l89.4-89.4c12.5-12.5 12.5-32.8 0-45.3z' },
|
|
38
38
|
stop: { vb: '0 0 384 512', d: 'M0 128C0 92.7 28.7 64 64 64H320c35.3 0 64 28.7 64 64V384c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V128z' },
|
|
39
|
+
user: { vb: '0 0 448 512', d: 'M224 256A128 128 0 1 0 224 0a128 128 0 1 0 0 256zm-45.7 48C79.8 304 0 383.8 0 482.3C0 498.7 13.3 512 29.7 512H418.3c16.4 0 29.7-13.3 29.7-29.7C448 383.8 368.2 304 269.7 304H178.3z' },
|
|
39
40
|
};
|
|
40
41
|
export function faIcon(name, size = 10) {
|
|
41
42
|
const ic = ICONS[name] || ICONS.clapper;
|
|
@@ -94,3 +95,30 @@ export function pruneDraftStore(store, liveKeys) {
|
|
|
94
95
|
}
|
|
95
96
|
return out;
|
|
96
97
|
}
|
|
98
|
+
|
|
99
|
+
// ── 认领角色下拉的行(2026-10-11 双user 刀I):纯函数,方便 Node 单测 ──────
|
|
100
|
+
/** 剧本人类角色 × 演员绑定账 → 下拉逐行 [{actor, state, label}]。
|
|
101
|
+
* state(认领三态,页面据此定可点性):
|
|
102
|
+
* 'mine' = 本机 user 已绑(human 型且 user_id 对上——只认 user_id,
|
|
103
|
+
* 设备/宿主不参与;「人类 Actor 默认就这个 User」的刀E 语义);
|
|
104
|
+
* 'taken'= 别人绑了(含 AI 席位绑定与只提名未定性的预备格——凡不是我的
|
|
105
|
+
* 当选绑定一律算别人,宁严不抢;服务端刀I 抢绑闸同尺);
|
|
106
|
+
* 'free' = 没主,可认领。
|
|
107
|
+
* label = 展示文案(用户拍板:「如果有别人绑定过的 actor,应显示(已被别人
|
|
108
|
+
* 绑定)」;自己的标「(我)」,与 dd-menu 的选中态互认)。 */
|
|
109
|
+
export function claimMenuItems(humans, bindings, myUid) {
|
|
110
|
+
const uid = String(myUid || '');
|
|
111
|
+
const bmap = (bindings && typeof bindings === 'object') ? bindings : {};
|
|
112
|
+
return (Array.isArray(humans) ? humans : []).map((h) => {
|
|
113
|
+
const actor = String(h || '').trim();
|
|
114
|
+
const b = bmap[actor];
|
|
115
|
+
let state = 'free';
|
|
116
|
+
if (b && typeof b === 'object') {
|
|
117
|
+
state = (String(b.type || '') === 'human' && uid
|
|
118
|
+
&& String(b.user_id || '') === uid) ? 'mine' : 'taken';
|
|
119
|
+
}
|
|
120
|
+
const label = state === 'mine' ? (actor + '(我)')
|
|
121
|
+
: state === 'taken' ? (actor + '(已被别人绑定)') : actor;
|
|
122
|
+
return { actor, state, label };
|
|
123
|
+
}).filter(x => x.actor);
|
|
124
|
+
}
|