femo-plugin 1.0.2 → 1.0.4
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/README.md +632 -635
- package/docs/ActiveRoadmaps/ARCHITECTURE.md +466 -0
- package/docs/ActiveRoadmaps/compiler/345/244/232job/345/220/214/350/267/221/346/224/271/351/200/240-/346/226/275/345/267/245/346/270/205/345/215/225.md +164 -0
- package/docs/ActiveRoadmaps/dshAdapter-/351/207/215/346/236/204/346/226/275/345/267/245/346/270/205/345/215/225.md +154 -0
- package/docs/ActiveRoadmaps/hub/345/224/257/344/270/200/345/214/226/350/256/276/350/256/241.md +107 -0
- package/docs/ActiveRoadmaps/webAdapter-/351/235/231/351/273/230/351/230/266/346/242/257/346/226/275/345/267/245/344/272/244/346/216/245.md +158 -0
- package/docs/ActiveRoadmaps/zcode-/346/227/240/345/255/220/344/273/243/347/220/206/345/214/226/346/226/275/345/267/245/346/270/205/345/215/225.md +166 -0
- package/docs/ActiveRoadmaps//345/274/225/346/223/216/345/270/270/351/251/273/345/214/226/347/254/2542/346/255/245/344/272/244/346/216/245.md +108 -0
- package/docs/ActiveRoadmaps//345/274/225/346/223/216/345/270/270/351/251/273/350/277/233/347/250/213/346/226/275/345/267/245/346/270/205/345/215/225.md +178 -0
- package/docs/ActiveRoadmaps//346/212/225/345/275/261/345/256/277/344/270/273/346/240/207/346/263/250/344/277/256/346/255/243/350/256/276/350/256/241.md +61 -0
- package/docs/ActiveRoadmaps//346/212/225/345/275/261/351/241/265/346/213/206/345/210/206/346/226/275/345/267/245/346/270/205/345/215/225.md +116 -0
- package/docs/ActiveRoadmaps//347/224/273/345/270/203/347/233/264/350/277/236/345/274/225/346/223/216/346/226/275/345/267/245/346/270/205/345/215/225.md +259 -0
- package/docs/README.md +38 -0
- package/docs/Specs//345/205/254/345/205/261/345/261/202/350/256/276/350/256/241/347/272/246/346/235/237.md +63 -0
- package/docs/Specs//345/256/277/344/270/273/346/216/245/345/205/245/346/270/205/345/215/225.md +137 -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 +569 -0
- package/docs/Specs//350/267/250/345/256/277/344/270/273/345/257/271/350/257/235/346/223/215/344/275/234/346/214/207/345/215/227.md +124 -0
- package/femo2host/AGENTS.md +165 -0
- package/femo2host/femoGenConnector/SKILL.common.md +232 -0
- package/femo2host/femoGenConnector/engine-client.mjs +255 -0
- package/femo2host/femoGenConnector/femogen-canvas-state.mjs +56 -0
- package/femo2host/femoGenConnector/femogen-files.d.mts +22 -0
- package/femo2host/femoGenConnector/femogen-files.mjs +208 -0
- package/femo2host/femoGenConnector/file-dialogs.d.mts +15 -0
- package/femo2host/femoGenConnector/file-dialogs.mjs +131 -0
- package/femo2host/femoGenConnector/sse-core.d.mts +40 -0
- package/femo2host/femoGenConnector/sse-core.mjs +95 -0
- package/femo2host/femoRoot.d.mts +7 -0
- package/femo2host/femoRoot.mjs +44 -0
- package/femo2host/femoToolcall/chronica.py +159 -156
- package/femo2host/femoToolcall/femo_debugger.py +1518 -1515
- package/femo2host/femo_api.py +472 -437
- package/femo2host/femo_gen_api.jsx +90 -77
- package/femo2host/host/api-retry.d.mts +44 -0
- package/femo2host/host/api-retry.mjs +155 -0
- package/femo2host/host/cast-core.d.mts +20 -0
- package/femo2host/host/cast-core.mjs +113 -0
- package/femo2host/host/daemon-client.d.mts +63 -0
- package/femo2host/host/daemon-client.mjs +606 -0
- package/femo2host/host/debug-run-core.d.mts +121 -0
- package/femo2host/host/debug-run-core.mjs +531 -0
- package/femo2host/host/delivery-queue.d.mts +18 -0
- package/femo2host/host/delivery-queue.mjs +101 -0
- package/femo2host/host/event-core.d.mts +84 -0
- package/femo2host/host/event-core.mjs +356 -0
- package/femo2host/host/femo-relation.d.mts +22 -0
- package/femo2host/host/femo-relation.mjs +39 -0
- package/femo2host/host/hub-client.d.mts +11 -0
- package/femo2host/host/hub-client.mjs +74 -0
- package/femo2host/host/hub-feed-core.d.mts +68 -0
- package/femo2host/host/hub-feed-core.mjs +274 -0
- package/femo2host/host/hub-render-core.d.mts +43 -0
- package/femo2host/host/hub-render-core.mjs +140 -0
- package/femo2host/host/mailbox-push-core.d.mts +40 -0
- package/femo2host/host/mailbox-push-core.mjs +113 -0
- package/femo2host/host/mount-registry.mjs +110 -0
- package/femo2host/host/node-retry.d.mts +37 -0
- package/femo2host/host/node-retry.mjs +200 -0
- package/femo2host/host/notice-core.d.mts +33 -0
- package/femo2host/host/notice-core.mjs +83 -0
- package/femo2host/host/projection-core.d.mts +78 -0
- package/femo2host/host/projection-core.mjs +279 -0
- package/femo2host/host/run-control-core.d.mts +23 -0
- package/femo2host/host/run-control-core.mjs +72 -0
- package/femo2host/host/run-state-core.d.mts +59 -0
- package/femo2host/host/run-state-core.mjs +173 -0
- package/femo2host/host/session-registry.mjs +56 -0
- package/femo2host/host/skill-expand.d.mts +11 -0
- package/femo2host/host/skill-expand.mjs +51 -0
- package/femo2host/host/speech-core.d.mts +43 -0
- package/femo2host/host/speech-core.mjs +75 -0
- package/femo2host/host/state-files.d.mts +35 -0
- package/femo2host/host/state-files.mjs +267 -0
- package/femo2host/host/subagent-core.d.mts +81 -0
- package/femo2host/host/subagent-core.mjs +303 -0
- package/femo2host/host/tools-core.d.mts +72 -0
- package/femo2host/host/tools-core.mjs +684 -0
- package/femo2host/host/variable-api.d.mts +23 -0
- package/femo2host/host/variable-api.mjs +90 -0
- package/femo2host/mail_courier.py +104 -0
- package/femo2host/mailbox.py +545 -0
- package/femo2host/projectionCenter/app.css +848 -0
- package/femo2host/projectionCenter/composer.mjs +272 -0
- package/femo2host/projectionCenter/debug-panel.mjs +131 -0
- package/femo2host/projectionCenter/index.html +96 -0
- package/femo2host/projectionCenter/main.mjs +479 -0
- package/femo2host/projectionCenter/panels.mjs +280 -0
- package/femo2host/projectionCenter/render.mjs +695 -0
- package/femo2host/projectionCenter/sessions.mjs +138 -0
- package/femo2host/projectionCenter/state.mjs +105 -0
- package/femo2host/projectionCenter/theme.css +250 -0
- package/femo2host/projectionCenter/util.mjs +96 -0
- package/femo2host/projection_hub.py +8422 -0
- package/femo2host/python/femo_bridge.py +2131 -0
- package/femo2host/python/femo_daemon.py +1209 -0
- package/femo2host/python/setting.py +153 -0
- package/femoBridges/ContextExample.py +167 -42
- package/femoBridges/MemoryExample.py +33 -30
- package/femoBridges/getDir/get_dir.py +32 -18
- package/femoBridges/getDir//344/275/240/345/217/257/344/273/245/350/256/276/345/256/232/344/273/273/346/204/217/346/226/207/344/273/266/345/244/271/344/270/272/347/224/250/346/210/267/346/225/260/346/215/256/346/226/207/344/273/266/345/244/271.txt +1 -1
- package/femoBridges/llmBridge.py +1 -1
- package/femoBridges/llmProviders.py +39 -35
- package/femoCompiler/AGENTS.md +185 -0
- package/femoCompiler/FEMO_CLIrenderer.py +50 -30
- package/femoCompiler/FEMO_config.py +2 -1
- package/femoCompiler/FEMO_errors.py +286 -278
- package/femoCompiler/FEMO_normalizer.py +12 -7
- package/femoCompiler/FEMO_parser.py +217 -118
- package/femoCompiler/FEMO_runtime.py +491 -251
- package/femoCompiler/FEMO_scope_resolver.py +6 -3
- package/femoCompiler/actor_resolver.py +3 -3
- package/femoCompiler/block_collector.py +31 -28
- package/femoCompiler/db_utils.py +18 -0
- package/femoCompiler/femoAsync.py +436 -401
- package/femoCompiler/host_manifest.py +22 -2
- package/femoCompiler/job_manager.py +203 -61
- package/femoCompiler/protocol.py +13 -12
- package/femoCompiler/save_dialog.py +103 -59
- package/femoCompiler/task_world.py +579 -544
- package/femoCompiler/vars/checkpoint.py +3 -3
- package/femoCompiler/vars/env.py +77 -12
- package/femoCompiler/vars/evaluator.py +11 -6
- package/femoCompiler/vars/join.py +1 -1
- package/femoCompiler/vars/model.py +7 -7
- package/femoExamples/AI/345/211/252/350/247/206/351/242/221/AI/345/211/252/350/247/206/351/242/221.femo +5 -5
- 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 +142 -0
- package/femoExamples/AI/350/201/212/345/244/251/345/256/244/AI/350/201/212/345/244/251/345/256/244.femo +111 -0
- package/femoExamples/AI/350/201/212/345/244/251/345/256/244/random_wait_time.py +80 -10
- package/{hostAdapter/zcodeAdapter/femo-zcode-dist/femoExamples/LuxFiat/luxfiat.femo → femoExamples/LuxFiat/luxfiat-loop.femo} +67 -38
- package/femoExamples/LuxFiat/{luxfiat.femo → luxfiat-simple.femo} +1 -15
- package/femoExamples/LuxFiat/wait.py +2 -2
- package/femoExamples/_join_wiring_tlib.py +28 -0
- package/femoExamples/discussion.femo +7 -5
- package/femoExamples/mt_test/file_a.py +5 -0
- package/femoExamples/plan-mode.femo +55 -0
- package/femoExamples//345/237/272/347/241/200/350/277/236/351/200/232/346/265/213/350/257/225.femo +38 -0
- package/femoExamples//347/213/274/344/272/272/346/235/200/werewolf_utils2.py +248 -20
- package/femoExamples//347/213/274/344/272/272/346/235/200/werewolf_utils9.py +609 -0
- package/{hostAdapter/zcodeAdapter/femo-zcode-dist/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 → 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} +308 -53
- 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 +222 -47
- package/femoExamples//347/213/274/344/272/272/346/235/200//347/213/274/344/272/272/346/235/200.femo +4 -4
- package/femoExamples//350/260/201/346/230/257/345/215/247/345/272/225/undercover_utils.py +286 -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 +95 -3
- 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 +126 -42
- package/femoGen/AGENTS.md +145 -0
- package/femoGen/document_ch.html +20 -13
- package/femoGen/document_en.html +9 -2
- package/femoGen/index.html +4 -2
- package/femoGen/intro_ch.html +28 -26
- package/femoGen/intro_en.html +9 -2
- package/femoGen/src/FemoWorAuto.jsx +1215 -257
- package/femoGen/src/actionModal.jsx +2 -2
- package/femoGen/src/bubbleOverlay.jsx +7 -5
- package/femoGen/src/canvasNodes.jsx +261 -61
- package/femoGen/src/common.jsx +94 -20
- package/femoGen/src/debugPanel.jsx +170 -43
- package/femoGen/src/engineWatch.jsx +323 -0
- package/femoGen/src/faIcons.jsx +11 -4
- package/femoGen/src/femoDiagnostics.js +1 -1
- package/femoGen/src/femoDirBrowse.jsx +430 -0
- package/femoGen/src/femoFileList.jsx +36 -6
- package/femoGen/src/femoGenerator.jsx +9 -9
- package/femoGen/src/femoParser.jsx +2276 -2255
- package/femoGen/src/femoPreview.jsx +30 -0
- package/femoGen/src/femoSaveReminder.jsx +75 -0
- package/femoGen/src/graphBuilder.jsx +2 -2
- package/femoGen/src/indentEdit.js +81 -0
- package/femoGen/src/libPanel.jsx +1 -1
- package/femoGen/src/mobileView.jsx +2871 -2796
- package/femoGen/src/projectPanel.jsx +2 -2
- package/femoGen/src/snap.js +101 -0
- package/femoGen/src/soulModal.jsx +4 -2
- package/femoGen/src/styles/font.css +13 -10
- package/femoGen/src/themes.js +297 -12
- package/femoGen/src/watchMirror.js +170 -0
- package/femoGen/vite.config.js +33 -28
- package/hostAdapter/dshAdapter/README.md +112 -68
- package/hostAdapter/dshAdapter/build.mjs +49 -6
- package/hostAdapter/dshAdapter/check-imports.mjs +85 -0
- package/hostAdapter/dshAdapter/client/client-ui/cast-button.tsx +232 -0
- package/hostAdapter/dshAdapter/client/{lineage-fork-native.jsx → client-ui/catalog-dropdown.jsx} +689 -624
- package/hostAdapter/dshAdapter/client/client-ui/chat-node.tsx +12 -9
- package/hostAdapter/dshAdapter/client/client-ui/composer-common.tsx +74 -0
- package/hostAdapter/dshAdapter/client/client-ui/composer-permission.tsx +183 -0
- package/hostAdapter/dshAdapter/client/client-ui/composer-ring.tsx +196 -0
- package/hostAdapter/dshAdapter/client/client-ui/composer-run-state.tsx +134 -0
- package/hostAdapter/dshAdapter/client/client-ui/composer-stats.tsx +163 -0
- package/hostAdapter/dshAdapter/client/client-ui/composer.tsx +417 -1100
- package/hostAdapter/dshAdapter/client/client-ui/editor-page.tsx +747 -726
- package/hostAdapter/dshAdapter/client/client-ui/editor-view.tsx +89 -88
- package/hostAdapter/dshAdapter/client/client-ui/hub-constants.ts +10 -0
- package/hostAdapter/dshAdapter/client/client-ui/hub-window.tsx +545 -0
- package/hostAdapter/dshAdapter/client/client-ui/primitives-compat.ts +39 -0
- package/hostAdapter/dshAdapter/client/client-ui/proj2/frame-router.ts +17 -52
- package/hostAdapter/dshAdapter/client/client-ui/proj2/index.ts +1 -1
- package/hostAdapter/dshAdapter/client/client-ui/proj2/ledger.ts +12 -12
- package/hostAdapter/dshAdapter/client/client-ui/proj2/turn-view.tsx +8 -16
- package/hostAdapter/dshAdapter/client/client-ui/proj2/window-id.ts +8 -9
- package/hostAdapter/dshAdapter/client/client-ui/stream-store.ts +187 -550
- package/hostAdapter/dshAdapter/client/client-ui/styles.ts +4 -10
- package/hostAdapter/dshAdapter/client/client-ui/view-button.tsx +550 -572
- package/hostAdapter/dshAdapter/client/client-ui/view-state.ts +1 -1
- package/hostAdapter/dshAdapter/client/client.tsx +611 -518
- package/hostAdapter/dshAdapter/client/femo-reasoning-row.tsx +104 -103
- package/hostAdapter/dshAdapter/client/femo-tool-row.tsx +264 -0
- package/hostAdapter/dshAdapter/client/lineage-fork.jsx +55 -570
- package/hostAdapter/dshAdapter/dshPatch/DSH-0.1.2-fork/344/277/256/346/224/271/351/234/200/346/261/202.md +4 -4
- package/hostAdapter/dshAdapter/dshPatch/patch-dsh-0.1.2-alpha.1.py +1 -1
- package/{femo2host/femoToolcall → hostAdapter/dshAdapter}/femo-chat.mjs +4 -2
- package/hostAdapter/dshAdapter/host/actor-name.ts +30 -0
- package/hostAdapter/dshAdapter/host/actor-usage.ts +54 -0
- package/hostAdapter/dshAdapter/host/actors/dispatch.ts +152 -0
- package/hostAdapter/dshAdapter/host/actors/main/capture.ts +219 -0
- package/hostAdapter/dshAdapter/host/actors/main/delivery.ts +233 -0
- package/hostAdapter/dshAdapter/host/actors/main/index.ts +420 -0
- package/hostAdapter/dshAdapter/host/actors/main/notice.ts +180 -0
- package/hostAdapter/dshAdapter/host/actors/native/child-setup.ts +103 -0
- package/hostAdapter/dshAdapter/host/actors/native/index.ts +672 -0
- package/hostAdapter/dshAdapter/host/actors/native/registry.ts +55 -0
- package/hostAdapter/dshAdapter/host/actors/native/turn-watch.ts +159 -0
- package/hostAdapter/dshAdapter/host/api-retry.ts +30 -123
- package/hostAdapter/dshAdapter/host/bridge-supervisor.ts +96 -0
- package/hostAdapter/dshAdapter/host/bridge.ts +147 -224
- package/hostAdapter/dshAdapter/host/compat/dsh-session-host.ts +46 -0
- package/hostAdapter/dshAdapter/host/{list-cache.ts → compat/list-cache.ts} +1 -1
- package/hostAdapter/dshAdapter/host/compat/plugin-source.ts +41 -0
- package/hostAdapter/dshAdapter/host/config.ts +149 -124
- package/hostAdapter/dshAdapter/host/debug-run.ts +274 -793
- package/hostAdapter/dshAdapter/host/diag/debug-log.ts +44 -0
- package/hostAdapter/dshAdapter/host/{diag-feed.ts → diag/diag-feed.ts} +11 -18
- package/hostAdapter/dshAdapter/host/{host-log.ts → diag/host-log.ts} +1 -1
- package/hostAdapter/dshAdapter/host/engine-transcript.ts +2 -2
- package/hostAdapter/dshAdapter/host/events/engine-events.ts +747 -0
- package/hostAdapter/dshAdapter/host/events/mailbox-push.ts +332 -0
- package/hostAdapter/dshAdapter/host/{pre-step-gate.ts → events/pre-step-gate.ts} +26 -32
- package/hostAdapter/dshAdapter/host/femo-files.ts +6 -207
- package/hostAdapter/dshAdapter/host/femo-skill.ts +153 -0
- package/hostAdapter/dshAdapter/host/femoIdentity.ts +101 -0
- package/hostAdapter/dshAdapter/host/http.ts +10 -12
- package/hostAdapter/dshAdapter/host/hub/god-mirror.ts +307 -0
- package/hostAdapter/dshAdapter/host/hub/hub-feed.ts +129 -0
- package/hostAdapter/dshAdapter/host/hub/hub-proxy.ts +203 -0
- package/hostAdapter/dshAdapter/host/{stream-frames.ts → hub/stream-frames.ts} +36 -77
- package/hostAdapter/dshAdapter/host/index.ts +354 -638
- package/hostAdapter/dshAdapter/host/job-index.ts +36 -0
- package/hostAdapter/dshAdapter/host/main-actor.ts +24 -853
- package/hostAdapter/dshAdapter/host/main-delivery-queue.ts +5 -112
- package/hostAdapter/dshAdapter/host/node-retry.ts +22 -246
- package/hostAdapter/dshAdapter/host/persona.ts +50 -96
- package/hostAdapter/dshAdapter/host/projection/hub-anchor.ts +21 -0
- package/hostAdapter/dshAdapter/host/{projection.ts → projection/projection.ts} +112 -188
- package/hostAdapter/dshAdapter/host/{windowing-native.ts → projection/windowing-native.ts} +35 -37
- package/hostAdapter/dshAdapter/host/routes/dialogs.ts +63 -0
- package/hostAdapter/dshAdapter/host/routes/engine-gateway.ts +128 -0
- package/hostAdapter/dshAdapter/host/routes/index.ts +603 -0
- package/hostAdapter/dshAdapter/host/{projection-input.ts → routes/projection-input.ts} +255 -246
- package/hostAdapter/dshAdapter/host/routes/projection.ts +174 -0
- package/hostAdapter/dshAdapter/host/routes/run.ts +127 -0
- package/hostAdapter/dshAdapter/host/routes/script-files.ts +68 -0
- package/hostAdapter/dshAdapter/host/routes/state.ts +273 -0
- package/hostAdapter/dshAdapter/host/run-control.ts +687 -641
- package/hostAdapter/dshAdapter/host/session-roster.ts +407 -0
- package/hostAdapter/dshAdapter/host/sse.ts +27 -0
- package/hostAdapter/dshAdapter/host/state-files.ts +13 -301
- package/hostAdapter/dshAdapter/host/tool-deps.ts +299 -0
- package/hostAdapter/dshAdapter/host/tools.ts +395 -486
- package/hostAdapter/dshAdapter/host/verbs.ts +81 -0
- package/hostAdapter/dshAdapter/host.manifest.json +2 -1
- package/hostAdapter/dshAdapter/lib/client.js +9209 -6558
- package/hostAdapter/dshAdapter/lib/client.js.map +4 -4
- package/hostAdapter/dshAdapter/lib/index.js +13 -8213
- package/hostAdapter/dshAdapter/lib/index.js.map +4 -4
- package/hostAdapter/dshAdapter/lib/main.js +10154 -0
- package/hostAdapter/dshAdapter/lib/main.js.map +7 -0
- package/hostAdapter/dshAdapter/package.json +5 -4
- package/hostAdapter/dshAdapter/pnpm-lock.yaml +606 -596
- package/hostAdapter/dshAdapter/shared/window-id.d.mts +5 -0
- package/hostAdapter/dshAdapter/shared/window-id.mjs +22 -0
- package/hostAdapter/dshAdapter/tsconfig.host-verify.json +6 -0
- package/hostAdapter/dshAdapter/tsconfig.json +1 -3
- package/hostAdapter/webAdapter/AGENTS.md +203 -0
- package/hostAdapter/webAdapter/console/index.html +760 -0
- package/hostAdapter/webAdapter/extension/background.js +738 -0
- package/hostAdapter/webAdapter/extension/bubble.js +201 -0
- package/hostAdapter/webAdapter/extension/icons/icon128.png +0 -0
- package/hostAdapter/webAdapter/extension/icons/icon16.png +0 -0
- package/hostAdapter/webAdapter/extension/icons/icon32.png +0 -0
- package/hostAdapter/webAdapter/extension/icons/icon48.png +0 -0
- package/hostAdapter/webAdapter/extension/seat-agent-core.js +791 -0
- package/hostAdapter/webAdapter/extension/sidepanel/conn.mjs +25 -0
- package/hostAdapter/webAdapter/extension/sidepanel/feeds.mjs +57 -0
- package/hostAdapter/webAdapter/extension/sidepanel/human-seat.mjs +111 -0
- package/hostAdapter/webAdapter/extension/sidepanel/main.mjs +186 -0
- package/hostAdapter/webAdapter/extension/sidepanel/run-control.mjs +183 -0
- package/hostAdapter/webAdapter/extension/sidepanel/seats.mjs +172 -0
- package/hostAdapter/webAdapter/extension/sidepanel/svclog.mjs +78 -0
- package/hostAdapter/webAdapter/extension/sidepanel.html +600 -0
- package/hostAdapter/webAdapter/manifest.json +158 -0
- package/hostAdapter/webAdapter/native/install-native-host.cmd +8 -0
- package/hostAdapter/webAdapter/native/install-native-host.mjs +27 -0
- package/hostAdapter/webAdapter/native/register-core.mjs +101 -0
- package/hostAdapter/webAdapter/native/web-launcher.cs +141 -0
- package/hostAdapter/webAdapter/native/web-launcher.mjs +160 -0
- package/hostAdapter/webAdapter/package.json +13 -0
- package/hostAdapter/webAdapter/readme.md +365 -0
- package/hostAdapter/webAdapter/server/board.mjs +42 -0
- package/hostAdapter/webAdapter/server/bridge.mjs +68 -0
- package/hostAdapter/webAdapter/server/canvas.mjs +520 -0
- package/hostAdapter/webAdapter/server/http-io.mjs +20 -0
- package/hostAdapter/webAdapter/server/keeper.mjs +114 -0
- package/hostAdapter/webAdapter/server/mailbox-push.mjs +184 -0
- package/hostAdapter/webAdapter/server/runtime.mjs +1025 -0
- package/hostAdapter/webAdapter/server/seats.mjs +239 -0
- package/hostAdapter/webAdapter/server/service.mjs +1051 -0
- package/hostAdapter/webAdapter/shared/dom.mjs +33 -0
- package/hostAdapter/webAdapter/shared/femo-logo.mjs +36 -0
- package/hostAdapter/webAdapter/shared/guard.mjs +28 -0
- package/hostAdapter/webAdapter/shared/human-seat-core.mjs +56 -0
- package/hostAdapter/webAdapter/shared/run-core.mjs +20 -0
- package/hostAdapter/webAdapter/shared/seats-core.mjs +73 -0
- package/hostAdapter/webAdapter/sites/aistudio.google.com/SITE.md +66 -0
- package/hostAdapter/webAdapter/sites/aistudio.google.com/content.js +144 -0
- package/hostAdapter/webAdapter/sites/aistudio.google.com/inject.js +240 -0
- package/hostAdapter/webAdapter/sites/aistudio.google.com/site.mjs +70 -0
- package/hostAdapter/webAdapter/sites/chat.deepseek.com/SITE.md +77 -0
- package/hostAdapter/webAdapter/sites/chat.deepseek.com/content.js +103 -0
- package/hostAdapter/webAdapter/sites/chat.deepseek.com/inject.js +181 -0
- package/hostAdapter/webAdapter/sites/chat.deepseek.com/site.mjs +73 -0
- package/hostAdapter/webAdapter/sites/chatglm.cn/SITE.md +63 -0
- package/hostAdapter/webAdapter/sites/chatglm.cn/content.js +121 -0
- package/hostAdapter/webAdapter/sites/chatglm.cn/inject.js +190 -0
- package/hostAdapter/webAdapter/sites/chatglm.cn/site.mjs +63 -0
- package/hostAdapter/webAdapter/sites/chatgpt.com/SITE.md +58 -0
- package/hostAdapter/webAdapter/sites/chatgpt.com/content.js +124 -0
- package/hostAdapter/webAdapter/sites/chatgpt.com/inject.js +404 -0
- package/hostAdapter/webAdapter/sites/chatgpt.com/site.mjs +68 -0
- package/hostAdapter/webAdapter/sites/grok.com/SITE.md +42 -0
- package/hostAdapter/webAdapter/sites/grok.com/content.js +120 -0
- package/hostAdapter/webAdapter/sites/grok.com/inject.js +259 -0
- package/hostAdapter/webAdapter/sites/grok.com/site.mjs +73 -0
- package/hostAdapter/webAdapter/sites/www.doubao.com/SITE.md +62 -0
- package/hostAdapter/webAdapter/sites/www.doubao.com/content.js +115 -0
- package/hostAdapter/webAdapter/sites/www.doubao.com/inject.js +232 -0
- package/hostAdapter/webAdapter/sites/www.doubao.com/site.mjs +62 -0
- package/hostAdapter/webAdapter/sites/www.kimi.com/SITE.md +57 -0
- package/hostAdapter/webAdapter/sites/www.kimi.com/content.js +117 -0
- package/hostAdapter/webAdapter/sites/www.kimi.com/inject.js +194 -0
- package/hostAdapter/webAdapter/sites/www.kimi.com/site.mjs +61 -0
- package/hostAdapter/webAdapter/sites/www.qianwen.com/SITE.md +43 -0
- package/hostAdapter/webAdapter/sites/www.qianwen.com/content.js +123 -0
- package/hostAdapter/webAdapter/sites/www.qianwen.com/inject.js +273 -0
- package/hostAdapter/webAdapter/sites/www.qianwen.com/site.mjs +72 -0
- package/hostAdapter/webAdapter/sites.mjs +67 -0
- package/hostAdapter/webAdapter/start-service.cmd +13 -0
- package/hostAdapter/webAdapter/tests/canvas-files.test.mjs +134 -0
- package/hostAdapter/webAdapter/tests/chatgpt-parser.test.mjs +161 -0
- package/hostAdapter/webAdapter/tests/doubao-parser.test.mjs +151 -0
- package/hostAdapter/webAdapter/tests/keeper.test.mjs +108 -0
- package/hostAdapter/webAdapter/tests/runtime.test.mjs +962 -0
- package/hostAdapter/webAdapter/tests/seats-core.test.mjs +134 -0
- package/hostAdapter/webAdapter/tests/site-boundary.test.mjs +161 -0
- package/hostAdapter/webAdapter/tests/smoke-bridge.mjs +65 -0
- package/hostAdapter/webAdapter/tests/smoke-service.mjs +232 -0
- package/hostAdapter/webAdapter/web.host.manifest.json +6 -0
- package/hostAdapter/zcodeAdapter/.zcode-plugin/plugin.json +23 -23
- package/hostAdapter/zcodeAdapter/README.md +73 -61
- package/hostAdapter/zcodeAdapter/commands/femo.md +8 -9
- package/hostAdapter/zcodeAdapter/hooks/hooks.json +13 -16
- package/hostAdapter/zcodeAdapter/hooks/lib.mjs +318 -59
- package/hostAdapter/zcodeAdapter/hooks/mail-context.mjs +4 -0
- package/hostAdapter/zcodeAdapter/hooks/stop-intent.mjs +4 -3
- package/hostAdapter/zcodeAdapter/hooks/turn-collect.mjs +3 -0
- package/hostAdapter/zcodeAdapter/icon.png +0 -0
- package/hostAdapter/zcodeAdapter/mcp/engine-bind.mjs +56 -0
- package/hostAdapter/zcodeAdapter/mcp/event-router.mjs +42 -258
- package/hostAdapter/zcodeAdapter/mcp/femo-server.mjs +198 -320
- package/hostAdapter/zcodeAdapter/paths.mjs +78 -0
- package/hostAdapter/zcodeAdapter/runtime/femo-possess.mjs +356 -0
- package/hostAdapter/zcodeAdapter/runtime/femo-stream-watcher.mjs +214 -0
- package/hostAdapter/zcodeAdapter/runtime/mailbox-cli.mjs +33 -0
- package/hostAdapter/zcodeAdapter/runtime/pulled-letter.mjs +36 -0
- package/hostAdapter/zcodeAdapter/runtime/speech-collect.mjs +547 -0
- package/hostAdapter/zcodeAdapter/skills/femo/SKILL.md +52 -89
- package/hostAdapter/zcodeAdapter/tests/bridge-smoke.mjs +16 -6
- package/hostAdapter/zcodeAdapter/tests/event-router.test.mjs +160 -157
- package/hostAdapter/zcodeAdapter/tests/harness.mjs +91 -0
- package/hostAdapter/zcodeAdapter/tests/hooks-smoke.mjs +205 -0
- package/hostAdapter/zcodeAdapter/tests/integration-human.mjs +34 -17
- package/hostAdapter/zcodeAdapter/tests/main-actor.mjs +203 -107
- package/hostAdapter/zcodeAdapter/tests/mcp-smoke.mjs +100 -130
- package/hostAdapter/zcodeAdapter/tests/memory-store.mjs +72 -0
- package/hostAdapter/zcodeAdapter/tests/modelio-weave.test.mjs +82 -0
- package/hostAdapter/zcodeAdapter/tests/mount-state.test.mjs +150 -0
- package/hostAdapter/zcodeAdapter/tests/pulled-letter.test.mjs +77 -0
- package/hostAdapter/zcodeAdapter/tests/run-state-core.test.mjs +95 -0
- package/hostAdapter/zcodeAdapter/tests/speech-draft.mjs +163 -0
- package/hostAdapter/zcodeAdapter/tests/stream-watcher.test.mjs +154 -0
- package/hostAdapter/zcodeAdapter/tests/turn-marker.test.mjs +110 -0
- package/hostAdapter/zcodeAdapter/tests/unbound-actors.test.mjs +48 -0
- package/hostAdapter/zcodeAdapter/tests/variable-api.test.mjs +79 -0
- package/hostAdapter/zcodeAdapter/zcode.host.manifest.json +2 -1
- package/package.json +2 -2
- package//350/257/255/346/263/225/346/226/207/346/241/243.md +1202 -1136
- package/FEMO_logo.svg +0 -55
- package/FEMO_logo_slogan.svg +0 -29
- package/_tmp/fallback/driver2.py +0 -176
- package/_tmp/fallback/events.jsonl +0 -108
- package/_tmp/fallback/gateway_ui.py +0 -325
- package/_tmp/fallback/outbox/j1553_human_[/347/234/213/347/211/214]_1.done +0 -1
- package/_tmp/fallback/outbox/r1.done +0 -1
- package/_tmp/fallback/outbox/r2.done +0 -1
- package/_tmp/fallback/outbox/r3.done +0 -1
- package/_tmp/fallback/outbox/r4.done +0 -1
- package/_tmp/fallback/outbox/r5.done +0 -1
- package/femoExamples/AI/350/201/212/345/244/251/345/256/244/group-chat.femo +0 -42
- package/femoGen/src/useCanvasInteraction.jsx +0 -319
- package/hostAdapter/dshAdapter/client/client-ui/femo-stream-live.tsx +0 -264
- package/hostAdapter/dshAdapter/dshPatch/MEOW_MODIFICATIONS.md +0 -3105
- package/hostAdapter/dshAdapter/host/debug-log.ts +0 -29
- package/hostAdapter/dshAdapter/host/engine-events.ts +0 -894
- package/hostAdapter/dshAdapter/host/god-mirror.ts +0 -234
- package/hostAdapter/dshAdapter/host/preset-install.ts +0 -59
- package/hostAdapter/dshAdapter/host/proj-trace.ts +0 -49
- package/hostAdapter/dshAdapter/host/routes.ts +0 -1196
- package/hostAdapter/dshAdapter/host/section-gate.ts +0 -108
- package/hostAdapter/dshAdapter/host/subagent-native.ts +0 -997
- package/hostAdapter/dshAdapter/host/subagent.ts +0 -1205
- package/hostAdapter/dshAdapter/package-lock.json +0 -500
- package/hostAdapter/dshAdapter/preset/agent.cordis.yml +0 -220
- package/hostAdapter/dshAdapter/preset/preset.yml +0 -3
- package/hostAdapter/dshAdapter/python/dev-bridge-test.py +0 -43
- package/hostAdapter/dshAdapter/python/femo_bridge.py +0 -533
- package/hostAdapter/zcodeAdapter/.tmp/femo/host-history/gateway.port +0 -1
- package/hostAdapter/zcodeAdapter/.tmp/femo/host-history/proj-mirror/femo-main-a-_40_52a9_624b.jsonl +0 -3
- package/hostAdapter/zcodeAdapter/.tmp/femo/host-history/proj-mirror/femo-main-a-_40_6211.jsonl +0 -10
- package/hostAdapter/zcodeAdapter/.tmp/femo/host-history/proj-mirror/femo-main-god.jsonl +0 -11
- package/hostAdapter/zcodeAdapter/.tmp/femo/host-history/proj-mirror/femo-main-stage.jsonl +0 -11
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/.zcode-plugin/plugin.json +0 -23
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/LICENSE +0 -201
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/README.md +0 -635
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/commands/femo.md +0 -9
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femo2host/__init__.py +0 -4
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femo2host/femoToolcall/chronica.py +0 -156
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femo2host/femoToolcall/femo-chat.mjs +0 -69
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femo2host/femoToolcall/femo_debugger.py +0 -1515
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femo2host/femo_api.py +0 -437
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femo2host/femo_gen_api.jsx +0 -77
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoBridges/ContextExample.py +0 -555
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoBridges/MemoryExample.py +0 -163
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoBridges/__init__.py +0 -1
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoBridges/getDir/get_dir.py +0 -56
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoBridges/getDir//344/275/240/345/217/257/344/273/245/350/256/276/345/256/232/344/273/273/346/204/217/346/226/207/344/273/266/345/244/271/344/270/272/347/224/250/346/210/267/346/225/260/346/215/256/346/226/207/344/273/266/345/244/271.txt +0 -10
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoBridges/llmBridge.py +0 -247
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoBridges/llmProviders.py +0 -308
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/FEMO_CLIrenderer.py +0 -198
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/FEMO_config.py +0 -35
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/FEMO_errors.py +0 -278
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/FEMO_interpreter.py +0 -163
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/FEMO_normalizer.py +0 -396
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/FEMO_parser.py +0 -2468
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/FEMO_runtime.py +0 -3630
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/FEMO_scope_resolver.py +0 -209
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/__init__.py +0 -1
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/actor_resolver.py +0 -86
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/block_collector.py +0 -441
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/db_utils.py +0 -485
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/femoAsync.py +0 -401
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/host_manifest.py +0 -68
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/job_manager.py +0 -767
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/protocol.py +0 -126
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/save_dialog.py +0 -402
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/task_world.py +0 -544
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/vars/__init__.py +0 -19
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/vars/checkpoint.py +0 -113
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/vars/env.py +0 -686
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/vars/evaluator.py +0 -567
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/vars/join.py +0 -303
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/vars/merge.py +0 -157
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/vars/model.py +0 -245
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoExamples/AI/345/211/252/350/247/206/351/242/221/AI/345/211/252/350/247/206/351/242/221.femo +0 -192
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoExamples/AI/350/201/212/345/244/251/345/256/244/group-chat.femo +0 -42
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoExamples/AI/350/201/212/345/244/251/345/256/244/random_wait_time.py +0 -10
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoExamples/LuxFiat/wait.py +0 -29
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoExamples/debug/347/245/236/345/231/250/debug/347/245/236/345/231/250.femo +0 -222
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoExamples/discussion.femo +0 -70
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoExamples/goal-mode.femo +0 -23
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoExamples//345/270/270/347/224/250/345/267/245/345/205/267python/wait.py +0 -29
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoExamples//347/213/274/344/272/272/346/235/200/werewolf_utils.py +0 -205
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoExamples//347/213/274/344/272/272/346/235/200/werewolf_utils2.py +0 -324
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoExamples//347/213/274/344/272/272/346/235/200//347/213/274/344/272/272/346/235/200.femo +0 -331
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoExamples//350/260/201/346/230/257/345/215/247/345/272/225/undercover_utils.py +0 -683
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/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 +0 -348
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/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 +0 -393
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/hooks/after-tool.mjs +0 -3
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/hooks/hooks.json +0 -16
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/hooks/lib.mjs +0 -59
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/hooks/prompt-state.mjs +0 -3
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/hooks/session-start.mjs +0 -3
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/hooks/stop-intent.mjs +0 -3
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/hostAdapter/dshAdapter/python/dev-bridge-test.py +0 -43
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/hostAdapter/dshAdapter/python/femo_bridge.py +0 -533
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/mcp/bridge-manager.mjs +0 -192
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/mcp/event-router.mjs +0 -258
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/mcp/femo-server.mjs +0 -429
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/mcp/gateway.mjs +0 -163
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/mcp/projection-writer.mjs +0 -294
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/skills/femo/SKILL.md +0 -93
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/tests/bridge-smoke.mjs +0 -26
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/tests/event-router.test.mjs +0 -157
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/tests/gateway-smoke.mjs +0 -107
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/tests/integration-human.mjs +0 -111
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/tests/main-actor.mjs +0 -107
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/tests/mcp-smoke.mjs +0 -130
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/tests/projection-writer.test.mjs +0 -144
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/zcode.host.manifest.json +0 -5
- package/hostAdapter/zcodeAdapter/femo-zcode-dist//346/212/225/345/275/261/347/252/227/351/207/215/350/256/276/350/256/241-/350/256/250/350/256/272/347/250/277.md +0 -113
- package/hostAdapter/zcodeAdapter/femo-zcode-dist//350/257/255/346/263/225/346/226/207/346/241/243.md +0 -1136
- package/hostAdapter/zcodeAdapter/hooks/after-tool.mjs +0 -3
- package/hostAdapter/zcodeAdapter/hooks/prompt-state.mjs +0 -3
- package/hostAdapter/zcodeAdapter/hooks/session-start.mjs +0 -3
- package/hostAdapter/zcodeAdapter/mcp/bridge-manager.mjs +0 -192
- package/hostAdapter/zcodeAdapter/mcp/gateway.mjs +0 -163
- package/hostAdapter/zcodeAdapter/mcp/projection-writer.mjs +0 -294
- package/hostAdapter/zcodeAdapter/tests/gateway-smoke.mjs +0 -107
- package/hostAdapter/zcodeAdapter/tests/projection-writer.test.mjs +0 -144
- package/hostAdapter/zcodeAdapter//346/212/225/345/275/261/347/252/227/351/207/215/350/256/276/350/256/241-/350/256/250/350/256/272/347/250/277.md +0 -113
- package/scripts/diag-find-redblue.mjs +0 -38
- package/scripts/diag-god-log.mjs +0 -31
- package/scripts/diag-god-log2.mjs +0 -39
- package/scripts/diag-god-log3.mjs +0 -35
- package/scripts/diag-god-log4.mjs +0 -59
- package/scripts/diag-god-log4b.mjs +0 -39
- package/scripts/diag-redblue-god.mjs +0 -39
- package/scripts/diag-redblue-log.mjs +0 -37
- package/scripts/diag-redblue-span.mjs +0 -41
- package/scripts/diag-stage-1017.mjs +0 -63
- package/scripts/dump_session.py +0 -36
- package/scripts/link-workspace.ps1 +0 -51
- package/scripts/list_souls.py +0 -18
- package/scripts/probe-composer-refresh.mjs +0 -197
- package/scripts/seed_story_souls.py +0 -86
- package/scripts/sync-zcode-dist.ps1 +0 -55
- package/scripts/theme-tokenize/color-extract.txt +0 -288
- package/scripts/theme-tokenize/round1-quoted.ps1 +0 -149
- package/scripts/theme-tokenize/round2-bare.ps1 +0 -138
- package/scripts/theme-tokenize/round3-shape.ps1 +0 -110
- package/tests/_diag_r4_join.femo +0 -32
- package/tests/conftest.py +0 -95
- package/tests/diag-subagent-dir-3081.mjs +0 -101
- package/tests/femoGenerator.test.mjs +0 -3909
- package/tests/femoParser.test.mjs +0 -4813
- package/tests/femogen_notice.test.mjs +0 -109
- package/tests/femoparser_validation.test.mjs +0 -84
- package/tests/main-delivery-queue.test.mjs +0 -329
- package/tests/pre-step-gate.test.mjs +0 -282
- package/tests/read-subagent-model.mjs +0 -24
- package/tests/run-script-tests.py +0 -97
- package/tests/safe-steer.test.mjs +0 -59
- package/tests/strip_comments.test.mjs +0 -164
- package/tests/test_actor_failed.py +0 -92
- package/tests/test_compile_warnings.py +0 -99
- package/tests/test_debug_log_bus.py +0 -108
- package/tests/test_debugger_module_mode.py +0 -141
- package/tests/test_error_buckets.py +0 -117
- package/tests/test_error_dispatcher.py +0 -261
- package/tests/test_exec_ai_retry.py +0 -155
- package/tests/test_exec_human_retry.py +0 -159
- package/tests/test_file_resolve.py +0 -104
- package/tests/test_flow_events.py +0 -311
- package/tests/test_flow_ref_validation.py +0 -92
- package/tests/test_func_dict_fallback.py +0 -39
- package/tests/test_job_lifecycle.py +0 -236
- package/tests/test_job_manager.py +0 -424
- package/tests/test_mind.py +0 -99
- package/tests/test_module_call_args.py +0 -258
- package/tests/test_module_visibility.py +0 -238
- package/tests/test_notice.py +0 -143
- package/tests/test_out_whitelist.py +0 -83
- package/tests/test_par_if_dispatch.py +0 -64
- package/tests/test_par_nested_for.py +0 -78
- package/tests/test_parser.py +0 -494
- package/tests/test_pause.py +0 -102
- package/tests/test_pause_contract.py +0 -135
- package/tests/test_protocol_transcript.py +0 -158
- package/tests/test_scope_self.py +0 -202
- package/tests/test_source_validate.py +0 -113
- package/tests/test_task_world.py +0 -447
- package/tests/test_town_structure.py +0 -70
- package/tests/test_v2_checkpoint.py +0 -115
- package/tests/test_v2_env.py +0 -383
- package/tests/test_v2_evaluator.py +0 -227
- package/tests/test_v2_join.py +0 -315
- package/tests/test_v2_join_wiring.py +0 -429
- package/tests/test_v2_merge.py +0 -167
- package/tests/test_v2_model.py +0 -143
- package/tests/test_v2_resume_e2e.py +0 -472
- package/tests/test_var_decls.py +0 -271
- package/tests/verify-model-functions.mjs +0 -90
- package/tests/verify-subagent-model-3081.mjs +0 -153
- package//346/226/275/345/267/245/346/270/205/345/215/225/node-notice-/346/226/275/345/267/245/346/270/205/345/215/225.md +0 -395
- package//346/226/275/345/267/245/346/270/205/345/215/225//344/270/244/344/270/252/345/276/205/350/247/243/345/206/263/347/232/204/351/227/256/351/242/230.MD +0 -66
- package//346/226/275/345/267/245/346/270/205/345/215/225//345/201/234/346/255/242/351/223/276/344/277/256/345/244/215-/346/226/275/345/267/245/346/270/205/345/215/225.md +0 -475
- package//346/226/275/345/267/245/346/270/205/345/215/225//345/217/230/351/207/217/344/270/216task/347/263/273/347/273/237/351/207/215/346/236/204-/346/226/275/345/267/245/346/270/205/345/215/225-v2.md +0 -847
- package//346/226/275/345/267/245/346/270/205/345/215/225//350/277/220/350/241/214/347/212/266/346/200/201/351/223/276/350/267/257/351/207/215/346/236/204-/346/226/275/345/267/245/346/270/205/345/215/225v4.md +0 -654
- package//346/226/275/345/267/245/346/270/205/345/215/225//351/224/231/350/257/257/346/263/250/345/205/245/347/273/255/350/201/212-/346/226/275/345/267/245/346/270/205/345/215/225.md +0 -471
- /package/hostAdapter/dshAdapter/host/{native-state.ts → compat/native-state.ts} +0 -0
- /package/hostAdapter/dshAdapter/host/{session-events.ts → compat/session-events.ts} +0 -0
|
@@ -1,319 +0,0 @@
|
|
|
1
|
-
// ═══════════════════════════════════════════════════════════════
|
|
2
|
-
// ═══ useWorkflowRuntime.jsx ═══
|
|
3
|
-
// ═══════════════════════════════════════════════════════════════
|
|
4
|
-
|
|
5
|
-
import { useCallback, useRef, useState } from 'react';
|
|
6
|
-
import { eid, getNodeSize, smartBezier, SPW, SPH, SINK_ONLY } from './common';
|
|
7
|
-
|
|
8
|
-
function useCanvasInteraction({
|
|
9
|
-
cvRef,
|
|
10
|
-
nodesRef,
|
|
11
|
-
setNodes,
|
|
12
|
-
edges,
|
|
13
|
-
setEdges,
|
|
14
|
-
scale,
|
|
15
|
-
setScale,
|
|
16
|
-
pan,
|
|
17
|
-
setPan,
|
|
18
|
-
setSel,
|
|
19
|
-
addNode,
|
|
20
|
-
addModuleNode,
|
|
21
|
-
addSpecialNode,
|
|
22
|
-
addPositionNode,
|
|
23
|
-
lib,
|
|
24
|
-
}) {
|
|
25
|
-
const [drag, setDrag] = useState(null);
|
|
26
|
-
const [conn, setConn] = useState(null);
|
|
27
|
-
const [isPanning, setIsPanning] = useState(false);
|
|
28
|
-
const [panStart, setPanStart] = useState({ x: 0, y: 0, px: 0, py: 0 });
|
|
29
|
-
const isMouseDownRef = useRef(false);
|
|
30
|
-
const isDraggingRef = useRef(false);
|
|
31
|
-
const mouseDownPosRef = useRef({ x: 0, y: 0 });
|
|
32
|
-
|
|
33
|
-
// Node map helper
|
|
34
|
-
const nm = new Map((nodesRef.current || []).map((n) => [n.id, n]));
|
|
35
|
-
|
|
36
|
-
// Convert client coords to canvas coords
|
|
37
|
-
const xy = useCallback(
|
|
38
|
-
(e) => {
|
|
39
|
-
const r = cvRef.current?.getBoundingClientRect();
|
|
40
|
-
if (!r) return [0, 0];
|
|
41
|
-
return [
|
|
42
|
-
(e.clientX - r.left - pan.x) / scale,
|
|
43
|
-
(e.clientY - r.top - pan.y) / scale,
|
|
44
|
-
];
|
|
45
|
-
},
|
|
46
|
-
[cvRef, pan, scale]
|
|
47
|
-
);
|
|
48
|
-
|
|
49
|
-
// Mouse move handler
|
|
50
|
-
const onMM = useCallback(
|
|
51
|
-
(e) => {
|
|
52
|
-
// 节点拖拽、连线时,无需检查 isMouseDownRef
|
|
53
|
-
if (drag) {
|
|
54
|
-
setNodes((p) => {
|
|
55
|
-
const draggedNode = p.find((n) => n.id === drag.id);
|
|
56
|
-
if (!draggedNode) return p;
|
|
57
|
-
const newX = drag.ox + (e.clientX - drag.sx) / scale;
|
|
58
|
-
const newY = drag.oy + (e.clientY - drag.sy) / scale;
|
|
59
|
-
return p.map((n) => {
|
|
60
|
-
if (n.id === drag.id) {
|
|
61
|
-
return { ...n, x: newX, y: newY };
|
|
62
|
-
}
|
|
63
|
-
// 拖拽 FOR 节点 → 联动 for_out 小圆点
|
|
64
|
-
if (draggedNode.specialType === 'FOR' && n.type === 'for_out' && n.id === draggedNode.forOutNodeId) {
|
|
65
|
-
return { ...n, x: newX + SPW - 22, y: newY + (SPH - 22) / 2 };
|
|
66
|
-
}
|
|
67
|
-
// 拖拽 for_out 小圆点 → 联动 FOR 节点
|
|
68
|
-
if (draggedNode.type === 'for_out' && n.id === draggedNode.forNodeId) {
|
|
69
|
-
return { ...n, x: newX - SPW + 22, y: newY - (SPH - 22) / 2 };
|
|
70
|
-
}
|
|
71
|
-
// par_out 不做任何联动(自由移动)
|
|
72
|
-
// 注意:par_out 不做任何联动,自由移动
|
|
73
|
-
return n;
|
|
74
|
-
});
|
|
75
|
-
});
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
78
|
-
if (conn) {
|
|
79
|
-
const [cx, cy] = xy(e);
|
|
80
|
-
setConn((p) => ({ ...p, mx: cx, my: cy }));
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
// 画布平移:必须按下鼠标才开始判断
|
|
85
|
-
if (!isMouseDownRef.current) return;
|
|
86
|
-
|
|
87
|
-
if (!isPanning) {
|
|
88
|
-
const dx = e.clientX - mouseDownPosRef.current.x;
|
|
89
|
-
const dy = e.clientY - mouseDownPosRef.current.y;
|
|
90
|
-
if (Math.abs(dx) > 3 || Math.abs(dy) > 3) {
|
|
91
|
-
setIsPanning(true);
|
|
92
|
-
isDraggingRef.current = true;
|
|
93
|
-
}
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
96
|
-
setPan({
|
|
97
|
-
x: panStart.px + e.clientX - panStart.x,
|
|
98
|
-
y: panStart.py + e.clientY - panStart.y,
|
|
99
|
-
});
|
|
100
|
-
},
|
|
101
|
-
[drag, conn, xy, isPanning, panStart, scale]
|
|
102
|
-
);
|
|
103
|
-
|
|
104
|
-
// Wheel handler (zoom/pan)
|
|
105
|
-
const handleWheel = useCallback(
|
|
106
|
-
(e) => {
|
|
107
|
-
e.preventDefault();
|
|
108
|
-
e.stopPropagation();
|
|
109
|
-
e.nativeEvent?.stopImmediatePropagation?.();
|
|
110
|
-
|
|
111
|
-
if (e.ctrlKey || e.metaKey) {
|
|
112
|
-
const rect = cvRef.current?.getBoundingClientRect();
|
|
113
|
-
if (!rect) return;
|
|
114
|
-
const mouseX = e.clientX - rect.left;
|
|
115
|
-
const mouseY = e.clientY - rect.top;
|
|
116
|
-
const worldX = (mouseX - pan.x) / scale;
|
|
117
|
-
const worldY = (mouseY - pan.y) / scale;
|
|
118
|
-
const delta = e.deltaY > 0 ? 0.9 : 1.1;
|
|
119
|
-
const newScale = Math.min(3, Math.max(0.2, scale * delta));
|
|
120
|
-
const newPanX = mouseX - worldX * newScale;
|
|
121
|
-
const newPanY = mouseY - worldY * newScale;
|
|
122
|
-
setScale(newScale);
|
|
123
|
-
setPan({ x: newPanX, y: newPanY });
|
|
124
|
-
} else {
|
|
125
|
-
setPan((prev) => ({
|
|
126
|
-
x: prev.x - e.deltaX,
|
|
127
|
-
y: prev.y - e.deltaY,
|
|
128
|
-
}));
|
|
129
|
-
}
|
|
130
|
-
},
|
|
131
|
-
[scale, pan]
|
|
132
|
-
);
|
|
133
|
-
|
|
134
|
-
// Mouse up handler
|
|
135
|
-
const onMU = useCallback(() => {
|
|
136
|
-
if (isMouseDownRef.current && !isDraggingRef.current) {
|
|
137
|
-
setSel(null);
|
|
138
|
-
}
|
|
139
|
-
setDrag(null);
|
|
140
|
-
setConn(null);
|
|
141
|
-
setIsPanning(false);
|
|
142
|
-
isDraggingRef.current = false;
|
|
143
|
-
isMouseDownRef.current = false;
|
|
144
|
-
}, []);
|
|
145
|
-
|
|
146
|
-
// Canvas mouse down (for panning)
|
|
147
|
-
const onCanvasDown = useCallback(
|
|
148
|
-
(e) => {
|
|
149
|
-
if (!e.target?.dataset?.canvasBg && e.target !== cvRef.current) return;
|
|
150
|
-
if (drag || isPanning || conn) {
|
|
151
|
-
setDrag(null);
|
|
152
|
-
setIsPanning(false);
|
|
153
|
-
setConn(null);
|
|
154
|
-
isDraggingRef.current = false;
|
|
155
|
-
isMouseDownRef.current = false;
|
|
156
|
-
return;
|
|
157
|
-
}
|
|
158
|
-
if (e.button === 0 || e.button === 1) {
|
|
159
|
-
isMouseDownRef.current = true;
|
|
160
|
-
mouseDownPosRef.current = { x: e.clientX, y: e.clientY };
|
|
161
|
-
setPanStart({ x: e.clientX, y: e.clientY, px: pan.x, py: pan.y });
|
|
162
|
-
e.preventDefault();
|
|
163
|
-
}
|
|
164
|
-
},
|
|
165
|
-
[pan, drag, isPanning, conn]
|
|
166
|
-
);
|
|
167
|
-
|
|
168
|
-
// Port handlers
|
|
169
|
-
function handlePortDown(e, nodeId, portDir, portX, portY) {
|
|
170
|
-
const node = nm.get(nodeId);
|
|
171
|
-
if (node?.type === 'special' && SINK_ONLY.has(node.specialType) && portDir !== 'for_out') return;
|
|
172
|
-
const [cx, cy] = xy(e);
|
|
173
|
-
let srcX = portX, srcY = portY;
|
|
174
|
-
if (srcX === undefined || srcY === undefined) {
|
|
175
|
-
const size = getNodeSize(node);
|
|
176
|
-
srcX = node.x + size.w / 2;
|
|
177
|
-
srcY = node.y + size.h / 2;
|
|
178
|
-
}
|
|
179
|
-
setConn({ srcId: nodeId, srcDir: portDir, mx: cx, my: cy, srcX, srcY });
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
function handlePortUp(e, nodeId, portDir) {
|
|
183
|
-
if (!conn) return;
|
|
184
|
-
if (conn.srcId === nodeId) {
|
|
185
|
-
if (!edges.some((ed) => ed.src === nodeId && ed.tgt === nodeId)) {
|
|
186
|
-
setEdges((p) => [
|
|
187
|
-
...p,
|
|
188
|
-
{ id: eid(), src: nodeId, tgt: nodeId, cond: '', isSelfLoop: true },
|
|
189
|
-
]);
|
|
190
|
-
}
|
|
191
|
-
setConn(null);
|
|
192
|
-
} else {
|
|
193
|
-
if (!edges.some((ed) => ed.src === conn.srcId && ed.tgt === nodeId)) {
|
|
194
|
-
setEdges((p) => [
|
|
195
|
-
...p,
|
|
196
|
-
{ id: eid(), src: conn.srcId, tgt: nodeId, cond: '' },
|
|
197
|
-
]);
|
|
198
|
-
}
|
|
199
|
-
setConn(null);
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
function handleBodyMouseUp(e, nodeId) {
|
|
204
|
-
if (conn && conn.srcId !== nodeId) {
|
|
205
|
-
if (!edges.some((ed) => ed.src === conn.srcId && ed.tgt === nodeId)) {
|
|
206
|
-
setEdges((p) => [
|
|
207
|
-
...p,
|
|
208
|
-
{ id: eid(), src: conn.srcId, tgt: nodeId, cond: '' },
|
|
209
|
-
]);
|
|
210
|
-
}
|
|
211
|
-
setConn(null);
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
// Library drag/drop
|
|
216
|
-
function handleLibDragStart(e, type, idOrType) {
|
|
217
|
-
e.dataTransfer.setData(
|
|
218
|
-
'application/femo-item',
|
|
219
|
-
JSON.stringify({ type, id: idOrType })
|
|
220
|
-
);
|
|
221
|
-
e.dataTransfer.effectAllowed = 'copy';
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
function handleCanvasDragOver(e) {
|
|
225
|
-
e.preventDefault();
|
|
226
|
-
e.dataTransfer.dropEffect = 'copy';
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
function handleCanvasDrop(e) {
|
|
230
|
-
e.preventDefault();
|
|
231
|
-
let data;
|
|
232
|
-
try {
|
|
233
|
-
data = JSON.parse(e.dataTransfer.getData('application/femo-item'));
|
|
234
|
-
} catch {
|
|
235
|
-
return;
|
|
236
|
-
}
|
|
237
|
-
if (!data) return;
|
|
238
|
-
|
|
239
|
-
const [cx, cy] = xy(e);
|
|
240
|
-
const dropX = cx - 50;
|
|
241
|
-
const dropY = cy - 20;
|
|
242
|
-
|
|
243
|
-
if (data.type === 'action') {
|
|
244
|
-
let action = lib.actions.find((a) => a.id === data.id);
|
|
245
|
-
if (action && isFinite(dropX) && isFinite(dropY))
|
|
246
|
-
addNode(action, dropX, dropY);
|
|
247
|
-
} else if (data.type === 'module') {
|
|
248
|
-
const mod = lib.modules.find((m) => m.id === data.id);
|
|
249
|
-
if (mod) addModuleNode(mod, dropX, dropY);
|
|
250
|
-
} else if (data.type === 'special') {
|
|
251
|
-
addSpecialNode(data.id, dropX, dropY);
|
|
252
|
-
} else if (data.type === 'position') {
|
|
253
|
-
addPositionNode(dropX, dropY);
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
// Compute temporary connection line
|
|
258
|
-
function getTempConnLine() {
|
|
259
|
-
if (!conn) return null;
|
|
260
|
-
const srcNode = nm.get(conn.srcId);
|
|
261
|
-
if (!srcNode) return null;
|
|
262
|
-
const ss = getNodeSize(srcNode);
|
|
263
|
-
|
|
264
|
-
let srcPort;
|
|
265
|
-
switch (conn.srcDir) {
|
|
266
|
-
case 'top':
|
|
267
|
-
srcPort = { x: srcNode.x + ss.w / 2, y: srcNode.y };
|
|
268
|
-
break;
|
|
269
|
-
case 'bottom':
|
|
270
|
-
srcPort = { x: srcNode.x + ss.w / 2, y: srcNode.y + ss.h };
|
|
271
|
-
break;
|
|
272
|
-
case 'left':
|
|
273
|
-
srcPort = { x: srcNode.x, y: srcNode.y + ss.h / 2 };
|
|
274
|
-
break;
|
|
275
|
-
case 'right':
|
|
276
|
-
srcPort = { x: srcNode.x + ss.w, y: srcNode.y + ss.h / 2 };
|
|
277
|
-
break;
|
|
278
|
-
default:
|
|
279
|
-
srcPort = { x: srcNode.x + ss.w, y: srcNode.y + ss.h / 2 };
|
|
280
|
-
}
|
|
281
|
-
const dx = (conn.mx || 0) - srcPort.x;
|
|
282
|
-
const dy = (conn.my || 0) - srcPort.y;
|
|
283
|
-
let srcDir = conn.srcDir || 'right';
|
|
284
|
-
if (!conn.srcDir) {
|
|
285
|
-
if (Math.abs(dx) > Math.abs(dy)) srcDir = dx > 0 ? 'right' : 'left';
|
|
286
|
-
else srcDir = dy > 0 ? 'bottom' : 'top';
|
|
287
|
-
}
|
|
288
|
-
const oppositeDir = {
|
|
289
|
-
right: 'left',
|
|
290
|
-
left: 'right',
|
|
291
|
-
top: 'bottom',
|
|
292
|
-
bottom: 'top',
|
|
293
|
-
}[srcDir];
|
|
294
|
-
return smartBezier(
|
|
295
|
-
srcPort.x,
|
|
296
|
-
srcPort.y,
|
|
297
|
-
srcDir,
|
|
298
|
-
conn.mx || srcPort.x,
|
|
299
|
-
conn.my || srcPort.y,
|
|
300
|
-
oppositeDir
|
|
301
|
-
);
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
return {
|
|
305
|
-
drag, setDrag,
|
|
306
|
-
conn, setConn,
|
|
307
|
-
isPanning, setIsPanning,
|
|
308
|
-
panStart, setPanStart,
|
|
309
|
-
onMM, onMU, onCanvasDown,
|
|
310
|
-
handleWheel,
|
|
311
|
-
handlePortDown, handlePortUp,
|
|
312
|
-
handleBodyMouseUp,
|
|
313
|
-
handleLibDragStart, handleCanvasDragOver, handleCanvasDrop,
|
|
314
|
-
getTempConnLine,
|
|
315
|
-
xy, nm,
|
|
316
|
-
};
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
export { useCanvasInteraction };
|
|
@@ -1,264 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* client-ui/femo-stream-live.tsx — 直播块渲染件 + Deep diving 状态行。
|
|
3
|
-
*
|
|
4
|
-
* speaker 锚点与导演锚点共用同一套视觉:reasoning 块走 FemoReasoningRow 折叠行、
|
|
5
|
-
* toolcall 块走单行 ⚙ 摘要、正文走官方 MarkdownText 打字机(2026-08-26 拆除
|
|
6
|
-
* 自绘闪烁光标:官方流式输出无 caret 装饰,Deep diving 状态行已是进行中信号)。
|
|
7
|
-
* FemoTurnStatus 是官方 ChatView TurnStatus 的同款转写,由调用方按 open-turn
|
|
8
|
-
* 条件渲染在流末尾(2026-08-26 二次修正:不再内嵌于 FemoStreamLive——官方语义
|
|
9
|
-
* 是"骑整个 running turn 全程",而非"有直播块才显示")。
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
import { useEffect, useMemo, useState, type ReactNode } from 'react'
|
|
13
|
-
// MarkdownText:官方正文渲染器(基线件,shell 同一实例)——投影窗流式方案B
|
|
14
|
-
// 的打字机正文与原生消息像素同款的关键。DisclosureRow/StateDot/变体图标同
|
|
15
|
-
// 理(build.mjs 把 primitives 列为 external,require 解析到 shell 同一实例,
|
|
16
|
-
// 自带样式已在页面)——官方工具行的骨架件零转写直接用真件。
|
|
17
|
-
import {
|
|
18
|
-
DisclosureRow, MarkdownText, StateDot,
|
|
19
|
-
IconApiOutline14, IconBrowseOutline16, IconCodeOutline16, IconEditOutline16,
|
|
20
|
-
IconSearchOutline16, IconSparkle16,
|
|
21
|
-
} from '@deepseek-ai/dsh-client-ui-primitives'
|
|
22
|
-
import { FemoReasoningRow } from '../femo-reasoning-row'
|
|
23
|
-
import { type FemoStreamBlock } from './stream-store'
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* 官方 ChatView runningTurnStartTime 同款 + open-turn 存在性判定。
|
|
27
|
-
* 投影窗是无 agent 镜像会话(官方 running 永 false),"演出中"由落盘事件
|
|
28
|
-
* 推导:timeline 存在 status==='open' 的 turn 即进行中;startTime=最近一个
|
|
29
|
-
* open turn 的 turn/start 时间(中途打开/重启后计时仍真实)。
|
|
30
|
-
*/
|
|
31
|
-
export function openTurnInfo(timeline: unknown): { hasOpen: boolean; startTime: number | null } {
|
|
32
|
-
const turns = (timeline as { turns?: Map<string, { status?: string; start?: { time?: number } }> } | undefined)?.turns
|
|
33
|
-
if (turns === undefined) return { hasOpen: false, startTime: null }
|
|
34
|
-
let latest: number | null = null
|
|
35
|
-
let hasOpen = false
|
|
36
|
-
for (const turn of turns.values()) {
|
|
37
|
-
if (turn?.status !== 'open') continue
|
|
38
|
-
hasOpen = true
|
|
39
|
-
if (turn.start !== undefined && typeof turn.start.time === 'number') {
|
|
40
|
-
latest = turn.start.time
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
return { hasOpen, startTime: latest }
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* 官方 ChatView TurnStatus 同款转写(2026-08-26 对齐官方语义):品牌蓝流光
|
|
48
|
-
* "Deep diving...",15 秒起追加耗时计时。官方行为(源码注释 "rides the whole
|
|
49
|
-
* running turn"):用户消息落地即出现(不等首 token,告知"已收到正在处理",
|
|
50
|
-
* 免得用户以为卡死)、位置恒在消息流末尾、整个 turn 结束才消失(首 token/
|
|
51
|
-
* 工具执行/流式全程不闪烁)。显示条件由调用方给(open turn 存在),本组件
|
|
52
|
-
* 只负责视觉与计时。startTime=open turn 的 turn/start 时间(官方
|
|
53
|
-
* runningTurnStartTime 同源;null 回退挂载时刻)。
|
|
54
|
-
*/
|
|
55
|
-
export function FemoTurnStatus({ startTime }: { startTime: number | null }) {
|
|
56
|
-
const [mountedAt] = useState(() => Date.now())
|
|
57
|
-
// Anchored to turn/start so a mid-turn reload keeps the real elapsed time.
|
|
58
|
-
const anchor = startTime ?? mountedAt
|
|
59
|
-
const [elapsedMs, setElapsedMs] = useState(() => Math.max(0, Date.now() - anchor))
|
|
60
|
-
useEffect(() => {
|
|
61
|
-
const tick = (): void => { setElapsedMs(Math.max(0, Date.now() - anchor)) }
|
|
62
|
-
tick()
|
|
63
|
-
const id = setInterval(tick, 1000)
|
|
64
|
-
return () => { clearInterval(id) }
|
|
65
|
-
}, [anchor])
|
|
66
|
-
// 官方同款阈值:短回合只留纯文案,跑够 15 秒才出现计时。
|
|
67
|
-
const showClock = elapsedMs >= 15_000
|
|
68
|
-
const total = Math.max(0, Math.floor(elapsedMs / 1000))
|
|
69
|
-
const minutes = Math.floor(total / 60)
|
|
70
|
-
const seconds = total % 60
|
|
71
|
-
return (
|
|
72
|
-
<div className="femo-turn-status" role="status" aria-live="polite">
|
|
73
|
-
Deep diving...
|
|
74
|
-
{showClock && (
|
|
75
|
-
<span className="femo-turn-status-clock" aria-hidden>
|
|
76
|
-
{minutes > 0 ? `${minutes}分${String(seconds).padStart(2, '0')}秒` : `${seconds}秒`}
|
|
77
|
-
</span>
|
|
78
|
-
)}
|
|
79
|
-
</div>
|
|
80
|
-
)
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
// ── 官方工具行(2026-08-30 V6.1,猫猫拍板"流式就显示官方版样子")────────
|
|
84
|
-
// 照抄对象:ui-tool ToolRow/GenericToolCard/tool-call-model。骨架件
|
|
85
|
-
// (DisclosureRow/StateDot/变体图标)= primitives 真件;行级样式(running
|
|
86
|
-
// sweep 流光/sep 点/summary 截断/IN-OUT 卡)在 styles.ts 按 ToolRow.module.css
|
|
87
|
-
// 逐属性转写(femo-toolrow-*,--dsw token 原样→深浅色/第三方主题自动跟随)。
|
|
88
|
-
// 未转写部分(terminal/read/search/diff/web 专用卡片、fileLink 打开件、
|
|
89
|
-
// Inspect 轨迹跳转)等 turn 落地由官方原生行接管——直播桶只做通用行。
|
|
90
|
-
type FemoToolVariant = 'search' | 'read' | 'bash' | 'write' | 'edit' | 'code' | 'others'
|
|
91
|
-
|
|
92
|
-
/** Figma 行标题字面量(tool-call-model VARIANT_TITLES 原表)。 */
|
|
93
|
-
const FEMO_TOOL_VARIANT_TITLES: Record<FemoToolVariant, string> = {
|
|
94
|
-
search: 'Search', read: 'Read', bash: 'Bash',
|
|
95
|
-
write: 'Write', edit: 'Edit', code: 'Code', others: 'Tool call',
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
/** 已知工具名 → 变体(tool-call-model TOOL_VARIANTS 原表;cordis_* 不在——
|
|
99
|
-
* femo 桶里不会出现,且缺省即 others 通用行)。 */
|
|
100
|
-
const FEMO_TOOL_VARIANTS: Record<string, FemoToolVariant> = {
|
|
101
|
-
bash: 'bash', pwsh: 'bash', read: 'read', web_fetch: 'read',
|
|
102
|
-
web_search: 'search', grep: 'search', glob: 'search',
|
|
103
|
-
write: 'write', edit: 'edit', run_code: 'code',
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
/** 摘要键偏好(tool-call-model SUMMARY_KEYS 原表)。 */
|
|
107
|
-
const FEMO_TOOL_SUMMARY_KEYS: Record<FemoToolVariant, readonly string[]> = {
|
|
108
|
-
bash: ['description', 'command'],
|
|
109
|
-
read: ['path', 'file_path', 'url'],
|
|
110
|
-
search: ['query', 'pattern', 'url'],
|
|
111
|
-
write: ['path', 'file_path'],
|
|
112
|
-
edit: ['path', 'file_path'],
|
|
113
|
-
code: ['description'],
|
|
114
|
-
others: [],
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
/** 变体前置图标(GenericToolCard VARIANT_ICONS 原表,14px 于 16px 槽)。 */
|
|
118
|
-
const FEMO_TOOL_VARIANT_ICONS: Record<FemoToolVariant, ReactNode> = {
|
|
119
|
-
search: <IconSearchOutline16 size={14} />,
|
|
120
|
-
read: <IconBrowseOutline16 size={14} />,
|
|
121
|
-
bash: <IconApiOutline14 size={14} />,
|
|
122
|
-
write: <IconEditOutline16 size={14} />,
|
|
123
|
-
edit: <IconEditOutline16 size={14} />,
|
|
124
|
-
code: <IconCodeOutline16 size={14} />,
|
|
125
|
-
others: <IconSparkle16 size={14} />,
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
function femoToolFirstLine(text: string): string {
|
|
129
|
-
const nl = text.indexOf('\n')
|
|
130
|
-
return nl === -1 ? text : text.slice(0, nl)
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
function femoToolPick(args: Record<string, unknown>, keys: readonly string[]): string | undefined {
|
|
134
|
-
for (const key of keys) {
|
|
135
|
-
const v = args[key]
|
|
136
|
-
if (typeof v === 'string' && v !== '') return v
|
|
137
|
-
}
|
|
138
|
-
return undefined
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
/** 摘要推导(tool-call-model deriveSummary 原逻辑,含流中截断 JSON 的
|
|
142
|
-
* firstLine 回退——与官方 running 行为一致)。 */
|
|
143
|
-
function femoToolDeriveSummary(variant: FemoToolVariant, argsRaw: string): string {
|
|
144
|
-
let parsed: unknown
|
|
145
|
-
try { parsed = JSON.parse(argsRaw) } catch { return femoToolFirstLine(argsRaw) }
|
|
146
|
-
if (typeof parsed !== 'object' || parsed === null) return femoToolFirstLine(argsRaw)
|
|
147
|
-
const args = parsed as Record<string, unknown>
|
|
148
|
-
const picked = femoToolPick(args, FEMO_TOOL_SUMMARY_KEYS[variant])
|
|
149
|
-
if (picked !== undefined) return femoToolFirstLine(picked)
|
|
150
|
-
for (const v of Object.values(args)) {
|
|
151
|
-
if (typeof v === 'string' && v !== '') return femoToolFirstLine(v)
|
|
152
|
-
}
|
|
153
|
-
return femoToolFirstLine(argsRaw)
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
/** 展开 IN 正文(tool-call-model deriveBody 原逻辑:可解析=pretty JSON,
|
|
157
|
-
* 不可解析=原文,code 变体取 program 本体)。 */
|
|
158
|
-
function femoToolDeriveBody(variant: FemoToolVariant, argsRaw: string): string | null {
|
|
159
|
-
if (argsRaw === '') return null
|
|
160
|
-
let parsed: unknown
|
|
161
|
-
try { parsed = JSON.parse(argsRaw) } catch { return argsRaw }
|
|
162
|
-
if (variant === 'code' && typeof parsed === 'object' && parsed !== null) {
|
|
163
|
-
const code = (parsed as Record<string, unknown>).code
|
|
164
|
-
if (typeof code === 'string' && code !== '') return code
|
|
165
|
-
}
|
|
166
|
-
return JSON.stringify(parsed, null, 2)
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
/** 一行官方工具行:收起=[图标|StateDot] 标题 · 摘要(running 流光),展开=
|
|
170
|
-
* IN args / OUT result 卡。result!==undefined → ok 态;无参异常路径由
|
|
171
|
-
* stream-store 以空参完成态块兜底。 */
|
|
172
|
-
function FemoToolRow({ name, args, result, t }: {
|
|
173
|
-
name: string | undefined
|
|
174
|
-
args: string
|
|
175
|
-
result: string | undefined
|
|
176
|
-
t: (key: string) => string
|
|
177
|
-
}) {
|
|
178
|
-
const [open, setOpen] = useState(false)
|
|
179
|
-
const toolName = name ?? ''
|
|
180
|
-
const variant: FemoToolVariant = FEMO_TOOL_VARIANTS[toolName] ?? 'others'
|
|
181
|
-
const running = result === undefined
|
|
182
|
-
const base = femoToolDeriveSummary(variant, args)
|
|
183
|
-
// others 变体把真实工具名放进摘要槽(官方原逻辑);参数未到流时以工具名
|
|
184
|
-
// 单独占位(官方此态是 callId,桶里无 callId → 退化工具名)。
|
|
185
|
-
const summary = variant === 'others' && toolName !== ''
|
|
186
|
-
? (base === '' ? toolName : `${toolName} · ${base}`)
|
|
187
|
-
: base
|
|
188
|
-
const body = femoToolDeriveBody(variant, args)
|
|
189
|
-
const output = result !== undefined && result !== '' ? result : null
|
|
190
|
-
const expandable = body !== null || output !== null
|
|
191
|
-
return (
|
|
192
|
-
<div className="femo-toolrow" data-variant={variant} data-tool={toolName} data-state={running ? 'running' : 'ok'}>
|
|
193
|
-
{running && <span className="femo-toolrow-sr">{t('row.running')}</span>}
|
|
194
|
-
<DisclosureRow
|
|
195
|
-
rowClassName="femo-toolrow-row"
|
|
196
|
-
leadingClassName="femo-toolrow-leading"
|
|
197
|
-
titleClassName="femo-toolrow-title"
|
|
198
|
-
chevronClassName="femo-toolrow-chevron"
|
|
199
|
-
icon={FEMO_TOOL_VARIANT_ICONS[variant]}
|
|
200
|
-
title={FEMO_TOOL_VARIANT_TITLES[variant]}
|
|
201
|
-
open={open && expandable}
|
|
202
|
-
expandable={expandable}
|
|
203
|
-
expandOnRowClick
|
|
204
|
-
keepContentWhenOpen
|
|
205
|
-
onToggle={() => { setOpen(v => !v) }}
|
|
206
|
-
collapsedContent={summary !== '' && (
|
|
207
|
-
<>
|
|
208
|
-
<span className="femo-toolrow-sep" aria-hidden />
|
|
209
|
-
<span className="femo-toolrow-summary">{summary}</span>
|
|
210
|
-
</>
|
|
211
|
-
)}
|
|
212
|
-
>
|
|
213
|
-
<div className="femo-toolrow-bodywrap">
|
|
214
|
-
{(body !== null || output !== null) && (
|
|
215
|
-
<div className="femo-toolrow-iocard">
|
|
216
|
-
{body !== null && (
|
|
217
|
-
<div className="femo-toolrow-iosection">
|
|
218
|
-
<span className="femo-toolrow-iolabel">IN</span>
|
|
219
|
-
<span className="femo-toolrow-iotext">{body}</span>
|
|
220
|
-
</div>
|
|
221
|
-
)}
|
|
222
|
-
{body !== null && output !== null && <span className="femo-toolrow-iodivider" aria-hidden />}
|
|
223
|
-
{output !== null && (
|
|
224
|
-
<div className="femo-toolrow-iosection">
|
|
225
|
-
<span className="femo-toolrow-iolabel">OUT</span>
|
|
226
|
-
<span className="femo-toolrow-iotext">{output}</span>
|
|
227
|
-
</div>
|
|
228
|
-
)}
|
|
229
|
-
</div>
|
|
230
|
-
)}
|
|
231
|
-
</div>
|
|
232
|
-
</DisclosureRow>
|
|
233
|
-
</div>
|
|
234
|
-
)
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
export function FemoStreamLive({ blocks, t }: { blocks: readonly FemoStreamBlock[]; t: unknown }) {
|
|
238
|
-
const safeT = typeof t === 'function' ? (t as (key: string) => string) : (key: string): string => key
|
|
239
|
-
const codeLabels = useMemo(() => ({ copyLabel: safeT('copy'), copiedLabel: safeT('copied') }), [safeT])
|
|
240
|
-
return (
|
|
241
|
-
<div className="femo-stream-root">
|
|
242
|
-
{blocks.map((block, i) => block.kind === 'reasoning'
|
|
243
|
-
? (
|
|
244
|
-
<FemoReasoningRow
|
|
245
|
-
key={i}
|
|
246
|
-
text={block.text}
|
|
247
|
-
running={i === blocks.length - 1}
|
|
248
|
-
runningLabel={safeT('row.running')}
|
|
249
|
-
/>
|
|
250
|
-
)
|
|
251
|
-
: block.kind === 'toolcall'
|
|
252
|
-
? (
|
|
253
|
-
<FemoToolRow
|
|
254
|
-
key={i}
|
|
255
|
-
name={block.name}
|
|
256
|
-
args={block.text}
|
|
257
|
-
result={block.result}
|
|
258
|
-
t={safeT}
|
|
259
|
-
/>
|
|
260
|
-
)
|
|
261
|
-
: <MarkdownText key={i} text={block.text} streaming codeLabels={codeLabels} />)}
|
|
262
|
-
</div>
|
|
263
|
-
)
|
|
264
|
-
}
|