femo-plugin 1.0.5 → 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.
Files changed (32) hide show
  1. package/LICENSE +1 -1
  2. package/NOTICE +8 -0
  3. package/README.md +12 -1
  4. package/femo2host/mailbox.py +630 -591
  5. package/femo2host/projectionCenter/composer.mjs +166 -11
  6. package/femo2host/projectionCenter/index.html +1 -0
  7. package/femo2host/projectionCenter/main.mjs +22 -2
  8. package/femo2host/projection_hub.py +9987 -9916
  9. package/femo2host/python/femo_bridge.py +33 -1
  10. package/femoCompiler/FEMO_runtime.py +16 -0
  11. package/femoGen/document_ch.html +1 -0
  12. package/femoGen/document_en.html +1 -0
  13. package/femoGen/index.html +1 -0
  14. package/femoGen/intro_ch.html +1 -0
  15. package/femoGen/intro_en.html +1 -0
  16. package/femoGen/package.json +7 -0
  17. package/femoGen/public/femo-logo-slogan.svg +5 -0
  18. package/femoGen/public/femo-logo.svg +6 -1
  19. package/hostAdapter/dshAdapter/package.json +11 -1
  20. package/hostAdapter/webAdapter/console/index.html +1 -0
  21. package/hostAdapter/webAdapter/extension/seat-agent-core.js +836 -792
  22. package/hostAdapter/webAdapter/extension/sidepanel.html +1 -0
  23. package/hostAdapter/webAdapter/package.json +7 -0
  24. package/hostAdapter/webAdapter/sites/chat.deepseek.com/SITE.md +7 -0
  25. package/hostAdapter/webAdapter/sites/chat.deepseek.com/content.js +83 -68
  26. package/hostAdapter/webAdapter/sites/chatgpt.com/SITE.md +6 -1
  27. package/hostAdapter/webAdapter/sites/chatgpt.com/content.js +24 -1
  28. package/hostAdapter/webAdapter/tests/chatgpt-input.test.mjs +58 -0
  29. package/hostAdapter/webAdapter/tests/deepseek-sanitize.test.mjs +68 -0
  30. package/hostAdapter/zcodeAdapter/skills/femo/SKILL.md +3 -0
  31. package/package.json +7 -1
  32. package//350/257/255/346/263/225/346/226/207/346/241/243.md +2 -0
