@celljs/ta 4.9.1 → 4.11.0
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.en.md +3 -1
- package/README.md +3 -1
- package/dist/cli.mjs +1753 -75
- package/dist/gateway.mjs +311 -25
- package/dist/pi/CHANGELOG.md +30 -0
- package/dist/pi/dist/bundle/chunks/anthropic-messages-CA3HHOL3.js +6 -0
- package/dist/pi/dist/bundle/chunks/{azure-openai-responses-FSC6BAW3.js → azure-openai-responses-76TWS6DT.js} +1 -1
- package/dist/pi/dist/bundle/chunks/bedrock-converse-stream.js +3 -3
- package/dist/pi/dist/bundle/chunks/chunk-4KSTFUIK.js +19 -0
- package/dist/pi/dist/bundle/chunks/chunk-4UNPP53I.js +55 -0
- package/dist/pi/dist/bundle/chunks/chunk-AUUCDC7R.js +4 -0
- package/dist/pi/dist/bundle/chunks/{chunk-V6KH5QG4.js → chunk-BAC3QPNW.js} +1 -1
- package/dist/pi/dist/bundle/chunks/{chunk-4EYXVSA5.js → chunk-FF6XOTWB.js} +9 -9
- package/dist/pi/dist/bundle/chunks/chunk-FMPAMX2W.js +82 -0
- package/dist/pi/dist/bundle/chunks/chunk-GFUN2N5K.js +2 -0
- package/dist/pi/dist/bundle/chunks/chunk-IEBK4HQA.js +2 -0
- package/dist/pi/dist/bundle/chunks/{chunk-C2WU32PX.js → chunk-IQUU5XIT.js} +1 -1
- package/dist/pi/dist/bundle/chunks/{chunk-EBFHJFEE.js → chunk-LQLJ7CDW.js} +1 -1
- package/dist/pi/dist/bundle/chunks/chunk-MMDXLZVS.js +30 -0
- package/dist/pi/dist/bundle/chunks/{chunk-GN3QYODH.js → chunk-QN4TOIZN.js} +1 -1
- package/dist/pi/dist/bundle/chunks/chunk-RKNK4Y6L.js +2 -0
- package/dist/pi/dist/bundle/chunks/{chunk-B46VJEHW.js → chunk-V7SLUK6A.js} +1 -1
- package/dist/pi/dist/bundle/chunks/chunk-VEJDBY3O.js +1237 -0
- package/dist/pi/dist/bundle/chunks/chunk-VKJQ6CME.js +8 -0
- package/dist/pi/dist/bundle/chunks/{chunk-3TGLJEWK.js → chunk-WL4TUXY7.js} +1 -1
- package/dist/pi/dist/bundle/chunks/{chunk-YZKQS34S.js → chunk-Y55SJART.js} +5 -1
- package/dist/pi/dist/bundle/chunks/{chunk-EOO47QGR.js → chunk-ZBIZYD6W.js} +1 -1
- package/dist/pi/dist/bundle/chunks/chunk-ZG74NES2.js +2 -0
- package/dist/pi/dist/bundle/chunks/chunk-ZGYS4UTC.js +2 -0
- package/dist/pi/dist/bundle/chunks/{cli-MCOUW5WS.js → cli-7RHMDOHL.js} +7 -7
- package/dist/pi/dist/bundle/chunks/{cloudflare-workers-ai-system-one-WLAFJSP6.js → cloudflare-workers-ai-system-one-U4J7D646.js} +1 -1
- package/dist/pi/dist/bundle/chunks/codemode-worker.js +2 -0
- package/dist/pi/dist/bundle/chunks/{easter-egg-3d-WMBNSJ4M.js → easter-egg-3d-GEVPKQF6.js} +1 -1
- package/dist/pi/dist/bundle/chunks/{execute-4CEBORGZ.js → execute-L2EEDV3L.js} +5 -3
- package/dist/pi/dist/bundle/chunks/github-copilot.js +1 -1
- package/dist/pi/dist/bundle/chunks/{google-generative-ai-INGKNW72.js → google-generative-ai-D5B6W47J.js} +1 -1
- package/dist/pi/dist/bundle/chunks/{google-vertex-IBTX6MBF.js → google-vertex-U4H5YDEW.js} +1 -1
- package/dist/pi/dist/bundle/chunks/{llama-cpp-classify-V5U3QKXI.js → llama-cpp-classify-EJXCQRUQ.js} +1 -1
- package/dist/pi/dist/bundle/chunks/{mistral-conversations-S4OWXIXQ.js → mistral-conversations-S277EKLB.js} +1 -1
- package/dist/pi/dist/bundle/chunks/openai-codex-responses-TEQRB65N.js +10 -0
- package/dist/pi/dist/bundle/chunks/{openai-completions-EJNYB6IX.js → openai-completions-HRZOSLBO.js} +3 -3
- package/dist/pi/dist/bundle/chunks/{openai-decisions-IXI34BYG.js → openai-decisions-F66BDLOM.js} +1 -1
- package/dist/pi/dist/bundle/chunks/openai-responses-BAKFWTGE.js +4 -0
- package/dist/pi/dist/bundle/chunks/{openrouter-images-PISKSFMS.js → openrouter-images-VXF5TVIK.js} +1 -1
- package/dist/pi/dist/bundle/chunks/{pi-messages-NORUKF4E.js → pi-messages-UBJKNDRN.js} +1 -1
- package/dist/pi/dist/bundle/chunks/{runtime-FQB7RU7U.js → runtime-J5ZSBGTX.js} +1 -1
- package/dist/pi/dist/bundle/chunks/{typesafe-system-one-CHVC2UUI.js → typesafe-system-one-56TEMIHL.js} +1 -1
- package/dist/pi/dist/bundle/chunks/virtual-modules-KITQRTYM.js +2 -0
- package/dist/pi/dist/bundle/cli-runtime.js +1 -1
- package/dist/pi/dist/bundle/index.js +1 -1
- package/dist/pi/dist/bundle/rpc-entry.js +1 -1
- package/dist/pi/docs/cli.md +14 -1
- package/dist/pi/docs/extensions.md +27 -7
- package/dist/pi/docs/keybindings.md +1 -1
- package/dist/pi/docs/llama-cpp.md +5 -8
- package/dist/pi/docs/models-configuration.md +6 -1
- package/dist/pi/docs/models.md +2 -1
- package/dist/pi/docs/prompt-templates.md +1 -1
- package/dist/pi/docs/providers.md +1 -1
- package/dist/pi/docs/rpc.md +4 -2
- package/dist/pi/docs/sessions.md +7 -1
- package/dist/pi/docs/settings.md +1 -1
- package/dist/pi/docs/tui.md +1 -1
- package/dist/pi/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/dist/pi/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/dist/pi/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/dist/pi/examples/extensions/gondolin/package-lock.json +2 -2
- package/dist/pi/examples/extensions/gondolin/package.json +1 -1
- package/dist/pi/examples/extensions/plan-mode/index.ts +23 -13
- package/dist/pi/examples/extensions/plan-mode/utils.ts +42 -16
- package/dist/pi/examples/extensions/subagent/README.md +14 -11
- package/dist/pi/examples/extensions/subagent/index.ts +392 -171
- package/dist/pi/examples/extensions/with-deps/package-lock.json +2 -2
- package/dist/pi/examples/extensions/with-deps/package.json +1 -1
- package/dist/pi/examples/tsconfig.json +63 -35
- package/dist/pi/package.json +1 -1
- package/dist/pi/packages/ta-agents/extension/index.mjs +185 -140
- package/dist/pi/packages/ta-agents/lib/acp-agent.js +30 -10
- package/dist/pi/packages/ta-agents/lib/agent-bindings.d.ts +2 -0
- package/dist/pi/packages/ta-agents/lib/agent-bindings.js +4 -0
- package/dist/pi/packages/ta-agents/lib/agent-catalog.d.ts +2 -2
- package/dist/pi/packages/ta-agents/lib/agent-catalog.js +4 -4
- package/dist/pi/packages/ta-agents/lib/agent-prompt.d.ts +6 -0
- package/dist/pi/packages/ta-agents/lib/agent-prompt.js +19 -0
- package/dist/pi/packages/ta-agents/lib/agent-session.d.ts +2 -0
- package/dist/pi/packages/ta-agents/lib/agent-session.js +2 -0
- package/dist/pi/packages/ta-agents/lib/agent-streamer.js +7 -0
- package/dist/pi/packages/ta-agents/lib/agent-tool.js +3 -2
- package/dist/pi/packages/ta-agents/lib/extension.js +15 -1
- package/dist/pi/packages/ta-agents/lib/texts.d.ts +4 -0
- package/dist/pi/packages/ta-agents/lib/texts.js +4 -0
- package/dist/pi/packages/ta-agents/package.json +3 -3
- package/dist/pi/packages/ta-bots/extension/index.mjs +31 -253
- package/dist/pi/packages/ta-bots/host/index.mjs +189 -1
- package/dist/pi/packages/ta-bots/lib/bots-protocol.d.ts +2 -0
- package/dist/pi/packages/ta-bots/lib/bots-protocol.js +3 -1
- package/dist/pi/packages/ta-bots/lib/bots-view.js +24 -12
- package/dist/pi/packages/ta-bots/lib/composer.js +1 -0
- package/dist/pi/packages/ta-bots/lib/extension.js +10 -17
- package/dist/pi/packages/ta-bots/lib/i18n.d.ts +1 -0
- package/dist/pi/packages/ta-bots/lib/i18n.js +2 -0
- package/dist/pi/packages/ta-bots/lib/index.js +2 -0
- package/dist/pi/packages/ta-bots/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-bots/lib/style.js +1 -0
- package/dist/pi/packages/ta-bots/lib/text-util.js +8 -1
- package/dist/pi/packages/ta-bots/lib/tool-line.d.ts +8 -0
- package/dist/pi/packages/ta-bots/lib/tool-line.js +19 -0
- package/dist/pi/packages/ta-bots/package.json +1 -1
- package/dist/pi/packages/ta-bots/web/index.js +47 -16
- package/dist/pi/packages/ta-changes/extension/index.mjs +23 -13
- package/dist/pi/packages/ta-changes/lib/card.js +18 -4
- package/dist/pi/packages/ta-changes/lib/changes-protocol.d.ts +0 -4
- package/dist/pi/packages/ta-changes/lib/changes-protocol.js +1 -5
- package/dist/pi/packages/ta-changes/lib/extension.js +5 -13
- package/dist/pi/packages/ta-changes/package.json +1 -1
- package/dist/pi/packages/ta-changes/web/index.js +16 -3
- package/dist/pi/packages/ta-channels/README.en.md +6 -5
- package/dist/pi/packages/ta-channels/README.md +6 -5
- package/dist/pi/packages/ta-channels/extension/index.mjs +350 -28
- package/dist/pi/packages/ta-channels/host/index.mjs +638 -43
- package/dist/pi/packages/ta-channels/lib/agent-cards.d.ts +19 -0
- package/dist/pi/packages/ta-channels/lib/agent-cards.js +58 -0
- package/dist/pi/packages/ta-channels/lib/agent-menu.d.ts +2 -2
- package/dist/pi/packages/ta-channels/lib/agent-menu.js +20 -6
- package/dist/pi/packages/ta-channels/lib/card.d.ts +27 -0
- package/dist/pi/packages/ta-channels/lib/card.js +178 -0
- package/dist/pi/packages/ta-channels/lib/channels-model.d.ts +65 -13
- package/dist/pi/packages/ta-channels/lib/channels-model.js +15 -6
- package/dist/pi/packages/ta-channels/lib/channels-util.d.ts +31 -2
- package/dist/pi/packages/ta-channels/lib/channels-util.js +100 -6
- package/dist/pi/packages/ta-channels/lib/channels.d.ts +28 -18
- package/dist/pi/packages/ta-channels/lib/channels.js +65 -65
- package/dist/pi/packages/ta-channels/lib/create.js +14 -4
- package/dist/pi/packages/ta-channels/lib/extension.d.ts +8 -0
- package/dist/pi/packages/ta-channels/lib/extension.js +104 -18
- package/dist/pi/packages/ta-channels/lib/faces.d.ts +2 -0
- package/dist/pi/packages/ta-channels/lib/faces.js +7 -1
- package/dist/pi/packages/ta-channels/lib/handoff-view.d.ts +19 -0
- package/dist/pi/packages/ta-channels/lib/handoff-view.js +113 -0
- package/dist/pi/packages/ta-channels/lib/handoff.d.ts +67 -0
- package/dist/pi/packages/ta-channels/lib/handoff.js +114 -0
- package/dist/pi/packages/ta-channels/lib/host.d.ts +1 -1
- package/dist/pi/packages/ta-channels/lib/host.js +1 -1
- package/dist/pi/packages/ta-channels/lib/i18n.d.ts +49 -8
- package/dist/pi/packages/ta-channels/lib/i18n.js +98 -16
- package/dist/pi/packages/ta-channels/lib/index.js +10 -1
- package/dist/pi/packages/ta-channels/lib/member-tools.d.ts +23 -0
- package/dist/pi/packages/ta-channels/lib/member-tools.js +56 -0
- package/dist/pi/packages/ta-channels/lib/members.js +6 -2
- package/dist/pi/packages/ta-channels/lib/more-menu.d.ts +3 -2
- package/dist/pi/packages/ta-channels/lib/more-menu.js +21 -29
- package/dist/pi/packages/ta-channels/lib/notice.d.ts +25 -0
- package/dist/pi/packages/ta-channels/lib/notice.js +101 -0
- package/dist/pi/packages/ta-channels/lib/room.js +26 -10
- package/dist/pi/packages/ta-channels/lib/sidebar.d.ts +1 -6
- package/dist/pi/packages/ta-channels/lib/sidebar.js +257 -84
- package/dist/pi/packages/ta-channels/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-channels/lib/style.js +151 -40
- package/dist/pi/packages/ta-channels/lib/tasks.js +3 -4
- package/dist/pi/packages/ta-channels/lib/team.d.ts +58 -10
- package/dist/pi/packages/ta-channels/lib/team.js +159 -38
- package/dist/pi/packages/ta-channels/lib/tool-lines.d.ts +22 -0
- package/dist/pi/packages/ta-channels/lib/tool-lines.js +113 -0
- package/dist/pi/packages/ta-channels/lib/views.d.ts +54 -1
- package/dist/pi/packages/ta-channels/lib/views.js +129 -1
- package/dist/pi/packages/ta-channels/package.json +2 -1
- package/dist/pi/packages/ta-channels/web/index.js +1792 -439
- package/dist/pi/packages/ta-computer-use/package.json +7 -2
- package/dist/pi/packages/ta-cron/README.en.md +6 -4
- package/dist/pi/packages/ta-cron/README.md +6 -4
- package/dist/pi/packages/ta-cron/extension/index.mjs +416 -44
- package/dist/pi/packages/ta-cron/host/index.mjs +30 -3
- package/dist/pi/packages/ta-cron/lib/chat-task.d.ts +48 -0
- package/dist/pi/packages/ta-cron/lib/chat-task.js +133 -0
- package/dist/pi/packages/ta-cron/lib/commands.d.ts +2 -1
- package/dist/pi/packages/ta-cron/lib/commands.js +10 -4
- package/dist/pi/packages/ta-cron/lib/composer.d.ts +11 -0
- package/dist/pi/packages/ta-cron/lib/composer.js +58 -0
- package/dist/pi/packages/ta-cron/lib/cron-protocol.d.ts +10 -3
- package/dist/pi/packages/ta-cron/lib/cron-protocol.js +6 -3
- package/dist/pi/packages/ta-cron/lib/editor.js +65 -30
- package/dist/pi/packages/ta-cron/lib/extension.d.ts +2 -0
- package/dist/pi/packages/ta-cron/lib/extension.js +33 -13
- package/dist/pi/packages/ta-cron/lib/i18n.d.ts +30 -1
- package/dist/pi/packages/ta-cron/lib/i18n.js +60 -2
- package/dist/pi/packages/ta-cron/lib/index.js +4 -0
- package/dist/pi/packages/ta-cron/lib/page.d.ts +38 -4
- package/dist/pi/packages/ta-cron/lib/page.js +131 -4
- package/dist/pi/packages/ta-cron/lib/react.d.ts +3 -0
- package/dist/pi/packages/ta-cron/lib/react.js +8 -0
- package/dist/pi/packages/ta-cron/lib/scheduler.js +3 -2
- package/dist/pi/packages/ta-cron/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-cron/lib/style.js +168 -50
- package/dist/pi/packages/ta-cron/lib/task-extension.d.ts +15 -0
- package/dist/pi/packages/ta-cron/lib/task-extension.js +56 -0
- package/dist/pi/packages/ta-cron/lib/task-util.d.ts +4 -0
- package/dist/pi/packages/ta-cron/lib/task-util.js +31 -1
- package/dist/pi/packages/ta-cron/lib/tasks-view.d.ts +4 -1
- package/dist/pi/packages/ta-cron/lib/tasks-view.js +107 -67
- package/dist/pi/packages/ta-cron/lib/tool-line.d.ts +9 -0
- package/dist/pi/packages/ta-cron/lib/tool-line.js +40 -0
- package/dist/pi/packages/ta-cron/lib/tool.d.ts +5 -1
- package/dist/pi/packages/ta-cron/lib/tool.js +6 -3
- package/dist/pi/packages/ta-cron/package.json +12 -1
- package/dist/pi/packages/ta-cron/web/index.js +1346 -415
- package/dist/pi/packages/ta-extensions/README.en.md +4 -2
- package/dist/pi/packages/ta-extensions/README.md +4 -2
- package/dist/pi/packages/ta-extensions/host/index.mjs +3 -2
- package/dist/pi/packages/ta-extensions/lib/actions.d.ts +4 -0
- package/dist/pi/packages/ta-extensions/lib/actions.js +16 -5
- package/dist/pi/packages/ta-extensions/lib/composer.d.ts +17 -0
- package/dist/pi/packages/ta-extensions/lib/composer.js +84 -0
- package/dist/pi/packages/ta-extensions/lib/extensions-util.d.ts +5 -0
- package/dist/pi/packages/ta-extensions/lib/extensions-util.js +10 -0
- package/dist/pi/packages/ta-extensions/lib/i18n.d.ts +9 -0
- package/dist/pi/packages/ta-extensions/lib/i18n.js +18 -0
- package/dist/pi/packages/ta-extensions/lib/index.js +4 -0
- package/dist/pi/packages/ta-extensions/lib/make-model.d.ts +20 -0
- package/dist/pi/packages/ta-extensions/lib/make-model.js +43 -0
- package/dist/pi/packages/ta-extensions/lib/market-parts.js +8 -2
- package/dist/pi/packages/ta-extensions/lib/market-style.d.ts +1 -1
- package/dist/pi/packages/ta-extensions/lib/market-style.js +4 -5
- package/dist/pi/packages/ta-extensions/lib/market-util.d.ts +2 -2
- package/dist/pi/packages/ta-extensions/lib/market-util.js +2 -2
- package/dist/pi/packages/ta-extensions/lib/page.js +52 -23
- package/dist/pi/packages/ta-extensions/lib/react.d.ts +3 -0
- package/dist/pi/packages/ta-extensions/lib/react.js +8 -0
- package/dist/pi/packages/ta-extensions/lib/settings.d.ts +4 -0
- package/dist/pi/packages/ta-extensions/lib/settings.js +44 -0
- package/dist/pi/packages/ta-extensions/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-extensions/lib/style.js +13 -6
- package/dist/pi/packages/ta-extensions/package.json +6 -1
- package/dist/pi/packages/ta-extensions/skills/ta-package/SKILL.md +25 -10
- package/dist/pi/packages/ta-extensions/web/index.js +459 -47
- package/dist/pi/packages/ta-games/README.en.md +47 -0
- package/dist/pi/packages/ta-games/README.md +47 -0
- package/dist/pi/packages/ta-games/host/index.mjs +65 -0
- package/dist/pi/packages/ta-games/lib/games-view.d.ts +16 -0
- package/dist/pi/packages/ta-games/lib/games-view.js +77 -0
- package/dist/pi/packages/ta-games/lib/host.d.ts +36 -0
- package/dist/pi/packages/ta-games/lib/host.js +83 -0
- package/dist/pi/packages/ta-games/lib/i18n.d.ts +35 -0
- package/dist/pi/packages/ta-games/lib/i18n.js +71 -0
- package/dist/pi/packages/ta-games/lib/ideas.d.ts +6 -0
- package/dist/pi/packages/ta-games/lib/ideas.js +62 -0
- package/dist/pi/packages/ta-games/lib/index.d.ts +7 -0
- package/dist/pi/packages/ta-games/lib/index.js +24 -0
- package/dist/pi/packages/ta-games/lib/make-game.d.ts +23 -0
- package/dist/pi/packages/ta-games/lib/make-game.js +67 -0
- package/dist/pi/packages/ta-games/lib/react.d.ts +11 -0
- package/dist/pi/packages/ta-games/lib/react.js +16 -0
- package/dist/pi/packages/ta-games/lib/style.d.ts +4 -0
- package/dist/pi/packages/ta-games/lib/style.js +33 -0
- package/dist/pi/packages/ta-games/package.json +60 -0
- package/dist/pi/packages/ta-games/skills/ta-game/SKILL.md +127 -0
- package/dist/pi/packages/ta-games/skills/ta-game/examples/dino-run/package.json +22 -0
- package/dist/pi/packages/ta-games/skills/ta-game/examples/dino-run/web.js +389 -0
- package/dist/pi/packages/ta-games/skills/ta-game/examples/stack/package.json +22 -0
- package/dist/pi/packages/ta-games/skills/ta-game/examples/stack/web.js +423 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/LICENSE.md +22 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/actions-and-utilities/SKILL.md +343 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/animations/SKILL.md +481 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/audio-and-sound/SKILL.md +453 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/cameras/SKILL.md +497 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/cameras/references/REFERENCE.md +128 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/curves-and-paths/SKILL.md +359 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/data-manager/SKILL.md +406 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/events-system/SKILL.md +497 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/filters-and-postfx/SKILL.md +449 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/game-object-components/SKILL.md +478 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/game-object-components/references/REFERENCE.md +76 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/game-setup-and-config/SKILL.md +485 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/geometry-and-math/SKILL.md +497 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/graphics-and-shapes/SKILL.md +473 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/groups-and-containers/SKILL.md +418 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/input-keyboard-mouse-touch/SKILL.md +500 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/input-keyboard-mouse-touch/references/REFERENCE.md +372 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/loading-assets/SKILL.md +474 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/loading-assets/references/REFERENCE.md +148 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/particles/SKILL.md +499 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/particles/references/REFERENCE.md +17 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/physics-arcade/SKILL.md +468 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/physics-matter/SKILL.md +499 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/render-textures/SKILL.md +441 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/scale-and-responsive/SKILL.md +371 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/scenes/SKILL.md +450 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/scenes/references/REFERENCE.md +78 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/sprites-and-images/SKILL.md +417 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/sprites-and-images/references/REFERENCE.md +160 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/text-and-bitmaptext/SKILL.md +460 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/tilemaps/SKILL.md +440 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/time-and-timers/SKILL.md +496 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/tweens/SKILL.md +414 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/v3-to-v4-migration/SKILL.md +430 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/v4-new-features/SKILL.md +384 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/v4-new-features/references/REFERENCE.md +69 -0
- package/dist/pi/packages/ta-games/web/index.js +431 -0
- package/dist/pi/packages/ta-glance/README.en.md +11 -0
- package/dist/pi/packages/ta-glance/README.md +11 -0
- package/dist/pi/packages/ta-glance/extension/index.mjs +67 -0
- package/dist/pi/packages/ta-glance/lib/card.d.ts +8 -0
- package/dist/pi/packages/ta-glance/lib/card.js +268 -0
- package/dist/pi/packages/ta-glance/lib/extension.d.ts +15 -0
- package/dist/pi/packages/ta-glance/lib/extension.js +24 -0
- package/dist/pi/packages/ta-glance/lib/glance-json.d.ts +9 -0
- package/dist/pi/packages/ta-glance/lib/glance-json.js +85 -0
- package/dist/pi/packages/ta-glance/lib/glance-prompt.d.ts +7 -0
- package/dist/pi/packages/ta-glance/lib/glance-prompt.js +34 -0
- package/dist/pi/packages/ta-glance/lib/glance-protocol.d.ts +98 -0
- package/dist/pi/packages/ta-glance/lib/glance-protocol.js +8 -0
- package/dist/pi/packages/ta-glance/lib/glance-spec.d.ts +6 -0
- package/dist/pi/packages/ta-glance/lib/glance-spec.js +204 -0
- package/dist/pi/packages/ta-glance/lib/glance-util.d.ts +3 -0
- package/dist/pi/packages/ta-glance/lib/glance-util.js +12 -0
- package/dist/pi/packages/ta-glance/lib/i18n.d.ts +22 -0
- package/dist/pi/packages/ta-glance/lib/i18n.js +41 -0
- package/dist/pi/packages/ta-glance/lib/index.d.ts +7 -0
- package/dist/pi/packages/ta-glance/lib/index.js +22 -0
- package/dist/pi/packages/ta-glance/lib/react.d.ts +8 -0
- package/dist/pi/packages/ta-glance/lib/react.js +8 -0
- package/dist/pi/packages/ta-glance/lib/style.d.ts +4 -0
- package/dist/pi/packages/ta-glance/lib/style.js +164 -0
- package/dist/pi/packages/ta-glance/package.json +53 -0
- package/dist/pi/packages/ta-glance/web/index.js +933 -0
- package/dist/pi/packages/ta-launcher/lib/actions.d.ts +4 -4
- package/dist/pi/packages/ta-launcher/lib/actions.js +7 -3
- package/dist/pi/packages/ta-launcher/lib/launcher-util.d.ts +7 -7
- package/dist/pi/packages/ta-launcher/lib/launcher-util.js +11 -8
- package/dist/pi/packages/ta-launcher/lib/launcher-view.js +13 -7
- package/dist/pi/packages/ta-launcher/lib/react.d.ts +3 -0
- package/dist/pi/packages/ta-launcher/lib/react.js +8 -0
- package/dist/pi/packages/ta-launcher/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-launcher/lib/style.js +6 -4
- package/dist/pi/packages/ta-launcher/package.json +1 -1
- package/dist/pi/packages/ta-launcher/web/index.js +34 -17
- package/dist/pi/packages/ta-manual/README.en.md +10 -0
- package/dist/pi/packages/ta-manual/README.md +10 -0
- package/dist/pi/packages/ta-manual/lib/i18n.d.ts +15 -0
- package/dist/pi/packages/ta-manual/lib/i18n.js +31 -0
- package/dist/pi/packages/ta-manual/lib/index.d.ts +7 -0
- package/dist/pi/packages/ta-manual/lib/index.js +24 -0
- package/dist/pi/packages/ta-manual/lib/manual-util.d.ts +18 -0
- package/dist/pi/packages/ta-manual/lib/manual-util.js +40 -0
- package/dist/pi/packages/ta-manual/lib/manual-view.d.ts +9 -0
- package/dist/pi/packages/ta-manual/lib/manual-view.js +81 -0
- package/dist/pi/packages/ta-manual/lib/pictures-a.d.ts +2 -0
- package/dist/pi/packages/ta-manual/lib/pictures-a.js +263 -0
- package/dist/pi/packages/ta-manual/lib/pictures-b.d.ts +2 -0
- package/dist/pi/packages/ta-manual/lib/pictures-b.js +216 -0
- package/dist/pi/packages/ta-manual/lib/pictures.d.ts +9 -0
- package/dist/pi/packages/ta-manual/lib/pictures.js +16 -0
- package/dist/pi/packages/ta-manual/lib/react.d.ts +8 -0
- package/dist/pi/packages/ta-manual/lib/react.js +8 -0
- package/dist/pi/packages/ta-manual/lib/scene.d.ts +68 -0
- package/dist/pi/packages/ta-manual/lib/scene.js +115 -0
- package/dist/pi/packages/ta-manual/lib/style.d.ts +4 -0
- package/dist/pi/packages/ta-manual/lib/style.js +47 -0
- package/dist/pi/packages/ta-manual/lib/topics.d.ts +42 -0
- package/dist/pi/packages/ta-manual/lib/topics.js +354 -0
- package/dist/pi/packages/ta-manual/package.json +54 -0
- package/dist/pi/packages/ta-manual/skills/ta-manual/SKILL.md +119 -0
- package/dist/pi/packages/ta-manual/web/index.js +2223 -0
- package/dist/pi/packages/ta-notify/README.en.md +29 -0
- package/dist/pi/packages/ta-notify/README.md +29 -0
- package/dist/pi/packages/ta-notify/extension/index.mjs +259 -0
- package/dist/pi/packages/ta-notify/host/index.mjs +163 -0
- package/dist/pi/packages/ta-notify/lib/ask-card.d.ts +9 -0
- package/dist/pi/packages/ta-notify/lib/ask-card.js +40 -0
- package/dist/pi/packages/ta-notify/lib/extension.d.ts +24 -0
- package/dist/pi/packages/ta-notify/lib/extension.js +102 -0
- package/dist/pi/packages/ta-notify/lib/host.d.ts +4 -0
- package/dist/pi/packages/ta-notify/lib/host.js +9 -0
- package/dist/pi/packages/ta-notify/lib/i18n.d.ts +31 -0
- package/dist/pi/packages/ta-notify/lib/i18n.js +63 -0
- package/dist/pi/packages/ta-notify/lib/index.d.ts +8 -0
- package/dist/pi/packages/ta-notify/lib/index.js +29 -0
- package/dist/pi/packages/ta-notify/lib/notify-protocol.d.ts +74 -0
- package/dist/pi/packages/ta-notify/lib/notify-protocol.js +23 -0
- package/dist/pi/packages/ta-notify/lib/notify-service.d.ts +21 -0
- package/dist/pi/packages/ta-notify/lib/notify-service.js +75 -0
- package/dist/pi/packages/ta-notify/lib/notify-util.d.ts +39 -0
- package/dist/pi/packages/ta-notify/lib/notify-util.js +119 -0
- package/dist/pi/packages/ta-notify/lib/react.d.ts +8 -0
- package/dist/pi/packages/ta-notify/lib/react.js +8 -0
- package/dist/pi/packages/ta-notify/lib/server-texts.d.ts +9 -0
- package/dist/pi/packages/ta-notify/lib/server-texts.js +22 -0
- package/dist/pi/packages/ta-notify/lib/settings.d.ts +8 -0
- package/dist/pi/packages/ta-notify/lib/settings.js +85 -0
- package/dist/pi/packages/ta-notify/lib/style.d.ts +4 -0
- package/dist/pi/packages/ta-notify/lib/style.js +29 -0
- package/dist/pi/packages/ta-notify/lib/tool-line.d.ts +9 -0
- package/dist/pi/packages/ta-notify/lib/tool-line.js +20 -0
- package/dist/pi/packages/ta-notify/lib/tool.d.ts +37 -0
- package/dist/pi/packages/ta-notify/lib/tool.js +46 -0
- package/dist/pi/packages/ta-notify/lib/watcher.d.ts +15 -0
- package/dist/pi/packages/ta-notify/lib/watcher.js +81 -0
- package/dist/pi/packages/ta-notify/package.json +55 -0
- package/dist/pi/packages/ta-notify/web/index.js +436 -0
- package/dist/pi/packages/ta-recall/README.en.md +19 -0
- package/dist/pi/packages/ta-recall/README.md +19 -0
- package/dist/pi/packages/ta-recall/extension/index.mjs +614 -0
- package/dist/pi/packages/ta-recall/host/index.mjs +820 -0
- package/dist/pi/packages/ta-recall/lib/brief-card.d.ts +21 -0
- package/dist/pi/packages/ta-recall/lib/brief-card.js +67 -0
- package/dist/pi/packages/ta-recall/lib/brief-home.d.ts +49 -0
- package/dist/pi/packages/ta-recall/lib/brief-home.js +143 -0
- package/dist/pi/packages/ta-recall/lib/brief-seen.d.ts +9 -0
- package/dist/pi/packages/ta-recall/lib/brief-seen.js +26 -0
- package/dist/pi/packages/ta-recall/lib/brief-util.d.ts +64 -0
- package/dist/pi/packages/ta-recall/lib/brief-util.js +179 -0
- package/dist/pi/packages/ta-recall/lib/chat-icons.d.ts +8 -0
- package/dist/pi/packages/ta-recall/lib/chat-icons.js +56 -0
- package/dist/pi/packages/ta-recall/lib/composer.d.ts +7 -0
- package/dist/pi/packages/ta-recall/lib/composer.js +38 -0
- package/dist/pi/packages/ta-recall/lib/conversation-index.d.ts +25 -0
- package/dist/pi/packages/ta-recall/lib/conversation-index.js +72 -0
- package/dist/pi/packages/ta-recall/lib/conversation-util.d.ts +16 -0
- package/dist/pi/packages/ta-recall/lib/conversation-util.js +109 -0
- package/dist/pi/packages/ta-recall/lib/conversations.d.ts +11 -0
- package/dist/pi/packages/ta-recall/lib/conversations.js +46 -0
- package/dist/pi/packages/ta-recall/lib/extension.d.ts +24 -0
- package/dist/pi/packages/ta-recall/lib/extension.js +131 -0
- package/dist/pi/packages/ta-recall/lib/host.d.ts +4 -0
- package/dist/pi/packages/ta-recall/lib/host.js +11 -0
- package/dist/pi/packages/ta-recall/lib/i18n.d.ts +41 -0
- package/dist/pi/packages/ta-recall/lib/i18n.js +83 -0
- package/dist/pi/packages/ta-recall/lib/index.d.ts +9 -0
- package/dist/pi/packages/ta-recall/lib/index.js +45 -0
- package/dist/pi/packages/ta-recall/lib/react.d.ts +11 -0
- package/dist/pi/packages/ta-recall/lib/react.js +16 -0
- package/dist/pi/packages/ta-recall/lib/recall-protocol.d.ts +186 -0
- package/dist/pi/packages/ta-recall/lib/recall-protocol.js +60 -0
- package/dist/pi/packages/ta-recall/lib/recall-service.d.ts +42 -0
- package/dist/pi/packages/ta-recall/lib/recall-service.js +241 -0
- package/dist/pi/packages/ta-recall/lib/search-source.d.ts +7 -0
- package/dist/pi/packages/ta-recall/lib/search-source.js +49 -0
- package/dist/pi/packages/ta-recall/lib/search-util.d.ts +30 -0
- package/dist/pi/packages/ta-recall/lib/search-util.js +167 -0
- package/dist/pi/packages/ta-recall/lib/server-texts.d.ts +7 -0
- package/dist/pi/packages/ta-recall/lib/server-texts.js +17 -0
- package/dist/pi/packages/ta-recall/lib/settings.d.ts +4 -0
- package/dist/pi/packages/ta-recall/lib/settings.js +77 -0
- package/dist/pi/packages/ta-recall/lib/skill-card.d.ts +9 -0
- package/dist/pi/packages/ta-recall/lib/skill-card.js +51 -0
- package/dist/pi/packages/ta-recall/lib/skill-util.d.ts +19 -0
- package/dist/pi/packages/ta-recall/lib/skill-util.js +110 -0
- package/dist/pi/packages/ta-recall/lib/stored.d.ts +5 -0
- package/dist/pi/packages/ta-recall/lib/stored.js +28 -0
- package/dist/pi/packages/ta-recall/lib/style.d.ts +4 -0
- package/dist/pi/packages/ta-recall/lib/style.js +48 -0
- package/dist/pi/packages/ta-recall/lib/tool-line.d.ts +10 -0
- package/dist/pi/packages/ta-recall/lib/tool-line.js +23 -0
- package/dist/pi/packages/ta-recall/lib/tool.d.ts +63 -0
- package/dist/pi/packages/ta-recall/lib/tool.js +71 -0
- package/dist/pi/packages/ta-recall/package.json +55 -0
- package/dist/pi/packages/ta-recall/web/index.js +1038 -0
- package/dist/pi/packages/ta-rooms/README.en.md +23 -0
- package/dist/pi/packages/ta-rooms/README.md +23 -0
- package/dist/pi/packages/ta-rooms/lib/dialogs.d.ts +39 -0
- package/dist/pi/packages/ta-rooms/lib/dialogs.js +235 -0
- package/dist/pi/packages/ta-rooms/lib/i18n.d.ts +101 -0
- package/dist/pi/packages/ta-rooms/lib/i18n.js +203 -0
- package/dist/pi/packages/ta-rooms/lib/index.d.ts +9 -0
- package/dist/pi/packages/ta-rooms/lib/index.js +85 -0
- package/dist/pi/packages/ta-rooms/lib/members-view.d.ts +3 -0
- package/dist/pi/packages/ta-rooms/lib/members-view.js +64 -0
- package/dist/pi/packages/ta-rooms/lib/page.d.ts +105 -0
- package/dist/pi/packages/ta-rooms/lib/page.js +306 -0
- package/dist/pi/packages/ta-rooms/lib/react.d.ts +8 -0
- package/dist/pi/packages/ta-rooms/lib/react.js +8 -0
- package/dist/pi/packages/ta-rooms/lib/room-view.d.ts +17 -0
- package/dist/pi/packages/ta-rooms/lib/room-view.js +150 -0
- package/dist/pi/packages/ta-rooms/lib/rooms-page.d.ts +8 -0
- package/dist/pi/packages/ta-rooms/lib/rooms-page.js +174 -0
- package/dist/pi/packages/ta-rooms/lib/style.d.ts +4 -0
- package/dist/pi/packages/ta-rooms/lib/style.js +154 -0
- package/dist/pi/packages/ta-rooms/package.json +50 -0
- package/dist/pi/packages/ta-rooms/web/index.js +1932 -0
- package/dist/pi/packages/ta-share/README.en.md +27 -0
- package/dist/pi/packages/ta-share/README.md +27 -0
- package/dist/pi/packages/ta-share/extension/index.mjs +184 -0
- package/dist/pi/packages/ta-share/host/index.mjs +364 -0
- package/dist/pi/packages/ta-share/lib/extension.d.ts +15 -0
- package/dist/pi/packages/ta-share/lib/extension.js +115 -0
- package/dist/pi/packages/ta-share/lib/host.d.ts +4 -0
- package/dist/pi/packages/ta-share/lib/host.js +9 -0
- package/dist/pi/packages/ta-share/lib/i18n.d.ts +106 -0
- package/dist/pi/packages/ta-share/lib/i18n.js +213 -0
- package/dist/pi/packages/ta-share/lib/index.d.ts +9 -0
- package/dist/pi/packages/ta-share/lib/index.js +77 -0
- package/dist/pi/packages/ta-share/lib/page.d.ts +48 -0
- package/dist/pi/packages/ta-share/lib/page.js +105 -0
- package/dist/pi/packages/ta-share/lib/react.d.ts +8 -0
- package/dist/pi/packages/ta-share/lib/react.js +8 -0
- package/dist/pi/packages/ta-share/lib/server-texts.d.ts +14 -0
- package/dist/pi/packages/ta-share/lib/server-texts.js +52 -0
- package/dist/pi/packages/ta-share/lib/share-dialog.d.ts +18 -0
- package/dist/pi/packages/ta-share/lib/share-dialog.js +233 -0
- package/dist/pi/packages/ta-share/lib/share-protocol.d.ts +86 -0
- package/dist/pi/packages/ta-share/lib/share-protocol.js +30 -0
- package/dist/pi/packages/ta-share/lib/share-service.d.ts +50 -0
- package/dist/pi/packages/ta-share/lib/share-service.js +130 -0
- package/dist/pi/packages/ta-share/lib/shared-view.d.ts +18 -0
- package/dist/pi/packages/ta-share/lib/shared-view.js +225 -0
- package/dist/pi/packages/ta-share/lib/shares-page.d.ts +3 -0
- package/dist/pi/packages/ta-share/lib/shares-page.js +54 -0
- package/dist/pi/packages/ta-share/lib/snapshot.d.ts +30 -0
- package/dist/pi/packages/ta-share/lib/snapshot.js +195 -0
- package/dist/pi/packages/ta-share/lib/style.d.ts +4 -0
- package/dist/pi/packages/ta-share/lib/style.js +111 -0
- package/dist/pi/packages/ta-share/package.json +56 -0
- package/dist/pi/packages/ta-share/web/index.js +1197 -0
- package/dist/pi/packages/ta-workspace/README.md +2 -2
- package/dist/pi/packages/ta-workspace/README.zh-cn.md +2 -2
- package/dist/pi/packages/ta-workspace/lib/browser-common.d.ts +1 -1
- package/dist/pi/packages/ta-workspace/lib/browser-common.js +29 -30
- package/dist/pi/packages/ta-workspace/lib/browser-tool-line.d.ts +15 -0
- package/dist/pi/packages/ta-workspace/lib/browser-tool-line.js +70 -0
- package/dist/pi/packages/ta-workspace/lib/bytes.d.ts +11 -0
- package/dist/pi/packages/ta-workspace/lib/bytes.js +40 -0
- package/dist/pi/packages/ta-workspace/lib/common.d.ts +2 -1
- package/dist/pi/packages/ta-workspace/lib/common.js +15 -37
- package/dist/pi/packages/ta-workspace/lib/editors.js +40 -4
- package/dist/pi/packages/ta-workspace/lib/i18n.d.ts +14 -4
- package/dist/pi/packages/ta-workspace/lib/i18n.js +31 -11
- package/dist/pi/packages/ta-workspace/lib/index.js +17 -0
- package/dist/pi/packages/ta-workspace/lib/launcher.d.ts +9 -0
- package/dist/pi/packages/ta-workspace/lib/launcher.js +39 -0
- package/dist/pi/packages/ta-workspace/lib/preview.d.ts +22 -3
- package/dist/pi/packages/ta-workspace/lib/preview.js +150 -22
- package/dist/pi/packages/ta-workspace/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-workspace/lib/style.js +70 -41
- package/dist/pi/packages/ta-workspace/lib/terminal-sessions.d.ts +15 -4
- package/dist/pi/packages/ta-workspace/lib/terminal-sessions.js +31 -9
- package/dist/pi/packages/ta-workspace/lib/terminal.d.ts +3 -2
- package/dist/pi/packages/ta-workspace/lib/terminal.js +51 -21
- package/dist/pi/packages/ta-workspace/lib/util/keys.d.ts +18 -0
- package/dist/pi/packages/ta-workspace/lib/util/keys.js +23 -0
- package/dist/pi/packages/ta-workspace/lib/util/preview.d.ts +46 -0
- package/dist/pi/packages/ta-workspace/lib/util/preview.js +106 -1
- package/dist/pi/packages/ta-workspace/lib/util/terminal.d.ts +5 -0
- package/dist/pi/packages/ta-workspace/lib/util/terminal.js +14 -0
- package/dist/pi/packages/ta-workspace/package.json +1 -1
- package/dist/pi/packages/ta-workspace/web/index.js +1032 -382
- package/dist/public/assets/OrbitControls-DVf70a7w.js +1 -0
- package/dist/public/assets/{abnfDiagram-S7VZAUFO-EVMX_yOb.js → abnfDiagram-S7VZAUFO-D9uU0Tx2.js} +1 -1
- package/dist/public/assets/{architecture-WOLXFQ4H-CDgbgZ_o.js → architecture-WOLXFQ4H-f7Nm7EIo.js} +1 -1
- package/dist/public/assets/{architectureDiagram-YGSQEFNW-dHreaCWz.js → architectureDiagram-YGSQEFNW-DSAqlcms.js} +1 -1
- package/dist/public/assets/{blockDiagram-APKKGZFW-D6FhzBDq.js → blockDiagram-APKKGZFW-C0lPIW9g.js} +1 -1
- package/dist/public/assets/browser-WLpgVYno.js +12 -0
- package/dist/public/assets/{c4Diagram-KJ2TOQU5-BFpcr8Cs.js → c4Diagram-KJ2TOQU5-CDcZ7mJq.js} +1 -1
- package/dist/public/assets/{chunk-6MUBBAK2-BczXkMV-.js → chunk-6MUBBAK2-CXPuyqPL.js} +1 -1
- package/dist/public/assets/{chunk-AXFCVDMN-CjJsv3jB.js → chunk-AXFCVDMN-Du6JRX1x.js} +1 -1
- package/dist/public/assets/{chunk-BG4553SI-FBaleaLz.js → chunk-BG4553SI-D592E55X.js} +1 -1
- package/dist/public/assets/{chunk-DQASFODM-BFdXY5sX.js → chunk-DQASFODM-BW2r2SL4.js} +1 -1
- package/dist/public/assets/{chunk-HFQBQIA3-C5cwK-Fg.js → chunk-HFQBQIA3-C3yoe54R.js} +1 -1
- package/dist/public/assets/{chunk-KQLB2F66-BUek3IRk.js → chunk-KQLB2F66-DF8gfYCy.js} +1 -1
- package/dist/public/assets/{chunk-KS47KZWR-BxsYBzt6.js → chunk-KS47KZWR-C8CRMTv1.js} +1 -1
- package/dist/public/assets/{chunk-LEVMRMFU-Bdcwz9fS.js → chunk-LEVMRMFU-BDcMKiwj.js} +1 -1
- package/dist/public/assets/{chunk-M57EVK23-kkpP5oug.js → chunk-M57EVK23-CKJPBygc.js} +1 -1
- package/dist/public/assets/{chunk-OY52VR5R-CFhQgxmD.js → chunk-OY52VR5R-B3ZWH07L.js} +1 -1
- package/dist/public/assets/{chunk-QB3YPZ4I-BVXqu0eC.js → chunk-QB3YPZ4I-DI-z4UPL.js} +1 -1
- package/dist/public/assets/{chunk-R3KSYZAL-B7SUqqLI.js → chunk-R3KSYZAL-Bg4-haAc.js} +1 -1
- package/dist/public/assets/{chunk-STOXU5M4-B3abfbnH.js → chunk-STOXU5M4-l_SHib3p.js} +1 -1
- package/dist/public/assets/{chunk-TU62E6Q5-C9NqnUav.js → chunk-TU62E6Q5-BINu9tIm.js} +1 -1
- package/dist/public/assets/{chunk-X4PVCEUW-BeLfETDx.js → chunk-X4PVCEUW-BQn-mvV5.js} +1 -1
- package/dist/public/assets/{chunk-XXDRQBXY-DXai1i8p.js → chunk-XXDRQBXY-uvpAu0Ys.js} +1 -1
- package/dist/public/assets/{classDiagram-v2-L25IHNXF-Zj6ne_tC.js → classDiagram-v2-L25IHNXF-BIowooW1.js} +1 -1
- package/dist/public/assets/{cose-bilkent-JH36ORCC-C0-TjqfJ.js → cose-bilkent-JH36ORCC-BTyx1Mh2.js} +1 -1
- package/dist/public/assets/cynefin-EF2NZ3EQ-Dg54eFzZ.js +1 -0
- package/dist/public/assets/{cynefinDiagram-L36ESFBY-BnqxfzPa.js → cynefinDiagram-L36ESFBY-D64EU9I0.js} +1 -1
- package/dist/public/assets/{d3-selection-DfFLTR9d.js → d3-selection-CN9k6_B9.js} +1 -1
- package/dist/public/assets/{dagre-SPEB5RXH-kI17e5cH.js → dagre-SPEB5RXH-FCbz2-Kk.js} +1 -1
- package/dist/public/assets/{diagram-3B7GL73J-DgPjeLA5.js → diagram-3B7GL73J-OhHUSI7j.js} +1 -1
- package/dist/public/assets/{diagram-DNEMPZML-CRhPfa0I.js → diagram-DNEMPZML-Be4xMtp6.js} +1 -1
- package/dist/public/assets/{diagram-L3MUGCDN-ExuTg12b.js → diagram-L3MUGCDN-CmKSs3aG.js} +1 -1
- package/dist/public/assets/{diagram-LA4NIPWU-Dgx5xNiY.js → diagram-LA4NIPWU-D1C32rMN.js} +1 -1
- package/dist/public/assets/{diagram-MHCOC4E2-BuifkUTl.js → diagram-MHCOC4E2-BjoE6JXs.js} +1 -1
- package/dist/public/assets/{diagram-XPFHEONP-CFEaBo7z.js → diagram-XPFHEONP-B22k4v8R.js} +1 -1
- package/dist/public/assets/{dist-C-iJHcSK.js → dist-DcBP8Cf6.js} +1 -1
- package/dist/public/assets/{ebnfDiagram-UZSYDL2S-D-hp5yNt.js → ebnfDiagram-UZSYDL2S-Tn-K8-X7.js} +1 -1
- package/dist/public/assets/{editor.api-BopUWpqY.js → editor.api-Bz4sjRz_.js} +1 -1
- package/dist/public/assets/{elk-XV6XMXQE-CBbk_IpU.js → elk-XV6XMXQE-COnQsWlN.js} +1 -1
- package/dist/public/assets/{erDiagram-EYBAPDEH-B02R_WWE.js → erDiagram-EYBAPDEH-c53dJilq.js} +1 -1
- package/dist/public/assets/{eventmodeling-K75KTNOO-aCZfYnCI.js → eventmodeling-K75KTNOO-DaFpPPks.js} +1 -1
- package/dist/public/assets/flowDiagram-MALGAFMO-V5qkYWIO.js +1 -0
- package/dist/public/assets/{freemarker2-DMN60LeK.js → freemarker2-BLxfRHsw.js} +1 -1
- package/dist/public/assets/{ganttDiagram-23REXITY-DioU8TlD.js → ganttDiagram-23REXITY-Md-SavIS.js} +1 -1
- package/dist/public/assets/gitGraph-VSP46ZUC-1q8ldRXU.js +1 -0
- package/dist/public/assets/{gitGraphDiagram-STJD7YCW--q3ctg6y.js → gitGraphDiagram-STJD7YCW-CMSwTghO.js} +1 -1
- package/dist/public/assets/{handlebars-B_-qdvpB.js → handlebars-sNpu01kP.js} +1 -1
- package/dist/public/assets/{html-BN8Ah3Js.js → html-C_tKd-uP.js} +1 -1
- package/dist/public/assets/{index-B3A--ac8.js → index-Bn86rI4n.js} +2 -2
- package/dist/public/assets/info-OHQRW6UA-Crere6sx.js +1 -0
- package/dist/public/assets/{infoDiagram-KBXO4MBG-CGXteYo9.js → infoDiagram-KBXO4MBG-CwgNj-7i.js} +1 -1
- package/dist/public/assets/{ishikawaDiagram-M35NCXHK-DM2LmOAc.js → ishikawaDiagram-M35NCXHK-BSlzQNMN.js} +1 -1
- package/dist/public/assets/{javascript-BlizGb0q.js → javascript-l3qKw0L-.js} +1 -1
- package/dist/public/assets/{journeyDiagram-OPLOXDXO-CNITRtGl.js → journeyDiagram-OPLOXDXO-B09LPEnF.js} +1 -1
- package/dist/public/assets/{jsonMode-CEUmT5sN.js → jsonMode-5SQQn1EX.js} +1 -1
- package/dist/public/assets/{kanban-definition-BZKZHSQY-BPUuS9um.js → kanban-definition-BZKZHSQY-BiW4aJ29.js} +1 -1
- package/dist/public/assets/{liquid-BbyLjUbE.js → liquid-BGyTIIUt.js} +1 -1
- package/dist/public/assets/{mdx-DiQz7Q35.js → mdx-8tGjz4em.js} +1 -1
- package/dist/public/assets/{mermaid-parser.core-Dum100hC.js → mermaid-parser.core-CctN5b0z.js} +3 -3
- package/dist/public/assets/{mermaid.core-BWmWf6XO.js → mermaid.core-7ERSdZ4-.js} +4 -4
- package/dist/public/assets/{mindmap-definition-I2QAS2VK-L8HyYUDY.js → mindmap-definition-I2QAS2VK-D-GOUwW1.js} +1 -1
- package/dist/public/assets/module-DEqsdd00.js +1 -0
- package/dist/public/assets/module-TWc52XwT.js +2244 -0
- package/dist/public/assets/{monaco-zOOyBmxy.js → monaco-B_9hlk78.js} +3 -3
- package/dist/public/assets/packet-JDAUHWVQ-qMf5LkHT.js +1 -0
- package/dist/public/assets/{pegDiagram-FD4XPPHP-CTZKPo0Z.js → pegDiagram-FD4XPPHP-Dmy1fWB3.js} +1 -1
- package/dist/public/assets/phaser.esm-BxCDEWDb.js +3202 -0
- package/dist/public/assets/pie-XZMESJXO-BjqLn4qm.js +1 -0
- package/dist/public/assets/{pieDiagram-J4AKIIQI-DAeT3dFi.js → pieDiagram-J4AKIIQI-CXFHLYTg.js} +1 -1
- package/dist/public/assets/{python-C984gt98.js → python-e-JK0s5M.js} +1 -1
- package/dist/public/assets/{quadrantDiagram-XTYBLID2--PXxwV1Z.js → quadrantDiagram-XTYBLID2-RQvEpGWO.js} +1 -1
- package/dist/public/assets/radar-ABXABTNO-DWO6t_4C.js +1 -0
- package/dist/public/assets/railroad-I3PHUGI6-D1XOJPWy.js +1 -0
- package/dist/public/assets/{railroad-abnf-LNEFI6M7-BYcFfrCa.js → railroad-abnf-LNEFI6M7-CDOSPZwX.js} +1 -1
- package/dist/public/assets/{railroad-ebnf-DWYD2UWJ-Cd33qxAm.js → railroad-ebnf-DWYD2UWJ-BTrNQ0DX.js} +1 -1
- package/dist/public/assets/{railroad-peg-JR7BVNR7-C5TpzaU8.js → railroad-peg-JR7BVNR7-B7NtVofS.js} +1 -1
- package/dist/public/assets/{railroadDiagram-MRQ6NCDL-DlWwjbhH.js → railroadDiagram-MRQ6NCDL-DsDrT0Jf.js} +1 -1
- package/dist/public/assets/{razor-BBqMR1Qn.js → razor-DtSPwumi.js} +1 -1
- package/dist/public/assets/{requirementDiagram-Y7LWUY3S-CsYBy9HS.js → requirementDiagram-Y7LWUY3S-BQh0hFuA.js} +1 -1
- package/dist/public/assets/{sankeyDiagram-WGJFYUXA-Baxyb5p9.js → sankeyDiagram-WGJFYUXA-BUXNAQEF.js} +1 -1
- package/dist/public/assets/{sequenceDiagram-5NDRBG5M-Cq6VeBT_.js → sequenceDiagram-5NDRBG5M-05f-N5V_.js} +1 -1
- package/dist/public/assets/{stateDiagram-v2-FJ4FJNEA-O60WKaE7.js → stateDiagram-v2-FJ4FJNEA-D6V1fGWV.js} +1 -1
- package/dist/public/assets/{swimlanes-UMQ2AFYF-C2nf1-Cc.js → swimlanes-UMQ2AFYF-DWhlPvKs.js} +1 -1
- package/dist/public/assets/swimlanesDiagram-OMPLPG4O-CRn5uHsY.js +8 -0
- package/dist/public/assets/three.module-CeVBJVoU.js +4225 -0
- package/dist/public/assets/{timeline-definition-SEUHKTQE-DEfUG6YH.js → timeline-definition-SEUHKTQE-CMdocOui.js} +1 -1
- package/dist/public/assets/treeView-D4JQ5SDB-D09wHNzT.js +1 -0
- package/dist/public/assets/treemap-SAJKECNS-ChxAT7Fq.js +1 -0
- package/dist/public/assets/{typescript-Gtq7f0aU.js → typescript-65jNyipU.js} +1 -1
- package/dist/public/assets/{usecaseDiagram-AFA6YXN4-Gw9DyJcx.js → usecaseDiagram-AFA6YXN4-BQTHUX1f.js} +1 -1
- package/dist/public/assets/{vennDiagram-NNMJR3RB-Clb3MLWF.js → vennDiagram-NNMJR3RB-BULkVTfA.js} +1 -1
- package/dist/public/assets/wardley-7MLQ67FV-DfSjKzbJ.js +1 -0
- package/dist/public/assets/{wardleyDiagram-S7YFUSEH-BrTRpwu2.js → wardleyDiagram-S7YFUSEH-Cek6l8lz.js} +1 -1
- package/dist/public/assets/{xml-Bx3nk7iG.js → xml-DWBejfu-.js} +1 -1
- package/dist/public/assets/{xychartDiagram-GGNKY7IX-BfjTcIsb.js → xychartDiagram-GGNKY7IX-ujnZQTWA.js} +1 -1
- package/dist/public/assets/{yaml-dFLE_rSl.js → yaml-CwRCT7q1.js} +1 -1
- package/dist/public/index.html +1 -1
- package/dist/public/launch.svg +46 -42
- package/dist/serve/index.mjs +8244 -3756
- package/package.json +33 -26
- package/dist/pi/dist/bundle/chunks/anthropic-messages-BWGCKOF4.js +0 -6
- package/dist/pi/dist/bundle/chunks/chunk-44DLKSKE.js +0 -1232
- package/dist/pi/dist/bundle/chunks/chunk-62VOPMLK.js +0 -65
- package/dist/pi/dist/bundle/chunks/chunk-7O7QKK6A.js +0 -2
- package/dist/pi/dist/bundle/chunks/chunk-CHWNPHIS.js +0 -82
- package/dist/pi/dist/bundle/chunks/chunk-NL4X6LBY.js +0 -4
- package/dist/pi/dist/bundle/chunks/chunk-NZY7EIPA.js +0 -4
- package/dist/pi/dist/bundle/chunks/chunk-R2EGYMOO.js +0 -7
- package/dist/pi/dist/bundle/chunks/chunk-UKVNB6C4.js +0 -2
- package/dist/pi/dist/bundle/chunks/chunk-USJZMAIR.js +0 -2
- package/dist/pi/dist/bundle/chunks/chunk-VOLAXWGI.js +0 -2
- package/dist/pi/dist/bundle/chunks/openai-codex-responses-QAWLOQSN.js +0 -10
- package/dist/pi/dist/bundle/chunks/openai-responses-MD3562FB.js +0 -4
- package/dist/pi/dist/bundle/chunks/virtual-modules-O76XM3OB.js +0 -2
- package/dist/public/assets/browser-y6EDNUmc.js +0 -12
- package/dist/public/assets/cynefin-EF2NZ3EQ-CoY4CrZu.js +0 -1
- package/dist/public/assets/flowDiagram-MALGAFMO-CATkJShO.js +0 -1
- package/dist/public/assets/gitGraph-VSP46ZUC-g4yHXXxx.js +0 -1
- package/dist/public/assets/info-OHQRW6UA-CKADJjz4.js +0 -1
- package/dist/public/assets/module-CH7IXa5L.js +0 -1781
- package/dist/public/assets/module-DNAasuMC.js +0 -1
- package/dist/public/assets/packet-JDAUHWVQ-CpKMhX4K.js +0 -1
- package/dist/public/assets/pie-XZMESJXO-CW-zGDRd.js +0 -1
- package/dist/public/assets/radar-ABXABTNO-Cg8W433p.js +0 -1
- package/dist/public/assets/railroad-I3PHUGI6-DriMt2PQ.js +0 -1
- package/dist/public/assets/swimlanesDiagram-OMPLPG4O-B46JxqS8.js +0 -8
- package/dist/public/assets/treeView-D4JQ5SDB-1LhEWwC9.js +0 -1
- package/dist/public/assets/treemap-SAJKECNS-D3t3N7nS.js +0 -1
- package/dist/public/assets/wardley-7MLQ67FV-D3sAsd8p.js +0 -1
|
@@ -1,3 +1,88 @@
|
|
|
1
|
+
// ../ta-protocol/esm/common/redactor.js
|
|
2
|
+
var REDACTED = "[redacted]";
|
|
3
|
+
var WHOLE = [
|
|
4
|
+
/-----BEGIN [A-Z0-9 ]*PRIVATE KEY-----[\s\S]*?-----END [A-Z0-9 ]*PRIVATE KEY-----/g,
|
|
5
|
+
/\bsk-(?:ant-|proj-)?[A-Za-z0-9_-]{20,}/g,
|
|
6
|
+
/\bgh[pousr]_[A-Za-z0-9]{30,}\b/g,
|
|
7
|
+
/\bgithub_pat_[A-Za-z0-9_]{40,}\b/g,
|
|
8
|
+
/\bglpat-[A-Za-z0-9_-]{20,}\b/g,
|
|
9
|
+
/\bxox[abprs]-[A-Za-z0-9-]{10,}\b/g,
|
|
10
|
+
/\b(?:AKIA|ASIA)[0-9A-Z]{16}\b/g,
|
|
11
|
+
/\bAIza[0-9A-Za-z_-]{35}\b/g,
|
|
12
|
+
/\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}/g
|
|
13
|
+
];
|
|
14
|
+
var NAMED = [
|
|
15
|
+
/(\bBearer\s+)[A-Za-z0-9._~+/-]{16,}=*/gi,
|
|
16
|
+
/(\b[A-Za-z0-9_.-]*(?:password|passwd|pwd|secret|token|api[_-]?key|access[_-]?key|private[_-]?key)[A-Za-z0-9_.-]*["']?\s*[:=]\s*["']?)([^\s"'`,;]{6,})/gi,
|
|
17
|
+
/(:\/\/[^\s:/@]+:)([^\s@/]{3,})(@)/g
|
|
18
|
+
];
|
|
19
|
+
|
|
20
|
+
class Redactor {
|
|
21
|
+
constructor() {
|
|
22
|
+
this.count = 0;
|
|
23
|
+
}
|
|
24
|
+
text(text) {
|
|
25
|
+
let out = text;
|
|
26
|
+
for (const pattern of WHOLE) {
|
|
27
|
+
out = out.replace(pattern, () => this.hide());
|
|
28
|
+
}
|
|
29
|
+
out = out.replace(NAMED[0], (_match, before) => before + this.hide());
|
|
30
|
+
out = out.replace(NAMED[1], (match, before, value) => Redactor.placeholder(value) ? match : before + this.hide());
|
|
31
|
+
out = out.replace(NAMED[2], (_match, before, _value, after) => before + this.hide() + after);
|
|
32
|
+
return out;
|
|
33
|
+
}
|
|
34
|
+
value(value, max) {
|
|
35
|
+
if (typeof value === "string") {
|
|
36
|
+
return Redactor.cut(this.text(value), max);
|
|
37
|
+
}
|
|
38
|
+
if (Array.isArray(value)) {
|
|
39
|
+
return value.map((item) => this.value(item, max));
|
|
40
|
+
}
|
|
41
|
+
if (value && typeof value === "object") {
|
|
42
|
+
return Object.fromEntries(Object.entries(value).map(([key, item]) => [key, this.value(item, max)]));
|
|
43
|
+
}
|
|
44
|
+
return value;
|
|
45
|
+
}
|
|
46
|
+
static cut(text, max) {
|
|
47
|
+
return text.length > max ? `${text.slice(0, max)}…` : text;
|
|
48
|
+
}
|
|
49
|
+
hide() {
|
|
50
|
+
this.count++;
|
|
51
|
+
return REDACTED;
|
|
52
|
+
}
|
|
53
|
+
static placeholder(value) {
|
|
54
|
+
return /^(?:\$|<|\{|\[redacted|process\.env|os\.environ|xxx|\*{3})/i.test(value) || /^(?:true|false|null|undefined|none|string|number)$/i.test(value);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// ../ta-relay/esm/common/relay-card.js
|
|
59
|
+
var RELAY_AGENT_KIND = "ta-agent";
|
|
60
|
+
var RelayAgentCards;
|
|
61
|
+
(function(RelayAgentCards2) {
|
|
62
|
+
const MAX_ROLE = 8000;
|
|
63
|
+
function parse(data) {
|
|
64
|
+
try {
|
|
65
|
+
const card = JSON.parse(typeof data === "string" ? data : new TextDecoder().decode(data));
|
|
66
|
+
if ((card === null || card === undefined ? undefined : card.v) !== 1 || typeof card.name !== "string" || !card.name.trim() || typeof card.role !== "string" || !card.role.trim()) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
const color = typeof card.color === "string" && /^#[0-9a-fA-F]{6}$/.test(card.color) ? card.color : undefined;
|
|
70
|
+
return {
|
|
71
|
+
v: 1,
|
|
72
|
+
name: card.name.trim().slice(0, 32),
|
|
73
|
+
role: card.role.trim().slice(0, MAX_ROLE),
|
|
74
|
+
mark: typeof card.mark === "string" && card.mark.trim() ? card.mark.trim().slice(0, 2) : card.name.trim().slice(0, 1).toUpperCase(),
|
|
75
|
+
...Number.isInteger(card.face) ? { face: card.face } : {},
|
|
76
|
+
...color ? { color } : {},
|
|
77
|
+
...typeof card.redacted === "number" && card.redacted > 0 ? { redacted: card.redacted } : {}
|
|
78
|
+
};
|
|
79
|
+
} catch (_a) {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
RelayAgentCards2.parse = parse;
|
|
84
|
+
})(RelayAgentCards || (RelayAgentCards = {}));
|
|
85
|
+
|
|
1
86
|
// web-src/channels-model.ts
|
|
2
87
|
var NAME = "@celljs/ta-channels";
|
|
3
88
|
var AGENT_MARK = "one of the agents of Ta";
|
|
@@ -8,12 +93,10 @@ var Keys;
|
|
|
8
93
|
Keys.QUEUE = "queue";
|
|
9
94
|
Keys.WORKING = "working";
|
|
10
95
|
Keys.FOCUS = "focus";
|
|
11
|
-
Keys.
|
|
12
|
-
Keys.
|
|
96
|
+
Keys.ANSWERED = "answered";
|
|
97
|
+
Keys.CARDS = "cards";
|
|
13
98
|
Keys.MESSAGES = "messages/";
|
|
14
99
|
Keys.messages = (channelId) => `${Keys.MESSAGES}${channelId}`;
|
|
15
|
-
Keys.request = (id) => `${Keys.REQUESTS}${id}`;
|
|
16
|
-
Keys.result = (id) => `${Keys.RESULTS}${id}`;
|
|
17
100
|
})(Keys ||= {});
|
|
18
101
|
var USER = "user";
|
|
19
102
|
var TA = "ta";
|
|
@@ -27,6 +110,8 @@ var MAX_MEMBERS = 12;
|
|
|
27
110
|
var DEFAULT_ROLE = "You help the user with what they ask, as a colleague who takes on the work and does it.";
|
|
28
111
|
var CONTEXT_MESSAGES = 12;
|
|
29
112
|
var MAX_NAME = 32;
|
|
113
|
+
var MAX_NOTICE = 2000;
|
|
114
|
+
var NOTICE_HEADINGS = { zh: ["决定", "约定", "待办"], en: ["Decisions", "Conventions", "To do"] };
|
|
30
115
|
|
|
31
116
|
// web-src/channels-util.ts
|
|
32
117
|
var ChannelsUtil;
|
|
@@ -283,8 +368,8 @@ var ChannelsUtil;
|
|
|
283
368
|
return team.channels.filter((channel) => channel.by !== "ta");
|
|
284
369
|
}
|
|
285
370
|
ChannelsUtil.ownChannels = ownChannels;
|
|
286
|
-
function pinnedFirst(
|
|
287
|
-
return [...
|
|
371
|
+
function pinnedFirst(items) {
|
|
372
|
+
return [...items.filter((item) => item.pinned), ...items.filter((item) => !item.pinned)];
|
|
288
373
|
}
|
|
289
374
|
ChannelsUtil.pinnedFirst = pinnedFirst;
|
|
290
375
|
function removeChannel(team, ref) {
|
|
@@ -332,6 +417,11 @@ var ChannelsUtil;
|
|
|
332
417
|
if (input.keep === true) {
|
|
333
418
|
delete agent.temporary;
|
|
334
419
|
}
|
|
420
|
+
if (input.pinned === true) {
|
|
421
|
+
agent.pinned = true;
|
|
422
|
+
} else if (input.pinned !== undefined) {
|
|
423
|
+
delete agent.pinned;
|
|
424
|
+
}
|
|
335
425
|
if (input.cwd !== undefined) {
|
|
336
426
|
const cwd = typeof input.cwd === "string" && input.cwd.trim() ? input.cwd.trim() : undefined;
|
|
337
427
|
if (cwd !== before.cwd) {
|
|
@@ -442,16 +532,39 @@ var ChannelsUtil;
|
|
|
442
532
|
`You are ${agent.name}, ${AGENT_MARK}. Your role: ${agent.role}`,
|
|
443
533
|
"You work with the user, Ta and other agents in channels. A message for you starts with a <context> block: the channel, its members, the recent messages and who speaks to you; answer what follows the block.",
|
|
444
534
|
"Do the part of the work your role covers with your tools, then answer in a few sentences: your answer is posted to the channel as it is.",
|
|
445
|
-
"To hand work to another member, write @ and their name in your answer; name nobody when the work is done or you need the user."
|
|
535
|
+
"To hand work to another member, write @ and their name in your answer; name nobody when the work is done or you need the user.",
|
|
536
|
+
NOTICE_RULE
|
|
446
537
|
].join(`
|
|
447
538
|
`);
|
|
448
539
|
}
|
|
449
540
|
ChannelsUtil.systemPrompt = systemPrompt;
|
|
541
|
+
function setNotice(team, input) {
|
|
542
|
+
const before = channelOf(team, input.channel);
|
|
543
|
+
const text = typeof input.text === "string" ? input.text.replace(/\r\n/g, `
|
|
544
|
+
`).trim() : "";
|
|
545
|
+
if (text.length > MAX_NOTICE) {
|
|
546
|
+
throw new Error(`The notice is too long (${text.length} characters, ${MAX_NOTICE} at most): keep it short, and drop to-dos done long ago.`);
|
|
547
|
+
}
|
|
548
|
+
if (text === (before.notice?.text ?? "")) {
|
|
549
|
+
return { team, channel: before, before, changed: false };
|
|
550
|
+
}
|
|
551
|
+
const channel = { ...before };
|
|
552
|
+
if (text) {
|
|
553
|
+
channel.notice = { text, at: input.at ?? Date.now(), by: input.by };
|
|
554
|
+
} else {
|
|
555
|
+
delete channel.notice;
|
|
556
|
+
}
|
|
557
|
+
return { team: { ...team, channels: team.channels.map((other) => other.id === channel.id ? channel : other) }, channel, before, changed: true };
|
|
558
|
+
}
|
|
559
|
+
ChannelsUtil.setNotice = setNotice;
|
|
450
560
|
function prompt(team, channel, history, message, agent) {
|
|
451
561
|
const labels = { user: "user", ta: "Ta" };
|
|
452
562
|
const members = channel.members.map((id) => team.agents.find((other) => other.id === id)).filter((other) => !!other).map((other) => `@${other.name}${other.id === agent.id ? " (you)" : ""}: ${firstLine(other.role)}`);
|
|
453
|
-
const before = history.filter((item) => item.id !== message.id && !item.failed).slice(-CONTEXT_MESSAGES);
|
|
563
|
+
const before = history.filter((item) => item.id !== message.id && !item.failed && !item.notice).slice(-CONTEXT_MESSAGES);
|
|
454
564
|
const lines = [`[#${channel.name}]${channel.topic ? ` ${channel.topic}` : ""}`, "Members:", ...members.map((line) => `- ${line}`)];
|
|
565
|
+
if (channel.notice) {
|
|
566
|
+
lines.push("", "Notice of the channel (follow it; keep it with update_channel_notice):", channel.notice.text);
|
|
567
|
+
}
|
|
455
568
|
if (before.length > 0) {
|
|
456
569
|
lines.push("", "Recent messages:", ...before.map((item) => `${authorName(team, item.author, labels)}: ${item.text}`));
|
|
457
570
|
}
|
|
@@ -474,7 +587,8 @@ ${message.text}`;
|
|
|
474
587
|
}
|
|
475
588
|
const name = (id) => team.agents.find((agent) => agent.id === id)?.name ?? id;
|
|
476
589
|
const agents = team.agents.map((agent) => `- @${agent.name}: ${firstLine(agent.role)}`);
|
|
477
|
-
const channels = team.channels.map((channel) => `- #${channel.name}${channel.topic ? ` (${channel.topic})` : ""}: ${channel.members.map((id) => `@${name(id)}`).join(", ")}${channel.muted?.length ? `; muted by the user, answering nothing: ${channel.muted.map((id) => `@${name(id)}`).join(", ")}` : ""}`
|
|
590
|
+
const channels = team.channels.map((channel) => `- #${channel.name}${channel.topic ? ` (${channel.topic})` : ""}: ${channel.members.map((id) => `@${name(id)}`).join(", ")}${channel.muted?.length ? `; muted by the user, answering nothing: ${channel.muted.map((id) => `@${name(id)}`).join(", ")}` : ""}${channel.notice ? `
|
|
591
|
+
notice: ${channel.notice.text.replace(/\s+/g, " ").slice(0, 300)}` : ""}`);
|
|
478
592
|
return ["Agents:", ...agents, "", "Channels:", ...channels.length > 0 ? channels : ["none yet"]].join(`
|
|
479
593
|
`);
|
|
480
594
|
}
|
|
@@ -524,173 +638,105 @@ ${message.text}`;
|
|
|
524
638
|
`)[0];
|
|
525
639
|
}
|
|
526
640
|
})(ChannelsUtil ||= {});
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
if (!this.loading || again) {
|
|
563
|
-
this.loading = Promise.all([this.storage.get(Keys.TEAM), this.storage.get(Keys.WORKING)]).then(([team, working]) => this.update({ team: team ?? ChannelsUtil.emptyTeam(), working: working ?? {}, loaded: true }));
|
|
641
|
+
var NOTICE_RULE = [
|
|
642
|
+
"A channel may have a notice, in the <context> block: what its members decided, agreed and are to do. Follow it.",
|
|
643
|
+
`When the talk settles a decision or a convention, or adds, assigns or finishes a to-do, update it with update_channel_notice: the whole notice, short, under the headings ### ${NOTICE_HEADINGS.zh.join(" / ")} (### ${NOTICE_HEADINGS.en.join(" / ")} in English), in the language of the channel, to-dos as - [ ] or - [x] with who does them. The lead keeps it most; leave it for small talk.`
|
|
644
|
+
].join(`
|
|
645
|
+
`);
|
|
646
|
+
var NoticeUtil;
|
|
647
|
+
((NoticeUtil) => {
|
|
648
|
+
const PARTS = {
|
|
649
|
+
决定: "decisions",
|
|
650
|
+
decisions: "decisions",
|
|
651
|
+
约定: "conventions",
|
|
652
|
+
conventions: "conventions",
|
|
653
|
+
待办: "todo",
|
|
654
|
+
"to do": "todo",
|
|
655
|
+
todo: "todo",
|
|
656
|
+
"to-do": "todo"
|
|
657
|
+
};
|
|
658
|
+
function counts(text) {
|
|
659
|
+
const counts2 = { decisions: 0, conventions: 0, todo: 0, done: 0 };
|
|
660
|
+
let part;
|
|
661
|
+
for (const line of text.split(/\r?\n/)) {
|
|
662
|
+
const heading = /^\s*#{1,6}\s+(.+?)\s*#*\s*$/.exec(line) ?? /^\s*\*\*(.+?)\*\*\s*[::]?\s*$/.exec(line);
|
|
663
|
+
if (heading) {
|
|
664
|
+
part = PARTS[heading[1].replace(/[::]$/, "").trim().toLowerCase()];
|
|
665
|
+
continue;
|
|
666
|
+
}
|
|
667
|
+
const item = /^\s*(?:[-*+]|\d+[.)])\s+(\[( |x|X)\]\s+)?\S/.exec(line);
|
|
668
|
+
if (!part || !item) {
|
|
669
|
+
continue;
|
|
670
|
+
}
|
|
671
|
+
if (part === "todo" && item[2] && item[2] !== " ") {
|
|
672
|
+
counts2.done++;
|
|
673
|
+
} else {
|
|
674
|
+
counts2[part]++;
|
|
675
|
+
}
|
|
564
676
|
}
|
|
565
|
-
return
|
|
677
|
+
return counts2;
|
|
566
678
|
}
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
679
|
+
NoticeUtil.counts = counts;
|
|
680
|
+
function firstLine(text) {
|
|
681
|
+
for (const line of text.split(/\r?\n/)) {
|
|
682
|
+
const item = /^\s*(?:[-*+]|\d+[.)])\s+(?:\[[ xX]\]\s+)?(.+)$/.exec(line);
|
|
683
|
+
if (item) {
|
|
684
|
+
return item[1].replace(/[*_`~]+/g, "").trim();
|
|
685
|
+
}
|
|
571
686
|
}
|
|
572
|
-
|
|
573
|
-
this.update({ messages: { ...this.current.messages, [channelId]: messages } });
|
|
574
|
-
return messages;
|
|
575
|
-
}
|
|
576
|
-
async createAgent(input) {
|
|
577
|
-
const agent = await this.request({ kind: "createAgent", ...input });
|
|
578
|
-
await this.load(true);
|
|
579
|
-
return agent;
|
|
580
|
-
}
|
|
581
|
-
async createChannel(input) {
|
|
582
|
-
const channel = await this.request({ kind: "createChannel", ...input });
|
|
583
|
-
await this.load(true);
|
|
584
|
-
return channel;
|
|
585
|
-
}
|
|
586
|
-
async addMembers(channelId, members) {
|
|
587
|
-
const channel = await this.request({ kind: "addMembers", channel: channelId, members });
|
|
588
|
-
await this.load(true);
|
|
589
|
-
return channel;
|
|
590
|
-
}
|
|
591
|
-
async changeMember(channelId, agentId, change) {
|
|
592
|
-
const channel = await this.request({ kind: "changeMember", channel: channelId, agent: agentId, change });
|
|
593
|
-
await this.load(true);
|
|
594
|
-
return channel;
|
|
595
|
-
}
|
|
596
|
-
async updateChannel(channelId, change) {
|
|
597
|
-
const channel = await this.request({ kind: "updateChannel", channel: channelId, ...change });
|
|
598
|
-
await this.load(true);
|
|
599
|
-
return channel;
|
|
600
|
-
}
|
|
601
|
-
async deleteChannel(channelId) {
|
|
602
|
-
await this.request({ kind: "deleteChannel", channel: channelId });
|
|
603
|
-
const { [channelId]: _gone, ...messages } = this.current.messages;
|
|
604
|
-
this.update({ messages });
|
|
605
|
-
await this.load(true);
|
|
606
|
-
}
|
|
607
|
-
async resetAgent(agentId) {
|
|
608
|
-
const agent = await this.request({ kind: "resetAgent", agent: agentId });
|
|
609
|
-
await this.load(true);
|
|
610
|
-
return agent;
|
|
687
|
+
return text.split(/\r?\n/).find((line) => line.trim() && !/^\s*#/.test(line))?.trim() ?? "";
|
|
611
688
|
}
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
const
|
|
623
|
-
return
|
|
689
|
+
NoticeUtil.firstLine = firstLine;
|
|
690
|
+
})(NoticeUtil ||= {});
|
|
691
|
+
|
|
692
|
+
// web-src/agent-cards.ts
|
|
693
|
+
var AgentCards;
|
|
694
|
+
((AgentCards) => {
|
|
695
|
+
AgentCards.KIND = RELAY_AGENT_KIND;
|
|
696
|
+
AgentCards.MARK = "[ta-channels:card]";
|
|
697
|
+
function card(agent, color) {
|
|
698
|
+
const redactor = new Redactor;
|
|
699
|
+
const role = redactor.text(agent.role);
|
|
700
|
+
return {
|
|
701
|
+
v: 1,
|
|
702
|
+
name: agent.name,
|
|
703
|
+
role,
|
|
704
|
+
mark: agent.mark,
|
|
705
|
+
...agent.face !== undefined ? { face: agent.face } : {},
|
|
706
|
+
...color && /^#[0-9a-fA-F]{6}$/.test(color) ? { color } : {},
|
|
707
|
+
...redactor.count ? { redacted: redactor.count } : {}
|
|
708
|
+
};
|
|
624
709
|
}
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
request(request) {
|
|
629
|
-
const id = ChannelsUtil.newId("request");
|
|
630
|
-
const result = new Promise((resolve, reject) => {
|
|
631
|
-
const timer = setTimeout(() => {
|
|
632
|
-
this.pending.delete(id);
|
|
633
|
-
reject(new Error("The Ta service did not answer: the extension may be off, or the service still starting."));
|
|
634
|
-
}, this.options.timeoutMs);
|
|
635
|
-
this.pending.set(id, { resolve, reject, timer });
|
|
636
|
-
});
|
|
637
|
-
return this.storage.set(Keys.request(id), request).then(() => {
|
|
638
|
-
this.take(id);
|
|
639
|
-
return result;
|
|
640
|
-
});
|
|
710
|
+
AgentCards.card = card;
|
|
711
|
+
function parse(data) {
|
|
712
|
+
return RelayAgentCards.parse(data);
|
|
641
713
|
}
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
714
|
+
AgentCards.parse = parse;
|
|
715
|
+
function freeName(team, name) {
|
|
716
|
+
const base = (name.trim().replace(/\s+/g, "-") || "agent").slice(0, MAX_NAME - 3);
|
|
717
|
+
if (!ChannelsUtil.findAgent(team, base)) {
|
|
718
|
+
return base;
|
|
645
719
|
}
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
return;
|
|
650
|
-
}
|
|
651
|
-
this.pending.delete(id);
|
|
652
|
-
clearTimeout(pending.timer);
|
|
653
|
-
this.storage.set(Keys.result(id), null).catch(() => {
|
|
654
|
-
return;
|
|
655
|
-
});
|
|
656
|
-
if (result.ok) {
|
|
657
|
-
pending.resolve(result.value);
|
|
658
|
-
} else {
|
|
659
|
-
pending.reject(new Error(result.error));
|
|
660
|
-
}
|
|
661
|
-
}
|
|
662
|
-
async changed(keys) {
|
|
663
|
-
const reads = [];
|
|
664
|
-
for (const key of keys) {
|
|
665
|
-
if (key === Keys.TEAM || key === Keys.WORKING) {
|
|
666
|
-
reads.push(this.load(true));
|
|
667
|
-
} else if (key.startsWith(Keys.MESSAGES)) {
|
|
668
|
-
const channelId = key.slice(Keys.MESSAGES.length);
|
|
669
|
-
if (this.current.messages[channelId]) {
|
|
670
|
-
reads.push(this.messages(channelId, true));
|
|
671
|
-
}
|
|
672
|
-
} else if (key.startsWith(Keys.RESULTS)) {
|
|
673
|
-
reads.push(this.take(key.slice(Keys.RESULTS.length)));
|
|
674
|
-
} else if (key === Keys.FOCUS) {
|
|
675
|
-
reads.push(this.storage.get(Keys.FOCUS).then(async (focus) => {
|
|
676
|
-
if (focus) {
|
|
677
|
-
await this.load(true);
|
|
678
|
-
for (const listener of this.focusListeners) {
|
|
679
|
-
listener(focus.channelId);
|
|
680
|
-
}
|
|
681
|
-
}
|
|
682
|
-
}));
|
|
720
|
+
for (let n = 2;; n++) {
|
|
721
|
+
if (!ChannelsUtil.findAgent(team, `${base}-${n}`)) {
|
|
722
|
+
return `${base}-${n}`;
|
|
683
723
|
}
|
|
684
724
|
}
|
|
685
|
-
await Promise.all(reads).catch((error) => console.error(error));
|
|
686
725
|
}
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
726
|
+
AgentCards.freeName = freeName;
|
|
727
|
+
function adapt(cwd, zh) {
|
|
728
|
+
const context = [
|
|
729
|
+
AgentCards.MARK,
|
|
730
|
+
`You were just added to this Ta from a card someone shared: the role in your instructions is theirs, written for their own work. Fit it to the project of your directory (${cwd}): look at it first (its README, manifests such as package.json, its layout, how it builds and tests), then rewrite your role for it, keeping what you are for, and save it with update_my_role. Then tell the user in a few sentences, in ${zh ? "Chinese" : "English"}, what you changed and what you can do here. Change no files.`
|
|
731
|
+
].join(`
|
|
732
|
+
`);
|
|
733
|
+
return `<context>
|
|
734
|
+
${context}
|
|
735
|
+
</context>
|
|
736
|
+
${zh ? "看看这个项目,把你的职责调整得贴合这里" : "Look at this project and fit your role to it"}`;
|
|
692
737
|
}
|
|
693
|
-
|
|
738
|
+
AgentCards.adapt = adapt;
|
|
739
|
+
})(AgentCards ||= {});
|
|
694
740
|
|
|
695
741
|
// web-src/react.ts
|
|
696
742
|
var React;
|
|
@@ -979,6 +1025,9 @@ function shape(face, look) {
|
|
|
979
1025
|
});
|
|
980
1026
|
}
|
|
981
1027
|
}
|
|
1028
|
+
function faceColor(face) {
|
|
1029
|
+
return (LOOKS[face] ?? LOOKS[0]).color;
|
|
1030
|
+
}
|
|
982
1031
|
function Face({ face, size, working }) {
|
|
983
1032
|
const look = LOOKS[face] ?? LOOKS[0];
|
|
984
1033
|
const half = look.gap / 2;
|
|
@@ -1060,7 +1109,7 @@ function RoomFace({ members, faces, size, working }) {
|
|
|
1060
1109
|
working: working.includes(lead.id)
|
|
1061
1110
|
});
|
|
1062
1111
|
}
|
|
1063
|
-
const small = Math.round(size * 0.
|
|
1112
|
+
const small = Math.round(size * 0.76);
|
|
1064
1113
|
return /* @__PURE__ */ React.createElement("span", {
|
|
1065
1114
|
className: "tac-room",
|
|
1066
1115
|
style: { width: size, height: size },
|
|
@@ -1087,12 +1136,16 @@ var EN = {
|
|
|
1087
1136
|
agents: "Agents",
|
|
1088
1137
|
newChannel: "New channel",
|
|
1089
1138
|
newAgent: "New agent",
|
|
1139
|
+
scan: "Scan",
|
|
1090
1140
|
name: "Name",
|
|
1091
1141
|
role: "Role",
|
|
1092
1142
|
rolePlaceholder: "What it does and how, as instructions to it",
|
|
1093
1143
|
topic: "Topic",
|
|
1094
1144
|
members: "Members",
|
|
1095
1145
|
addMembers: "Add members",
|
|
1146
|
+
makeExtension: "Make an extension",
|
|
1147
|
+
makeExtensionDetail: "Of what was worked out here",
|
|
1148
|
+
makeExtensionAsk: "Make what this channel worked out an extension, with the ta-package skill, to do it again in a click",
|
|
1096
1149
|
add: "Add",
|
|
1097
1150
|
allMembers: "Every agent is in this channel already",
|
|
1098
1151
|
membersHint: "The first one you pick leads: it answers what names nobody.",
|
|
@@ -1117,12 +1170,10 @@ var EN = {
|
|
|
1117
1170
|
search: "Search",
|
|
1118
1171
|
clear: "Clear",
|
|
1119
1172
|
new: "New",
|
|
1120
|
-
idle: "Idle",
|
|
1121
1173
|
answeringIn: "Answering in #{channel}",
|
|
1122
1174
|
answeringNow: "{name} is answering…",
|
|
1123
1175
|
noMatch: "No matching agents or channels",
|
|
1124
1176
|
noMessages: "No messages yet",
|
|
1125
|
-
leadOf: "Lead: {name}",
|
|
1126
1177
|
noAgentsYet: "No agents yet",
|
|
1127
1178
|
noAgentsYetHint: "Create one with +, or ask Ta for a team",
|
|
1128
1179
|
myDouble: "My double",
|
|
@@ -1188,6 +1239,7 @@ var EN = {
|
|
|
1188
1239
|
stoppedChannel: "Stopped the members answering in #{channel}.",
|
|
1189
1240
|
noMessagesToExport: "#{channel} has no messages yet.",
|
|
1190
1241
|
yourTurn: "Your turn",
|
|
1242
|
+
needsYou: "Waiting for you",
|
|
1191
1243
|
building: "Building the team…",
|
|
1192
1244
|
openInMain: "Open in the main area",
|
|
1193
1245
|
openInMainHint: "Talk to the team yourself",
|
|
@@ -1201,21 +1253,66 @@ var EN = {
|
|
|
1201
1253
|
membersSection: "Members",
|
|
1202
1254
|
byDirectory: "Group by directory",
|
|
1203
1255
|
channelsSection: "Channels",
|
|
1204
|
-
waitingSection: "Waiting for you",
|
|
1205
|
-
runningSection: "In progress",
|
|
1206
|
-
endedSection: "Ended",
|
|
1207
1256
|
showAll: "Show all {count}",
|
|
1208
1257
|
showFewer: "Show fewer",
|
|
1209
|
-
noTasksYet: "Nothing handed out yet",
|
|
1210
1258
|
waitingCount: "{count} need you",
|
|
1211
1259
|
runningCount: "{count} running",
|
|
1260
|
+
freshCount: "{count} new",
|
|
1212
1261
|
standingBy: "Standing by",
|
|
1213
|
-
noTasksYetHint: "Tell the double what you want done",
|
|
1214
1262
|
noTasksHere: "What the double hands out, tasks and teams, is listed here",
|
|
1215
|
-
tellDouble: "Talk to the double",
|
|
1216
1263
|
deleteTask: "Delete the team",
|
|
1217
1264
|
deleteTaskHint: "The messages of #{channel} go with it. Its agents stay, among your members.",
|
|
1218
|
-
selectTasks: "Select"
|
|
1265
|
+
selectTasks: "Select",
|
|
1266
|
+
toolCreateAgent: "Create agent",
|
|
1267
|
+
toolCreateChannel: "Create channel",
|
|
1268
|
+
toolAddToChannel: "Add to channel",
|
|
1269
|
+
toolPostToChannel: "Post to",
|
|
1270
|
+
toolHandOff: "Hand over to",
|
|
1271
|
+
handOff: "Hand over to…",
|
|
1272
|
+
handOffDetail: "An agent or a channel goes on with it",
|
|
1273
|
+
handedTo: "Handed over to {to}",
|
|
1274
|
+
handOffOpen: "Open",
|
|
1275
|
+
toolListChannels: "Look over the team",
|
|
1276
|
+
notice: "Notice",
|
|
1277
|
+
noticeCounts: "{decisions} decided · {conventions} agreed · {todo} to do",
|
|
1278
|
+
noticeEmpty: "No notice yet",
|
|
1279
|
+
noticeBy: "{name} updated it {time}",
|
|
1280
|
+
noticeEdit: "Edit the notice",
|
|
1281
|
+
noticeTemplate: `### Decisions
|
|
1282
|
+
-
|
|
1283
|
+
|
|
1284
|
+
### Conventions
|
|
1285
|
+
-
|
|
1286
|
+
|
|
1287
|
+
### To do
|
|
1288
|
+
- [ ] `,
|
|
1289
|
+
noticeHint: "What this channel decided, agreed and is to do: every member reads it with each message and follows it. Members keep it up to date as the talk settles things.",
|
|
1290
|
+
noticeUpdated: "{name} updated the notice",
|
|
1291
|
+
noticeCleared: "{name} took the notice down",
|
|
1292
|
+
noticeShow: "Show the notice",
|
|
1293
|
+
noticeHide: "Hide the notice",
|
|
1294
|
+
noticeSaved: "Notice saved",
|
|
1295
|
+
toolNotice: "Update the notice",
|
|
1296
|
+
toolRole: "Update its role",
|
|
1297
|
+
shareCard: "Share card…",
|
|
1298
|
+
cardTitle: "{name}'s card",
|
|
1299
|
+
cardKind: "An agent's card",
|
|
1300
|
+
cardMaking: "Making the link…",
|
|
1301
|
+
cardHint: "Whoever opens it in Ta, by scanning or pasting, adds it as an agent of theirs, which first fits its role to their project. Its role goes, with secrets taken out; not its directory nor its conversation. The link works for 30 days, while this computer is off too.",
|
|
1302
|
+
cardRedacted: "{n} places that looked like secrets were taken out.",
|
|
1303
|
+
copyLink: "Copy link",
|
|
1304
|
+
linkCopied: "Copied",
|
|
1305
|
+
sendLink: "Send",
|
|
1306
|
+
stopCard: "Stop sharing",
|
|
1307
|
+
cardStopped: "The link of the card no longer works.",
|
|
1308
|
+
cardOpening: "Opening the card…",
|
|
1309
|
+
cardAddTo: "Works in {dir}",
|
|
1310
|
+
cardChangeDir: "Change",
|
|
1311
|
+
cardAdd: "Add as my agent",
|
|
1312
|
+
cardAddHint: "It looks at the project there first and fits its role to it; you see what it changed in its conversation.",
|
|
1313
|
+
cardAdded: "Added as @{name}",
|
|
1314
|
+
cardOpen: "Open the conversation",
|
|
1315
|
+
cardFailed: "Could not open the card: {message}"
|
|
1219
1316
|
};
|
|
1220
1317
|
var ZH = {
|
|
1221
1318
|
title: "分身",
|
|
@@ -1223,12 +1320,16 @@ var ZH = {
|
|
|
1223
1320
|
agents: "智能体",
|
|
1224
1321
|
newChannel: "新建频道",
|
|
1225
1322
|
newAgent: "新建智能体",
|
|
1323
|
+
scan: "扫一扫",
|
|
1226
1324
|
name: "名字",
|
|
1227
1325
|
role: "职责",
|
|
1228
1326
|
rolePlaceholder: "它做什么、怎么做,写成给它的指示",
|
|
1229
1327
|
topic: "主题",
|
|
1230
1328
|
members: "成员",
|
|
1231
1329
|
addMembers: "添加成员",
|
|
1330
|
+
makeExtension: "做成扩展",
|
|
1331
|
+
makeExtensionDetail: "把这里商量出的事做成工具",
|
|
1332
|
+
makeExtensionAsk: "把这个频道里商量和做成的事做成扩展(用 ta-package 技能),以后一键就能再用",
|
|
1232
1333
|
add: "添加",
|
|
1233
1334
|
allMembers: "所有智能体都已在这个频道里",
|
|
1234
1335
|
membersHint: "先选的成员是负责人:没人被 @ 的消息由它回答。",
|
|
@@ -1253,12 +1354,10 @@ var ZH = {
|
|
|
1253
1354
|
search: "搜索",
|
|
1254
1355
|
clear: "清除",
|
|
1255
1356
|
new: "新建",
|
|
1256
|
-
idle: "空闲",
|
|
1257
1357
|
answeringIn: "正在 #{channel} 回答",
|
|
1258
1358
|
answeringNow: "{name} 正在回答…",
|
|
1259
1359
|
noMatch: "没有匹配的智能体或频道",
|
|
1260
1360
|
noMessages: "还没有消息",
|
|
1261
|
-
leadOf: "负责人:{name}",
|
|
1262
1361
|
noAgentsYet: "还没有智能体",
|
|
1263
1362
|
noAgentsYetHint: "点 + 新建,或让 Ta 组个团队",
|
|
1264
1363
|
myDouble: "我的分身",
|
|
@@ -1324,6 +1423,7 @@ var ZH = {
|
|
|
1324
1423
|
stoppedChannel: "已让 #{channel} 里正在回答的成员停下。",
|
|
1325
1424
|
noMessagesToExport: "#{channel} 还没有消息。",
|
|
1326
1425
|
yourTurn: "轮到你了",
|
|
1426
|
+
needsYou: "等你处理",
|
|
1327
1427
|
building: "正在组建团队…",
|
|
1328
1428
|
openInMain: "在主区打开",
|
|
1329
1429
|
openInMainHint: "亲自和团队对话",
|
|
@@ -1337,21 +1437,66 @@ var ZH = {
|
|
|
1337
1437
|
membersSection: "成员",
|
|
1338
1438
|
byDirectory: "按目录分组",
|
|
1339
1439
|
channelsSection: "频道",
|
|
1340
|
-
waitingSection: "待你处理",
|
|
1341
|
-
runningSection: "进行中",
|
|
1342
|
-
endedSection: "已结束",
|
|
1343
1440
|
showAll: "显示全部 {count} 个",
|
|
1344
1441
|
showFewer: "收起",
|
|
1345
|
-
noTasksYet: "还没有交出的事",
|
|
1346
1442
|
waitingCount: "{count} 个待你处理",
|
|
1347
1443
|
runningCount: "{count} 个进行中",
|
|
1444
|
+
freshCount: "{count} 个新结果",
|
|
1348
1445
|
standingBy: "待命",
|
|
1349
|
-
noTasksYetHint: "告诉分身你想做什么",
|
|
1350
1446
|
noTasksHere: "分身交出去的任务和团队会列在这里",
|
|
1351
|
-
tellDouble: "和分身说",
|
|
1352
1447
|
deleteTask: "删除这个团队",
|
|
1353
1448
|
deleteTaskHint: "#{channel} 的消息会一起删除,团队成员会留在你的成员里。",
|
|
1354
|
-
selectTasks: "多选"
|
|
1449
|
+
selectTasks: "多选",
|
|
1450
|
+
toolCreateAgent: "新建智能体",
|
|
1451
|
+
toolCreateChannel: "新建频道",
|
|
1452
|
+
toolAddToChannel: "拉进频道",
|
|
1453
|
+
toolPostToChannel: "发到频道",
|
|
1454
|
+
toolHandOff: "交给",
|
|
1455
|
+
handOff: "交给…",
|
|
1456
|
+
handOffDetail: "让智能体或频道接着做",
|
|
1457
|
+
handedTo: "已交给 {to}",
|
|
1458
|
+
handOffOpen: "打开",
|
|
1459
|
+
toolListChannels: "查看团队",
|
|
1460
|
+
notice: "公告",
|
|
1461
|
+
noticeCounts: "决定 {decisions} · 约定 {conventions} · 待办 {todo}",
|
|
1462
|
+
noticeEmpty: "还没有公告",
|
|
1463
|
+
noticeBy: "{name} {time} 更新",
|
|
1464
|
+
noticeEdit: "编辑公告",
|
|
1465
|
+
noticeTemplate: `### 决定
|
|
1466
|
+
-
|
|
1467
|
+
|
|
1468
|
+
### 约定
|
|
1469
|
+
-
|
|
1470
|
+
|
|
1471
|
+
### 待办
|
|
1472
|
+
- [ ] `,
|
|
1473
|
+
noticeHint: "这个频道定下的事、约定和待办:每个成员每次回答都会读到并照着做,讨论定下新的事时成员会自己更新。",
|
|
1474
|
+
noticeUpdated: "{name} 更新了公告",
|
|
1475
|
+
noticeCleared: "{name} 撤下了公告",
|
|
1476
|
+
noticeShow: "展开公告",
|
|
1477
|
+
noticeHide: "收起公告",
|
|
1478
|
+
noticeSaved: "公告已保存",
|
|
1479
|
+
toolNotice: "更新公告",
|
|
1480
|
+
toolRole: "更新职责",
|
|
1481
|
+
shareCard: "分享名片…",
|
|
1482
|
+
cardTitle: "{name} 的名片",
|
|
1483
|
+
cardKind: "智能体名片",
|
|
1484
|
+
cardMaking: "正在生成链接…",
|
|
1485
|
+
cardHint: "对方在 Ta 里扫码或粘贴链接,就能把它加为自己的智能体,加进来时它会先按对方的项目调整职责。只带上职责(隐去疑似密钥),不带工作目录和对话。链接 30 天内有效,你的电脑关机也能打开。",
|
|
1486
|
+
cardRedacted: "职责里有 {n} 处疑似密钥已隐去。",
|
|
1487
|
+
copyLink: "复制链接",
|
|
1488
|
+
linkCopied: "已复制",
|
|
1489
|
+
sendLink: "发送",
|
|
1490
|
+
stopCard: "停止分享",
|
|
1491
|
+
cardStopped: "名片链接已失效。",
|
|
1492
|
+
cardOpening: "正在打开名片…",
|
|
1493
|
+
cardAddTo: "工作目录:{dir}",
|
|
1494
|
+
cardChangeDir: "更改",
|
|
1495
|
+
cardAdd: "加为我的智能体",
|
|
1496
|
+
cardAddHint: "加进来后它会先看看这个目录下的项目,把职责调整得贴合这里;改了什么会在它的对话里告诉你。",
|
|
1497
|
+
cardAdded: "已添加为 @{name}",
|
|
1498
|
+
cardOpen: "打开对话",
|
|
1499
|
+
cardFailed: "打不开这张名片:{message}"
|
|
1355
1500
|
};
|
|
1356
1501
|
var ChannelWords;
|
|
1357
1502
|
((ChannelWords) => {
|
|
@@ -1429,7 +1574,7 @@ var ChannelViews;
|
|
|
1429
1574
|
});
|
|
1430
1575
|
if (!known) {
|
|
1431
1576
|
const agent = ChannelsUtil.findAgent(context.service.state.team, agentId);
|
|
1432
|
-
await context.pi.switchSession(opened, { title: agent?.name });
|
|
1577
|
+
await context.pi.switchSession(opened, { title: agent?.name, sessionFile: agent?.sessionFile });
|
|
1433
1578
|
return;
|
|
1434
1579
|
}
|
|
1435
1580
|
const shown = context.pi.switchSession(known).catch(() => {
|
|
@@ -1499,6 +1644,100 @@ function useServerCwd(pi) {
|
|
|
1499
1644
|
}
|
|
1500
1645
|
var SidebarUtil;
|
|
1501
1646
|
((SidebarUtil) => {
|
|
1647
|
+
function needsLook(task, seen) {
|
|
1648
|
+
if (task.status === "waiting") {
|
|
1649
|
+
return true;
|
|
1650
|
+
}
|
|
1651
|
+
if (task.status !== "done" && task.status !== "failed") {
|
|
1652
|
+
return false;
|
|
1653
|
+
}
|
|
1654
|
+
return !!task.endedAt && task.endedAt > (seen.at[task.key] ?? seen.since);
|
|
1655
|
+
}
|
|
1656
|
+
SidebarUtil.needsLook = needsLook;
|
|
1657
|
+
function answering(agents, sessions, opened) {
|
|
1658
|
+
return agentsOf(agents, sessions, opened, (session) => session.isStreaming);
|
|
1659
|
+
}
|
|
1660
|
+
SidebarUtil.answering = answering;
|
|
1661
|
+
function waiting(agents, sessions, opened) {
|
|
1662
|
+
return agentsOf(agents, sessions, opened, (session) => !!session.waiting);
|
|
1663
|
+
}
|
|
1664
|
+
SidebarUtil.waiting = waiting;
|
|
1665
|
+
function agentsOf(agents, sessions, opened, test) {
|
|
1666
|
+
const found = new Set;
|
|
1667
|
+
for (const session of sessions) {
|
|
1668
|
+
if (!test(session)) {
|
|
1669
|
+
continue;
|
|
1670
|
+
}
|
|
1671
|
+
const agent = agents.find((candidate) => !!session.sessionFile && candidate.sessionFile === session.sessionFile || opened.get(candidate.id) === session.sessionId);
|
|
1672
|
+
if (agent) {
|
|
1673
|
+
found.add(agent.id);
|
|
1674
|
+
}
|
|
1675
|
+
}
|
|
1676
|
+
return found;
|
|
1677
|
+
}
|
|
1678
|
+
function mergeSeen(a, b) {
|
|
1679
|
+
const since = a.since && b.since ? Math.max(a.since, b.since) : a.since || b.since;
|
|
1680
|
+
const at = { ...a.at };
|
|
1681
|
+
for (const [key, time2] of Object.entries(b.at)) {
|
|
1682
|
+
if (time2 > (at[key] ?? 0)) {
|
|
1683
|
+
at[key] = time2;
|
|
1684
|
+
}
|
|
1685
|
+
}
|
|
1686
|
+
for (const [key, time2] of Object.entries(at)) {
|
|
1687
|
+
if (time2 <= since) {
|
|
1688
|
+
delete at[key];
|
|
1689
|
+
}
|
|
1690
|
+
}
|
|
1691
|
+
const same = since === a.since && Object.keys(at).length === Object.keys(a.at).length && Object.entries(at).every(([key, time2]) => a.at[key] === time2);
|
|
1692
|
+
return same ? a : { since, at };
|
|
1693
|
+
}
|
|
1694
|
+
SidebarUtil.mergeSeen = mergeSeen;
|
|
1695
|
+
function look(seen, key, at, kept) {
|
|
1696
|
+
if ((seen.at[key] ?? seen.since) >= at) {
|
|
1697
|
+
return;
|
|
1698
|
+
}
|
|
1699
|
+
const others = kept ? Object.entries(seen.at).filter(([other]) => kept(other)) : Object.entries(seen.at);
|
|
1700
|
+
return { since: seen.since, at: { ...Object.fromEntries(others), [key]: at } };
|
|
1701
|
+
}
|
|
1702
|
+
SidebarUtil.look = look;
|
|
1703
|
+
function lastAt(agent, sessions, opened) {
|
|
1704
|
+
let latest;
|
|
1705
|
+
for (const session of sessions) {
|
|
1706
|
+
const its = !!agent.sessionFile && session.sessionFile === agent.sessionFile || !!session.sessionId && opened.get(agent.id) === session.sessionId;
|
|
1707
|
+
if (its && session.updatedAt > (latest ?? 0)) {
|
|
1708
|
+
latest = session.updatedAt;
|
|
1709
|
+
}
|
|
1710
|
+
}
|
|
1711
|
+
return latest;
|
|
1712
|
+
}
|
|
1713
|
+
SidebarUtil.lastAt = lastAt;
|
|
1714
|
+
function unseen(latest, seen, key, inChannel = 0) {
|
|
1715
|
+
return !!seen && seen.since > 0 && latest !== undefined && latest > Math.max(seen.at[key] ?? seen.since, inChannel);
|
|
1716
|
+
}
|
|
1717
|
+
SidebarUtil.unseen = unseen;
|
|
1718
|
+
function lastLines(agents, messages, sessions) {
|
|
1719
|
+
const lines = new Map;
|
|
1720
|
+
const keep = (id, text, at) => {
|
|
1721
|
+
const line = text?.replace(/\s+/g, " ").trim();
|
|
1722
|
+
if (line && at >= (lines.get(id)?.at ?? 0)) {
|
|
1723
|
+
lines.set(id, { text: line, at });
|
|
1724
|
+
}
|
|
1725
|
+
};
|
|
1726
|
+
for (const list of Object.values(messages)) {
|
|
1727
|
+
for (const message of list) {
|
|
1728
|
+
keep(message.author, message.text, message.at);
|
|
1729
|
+
}
|
|
1730
|
+
}
|
|
1731
|
+
const byFile = new Map(agents.filter((agent) => agent.sessionFile).map((agent) => [agent.sessionFile, agent.id]));
|
|
1732
|
+
for (const session of sessions) {
|
|
1733
|
+
const id = session.sessionFile && byFile.get(session.sessionFile);
|
|
1734
|
+
if (id) {
|
|
1735
|
+
keep(id, session.lastMessage, session.updatedAt);
|
|
1736
|
+
}
|
|
1737
|
+
}
|
|
1738
|
+
return lines;
|
|
1739
|
+
}
|
|
1740
|
+
SidebarUtil.lastLines = lastLines;
|
|
1502
1741
|
function time(at, language, now = new Date) {
|
|
1503
1742
|
if (!at) {
|
|
1504
1743
|
return "";
|
|
@@ -1513,6 +1752,11 @@ var SidebarUtil;
|
|
|
1513
1752
|
return date.toLocaleDateString(language, { year: "2-digit", month: "numeric", day: "numeric" });
|
|
1514
1753
|
}
|
|
1515
1754
|
SidebarUtil.time = time;
|
|
1755
|
+
function where(cwd) {
|
|
1756
|
+
const remote = /^ssh:\/\/([^/:]+)(?::\d+)?(\/.*)?$/.exec(cwd);
|
|
1757
|
+
return remote ? `${remote[1]}:${decodeURIComponent(remote[2] ?? "/")}` : cwd;
|
|
1758
|
+
}
|
|
1759
|
+
SidebarUtil.where = where;
|
|
1516
1760
|
function folder(cwd) {
|
|
1517
1761
|
const parts = cwd.split(/[\\/]+/).filter(Boolean);
|
|
1518
1762
|
return parts[parts.length - 1] ?? cwd;
|
|
@@ -1571,6 +1815,391 @@ function useSubmit(action, onDone) {
|
|
|
1571
1815
|
};
|
|
1572
1816
|
}
|
|
1573
1817
|
|
|
1818
|
+
// web-src/card.tsx
|
|
1819
|
+
var CardLink;
|
|
1820
|
+
((CardLink) => {
|
|
1821
|
+
const LINK = /^https?:\/\/[^/\s#?]+\/s#v=1&\S+$/i;
|
|
1822
|
+
function is(text) {
|
|
1823
|
+
const trimmed = text.trim();
|
|
1824
|
+
return LINK.test(trimmed) && new URLSearchParams(trimmed.slice(trimmed.indexOf("#") + 1)).get("c") === AgentCards.KIND;
|
|
1825
|
+
}
|
|
1826
|
+
CardLink.is = is;
|
|
1827
|
+
function id(text) {
|
|
1828
|
+
return new URLSearchParams(text.slice(text.indexOf("#") + 1)).get("s") ?? text;
|
|
1829
|
+
}
|
|
1830
|
+
CardLink.id = id;
|
|
1831
|
+
})(CardLink ||= {});
|
|
1832
|
+
function baseName(path) {
|
|
1833
|
+
return path.replace(/[\\/]+$/, "").split(/[\\/]/).pop() || path;
|
|
1834
|
+
}
|
|
1835
|
+
function CardFace({ pi, card }) {
|
|
1836
|
+
const w = ChannelViews.words(pi);
|
|
1837
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
1838
|
+
className: "tac-card-who"
|
|
1839
|
+
}, /* @__PURE__ */ React.createElement("span", {
|
|
1840
|
+
className: "tac-card-face"
|
|
1841
|
+
}, card.face !== undefined ? /* @__PURE__ */ React.createElement(Face, {
|
|
1842
|
+
face: card.face,
|
|
1843
|
+
size: 56
|
|
1844
|
+
}) : /* @__PURE__ */ React.createElement("span", {
|
|
1845
|
+
className: "tac-card-mark"
|
|
1846
|
+
}, card.mark)), /* @__PURE__ */ React.createElement("strong", {
|
|
1847
|
+
className: "tac-card-name"
|
|
1848
|
+
}, "@", card.name), /* @__PURE__ */ React.createElement("span", {
|
|
1849
|
+
className: "tac-card-kind"
|
|
1850
|
+
}, w.cardKind));
|
|
1851
|
+
}
|
|
1852
|
+
function CardDialog({ context, agent, onClose }) {
|
|
1853
|
+
const { pi, service } = context;
|
|
1854
|
+
const w = ChannelViews.words(pi);
|
|
1855
|
+
const [share, setShare] = React.useState();
|
|
1856
|
+
const [error, setError] = React.useState();
|
|
1857
|
+
const [copied, setCopied] = React.useState(false);
|
|
1858
|
+
const [stopping, setStopping] = React.useState(false);
|
|
1859
|
+
const card = React.useMemo(() => AgentCards.card(agent), [agent]);
|
|
1860
|
+
React.useEffect(() => {
|
|
1861
|
+
let live = true;
|
|
1862
|
+
service.shareAgent(agent.id, agent.face !== undefined ? faceColor(agent.face) : undefined).then((made) => live && setShare(made), (failure) => live && setError(ChannelViews.message(failure)));
|
|
1863
|
+
return () => {
|
|
1864
|
+
live = false;
|
|
1865
|
+
};
|
|
1866
|
+
}, [service, agent]);
|
|
1867
|
+
const Copy = ChannelViews.icon(pi, copied ? "Check" : "Copy");
|
|
1868
|
+
const Send = ChannelViews.icon(pi, "Share2");
|
|
1869
|
+
const canSend = typeof navigator !== "undefined" && typeof navigator.share === "function";
|
|
1870
|
+
const copy = () => share && void navigator.clipboard?.writeText(share.link).then(() => setCopied(true));
|
|
1871
|
+
const stop = () => {
|
|
1872
|
+
setStopping(true);
|
|
1873
|
+
service.stopCard(agent.id).then(() => {
|
|
1874
|
+
pi.ui.notify(w.cardStopped, "info");
|
|
1875
|
+
onClose();
|
|
1876
|
+
}, (failure) => {
|
|
1877
|
+
setStopping(false);
|
|
1878
|
+
setError(ChannelViews.message(failure));
|
|
1879
|
+
});
|
|
1880
|
+
};
|
|
1881
|
+
return /* @__PURE__ */ React.createElement(pi.ui.Dialog, {
|
|
1882
|
+
title: ChannelWords.format(w.cardTitle, { name: agent.name }),
|
|
1883
|
+
onClose
|
|
1884
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
1885
|
+
className: "tac-dialog tac-card"
|
|
1886
|
+
}, /* @__PURE__ */ React.createElement(CardFace, {
|
|
1887
|
+
pi,
|
|
1888
|
+
card
|
|
1889
|
+
}), /* @__PURE__ */ React.createElement("div", {
|
|
1890
|
+
className: "tac-card-role"
|
|
1891
|
+
}, card.role), card.redacted ? /* @__PURE__ */ React.createElement("p", {
|
|
1892
|
+
className: "tac-dialog-note"
|
|
1893
|
+
}, ChannelWords.format(w.cardRedacted, { n: String(card.redacted) })) : null, share ? /* @__PURE__ */ React.createElement(React.Fragment, null, pi.ui.QrCode && /* @__PURE__ */ React.createElement("div", {
|
|
1894
|
+
className: "tac-card-qr"
|
|
1895
|
+
}, /* @__PURE__ */ React.createElement(pi.ui.QrCode, {
|
|
1896
|
+
text: share.link,
|
|
1897
|
+
label: share.title
|
|
1898
|
+
})), /* @__PURE__ */ React.createElement("div", {
|
|
1899
|
+
className: "tac-card-link",
|
|
1900
|
+
title: share.link
|
|
1901
|
+
}, share.link), /* @__PURE__ */ React.createElement("div", {
|
|
1902
|
+
className: "tac-card-actions"
|
|
1903
|
+
}, /* @__PURE__ */ React.createElement("button", {
|
|
1904
|
+
type: "button",
|
|
1905
|
+
className: "tac-button tac-primary",
|
|
1906
|
+
onClick: copy
|
|
1907
|
+
}, /* @__PURE__ */ React.createElement(Copy, {
|
|
1908
|
+
size: 14
|
|
1909
|
+
}), copied ? w.linkCopied : w.copyLink), canSend && /* @__PURE__ */ React.createElement("button", {
|
|
1910
|
+
type: "button",
|
|
1911
|
+
className: "tac-button",
|
|
1912
|
+
onClick: () => void navigator.share({ title: share.title, url: share.link }).catch(() => {
|
|
1913
|
+
return;
|
|
1914
|
+
})
|
|
1915
|
+
}, /* @__PURE__ */ React.createElement(Send, {
|
|
1916
|
+
size: 14
|
|
1917
|
+
}), w.sendLink)), /* @__PURE__ */ React.createElement("p", {
|
|
1918
|
+
className: "tac-dialog-note"
|
|
1919
|
+
}, w.cardHint), /* @__PURE__ */ React.createElement("button", {
|
|
1920
|
+
type: "button",
|
|
1921
|
+
className: "tac-card-stop",
|
|
1922
|
+
disabled: stopping,
|
|
1923
|
+
onClick: stop
|
|
1924
|
+
}, w.stopCard)) : error ? /* @__PURE__ */ React.createElement("div", {
|
|
1925
|
+
className: "tac-error"
|
|
1926
|
+
}, error) : /* @__PURE__ */ React.createElement("div", {
|
|
1927
|
+
className: "tac-card-making"
|
|
1928
|
+
}, /* @__PURE__ */ React.createElement("span", {
|
|
1929
|
+
className: "ta-spinner"
|
|
1930
|
+
}), w.cardMaking)));
|
|
1931
|
+
}
|
|
1932
|
+
function CardView({ context, link }) {
|
|
1933
|
+
const { pi, service } = context;
|
|
1934
|
+
const w = ChannelViews.words(pi);
|
|
1935
|
+
const serverCwd = useServerCwd(pi);
|
|
1936
|
+
const [card, setCard] = React.useState();
|
|
1937
|
+
const [error, setError] = React.useState();
|
|
1938
|
+
const [cwd, setCwd] = React.useState();
|
|
1939
|
+
const [picking, setPicking] = React.useState(false);
|
|
1940
|
+
const [busy, setBusy] = React.useState(false);
|
|
1941
|
+
const [added, setAdded] = React.useState();
|
|
1942
|
+
React.useEffect(() => {
|
|
1943
|
+
let live = true;
|
|
1944
|
+
service.openCard(link).then((opened) => live && setCard(opened), (failure) => live && setError(ChannelViews.message(failure)));
|
|
1945
|
+
return () => {
|
|
1946
|
+
live = false;
|
|
1947
|
+
};
|
|
1948
|
+
}, [service, link]);
|
|
1949
|
+
const dir = cwd ?? serverCwd ?? "";
|
|
1950
|
+
const add = () => {
|
|
1951
|
+
setBusy(true);
|
|
1952
|
+
setError(undefined);
|
|
1953
|
+
service.addFromCard(link, dir).then((result) => {
|
|
1954
|
+
setBusy(false);
|
|
1955
|
+
setAdded(result);
|
|
1956
|
+
context.sessions.set(result.agent.id, result.sessionId);
|
|
1957
|
+
pi.ui.notify(ChannelWords.format(w.cardAdded, { name: result.agent.name }), "info");
|
|
1958
|
+
ChannelViews.openAgent(context, result.agent.id);
|
|
1959
|
+
}, (failure) => {
|
|
1960
|
+
setBusy(false);
|
|
1961
|
+
setError(ChannelViews.message(failure));
|
|
1962
|
+
});
|
|
1963
|
+
};
|
|
1964
|
+
if (!card) {
|
|
1965
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
1966
|
+
className: "tac-card-page"
|
|
1967
|
+
}, error ? /* @__PURE__ */ React.createElement(pi.ui.Empty, {
|
|
1968
|
+
title: ChannelWords.format(w.cardFailed, { message: error })
|
|
1969
|
+
}) : /* @__PURE__ */ React.createElement("div", {
|
|
1970
|
+
className: "tac-card-making"
|
|
1971
|
+
}, /* @__PURE__ */ React.createElement("span", {
|
|
1972
|
+
className: "ta-spinner"
|
|
1973
|
+
}), w.cardOpening));
|
|
1974
|
+
}
|
|
1975
|
+
const Folder = ChannelViews.icon(pi, "Folder");
|
|
1976
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
1977
|
+
className: "tac-card-page"
|
|
1978
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
1979
|
+
className: "tac-card"
|
|
1980
|
+
}, /* @__PURE__ */ React.createElement(CardFace, {
|
|
1981
|
+
pi,
|
|
1982
|
+
card
|
|
1983
|
+
}), /* @__PURE__ */ React.createElement("div", {
|
|
1984
|
+
className: "tac-card-role"
|
|
1985
|
+
}, /* @__PURE__ */ React.createElement(pi.ui.Markdown, {
|
|
1986
|
+
text: card.role
|
|
1987
|
+
})), added ? /* @__PURE__ */ React.createElement("div", {
|
|
1988
|
+
className: "tac-card-done"
|
|
1989
|
+
}, /* @__PURE__ */ React.createElement("span", null, ChannelWords.format(w.cardAdded, { name: added.agent.name })), /* @__PURE__ */ React.createElement("button", {
|
|
1990
|
+
type: "button",
|
|
1991
|
+
className: "tac-button",
|
|
1992
|
+
onClick: () => void ChannelViews.openAgent(context, added.agent.id)
|
|
1993
|
+
}, w.cardOpen)) : /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", {
|
|
1994
|
+
className: "tac-card-dir"
|
|
1995
|
+
}, /* @__PURE__ */ React.createElement(Folder, {
|
|
1996
|
+
size: 14
|
|
1997
|
+
}), /* @__PURE__ */ React.createElement("span", {
|
|
1998
|
+
title: dir
|
|
1999
|
+
}, ChannelWords.format(w.cardAddTo, { dir: baseName(dir) })), pi.ui.FolderPicker && /* @__PURE__ */ React.createElement("button", {
|
|
2000
|
+
type: "button",
|
|
2001
|
+
className: "tac-button tac-quiet",
|
|
2002
|
+
onClick: () => setPicking(true)
|
|
2003
|
+
}, w.cardChangeDir)), /* @__PURE__ */ React.createElement("button", {
|
|
2004
|
+
type: "button",
|
|
2005
|
+
className: busy ? "tac-button tac-primary ta-busy" : "tac-button tac-primary",
|
|
2006
|
+
disabled: busy || !dir,
|
|
2007
|
+
onClick: add
|
|
2008
|
+
}, w.cardAdd, busy && /* @__PURE__ */ React.createElement("span", {
|
|
2009
|
+
className: "ta-spinner ta-busy-mark ta-on-brand"
|
|
2010
|
+
})), /* @__PURE__ */ React.createElement("p", {
|
|
2011
|
+
className: "tac-dialog-note tac-center"
|
|
2012
|
+
}, w.cardAddHint)), error && /* @__PURE__ */ React.createElement("div", {
|
|
2013
|
+
className: "tac-error"
|
|
2014
|
+
}, error)), picking && pi.ui.FolderPicker && /* @__PURE__ */ React.createElement(pi.ui.FolderPicker, {
|
|
2015
|
+
initial: dir,
|
|
2016
|
+
onClose: () => setPicking(false),
|
|
2017
|
+
onPick: (path) => {
|
|
2018
|
+
setPicking(false);
|
|
2019
|
+
setCwd(path);
|
|
2020
|
+
}
|
|
2021
|
+
}));
|
|
2022
|
+
}
|
|
2023
|
+
function registerCardOpener(context) {
|
|
2024
|
+
const { pi } = context;
|
|
2025
|
+
pi.registerOpener((link) => {
|
|
2026
|
+
if (link.type !== "url" || !CardLink.is(link.url)) {
|
|
2027
|
+
return false;
|
|
2028
|
+
}
|
|
2029
|
+
pi.ui.openEditor({
|
|
2030
|
+
id: `ta-channels-card:${CardLink.id(link.url)}`,
|
|
2031
|
+
title: () => ChannelViews.words(pi).cardKind,
|
|
2032
|
+
icon: ChannelViews.icon(pi, "Contact"),
|
|
2033
|
+
render: () => /* @__PURE__ */ React.createElement(CardView, {
|
|
2034
|
+
context,
|
|
2035
|
+
link: link.url
|
|
2036
|
+
})
|
|
2037
|
+
});
|
|
2038
|
+
return true;
|
|
2039
|
+
}, { specific: true });
|
|
2040
|
+
}
|
|
2041
|
+
|
|
2042
|
+
// web-src/channels.ts
|
|
2043
|
+
class ChannelsClient {
|
|
2044
|
+
storage;
|
|
2045
|
+
send;
|
|
2046
|
+
current = { team: ChannelsUtil.emptyTeam(), messages: {}, working: {}, answered: {}, loaded: false, deleting: [] };
|
|
2047
|
+
listeners = new Set;
|
|
2048
|
+
focusListeners = new Set;
|
|
2049
|
+
loading;
|
|
2050
|
+
unlisten;
|
|
2051
|
+
constructor(storage, send) {
|
|
2052
|
+
this.storage = storage;
|
|
2053
|
+
this.send = send;
|
|
2054
|
+
this.unlisten = storage.onChange((keys) => void this.changed(keys));
|
|
2055
|
+
}
|
|
2056
|
+
get state() {
|
|
2057
|
+
return this.current;
|
|
2058
|
+
}
|
|
2059
|
+
subscribe(listener) {
|
|
2060
|
+
this.listeners.add(listener);
|
|
2061
|
+
return () => this.listeners.delete(listener);
|
|
2062
|
+
}
|
|
2063
|
+
onFocus(listener) {
|
|
2064
|
+
this.focusListeners.add(listener);
|
|
2065
|
+
return () => this.focusListeners.delete(listener);
|
|
2066
|
+
}
|
|
2067
|
+
dispose() {
|
|
2068
|
+
this.unlisten();
|
|
2069
|
+
}
|
|
2070
|
+
load(again = false) {
|
|
2071
|
+
if (!this.loading || again) {
|
|
2072
|
+
this.loading = Promise.all([
|
|
2073
|
+
this.storage.get(Keys.TEAM),
|
|
2074
|
+
this.storage.get(Keys.WORKING),
|
|
2075
|
+
this.storage.get(Keys.ANSWERED)
|
|
2076
|
+
]).then(([team, working, answered]) => this.update({ team: team ?? ChannelsUtil.emptyTeam(), working: working ?? {}, answered: answered ?? {}, loaded: true }));
|
|
2077
|
+
}
|
|
2078
|
+
return this.loading;
|
|
2079
|
+
}
|
|
2080
|
+
async messages(channelId, again = false) {
|
|
2081
|
+
const known = this.current.messages[channelId];
|
|
2082
|
+
if (known && !again) {
|
|
2083
|
+
return known;
|
|
2084
|
+
}
|
|
2085
|
+
const messages = await this.storage.get(Keys.messages(channelId)) ?? [];
|
|
2086
|
+
this.update({ messages: { ...this.current.messages, [channelId]: messages } });
|
|
2087
|
+
return messages;
|
|
2088
|
+
}
|
|
2089
|
+
async createAgent(input) {
|
|
2090
|
+
const agent = await this.send({ kind: "createAgent", ...input });
|
|
2091
|
+
await this.load(true);
|
|
2092
|
+
return agent;
|
|
2093
|
+
}
|
|
2094
|
+
async createChannel(input) {
|
|
2095
|
+
const channel = await this.send({ kind: "createChannel", ...input });
|
|
2096
|
+
await this.load(true);
|
|
2097
|
+
return channel;
|
|
2098
|
+
}
|
|
2099
|
+
async addMembers(channelId, members) {
|
|
2100
|
+
const channel = await this.send({ kind: "addMembers", channel: channelId, members });
|
|
2101
|
+
await this.load(true);
|
|
2102
|
+
return channel;
|
|
2103
|
+
}
|
|
2104
|
+
async changeMember(channelId, agentId, change) {
|
|
2105
|
+
const channel = await this.send({ kind: "changeMember", channel: channelId, agent: agentId, change });
|
|
2106
|
+
await this.load(true);
|
|
2107
|
+
return channel;
|
|
2108
|
+
}
|
|
2109
|
+
async updateChannel(channelId, change) {
|
|
2110
|
+
const channel = await this.send({ kind: "updateChannel", channel: channelId, ...change });
|
|
2111
|
+
await this.load(true);
|
|
2112
|
+
return channel;
|
|
2113
|
+
}
|
|
2114
|
+
async deleteChannel(channelId) {
|
|
2115
|
+
await this.deleting(channelId, async () => {
|
|
2116
|
+
await this.send({ kind: "deleteChannel", channel: channelId });
|
|
2117
|
+
const { [channelId]: _gone, ...messages } = this.current.messages;
|
|
2118
|
+
this.update({ messages });
|
|
2119
|
+
await this.load(true);
|
|
2120
|
+
});
|
|
2121
|
+
}
|
|
2122
|
+
async resetAgent(agentId) {
|
|
2123
|
+
const agent = await this.send({ kind: "resetAgent", agent: agentId });
|
|
2124
|
+
await this.load(true);
|
|
2125
|
+
return agent;
|
|
2126
|
+
}
|
|
2127
|
+
async updateAgent(agentId, change) {
|
|
2128
|
+
const agent = await this.send({ kind: "updateAgent", agent: agentId, ...change });
|
|
2129
|
+
await this.load(true);
|
|
2130
|
+
return agent;
|
|
2131
|
+
}
|
|
2132
|
+
async deleteAgent(agentId) {
|
|
2133
|
+
await this.deleting(agentId, async () => {
|
|
2134
|
+
await this.send({ kind: "deleteAgent", agent: agentId });
|
|
2135
|
+
await this.load(true);
|
|
2136
|
+
});
|
|
2137
|
+
}
|
|
2138
|
+
async deleting(id, action) {
|
|
2139
|
+
this.update({ deleting: [...this.current.deleting, id] });
|
|
2140
|
+
try {
|
|
2141
|
+
await action();
|
|
2142
|
+
} finally {
|
|
2143
|
+
this.update({ deleting: this.current.deleting.filter((other) => other !== id) });
|
|
2144
|
+
}
|
|
2145
|
+
}
|
|
2146
|
+
async openAgent(agentId) {
|
|
2147
|
+
const { sessionId } = await this.send({ kind: "openAgent", agent: agentId });
|
|
2148
|
+
return sessionId;
|
|
2149
|
+
}
|
|
2150
|
+
async setNotice(channelId, text) {
|
|
2151
|
+
const channel = await this.send({ kind: "setNotice", channel: channelId, text });
|
|
2152
|
+
await this.load(true);
|
|
2153
|
+
return channel;
|
|
2154
|
+
}
|
|
2155
|
+
shareAgent(agentId, color) {
|
|
2156
|
+
return this.send({ kind: "shareAgent", agent: agentId, ...color ? { color } : {} });
|
|
2157
|
+
}
|
|
2158
|
+
async stopCard(agentId) {
|
|
2159
|
+
return await this.send({ kind: "stopCard", agent: agentId });
|
|
2160
|
+
}
|
|
2161
|
+
openCard(link, password) {
|
|
2162
|
+
return this.send({ kind: "openCard", link, ...password ? { password } : {} });
|
|
2163
|
+
}
|
|
2164
|
+
async addFromCard(link, cwd, password) {
|
|
2165
|
+
const added = await this.send({ kind: "addFromCard", link, cwd, ...password ? { password } : {} });
|
|
2166
|
+
await this.load(true);
|
|
2167
|
+
return added;
|
|
2168
|
+
}
|
|
2169
|
+
async post(channelId, text) {
|
|
2170
|
+
await this.send({ kind: "post", channel: channelId, text });
|
|
2171
|
+
}
|
|
2172
|
+
async changed(keys) {
|
|
2173
|
+
const reads = [];
|
|
2174
|
+
for (const key of keys) {
|
|
2175
|
+
if (key === Keys.TEAM || key === Keys.WORKING || key === Keys.ANSWERED) {
|
|
2176
|
+
reads.push(this.load(true));
|
|
2177
|
+
} else if (key.startsWith(Keys.MESSAGES)) {
|
|
2178
|
+
const channelId = key.slice(Keys.MESSAGES.length);
|
|
2179
|
+
if (this.current.messages[channelId]) {
|
|
2180
|
+
reads.push(this.messages(channelId, true));
|
|
2181
|
+
}
|
|
2182
|
+
} else if (key === Keys.FOCUS) {
|
|
2183
|
+
reads.push(this.storage.get(Keys.FOCUS).then(async (focus) => {
|
|
2184
|
+
if (focus) {
|
|
2185
|
+
await this.load(true);
|
|
2186
|
+
for (const listener of this.focusListeners) {
|
|
2187
|
+
listener(focus.channelId);
|
|
2188
|
+
}
|
|
2189
|
+
}
|
|
2190
|
+
}));
|
|
2191
|
+
}
|
|
2192
|
+
}
|
|
2193
|
+
await Promise.all(reads).catch((error) => console.error(error));
|
|
2194
|
+
}
|
|
2195
|
+
update(change) {
|
|
2196
|
+
this.current = { ...this.current, ...change };
|
|
2197
|
+
for (const listener of this.listeners) {
|
|
2198
|
+
listener(this.current);
|
|
2199
|
+
}
|
|
2200
|
+
}
|
|
2201
|
+
}
|
|
2202
|
+
|
|
1574
2203
|
// web-src/create.tsx
|
|
1575
2204
|
var AGENT_PAGE = `${NAME}/agent`;
|
|
1576
2205
|
function newAgent(context) {
|
|
@@ -1674,14 +2303,20 @@ function NewAgentHead({ context }) {
|
|
|
1674
2303
|
function NewAgentPage({ context }) {
|
|
1675
2304
|
const { pi, service, ui } = context;
|
|
1676
2305
|
const { draft } = useUi(ui);
|
|
2306
|
+
const { loaded } = useChannels(service);
|
|
1677
2307
|
const w = ChannelViews.words(pi);
|
|
1678
2308
|
const Pencil = ChannelViews.icon(pi, "Pencil");
|
|
1679
2309
|
const Composer = pi.ui.Composer;
|
|
2310
|
+
const first = React.useRef(true);
|
|
1680
2311
|
React.useEffect(() => {
|
|
1681
|
-
if (!
|
|
2312
|
+
if (!loaded || !first.current) {
|
|
2313
|
+
return;
|
|
2314
|
+
}
|
|
2315
|
+
first.current = false;
|
|
2316
|
+
if (!ui.state.draft) {
|
|
1682
2317
|
newAgent(context);
|
|
1683
2318
|
}
|
|
1684
|
-
}, [
|
|
2319
|
+
}, [loaded, ui, context]);
|
|
1685
2320
|
if (!draft) {
|
|
1686
2321
|
return null;
|
|
1687
2322
|
}
|
|
@@ -1826,10 +2461,229 @@ function NewChannelDialog({ context, onClose }) {
|
|
|
1826
2461
|
className: "tac-dialog-actions"
|
|
1827
2462
|
}, /* @__PURE__ */ React.createElement("button", {
|
|
1828
2463
|
type: "submit",
|
|
1829
|
-
className: "tac-button tac-primary",
|
|
2464
|
+
className: busy ? "tac-button tac-primary ta-busy" : "tac-button tac-primary",
|
|
1830
2465
|
disabled: busy || !name.trim() || picked.length === 0
|
|
1831
|
-
}, w.create
|
|
2466
|
+
}, w.create, busy && /* @__PURE__ */ React.createElement("span", {
|
|
2467
|
+
className: "ta-spinner ta-busy-mark ta-on-brand"
|
|
2468
|
+
})))));
|
|
2469
|
+
}
|
|
2470
|
+
|
|
2471
|
+
// web-src/handoff.ts
|
|
2472
|
+
var HandOff;
|
|
2473
|
+
((HandOff) => {
|
|
2474
|
+
HandOff.TOOL = "hand_off";
|
|
2475
|
+
HandOff.CARD = "ta-channels-handoff";
|
|
2476
|
+
HandOff.BLOCK = "ta-handoff";
|
|
2477
|
+
const MARK = /\[ta-handoff:([^\]\s]+)\]/;
|
|
2478
|
+
HandOff.DEFINITION = {
|
|
2479
|
+
name: HandOff.TOOL,
|
|
2480
|
+
label: "Hand off",
|
|
2481
|
+
description: "Hands the work of this conversation over to one of the user's agents (@name) or channels (#name), when the user says so (hand it to, give it to, 交给, 转给). The other side does not see this conversation: write the brief it needs to go on, in the user's language: the goal, what is done and decided, what is left or blocks, the files, branches, commands and links that matter. It works on it in its own conversation, which the user follows; you stop working on it here. list_channels lists the team. After the call, say in one line to whom it went.",
|
|
2482
|
+
promptSnippet: "Hand the work over to one of the user's agents or channels",
|
|
2483
|
+
parameters: {
|
|
2484
|
+
type: "object",
|
|
2485
|
+
properties: {
|
|
2486
|
+
to: { type: "string", description: "@name of an agent or #name of a channel." },
|
|
2487
|
+
brief: { type: "string", description: "Complete in itself: the receiver sees only this." }
|
|
2488
|
+
},
|
|
2489
|
+
required: ["to", "brief"]
|
|
2490
|
+
}
|
|
2491
|
+
};
|
|
2492
|
+
function ref(target) {
|
|
2493
|
+
return `${target.kind === "agent" ? "@" : "#"}${target.name}`;
|
|
2494
|
+
}
|
|
2495
|
+
HandOff.ref = ref;
|
|
2496
|
+
function ask(language, to) {
|
|
2497
|
+
const fence = "```";
|
|
2498
|
+
const context = [
|
|
2499
|
+
`[ta-handoff:${to}]`,
|
|
2500
|
+
`The user hands the work of this conversation over to ${to}, which does not see this conversation.`,
|
|
2501
|
+
`- Write the brief it needs to go on: the goal, what is done and decided, what is left or blocks, the files, branches, commands and links that matter, in the user's language. Leave out what was only tried and dropped.`,
|
|
2502
|
+
`- With the tool ${HandOff.TOOL}, call it with to "${to}" and the brief, then say in one line that it went.`,
|
|
2503
|
+
`- Without it, say in one line what you hand over, then end your answer with the brief in a fenced block of the language ${HandOff.BLOCK}, which Ta reads to hand it over (a longer fence when the brief has one of its own):`,
|
|
2504
|
+
`${fence}${HandOff.BLOCK}`,
|
|
2505
|
+
"<the brief>",
|
|
2506
|
+
fence,
|
|
2507
|
+
`- When the conversation holds nothing to hand over yet, say so and ask what ${to} should do.`
|
|
2508
|
+
].join(`
|
|
2509
|
+
`);
|
|
2510
|
+
const line = language === "zh-CN" ? `把这件事交给 ${to}` : `Hand this over to ${to}`;
|
|
2511
|
+
return `<context>
|
|
2512
|
+
${context}
|
|
2513
|
+
</context>
|
|
2514
|
+
${line}`;
|
|
2515
|
+
}
|
|
2516
|
+
HandOff.ask = ask;
|
|
2517
|
+
function asked(text) {
|
|
2518
|
+
return MARK.exec(text)?.[1];
|
|
2519
|
+
}
|
|
2520
|
+
HandOff.asked = asked;
|
|
2521
|
+
function find(text) {
|
|
2522
|
+
const lines = text.split(/\r?\n/);
|
|
2523
|
+
let found;
|
|
2524
|
+
for (let index = 0;index < lines.length; index++) {
|
|
2525
|
+
const open = /^\s*(`{3,})\s*([\w-]+)\s*$/.exec(lines[index]);
|
|
2526
|
+
if (open?.[2] !== HandOff.BLOCK) {
|
|
2527
|
+
continue;
|
|
2528
|
+
}
|
|
2529
|
+
const close = new RegExp(`^\\s*${open[1]}\`*\\s*$`);
|
|
2530
|
+
const end = lines.findIndex((line, at) => at > index && close.test(line));
|
|
2531
|
+
found = lines.slice(index + 1, end < 0 ? lines.length : end);
|
|
2532
|
+
index = end < 0 ? lines.length : end;
|
|
2533
|
+
}
|
|
2534
|
+
const brief = found?.join(`
|
|
2535
|
+
`).trim();
|
|
2536
|
+
return brief || undefined;
|
|
2537
|
+
}
|
|
2538
|
+
HandOff.find = find;
|
|
2539
|
+
function message(origin, brief, language) {
|
|
2540
|
+
const title = origin.title?.trim() || (language === "zh-CN" ? "一个对话" : "a conversation");
|
|
2541
|
+
const head = language === "zh-CN" ? `(交接自“${title}”)` : `(Handed over from “${title}”)`;
|
|
2542
|
+
const context = [
|
|
2543
|
+
"The user handed you this work from another conversation of theirs, which you do not see; the brief below is all it says. Go on from there in this conversation, which the user follows; ask them when the brief leaves out something you need.",
|
|
2544
|
+
origin.sessionFile ? `That conversation is pi's session file ${origin.sessionFile}${origin.cwd ? `, working in ${origin.cwd}` : ""}: read it only when the brief is not enough.` : ""
|
|
2545
|
+
].filter(Boolean).join(`
|
|
2546
|
+
`);
|
|
2547
|
+
return `<context>
|
|
2548
|
+
${context}
|
|
2549
|
+
</context>
|
|
2550
|
+
${head}
|
|
2551
|
+
|
|
2552
|
+
${brief.trim()}`;
|
|
2553
|
+
}
|
|
2554
|
+
HandOff.message = message;
|
|
2555
|
+
function channelText(origin, brief, language) {
|
|
2556
|
+
const title = origin.title?.trim() || (language === "zh-CN" ? "一个对话" : "a conversation");
|
|
2557
|
+
return `${language === "zh-CN" ? `(交接自“${title}”)` : `(Handed over from “${title}”)`}
|
|
2558
|
+
|
|
2559
|
+
${brief.trim()}`;
|
|
2560
|
+
}
|
|
2561
|
+
HandOff.channelText = channelText;
|
|
2562
|
+
function serverLanguage(env = typeof process === "undefined" ? {} : process.env) {
|
|
2563
|
+
return /^zh/i.test(env.TA_LANGUAGE || env.LC_ALL || env.LC_MESSAGES || env.LANG || "") ? "zh-CN" : "en";
|
|
2564
|
+
}
|
|
2565
|
+
HandOff.serverLanguage = serverLanguage;
|
|
2566
|
+
function result(target) {
|
|
2567
|
+
return `Handed over to ${ref(target)}; it works on it in its own conversation, which the user follows. Do not go on with it here.`;
|
|
2568
|
+
}
|
|
2569
|
+
HandOff.result = result;
|
|
2570
|
+
})(HandOff ||= {});
|
|
2571
|
+
|
|
2572
|
+
// web-src/handoff-view.tsx
|
|
2573
|
+
var HandOffViewUtil;
|
|
2574
|
+
((HandOffViewUtil) => {
|
|
2575
|
+
function members(team, target) {
|
|
2576
|
+
if (target.kind === "agent") {
|
|
2577
|
+
const agent = team.agents.find((candidate) => candidate.id === target.id);
|
|
2578
|
+
return agent ? [agent] : [];
|
|
2579
|
+
}
|
|
2580
|
+
const channel = team.channels.find((candidate) => candidate.id === target.id);
|
|
2581
|
+
return channel ? membersOf(team, channel) : [];
|
|
2582
|
+
}
|
|
2583
|
+
HandOffViewUtil.members = members;
|
|
2584
|
+
})(HandOffViewUtil ||= {});
|
|
2585
|
+
function useTeam(context) {
|
|
2586
|
+
return React.useSyncExternalStore((listener) => context.service.subscribe(listener), () => context.service.state).team;
|
|
2587
|
+
}
|
|
2588
|
+
function HandOffCard({ context, message }) {
|
|
2589
|
+
const card = message.details;
|
|
2590
|
+
const team = useTeam(context);
|
|
2591
|
+
const faces = useFaces(team);
|
|
2592
|
+
if (!card?.target) {
|
|
2593
|
+
return null;
|
|
2594
|
+
}
|
|
2595
|
+
const w = ChannelViews.words(context.pi);
|
|
2596
|
+
const members = HandOffViewUtil.members(team, card.target);
|
|
2597
|
+
const open = () => card.target.kind === "agent" ? void ChannelViews.openAgent(context, card.target.id).catch((error) => context.pi.ui.notify(ChannelViews.message(error), "error")) : context.showChannel(card.target.id);
|
|
2598
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
2599
|
+
className: "tac-handoff"
|
|
2600
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
2601
|
+
className: "tac-handoff-head"
|
|
2602
|
+
}, members.length > 0 && /* @__PURE__ */ React.createElement(RoomFace, {
|
|
2603
|
+
members,
|
|
2604
|
+
faces,
|
|
2605
|
+
size: 20,
|
|
2606
|
+
working: []
|
|
2607
|
+
}), /* @__PURE__ */ React.createElement("span", {
|
|
2608
|
+
className: "tac-handoff-title"
|
|
2609
|
+
}, w.handedTo.replace("{to}", HandOff.ref(card.target))), members.length > 0 && /* @__PURE__ */ React.createElement("button", {
|
|
2610
|
+
type: "button",
|
|
2611
|
+
className: "tac-link",
|
|
2612
|
+
onClick: open
|
|
2613
|
+
}, w.handOffOpen)), /* @__PURE__ */ React.createElement("div", {
|
|
2614
|
+
className: "tac-handoff-brief"
|
|
2615
|
+
}, card.brief));
|
|
1832
2616
|
}
|
|
2617
|
+
var HandOffView;
|
|
2618
|
+
((HandOffView) => {
|
|
2619
|
+
function card(context) {
|
|
2620
|
+
return ({ message }) => /* @__PURE__ */ React.createElement(HandOffCard, {
|
|
2621
|
+
context,
|
|
2622
|
+
message
|
|
2623
|
+
});
|
|
2624
|
+
}
|
|
2625
|
+
HandOffView.card = card;
|
|
2626
|
+
function icon(context, target, icons) {
|
|
2627
|
+
const key = `${target.kind}:${target.id}`;
|
|
2628
|
+
let node = icons.get(key);
|
|
2629
|
+
if (!node) {
|
|
2630
|
+
const Face2 = () => {
|
|
2631
|
+
const team = useTeam(context);
|
|
2632
|
+
const faces = useFaces(team);
|
|
2633
|
+
const members = HandOffViewUtil.members(team, target);
|
|
2634
|
+
return members.length ? /* @__PURE__ */ React.createElement(RoomFace, {
|
|
2635
|
+
members,
|
|
2636
|
+
faces,
|
|
2637
|
+
size: 16,
|
|
2638
|
+
working: []
|
|
2639
|
+
}) : null;
|
|
2640
|
+
};
|
|
2641
|
+
node = /* @__PURE__ */ React.createElement(Face2, null);
|
|
2642
|
+
icons.set(key, node);
|
|
2643
|
+
}
|
|
2644
|
+
return node;
|
|
2645
|
+
}
|
|
2646
|
+
function composerAddon(context) {
|
|
2647
|
+
const icons = new Map;
|
|
2648
|
+
const send = (conversation, to) => void context.pi.server.prompt(conversation.sessionId, {
|
|
2649
|
+
clientMessageId: ChannelsUtil.newId("handoff-ask"),
|
|
2650
|
+
message: HandOff.ask(context.pi.ui.language, to),
|
|
2651
|
+
streamingBehavior: "followUp"
|
|
2652
|
+
}).catch((error) => context.pi.ui.notify(ChannelViews.message(error), "error"));
|
|
2653
|
+
return {
|
|
2654
|
+
actions: (conversation) => {
|
|
2655
|
+
const { team } = context.service.state;
|
|
2656
|
+
if (conversation.group === NAME || team.agents.length === 0 && team.channels.length === 0) {
|
|
2657
|
+
return [];
|
|
2658
|
+
}
|
|
2659
|
+
const w = ChannelViews.words(context.pi);
|
|
2660
|
+
const Forward = ChannelViews.icon(context.pi, "Forward");
|
|
2661
|
+
const agents = team.agents.filter((agent) => !agent.temporary).map((agent) => ({
|
|
2662
|
+
key: `handoff:agent:${agent.id}`,
|
|
2663
|
+
label: agent.name,
|
|
2664
|
+
detail: agent.role.split(`
|
|
2665
|
+
`)[0],
|
|
2666
|
+
group: w.agents,
|
|
2667
|
+
icon: icon(context, { kind: "agent", id: agent.id }, icons),
|
|
2668
|
+
run: () => send(conversation, `@${agent.name}`)
|
|
2669
|
+
}));
|
|
2670
|
+
const channels = team.channels.map((channel) => ({
|
|
2671
|
+
key: `handoff:channel:${channel.id}`,
|
|
2672
|
+
label: `#${channel.name}`,
|
|
2673
|
+
detail: channel.topic,
|
|
2674
|
+
group: w.channels,
|
|
2675
|
+
icon: icon(context, { kind: "channel", id: channel.id }, icons),
|
|
2676
|
+
run: () => send(conversation, `#${channel.name}`)
|
|
2677
|
+
}));
|
|
2678
|
+
return [{ key: "handoff", label: w.handOff, detail: w.handOffDetail, icon: /* @__PURE__ */ React.createElement(Forward, {
|
|
2679
|
+
size: 16
|
|
2680
|
+
}), items: [...agents, ...channels] }];
|
|
2681
|
+
},
|
|
2682
|
+
subscribe: (listener) => context.service.subscribe(listener)
|
|
2683
|
+
};
|
|
2684
|
+
}
|
|
2685
|
+
HandOffView.composerAddon = composerAddon;
|
|
2686
|
+
})(HandOffView ||= {});
|
|
1833
2687
|
|
|
1834
2688
|
// web-src/members.tsx
|
|
1835
2689
|
function MembersView({ context }) {
|
|
@@ -2007,10 +2861,12 @@ ${agent.role}`,
|
|
|
2007
2861
|
onClick: () => setConfirming(false)
|
|
2008
2862
|
}, w.cancel), /* @__PURE__ */ React.createElement("button", {
|
|
2009
2863
|
type: "button",
|
|
2010
|
-
className: "tac-button tac-danger",
|
|
2864
|
+
className: busy === "delete" ? "tac-button tac-danger ta-busy" : "tac-button tac-danger",
|
|
2011
2865
|
disabled: !!busy,
|
|
2012
2866
|
onClick: remove
|
|
2013
|
-
}, w.delete
|
|
2867
|
+
}, w.delete, busy === "delete" && /* @__PURE__ */ React.createElement("span", {
|
|
2868
|
+
className: "ta-spinner ta-busy-mark"
|
|
2869
|
+
}))) : /* @__PURE__ */ React.createElement("button", {
|
|
2014
2870
|
type: "button",
|
|
2015
2871
|
className: "tac-link tac-danger",
|
|
2016
2872
|
onClick: () => setConfirming(true)
|
|
@@ -2111,10 +2967,131 @@ function MemberPicker({ context, team, channel, faces }) {
|
|
|
2111
2967
|
className: "tac-members-foot"
|
|
2112
2968
|
}, /* @__PURE__ */ React.createElement("button", {
|
|
2113
2969
|
type: "button",
|
|
2114
|
-
className: "tac-button tac-primary tac-wide",
|
|
2970
|
+
className: busy ? "tac-button tac-primary tac-wide ta-busy" : "tac-button tac-primary tac-wide",
|
|
2115
2971
|
disabled: busy || picked.length === 0,
|
|
2116
2972
|
onClick: submit
|
|
2117
|
-
}, picked.length > 0 ? ChannelWords.format(w.addCount, { count: String(picked.length) }) : w.add
|
|
2973
|
+
}, picked.length > 0 ? ChannelWords.format(w.addCount, { count: String(picked.length) }) : w.add, busy && /* @__PURE__ */ React.createElement("span", {
|
|
2974
|
+
className: "ta-spinner ta-busy-mark ta-on-brand"
|
|
2975
|
+
}))));
|
|
2976
|
+
}
|
|
2977
|
+
|
|
2978
|
+
// web-src/notice.tsx
|
|
2979
|
+
var NoticeView;
|
|
2980
|
+
((NoticeView) => {
|
|
2981
|
+
function display(text) {
|
|
2982
|
+
return text.replace(/^(\s*[-*+]\s+)\[ \]\s+/gm, "$1☐ ").replace(/^(\s*[-*+]\s+)\[[xX]\]\s+/gm, "$1☑ ");
|
|
2983
|
+
}
|
|
2984
|
+
NoticeView.display = display;
|
|
2985
|
+
function counts(text, language) {
|
|
2986
|
+
const w = ChannelWords.of(language);
|
|
2987
|
+
const counts2 = NoticeUtil.counts(text);
|
|
2988
|
+
if (counts2.decisions + counts2.conventions + counts2.todo === 0) {
|
|
2989
|
+
return NoticeUtil.firstLine(text);
|
|
2990
|
+
}
|
|
2991
|
+
const values = { decisions: String(counts2.decisions), conventions: String(counts2.conventions), todo: String(counts2.todo) };
|
|
2992
|
+
return ChannelWords.format(w.noticeCounts, values).split(" · ").filter((_, at) => [counts2.decisions, counts2.conventions, counts2.todo][at] > 0).join(" · ");
|
|
2993
|
+
}
|
|
2994
|
+
NoticeView.counts = counts;
|
|
2995
|
+
})(NoticeView ||= {});
|
|
2996
|
+
function NoticeBar({
|
|
2997
|
+
context,
|
|
2998
|
+
channel,
|
|
2999
|
+
state,
|
|
3000
|
+
onState
|
|
3001
|
+
}) {
|
|
3002
|
+
const { pi, service } = context;
|
|
3003
|
+
const { team } = useChannels(service);
|
|
3004
|
+
const w = ChannelViews.words(pi);
|
|
3005
|
+
const notice = channel.notice;
|
|
3006
|
+
const [draft, setDraft] = React.useState("");
|
|
3007
|
+
const [busy, setBusy] = React.useState(false);
|
|
3008
|
+
const [error, setError] = React.useState();
|
|
3009
|
+
React.useEffect(() => {
|
|
3010
|
+
if (state.editing) {
|
|
3011
|
+
setDraft(notice?.text ?? w.noticeTemplate);
|
|
3012
|
+
setError(undefined);
|
|
3013
|
+
}
|
|
3014
|
+
}, [state.editing]);
|
|
3015
|
+
if (!notice && !state.editing) {
|
|
3016
|
+
return null;
|
|
3017
|
+
}
|
|
3018
|
+
const Megaphone = ChannelViews.icon(pi, "Megaphone");
|
|
3019
|
+
const Chevron = ChannelViews.icon(pi, "ChevronDown");
|
|
3020
|
+
const Markdown = pi.ui.Markdown;
|
|
3021
|
+
const save = (event) => {
|
|
3022
|
+
event.preventDefault();
|
|
3023
|
+
setBusy(true);
|
|
3024
|
+
setError(undefined);
|
|
3025
|
+
service.setNotice(channel.id, draft).then(() => {
|
|
3026
|
+
setBusy(false);
|
|
3027
|
+
onState({ open: true, editing: false });
|
|
3028
|
+
}, (failure) => {
|
|
3029
|
+
setBusy(false);
|
|
3030
|
+
setError(ChannelViews.message(failure));
|
|
3031
|
+
});
|
|
3032
|
+
};
|
|
3033
|
+
const open = state.open || state.editing;
|
|
3034
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
3035
|
+
className: "tac-notice-bar",
|
|
3036
|
+
"data-open": open ? "" : undefined
|
|
3037
|
+
}, /* @__PURE__ */ React.createElement("button", {
|
|
3038
|
+
type: "button",
|
|
3039
|
+
className: "tac-notice-head",
|
|
3040
|
+
"aria-expanded": open,
|
|
3041
|
+
title: open ? w.noticeHide : w.noticeShow,
|
|
3042
|
+
onClick: () => onState({ open: !open, editing: false })
|
|
3043
|
+
}, /* @__PURE__ */ React.createElement("span", {
|
|
3044
|
+
className: "tac-notice-icon"
|
|
3045
|
+
}, /* @__PURE__ */ React.createElement(Megaphone, {
|
|
3046
|
+
size: 13,
|
|
3047
|
+
strokeWidth: 2
|
|
3048
|
+
})), /* @__PURE__ */ React.createElement("strong", null, w.notice), /* @__PURE__ */ React.createElement("span", {
|
|
3049
|
+
className: "tac-notice-sum"
|
|
3050
|
+
}, notice ? NoticeView.counts(notice.text, pi.ui.language) : w.noticeEmpty), /* @__PURE__ */ React.createElement("span", {
|
|
3051
|
+
className: "tac-notice-chevron"
|
|
3052
|
+
}, /* @__PURE__ */ React.createElement(Chevron, {
|
|
3053
|
+
size: 15
|
|
3054
|
+
}))), open && !state.editing && notice && /* @__PURE__ */ React.createElement("div", {
|
|
3055
|
+
className: "tac-notice-body"
|
|
3056
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
3057
|
+
className: "tac-notice-text"
|
|
3058
|
+
}, /* @__PURE__ */ React.createElement(Markdown, {
|
|
3059
|
+
text: NoticeView.display(notice.text)
|
|
3060
|
+
})), /* @__PURE__ */ React.createElement("div", {
|
|
3061
|
+
className: "tac-notice-foot"
|
|
3062
|
+
}, /* @__PURE__ */ React.createElement("span", null, ChannelWords.format(w.noticeBy, {
|
|
3063
|
+
name: ChannelsUtil.authorName(team, notice.by, { user: w.you, ta: w.ta }),
|
|
3064
|
+
time: SidebarUtil.time(notice.at, pi.ui.language)
|
|
3065
|
+
})), /* @__PURE__ */ React.createElement("button", {
|
|
3066
|
+
type: "button",
|
|
3067
|
+
className: "tac-button tac-quiet",
|
|
3068
|
+
onClick: () => onState({ open: true, editing: true })
|
|
3069
|
+
}, w.noticeEdit))), state.editing && /* @__PURE__ */ React.createElement("form", {
|
|
3070
|
+
className: "tac-notice-body tac-notice-form",
|
|
3071
|
+
onSubmit: save
|
|
3072
|
+
}, /* @__PURE__ */ React.createElement("p", {
|
|
3073
|
+
className: "tac-dialog-note"
|
|
3074
|
+
}, w.noticeHint), /* @__PURE__ */ React.createElement("textarea", {
|
|
3075
|
+
className: "tac-input tac-notice-input",
|
|
3076
|
+
value: draft,
|
|
3077
|
+
"aria-label": w.noticeEdit,
|
|
3078
|
+
autoFocus: true,
|
|
3079
|
+
onChange: (event) => setDraft(event.target.value)
|
|
3080
|
+
}), error && /* @__PURE__ */ React.createElement("div", {
|
|
3081
|
+
className: "tac-error"
|
|
3082
|
+
}, error), /* @__PURE__ */ React.createElement("div", {
|
|
3083
|
+
className: "tac-notice-actions"
|
|
3084
|
+
}, /* @__PURE__ */ React.createElement("button", {
|
|
3085
|
+
type: "button",
|
|
3086
|
+
className: "tac-button tac-quiet",
|
|
3087
|
+
onClick: () => onState({ open: !!notice, editing: false })
|
|
3088
|
+
}, w.cancel), /* @__PURE__ */ React.createElement("button", {
|
|
3089
|
+
type: "submit",
|
|
3090
|
+
className: busy ? "tac-button tac-primary ta-busy" : "tac-button tac-primary",
|
|
3091
|
+
disabled: busy || draft.trim() === (notice?.text ?? "")
|
|
3092
|
+
}, w.save, busy && /* @__PURE__ */ React.createElement("span", {
|
|
3093
|
+
className: "ta-spinner ta-busy-mark ta-on-brand"
|
|
3094
|
+
})))));
|
|
2118
3095
|
}
|
|
2119
3096
|
|
|
2120
3097
|
// web-src/room.tsx
|
|
@@ -2126,7 +3103,7 @@ var RoomUtil;
|
|
|
2126
3103
|
return messages.map((message, index) => {
|
|
2127
3104
|
const before = messages[index - 1];
|
|
2128
3105
|
const separator = !before || message.at - before.at > PAUSE_MS;
|
|
2129
|
-
const first = separator || before.author !== message.author || before.author === SYSTEM || message.at - before.at > RUN_MS;
|
|
3106
|
+
const first = separator || before.author !== message.author || before.author === SYSTEM || !!before.notice || message.at - before.at > RUN_MS;
|
|
2130
3107
|
return { message, first, separator };
|
|
2131
3108
|
});
|
|
2132
3109
|
}
|
|
@@ -2217,7 +3194,6 @@ function ChannelRoom({ context, channelId: fixed }) {
|
|
|
2217
3194
|
const channelId = fixed ?? shown;
|
|
2218
3195
|
const faces = useFaces(state.team);
|
|
2219
3196
|
const w = ChannelViews.words(pi);
|
|
2220
|
-
const list = React.useRef(null);
|
|
2221
3197
|
const channel = state.team.channels.find((candidate) => candidate.id === channelId);
|
|
2222
3198
|
const messages = channel ? state.messages[channel.id] : undefined;
|
|
2223
3199
|
const working = channel ? state.working[channel.id] ?? [] : [];
|
|
@@ -2226,12 +3202,10 @@ function ChannelRoom({ context, channelId: fixed }) {
|
|
|
2226
3202
|
service.messages(channelId);
|
|
2227
3203
|
}
|
|
2228
3204
|
}, [service, channelId]);
|
|
2229
|
-
React.
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
}
|
|
2234
|
-
}, [channelId, messages?.length, working.length]);
|
|
3205
|
+
const sent = React.useMemo(() => messages?.filter((message) => message.author === USER).length ?? 0, [messages]);
|
|
3206
|
+
const list = pi.ui.useChatScroll(sent, channelId);
|
|
3207
|
+
const [notice, setNotice] = React.useState({ open: false, editing: false });
|
|
3208
|
+
React.useEffect(() => setNotice({ open: false, editing: false }), [channelId]);
|
|
2235
3209
|
const Markdown = pi.ui.Markdown;
|
|
2236
3210
|
const Composer = pi.ui.Composer;
|
|
2237
3211
|
const Avatar = pi.ui.Avatar;
|
|
@@ -2259,7 +3233,12 @@ function ChannelRoom({ context, channelId: fixed }) {
|
|
|
2259
3233
|
});
|
|
2260
3234
|
return /* @__PURE__ */ React.createElement("div", {
|
|
2261
3235
|
className: "tac-room-page"
|
|
2262
|
-
}, /* @__PURE__ */ React.createElement(
|
|
3236
|
+
}, /* @__PURE__ */ React.createElement(NoticeBar, {
|
|
3237
|
+
context,
|
|
3238
|
+
channel,
|
|
3239
|
+
state: notice,
|
|
3240
|
+
onState: setNotice
|
|
3241
|
+
}), /* @__PURE__ */ React.createElement("div", {
|
|
2263
3242
|
className: "tac-chat ta-conversation",
|
|
2264
3243
|
ref: list
|
|
2265
3244
|
}, /* @__PURE__ */ React.createElement("div", {
|
|
@@ -2280,7 +3259,12 @@ function ChannelRoom({ context, channelId: fixed }) {
|
|
|
2280
3259
|
}, time(message.at)), message.author === SYSTEM ? /* @__PURE__ */ React.createElement("div", {
|
|
2281
3260
|
className: "tac-notice",
|
|
2282
3261
|
role: "note"
|
|
2283
|
-
}, w.stopped) : message.
|
|
3262
|
+
}, w.stopped) : message.notice ? /* @__PURE__ */ React.createElement("button", {
|
|
3263
|
+
type: "button",
|
|
3264
|
+
className: "tac-notice tac-notice-line",
|
|
3265
|
+
disabled: !channel.notice,
|
|
3266
|
+
onClick: () => setNotice({ open: true, editing: false })
|
|
3267
|
+
}, ChannelWords.format(message.notice === "cleared" ? w.noticeCleared : w.noticeUpdated, { name: name(message.author) })) : message.author === USER ? /* @__PURE__ */ React.createElement("div", {
|
|
2284
3268
|
className: "ta-message ta-user tac-mine"
|
|
2285
3269
|
}, /* @__PURE__ */ React.createElement("div", {
|
|
2286
3270
|
className: "ta-bubble"
|
|
@@ -2330,6 +3314,12 @@ function ChannelRoom({ context, channelId: fixed }) {
|
|
|
2330
3314
|
actions: [
|
|
2331
3315
|
members.map(mention),
|
|
2332
3316
|
[
|
|
3317
|
+
{
|
|
3318
|
+
key: "notice",
|
|
3319
|
+
label: w.noticeEdit,
|
|
3320
|
+
icon: ChannelViews.maybeIcon(pi, "Megaphone", null, 16),
|
|
3321
|
+
run: () => setNotice({ open: true, editing: true })
|
|
3322
|
+
},
|
|
2333
3323
|
{
|
|
2334
3324
|
key: "add",
|
|
2335
3325
|
label: w.addMembers,
|
|
@@ -2341,6 +3331,15 @@ function ChannelRoom({ context, channelId: fixed }) {
|
|
|
2341
3331
|
context.showMembers(true);
|
|
2342
3332
|
}
|
|
2343
3333
|
}
|
|
3334
|
+
],
|
|
3335
|
+
[
|
|
3336
|
+
{
|
|
3337
|
+
key: "make-extension",
|
|
3338
|
+
label: w.makeExtension,
|
|
3339
|
+
detail: w.makeExtensionDetail,
|
|
3340
|
+
icon: ChannelViews.maybeIcon(pi, "Sparkles", null, 16),
|
|
3341
|
+
run: () => void service.post(channel.id, w.makeExtensionAsk).catch((error) => pi.ui.notify(ChannelViews.message(error), "error"))
|
|
3342
|
+
}
|
|
2344
3343
|
]
|
|
2345
3344
|
],
|
|
2346
3345
|
onSend: (text) => service.post(channel.id, text)
|
|
@@ -2349,27 +3348,28 @@ function ChannelRoom({ context, channelId: fixed }) {
|
|
|
2349
3348
|
|
|
2350
3349
|
// web-src/more-menu.tsx
|
|
2351
3350
|
var MARGIN = 8;
|
|
2352
|
-
var FINGER_GAP = 14;
|
|
2353
|
-
function safeArea() {
|
|
2354
|
-
const probe = document.createElement("div");
|
|
2355
|
-
probe.style.cssText = "position:fixed;visibility:hidden;pointer-events:none;padding-top:env(safe-area-inset-top);padding-bottom:env(safe-area-inset-bottom)";
|
|
2356
|
-
document.body.appendChild(probe);
|
|
2357
|
-
const style = getComputedStyle(probe);
|
|
2358
|
-
const area = { top: Number.parseFloat(style.paddingTop) || 0, bottom: Number.parseFloat(style.paddingBottom) || 0 };
|
|
2359
|
-
probe.remove();
|
|
2360
|
-
return area;
|
|
2361
|
-
}
|
|
2362
3351
|
function MoreMenu({ pi, label, items }) {
|
|
2363
3352
|
const w = ChannelViews.words(pi);
|
|
2364
3353
|
const [open, setOpen] = React.useState(false);
|
|
2365
|
-
const anchor = React.useRef({
|
|
3354
|
+
const anchor = React.useRef({
|
|
3355
|
+
right: 0,
|
|
3356
|
+
below: 0,
|
|
3357
|
+
above: 0,
|
|
3358
|
+
finger: undefined
|
|
3359
|
+
});
|
|
2366
3360
|
const root = React.useRef(null);
|
|
2367
3361
|
const menu = React.useRef(null);
|
|
2368
3362
|
const Ellipsis = ChannelViews.icon(pi, "Ellipsis");
|
|
2369
3363
|
const show = React.useCallback((button, at) => {
|
|
2370
3364
|
const box = button.getBoundingClientRect();
|
|
2371
3365
|
const touch = document.documentElement.hasAttribute("data-touch");
|
|
2372
|
-
|
|
3366
|
+
const row = root.current?.parentElement?.getBoundingClientRect() ?? box;
|
|
3367
|
+
anchor.current = {
|
|
3368
|
+
right: box.right,
|
|
3369
|
+
below: at?.y ?? box.bottom,
|
|
3370
|
+
above: at?.y ?? box.top,
|
|
3371
|
+
finger: touch && at ? { ...at, around: { top: row.top, bottom: row.bottom } } : undefined
|
|
3372
|
+
};
|
|
2373
3373
|
setOpen(true);
|
|
2374
3374
|
}, []);
|
|
2375
3375
|
React.useLayoutEffect(() => {
|
|
@@ -2378,23 +3378,15 @@ function MoreMenu({ pi, label, items }) {
|
|
|
2378
3378
|
return;
|
|
2379
3379
|
}
|
|
2380
3380
|
const { right, below, above, finger } = anchor.current;
|
|
2381
|
-
const width = element.offsetWidth;
|
|
2382
|
-
const height = element.offsetHeight;
|
|
2383
3381
|
if (finger) {
|
|
2384
|
-
|
|
2385
|
-
const highest = safe.top + MARGIN;
|
|
2386
|
-
const lowest = window.innerHeight - safe.bottom - MARGIN - height;
|
|
2387
|
-
const over = finger.y - FINGER_GAP - height;
|
|
2388
|
-
const top2 = over >= highest ? over : Math.max(highest, Math.min(finger.y + FINGER_GAP, lowest));
|
|
2389
|
-
element.style.top = `${top2}px`;
|
|
2390
|
-
element.style.left = `${Math.max(MARGIN, Math.min(finger.x - width / 2, window.innerWidth - MARGIN - width))}px`;
|
|
2391
|
-
element.style.transformOrigin = top2 < finger.y ? "center bottom" : "center top";
|
|
2392
|
-
return;
|
|
3382
|
+
return pi.ui.attachMenu(element, finger, () => setOpen(false));
|
|
2393
3383
|
}
|
|
3384
|
+
const width = element.offsetWidth;
|
|
3385
|
+
const height = element.offsetHeight;
|
|
2394
3386
|
const top = below + 4 + height <= window.innerHeight - MARGIN ? below + 4 : Math.max(MARGIN, above - 4 - height);
|
|
2395
3387
|
element.style.top = `${top}px`;
|
|
2396
3388
|
element.style.left = `${Math.max(MARGIN, right - width)}px`;
|
|
2397
|
-
}, [open]);
|
|
3389
|
+
}, [open, pi]);
|
|
2398
3390
|
React.useEffect(() => {
|
|
2399
3391
|
const row = root.current?.parentElement;
|
|
2400
3392
|
const button = root.current?.querySelector(".tac-action");
|
|
@@ -2544,6 +3536,7 @@ function AgentMenu({ context, agent, cwd, working }) {
|
|
|
2544
3536
|
download(`${agent.name}.md`, ChannelsUtil.markdown(agent, messages, { user: w.you }));
|
|
2545
3537
|
});
|
|
2546
3538
|
const remove = act(() => deleteAgent(context, agent));
|
|
3539
|
+
const pin = act(() => service.updateAgent(agent.id, { pinned: !agent.pinned }));
|
|
2547
3540
|
const keep = act(async () => {
|
|
2548
3541
|
await service.updateAgent(agent.id, { keep: true });
|
|
2549
3542
|
pi.ui.notify(ChannelWords.format(w.kept, { name: agent.name }), "info");
|
|
@@ -2560,7 +3553,10 @@ function AgentMenu({ context, agent, cwd, working }) {
|
|
|
2560
3553
|
pi,
|
|
2561
3554
|
label: agent.name,
|
|
2562
3555
|
items: () => [
|
|
2563
|
-
|
|
3556
|
+
[
|
|
3557
|
+
...agent.temporary ? [item("keep", w.keep, "UserPlus", keep)] : [],
|
|
3558
|
+
item("pin", agent.pinned ? w.unpin : w.pin, agent.pinned ? "PinOff" : "Pin", pin)
|
|
3559
|
+
],
|
|
2564
3560
|
[item("stop", w.stop, "Square", stop, { disabled: !working && !agent.sessionFile }), item("restart", w.restart, "RotateCcw", restart)],
|
|
2565
3561
|
[
|
|
2566
3562
|
item("rename", w.rename, "Pencil", show("rename")),
|
|
@@ -2568,7 +3564,11 @@ function AgentMenu({ context, agent, cwd, working }) {
|
|
|
2568
3564
|
item("move", w.moveTo, "FolderInput", show("move")),
|
|
2569
3565
|
item("copy", w.copyCwd, "Copy", copyCwd)
|
|
2570
3566
|
],
|
|
2571
|
-
[
|
|
3567
|
+
[
|
|
3568
|
+
item("card", w.shareCard, "Contact", show("card")),
|
|
3569
|
+
item("export", w.exportChat, "Download", exportMarkdown),
|
|
3570
|
+
item("join", w.joinChannel, "UserPlus", show("join"))
|
|
3571
|
+
],
|
|
2572
3572
|
[item("delete", w.deleteAgent, "Trash2", remove, { danger: true })]
|
|
2573
3573
|
]
|
|
2574
3574
|
}), dialog === "rename" && /* @__PURE__ */ React.createElement(RenameDialog, {
|
|
@@ -2583,6 +3583,10 @@ function AgentMenu({ context, agent, cwd, working }) {
|
|
|
2583
3583
|
context,
|
|
2584
3584
|
agent,
|
|
2585
3585
|
onClose: () => setDialog(undefined)
|
|
3586
|
+
}), dialog === "card" && /* @__PURE__ */ React.createElement(CardDialog, {
|
|
3587
|
+
context,
|
|
3588
|
+
agent,
|
|
3589
|
+
onClose: () => setDialog(undefined)
|
|
2586
3590
|
}), dialog === "move" && /* @__PURE__ */ React.createElement(pi.ui.FolderPicker, {
|
|
2587
3591
|
initial: cwd,
|
|
2588
3592
|
onClose: () => setDialog(undefined),
|
|
@@ -2634,9 +3638,11 @@ function RenameDialog({ context, agent, onClose }) {
|
|
|
2634
3638
|
className: "tac-dialog-actions"
|
|
2635
3639
|
}, /* @__PURE__ */ React.createElement("button", {
|
|
2636
3640
|
type: "submit",
|
|
2637
|
-
className: "tac-button tac-primary",
|
|
3641
|
+
className: busy ? "tac-button tac-primary ta-busy" : "tac-button tac-primary",
|
|
2638
3642
|
disabled: busy || !name.trim() || name.trim() === agent.name
|
|
2639
|
-
}, w.save
|
|
3643
|
+
}, w.save, busy && /* @__PURE__ */ React.createElement("span", {
|
|
3644
|
+
className: "ta-spinner ta-busy-mark ta-on-brand"
|
|
3645
|
+
})))));
|
|
2640
3646
|
}
|
|
2641
3647
|
function RoleDialog({ context, agent, onClose }) {
|
|
2642
3648
|
const { pi, service } = context;
|
|
@@ -2664,9 +3670,11 @@ function RoleDialog({ context, agent, onClose }) {
|
|
|
2664
3670
|
className: "tac-dialog-actions"
|
|
2665
3671
|
}, /* @__PURE__ */ React.createElement("button", {
|
|
2666
3672
|
type: "submit",
|
|
2667
|
-
className: "tac-button tac-primary",
|
|
3673
|
+
className: busy ? "tac-button tac-primary ta-busy" : "tac-button tac-primary",
|
|
2668
3674
|
disabled: busy || !role.trim() || role.trim() === agent.role
|
|
2669
|
-
}, w.save
|
|
3675
|
+
}, w.save, busy && /* @__PURE__ */ React.createElement("span", {
|
|
3676
|
+
className: "ta-spinner ta-busy-mark ta-on-brand"
|
|
3677
|
+
})))));
|
|
2670
3678
|
}
|
|
2671
3679
|
function JoinDialog({ context, agent, onClose }) {
|
|
2672
3680
|
const { pi, service } = context;
|
|
@@ -2797,7 +3805,7 @@ class ChannelTaskSource {
|
|
|
2797
3805
|
const last = messages?.at(-1);
|
|
2798
3806
|
if (!last) {
|
|
2799
3807
|
const building = Date.now() - channel.createdAt < BUILDING_MS;
|
|
2800
|
-
return building ? { status: "running", detail: w.building } : { status: "done", detail: channel.topic
|
|
3808
|
+
return building ? { status: "running", detail: w.building } : { status: "done", detail: channel.topic || w.noMessages, endedAt: channel.createdAt };
|
|
2801
3809
|
}
|
|
2802
3810
|
if (last.author === SYSTEM) {
|
|
2803
3811
|
return { status: "waiting", detail: w.yourTurn };
|
|
@@ -2828,7 +3836,7 @@ class ChannelTaskSource {
|
|
|
2828
3836
|
}
|
|
2829
3837
|
}
|
|
2830
3838
|
function taskTitle(channel) {
|
|
2831
|
-
return channel.
|
|
3839
|
+
return channel.name;
|
|
2832
3840
|
}
|
|
2833
3841
|
async function deleteTeam(context, channel) {
|
|
2834
3842
|
await context.service.deleteChannel(channel.id);
|
|
@@ -3000,32 +4008,40 @@ function ChannelMenu({ context, channel, working }) {
|
|
|
3000
4008
|
}
|
|
3001
4009
|
|
|
3002
4010
|
// web-src/sidebar.tsx
|
|
3003
|
-
function Row({ pi, avatar, title, badge, preview, live, dot, waiting,
|
|
4011
|
+
function Row({ pi, avatar, title, badge, preview, live, dot, waiting, fresh, time, hint, selected, onSelect, more, swipe, check, place, deleting }) {
|
|
4012
|
+
const single = !preview && !place;
|
|
4013
|
+
const spinner = dot === "running" && /* @__PURE__ */ React.createElement("span", {
|
|
4014
|
+
className: "tac-spinner ta-spinner"
|
|
4015
|
+
});
|
|
3004
4016
|
const row = /* @__PURE__ */ React.createElement("button", {
|
|
3005
4017
|
type: "button",
|
|
3006
|
-
className: `tac-item${selected ? " tac-selected" : ""}`,
|
|
4018
|
+
className: `tac-item${selected ? " tac-selected" : ""}${single ? " tac-item-single" : ""}${deleting && !(more || swipe) ? " ta-pending" : ""}`,
|
|
3007
4019
|
"aria-current": selected || undefined,
|
|
4020
|
+
"aria-busy": deleting || undefined,
|
|
4021
|
+
"data-unseen": dot === "attention" ? "" : undefined,
|
|
3008
4022
|
title: hint,
|
|
3009
4023
|
onClick: onSelect
|
|
3010
|
-
}, check,
|
|
4024
|
+
}, check, /* @__PURE__ */ React.createElement("span", {
|
|
4025
|
+
className: "tac-avatar"
|
|
4026
|
+
}, avatar, /* @__PURE__ */ React.createElement("span", {
|
|
4027
|
+
className: `tac-dot${dot ? ` tac-dot-${dot}` : ""}`
|
|
4028
|
+
})), /* @__PURE__ */ React.createElement("span", {
|
|
3011
4029
|
className: "tac-item-text"
|
|
3012
4030
|
}, /* @__PURE__ */ React.createElement("span", {
|
|
3013
4031
|
className: "tac-item-top"
|
|
3014
4032
|
}, /* @__PURE__ */ React.createElement("span", {
|
|
3015
4033
|
className: "tac-item-title"
|
|
3016
|
-
}, title), badge, /* @__PURE__ */ React.createElement("span", {
|
|
4034
|
+
}, title), badge, single && spinner, /* @__PURE__ */ React.createElement("span", {
|
|
3017
4035
|
className: "tac-item-time"
|
|
3018
|
-
},
|
|
4036
|
+
}, deleting ? /* @__PURE__ */ React.createElement("span", {
|
|
4037
|
+
className: "tac-spinner ta-spinner ta-later"
|
|
4038
|
+
}) : time)), !single && /* @__PURE__ */ React.createElement("span", {
|
|
3019
4039
|
className: "tac-item-bottom"
|
|
3020
|
-
},
|
|
3021
|
-
className: `
|
|
3022
|
-
}
|
|
3023
|
-
className: `tac-item-preview${live ? " tac-live" : ""}${waiting ? " tac-waiting" : ""}`
|
|
3024
|
-
}, preview), fresh && /* @__PURE__ */ React.createElement("span", {
|
|
3025
|
-
className: "tac-fresh"
|
|
3026
|
-
}))));
|
|
4040
|
+
}, place, /* @__PURE__ */ React.createElement("span", {
|
|
4041
|
+
className: `tac-item-preview${live ? " tac-now" : ""}${waiting ? " tac-waiting" : ""}${fresh ? " tac-fresh" : ""}`
|
|
4042
|
+
}, preview), spinner)));
|
|
3027
4043
|
const SwipeRow = pi.ui.SwipeRow;
|
|
3028
|
-
const className = `tac-item-row${selected ? " tac-selected" : ""}`;
|
|
4044
|
+
const className = `tac-item-row${selected ? " tac-selected" : ""}${deleting ? " ta-pending" : ""}`;
|
|
3029
4045
|
if (SwipeRow && (more || swipe)) {
|
|
3030
4046
|
return /* @__PURE__ */ React.createElement(SwipeRow, {
|
|
3031
4047
|
className,
|
|
@@ -3036,9 +4052,22 @@ function Row({ pi, avatar, title, badge, preview, live, dot, waiting, time, fres
|
|
|
3036
4052
|
className
|
|
3037
4053
|
}, row, more) : row;
|
|
3038
4054
|
}
|
|
3039
|
-
function
|
|
4055
|
+
function swipePinDelete(pi, pinned, pin, remove) {
|
|
4056
|
+
const w = ChannelViews.words(pi);
|
|
4057
|
+
const fail = (error) => pi.ui.notify(ChannelViews.message(error), "error");
|
|
4058
|
+
return [
|
|
4059
|
+
{ key: "pin", label: pinned ? w.unpin : w.pin, run: () => void pin(!pinned).catch(fail) },
|
|
4060
|
+
{ key: "delete", label: w.delete, danger: true, run: () => void remove().catch(fail) }
|
|
4061
|
+
];
|
|
4062
|
+
}
|
|
4063
|
+
function PinMark({ pi, pinned }) {
|
|
3040
4064
|
const w = ChannelViews.words(pi);
|
|
3041
|
-
return
|
|
4065
|
+
return pinned ? /* @__PURE__ */ React.createElement("span", {
|
|
4066
|
+
className: "tac-pinned",
|
|
4067
|
+
title: w.pinned,
|
|
4068
|
+
role: "img",
|
|
4069
|
+
"aria-label": w.pinned
|
|
4070
|
+
}, ChannelViews.maybeIcon(pi, "Pin", null, 12)) : null;
|
|
3042
4071
|
}
|
|
3043
4072
|
function SidebarHead({ context }) {
|
|
3044
4073
|
const { pi, ui } = context;
|
|
@@ -3051,6 +4080,8 @@ function SidebarHead({ context }) {
|
|
|
3051
4080
|
const X = ChannelViews.icon(pi, "X");
|
|
3052
4081
|
const Hash = ChannelViews.icon(pi, "Hash");
|
|
3053
4082
|
const Bot = ChannelViews.icon(pi, "Bot");
|
|
4083
|
+
const ScanLine = ChannelViews.icon(pi, "ScanLine");
|
|
4084
|
+
const scan = pi.ui.scan;
|
|
3054
4085
|
React.useEffect(() => {
|
|
3055
4086
|
if (!menu) {
|
|
3056
4087
|
return;
|
|
@@ -3118,13 +4149,23 @@ function SidebarHead({ context }) {
|
|
|
3118
4149
|
onClick: () => begin("channel")
|
|
3119
4150
|
}, /* @__PURE__ */ React.createElement(Hash, {
|
|
3120
4151
|
size: 14
|
|
3121
|
-
}), w.newChannel)
|
|
4152
|
+
}), w.newChannel), scan && /* @__PURE__ */ React.createElement("button", {
|
|
4153
|
+
type: "button",
|
|
4154
|
+
role: "menuitem",
|
|
4155
|
+
onClick: () => {
|
|
4156
|
+
setMenu(false);
|
|
4157
|
+
scan();
|
|
4158
|
+
}
|
|
4159
|
+
}, /* @__PURE__ */ React.createElement(ScanLine, {
|
|
4160
|
+
size: 14
|
|
4161
|
+
}), w.scan))), creating && /* @__PURE__ */ React.createElement(NewChannelDialog, {
|
|
3122
4162
|
context,
|
|
3123
4163
|
onClose: () => ui.set({ creating: false })
|
|
3124
4164
|
}));
|
|
3125
4165
|
}
|
|
3126
4166
|
var FOLDED_KEY = "ta-channels.folded";
|
|
3127
4167
|
var BY_DIRECTORY_KEY = "ui.membersByDirectory";
|
|
4168
|
+
var NO_SESSIONS = [];
|
|
3128
4169
|
var ENDED_SHOWN = 5;
|
|
3129
4170
|
function useFolded() {
|
|
3130
4171
|
const [folded, setFolded] = React.useState(() => {
|
|
@@ -3176,6 +4217,7 @@ function Section({
|
|
|
3176
4217
|
folded,
|
|
3177
4218
|
onFold,
|
|
3178
4219
|
action,
|
|
4220
|
+
alert,
|
|
3179
4221
|
children
|
|
3180
4222
|
}) {
|
|
3181
4223
|
const closed = folded.has(id);
|
|
@@ -3187,19 +4229,120 @@ function Section({
|
|
|
3187
4229
|
type: "button",
|
|
3188
4230
|
className: "tac-section-head",
|
|
3189
4231
|
"aria-expanded": !closed,
|
|
4232
|
+
"data-unseen": closed && alert ? "" : undefined,
|
|
3190
4233
|
onClick: () => onFold(id)
|
|
3191
4234
|
}, /* @__PURE__ */ React.createElement("span", {
|
|
3192
|
-
className: "tac-section-chevron",
|
|
3193
|
-
"aria-hidden": "true"
|
|
3194
|
-
}), /* @__PURE__ */ React.createElement("span", {
|
|
3195
4235
|
className: "tac-section-title"
|
|
3196
|
-
}, title), /* @__PURE__ */ React.createElement("span", {
|
|
4236
|
+
}, title), closed && count > 0 && /* @__PURE__ */ React.createElement("span", {
|
|
3197
4237
|
className: "tac-section-count"
|
|
3198
|
-
}, count)
|
|
4238
|
+
}, count), closed && alert && /* @__PURE__ */ React.createElement("span", {
|
|
4239
|
+
className: "tac-section-alert"
|
|
4240
|
+
}), /* @__PURE__ */ React.createElement("span", {
|
|
4241
|
+
className: "tac-section-chevron",
|
|
4242
|
+
"aria-hidden": "true"
|
|
4243
|
+
})), !closed && action), !closed && /* @__PURE__ */ React.createElement("div", {
|
|
3199
4244
|
className: "tac-section-body"
|
|
3200
4245
|
}, children));
|
|
3201
4246
|
}
|
|
3202
|
-
var
|
|
4247
|
+
var SEEN_KEY = "ui.seenTasks";
|
|
4248
|
+
var AGENTS_SEEN_KEY = "ui.agentsSeen";
|
|
4249
|
+
var DOUBLE_LOOK = "double";
|
|
4250
|
+
function useSeen(storage, key) {
|
|
4251
|
+
const [seen, setSeen] = React.useState();
|
|
4252
|
+
const latest = React.useRef(undefined);
|
|
4253
|
+
React.useEffect(() => {
|
|
4254
|
+
let live = true;
|
|
4255
|
+
const read = () => storage.get(key).then((kept) => {
|
|
4256
|
+
if (!live) {
|
|
4257
|
+
return;
|
|
4258
|
+
}
|
|
4259
|
+
const local = latest.current;
|
|
4260
|
+
const next = kept ? local ? SidebarUtil.mergeSeen(local, kept) : kept : local ?? { since: Date.now(), at: {} };
|
|
4261
|
+
latest.current = next;
|
|
4262
|
+
setSeen(next);
|
|
4263
|
+
if (!kept || next !== kept && JSON.stringify(next) !== JSON.stringify(kept)) {
|
|
4264
|
+
storage.set(key, next).catch(() => {
|
|
4265
|
+
return;
|
|
4266
|
+
});
|
|
4267
|
+
}
|
|
4268
|
+
}, () => {
|
|
4269
|
+
return;
|
|
4270
|
+
});
|
|
4271
|
+
read();
|
|
4272
|
+
const stop = storage.onChange((keys) => keys.includes(key) && void read());
|
|
4273
|
+
return () => {
|
|
4274
|
+
live = false;
|
|
4275
|
+
stop();
|
|
4276
|
+
};
|
|
4277
|
+
}, [storage, key]);
|
|
4278
|
+
const look = React.useCallback((id, at, kept) => {
|
|
4279
|
+
const next = latest.current && SidebarUtil.look(latest.current, id, at, kept);
|
|
4280
|
+
if (next) {
|
|
4281
|
+
latest.current = next;
|
|
4282
|
+
setSeen(next);
|
|
4283
|
+
storage.set(key, next).catch(() => {
|
|
4284
|
+
return;
|
|
4285
|
+
});
|
|
4286
|
+
}
|
|
4287
|
+
}, [storage, key]);
|
|
4288
|
+
return { seen, look };
|
|
4289
|
+
}
|
|
4290
|
+
function useSeenTasks(storage, tasks) {
|
|
4291
|
+
const { seen, look } = useSeen(storage, SEEN_KEY);
|
|
4292
|
+
const needsLook = (task) => SidebarUtil.needsLook(task, seen ?? { since: Number.POSITIVE_INFINITY, at: {} });
|
|
4293
|
+
const open = (task) => {
|
|
4294
|
+
const keys = new Set(tasks.map((each) => each.key));
|
|
4295
|
+
look(task.key, Date.now(), (key) => keys.has(key));
|
|
4296
|
+
task.open();
|
|
4297
|
+
};
|
|
4298
|
+
return { needsLook, open };
|
|
4299
|
+
}
|
|
4300
|
+
function useVisible() {
|
|
4301
|
+
const [visible, setVisible] = React.useState(() => document.visibilityState === "visible");
|
|
4302
|
+
React.useEffect(() => {
|
|
4303
|
+
const change = () => setVisible(document.visibilityState === "visible");
|
|
4304
|
+
document.addEventListener("visibilitychange", change);
|
|
4305
|
+
return () => document.removeEventListener("visibilitychange", change);
|
|
4306
|
+
}, []);
|
|
4307
|
+
return visible;
|
|
4308
|
+
}
|
|
4309
|
+
function useUnseen(storage, latest, busy, shown, answered, known) {
|
|
4310
|
+
const { seen, look } = useSeen(storage, AGENTS_SEEN_KEY);
|
|
4311
|
+
const looking = useVisible() ? shown : undefined;
|
|
4312
|
+
const lookingAt = looking === undefined ? undefined : latest.get(looking);
|
|
4313
|
+
const lookingBusy = looking !== undefined && busy.has(looking);
|
|
4314
|
+
const knownKey = known?.join(`
|
|
4315
|
+
`);
|
|
4316
|
+
React.useEffect(() => {
|
|
4317
|
+
if (looking !== undefined && !lookingBusy) {
|
|
4318
|
+
const ids = knownKey === undefined ? undefined : new Set(knownKey.split(`
|
|
4319
|
+
`));
|
|
4320
|
+
look(looking, Math.max(Date.now(), lookingAt ?? 0), ids && ((id) => ids.has(id)));
|
|
4321
|
+
}
|
|
4322
|
+
}, [look, looking, lookingBusy, lookingAt, knownKey]);
|
|
4323
|
+
return (id) => id !== looking && !busy.has(id) && SidebarUtil.unseen(latest.get(id), seen, id, answered[id]);
|
|
4324
|
+
}
|
|
4325
|
+
function useSessionLines(context, changed) {
|
|
4326
|
+
const { pi } = context;
|
|
4327
|
+
const [lines, setLines] = React.useState(context.sessionLines);
|
|
4328
|
+
React.useEffect(() => {
|
|
4329
|
+
let live = true;
|
|
4330
|
+
const read = () => Promise.all([pi.server.listSessions().catch(() => []), pi.server.listSavedSessions().catch(() => [])]).then(([open, saved]) => {
|
|
4331
|
+
context.sessionLines = [...saved, ...open];
|
|
4332
|
+
if (live) {
|
|
4333
|
+
setLines(context.sessionLines);
|
|
4334
|
+
}
|
|
4335
|
+
});
|
|
4336
|
+
read();
|
|
4337
|
+
const again = () => document.visibilityState === "visible" && void read();
|
|
4338
|
+
document.addEventListener("visibilitychange", again);
|
|
4339
|
+
return () => {
|
|
4340
|
+
live = false;
|
|
4341
|
+
document.removeEventListener("visibilitychange", again);
|
|
4342
|
+
};
|
|
4343
|
+
}, [context, pi, changed]);
|
|
4344
|
+
return lines;
|
|
4345
|
+
}
|
|
3203
4346
|
function useTaskSelection(pi, tasks) {
|
|
3204
4347
|
const [chosen, setChosen] = React.useState();
|
|
3205
4348
|
const removable = tasks.filter((task) => task.remove);
|
|
@@ -3232,7 +4375,7 @@ function useTaskSelection(pi, tasks) {
|
|
|
3232
4375
|
}
|
|
3233
4376
|
};
|
|
3234
4377
|
}
|
|
3235
|
-
function TaskItem({ context, task, selection }) {
|
|
4378
|
+
function TaskItem({ context, task, selection, seen }) {
|
|
3236
4379
|
const { pi } = context;
|
|
3237
4380
|
const w = ChannelViews.words(pi);
|
|
3238
4381
|
const Own = task.icon;
|
|
@@ -3255,20 +4398,20 @@ function TaskItem({ context, task, selection }) {
|
|
|
3255
4398
|
avatar: Own ? /* @__PURE__ */ React.createElement("span", {
|
|
3256
4399
|
className: "tac-task-face"
|
|
3257
4400
|
}, /* @__PURE__ */ React.createElement(Own, {
|
|
3258
|
-
size:
|
|
4401
|
+
size: 40
|
|
3259
4402
|
})) : /* @__PURE__ */ React.createElement("span", {
|
|
3260
4403
|
className: "tac-task-face tac-task-glyph"
|
|
3261
4404
|
}, /* @__PURE__ */ React.createElement(ListTodo, {
|
|
3262
4405
|
size: 17
|
|
3263
4406
|
})),
|
|
3264
4407
|
title: task.title,
|
|
3265
|
-
dot:
|
|
4408
|
+
dot: task.status === "running" ? "running" : seen.needsLook(task) ? "attention" : undefined,
|
|
3266
4409
|
preview: task.detail ?? "",
|
|
3267
4410
|
waiting: task.status === "waiting",
|
|
3268
4411
|
time: SidebarUtil.time(task.endedAt ?? task.startedAt, pi.ui.language),
|
|
3269
4412
|
hint: task.title,
|
|
3270
4413
|
selected: selecting && selection.isChosen(task),
|
|
3271
|
-
onSelect: selecting ? () => removable && selection.toggle(task) : () =>
|
|
4414
|
+
onSelect: selecting ? () => removable && selection.toggle(task) : () => seen.open(task),
|
|
3272
4415
|
more: !selecting && (task.menu || removable) && /* @__PURE__ */ React.createElement(MoreMenu, {
|
|
3273
4416
|
pi,
|
|
3274
4417
|
label: task.title,
|
|
@@ -3281,54 +4424,38 @@ function TaskItem({ context, task, selection }) {
|
|
|
3281
4424
|
})
|
|
3282
4425
|
});
|
|
3283
4426
|
}
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
const
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
|
|
3292
|
-
|
|
3293
|
-
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
|
|
3307
|
-
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
|
|
3311
|
-
}), /* @__PURE__ */ React.createElement("rect", {
|
|
3312
|
-
className: bubble,
|
|
3313
|
-
x: "33",
|
|
3314
|
-
y,
|
|
3315
|
-
width,
|
|
3316
|
-
height: "14",
|
|
3317
|
-
rx: "7"
|
|
3318
|
-
}), /* @__PURE__ */ React.createElement("rect", {
|
|
3319
|
-
className: index === 0 ? "ta-pic-mark ta-pic-soft" : "ta-pic-line",
|
|
3320
|
-
x: "40",
|
|
3321
|
-
y: y + 4.5,
|
|
3322
|
-
width: width - 22,
|
|
3323
|
-
height: "5",
|
|
3324
|
-
rx: "2.5"
|
|
3325
|
-
}));
|
|
3326
|
-
}));
|
|
4427
|
+
var NO_HOME_ITEMS = [];
|
|
4428
|
+
function HomeRow({ pi, item }) {
|
|
4429
|
+
const [opening, setOpening] = React.useState(false);
|
|
4430
|
+
const Glyph = item.icon;
|
|
4431
|
+
const open = () => {
|
|
4432
|
+
setOpening(true);
|
|
4433
|
+
Promise.resolve().then(() => item.open()).catch((error) => pi.ui.notify(ChannelViews.message(error), "error")).finally(() => setOpening(false));
|
|
4434
|
+
};
|
|
4435
|
+
return /* @__PURE__ */ React.createElement(Row, {
|
|
4436
|
+
pi,
|
|
4437
|
+
avatar: /* @__PURE__ */ React.createElement("span", {
|
|
4438
|
+
className: "tac-home-icon",
|
|
4439
|
+
style: { background: `var(--ta-tint-${item.tone})`, color: `var(--ta-tint-ink-${item.tone})` }
|
|
4440
|
+
}, opening ? /* @__PURE__ */ React.createElement("span", {
|
|
4441
|
+
className: "ta-spinner"
|
|
4442
|
+
}) : /* @__PURE__ */ React.createElement(Glyph, {
|
|
4443
|
+
size: 19,
|
|
4444
|
+
strokeWidth: 1.8
|
|
4445
|
+
})),
|
|
4446
|
+
title: item.title,
|
|
4447
|
+
preview: item.detail ?? "",
|
|
4448
|
+
fresh: item.unseen,
|
|
4449
|
+
dot: item.unseen ? "attention" : undefined,
|
|
4450
|
+
time: item.at ? SidebarUtil.time(item.at, pi.ui.language) : "",
|
|
4451
|
+
selected: false,
|
|
4452
|
+
onSelect: open
|
|
4453
|
+
});
|
|
3327
4454
|
}
|
|
3328
4455
|
function AgentsSidebar({ context }) {
|
|
3329
4456
|
const { pi, service, ui } = context;
|
|
3330
4457
|
const state = useChannels(service);
|
|
3331
|
-
const { query, draft, channelId, fresh } = useUi(ui);
|
|
4458
|
+
const { query, draft, channelId, fresh: unread } = useUi(ui);
|
|
3332
4459
|
const w = ChannelViews.words(pi);
|
|
3333
4460
|
const faces = useFaces(state.team);
|
|
3334
4461
|
const serverCwd = useServerCwd(pi) ?? "";
|
|
@@ -3337,6 +4464,7 @@ function AgentsSidebar({ context }) {
|
|
|
3337
4464
|
const channelPage = pi.ui.useView(CHANNEL_PAGE);
|
|
3338
4465
|
const agentPage = pi.ui.useView(AGENT_PAGE);
|
|
3339
4466
|
const tasks = pi.ui.useTasks();
|
|
4467
|
+
const homeItems = pi.ui.useHomeItems?.() ?? NO_HOME_ITEMS;
|
|
3340
4468
|
const [folded, fold] = useFolded();
|
|
3341
4469
|
const [byDirectory, setByDirectory] = useStored(pi.storage, BY_DIRECTORY_KEY, false);
|
|
3342
4470
|
const language = pi.ui.language;
|
|
@@ -3347,11 +4475,41 @@ function AgentsSidebar({ context }) {
|
|
|
3347
4475
|
const FolderTree = pi.ui.icons.FolderTree ?? Folder;
|
|
3348
4476
|
const HostTag = pi.ui.HostTag;
|
|
3349
4477
|
const ListTodo = pi.ui.icons.ListTodo ?? ChannelViews.icon(pi, "List");
|
|
4478
|
+
const ChevronRight = ChannelViews.icon(pi, "ChevronRight");
|
|
3350
4479
|
const Avatar = pi.ui.Avatar;
|
|
3351
4480
|
const Empty = pi.ui.Empty;
|
|
3352
4481
|
const Skeleton = pi.ui.Skeleton;
|
|
3353
4482
|
const { team, working } = state;
|
|
3354
4483
|
const own = React.useMemo(() => ChannelsUtil.ownChannels(team), [team]);
|
|
4484
|
+
const seen = useSeenTasks(pi.storage, tasks);
|
|
4485
|
+
const said = Object.values(state.messages).reduce((count, list) => count + list.length, 0);
|
|
4486
|
+
const sessionLines = useSessionLines(context, `${said}:${Object.values(working).flat().join(",")}:${team.agents.length}`);
|
|
4487
|
+
const openSessions = pi.ui.useSessions?.() ?? NO_SESSIONS;
|
|
4488
|
+
const lastLines = React.useMemo(() => sessionLines && SidebarUtil.lastLines(team.agents, state.messages, [...sessionLines, ...openSessions]), [team.agents, state.messages, sessionLines, openSessions]);
|
|
4489
|
+
const answering = React.useMemo(() => SidebarUtil.answering(team.agents, openSessions, context.sessions), [team.agents, openSessions, context.sessions]);
|
|
4490
|
+
const asking = React.useMemo(() => SidebarUtil.waiting(team.agents, openSessions, context.sessions), [team.agents, openSessions, context.sessions]);
|
|
4491
|
+
const doubleBusy = !!double?.busy;
|
|
4492
|
+
const pageShown = !!double?.shown || !!channelPage?.shown || !!agentPage?.shown;
|
|
4493
|
+
const shownFile = shownSession ? openSessions.find((session) => session.sessionId === shownSession)?.sessionFile : undefined;
|
|
4494
|
+
const shownAgent = pageShown ? undefined : team.agents.find((agent) => !!shownSession && context.sessions.get(agent.id) === shownSession || !!shownFile && agent.sessionFile === shownFile)?.id;
|
|
4495
|
+
const doubleAt = double?.preview?.at;
|
|
4496
|
+
const latest = React.useMemo(() => {
|
|
4497
|
+
const sessions = [...sessionLines ?? [], ...openSessions];
|
|
4498
|
+
const map = new Map;
|
|
4499
|
+
for (const agent of team.agents) {
|
|
4500
|
+
const at = SidebarUtil.lastAt(agent, sessions, context.sessions);
|
|
4501
|
+
if (at !== undefined) {
|
|
4502
|
+
map.set(agent.id, at);
|
|
4503
|
+
}
|
|
4504
|
+
}
|
|
4505
|
+
if (doubleAt !== undefined) {
|
|
4506
|
+
map.set(DOUBLE_LOOK, doubleAt);
|
|
4507
|
+
}
|
|
4508
|
+
return map;
|
|
4509
|
+
}, [team.agents, sessionLines, openSessions, context.sessions, doubleAt]);
|
|
4510
|
+
const busyNow = React.useMemo(() => new Set([...answering, ...Object.values(working).flat(), ...doubleBusy ? [DOUBLE_LOOK] : []]), [answering, working, doubleBusy]);
|
|
4511
|
+
const needsLook = useUnseen(pi.storage, latest, busyNow, double?.shown ? DOUBLE_LOOK : shownAgent, state.answered, state.loaded ? [DOUBLE_LOOK, ...team.agents.map((agent) => agent.id)] : undefined);
|
|
4512
|
+
const doubleFresh = needsLook(DOUBLE_LOOK);
|
|
3355
4513
|
React.useEffect(() => {
|
|
3356
4514
|
for (const channel of own) {
|
|
3357
4515
|
service.messages(channel.id).catch(() => {
|
|
@@ -3360,21 +4518,14 @@ function AgentsSidebar({ context }) {
|
|
|
3360
4518
|
}
|
|
3361
4519
|
}, [service, own]);
|
|
3362
4520
|
const name = (id) => ChannelsUtil.authorName(team, id, { user: w.you, ta: w.ta });
|
|
3363
|
-
const lastSaid = new Map;
|
|
3364
|
-
for (const messages of Object.values(state.messages)) {
|
|
3365
|
-
for (const message of messages) {
|
|
3366
|
-
lastSaid.set(message.author, Math.max(lastSaid.get(message.author) ?? 0, message.at));
|
|
3367
|
-
}
|
|
3368
|
-
}
|
|
3369
4521
|
const shownTasks = tasks.filter((task) => SidebarUtil.matches(query, task.title, task.detail));
|
|
3370
4522
|
const groups = SidebarUtil.taskGroups(shownTasks);
|
|
3371
4523
|
const selection = useTaskSelection(pi, shownTasks);
|
|
3372
4524
|
const SelectBar = pi.ui.SelectBar;
|
|
3373
4525
|
const channels = ChannelsUtil.pinnedFirst(own).filter((channel) => SidebarUtil.matches(query, channel.name, channel.topic, ...membersOf(team, channel).map((agent) => agent.name)));
|
|
3374
|
-
const agents = ChannelsUtil.standing(team).filter((agent) => SidebarUtil.matches(query, agent.name, agent.role));
|
|
4526
|
+
const agents = ChannelsUtil.pinnedFirst(ChannelsUtil.standing(team)).filter((agent) => SidebarUtil.matches(query, agent.name, agent.role));
|
|
3375
4527
|
const directories = SidebarUtil.directories(agents, serverCwd);
|
|
3376
4528
|
const memberGroups = SidebarUtil.memberGroups(agents, serverCwd, byDirectory && !query.trim());
|
|
3377
|
-
const pageShown = !!double?.shown || !!channelPage?.shown || !!agentPage?.shown;
|
|
3378
4529
|
const openAgent = (agent) => {
|
|
3379
4530
|
setOpening(agent.id);
|
|
3380
4531
|
ChannelViews.openAgent(context, agent.id).catch((error) => pi.ui.notify(ChannelViews.message(error), "error")).finally(() => setOpening(undefined));
|
|
@@ -3385,11 +4536,12 @@ function AgentsSidebar({ context }) {
|
|
|
3385
4536
|
};
|
|
3386
4537
|
const ended = allEnded || selection.selecting ? groups.ended : groups.ended.slice(0, ENDED_SHOWN);
|
|
3387
4538
|
const nothing = query && shownTasks.length === 0 && channels.length === 0 && agents.length === 0;
|
|
3388
|
-
const blank = state.loaded && !query && !draft && tasks.length === 0 && own.length === 0 && ChannelsUtil.standing(team).length === 0;
|
|
3389
4539
|
const running = tasks.filter((task) => task.status === "running").length;
|
|
3390
4540
|
const waiting = tasks.filter((task) => task.status === "waiting").length;
|
|
4541
|
+
const fresh = tasks.filter((task) => task.status !== "waiting" && seen.needsLook(task)).length;
|
|
3391
4542
|
const doubleLine = [
|
|
3392
4543
|
waiting > 0 ? ChannelWords.format(w.waitingCount, { count: String(waiting) }) : "",
|
|
4544
|
+
fresh > 0 ? ChannelWords.format(w.freshCount, { count: String(fresh) }) : "",
|
|
3393
4545
|
running > 0 ? ChannelWords.format(w.runningCount, { count: String(running) }) : ""
|
|
3394
4546
|
].filter(Boolean).join(" · ");
|
|
3395
4547
|
return /* @__PURE__ */ React.createElement("div", {
|
|
@@ -3402,30 +4554,47 @@ function AgentsSidebar({ context }) {
|
|
|
3402
4554
|
type: "button",
|
|
3403
4555
|
className: `tac-double${double.shown ? " tac-selected" : ""}`,
|
|
3404
4556
|
"aria-current": double.shown || undefined,
|
|
4557
|
+
"data-unseen": waiting > 0 || fresh > 0 || doubleFresh ? "" : undefined,
|
|
3405
4558
|
onClick: () => pi.ui.showView(DOUBLE_PAGE)
|
|
3406
4559
|
}, /* @__PURE__ */ React.createElement("span", {
|
|
3407
4560
|
className: "tac-double-face"
|
|
3408
4561
|
}, /* @__PURE__ */ React.createElement(Avatar, {
|
|
3409
|
-
size:
|
|
4562
|
+
size: 42,
|
|
4563
|
+
mood: doubleBusy ? "working" : "idle"
|
|
4564
|
+
}), /* @__PURE__ */ React.createElement("span", {
|
|
4565
|
+
className: `tac-dot${waiting > 0 || fresh > 0 || doubleFresh ? " tac-dot-attention" : running > 0 || doubleBusy ? " tac-dot-running" : ""}`
|
|
3410
4566
|
})), /* @__PURE__ */ React.createElement("span", {
|
|
3411
4567
|
className: "tac-double-text"
|
|
3412
4568
|
}, /* @__PURE__ */ React.createElement("span", {
|
|
3413
|
-
className: "tac-double-
|
|
3414
|
-
}, double.title), /* @__PURE__ */ React.createElement("span", {
|
|
3415
|
-
className: `tac-double-line${waiting > 0 ? " tac-waiting" : ""}`
|
|
4569
|
+
className: "tac-double-top"
|
|
3416
4570
|
}, /* @__PURE__ */ React.createElement("span", {
|
|
3417
|
-
className:
|
|
3418
|
-
}
|
|
4571
|
+
className: "tac-double-name"
|
|
4572
|
+
}, double.title), !doubleLine && double.preview && /* @__PURE__ */ React.createElement("span", {
|
|
4573
|
+
className: "tac-item-time"
|
|
4574
|
+
}, SidebarUtil.time(double.preview.at, pi.ui.language))), /* @__PURE__ */ React.createElement("span", {
|
|
4575
|
+
className: `tac-double-line${waiting > 0 || fresh > 0 ? " tac-waiting" : doubleFresh && !doubleLine ? " tac-fresh" : ""}`
|
|
4576
|
+
}, /* @__PURE__ */ React.createElement("span", null, doubleLine || double.preview?.text || w.standingBy), (doubleBusy || running > 0) && /* @__PURE__ */ React.createElement("span", {
|
|
4577
|
+
className: "tac-spinner ta-spinner"
|
|
4578
|
+
}))), /* @__PURE__ */ React.createElement("span", {
|
|
4579
|
+
className: "tac-double-go",
|
|
4580
|
+
"aria-hidden": "true"
|
|
4581
|
+
}, /* @__PURE__ */ React.createElement(ChevronRight, {
|
|
4582
|
+
size: 18
|
|
4583
|
+
}))), double.menu && /* @__PURE__ */ React.createElement(MoreMenu, {
|
|
3419
4584
|
pi,
|
|
3420
4585
|
label: double.title,
|
|
3421
4586
|
items: () => (double.menu?.() ?? []).map((section) => section.map(({ icon: Icon, ...item }) => ({ ...item, icon: Icon && /* @__PURE__ */ React.createElement(Icon, {
|
|
3422
4587
|
size: 15
|
|
3423
4588
|
}) })))
|
|
4589
|
+
})), homeItems.filter((item) => SidebarUtil.matches(query, item.title, item.detail)).map((item) => /* @__PURE__ */ React.createElement(HomeRow, {
|
|
4590
|
+
key: item.key,
|
|
4591
|
+
pi,
|
|
4592
|
+
item
|
|
3424
4593
|
})), draft && /* @__PURE__ */ React.createElement(Row, {
|
|
3425
4594
|
pi,
|
|
3426
4595
|
avatar: /* @__PURE__ */ React.createElement(Face, {
|
|
3427
4596
|
face: draft.face,
|
|
3428
|
-
size:
|
|
4597
|
+
size: 40
|
|
3429
4598
|
}),
|
|
3430
4599
|
title: draft.name || w.newAgentName,
|
|
3431
4600
|
preview: w.notStarted,
|
|
@@ -3436,69 +4605,25 @@ function AgentsSidebar({ context }) {
|
|
|
3436
4605
|
rows: 4
|
|
3437
4606
|
}), nothing && /* @__PURE__ */ React.createElement(Empty, {
|
|
3438
4607
|
title: w.noMatch
|
|
3439
|
-
}),
|
|
3440
|
-
picture: /* @__PURE__ */ React.createElement(TeamPicture, {
|
|
3441
|
-
pi
|
|
3442
|
-
}),
|
|
3443
|
-
title: w.noTasksYet,
|
|
3444
|
-
hint: w.noTasksYetHint
|
|
3445
|
-
}, double && /* @__PURE__ */ React.createElement("button", {
|
|
3446
|
-
type: "button",
|
|
3447
|
-
className: "tac-button tac-team-up",
|
|
3448
|
-
onClick: () => pi.ui.showView(DOUBLE_PAGE)
|
|
3449
|
-
}, w.tellDouble)), state.loaded && !blank && !query && tasks.length === 0 && /* @__PURE__ */ React.createElement(Section, {
|
|
4608
|
+
}), state.loaded && (shownTasks.length > 0 || !query && tasks.length === 0) && /* @__PURE__ */ React.createElement(Section, {
|
|
3450
4609
|
id: "tasks",
|
|
3451
4610
|
title: w.tasks,
|
|
3452
|
-
count:
|
|
4611
|
+
count: shownTasks.length,
|
|
3453
4612
|
folded,
|
|
3454
|
-
onFold: fold
|
|
3455
|
-
|
|
4613
|
+
onFold: fold,
|
|
4614
|
+
alert: shownTasks.some((task) => seen.needsLook(task))
|
|
4615
|
+
}, shownTasks.length === 0 && /* @__PURE__ */ React.createElement("button", {
|
|
3456
4616
|
type: "button",
|
|
3457
4617
|
className: "tac-tasks-empty",
|
|
3458
4618
|
onClick: () => pi.ui.showView(DOUBLE_PAGE)
|
|
3459
|
-
}, /* @__PURE__ */ React.createElement("span", {
|
|
3460
|
-
className: "tac-task-face tac-task-glyph"
|
|
3461
4619
|
}, /* @__PURE__ */ React.createElement(ListTodo, {
|
|
3462
|
-
size:
|
|
3463
|
-
})
|
|
3464
|
-
className: "tac-item-text"
|
|
3465
|
-
}, /* @__PURE__ */ React.createElement("span", {
|
|
3466
|
-
className: "tac-item-title"
|
|
3467
|
-
}, w.noTasksYet), /* @__PURE__ */ React.createElement("span", {
|
|
3468
|
-
className: "tac-item-preview"
|
|
3469
|
-
}, w.noTasksHere)))), groups.waiting.length > 0 && /* @__PURE__ */ React.createElement(Section, {
|
|
3470
|
-
id: "waiting",
|
|
3471
|
-
title: w.waitingSection,
|
|
3472
|
-
count: groups.waiting.length,
|
|
3473
|
-
folded,
|
|
3474
|
-
onFold: fold
|
|
3475
|
-
}, groups.waiting.map((task) => /* @__PURE__ */ React.createElement(TaskItem, {
|
|
3476
|
-
key: task.key,
|
|
3477
|
-
context,
|
|
3478
|
-
task,
|
|
3479
|
-
selection
|
|
3480
|
-
}))), groups.running.length > 0 && /* @__PURE__ */ React.createElement(Section, {
|
|
3481
|
-
id: "running",
|
|
3482
|
-
title: w.runningSection,
|
|
3483
|
-
count: groups.running.length,
|
|
3484
|
-
folded,
|
|
3485
|
-
onFold: fold
|
|
3486
|
-
}, groups.running.map((task) => /* @__PURE__ */ React.createElement(TaskItem, {
|
|
3487
|
-
key: task.key,
|
|
3488
|
-
context,
|
|
3489
|
-
task,
|
|
3490
|
-
selection
|
|
3491
|
-
}))), groups.ended.length > 0 && /* @__PURE__ */ React.createElement(Section, {
|
|
3492
|
-
id: "ended",
|
|
3493
|
-
title: w.endedSection,
|
|
3494
|
-
count: groups.ended.length,
|
|
3495
|
-
folded,
|
|
3496
|
-
onFold: fold
|
|
3497
|
-
}, ended.map((task) => /* @__PURE__ */ React.createElement(TaskItem, {
|
|
4620
|
+
size: 14
|
|
4621
|
+
}), /* @__PURE__ */ React.createElement("span", null, w.noTasksHere)), [...groups.waiting, ...groups.running, ...ended].map((task) => /* @__PURE__ */ React.createElement(TaskItem, {
|
|
3498
4622
|
key: task.key,
|
|
3499
4623
|
context,
|
|
3500
4624
|
task,
|
|
3501
|
-
selection
|
|
4625
|
+
selection,
|
|
4626
|
+
seen
|
|
3502
4627
|
})), groups.ended.length > ENDED_SHOWN && !selection.selecting && /* @__PURE__ */ React.createElement("button", {
|
|
3503
4628
|
type: "button",
|
|
3504
4629
|
className: "tac-show-all",
|
|
@@ -3509,6 +4634,7 @@ function AgentsSidebar({ context }) {
|
|
|
3509
4634
|
count: agents.length,
|
|
3510
4635
|
folded,
|
|
3511
4636
|
onFold: fold,
|
|
4637
|
+
alert: agents.some((agent) => needsLook(agent.id)),
|
|
3512
4638
|
action: directories > 1 && /* @__PURE__ */ React.createElement("button", {
|
|
3513
4639
|
type: "button",
|
|
3514
4640
|
className: "tac-section-action",
|
|
@@ -3530,40 +4656,54 @@ function AgentsSidebar({ context }) {
|
|
|
3530
4656
|
location: group.cwd
|
|
3531
4657
|
})), group.agents.map((agent) => {
|
|
3532
4658
|
const where = team.channels.find((channel) => working[channel.id]?.includes(agent.id));
|
|
4659
|
+
const cwd = agent.cwd ?? serverCwd;
|
|
4660
|
+
const last = lastLines?.get(agent.id);
|
|
4661
|
+
const line = lastLines ? last?.text ?? w.noMessages : "";
|
|
4662
|
+
const busy = !!where || answering.has(agent.id);
|
|
4663
|
+
const needsYou = asking.has(agent.id);
|
|
4664
|
+
const unseen = !busy && needsLook(agent.id);
|
|
3533
4665
|
return /* @__PURE__ */ React.createElement(Row, {
|
|
3534
4666
|
pi,
|
|
3535
4667
|
key: agent.id,
|
|
3536
4668
|
avatar: /* @__PURE__ */ React.createElement(AgentAvatar, {
|
|
3537
4669
|
agent,
|
|
3538
4670
|
faces,
|
|
3539
|
-
size:
|
|
3540
|
-
working:
|
|
4671
|
+
size: 40,
|
|
4672
|
+
working: busy
|
|
3541
4673
|
}),
|
|
3542
4674
|
title: agent.name,
|
|
3543
|
-
badge:
|
|
3544
|
-
|
|
4675
|
+
badge: /* @__PURE__ */ React.createElement(PinMark, {
|
|
4676
|
+
pi,
|
|
4677
|
+
pinned: agent.pinned
|
|
4678
|
+
}),
|
|
4679
|
+
place: /* @__PURE__ */ React.createElement(HostTag, {
|
|
4680
|
+
location: cwd
|
|
3545
4681
|
}),
|
|
3546
|
-
preview: where ? ChannelWords.format(w.answeringIn, { channel: where.name }) :
|
|
3547
|
-
live:
|
|
3548
|
-
|
|
3549
|
-
|
|
3550
|
-
|
|
4682
|
+
preview: needsYou ? w.needsYou : where ? ChannelWords.format(w.answeringIn, { channel: where.name }) : line,
|
|
4683
|
+
live: busy && !needsYou,
|
|
4684
|
+
waiting: needsYou,
|
|
4685
|
+
fresh: unseen,
|
|
4686
|
+
dot: needsYou ? "attention" : busy ? "running" : unseen ? "attention" : undefined,
|
|
4687
|
+
time: lastLines ? SidebarUtil.time(last?.at ?? agent.createdAt, pi.ui.language) : "",
|
|
4688
|
+
hint: SidebarUtil.where(cwd),
|
|
3551
4689
|
selected: agentSelected(agent),
|
|
4690
|
+
deleting: state.deleting.includes(agent.id),
|
|
3552
4691
|
onSelect: () => openAgent(agent),
|
|
3553
4692
|
more: /* @__PURE__ */ React.createElement(AgentMenu, {
|
|
3554
4693
|
context,
|
|
3555
4694
|
agent,
|
|
3556
|
-
cwd
|
|
4695
|
+
cwd,
|
|
3557
4696
|
working: !!where
|
|
3558
4697
|
}),
|
|
3559
|
-
swipe:
|
|
4698
|
+
swipe: swipePinDelete(pi, !!agent.pinned, (pinned) => context.service.updateAgent(agent.id, { pinned }), () => deleteAgent(context, agent))
|
|
3560
4699
|
});
|
|
3561
4700
|
})))), channels.length > 0 && /* @__PURE__ */ React.createElement(Section, {
|
|
3562
4701
|
id: "channels",
|
|
3563
4702
|
title: w.channelsSection,
|
|
3564
4703
|
count: channels.length,
|
|
3565
4704
|
folded,
|
|
3566
|
-
onFold: fold
|
|
4705
|
+
onFold: fold,
|
|
4706
|
+
alert: channels.some((channel) => unread.includes(channel.id))
|
|
3567
4707
|
}, channels.map((channel) => {
|
|
3568
4708
|
const members = membersOf(team, channel);
|
|
3569
4709
|
const busy = working[channel.id] ?? [];
|
|
@@ -3575,32 +4715,28 @@ ${agent.cwd ?? serverCwd}`,
|
|
|
3575
4715
|
avatar: /* @__PURE__ */ React.createElement(RoomFace, {
|
|
3576
4716
|
members,
|
|
3577
4717
|
faces,
|
|
3578
|
-
size:
|
|
4718
|
+
size: 40,
|
|
3579
4719
|
working: busy
|
|
3580
4720
|
}),
|
|
3581
4721
|
title: channel.name,
|
|
3582
|
-
badge: /* @__PURE__ */ React.createElement(
|
|
3583
|
-
|
|
3584
|
-
|
|
3585
|
-
}
|
|
3586
|
-
className: "tac-pinned",
|
|
3587
|
-
title: w.pinned,
|
|
3588
|
-
role: "img",
|
|
3589
|
-
"aria-label": w.pinned
|
|
3590
|
-
}, ChannelViews.maybeIcon(pi, "Pin", null, 12))),
|
|
4722
|
+
badge: /* @__PURE__ */ React.createElement(PinMark, {
|
|
4723
|
+
pi,
|
|
4724
|
+
pinned: channel.pinned
|
|
4725
|
+
}),
|
|
3591
4726
|
preview,
|
|
3592
4727
|
live: busy.length > 0,
|
|
4728
|
+
dot: busy.length > 0 ? "running" : unread.includes(channel.id) ? "attention" : undefined,
|
|
3593
4729
|
time: SidebarUtil.time(last?.at ?? channel.createdAt, pi.ui.language),
|
|
3594
|
-
fresh: fresh.includes(channel.id),
|
|
3595
4730
|
hint: channel.topic ? `#${channel.name} · ${channel.topic}` : `#${channel.name}`,
|
|
3596
4731
|
selected: !!channelPage?.shown && channelId === channel.id,
|
|
4732
|
+
deleting: state.deleting.includes(channel.id),
|
|
3597
4733
|
onSelect: () => context.showChannel(channel.id),
|
|
3598
4734
|
more: /* @__PURE__ */ React.createElement(ChannelMenu, {
|
|
3599
4735
|
context,
|
|
3600
4736
|
channel,
|
|
3601
4737
|
working: busy
|
|
3602
4738
|
}),
|
|
3603
|
-
swipe:
|
|
4739
|
+
swipe: swipePinDelete(pi, !!channel.pinned, (pinned) => context.service.updateChannel(channel.id, { pinned }), () => deleteChannel(context, channel))
|
|
3604
4740
|
});
|
|
3605
4741
|
}))), selection.selecting && SelectBar && /* @__PURE__ */ React.createElement(SelectBar, {
|
|
3606
4742
|
count: selection.selected.length,
|
|
@@ -3632,17 +4768,22 @@ var STYLE = `
|
|
|
3632
4768
|
.tac-list { flex: 1; min-height: 0; overflow: auto; padding: 2px 0 12px; }
|
|
3633
4769
|
.tac-list:has(> .ta-empty:not(.ta-empty-compact)) { display: flex; flex-direction: column; }
|
|
3634
4770
|
.tac-list > .tac-view > .tac-form { margin: 2px 10px 8px; }
|
|
3635
|
-
|
|
3636
|
-
.tac-double
|
|
3637
|
-
.tac-double
|
|
3638
|
-
.tac-double
|
|
3639
|
-
.tac-double-
|
|
4771
|
+
/* The double first, a card of its own: the one the user talks to. --tac-double-bg and -edge change with hover and press. */
|
|
4772
|
+
.tac-double { --tac-double-bg: var(--ta-raised); --tac-double-edge: color-mix(in srgb, var(--ta-text) 7%, transparent); display: flex; align-items: center; gap: 14px; width: 100%; min-height: 80px; margin: 4px 0 14px; padding: 12px 44px 12px 12px; border: 1px solid var(--tac-double-edge); border-radius: 18px; background: var(--tac-double-bg); color: var(--ta-text); font: inherit; text-align: left; cursor: pointer; transition: background-color 120ms, border-color 160ms; box-sizing: border-box; }
|
|
4773
|
+
:root[data-theme='light'] .tac-double { --tac-double-bg: var(--ta-card); --tac-double-edge: var(--ta-border-muted); }
|
|
4774
|
+
.tac-double:hover { --tac-double-bg: var(--ta-hover); }
|
|
4775
|
+
.tac-double.tac-selected { --tac-double-edge: color-mix(in srgb, var(--ta-accent) 40%, transparent); }
|
|
4776
|
+
/* The dinosaur on a disc of its color, as a profile picture. */
|
|
4777
|
+
.tac-double-face { display: inline-grid; place-items: center; width: 52px; height: 52px; flex: none; border-radius: 50%; background: color-mix(in oklch, var(--ta-accent) 34%, var(--ta-main)); }
|
|
4778
|
+
.tac-double-text { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
|
|
4779
|
+
/* A finger has no … to hover: the card says it opens, as a profile card does. */
|
|
4780
|
+
.tac-double-go { display: none; flex: none; margin-right: -2px; color: var(--ta-muted); opacity: 0.7; }
|
|
4781
|
+
:root[data-touch] .tac-double-go { display: inline-flex; }
|
|
3640
4782
|
.tac-double-row { position: relative; }
|
|
3641
4783
|
.tac-pinned { display: inline-flex; flex: none; color: var(--ta-muted); }
|
|
3642
|
-
.tac-double-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: calc(
|
|
4784
|
+
.tac-double-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: calc(16px * var(--ta-font-scale)); font-weight: 600; line-height: calc(22px * var(--ta-font-scale)); letter-spacing: 0.01em; }
|
|
3643
4785
|
.tac-item-bottom { display: flex; align-items: center; gap: 6px; min-width: 0; }
|
|
3644
4786
|
.tac-item-bottom .tac-item-preview { flex: 1; min-width: 0; }
|
|
3645
|
-
.tac-fresh { width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--ta-green); }
|
|
3646
4787
|
.tac-head { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; padding-left: 8px; }
|
|
3647
4788
|
.tac-head-title { display: flex; align-items: baseline; gap: 8px; flex: 1; min-width: 0; white-space: nowrap; }
|
|
3648
4789
|
.tac-head-title strong { overflow: hidden; text-overflow: ellipsis; font-size: calc(14.5px * var(--ta-font-scale)); font-weight: 600; }
|
|
@@ -3656,8 +4797,8 @@ var STYLE = `
|
|
|
3656
4797
|
.tac-head-more { margin-left: 4px; color: var(--ta-muted); font-size: calc(11.5px * var(--ta-font-scale)); }
|
|
3657
4798
|
.tac-action.tac-on { background: var(--ta-hover-strong); color: var(--ta-text); }
|
|
3658
4799
|
.tac-room-page { display: flex; flex-direction: column; flex: 1; min-height: 0; background: var(--ta-main); color: var(--ta-text); }
|
|
3659
|
-
.tac-chat { flex: 1; min-height: 0; overflow-y: auto; }
|
|
3660
|
-
.tac-chat-col { display: flex; flex-direction: column; gap: 4px; max-width: calc(var(--ta-col) + 48px); margin: 0 auto; padding: 20px 24px 12px; box-sizing: border-box; }
|
|
4800
|
+
.tac-chat { flex: 1; min-height: 0; overflow-x: hidden; overflow-y: auto; overflow-anchor: none; }
|
|
4801
|
+
.tac-chat-col { position: relative; display: flex; flex-direction: column; gap: 4px; max-width: calc(var(--ta-col) + 48px); margin: 0 auto; padding: 20px 24px 12px; box-sizing: border-box; }
|
|
3661
4802
|
.tac-chat-time { align-self: center; margin: 14px 0 6px; color: var(--ta-muted); font-size: calc(11.5px * var(--ta-font-scale)); font-variant-numeric: tabular-nums; }
|
|
3662
4803
|
.tac-chat-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 12vh auto 0; max-width: 360px; color: var(--ta-muted); font-size: calc(13px * var(--ta-font-scale)); text-align: center; }
|
|
3663
4804
|
.tac-chat-empty strong { margin-top: 6px; color: var(--ta-text); font-size: calc(16px * var(--ta-font-scale)); }
|
|
@@ -3675,6 +4816,57 @@ var STYLE = `
|
|
|
3675
4816
|
.tac-msg-bubble pre { max-width: 100%; overflow-x: auto; }
|
|
3676
4817
|
.tac-mention { color: var(--ta-link); }
|
|
3677
4818
|
.tac-notice { align-self: center; margin: 10px 0; padding: 3px 10px; border-radius: 999px; background: var(--ta-hover); color: var(--ta-muted); font-size: calc(12px * var(--ta-font-scale)); }
|
|
4819
|
+
/* The notice of a channel (notice.tsx): a line over the chat, open to read and to write */
|
|
4820
|
+
.tac-notice-bar { flex: none; width: 100%; max-width: calc(var(--ta-col) + 48px); margin: 0 auto; padding: 8px 24px 0; box-sizing: border-box; }
|
|
4821
|
+
.tac-notice-head { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 38px; padding: 0 10px 0 8px; border: 1px solid var(--ta-border-muted); border-radius: 12px; background: var(--ta-side); color: var(--ta-text); font: inherit; font-size: calc(13px * var(--ta-font-scale)); text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background 120ms, border-radius 160ms; }
|
|
4822
|
+
.tac-notice-head:hover { background: var(--ta-hover); }
|
|
4823
|
+
.tac-notice-bar[data-open] .tac-notice-head { border-bottom-color: transparent; border-radius: 12px 12px 0 0; }
|
|
4824
|
+
.tac-notice-icon { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; background: color-mix(in srgb, var(--ta-yellow) 18%, transparent); color: color-mix(in srgb, var(--ta-yellow) 70%, var(--ta-text)); }
|
|
4825
|
+
.tac-notice-head > strong { flex: none; font-weight: 600; }
|
|
4826
|
+
.tac-notice-sum { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ta-muted); }
|
|
4827
|
+
.tac-notice-chevron { flex: none; display: grid; color: var(--ta-muted); transition: transform 160ms var(--ta-ease); }
|
|
4828
|
+
.tac-notice-bar[data-open] .tac-notice-chevron { transform: rotate(180deg); }
|
|
4829
|
+
.tac-notice-body { max-height: min(46vh, 420px); overflow-y: auto; padding: 4px 14px 10px; border: 1px solid var(--ta-border-muted); border-top: 0; border-radius: 0 0 12px 12px; background: var(--ta-side); animation: tac-notice-in 160ms var(--ta-ease) both; }
|
|
4830
|
+
.tac-notice-text { color: var(--ta-body); font-size: calc(13.5px * var(--ta-font-scale)); line-height: 1.6; overflow-wrap: anywhere; }
|
|
4831
|
+
.tac-notice-text h3 { margin: 10px 0 4px; font-size: calc(12.5px * var(--ta-font-scale)); color: var(--ta-secondary); }
|
|
4832
|
+
.tac-notice-text ul { margin: 0; padding-left: 1.2em; }
|
|
4833
|
+
.tac-notice-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; color: var(--ta-muted); font-size: calc(12px * var(--ta-font-scale)); }
|
|
4834
|
+
.tac-notice-form { display: flex; flex-direction: column; gap: 8px; padding-top: 8px; }
|
|
4835
|
+
textarea.tac-notice-input { min-height: 180px; font-family: var(--ta-font-mono, ui-monospace, SFMono-Regular, Menlo, monospace); font-size: calc(12.5px * var(--ta-font-scale)); }
|
|
4836
|
+
.tac-notice-actions { display: flex; justify-content: flex-end; gap: 8px; }
|
|
4837
|
+
button.tac-notice-line { border: 0; font: inherit; font-size: calc(12px * var(--ta-font-scale)); cursor: pointer; }
|
|
4838
|
+
button.tac-notice-line:hover:not(:disabled) { color: var(--ta-text); }
|
|
4839
|
+
button.tac-notice-line:disabled { cursor: default; }
|
|
4840
|
+
@keyframes tac-notice-in { from { opacity: 0; transform: translateY(-4px); } }
|
|
4841
|
+
@media (max-width: 720px) {
|
|
4842
|
+
.tac-notice-bar { padding: 6px 14px 0; }
|
|
4843
|
+
}
|
|
4844
|
+
|
|
4845
|
+
/* An agent's card (card.tsx): shared from its menu, opened from its link */
|
|
4846
|
+
.tac-card { display: flex; flex-direction: column; align-items: stretch; gap: 12px; }
|
|
4847
|
+
.tac-card-who { display: flex; flex-direction: column; align-items: center; gap: 2px; padding-top: 4px; }
|
|
4848
|
+
.tac-card-face { display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 6px; }
|
|
4849
|
+
.tac-card-mark { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--ta-hover); font-size: 22px; font-weight: 700; }
|
|
4850
|
+
.tac-card-name { font-size: calc(16px * var(--ta-font-scale)); font-weight: 600; }
|
|
4851
|
+
.tac-card-kind { color: var(--ta-muted); font-size: calc(12px * var(--ta-font-scale)); }
|
|
4852
|
+
.tac-card-role { max-height: 160px; overflow-y: auto; padding: 10px 12px; border: 1px solid var(--ta-border-muted); border-radius: 12px; background: var(--ta-side); color: var(--ta-body); font-size: calc(13px * var(--ta-font-scale)); line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
|
|
4853
|
+
.tac-card-page .tac-card-role { max-height: none; white-space: normal; }
|
|
4854
|
+
.tac-card-qr { display: grid; place-items: center; }
|
|
4855
|
+
.tac-card-qr canvas, .tac-card-qr svg, .tac-card-qr img { width: 168px; height: 168px; }
|
|
4856
|
+
.tac-card-link { padding: 8px 10px; border-radius: 8px; background: var(--ta-hover); color: var(--ta-secondary); font-family: var(--ta-font-mono, ui-monospace, SFMono-Regular, Menlo, monospace); font-size: calc(11.5px * var(--ta-font-scale)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
4857
|
+
.tac-card-actions { display: flex; justify-content: center; gap: 8px; }
|
|
4858
|
+
.tac-card-actions .tac-button { height: 36px; padding: 0 16px; }
|
|
4859
|
+
.tac-card-stop { align-self: center; padding: 4px 8px; border: 0; background: none; color: var(--ta-muted); font: inherit; font-size: calc(12.5px * var(--ta-font-scale)); cursor: pointer; }
|
|
4860
|
+
.tac-card-stop:hover:not(:disabled) { color: var(--ta-red); }
|
|
4861
|
+
.tac-card-making { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 120px; color: var(--ta-muted); font-size: calc(13px * var(--ta-font-scale)); }
|
|
4862
|
+
.tac-card-page { flex: 1; min-height: 0; height: 100%; overflow-y: auto; padding: 28px 20px 40px; box-sizing: border-box; background: var(--ta-main); color: var(--ta-text); }
|
|
4863
|
+
.tac-card-page > .tac-card { max-width: 520px; margin: 0 auto; }
|
|
4864
|
+
.tac-card-page .tac-button.tac-primary { height: 40px; font-size: calc(14px * var(--ta-font-scale)); }
|
|
4865
|
+
.tac-card-dir { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--ta-secondary); font-size: calc(13px * var(--ta-font-scale)); }
|
|
4866
|
+
.tac-card-dir > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
4867
|
+
.tac-card-done { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--ta-green) 10%, transparent); color: var(--ta-green); font-size: calc(13.5px * var(--ta-font-scale)); }
|
|
4868
|
+
.tac-center { text-align: center; }
|
|
4869
|
+
|
|
3678
4870
|
.tac-live { display: flex; align-items: center; gap: 8px; align-self: flex-start; margin: 10px 0 0 38px; padding: 5px 12px 5px 8px; border-radius: 999px; background: var(--ta-hover); color: var(--ta-secondary); font-size: calc(12.5px * var(--ta-font-scale)); }
|
|
3679
4871
|
.tac-live-faces { display: inline-flex; }
|
|
3680
4872
|
.tac-live-faces > * + * { margin-left: -4px; }
|
|
@@ -3733,15 +4925,18 @@ div.tac-dialog-label { flex-direction: row; justify-content: space-between; marg
|
|
|
3733
4925
|
.tac-identity { position: fixed; top: calc(60px + env(safe-area-inset-top) + var(--ta-titlebar, 0px)); left: 12px; right: 12px; width: auto; max-width: none; transform: none; animation: none; }
|
|
3734
4926
|
}
|
|
3735
4927
|
.tac-empty { padding: 8px 18px; }
|
|
3736
|
-
.tac-item { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height:
|
|
4928
|
+
.tac-item { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; margin: 1px 0; padding: 9px 10px; border: 0; border-radius: 12px; background: none; color: var(--ta-text); font: inherit; text-align: left; cursor: pointer; transition: background 120ms; }
|
|
3737
4929
|
.tac-item:hover { background: var(--ta-hover); }
|
|
3738
4930
|
.tac-item.tac-selected { background: var(--ta-selected); }
|
|
3739
|
-
|
|
4931
|
+
/* A row with nothing to say under its name, as a contact: one line, a little lower. */
|
|
4932
|
+
.tac-item.tac-item-single { min-height: 54px; padding-top: 7px; padding-bottom: 7px; }
|
|
4933
|
+
.tac-item-text { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
|
|
3740
4934
|
.tac-item-top { display: flex; align-items: center; gap: 6px; min-width: 0; }
|
|
3741
|
-
.tac-item-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: calc(
|
|
4935
|
+
.tac-item-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: calc(14px * var(--ta-font-scale)); font-weight: 500; line-height: calc(19px * var(--ta-font-scale)); }
|
|
3742
4936
|
.tac-item-time { flex: none; margin-left: auto; padding-left: 4px; color: var(--ta-muted); font-size: calc(11px * var(--ta-font-scale)); font-variant-numeric: tabular-nums; }
|
|
3743
4937
|
.tac-item-preview { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ta-muted); font-size: calc(12px * var(--ta-font-scale)); line-height: calc(17px * var(--ta-font-scale)); }
|
|
3744
|
-
|
|
4938
|
+
/* What goes on now is said plainly: the green dot on the face marks it. */
|
|
4939
|
+
.tac-item-preview.tac-now { color: var(--ta-secondary); }
|
|
3745
4940
|
.tac-lead { display: inline-flex; align-items: center; gap: 3px; flex: none; max-width: 96px; overflow: hidden; padding: 0 6px; border: 1px solid color-mix(in srgb, var(--ta-green) 35%, transparent); border-radius: 999px; background: color-mix(in srgb, var(--ta-green) 10%, transparent); color: var(--ta-green); font-size: calc(10.5px * var(--ta-font-scale)); font-weight: 600; line-height: calc(16px * var(--ta-font-scale)); white-space: nowrap; }
|
|
3746
4941
|
.tac-lead span { overflow: hidden; text-overflow: ellipsis; }
|
|
3747
4942
|
.tac-lead svg { flex: none; }
|
|
@@ -3749,6 +4944,13 @@ div.tac-dialog-label { flex-direction: row; justify-content: space-between; marg
|
|
|
3749
4944
|
.tac-folder span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
3750
4945
|
.tac-folder .ta-host-tag { margin: 0 0 0 1px; vertical-align: 0; }
|
|
3751
4946
|
.tac-item-top .ta-host-tag { margin: 0; vertical-align: 0; }
|
|
4947
|
+
/* A remote agent's host, on the line of where it works: as quiet as the line, its blue says it is elsewhere. */
|
|
4948
|
+
.tac-item-bottom .ta-host-tag { height: auto; margin: 0; padding: 0; background: none; color: color-mix(in srgb, var(--ta-blue) 70%, var(--ta-muted)); font-size: calc(12px * var(--ta-font-scale)); font-weight: 400; line-height: calc(17px * var(--ta-font-scale)); }
|
|
4949
|
+
.tac-item-bottom .ta-host-tag { gap: 4px; }
|
|
4950
|
+
.tac-item-bottom .ta-host-tag > svg { width: calc(12px * var(--ta-font-scale)); height: calc(12px * var(--ta-font-scale)); }
|
|
4951
|
+
.tac-item-bottom .ta-host-tag + .tac-item-preview::before { content: '·'; margin-right: 6px; }
|
|
4952
|
+
/* The panda's ears are ink, lost on a dark page: a lighter ink there. */
|
|
4953
|
+
:root:not([data-theme='light']) .tac-face[data-face="11"] .tac-face-body > g > circle { fill: #4a4a52; }
|
|
3752
4954
|
.tac-face { display: inline-flex; flex: none; }
|
|
3753
4955
|
.tac-face svg { display: block; overflow: visible; }
|
|
3754
4956
|
.tac-face-eyes { transform-box: fill-box; transform-origin: center; animation: tac-blink 5.2s infinite; }
|
|
@@ -3776,11 +4978,16 @@ textarea.tac-input { resize: vertical; min-height: 56px; line-height: 1.5; }
|
|
|
3776
4978
|
.tac-chip.tac-on { border-color: var(--ta-accent); color: var(--ta-text); background: var(--ta-selected); }
|
|
3777
4979
|
.tac-chip small { color: var(--ta-muted); }
|
|
3778
4980
|
.tac-buttons { display: flex; justify-content: flex-end; gap: 6px; }
|
|
3779
|
-
|
|
3780
|
-
.tac-button
|
|
3781
|
-
.tac-button:disabled {
|
|
4981
|
+
/* As the buttons of the page (.ta-button). */
|
|
4982
|
+
.tac-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid var(--ta-border); border-radius: 8px; background: transparent; color: var(--ta-text); font: inherit; font-size: calc(13px * var(--ta-font-scale)); font-weight: 500; white-space: nowrap; cursor: pointer; transition: background 120ms, opacity 120ms; }
|
|
4983
|
+
.tac-button:hover:not(:disabled) { background: var(--ta-hover); }
|
|
4984
|
+
.tac-button.tac-primary { border-color: var(--ta-brand); background: var(--ta-brand); color: var(--ta-brand-text); }
|
|
4985
|
+
.tac-button.tac-primary:hover:not(:disabled) { background: var(--ta-brand); opacity: 0.88; }
|
|
4986
|
+
.tac-button:disabled:not(.ta-busy) { opacity: 0.5; cursor: default; }
|
|
4987
|
+
.tac-button.ta-busy { position: relative; }
|
|
3782
4988
|
.tac-button.tac-danger { border-color: transparent; background: var(--ta-red); color: #fff; }
|
|
3783
|
-
.tac-
|
|
4989
|
+
.tac-button.tac-danger > .ta-busy-mark { border-color: rgba(255, 255, 255, 0.35); border-top-color: #fff; }
|
|
4990
|
+
.tac-button.tac-danger:hover:not(:disabled) { background: var(--ta-red); opacity: 0.9; }
|
|
3784
4991
|
.tac-link { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px; border: 0; border-radius: 6px; background: none; color: var(--ta-secondary); font: inherit; font-size: calc(12.5px * var(--ta-font-scale)); cursor: pointer; }
|
|
3785
4992
|
.tac-link:hover { background: var(--ta-hover); }
|
|
3786
4993
|
.tac-link.tac-danger { color: var(--ta-red); }
|
|
@@ -3854,43 +5061,76 @@ textarea.tac-role-input { min-height: 200px; max-height: 50vh; font-size: calc(1
|
|
|
3854
5061
|
:root[data-touch] .tac-item-more > .tac-action { visibility: hidden; }
|
|
3855
5062
|
:root[data-touch] .tac-item-row .tac-item-time { visibility: visible; }
|
|
3856
5063
|
:root[data-touch] .tac-double { padding-right: 10px; }
|
|
3857
|
-
:root[data-touch] .tac-item:not(.tac-selected):hover
|
|
5064
|
+
:root[data-touch] .tac-item:not(.tac-selected):hover { --tac-bg: var(--ta-side); background: none; }
|
|
5065
|
+
:root[data-touch] .tac-double:hover { --tac-double-bg: var(--ta-raised); }
|
|
5066
|
+
:root[data-theme='light'][data-touch] .tac-double:hover { --tac-double-bg: var(--ta-card); }
|
|
3858
5067
|
/* A phone, as its messaging apps: the row picked is not marked; its conversation covers the list, and back on the list nothing is picked. */
|
|
3859
|
-
:root[data-handheld] .tac-item.tac-selected
|
|
3860
|
-
:root[data-
|
|
5068
|
+
:root[data-handheld] .tac-item.tac-selected { --tac-bg: var(--ta-side); background: none; }
|
|
5069
|
+
:root[data-handheld] .tac-double.tac-selected { --tac-double-edge: color-mix(in srgb, var(--ta-text) 7%, transparent); }
|
|
5070
|
+
:root[data-theme='light'][data-handheld] .tac-double.tac-selected { --tac-double-edge: var(--ta-border-muted); }
|
|
5071
|
+
:root[data-touch] .tac-item:active { --tac-bg: var(--ta-hover); background: var(--ta-hover); }
|
|
5072
|
+
:root[data-touch] .tac-double:active, :root[data-touch] .tac-double:has(~ .tac-item-more > [aria-expanded="true"]) { --tac-double-bg: var(--ta-hover); }
|
|
3861
5073
|
/* The side bar of the double: its sections, folding */
|
|
3862
|
-
.tac-double-
|
|
3863
|
-
.tac-double-
|
|
3864
|
-
.tac-double-line
|
|
3865
|
-
.tac-double-line > span:
|
|
5074
|
+
.tac-double-top { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
|
|
5075
|
+
.tac-double-top > .tac-double-name { flex: 1; min-width: 0; }
|
|
5076
|
+
.tac-double-line { display: flex; align-items: center; gap: 7px; min-width: 0; color: var(--ta-secondary); font-size: calc(12.5px * var(--ta-font-scale)); line-height: calc(17px * var(--ta-font-scale)); }
|
|
5077
|
+
.tac-double-line > span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
5078
|
+
/* Something goes on: a spinner ends its line, as in the list of conversations. */
|
|
5079
|
+
.tac-spinner.ta-spinner { width: 12px; height: 12px; }
|
|
3866
5080
|
.tac-double-line.tac-waiting { color: color-mix(in srgb, var(--ta-yellow) 85%, var(--ta-text)); }
|
|
3867
5081
|
.tac-section { display: flex; flex-direction: column; }
|
|
3868
|
-
|
|
3869
|
-
.tac-section
|
|
3870
|
-
.tac-section-head
|
|
5082
|
+
/* A section is named, not boxed: a quiet name and count, the chevron only while hovered or folded. */
|
|
5083
|
+
.tac-section + .tac-section { margin-top: 10px; }
|
|
5084
|
+
.tac-section-head { display: flex; align-items: center; gap: 6px; width: 100%; height: 30px; margin: 0; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: var(--ta-muted); font: inherit; font-size: calc(12px * var(--ta-font-scale)); font-weight: 500; letter-spacing: 0.02em; text-align: left; cursor: pointer; transition: color 120ms; }
|
|
5085
|
+
.tac-section-head:hover { color: var(--ta-secondary); }
|
|
3871
5086
|
.tac-section-head-row { position: relative; }
|
|
3872
|
-
/* Left of the
|
|
3873
|
-
.tac-section-action { position: absolute; top:
|
|
5087
|
+
/* Left of the chevron; seen on hover, or while on. */
|
|
5088
|
+
.tac-section-action { position: absolute; top: 4px; right: 26px; display: inline-grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--ta-muted); cursor: pointer; opacity: 0; transition: opacity 120ms, background 120ms, color 120ms; }
|
|
3874
5089
|
.tac-section-head-row:hover .tac-section-action, .tac-section-action:focus-visible, .tac-section-action[aria-pressed="true"] { opacity: 1; }
|
|
3875
5090
|
.tac-section-action:hover { background: var(--ta-hover-strong); color: var(--ta-secondary); }
|
|
3876
5091
|
.tac-section-action[aria-pressed="true"] { color: var(--ta-accent); }
|
|
3877
5092
|
.tac-section-head:focus-visible { outline: 1px solid var(--ta-border-focus); outline-offset: -1px; }
|
|
3878
|
-
.tac-section-chevron { width: 6px; height: 6px; margin: 0 3px 0
|
|
5093
|
+
.tac-section-chevron { flex: none; width: 6px; height: 6px; margin: 0 3px 0 auto; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; opacity: 0; transform: translateY(-1px) rotate(45deg); transition: transform 160ms var(--ta-ease, ease), opacity 120ms; }
|
|
5094
|
+
.tac-section-head-row:hover .tac-section-chevron, .tac-section-head:focus-visible .tac-section-chevron, .tac-closed .tac-section-chevron { opacity: 1; }
|
|
3879
5095
|
.tac-closed .tac-section-chevron { transform: translateX(-1px) rotate(-45deg); }
|
|
3880
|
-
.tac-section-title {
|
|
3881
|
-
.tac-section-count { flex: none; color: var(--ta-muted); font-size: calc(
|
|
5096
|
+
.tac-section-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
5097
|
+
.tac-section-count { flex: none; color: var(--ta-muted); opacity: 0.7; font-size: calc(11.5px * var(--ta-font-scale)); font-variant-numeric: tabular-nums; }
|
|
3882
5098
|
.tac-section-body { display: flex; flex-direction: column; animation: tac-unfold 160ms ease-out; }
|
|
3883
5099
|
.tac-section-body > .tac-folder:first-child { margin-top: 4px; }
|
|
3884
5100
|
@keyframes tac-unfold { from { opacity: 0; transform: translateY(-3px); } }
|
|
3885
5101
|
@media (prefers-reduced-motion: reduce) { .tac-section-body, .tac-section-chevron { animation: none; transition: none; } }
|
|
3886
|
-
|
|
5102
|
+
/*
|
|
5103
|
+
* On the corner of the face, as the presence of a contact: green while it goes on, amber while it needs the user
|
|
5104
|
+
* (it waits, or ended or wrote since they last looked); nothing else. Cut out of the face by the row's color (--tac-bg).
|
|
5105
|
+
*/
|
|
5106
|
+
.tac-dot { position: absolute; right: -2px; bottom: -2px; z-index: 1; width: 12px; height: 12px; box-sizing: border-box; border: 2px solid var(--tac-bg, var(--ta-side)); border-radius: 50%; background: var(--tac-dot); }
|
|
5107
|
+
.tac-avatar { position: relative; display: inline-flex; flex: none; }
|
|
5108
|
+
/* A row an extension adds under the double (a daily brief): its icon on a tile of its tint, the size of a face. */
|
|
5109
|
+
.tac-home-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; }
|
|
5110
|
+
.tac-home-icon > .ta-spinner { width: 16px; height: 16px; }
|
|
5111
|
+
.tac-double-face { position: relative; }
|
|
5112
|
+
.tac-item:hover { --tac-bg: var(--ta-hover); }
|
|
5113
|
+
.tac-item.tac-selected { --tac-bg: var(--ta-selected); }
|
|
5114
|
+
.tac-double-face > .tac-dot { right: 1px; bottom: 1px; width: 14px; height: 14px; border-width: 2.5px; --tac-bg: var(--tac-double-bg); }
|
|
5115
|
+
.tac-dot-running { --tac-dot: var(--ta-green); }
|
|
5116
|
+
.tac-dot-attention { --tac-dot: var(--ta-yellow); }
|
|
5117
|
+
/* The dot grows in, turns from green to amber when an answer ends unseen (a ripple or two says so), and shrinks away once looked at. */
|
|
5118
|
+
.tac-dot { transform: scale(0); opacity: 0; transition: transform 0.24s cubic-bezier(0.3, 1.5, 0.5, 1), opacity 0.18s ease, background-color 0.5s ease; }
|
|
5119
|
+
.tac-dot-running, .tac-dot-attention { transform: none; opacity: 1; }
|
|
5120
|
+
.tac-dot-attention::after { content: ''; position: absolute; inset: -2px; border-radius: 50%; animation: tac-ripple 1.5s ease-out 0.3s 2 both; }
|
|
5121
|
+
@keyframes tac-ripple { from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ta-yellow) 55%, transparent); } to { box-shadow: 0 0 0 7px color-mix(in srgb, var(--ta-yellow) 0%, transparent); } }
|
|
5122
|
+
@media (prefers-reduced-motion: reduce) { .tac-dot { transition: opacity 0.18s ease; } .tac-dot-attention::after { animation: none; } }
|
|
5123
|
+
/* What came unseen reads as unread: in the color of the text, not muted. */
|
|
5124
|
+
.tac-item-preview.tac-fresh, .tac-double-line.tac-fresh { color: var(--ta-text); }
|
|
5125
|
+
.tac-section-alert { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--ta-yellow); }
|
|
5126
|
+
|
|
3887
5127
|
.tac-item-preview.tac-waiting { color: color-mix(in srgb, var(--ta-yellow) 85%, var(--ta-text)); }
|
|
3888
|
-
.tac-task-face { display: inline-grid; place-items: center; width:
|
|
5128
|
+
.tac-task-face { display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 12px; overflow: hidden; }
|
|
3889
5129
|
.tac-task-glyph { background: var(--ta-chip); color: var(--ta-secondary); }
|
|
3890
|
-
|
|
3891
|
-
.tac-tasks-empty
|
|
3892
|
-
.tac-tasks-empty
|
|
3893
|
-
.tac-tasks-empty
|
|
5130
|
+
/* No task yet: one quiet line where they will be, so the place is known before the first. */
|
|
5131
|
+
.tac-tasks-empty { display: flex; align-items: flex-start; gap: 8px; width: 100%; margin: 0; padding: 4px 10px 8px; border: 0; border-radius: 8px; background: none; color: var(--ta-muted); font: inherit; font-size: calc(12.5px * var(--ta-font-scale)); line-height: calc(18px * var(--ta-font-scale)); text-align: left; cursor: pointer; transition: color 120ms; }
|
|
5132
|
+
.tac-tasks-empty:hover { color: var(--ta-secondary); }
|
|
5133
|
+
.tac-tasks-empty svg { flex: none; margin-top: calc(2px * var(--ta-font-scale)); }
|
|
3894
5134
|
.tac-show-all { align-self: flex-start; height: 26px; margin: 0 4px 4px; padding: 0 8px; border: 0; border-radius: 6px; background: none; color: var(--ta-muted); font: inherit; font-size: calc(12px * var(--ta-font-scale)); cursor: pointer; }
|
|
3895
5135
|
.tac-show-all:hover { background: var(--ta-hover); color: var(--ta-secondary); }
|
|
3896
5136
|
.tac-temporary { flex: none; padding: 0 5px; border-radius: 999px; background: var(--ta-hover-strong); color: var(--ta-secondary); font-size: calc(10.5px * var(--ta-font-scale)); font-weight: 500; line-height: calc(16px * var(--ta-font-scale)); }
|
|
@@ -3909,10 +5149,17 @@ textarea.tac-role-input { min-height: 200px; max-height: 50vh; font-size: calc(1
|
|
|
3909
5149
|
:root[data-touch] .tac-agent-menu button { height: 44px; padding: 0 14px; border-radius: 10px; }
|
|
3910
5150
|
:root[data-touch] .tac-agent-menu button:active:not(:disabled) { background: var(--ta-hover); }
|
|
3911
5151
|
:root[data-touch] .tac-agent-menu .tac-menu-line { margin: 4px 10px; }
|
|
3912
|
-
:root[data-touch] .tac-item:has(~ .tac-item-more > [aria-expanded="true"])
|
|
5152
|
+
:root[data-touch] .tac-item:has(~ .tac-item-more > [aria-expanded="true"]) { background: var(--ta-hover); }
|
|
3913
5153
|
@keyframes tac-menu-in { from { opacity: 0; transform: scale(0.94); } }
|
|
3914
5154
|
@media (prefers-reduced-motion: reduce) { :root[data-touch] .tac-agent-menu { animation: none; } }
|
|
3915
|
-
:
|
|
5155
|
+
/* A finger: no hover to show it; while off it stays away from the list (the choice is the user's on every device), on it shows to turn it off. */
|
|
5156
|
+
:root[data-touch] .tac-section-action { right: 4px; }
|
|
5157
|
+
:root[data-touch] .tac-section-action:not([aria-pressed="true"]) { display: none; }
|
|
5158
|
+
/* A hand-off in the conversation it came from */
|
|
5159
|
+
.tac-handoff { margin: 4px 0; padding: 10px 12px; border: 1px solid var(--ta-border-muted); border-radius: 10px; background: var(--ta-card); font-size: calc(13px * var(--ta-font-scale)); }
|
|
5160
|
+
.tac-handoff-head { display: flex; align-items: center; gap: 8px; min-height: 24px; color: var(--ta-secondary); }
|
|
5161
|
+
.tac-handoff-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ta-text); font-weight: 500; }
|
|
5162
|
+
.tac-handoff-brief { margin-top: 6px; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; color: var(--ta-secondary); line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
|
|
3916
5163
|
`;
|
|
3917
5164
|
function injectStyle() {
|
|
3918
5165
|
const element = document.createElement("style");
|
|
@@ -3922,11 +5169,113 @@ function injectStyle() {
|
|
|
3922
5169
|
return () => element.remove();
|
|
3923
5170
|
}
|
|
3924
5171
|
|
|
5172
|
+
// web-src/tool-lines.tsx
|
|
5173
|
+
function text(value) {
|
|
5174
|
+
return typeof value === "string" ? value.trim() : "";
|
|
5175
|
+
}
|
|
5176
|
+
function names(value) {
|
|
5177
|
+
return Array.isArray(value) ? value.map(text).filter(Boolean) : [];
|
|
5178
|
+
}
|
|
5179
|
+
|
|
5180
|
+
class ChannelToolLines {
|
|
5181
|
+
context;
|
|
5182
|
+
icons = new Map;
|
|
5183
|
+
constructor(context) {
|
|
5184
|
+
this.context = context;
|
|
5185
|
+
}
|
|
5186
|
+
renderers() {
|
|
5187
|
+
const w = () => ChannelViews.words(this.context.pi);
|
|
5188
|
+
return {
|
|
5189
|
+
create_agent: {
|
|
5190
|
+
renderCall: (args) => {
|
|
5191
|
+
const name = text(args.name);
|
|
5192
|
+
return { verb: w().toolCreateAgent, target: name, icon: name ? this.faces("agent", [name]) : undefined };
|
|
5193
|
+
}
|
|
5194
|
+
},
|
|
5195
|
+
create_channel: {
|
|
5196
|
+
renderCall: (args) => {
|
|
5197
|
+
const name = text(args.name);
|
|
5198
|
+
const members = names(args.members);
|
|
5199
|
+
return { verb: w().toolCreateChannel, target: name && `#${name}`, icon: members.length ? this.faces("agents", members) : undefined };
|
|
5200
|
+
}
|
|
5201
|
+
},
|
|
5202
|
+
add_to_channel: {
|
|
5203
|
+
renderCall: (args) => {
|
|
5204
|
+
const members = names(args.members);
|
|
5205
|
+
const channel = text(args.channel);
|
|
5206
|
+
return {
|
|
5207
|
+
verb: w().toolAddToChannel,
|
|
5208
|
+
target: [channel && `#${channel}`, members.map((name) => `@${name}`).join(" ")].filter(Boolean).join(" "),
|
|
5209
|
+
icon: members.length ? this.faces("agents", members) : undefined
|
|
5210
|
+
};
|
|
5211
|
+
}
|
|
5212
|
+
},
|
|
5213
|
+
post_to_channel: {
|
|
5214
|
+
renderCall: (args) => {
|
|
5215
|
+
const channel = text(args.channel);
|
|
5216
|
+
return {
|
|
5217
|
+
verb: w().toolPostToChannel,
|
|
5218
|
+
target: [channel && `#${channel}`, text(args.message)].filter(Boolean).join(" "),
|
|
5219
|
+
icon: channel ? this.faces("channel", [channel]) : undefined
|
|
5220
|
+
};
|
|
5221
|
+
}
|
|
5222
|
+
},
|
|
5223
|
+
list_channels: { renderCall: () => ({ verb: w().toolListChannels }) },
|
|
5224
|
+
update_channel_notice: {
|
|
5225
|
+
renderCall: (args) => {
|
|
5226
|
+
const channel = text(args.channel).replace(/^#/, "");
|
|
5227
|
+
return { verb: w().toolNotice, target: channel && `#${channel}`, icon: channel ? this.faces("channel", [channel]) : undefined };
|
|
5228
|
+
}
|
|
5229
|
+
},
|
|
5230
|
+
update_my_role: { renderCall: () => ({ verb: w().toolRole }) },
|
|
5231
|
+
hand_off: {
|
|
5232
|
+
renderCall: (args) => {
|
|
5233
|
+
const to = text(args.to);
|
|
5234
|
+
const channel = to.startsWith("#");
|
|
5235
|
+
const name = to.replace(/^[@#]/, "");
|
|
5236
|
+
return { verb: w().toolHandOff, target: to, icon: name ? this.faces(channel ? "channel" : "agent", [name]) : undefined };
|
|
5237
|
+
}
|
|
5238
|
+
}
|
|
5239
|
+
};
|
|
5240
|
+
}
|
|
5241
|
+
register() {
|
|
5242
|
+
const renderers = new Map(Object.entries(this.renderers()));
|
|
5243
|
+
this.context.pi.registerToolRenderer?.((name, next) => renderers.get(name) ?? next());
|
|
5244
|
+
}
|
|
5245
|
+
faces(kind, named) {
|
|
5246
|
+
const key = `${kind}:${named.join(",")}`;
|
|
5247
|
+
let icon = this.icons.get(key);
|
|
5248
|
+
if (!icon) {
|
|
5249
|
+
const service = this.context.service;
|
|
5250
|
+
const pick = (team) => {
|
|
5251
|
+
if (kind === "channel") {
|
|
5252
|
+
const channel = team.channels.find((candidate) => candidate.name === named[0]);
|
|
5253
|
+
return channel ? channel.members.map((id) => team.agents.find((agent) => agent.id === id)).filter((agent) => !!agent) : [];
|
|
5254
|
+
}
|
|
5255
|
+
return named.map((name) => team.agents.find((agent) => agent.name === name)).filter((agent) => !!agent);
|
|
5256
|
+
};
|
|
5257
|
+
icon = ({ size }) => {
|
|
5258
|
+
const { team } = React.useSyncExternalStore((listener) => service.subscribe(listener), () => service.state);
|
|
5259
|
+
const faces = useFaces(team);
|
|
5260
|
+
const members = pick(team);
|
|
5261
|
+
return members.length ? /* @__PURE__ */ React.createElement(RoomFace, {
|
|
5262
|
+
members,
|
|
5263
|
+
faces,
|
|
5264
|
+
size,
|
|
5265
|
+
working: []
|
|
5266
|
+
}) : null;
|
|
5267
|
+
};
|
|
5268
|
+
this.icons.set(key, icon);
|
|
5269
|
+
}
|
|
5270
|
+
return icon;
|
|
5271
|
+
}
|
|
5272
|
+
}
|
|
5273
|
+
|
|
3925
5274
|
// web-src/index.tsx
|
|
3926
5275
|
function activate(pi) {
|
|
3927
5276
|
bind(pi.React);
|
|
3928
5277
|
const removeStyle = injectStyle();
|
|
3929
|
-
const service = new ChannelsClient(pi.storage);
|
|
5278
|
+
const service = new ChannelsClient(pi.storage, (request) => pi.callHost("request", request));
|
|
3930
5279
|
const ui = new ChannelsUiStore;
|
|
3931
5280
|
const context = {
|
|
3932
5281
|
pi,
|
|
@@ -3951,6 +5300,9 @@ function activate(pi) {
|
|
|
3951
5300
|
}
|
|
3952
5301
|
};
|
|
3953
5302
|
pi.registerTasks(tasks);
|
|
5303
|
+
new ChannelToolLines(context).register();
|
|
5304
|
+
pi.registerMessageRenderer(HandOff.CARD, HandOffView.card(context));
|
|
5305
|
+
pi.registerComposerAddon(HandOffView.composerAddon(context));
|
|
3954
5306
|
pi.registerView("channels", {
|
|
3955
5307
|
title: () => ChannelWords.of(pi.ui.language).title,
|
|
3956
5308
|
icon: ChannelViews.icon(pi, "Bot"),
|
|
@@ -3996,6 +5348,7 @@ function activate(pi) {
|
|
|
3996
5348
|
location: "panel",
|
|
3997
5349
|
order: 60
|
|
3998
5350
|
});
|
|
5351
|
+
registerCardOpener(context);
|
|
3999
5352
|
pi.registerAvatar((props) => /* @__PURE__ */ React.createElement(SessionAvatar, {
|
|
4000
5353
|
context,
|
|
4001
5354
|
...props
|