femo-plugin 1.0.0 → 1.0.2
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/FEMO_logo.svg +55 -0
- package/FEMO_logo_slogan.svg +29 -0
- package/README.md +10 -2
- package/_tmp/fallback/driver2.py +176 -0
- package/_tmp/fallback/events.jsonl +108 -0
- package/_tmp/fallback/gateway_ui.py +325 -0
- package/_tmp/fallback/outbox/j1553_human_[/347/234/213/347/211/214]_1.done +1 -0
- package/_tmp/fallback/outbox/r1.done +1 -0
- package/_tmp/fallback/outbox/r2.done +1 -0
- package/_tmp/fallback/outbox/r3.done +1 -0
- package/_tmp/fallback/outbox/r4.done +1 -0
- package/_tmp/fallback/outbox/r5.done +1 -0
- 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 +3 -2
- package/hostAdapter/dshAdapter/client/client-ui/composer.tsx +112 -9
- package/hostAdapter/dshAdapter/client/client-ui/styles.ts +17 -0
- package/hostAdapter/dshAdapter/client/fa-icons.tsx +3 -0
- package/hostAdapter/dshAdapter/host/engine-events.ts +4 -1
- package/hostAdapter/dshAdapter/host/index.ts +5 -0
- package/hostAdapter/dshAdapter/host/preset-install.ts +59 -0
- package/hostAdapter/dshAdapter/host/projection-input.ts +14 -6
- package/hostAdapter/dshAdapter/lib/client.js +124 -5
- package/hostAdapter/dshAdapter/lib/client.js.map +3 -3
- package/hostAdapter/dshAdapter/lib/index.js +58 -18
- package/hostAdapter/dshAdapter/lib/index.js.map +4 -4
- package/hostAdapter/dshAdapter/package.json +1 -5
- package/hostAdapter/dshAdapter/preset/agent.cordis.yml +220 -0
- package/hostAdapter/dshAdapter/preset/preset.yml +3 -0
- package/hostAdapter/zcodeAdapter/.tmp/femo/host-history/gateway.port +1 -0
- package/hostAdapter/zcodeAdapter/.tmp/femo/host-history/proj-mirror/femo-main-a-_40_52a9_624b.jsonl +3 -0
- package/hostAdapter/zcodeAdapter/.tmp/femo/host-history/proj-mirror/femo-main-a-_40_6211.jsonl +10 -0
- package/hostAdapter/zcodeAdapter/.tmp/femo/host-history/proj-mirror/femo-main-god.jsonl +11 -0
- package/hostAdapter/zcodeAdapter/.tmp/femo/host-history/proj-mirror/femo-main-stage.jsonl +11 -0
- package/hostAdapter/zcodeAdapter/.zcode-plugin/plugin.json +23 -0
- package/hostAdapter/zcodeAdapter/README.md +61 -0
- package/hostAdapter/zcodeAdapter/commands/femo.md +9 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/.zcode-plugin/plugin.json +23 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/LICENSE +201 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/README.md +635 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/commands/femo.md +9 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femo2host/__init__.py +4 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femo2host/femoToolcall/chronica.py +156 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femo2host/femoToolcall/femo-chat.mjs +69 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femo2host/femoToolcall/femo_debugger.py +1515 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femo2host/femo_api.py +437 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femo2host/femo_gen_api.jsx +77 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoBridges/ContextExample.py +555 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoBridges/MemoryExample.py +163 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoBridges/__init__.py +1 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoBridges/getDir/get_dir.py +56 -0
- 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 +10 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoBridges/llmBridge.py +247 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoBridges/llmProviders.py +308 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/FEMO_CLIrenderer.py +198 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/FEMO_config.py +35 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/FEMO_errors.py +278 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/FEMO_interpreter.py +163 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/FEMO_normalizer.py +396 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/FEMO_parser.py +2468 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/FEMO_runtime.py +3630 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/FEMO_scope_resolver.py +209 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/__init__.py +1 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/actor_resolver.py +86 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/block_collector.py +441 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/db_utils.py +485 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/femoAsync.py +401 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/host_manifest.py +68 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/job_manager.py +767 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/protocol.py +126 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/save_dialog.py +402 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/task_world.py +544 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/vars/__init__.py +19 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/vars/checkpoint.py +113 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/vars/env.py +686 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/vars/evaluator.py +567 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/vars/join.py +303 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/vars/merge.py +157 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/vars/model.py +245 -0
- 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 +192 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoExamples/AI/350/201/212/345/244/251/345/256/244/group-chat.femo +42 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoExamples/AI/350/201/212/345/244/251/345/256/244/random_wait_time.py +10 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoExamples/LuxFiat/luxfiat.femo +38 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoExamples/LuxFiat/wait.py +29 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoExamples/debug/347/245/236/345/231/250/debug/347/245/236/345/231/250.femo +222 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoExamples/discussion.femo +70 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoExamples/goal-mode.femo +23 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoExamples//345/270/270/347/224/250/345/267/245/345/205/267python/wait.py +29 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoExamples//347/213/274/344/272/272/346/235/200/werewolf_utils.py +205 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoExamples//347/213/274/344/272/272/346/235/200/werewolf_utils2.py +324 -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 +544 -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.femo +331 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoExamples//350/260/201/346/230/257/345/215/247/345/272/225/undercover_utils.py +683 -0
- 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 +348 -0
- 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 +393 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/hooks/after-tool.mjs +3 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/hooks/hooks.json +16 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/hooks/lib.mjs +59 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/hooks/prompt-state.mjs +3 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/hooks/session-start.mjs +3 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/hooks/stop-intent.mjs +3 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/hostAdapter/dshAdapter/python/dev-bridge-test.py +43 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/hostAdapter/dshAdapter/python/femo_bridge.py +533 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/mcp/bridge-manager.mjs +192 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/mcp/event-router.mjs +258 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/mcp/femo-server.mjs +429 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/mcp/gateway.mjs +163 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/mcp/projection-writer.mjs +294 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/skills/femo/SKILL.md +93 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/tests/bridge-smoke.mjs +26 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/tests/event-router.test.mjs +157 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/tests/gateway-smoke.mjs +107 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/tests/integration-human.mjs +111 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/tests/main-actor.mjs +107 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/tests/mcp-smoke.mjs +130 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/tests/projection-writer.test.mjs +144 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/zcode.host.manifest.json +5 -0
- 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 +113 -0
- package/hostAdapter/zcodeAdapter/femo-zcode-dist//350/257/255/346/263/225/346/226/207/346/241/243.md +1136 -0
- package/hostAdapter/zcodeAdapter/hooks/after-tool.mjs +3 -0
- package/hostAdapter/zcodeAdapter/hooks/hooks.json +16 -0
- package/hostAdapter/zcodeAdapter/hooks/lib.mjs +59 -0
- package/hostAdapter/zcodeAdapter/hooks/prompt-state.mjs +3 -0
- package/hostAdapter/zcodeAdapter/hooks/session-start.mjs +3 -0
- package/hostAdapter/zcodeAdapter/hooks/stop-intent.mjs +3 -0
- package/hostAdapter/zcodeAdapter/mcp/bridge-manager.mjs +192 -0
- package/hostAdapter/zcodeAdapter/mcp/event-router.mjs +258 -0
- package/hostAdapter/zcodeAdapter/mcp/femo-server.mjs +429 -0
- package/hostAdapter/zcodeAdapter/mcp/gateway.mjs +163 -0
- package/hostAdapter/zcodeAdapter/mcp/projection-writer.mjs +294 -0
- package/hostAdapter/zcodeAdapter/skills/femo/SKILL.md +93 -0
- package/hostAdapter/zcodeAdapter/tests/bridge-smoke.mjs +26 -0
- package/hostAdapter/zcodeAdapter/tests/event-router.test.mjs +157 -0
- package/hostAdapter/zcodeAdapter/tests/gateway-smoke.mjs +107 -0
- package/hostAdapter/zcodeAdapter/tests/integration-human.mjs +111 -0
- package/hostAdapter/zcodeAdapter/tests/main-actor.mjs +107 -0
- package/hostAdapter/zcodeAdapter/tests/mcp-smoke.mjs +130 -0
- package/hostAdapter/zcodeAdapter/tests/projection-writer.test.mjs +144 -0
- package/hostAdapter/zcodeAdapter/zcode.host.manifest.json +5 -0
- 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 +113 -0
- package/package.json +1 -1
- package/scripts/diag-find-redblue.mjs +38 -0
- package/scripts/diag-god-log.mjs +31 -0
- package/scripts/diag-god-log2.mjs +39 -0
- package/scripts/diag-god-log3.mjs +35 -0
- package/scripts/diag-god-log4.mjs +59 -0
- package/scripts/diag-god-log4b.mjs +39 -0
- package/scripts/diag-redblue-god.mjs +39 -0
- package/scripts/diag-redblue-log.mjs +37 -0
- package/scripts/diag-redblue-span.mjs +41 -0
- package/scripts/diag-stage-1017.mjs +63 -0
- package/scripts/dump_session.py +36 -0
- package/scripts/link-workspace.ps1 +51 -0
- package/scripts/list_souls.py +18 -0
- package/scripts/probe-composer-refresh.mjs +197 -0
- package/scripts/seed_story_souls.py +86 -0
- package/scripts/sync-zcode-dist.ps1 +55 -0
- package/scripts/theme-tokenize/color-extract.txt +288 -0
- package/scripts/theme-tokenize/round1-quoted.ps1 +149 -0
- package/scripts/theme-tokenize/round2-bare.ps1 +138 -0
- package/scripts/theme-tokenize/round3-shape.ps1 +110 -0
- package/tests/_diag_r4_join.femo +32 -0
- package/tests/conftest.py +95 -0
- package/tests/diag-subagent-dir-3081.mjs +101 -0
- package/tests/femoGenerator.test.mjs +3909 -0
- package/tests/femoParser.test.mjs +4813 -0
- package/tests/femogen_notice.test.mjs +109 -0
- package/tests/femoparser_validation.test.mjs +84 -0
- package/tests/main-delivery-queue.test.mjs +329 -0
- package/tests/pre-step-gate.test.mjs +282 -0
- package/tests/read-subagent-model.mjs +24 -0
- package/tests/run-script-tests.py +97 -0
- package/tests/safe-steer.test.mjs +59 -0
- package/tests/strip_comments.test.mjs +164 -0
- package/tests/test_actor_failed.py +92 -0
- package/tests/test_compile_warnings.py +99 -0
- package/tests/test_debug_log_bus.py +108 -0
- package/tests/test_debugger_module_mode.py +141 -0
- package/tests/test_error_buckets.py +117 -0
- package/tests/test_error_dispatcher.py +261 -0
- package/tests/test_exec_ai_retry.py +155 -0
- package/tests/test_exec_human_retry.py +159 -0
- package/tests/test_file_resolve.py +104 -0
- package/tests/test_flow_events.py +311 -0
- package/tests/test_flow_ref_validation.py +92 -0
- package/tests/test_func_dict_fallback.py +39 -0
- package/tests/test_job_lifecycle.py +236 -0
- package/tests/test_job_manager.py +424 -0
- package/tests/test_mind.py +99 -0
- package/tests/test_module_call_args.py +258 -0
- package/tests/test_module_visibility.py +238 -0
- package/tests/test_notice.py +143 -0
- package/tests/test_out_whitelist.py +83 -0
- package/tests/test_par_if_dispatch.py +64 -0
- package/tests/test_par_nested_for.py +78 -0
- package/tests/test_parser.py +494 -0
- package/tests/test_pause.py +102 -0
- package/tests/test_pause_contract.py +135 -0
- package/tests/test_protocol_transcript.py +158 -0
- package/tests/test_scope_self.py +202 -0
- package/tests/test_source_validate.py +113 -0
- package/tests/test_task_world.py +447 -0
- package/tests/test_town_structure.py +70 -0
- package/tests/test_v2_checkpoint.py +115 -0
- package/tests/test_v2_env.py +383 -0
- package/tests/test_v2_evaluator.py +227 -0
- package/tests/test_v2_join.py +315 -0
- package/tests/test_v2_join_wiring.py +429 -0
- package/tests/test_v2_merge.py +167 -0
- package/tests/test_v2_model.py +143 -0
- package/tests/test_v2_resume_e2e.py +472 -0
- package/tests/test_var_decls.py +271 -0
- package/tests/verify-model-functions.mjs +90 -0
- package/tests/verify-subagent-model-3081.mjs +153 -0
- 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 +395 -0
- 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 +66 -0
- 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 +475 -0
- 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 +847 -0
- 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 +654 -0
- 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 +471 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* preset-install.ts — 把随插件打包的 FEMO preset 安装到 dsh home。
|
|
3
|
+
*
|
|
4
|
+
* 「FEMO模式」出现在 dsh 的模式菜单里,前提是 <dsh-home>/.agent-presets/
|
|
5
|
+
* femo-plugin/ 存在(dsh 只发现内置 preset + 用户目录 preset)。历史上一份
|
|
6
|
+
* 手拷的 preset 活在开发者自己的 dsh-home 里,普通用户装完插件菜单里没有
|
|
7
|
+
* FEMO模式(GitHub issue #1,2026-09-15)。现在 preset 随插件发布
|
|
8
|
+
* (preset/agent.cordis.yml + preset.yml,dshAdapter 目录内,整仓打包必带),
|
|
9
|
+
* apply() 时镜像到 dsh home:内容一致则跳过,不一致则覆盖——插件是 preset
|
|
10
|
+
* 的唯一权威来源,手改 dsh-home 里的文件会在下次启动被插件版覆盖。
|
|
11
|
+
*
|
|
12
|
+
* dsh home 解析与 @deepseek-ai/dsh-home-paths 同款:$DSH_HOME → ~/.dsh。
|
|
13
|
+
* 本模块不 import 该包(插件 devDependencies 里没有它,运行时以内部实现
|
|
14
|
+
* 保持同语义)。
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { copyFileSync, existsSync, mkdirSync, readFileSync } from 'node:fs'
|
|
18
|
+
import { homedir } from 'node:os'
|
|
19
|
+
import { join } from 'node:path'
|
|
20
|
+
import { fileURLToPath } from 'node:url'
|
|
21
|
+
|
|
22
|
+
const PRESET_NAME = 'femo-plugin'
|
|
23
|
+
const PRESET_FILES = ['preset.yml', 'agent.cordis.yml'] as const
|
|
24
|
+
|
|
25
|
+
/** dsh home 根目录(与 dsh-home-paths 的优先级一致:$DSH_HOME → ~/.dsh)。 */
|
|
26
|
+
function dshHome(): string {
|
|
27
|
+
const fromEnv = process.env.DSH_HOME?.trim()
|
|
28
|
+
return fromEnv || join(homedir(), '.dsh')
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* 安装(镜像)FEMO preset 到 dsh home。返回给 apply() 的日志用一句话:
|
|
33
|
+
* 'installed'(首次落盘)/ 'updated'(内容有差异,已覆盖)/ 'up-to-date'。
|
|
34
|
+
* 单文件读写失败只跳过该文件并返回错误摘要,不阻断插件加载。
|
|
35
|
+
*/
|
|
36
|
+
export function installFemoPreset(): 'installed' | 'updated' | 'up-to-date' | string {
|
|
37
|
+
const bundledDir = fileURLToPath(new URL('../preset/', import.meta.url))
|
|
38
|
+
const targetDir = join(dshHome(), '.agent-presets', PRESET_NAME)
|
|
39
|
+
let result: 'installed' | 'updated' | 'up-to-date' = 'up-to-date'
|
|
40
|
+
const errors: string[] = []
|
|
41
|
+
|
|
42
|
+
const existed = existsSync(join(targetDir, 'preset.yml'))
|
|
43
|
+
for (const file of PRESET_FILES) {
|
|
44
|
+
try {
|
|
45
|
+
const source = join(bundledDir, file)
|
|
46
|
+
const target = join(targetDir, file)
|
|
47
|
+
const same = existsSync(target) &&
|
|
48
|
+
readFileSync(target, 'utf8') === readFileSync(source, 'utf8')
|
|
49
|
+
if (same) continue
|
|
50
|
+
mkdirSync(targetDir, { recursive: true })
|
|
51
|
+
copyFileSync(source, target)
|
|
52
|
+
if (result === 'up-to-date') result = existed ? 'updated' : 'installed'
|
|
53
|
+
} catch (error) {
|
|
54
|
+
errors.push(`${file}: ${String(error)}`)
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
if (errors.length > 0) return `${result} with errors (${errors.join('; ')})`
|
|
58
|
+
return result
|
|
59
|
+
}
|
|
@@ -66,9 +66,16 @@ export async function handleProjectionInput(
|
|
|
66
66
|
const raw = await readBody(req) as Record<string, unknown>
|
|
67
67
|
const sessionId = typeof raw.sessionId === 'string' && raw.sessionId.trim().length > 0 ? raw.sessionId : ''
|
|
68
68
|
const text = typeof raw.text === 'string' && raw.text.trim().length > 0 ? raw.text.trim() : ''
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
69
|
+
// 变量赋值浮层(2026-09-14):人类节点 out 的结构化赋值,绕过引擎侧
|
|
70
|
+
// chat_text 文本解析(人类指令跟随差的根治)。只收非空字符串值。
|
|
71
|
+
const rawVars = typeof raw.variables === 'object' && raw.variables !== null ? raw.variables as Record<string, unknown> : {}
|
|
72
|
+
const variables: Record<string, string> = {}
|
|
73
|
+
for (const [key, value] of Object.entries(rawVars)) {
|
|
74
|
+
if (typeof value === 'string' && value.trim().length > 0) variables[key] = value.trim()
|
|
75
|
+
}
|
|
76
|
+
debugLog(`payload: sessionId=${sessionId} textLen=${text.length} variables=${JSON.stringify(variables)}`)
|
|
77
|
+
if (sessionId.length === 0 || (text.length === 0 && Object.keys(variables).length === 0)) {
|
|
78
|
+
writeJson(res, 400, { ok: false, error: 'sessionId and text (or variables) are required' })
|
|
72
79
|
return
|
|
73
80
|
}
|
|
74
81
|
const sessions = ctx.get('sessions') as { get(id: SessionId): Session | undefined } | undefined
|
|
@@ -191,7 +198,7 @@ export async function handleProjectionInput(
|
|
|
191
198
|
// 【UI 同日拍板】本窗不再写 user/message 留痕——role 行(全窗广播、渲染
|
|
192
199
|
// 为 dsh user 气泡样式)就是人类发言的唯一显示面,避免发言窗同一段话
|
|
193
200
|
// 双份(user/message 气泡 + role 行)。
|
|
194
|
-
await feedHumanNode(ctx, deps, mainSid, job!, text, debugLog)
|
|
201
|
+
await feedHumanNode(ctx, deps, mainSid, job!, text, variables, debugLog)
|
|
195
202
|
writeJson(res, 200, { ok: true, routed: 'human-node' })
|
|
196
203
|
return
|
|
197
204
|
}
|
|
@@ -218,15 +225,16 @@ async function feedHumanNode(
|
|
|
218
225
|
mainSid: string,
|
|
219
226
|
job: JobMirror,
|
|
220
227
|
text: string,
|
|
228
|
+
variables: Record<string, string>,
|
|
221
229
|
debugLog: (line: string) => void,
|
|
222
230
|
): Promise<boolean> {
|
|
223
231
|
const { bridge, projections, sessionsStore } = deps
|
|
224
232
|
const waitKeyUsed = String(job.waitingHuman?.waitKey ?? '')
|
|
225
|
-
debugLog(`branch② feeding: job=${String(job.jobId)} wait_key=${waitKeyUsed} len=${text.length}`)
|
|
233
|
+
debugLog(`branch② feeding: job=${String(job.jobId)} wait_key=${waitKeyUsed} len=${text.length} vars=${JSON.stringify(variables)}`)
|
|
226
234
|
const feedResult = await bridge.send('human_input', {
|
|
227
235
|
job_id: job.jobId,
|
|
228
236
|
wait_key: waitKeyUsed,
|
|
229
|
-
body: { chat_text: text, variables
|
|
237
|
+
body: { chat_text: text, variables },
|
|
230
238
|
}) as { delivered?: boolean } | undefined
|
|
231
239
|
debugLog(`branch② feed result: ${JSON.stringify(feedResult)}`)
|
|
232
240
|
pushDiag('proj-input', `branch② human_input delivered job=${String(job.jobId)} wait_key=${waitKeyUsed} → ${JSON.stringify(feedResult)}`)
|
|
@@ -1158,6 +1158,23 @@ var FEMO_COMPOSER_CSS = `
|
|
|
1158
1158
|
.femo-comp-meter-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:2px 0}
|
|
1159
1159
|
.femo-comp-meter-row dt{color:var(--dsw-alias-label-secondary)}
|
|
1160
1160
|
.femo-comp-meter-row dd{margin:0;font-variant-numeric:tabular-nums;color:var(--dsw-alias-label-primary)}
|
|
1161
|
+
/* \u53D8\u91CF\u8D4B\u503C\u6D6E\u5C42\uFF082026-09-14\uFF09\uFF1A\u7B49\u5F85\u4EBA\u7C7B\u8282\u70B9\u4E14\u8282\u70B9\u58F0\u660E out \u65F6\uFF0C\u8F93\u5165\u6846\u4E0A\u65B9\u7684
|
|
1162
|
+
fa-code \u5C0F\u6309\u94AE + \u5411\u4E0A\u5F39\u51FA\u7684\u300C\u53D8\u91CF\u540D = \u8F93\u5165\u6846\u300D\u5217\u8868\uFF1B\u786E\u8BA4\u94AE=FaCircleCheck\u3002 */
|
|
1163
|
+
.femo-comp-var-bar{position:relative;display:flex;padding:0 8px;align-items:center}
|
|
1164
|
+
.femo-comp-var-trigger{display:inline-flex;align-items:center;gap:5px;height:24px;padding:0 8px;border:none;border-radius:12px;outline:none;background:transparent;color:var(--dsw-alias-label-secondary);font-size:12px;line-height:16px;font-family:inherit;cursor:pointer}
|
|
1165
|
+
.femo-comp-var-trigger:hover{background:var(--dsw-alias-interactive-bg-hover)}
|
|
1166
|
+
.femo-comp-var-trigger:focus-visible{box-shadow:0 0 0 2px var(--dsw-alias-border-l3)}
|
|
1167
|
+
.femo-comp-var-trigger[data-open='true']{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}
|
|
1168
|
+
.femo-comp-var-panel{position:absolute;bottom:calc(100% + 6px);left:8px;z-index:100;box-sizing:border-box;min-width:260px;max-width:min(420px,calc(100% - 16px));padding:10px 12px 12px;border:1px solid var(--dsw-alias-border-inverted);border-radius:12px;background:var(--dsw-specific-menu);box-shadow:var(--dsw-shadow-lv3);font-size:13px;line-height:20px;color:var(--dsw-alias-label-secondary);cursor:default}
|
|
1169
|
+
.femo-comp-var-head{margin-bottom:8px;font-weight:500;color:var(--dsw-alias-label-primary)}
|
|
1170
|
+
.femo-comp-var-row{display:flex;align-items:center;gap:8px;padding:3px 0}
|
|
1171
|
+
.femo-comp-var-name{max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--dsw-font-mono,ui-monospace,monospace);color:var(--dsw-alias-label-primary)}
|
|
1172
|
+
.femo-comp-var-eq{flex:none;color:var(--dsw-alias-label-tertiary)}
|
|
1173
|
+
.femo-comp-var-input{flex:1 1 auto;min-width:0;box-sizing:border-box;height:28px;padding:0 8px;border:1px solid var(--dsw-alias-border-l2-darkmode-thin);border-radius:8px;outline:none;background:var(--dsw-specific-input-major);color:var(--dsw-alias-label-primary);font-size:13px;line-height:20px;font-family:inherit}
|
|
1174
|
+
.femo-comp-var-input:focus{border-color:var(--dsw-alias-state-business-primary)}
|
|
1175
|
+
.femo-comp-var-confirm{display:inline-flex;align-items:center;gap:5px;margin-top:10px;height:28px;padding:0 12px;border:none;border-radius:999px;outline:none;background:var(--dsw-alias-button-info-fill,#3964FE);color:#fff;font-size:12px;line-height:16px;font-weight:500;font-family:inherit;cursor:pointer;transition:background-color 100ms ease}
|
|
1176
|
+
.femo-comp-var-confirm:hover{background:var(--dsw-alias-button-info-hover)}
|
|
1177
|
+
.femo-comp-var-confirm:disabled{opacity:.4;cursor:default}
|
|
1161
1178
|
`;
|
|
1162
1179
|
function ensureFemoStreamStyles() {
|
|
1163
1180
|
if (document.getElementById("femo-stream-style") !== null) return;
|
|
@@ -1280,6 +1297,7 @@ var FaTriangleExclamation = make("0 0 512 512", "M256 32c14.2 0 27.3 7.5 34.5 19
|
|
|
1280
1297
|
var FaMasksTheater = make("0 0 640 512", "M74.6 373.2c41.7 36.1 108 82.5 166.1 73.7c6.1-.9 12.1-2.5 18-4.5c-9.2-12.3-17.3-24.4-24.2-35.4c-21.9-35-28.8-75.2-25.9-113.6c-20.6 4.1-39.2 13-54.7 25.4c-6.5 5.2-16.3 1.3-14.8-7c6.4-33.5 33-60.9 68.2-66.3c2.6-.4 5.3-.7 7.9-.8l19.4-131.3c2-13.8 8-32.7 25-45.9C278.2 53.2 310.5 37 363.2 32.2c-.8-.7-1.6-1.4-2.4-2.1C340.6 14.5 288.4-11.5 175.7 5.6S20.5 63 5.7 83.9C0 91.9-.8 102 .6 111.8L24.8 276.1c5.5 37.3 21.5 72.6 49.8 97.2zm87.7-219.6c4.4-3.1 10.8-2 11.8 3.3c.1 .5 .2 1.1 .3 1.6c3.2 21.8-11.6 42-33.1 45.3s-41.5-11.8-44.7-33.5c-.1-.5-.1-1.1-.2-1.6c-.6-5.4 5.2-8.4 10.3-6.7c9 3 18.8 3.9 28.7 2.4s19.1-5.3 26.8-10.8zM261.6 390c29.4 46.9 79.5 110.9 137.6 119.7s124.5-37.5 166.1-73.7c28.3-24.5 44.3-59.8 49.8-97.2l24.2-164.3c1.4-9.8 .6-19.9-5.1-27.9c-14.8-20.9-57.3-61.2-170-78.3S299.4 77.2 279.2 92.8c-7.8 6-11.5 15.4-12.9 25.2L242.1 282.3c-5.5 37.3-.4 75.8 19.6 107.7zM404.5 235.3c-7.7-5.5-16.8-9.3-26.8-10.8s-19.8-.6-28.7 2.4c-5.1 1.7-10.9-1.3-10.3-6.7c.1-.5 .1-1.1 .2-1.6c3.2-21.8 23.2-36.8 44.7-33.5s36.3 23.5 33.1 45.3c-.1 .5-.2 1.1-.3 1.6c-1 5.3-7.4 6.4-11.8 3.3zm136.2 15.5c-1 5.3-7.4 6.4-11.8 3.3c-7.7-5.5-16.8-9.3-26.8-10.8s-19.8-.6-28.7 2.4c-5.1 1.7-10.9-1.3-10.3-6.7c.1-.5 .1-1.1 .2-1.6c3.2-21.8 23.2-36.8 44.7-33.5s36.3 23.5 33.1 45.3c-.1 .5-.2 1.1-.3 1.6zM530 350.2c-19.6 44.7-66.8 72.5-116.8 64.9s-87.1-48.2-93-96.7c-1-8.3 8.9-12.1 15.2-6.7c23.9 20.8 53.6 35.3 87 40.3s66.1 .1 94.9-12.8c7.6-3.4 16 3.2 12.6 10.9z");
|
|
1281
1298
|
var FaBullhorn = make("0 0 512 512", "M480 32c0-12.9-7.8-24.6-19.8-29.6s-25.7-2.2-34.9 6.9L381.7 53c-48 48-113.1 75-181 75H192 160 64c-35.3 0-64 28.7-64 64v96c0 35.3 28.7 64 64 64l0 128c0 17.7 14.3 32 32 32h64c17.7 0 32-14.3 32-32V352l8.7 0c67.9 0 133 27 181 75l43.6 43.6c9.2 9.2 22.9 11.9 34.9 6.9s19.8-16.6 19.8-29.6V300.4c18.6-8.8 32-32.5 32-60.4s-13.4-51.6-32-60.4V32zm-64 76.7V240 371.3C357.2 317.8 280.5 288 200.7 288H192V192h8.7c79.8 0 156.5-29.8 215.3-83.3z");
|
|
1282
1299
|
var FaWrench = make("0 0 512 512", "M352 320c88.4 0 160-71.6 160-160c0-15.3-2.2-30.1-6.2-44.2c-3.1-10.8-16.4-13.2-24.3-5.3l-76.8 76.8c-3 3-7.1 4.7-11.3 4.7H336c-8.8 0-16-7.2-16-16V118.6c0-4.2 1.7-8.3 4.7-11.3l76.8-76.8c7.9-7.9 5.4-21.2-5.3-24.3C382.1 2.2 367.3 0 352 0C263.6 0 192 71.6 192 160c0 19.1 3.4 37.5 9.5 54.5L19.9 396.1C7.2 408.8 0 426.1 0 444.1C0 481.6 30.4 512 67.9 512c18 0 35.3-7.2 48-19.9L297.5 310.5c17 6.2 35.4 9.5 54.5 9.5zM80 408a24 24 0 1 1 0 48 24 24 0 1 1 0-48z");
|
|
1300
|
+
var FaCode = make("0 0 640 512", "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");
|
|
1283
1301
|
|
|
1284
1302
|
// client/client-ui/chat-node.tsx
|
|
1285
1303
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
@@ -18563,7 +18581,7 @@ function PermissionMenu({ face, disabled }) {
|
|
|
18563
18581
|
)
|
|
18564
18582
|
] });
|
|
18565
18583
|
}
|
|
18566
|
-
var IDLE_RUN_STATE = { running: false, waiting: false, waitScope: [] };
|
|
18584
|
+
var IDLE_RUN_STATE = { running: false, waiting: false, waitScope: [], outVars: [] };
|
|
18567
18585
|
function composerButtonState(args) {
|
|
18568
18586
|
const { winKind, actor, run, mainRunning } = args;
|
|
18569
18587
|
if (winKind === "god") {
|
|
@@ -18616,6 +18634,7 @@ function ProjectionComposer({ useSession, useSessions, getSessionFace }) {
|
|
|
18616
18634
|
running: data.running === true,
|
|
18617
18635
|
waiting: data.waiting === true,
|
|
18618
18636
|
waitScope: Array.isArray(data.waitScope) ? data.waitScope : [],
|
|
18637
|
+
outVars: Array.isArray(data.outVars) ? data.outVars : [],
|
|
18619
18638
|
prompt: typeof data.prompt === "string" ? data.prompt : void 0
|
|
18620
18639
|
});
|
|
18621
18640
|
}
|
|
@@ -18660,19 +18679,61 @@ function ProjectionComposer({ useSession, useSessions, getSessionFace }) {
|
|
|
18660
18679
|
running: data.running === true,
|
|
18661
18680
|
waiting: data.waiting === true,
|
|
18662
18681
|
waitScope: Array.isArray(data.waitScope) ? data.waitScope : [],
|
|
18682
|
+
outVars: Array.isArray(data.outVars) ? data.outVars : [],
|
|
18663
18683
|
prompt: typeof data.prompt === "string" ? data.prompt : void 0
|
|
18664
18684
|
});
|
|
18665
18685
|
});
|
|
18666
18686
|
}, [mainSid]);
|
|
18667
18687
|
const buttonState = composerButtonState({ winKind: winInfo.winKind, actor: winInfo.actor, run, mainRunning });
|
|
18668
|
-
const
|
|
18688
|
+
const [varsOpen, setVarsOpen] = (0, import_react25.useState)(false);
|
|
18689
|
+
const [varValues, setVarValues] = (0, import_react25.useState)({});
|
|
18690
|
+
const varsPanelRef = (0, import_react25.useRef)(null);
|
|
18691
|
+
const outVarsKey = run.outVars.join("\0");
|
|
18692
|
+
(0, import_react25.useEffect)(() => {
|
|
18693
|
+
setVarsOpen(false);
|
|
18694
|
+
setVarValues({});
|
|
18695
|
+
}, [outVarsKey]);
|
|
18696
|
+
(0, import_react25.useEffect)(() => {
|
|
18697
|
+
if (!varsOpen) return;
|
|
18698
|
+
const onPointerDown = (e) => {
|
|
18699
|
+
if (e.target instanceof Node && varsPanelRef.current?.contains(e.target) === true) return;
|
|
18700
|
+
setVarsOpen(false);
|
|
18701
|
+
};
|
|
18702
|
+
const onKeyDown2 = (e) => {
|
|
18703
|
+
if (e.key === "Escape") setVarsOpen(false);
|
|
18704
|
+
};
|
|
18705
|
+
document.addEventListener("pointerdown", onPointerDown);
|
|
18706
|
+
document.addEventListener("keydown", onKeyDown2);
|
|
18707
|
+
return () => {
|
|
18708
|
+
document.removeEventListener("pointerdown", onPointerDown);
|
|
18709
|
+
document.removeEventListener("keydown", onKeyDown2);
|
|
18710
|
+
};
|
|
18711
|
+
}, [varsOpen]);
|
|
18712
|
+
const setVarValue = (name, value) => {
|
|
18713
|
+
setVarValues((prev) => ({ ...prev, [name]: value }));
|
|
18714
|
+
};
|
|
18715
|
+
const confirmVars = () => {
|
|
18716
|
+
const filled = {};
|
|
18717
|
+
for (const name of run.outVars) {
|
|
18718
|
+
const value = varValues[name]?.trim();
|
|
18719
|
+
if (value !== void 0 && value.length > 0) filled[name] = value;
|
|
18720
|
+
}
|
|
18721
|
+
if (Object.keys(filled).length === 0) {
|
|
18722
|
+
setVarsOpen(false);
|
|
18723
|
+
return;
|
|
18724
|
+
}
|
|
18725
|
+
submit(filled);
|
|
18726
|
+
};
|
|
18727
|
+
const showVarUi = buttonState === "send" && run.outVars.length > 0;
|
|
18728
|
+
const submit = (variables = {}) => {
|
|
18669
18729
|
const value = text.trim();
|
|
18670
|
-
|
|
18730
|
+
const hasVars = Object.keys(variables).length > 0;
|
|
18731
|
+
if (value.length === 0 && !hasVars || busy || sessionId === void 0) return;
|
|
18671
18732
|
setBusy(true);
|
|
18672
18733
|
const post = async () => fetch("/femo-plugin/projection-input", {
|
|
18673
18734
|
method: "POST",
|
|
18674
18735
|
headers: { "content-type": "application/json" },
|
|
18675
|
-
body: JSON.stringify({ sessionId, text: value })
|
|
18736
|
+
body: JSON.stringify({ sessionId, text: value, ...hasVars ? { variables } : {} })
|
|
18676
18737
|
});
|
|
18677
18738
|
void (async () => {
|
|
18678
18739
|
try {
|
|
@@ -18688,6 +18749,8 @@ function ProjectionComposer({ useSession, useSessions, getSessionFace }) {
|
|
|
18688
18749
|
}
|
|
18689
18750
|
if (data.ok === true) {
|
|
18690
18751
|
changeText("");
|
|
18752
|
+
setVarsOpen(false);
|
|
18753
|
+
setVarValues({});
|
|
18691
18754
|
return;
|
|
18692
18755
|
}
|
|
18693
18756
|
errorSeqRef.current += 1;
|
|
@@ -18743,6 +18806,60 @@ function ProjectionComposer({ useSession, useSessions, getSessionFace }) {
|
|
|
18743
18806
|
] }) }),
|
|
18744
18807
|
error !== null && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "femo-comp-notice", role: "status", children: error.text }),
|
|
18745
18808
|
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "femo-comp-card", "data-composer-card": "", children: [
|
|
18809
|
+
showVarUi && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "femo-comp-var-bar", children: [
|
|
18810
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
18811
|
+
"button",
|
|
18812
|
+
{
|
|
18813
|
+
type: "button",
|
|
18814
|
+
className: "femo-comp-var-trigger",
|
|
18815
|
+
"aria-label": "\u53D8\u91CF\u8D4B\u503C",
|
|
18816
|
+
"aria-haspopup": "dialog",
|
|
18817
|
+
"aria-expanded": varsOpen,
|
|
18818
|
+
"data-open": varsOpen,
|
|
18819
|
+
onMouseDown: keepFocus,
|
|
18820
|
+
onClick: () => {
|
|
18821
|
+
setVarsOpen(!varsOpen);
|
|
18822
|
+
},
|
|
18823
|
+
children: [
|
|
18824
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FaCode, { size: 12 }),
|
|
18825
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { children: "\u53D8\u91CF\u8D4B\u503C" })
|
|
18826
|
+
]
|
|
18827
|
+
}
|
|
18828
|
+
),
|
|
18829
|
+
varsOpen && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { ref: varsPanelRef, className: "femo-comp-var-panel", role: "dialog", "aria-label": "\u53D8\u91CF\u8D4B\u503C", children: [
|
|
18830
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "femo-comp-var-head", children: "\u672C\u8282\u70B9\u53D8\u91CF\u8D4B\u503C\uFF08\u53EF\u53EA\u586B\u5176\u4E2D\u51E0\u9879\uFF09" }),
|
|
18831
|
+
run.outVars.map((name) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "femo-comp-var-row", children: [
|
|
18832
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "femo-comp-var-name", title: name, children: name }),
|
|
18833
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "femo-comp-var-eq", "aria-hidden": true, children: "=" }),
|
|
18834
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
18835
|
+
"input",
|
|
18836
|
+
{
|
|
18837
|
+
className: "femo-comp-var-input",
|
|
18838
|
+
value: varValues[name] ?? "",
|
|
18839
|
+
placeholder: "\u7559\u7A7A=\u4E0D\u8D4B\u503C",
|
|
18840
|
+
spellCheck: false,
|
|
18841
|
+
onChange: (e) => {
|
|
18842
|
+
setVarValue(name, e.currentTarget.value);
|
|
18843
|
+
}
|
|
18844
|
+
}
|
|
18845
|
+
)
|
|
18846
|
+
] }, name)),
|
|
18847
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
18848
|
+
"button",
|
|
18849
|
+
{
|
|
18850
|
+
type: "button",
|
|
18851
|
+
className: "femo-comp-var-confirm",
|
|
18852
|
+
disabled: busy,
|
|
18853
|
+
onMouseDown: keepFocus,
|
|
18854
|
+
onClick: confirmVars,
|
|
18855
|
+
children: [
|
|
18856
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FaCircleCheck, { size: 13 }),
|
|
18857
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { children: busy ? "\u53D1\u9001\u4E2D" : "\u786E\u8BA4\u8D4B\u503C\u5E76\u53D1\u9001" })
|
|
18858
|
+
]
|
|
18859
|
+
}
|
|
18860
|
+
)
|
|
18861
|
+
] })
|
|
18862
|
+
] }),
|
|
18746
18863
|
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "femo-comp-scroll", "data-input-scroll": "", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "femo-comp-grow", children: [
|
|
18747
18864
|
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { "aria-hidden": true, className: "femo-comp-mirror", "data-input-mirror": "", children: `${text}
|
|
18748
18865
|
` }),
|
|
@@ -18792,7 +18909,9 @@ function ProjectionComposer({ useSession, useSessions, getSessionFace }) {
|
|
|
18792
18909
|
onClick: buttonState === "stop" ? () => {
|
|
18793
18910
|
void mainFace?.cancel?.()?.catch(() => {
|
|
18794
18911
|
});
|
|
18795
|
-
} :
|
|
18912
|
+
} : () => {
|
|
18913
|
+
submit();
|
|
18914
|
+
},
|
|
18796
18915
|
children: buttonState === "stop" ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("svg", { viewBox: "0 0 16 16", width: "16", height: "16", "aria-hidden": true, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("rect", { x: "3", y: "3", width: "10", height: "10", rx: "3", fill: "currentColor" }) }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("svg", { viewBox: "0 0 16 16", width: "16", height: "16", "aria-hidden": true, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("path", { d: "M8.3125 0.980183C8.66767 1.0531 8.97902 1.20418 9.2627 1.43233C9.48724 1.61297 9.73029 1.85793 9.97949 2.10714L14.707 6.83468L13.293 8.24874L9 3.95577V15.0417H7V3.95577L2.70703 8.24874L1.29297 6.83468L6.02051 2.10714C6.26971 1.85793 6.51277 1.61297 6.7373 1.43233C6.97662 1.23986 7.28445 1.04402 7.6875 0.980183C7.8973 0.947006 8.1031 0.95516 8.3125 0.980183Z", fill: "currentColor" }) })
|
|
18797
18916
|
}
|
|
18798
18917
|
)
|