@@ -406,7 +406,26 @@ def build_stage(args, femo_root, mailbox, mail_courier, projection_hub,
406
406
  # 的校验面。驿站模块一并注入(hub 不 import 兄弟件,依赖倒置);
407
407
  # 复用模式下这三笔注入在 HubClient 里是记录在案的无操作(寄信走共享
408
408
  # 信柜,远端 hub 用养桥注入的那一半)。
409
- projector.set_waiting_sink(hub.set_waiting)
409
+ # 【事件流台账 2026-10-20】等待镜像变更过一道记录再进 hub:keys 增减
410
+ # 一拍一记(谁上新席/谁收麦),与引擎/桥/hub 三段台账对时序。
411
+ def _waiting_sink_logged(state):
412
+ try:
413
+ import os as _os
414
+ import datetime as _dt
415
+ if isinstance(state, list):
416
+ _shape, _keys = 'list', [str(s.get('wait_key') or '') for s in state if isinstance(s, dict)]
417
+ elif isinstance(state, dict):
418
+ _shape, _keys = 'dict', [str(state.get('wait_key') or '')]
419
+ else:
420
+ _shape, _keys = 'clear', []
421
+ with open(_os.path.join(_os.environ.get('FEMO_DATA_DIR') or 'user_data',
422
+ 'debug-event-flow.log'), 'a', encoding='utf-8') as _f:
423
+ _f.write(f"[{_dt.datetime.now().isoformat()}] [bridge] waiting-sink"
424
+ f" shape={_shape} keys={_keys}\n")
425
+ except Exception:
426
+ pass
427
+ hub.set_waiting(state)
428
+ projector.set_waiting_sink(_waiting_sink_logged)
410
429
  hub.set_mailbox(mailbox)
411
430
  # 信箱宿主 id(2026-09-24 多实例并存):hub 寄人类信的 target_host
412
431
  # 必须与本桥 drain_outgoing 的过滤词同源(args.host)——以前 hub 拿
@@ -1175,6 +1194,19 @@ def build_stage(args, femo_root, mailbox, mail_courier, projection_hub,
1175
1194
  # 【观测】引擎→桥的每一次事件都留痕:卡死时用它回答
1176
1195
  # 「引擎到底有没有 emit ai_done / node_settled」。
1177
1196
  _trace(f"engine→bridge event={event_type} job={job_id}")
1197
+ # 【事件流台账 2026-10-20】引擎→桥每一拍落盘(独立文件,不依赖
1198
+ # FEMO_BRIDGE_TRACE 开关):human_wait/human_done 带不带 wait_key
1199
+ # 在这行见分晓。文件=user_data/debug-event-flow.log。
1200
+ try:
1201
+ import os as _os
1202
+ import datetime as _dt
1203
+ _wk = data.get('wait_key') if isinstance(data, dict) else None
1204
+ with open(_os.path.join(_os.environ.get('FEMO_DATA_DIR') or 'user_data',
1205
+ 'debug-event-flow.log'), 'a', encoding='utf-8') as _f:
1206
+ _f.write(f"[{_dt.datetime.now().isoformat()}] [bridge] cb event={event_type}"
1207
+ f" job={job_id} wk={_wk}\n")
1208
+ except Exception:
1209
+ pass
1178
1210
  payload = {**(data if isinstance(data, dict) else {}), 'job_id': job_id}
1179
1211
  jm.observe_event(job_id, event_type, payload) # 状态机旁挂(§7.5)
1180
1212
  # 先投递后发事件(2026-09-16 上门投递):_mailbox_post 内含产信+投递员
@@ -680,6 +680,22 @@ class FEMORunner:
680
680
  # 调试:打印所有发往前端的事件
681
681
  #print(f"[EMIT] {event_type}: {json.dumps(data, ensure_ascii=False, default=str) if data else '{}'}")
682
682
 
683
+ # 【事件流台账 2026-10-20】引擎每一拍 emit 都落盘(只跳过 ai_token/
684
+ # context_ready 两类高频)——「页面卡已寄出」取证第一问:human_wait /
685
+ # human_done 到底发没发、带没带 wait_key,看 user_data/debug-event-flow.log。
686
+ if event_type not in ('ai_token', 'context_ready'):
687
+ try:
688
+ import os as _os
689
+ import datetime as _dt
690
+ _dk = {k: data.get(k) for k in ('wait_key', 'node_name', 'node', 'job_id')
691
+ if isinstance(data, dict) and data.get(k) is not None}
692
+ with open(_os.path.join(_os.environ.get('FEMO_DATA_DIR') or 'user_data',
693
+ 'debug-event-flow.log'), 'a', encoding='utf-8') as _f:
694
+ _f.write(f"[{_dt.datetime.now().isoformat()}] [engine] emit {event_type}"
695
+ + (f" {_dk}" if _dk else '') + "\n")
696
+ except Exception:
697
+ pass
698
+
683
699
  if self._event_callback:
684
700
  self._event_callback(event_type, data or {})
685
701
 
@@ -2,6 +2,7 @@
2
2
  <html lang="zh-CN">
3
3
  <head>
4
4
  <meta charset="UTF-8">
5
+ <meta name="author" content="Phant0Meow (jovielher)">
5
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
7
  <title>Femo 语法文档</title>
7
8
  <link rel="preconnect" href="https://fonts.googleapis.com">
@@ -2,6 +2,7 @@
2
2
  <html lang="en">
3
3
  <head>
4
4
  <meta charset="UTF-8">
5
+ <meta name="author" content="Phant0Meow (jovielher)">
5
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
7
  <title>Femo Syntax Reference</title>
7
8
  <link rel="preconnect" href="https://fonts.googleapis.com">
@@ -2,6 +2,7 @@
2
2
  <html lang="zh-CN">
3
3
  <head>
4
4
  <meta charset="UTF-8" />
5
+ <meta name="author" content="Phant0Meow (jovielher)" />
5
6
  <link rel="icon" type="image/svg+xml" href="/favicon.ico" />
6
7
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
8
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
@@ -3,6 +3,7 @@
3
3
  <head>
4
4
  <link rel="icon" type="image/svg+xml" href="/favicon.ico" />
5
5
  <meta charset="UTF-8">
6
+ <meta name="author" content="Phant0Meow (jovielher)">
6
7
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
8
  <title>Femo — 用写脚本的方式编排多智能体世界</title>
8
9
  <link rel="preconnect" href="https://fonts.googleapis.com">
@@ -3,6 +3,7 @@
3
3
  <head>
4
4
  <link rel="icon" type="image/svg+xml" href="/favicon.ico" />
5
5
  <meta charset="UTF-8">
6
+ <meta name="author" content="Phant0Meow (jovielher)">
6
7
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
8
  <title>Femo — Orchestrate Multi-Agent Worlds Like Writing a Screenplay</title>
8
9
  <link rel="preconnect" href="https://fonts.googleapis.com">
@@ -3,6 +3,13 @@
3
3
  "private": true,
4
4
  "version": "1.0.0",
5
5
  "type": "module",
6
+ "license": "Apache-2.0",
7
+ "author": {
8
+ "name": "Phant0Meow (jovielher)",
9
+ "url": "https://github.com/Phant0Meow"
10
+ },
11
+ "homepage": "https://github.com/Phant0Meow/femo-plugin#readme",
12
+ "bugs": "https://github.com/Phant0Meow/femo-plugin/issues",
6
13
  "scripts": {
7
14
  "dev": "vite",
8
15
  "build": "vite build",
@@ -1,4 +1,9 @@
1
1
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 480" width="400" height="480">
2
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
3
+ <dc:title>femo logo with slogan</dc:title>
4
+ <dc:creator>Phant0Meow (jovielher)</dc:creator>
5
+ <dc:rights>Copyright 2026 Phant0Meow (jovielher) — licensed under the Apache License 2.0</dc:rights>
6
+ </metadata>
2
7
 
3
8
  <!-- ============ 蒙版定义 ============ -->
4
9
  <defs>
@@ -1,5 +1,10 @@
1
- <?xml version="1.0" standalone="no"?>
1
+ <?xml version="1.0" standalone="no"?>
2
2
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="27.169998168945312 30 345.6600341796875 364" width="309.12" height="352">
3
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
4
+ <dc:title>femo logo</dc:title>
5
+ <dc:creator>Phant0Meow (jovielher)</dc:creator>
6
+ <dc:rights>Copyright 2026 Phant0Meow (jovielher) — licensed under the Apache License 2.0</dc:rights>
7
+ </metadata>
3
8
 
4
9
  <!-- ============ 蒙版定义 ============ -->
5
10
  <defs>
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "femo-plugin",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "Femo (FlowEngineforMinds) 多智能体脚本引擎的 dsh 插件版 — 无主模型 Femo 会话、聊天窗口角色气泡、FEMO脚本控制(含完整引擎,自包含,整个文件夹搬走即用)",
5
5
  "keywords": [
6
6
  "deepseek-harness",
@@ -20,6 +20,16 @@
20
20
  "./package.json": "./package.json"
21
21
  },
22
22
  "license": "Apache-2.0",
23
+ "author": {
24
+ "name": "Phant0Meow (jovielher)",
25
+ "url": "https://github.com/Phant0Meow"
26
+ },
27
+ "homepage": "https://github.com/Phant0Meow/femo-plugin#readme",
28
+ "bugs": "https://github.com/Phant0Meow/femo-plugin/issues",
29
+ "repository": {
30
+ "type": "git",
31
+ "url": "git+https://github.com/Phant0Meow/femo-plugin.git"
32
+ },
23
33
  "dsh": {
24
34
  "client": {
25
35
  "platform": "web",
@@ -2,6 +2,7 @@
2
2
  <html lang="zh-CN">
3
3
  <head>
4
4
  <meta charset="utf-8">
5
+ <meta name="author" content="Phant0Meow (jovielher)">
5
6
  <title>FEMO · 网页版操作台</title>
6
7
  <style>
7
8
  /* ───────── 设计基调:与侧栏同宗 —— 深色 · 玻璃 · 绿主紫辅 ───────── */