@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
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Cell - Ta Notify
|
|
2
|
+
|
|
3
|
+
A pi package that comes with Ta (on by default; turn it off in Settings → Extensions of the web client): notifications. While you are elsewhere in Ta, in another app, or with Ta in the background, it tells you which conversation answered, failed or waits for your decision, as a messenger does.
|
|
4
|
+
|
|
5
|
+
- **A turn ends**: the first two lines of its last answer (the error when it failed). A turn you stopped says nothing.
|
|
6
|
+
- **It waits for you**: a dialog of an extension waits for your answer (pi's `ui_prompt_start`), told by its title.
|
|
7
|
+
- **Ta asks you**: Ta has a tool `notify_user({ message, options?, kind? })`, for a decision only you can make, something that blocks it, or a long job you asked to hear about; `options` are up to 4 short answers, buttons on the notice, one tapped sent to that conversation as your message (once, even when a computer and a phone tap at the same time). A turn that used it says nothing more when it ends. The question and its answers also stay in the conversation as a card (the model does not read it), to tap on any device.
|
|
8
|
+
|
|
9
|
+
The page decides how to tell you: nothing of the conversation you look at; a task the double follows is told by the double (unless it asks). On a phone or a tablet nothing pops up, as in WeChat in front: an amber dot on the row of the list and on the Chats tab, a decision tapped on the card in its conversation. On a computer with the page in front, a banner at the bottom right with the face and name of the conversation, a tap opening it. With the page not in front, a notice of the system (silent for an answer); on a computer without one, a question or a failure leaves a banner that waits for your return.
|
|
10
|
+
|
|
11
|
+
Settings → Notifications:
|
|
12
|
+
|
|
13
|
+
- **Tell me**: every answer (default), when it needs me (questions and failures only), or off.
|
|
14
|
+
- **Notices of the system**: Allow turns on the notices of the browser or of Ta Desktop. Pushes to the phone app while it is closed or the phone locked are not set up yet (they need APNs); meanwhile the dots of the list tell once the app is open.
|
|
15
|
+
- **Muted conversations**: Mute on a banner of an answer or a failure adds one; they tell you only when they need you. Unmute them here.
|
|
16
|
+
|
|
17
|
+
Sessions another package opened for a role of its own (an agent of a channel, a run of a schedule) say nothing when a turn ends, their package telling you in its own way; they still tell you when they ask or a dialog waits.
|
|
18
|
+
|
|
19
|
+
## Data and calls
|
|
20
|
+
|
|
21
|
+
The data of the package (`@celljs/ta-notify`): `notices` (the latest 30, the newest last), `level` (`all` / `needs` / `off`), `muted` (`{ target, title? }[]`, `target` the session file, else the session id).
|
|
22
|
+
|
|
23
|
+
What its host (`pi.host`) answers, for web extensions through `callPackageHost('@celljs/ta-notify', …)`:
|
|
24
|
+
|
|
25
|
+
- `mute(target, muted, title?)`: mutes a conversation or not; the list after.
|
|
26
|
+
|
|
27
|
+
Another extension that tells the user news of its own uses the page's `ui.notifySession` (see @celljs/ta-web), not the data of this package.
|
|
28
|
+
|
|
29
|
+
Design record: `docs/design/ta-notify.md`.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Cell - Ta Notify
|
|
2
|
+
|
|
3
|
+
Ta 自带的 pi 包(默认开启,可在 Web 客户端的 设置 → 扩展 关闭):提醒。你在 Ta 的别处、别的应用里,或者把 Ta 放在后台时,哪个对话回复了、失败了、在等你拍板,就告诉你,像聊天软件那样。
|
|
4
|
+
|
|
5
|
+
- **一轮结束**:最后的回答取前两行做成提醒(失败时是错误信息)。你停下的一轮不提醒。
|
|
6
|
+
- **在等你**:扩展的对话框在等回答时(pi 的 `ui_prompt_start`),用它的标题提醒你。
|
|
7
|
+
- **Ta 主动问你**:Ta 有一个工具 `notify_user({ message, options?, kind? })`。只有你能做的决定、卡住它的事、你说过要听结果的长任务才用;`options` 是最多 4 个短回答,在提醒上是按钮,点一个就以你的身份发进那个对话(电脑和手机同时点也只发一次)。用过它的一轮,结束时不再另外提醒。问题和回答按钮也作为一张卡片留在对话里(模型读不到),任何设备打开对话都能点。
|
|
8
|
+
|
|
9
|
+
页面决定怎么告诉你:你正在看的对话不提醒;分身跟进的任务由分身告诉你(除非它在问你)。手机和平板上像微信在前台时一样不弹窗:对话列表行上和底部"对话"标签上有黄点,要你拍板的事在对话的卡片上点选。电脑上页面在前台时是右下角一条带对话头像和名字的横幅,点一下打开对话。页面不在前台时是系统通知(回复是静音的);电脑上没有系统通知时,提问和失败留一条横幅等你回来。
|
|
10
|
+
|
|
11
|
+
设置 → 提醒:
|
|
12
|
+
|
|
13
|
+
- **提醒我**:每次回复(默认)、需要我时(只有提问和失败)、关闭。
|
|
14
|
+
- **系统通知**:点"允许"开启浏览器或 Ta 桌面版的系统通知。手机 App 被关掉或锁屏后的推送还没有接入(需要 APNs),这时只在 App 打开后从列表的黄点看到。
|
|
15
|
+
- **免打扰的对话**:在回复或失败的横幅上点"免打扰"加入;这些对话只在需要你时提醒。这里可以取消。
|
|
16
|
+
|
|
17
|
+
由别的包打开、承担固定角色的会话(频道里的智能体、定时任务的运行)一轮结束时不提醒,由那个包自己告诉你;它们问你或有对话框在等时照样提醒。
|
|
18
|
+
|
|
19
|
+
## 数据与调用
|
|
20
|
+
|
|
21
|
+
包数据(`@celljs/ta-notify`):`notices`(最近 30 条提醒,最新的在后)、`level`(`all` / `needs` / `off`)、`muted`(`{ target, title? }[]`,`target` 是会话文件,没有时是会话 id)。
|
|
22
|
+
|
|
23
|
+
包宿主(`pi.host`)的方法,Web 扩展经 `callPackageHost('@celljs/ta-notify', …)` 调用:
|
|
24
|
+
|
|
25
|
+
- `mute(target, muted, title?)`:设成或取消免打扰,返回新的列表。
|
|
26
|
+
|
|
27
|
+
别的扩展要告诉用户自己的消息,用页面的 `ui.notifySession`(见 @celljs/ta-web),不要写这个包的数据。
|
|
28
|
+
|
|
29
|
+
设计记录:`docs/design/ta-notify.md`。
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
// ../ta-protocol/esm/common/ta-extension-host.js
|
|
2
|
+
var TA_HOST_EVENT = "ta:host";
|
|
3
|
+
var TaHostUtil;
|
|
4
|
+
(function(TaHostUtil2) {
|
|
5
|
+
TaHostUtil2.WAIT_MS = 1000;
|
|
6
|
+
function reach(events, name, waitMs = TaHostUtil2.WAIT_MS) {
|
|
7
|
+
return new Promise((resolve) => {
|
|
8
|
+
const timer = setTimeout(() => resolve(undefined), waitMs);
|
|
9
|
+
const request = {
|
|
10
|
+
name,
|
|
11
|
+
resolve: (answer) => {
|
|
12
|
+
clearTimeout(timer);
|
|
13
|
+
resolve(answer);
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
events.emit(TA_HOST_EVENT, request);
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
TaHostUtil2.reach = reach;
|
|
20
|
+
})(TaHostUtil || (TaHostUtil = {}));
|
|
21
|
+
|
|
22
|
+
// web-src/notify-protocol.ts
|
|
23
|
+
var NAME = "@celljs/ta-notify";
|
|
24
|
+
var TOOL_NAME = "notify_user";
|
|
25
|
+
var ASK_TYPE = "ta-notify-ask";
|
|
26
|
+
var Keys;
|
|
27
|
+
((Keys) => {
|
|
28
|
+
Keys.NOTICES = "notices";
|
|
29
|
+
Keys.LEVEL = "level";
|
|
30
|
+
Keys.MUTED = "muted";
|
|
31
|
+
})(Keys ||= {});
|
|
32
|
+
|
|
33
|
+
// web-src/notify-util.ts
|
|
34
|
+
var KEEP = 30;
|
|
35
|
+
var FRESH_MS = 2 * 60000;
|
|
36
|
+
var TEXT_CHARS = 200;
|
|
37
|
+
var OPTION_CHARS = 40;
|
|
38
|
+
var OPTIONS = 4;
|
|
39
|
+
var NotifyUtil;
|
|
40
|
+
((NotifyUtil) => {
|
|
41
|
+
function key(piSessionId, source, id) {
|
|
42
|
+
return `${piSessionId}:${source}:${id}`;
|
|
43
|
+
}
|
|
44
|
+
NotifyUtil.key = key;
|
|
45
|
+
function answerId(key2, index) {
|
|
46
|
+
return `notice:${key2}:${index}`;
|
|
47
|
+
}
|
|
48
|
+
NotifyUtil.answerId = answerId;
|
|
49
|
+
function allows(level2, setting, muted2) {
|
|
50
|
+
if (setting === "off") {
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
53
|
+
return level2 !== "done" || setting === "all" && !muted2;
|
|
54
|
+
}
|
|
55
|
+
NotifyUtil.allows = allows;
|
|
56
|
+
function level(value) {
|
|
57
|
+
return value === "needs" || value === "off" ? value : "all";
|
|
58
|
+
}
|
|
59
|
+
NotifyUtil.level = level;
|
|
60
|
+
function muted(value) {
|
|
61
|
+
return Array.isArray(value) ? value.filter((item) => !!item && typeof item.target === "string") : [];
|
|
62
|
+
}
|
|
63
|
+
NotifyUtil.muted = muted;
|
|
64
|
+
function notices(value) {
|
|
65
|
+
return Array.isArray(value) ? value.filter((item) => !!item && typeof item.key === "string") : [];
|
|
66
|
+
}
|
|
67
|
+
NotifyUtil.notices = notices;
|
|
68
|
+
function keep(list, notice, max = KEEP) {
|
|
69
|
+
return [...list.filter((other) => other.key !== notice.key), notice].slice(-max);
|
|
70
|
+
}
|
|
71
|
+
NotifyUtil.keep = keep;
|
|
72
|
+
function fresh(notice, now = Date.now()) {
|
|
73
|
+
return now - notice.at <= FRESH_MS;
|
|
74
|
+
}
|
|
75
|
+
NotifyUtil.fresh = fresh;
|
|
76
|
+
function text(markdown) {
|
|
77
|
+
const lines = markdown.replace(/```[\s\S]*?(```|$)/g, " ").replace(/!?\[([^\]]*)\]\([^)]*\)/g, "$1").split(`
|
|
78
|
+
`).map((line) => line.replace(/^\s{0,3}(#{1,6}\s+|>\s?|[-*+]\s+|\d+[.)]\s+)/, "").replace(/(\*\*|__|\*|`|~~)/g, "").replace(/\s+/g, " ").trim()).filter((line) => line && !/^[-*_=|:\s]+$/.test(line));
|
|
79
|
+
const joined = lines.slice(0, 2).join(`
|
|
80
|
+
`);
|
|
81
|
+
return joined.length > TEXT_CHARS ? `${joined.slice(0, TEXT_CHARS - 1).trimEnd()}…` : joined;
|
|
82
|
+
}
|
|
83
|
+
NotifyUtil.text = text;
|
|
84
|
+
function options(value) {
|
|
85
|
+
if (!Array.isArray(value)) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
const picked = [
|
|
89
|
+
...new Set(value.filter((item) => typeof item === "string").map((item) => item.trim().slice(0, OPTION_CHARS)).filter(Boolean))
|
|
90
|
+
].slice(0, OPTIONS);
|
|
91
|
+
return picked.length ? picked : undefined;
|
|
92
|
+
}
|
|
93
|
+
NotifyUtil.options = options;
|
|
94
|
+
function contentText(content) {
|
|
95
|
+
if (typeof content === "string") {
|
|
96
|
+
return content;
|
|
97
|
+
}
|
|
98
|
+
return Array.isArray(content) ? content.filter((part) => part?.type === "text" && typeof part.text === "string").map((part) => part.text).join(`
|
|
99
|
+
`) : "";
|
|
100
|
+
}
|
|
101
|
+
NotifyUtil.contentText = contentText;
|
|
102
|
+
function lastAnswer(messages) {
|
|
103
|
+
const answer = [...messages].reverse().find((message) => message?.role === "assistant");
|
|
104
|
+
if (!answer) {
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
const failed = answer.stopReason === "error";
|
|
108
|
+
const said = contentText(answer.content);
|
|
109
|
+
return {
|
|
110
|
+
text: failed && answer.errorMessage ? answer.errorMessage : said,
|
|
111
|
+
failed,
|
|
112
|
+
aborted: answer.stopReason === "aborted",
|
|
113
|
+
at: typeof answer.timestamp === "number" ? answer.timestamp : Date.now()
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
NotifyUtil.lastAnswer = lastAnswer;
|
|
117
|
+
})(NotifyUtil ||= {});
|
|
118
|
+
|
|
119
|
+
// web-src/server-texts.ts
|
|
120
|
+
var NotifyServerTexts;
|
|
121
|
+
((NotifyServerTexts) => {
|
|
122
|
+
function zh(env = process.env) {
|
|
123
|
+
return /^zh/i.test(env.TA_LANGUAGE || env.LC_ALL || env.LC_MESSAGES || env.LANG || "");
|
|
124
|
+
}
|
|
125
|
+
NotifyServerTexts.zh = zh;
|
|
126
|
+
function waiting() {
|
|
127
|
+
return zh() ? "有一个确认在等你回答" : "A question waits for your answer";
|
|
128
|
+
}
|
|
129
|
+
NotifyServerTexts.waiting = waiting;
|
|
130
|
+
function failed() {
|
|
131
|
+
return zh() ? "这一轮没有完成" : "This turn did not finish";
|
|
132
|
+
}
|
|
133
|
+
NotifyServerTexts.failed = failed;
|
|
134
|
+
})(NotifyServerTexts ||= {});
|
|
135
|
+
|
|
136
|
+
// web-src/tool.ts
|
|
137
|
+
var NotifyTool;
|
|
138
|
+
((NotifyTool) => {
|
|
139
|
+
NotifyTool.NAME = TOOL_NAME;
|
|
140
|
+
NotifyTool.DEFINITION = {
|
|
141
|
+
name: NotifyTool.NAME,
|
|
142
|
+
label: "Notify user",
|
|
143
|
+
description: "Tells the user something that needs them while they may be away from this conversation: a decision only they can make, something that blocks you, or the result of a long job they asked to hear about. They get it as a notification on the devices where Ta is open, with the options you give as buttons; an option they pick comes back as their message. The end of each of your turns is already shown to them: do not use this for progress or for an ordinary answer, and at most once a turn.",
|
|
144
|
+
promptSnippet: "Notify the user, with answers to pick, when you need their decision",
|
|
145
|
+
parameters: {
|
|
146
|
+
type: "object",
|
|
147
|
+
properties: {
|
|
148
|
+
message: { type: "string", description: "One or two short sentences in the user's language: what you need from them, or what happened." },
|
|
149
|
+
kind: {
|
|
150
|
+
type: "string",
|
|
151
|
+
enum: ["question", "result"],
|
|
152
|
+
description: "question: you need their answer or decision, or they must unblock you (default); result: a long job they asked to hear about ended."
|
|
153
|
+
},
|
|
154
|
+
options: {
|
|
155
|
+
type: "array",
|
|
156
|
+
items: { type: "string" },
|
|
157
|
+
description: "Up to 4 short answers to pick from, when you ask them to decide (each a few words)."
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
required: ["message"]
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
function level(kind) {
|
|
164
|
+
return kind === "result" ? "done" : "ask";
|
|
165
|
+
}
|
|
166
|
+
NotifyTool.level = level;
|
|
167
|
+
function result(sent, asks) {
|
|
168
|
+
if (asks) {
|
|
169
|
+
return `${sent ? "The user was notified, and" : "The settings of the user leave out a notification, but"} the question shows in this conversation with its answers as buttons when your turn ends. End your turn now and wait for their answer.`;
|
|
170
|
+
}
|
|
171
|
+
return sent ? "The user was notified." : "The settings of the user leave this out; say it in your answer instead.";
|
|
172
|
+
}
|
|
173
|
+
NotifyTool.result = result;
|
|
174
|
+
})(NotifyTool ||= {});
|
|
175
|
+
|
|
176
|
+
// web-src/extension.ts
|
|
177
|
+
var NO_SERVER = "Notifications need the Ta service, which tells the pages: start it with `ta serve` (or open Ta Desktop).";
|
|
178
|
+
function activate(pi) {
|
|
179
|
+
let reached;
|
|
180
|
+
const reach = () => reached ??= TaHostUtil.reach(pi.events, NAME).then((answer) => answer?.service);
|
|
181
|
+
const post = async (input) => {
|
|
182
|
+
try {
|
|
183
|
+
return await (await reach())?.post(input);
|
|
184
|
+
} catch (error) {
|
|
185
|
+
console.error("ta-notify could not tell the user:", error);
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
let told = false;
|
|
190
|
+
let asked;
|
|
191
|
+
let last;
|
|
192
|
+
pi.on("session_start", () => {
|
|
193
|
+
reach();
|
|
194
|
+
});
|
|
195
|
+
pi.on("agent_start", () => {
|
|
196
|
+
told = false;
|
|
197
|
+
asked = undefined;
|
|
198
|
+
last = undefined;
|
|
199
|
+
});
|
|
200
|
+
pi.on("context", (event) => {
|
|
201
|
+
const messages = event.messages.filter((message) => !(message.role === "custom" && message.customType === ASK_TYPE));
|
|
202
|
+
return messages.length === event.messages.length ? undefined : { messages };
|
|
203
|
+
});
|
|
204
|
+
pi.on("agent_end", (event) => {
|
|
205
|
+
last = NotifyUtil.lastAnswer(event.messages ?? []) ?? last;
|
|
206
|
+
});
|
|
207
|
+
pi.on("agent_settled", (event, ctx) => {
|
|
208
|
+
const answer = last;
|
|
209
|
+
last = undefined;
|
|
210
|
+
const question = asked;
|
|
211
|
+
asked = undefined;
|
|
212
|
+
if (question && !event.aborted) {
|
|
213
|
+
pi.sendMessage({ customType: ASK_TYPE, content: question.text, display: true, details: question }, { triggerTurn: false });
|
|
214
|
+
}
|
|
215
|
+
if (event.aborted || told || !answer || answer.aborted) {
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
218
|
+
const text = NotifyUtil.text(answer.text) || (answer.failed ? NotifyServerTexts.failed() : "");
|
|
219
|
+
if (!text) {
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
post({ piSessionId: ctx.sessionManager.getSessionId(), id: String(answer.at), level: answer.failed ? "failed" : "done", source: "turn", text });
|
|
223
|
+
});
|
|
224
|
+
pi.on("ui_prompt_start", (event, ctx) => {
|
|
225
|
+
post({
|
|
226
|
+
piSessionId: ctx.sessionManager.getSessionId(),
|
|
227
|
+
id: String(Date.now()),
|
|
228
|
+
level: "ask",
|
|
229
|
+
source: "dialog",
|
|
230
|
+
text: NotifyUtil.text(event.title ?? "") || NotifyServerTexts.waiting()
|
|
231
|
+
});
|
|
232
|
+
});
|
|
233
|
+
pi.registerTool({
|
|
234
|
+
...NotifyTool.DEFINITION,
|
|
235
|
+
execute: async (id, params, _signal, _update, ctx) => {
|
|
236
|
+
if (!await reach()) {
|
|
237
|
+
throw new Error(NO_SERVER);
|
|
238
|
+
}
|
|
239
|
+
const text = NotifyUtil.text(typeof params?.message === "string" ? params.message : "");
|
|
240
|
+
if (!text) {
|
|
241
|
+
throw new Error("Say what the user should know in `message`.");
|
|
242
|
+
}
|
|
243
|
+
const level = NotifyTool.level(params?.kind);
|
|
244
|
+
const options = level === "ask" ? NotifyUtil.options(params?.options) : undefined;
|
|
245
|
+
const piSessionId = ctx.sessionManager.getSessionId();
|
|
246
|
+
const sent = await post({ piSessionId, id, level, source: "agent", text, options });
|
|
247
|
+
told ||= !!sent;
|
|
248
|
+
if (level === "ask") {
|
|
249
|
+
asked = { key: NotifyUtil.key(piSessionId, "agent", id), text, options: options ?? [] };
|
|
250
|
+
told = true;
|
|
251
|
+
}
|
|
252
|
+
return { content: [{ type: "text", text: NotifyTool.result(!!sent, level === "ask") }], details: undefined };
|
|
253
|
+
}
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
export {
|
|
257
|
+
activate as default,
|
|
258
|
+
NO_SERVER
|
|
259
|
+
};
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
// web-src/notify-protocol.ts
|
|
2
|
+
var NAME = "@celljs/ta-notify";
|
|
3
|
+
var Keys;
|
|
4
|
+
((Keys) => {
|
|
5
|
+
Keys.NOTICES = "notices";
|
|
6
|
+
Keys.LEVEL = "level";
|
|
7
|
+
Keys.MUTED = "muted";
|
|
8
|
+
})(Keys ||= {});
|
|
9
|
+
|
|
10
|
+
// web-src/notify-util.ts
|
|
11
|
+
var KEEP = 30;
|
|
12
|
+
var FRESH_MS = 2 * 60000;
|
|
13
|
+
var TEXT_CHARS = 200;
|
|
14
|
+
var OPTION_CHARS = 40;
|
|
15
|
+
var OPTIONS = 4;
|
|
16
|
+
var NotifyUtil;
|
|
17
|
+
((NotifyUtil) => {
|
|
18
|
+
function key(piSessionId, source, id) {
|
|
19
|
+
return `${piSessionId}:${source}:${id}`;
|
|
20
|
+
}
|
|
21
|
+
NotifyUtil.key = key;
|
|
22
|
+
function answerId(key2, index) {
|
|
23
|
+
return `notice:${key2}:${index}`;
|
|
24
|
+
}
|
|
25
|
+
NotifyUtil.answerId = answerId;
|
|
26
|
+
function allows(level2, setting, muted2) {
|
|
27
|
+
if (setting === "off") {
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
return level2 !== "done" || setting === "all" && !muted2;
|
|
31
|
+
}
|
|
32
|
+
NotifyUtil.allows = allows;
|
|
33
|
+
function level(value) {
|
|
34
|
+
return value === "needs" || value === "off" ? value : "all";
|
|
35
|
+
}
|
|
36
|
+
NotifyUtil.level = level;
|
|
37
|
+
function muted(value) {
|
|
38
|
+
return Array.isArray(value) ? value.filter((item) => !!item && typeof item.target === "string") : [];
|
|
39
|
+
}
|
|
40
|
+
NotifyUtil.muted = muted;
|
|
41
|
+
function notices(value) {
|
|
42
|
+
return Array.isArray(value) ? value.filter((item) => !!item && typeof item.key === "string") : [];
|
|
43
|
+
}
|
|
44
|
+
NotifyUtil.notices = notices;
|
|
45
|
+
function keep(list, notice, max = KEEP) {
|
|
46
|
+
return [...list.filter((other) => other.key !== notice.key), notice].slice(-max);
|
|
47
|
+
}
|
|
48
|
+
NotifyUtil.keep = keep;
|
|
49
|
+
function fresh(notice, now = Date.now()) {
|
|
50
|
+
return now - notice.at <= FRESH_MS;
|
|
51
|
+
}
|
|
52
|
+
NotifyUtil.fresh = fresh;
|
|
53
|
+
function text(markdown) {
|
|
54
|
+
const lines = markdown.replace(/```[\s\S]*?(```|$)/g, " ").replace(/!?\[([^\]]*)\]\([^)]*\)/g, "$1").split(`
|
|
55
|
+
`).map((line) => line.replace(/^\s{0,3}(#{1,6}\s+|>\s?|[-*+]\s+|\d+[.)]\s+)/, "").replace(/(\*\*|__|\*|`|~~)/g, "").replace(/\s+/g, " ").trim()).filter((line) => line && !/^[-*_=|:\s]+$/.test(line));
|
|
56
|
+
const joined = lines.slice(0, 2).join(`
|
|
57
|
+
`);
|
|
58
|
+
return joined.length > TEXT_CHARS ? `${joined.slice(0, TEXT_CHARS - 1).trimEnd()}…` : joined;
|
|
59
|
+
}
|
|
60
|
+
NotifyUtil.text = text;
|
|
61
|
+
function options(value) {
|
|
62
|
+
if (!Array.isArray(value)) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
const picked = [
|
|
66
|
+
...new Set(value.filter((item) => typeof item === "string").map((item) => item.trim().slice(0, OPTION_CHARS)).filter(Boolean))
|
|
67
|
+
].slice(0, OPTIONS);
|
|
68
|
+
return picked.length ? picked : undefined;
|
|
69
|
+
}
|
|
70
|
+
NotifyUtil.options = options;
|
|
71
|
+
function contentText(content) {
|
|
72
|
+
if (typeof content === "string") {
|
|
73
|
+
return content;
|
|
74
|
+
}
|
|
75
|
+
return Array.isArray(content) ? content.filter((part) => part?.type === "text" && typeof part.text === "string").map((part) => part.text).join(`
|
|
76
|
+
`) : "";
|
|
77
|
+
}
|
|
78
|
+
NotifyUtil.contentText = contentText;
|
|
79
|
+
function lastAnswer(messages) {
|
|
80
|
+
const answer = [...messages].reverse().find((message) => message?.role === "assistant");
|
|
81
|
+
if (!answer) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
const failed = answer.stopReason === "error";
|
|
85
|
+
const said = contentText(answer.content);
|
|
86
|
+
return {
|
|
87
|
+
text: failed && answer.errorMessage ? answer.errorMessage : said,
|
|
88
|
+
failed,
|
|
89
|
+
aborted: answer.stopReason === "aborted",
|
|
90
|
+
at: typeof answer.timestamp === "number" ? answer.timestamp : Date.now()
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
NotifyUtil.lastAnswer = lastAnswer;
|
|
94
|
+
})(NotifyUtil ||= {});
|
|
95
|
+
|
|
96
|
+
// web-src/notify-service.ts
|
|
97
|
+
class NotifyHost {
|
|
98
|
+
host;
|
|
99
|
+
queue = Promise.resolve();
|
|
100
|
+
constructor(host) {
|
|
101
|
+
this.host = host;
|
|
102
|
+
}
|
|
103
|
+
post(input) {
|
|
104
|
+
return this.serial(async () => {
|
|
105
|
+
const info = (await this.host.listSessions()).find((session) => session.piSessionId === input.piSessionId);
|
|
106
|
+
if (input.source === "turn" && info?.group) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
const target = info?.sessionFile ?? info?.sessionId;
|
|
110
|
+
const [level, muted] = await Promise.all([this.read(Keys.LEVEL), this.read(Keys.MUTED)]);
|
|
111
|
+
const isMuted = !!target && NotifyUtil.muted(muted).some((item) => item.target === target);
|
|
112
|
+
if (!NotifyUtil.allows(input.level, NotifyUtil.level(level), isMuted)) {
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
const notice = {
|
|
116
|
+
key: NotifyUtil.key(input.piSessionId, input.source, input.id),
|
|
117
|
+
at: Date.now(),
|
|
118
|
+
level: input.level,
|
|
119
|
+
source: input.source,
|
|
120
|
+
text: input.text,
|
|
121
|
+
...input.options?.length ? { options: input.options } : {},
|
|
122
|
+
...info ? {
|
|
123
|
+
sessionId: info.sessionId,
|
|
124
|
+
sessionFile: info.sessionFile,
|
|
125
|
+
cwd: info.cwd,
|
|
126
|
+
title: info.sessionName || info.firstMessage
|
|
127
|
+
} : {}
|
|
128
|
+
};
|
|
129
|
+
const list = NotifyUtil.notices(await this.read(Keys.NOTICES));
|
|
130
|
+
await this.host.setExtensionData(NAME, Keys.NOTICES, NotifyUtil.keep(list, notice));
|
|
131
|
+
return notice;
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
mute(target, muted, title) {
|
|
135
|
+
return this.serial(async () => {
|
|
136
|
+
const list = NotifyUtil.muted(await this.read(Keys.MUTED)).filter((item) => item.target !== target);
|
|
137
|
+
const next = muted ? [...list, { target, ...title ? { title } : {} }] : list;
|
|
138
|
+
await this.host.setExtensionData(NAME, Keys.MUTED, next);
|
|
139
|
+
return next;
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
dispose() {}
|
|
143
|
+
read(key) {
|
|
144
|
+
return this.host.getExtensionData(NAME, key).catch(() => {
|
|
145
|
+
return;
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
serial(work) {
|
|
149
|
+
const next = this.queue.then(work, work);
|
|
150
|
+
this.queue = next.catch(() => {
|
|
151
|
+
return;
|
|
152
|
+
});
|
|
153
|
+
return next;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
// web-src/host.ts
|
|
158
|
+
function activate(host) {
|
|
159
|
+
return new NotifyHost(host);
|
|
160
|
+
}
|
|
161
|
+
export {
|
|
162
|
+
activate as default
|
|
163
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { WebCustomMessage, WebExtensionAPI } from '@celljs/ta-web/lib/browser/extension/web-extension-api';
|
|
2
|
+
/**
|
|
3
|
+
* What Ta asked with notify_user, in its conversation: the question and its answers as buttons, one picked sent
|
|
4
|
+
* as the user's message with the id a banner would send it with, so that it goes once from wherever it was picked.
|
|
5
|
+
*/
|
|
6
|
+
export declare function askCard(pi: WebExtensionAPI): React.ComponentType<{
|
|
7
|
+
message: WebCustomMessage;
|
|
8
|
+
}>;
|
|
9
|
+
//# sourceMappingURL=ask-card.d.ts.map
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.askCard = askCard;
|
|
4
|
+
const i18n_1 = require("./i18n");
|
|
5
|
+
const notify_util_1 = require("./notify-util");
|
|
6
|
+
const react_1 = require("./react");
|
|
7
|
+
/**
|
|
8
|
+
* What Ta asked with notify_user, in its conversation: the question and its answers as buttons, one picked sent
|
|
9
|
+
* as the user's message with the id a banner would send it with, so that it goes once from wherever it was picked.
|
|
10
|
+
*/
|
|
11
|
+
function askCard(pi) {
|
|
12
|
+
return function AskCard({ message }) {
|
|
13
|
+
var _a;
|
|
14
|
+
const words = i18n_1.NotifyWords.of(pi.ui.language);
|
|
15
|
+
const sessionId = pi.ui.useSessionId();
|
|
16
|
+
const [picked, setPicked] = react_1.React.useState();
|
|
17
|
+
const details = message.details;
|
|
18
|
+
if (!(details === null || details === void 0 ? void 0 : details.text)) {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
const Bell = (_a = pi.ui.icons.Bell) !== null && _a !== void 0 ? _a : pi.ui.icons.BellOff;
|
|
22
|
+
const answer = (option, index) => {
|
|
23
|
+
if (!sessionId || picked !== undefined) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
setPicked(index);
|
|
27
|
+
pi.server.prompt(sessionId, { message: option, clientMessageId: notify_util_1.NotifyUtil.answerId(details.key, index) }).catch(error => {
|
|
28
|
+
setPicked(undefined);
|
|
29
|
+
pi.ui.notify(error instanceof Error ? error.message : String(error), 'error');
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
return (react_1.React.createElement("div", { className: "ta-notify-ask" },
|
|
33
|
+
react_1.React.createElement("div", { className: "ta-notify-ask-head" },
|
|
34
|
+
Bell && react_1.React.createElement(Bell, { size: 14 }),
|
|
35
|
+
react_1.React.createElement("span", null, words.askTitle)),
|
|
36
|
+
react_1.React.createElement("div", { className: "ta-notify-ask-text" }, details.text),
|
|
37
|
+
details.options.length > 0 && (react_1.React.createElement("div", { className: "ta-notify-ask-options" }, details.options.map((option, index) => (react_1.React.createElement("button", { key: option, type: "button", className: `ta-notify-ask-option${picked === index ? ' ta-on' : ''}`, disabled: picked !== undefined && picked !== index, "aria-pressed": picked === index, onClick: () => answer(option, index) }, option)))))));
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=ask-card.js.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare const NO_SERVER = "Notifications need the Ta service, which tells the pages: start it with `ta serve` (or open Ta Desktop).";
|
|
2
|
+
interface Pi {
|
|
3
|
+
events: {
|
|
4
|
+
emit(event: string, data: unknown): void;
|
|
5
|
+
};
|
|
6
|
+
on(event: string, handler: (event: never, ctx: never) => unknown): unknown;
|
|
7
|
+
registerTool(tool: never): unknown;
|
|
8
|
+
sendMessage(message: {
|
|
9
|
+
customType: string;
|
|
10
|
+
content: string;
|
|
11
|
+
display: boolean;
|
|
12
|
+
details: unknown;
|
|
13
|
+
}, options?: {
|
|
14
|
+
triggerTurn?: boolean;
|
|
15
|
+
}): void;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* The pi extension, in every session: tells the host of the package (host.ts) when a turn ends or fails, when a
|
|
19
|
+
* dialog of an extension waits for the user (pi's `ui_prompt_start`), and gives Ta the tool `notify_user`, to ask
|
|
20
|
+
* the user to decide with answers to pick. The host keeps what the settings allow; the pages tell of it.
|
|
21
|
+
*/
|
|
22
|
+
export default function activate(pi: Pi): void;
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=extension.d.ts.map
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NO_SERVER = void 0;
|
|
4
|
+
exports.default = activate;
|
|
5
|
+
const ta_extension_host_1 = require("@celljs/ta-protocol/lib/common/ta-extension-host");
|
|
6
|
+
const notify_protocol_1 = require("./notify-protocol");
|
|
7
|
+
const notify_util_1 = require("./notify-util");
|
|
8
|
+
const server_texts_1 = require("./server-texts");
|
|
9
|
+
const tool_1 = require("./tool");
|
|
10
|
+
exports.NO_SERVER = 'Notifications need the Ta service, which tells the pages: start it with `ta serve` (or open Ta Desktop).';
|
|
11
|
+
/**
|
|
12
|
+
* The pi extension, in every session: tells the host of the package (host.ts) when a turn ends or fails, when a
|
|
13
|
+
* dialog of an extension waits for the user (pi's `ui_prompt_start`), and gives Ta the tool `notify_user`, to ask
|
|
14
|
+
* the user to decide with answers to pick. The host keeps what the settings allow; the pages tell of it.
|
|
15
|
+
*/
|
|
16
|
+
function activate(pi) {
|
|
17
|
+
let reached;
|
|
18
|
+
const reach = () => (reached !== null && reached !== void 0 ? reached : (reached = ta_extension_host_1.TaHostUtil.reach(pi.events, notify_protocol_1.NAME).then(answer => answer === null || answer === void 0 ? void 0 : answer.service)));
|
|
19
|
+
const post = async (input) => {
|
|
20
|
+
var _a;
|
|
21
|
+
try {
|
|
22
|
+
return await ((_a = (await reach())) === null || _a === void 0 ? void 0 : _a.post(input));
|
|
23
|
+
}
|
|
24
|
+
catch (error) {
|
|
25
|
+
console.error('ta-notify could not tell the user:', error);
|
|
26
|
+
return undefined;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
/** Ta told the user itself in this run: its end says nothing more. */
|
|
30
|
+
let told = false;
|
|
31
|
+
/** What Ta asked in this run, shown in the conversation once it settles. */
|
|
32
|
+
let asked;
|
|
33
|
+
let last;
|
|
34
|
+
pi.on('session_start', () => {
|
|
35
|
+
void reach();
|
|
36
|
+
});
|
|
37
|
+
pi.on('agent_start', () => {
|
|
38
|
+
told = false;
|
|
39
|
+
asked = undefined;
|
|
40
|
+
last = undefined;
|
|
41
|
+
});
|
|
42
|
+
// The card of the question is for the user.
|
|
43
|
+
pi.on('context', (event) => {
|
|
44
|
+
const messages = event.messages.filter(message => !(message.role === 'custom' && message.customType === notify_protocol_1.ASK_TYPE));
|
|
45
|
+
return messages.length === event.messages.length ? undefined : { messages };
|
|
46
|
+
});
|
|
47
|
+
pi.on('agent_end', (event) => {
|
|
48
|
+
var _a, _b;
|
|
49
|
+
last = (_b = notify_util_1.NotifyUtil.lastAnswer((_a = event.messages) !== null && _a !== void 0 ? _a : [])) !== null && _b !== void 0 ? _b : last;
|
|
50
|
+
});
|
|
51
|
+
// Once nothing more runs: no retry, compaction or message of the queue.
|
|
52
|
+
pi.on('agent_settled', (event, ctx) => {
|
|
53
|
+
const answer = last;
|
|
54
|
+
last = undefined;
|
|
55
|
+
const question = asked;
|
|
56
|
+
asked = undefined;
|
|
57
|
+
if (question && !event.aborted) {
|
|
58
|
+
pi.sendMessage({ customType: notify_protocol_1.ASK_TYPE, content: question.text, display: true, details: question }, { triggerTurn: false });
|
|
59
|
+
}
|
|
60
|
+
if (event.aborted || told || !answer || answer.aborted) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
const text = notify_util_1.NotifyUtil.text(answer.text) || (answer.failed ? server_texts_1.NotifyServerTexts.failed() : '');
|
|
64
|
+
if (!text) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
void post({ piSessionId: ctx.sessionManager.getSessionId(), id: String(answer.at), level: answer.failed ? 'failed' : 'done', source: 'turn', text });
|
|
68
|
+
});
|
|
69
|
+
pi.on('ui_prompt_start', (event, ctx) => {
|
|
70
|
+
var _a;
|
|
71
|
+
void post({
|
|
72
|
+
piSessionId: ctx.sessionManager.getSessionId(),
|
|
73
|
+
id: String(Date.now()),
|
|
74
|
+
level: 'ask',
|
|
75
|
+
source: 'dialog',
|
|
76
|
+
text: notify_util_1.NotifyUtil.text((_a = event.title) !== null && _a !== void 0 ? _a : '') || server_texts_1.NotifyServerTexts.waiting(),
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
pi.registerTool({
|
|
80
|
+
...tool_1.NotifyTool.DEFINITION,
|
|
81
|
+
execute: async (id, params, _signal, _update, ctx) => {
|
|
82
|
+
if (!(await reach())) {
|
|
83
|
+
throw new Error(exports.NO_SERVER);
|
|
84
|
+
}
|
|
85
|
+
const text = notify_util_1.NotifyUtil.text(typeof (params === null || params === void 0 ? void 0 : params.message) === 'string' ? params.message : '');
|
|
86
|
+
if (!text) {
|
|
87
|
+
throw new Error('Say what the user should know in `message`.');
|
|
88
|
+
}
|
|
89
|
+
const level = tool_1.NotifyTool.level(params === null || params === void 0 ? void 0 : params.kind);
|
|
90
|
+
const options = level === 'ask' ? notify_util_1.NotifyUtil.options(params === null || params === void 0 ? void 0 : params.options) : undefined;
|
|
91
|
+
const piSessionId = ctx.sessionManager.getSessionId();
|
|
92
|
+
const sent = await post({ piSessionId, id, level, source: 'agent', text, options });
|
|
93
|
+
told || (told = !!sent);
|
|
94
|
+
if (level === 'ask') {
|
|
95
|
+
asked = { key: notify_util_1.NotifyUtil.key(piSessionId, 'agent', id), text, options: options !== null && options !== void 0 ? options : [] };
|
|
96
|
+
told = true;
|
|
97
|
+
}
|
|
98
|
+
return { content: [{ type: 'text', text: tool_1.NotifyTool.result(!!sent, level === 'ask') }], details: undefined };
|
|
99
|
+
},
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=extension.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { TaExtensionHost, TaPackageService } from '@celljs/ta-protocol';
|
|
2
|
+
/** The server side of the package (`pi.host`): the Ta service runs it once; the pi extensions of every session post to it. */
|
|
3
|
+
export default function activate(host: TaExtensionHost): TaPackageService;
|
|
4
|
+
//# sourceMappingURL=host.d.ts.map
|