@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,820 @@
|
|
|
1
|
+
// web-src/recall-service.ts
|
|
2
|
+
import { existsSync } from "node:fs";
|
|
3
|
+
import { mkdir, writeFile } from "node:fs/promises";
|
|
4
|
+
import { join as join2 } from "node:path";
|
|
5
|
+
|
|
6
|
+
// web-src/recall-protocol.ts
|
|
7
|
+
var NAME = "@celljs/ta-recall";
|
|
8
|
+
var PROPOSE_TOOL = "propose_skill";
|
|
9
|
+
var SKILL_BLOCK = "ta-skill";
|
|
10
|
+
var Keys;
|
|
11
|
+
((Keys) => {
|
|
12
|
+
Keys.SUGGEST = "suggest";
|
|
13
|
+
Keys.BRIEF = "brief";
|
|
14
|
+
Keys.BRIEF_FILE = "briefFile";
|
|
15
|
+
Keys.BRIEF_LAST = "briefLast";
|
|
16
|
+
Keys.ASKED = "asked";
|
|
17
|
+
Keys.BRIEF_SUMMARY = "briefSummary";
|
|
18
|
+
Keys.BRIEF_SEEN = "briefSeen";
|
|
19
|
+
Keys.BRIEF_PINNED = "briefPinned";
|
|
20
|
+
Keys.BRIEF_HANDLED = "briefHandled";
|
|
21
|
+
Keys.DECIDED = "decided";
|
|
22
|
+
Keys.DECLINED = "declined";
|
|
23
|
+
})(Keys ||= {});
|
|
24
|
+
var Limits;
|
|
25
|
+
((Limits) => {
|
|
26
|
+
Limits.SEARCH_DAYS = 30;
|
|
27
|
+
Limits.SEARCH_HITS = 8;
|
|
28
|
+
Limits.SNIPPETS = 3;
|
|
29
|
+
Limits.SNIPPET_CHARS = 240;
|
|
30
|
+
Limits.SIMILAR_DAYS = 60;
|
|
31
|
+
Limits.SIMILAR_MIN_CHARS = 16;
|
|
32
|
+
Limits.SIMILAR_SCORE = 0.5;
|
|
33
|
+
Limits.DECLINED_KEPT = 100;
|
|
34
|
+
Limits.ASKED_KEPT = 200;
|
|
35
|
+
Limits.BRIEF_CONVERSATIONS = 30;
|
|
36
|
+
Limits.BRIEF_ITEMS = 5;
|
|
37
|
+
Limits.ASKED_ARCHIVE_DAYS = 7;
|
|
38
|
+
})(Limits ||= {});
|
|
39
|
+
|
|
40
|
+
// web-src/brief-util.ts
|
|
41
|
+
var DAY_MS = 24 * 60 * 60000;
|
|
42
|
+
var ASKS = 3;
|
|
43
|
+
var ASK_CHARS = 160;
|
|
44
|
+
var ANSWER_CHARS = 500;
|
|
45
|
+
var SUMMARY_CHARS = 300;
|
|
46
|
+
var BriefUtil;
|
|
47
|
+
((BriefUtil) => {
|
|
48
|
+
BriefUtil.DEFAULT = { enabled: true, time: "09:00" };
|
|
49
|
+
function settings(value) {
|
|
50
|
+
const stored = value && typeof value === "object" ? value : {};
|
|
51
|
+
return {
|
|
52
|
+
enabled: typeof stored.enabled === "boolean" ? stored.enabled : BriefUtil.DEFAULT.enabled,
|
|
53
|
+
time: typeof stored.time === "string" && parseTime(stored.time) ? stored.time : BriefUtil.DEFAULT.time
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
BriefUtil.settings = settings;
|
|
57
|
+
function parseTime(text) {
|
|
58
|
+
const match = /^(\d{1,2}):(\d{2})$/.exec(text.trim());
|
|
59
|
+
if (!match) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
const hours = Number(match[1]);
|
|
63
|
+
const minutes = Number(match[2]);
|
|
64
|
+
return hours < 24 && minutes < 60 ? { hours, minutes } : undefined;
|
|
65
|
+
}
|
|
66
|
+
BriefUtil.parseTime = parseTime;
|
|
67
|
+
function today(settings2, now) {
|
|
68
|
+
const { hours, minutes } = parseTime(settings2.time) ?? { hours: 9, minutes: 0 };
|
|
69
|
+
const day = new Date(now);
|
|
70
|
+
day.setHours(hours, minutes, 0, 0);
|
|
71
|
+
return day.getTime();
|
|
72
|
+
}
|
|
73
|
+
BriefUtil.today = today;
|
|
74
|
+
function due(settings2, last, now) {
|
|
75
|
+
const time = today(settings2, now);
|
|
76
|
+
return settings2.enabled && now >= time && (last === undefined || last < time);
|
|
77
|
+
}
|
|
78
|
+
BriefUtil.due = due;
|
|
79
|
+
function since(last, now) {
|
|
80
|
+
return last && last > now - 7 * DAY_MS ? last : now - DAY_MS;
|
|
81
|
+
}
|
|
82
|
+
BriefUtil.since = since;
|
|
83
|
+
function material(input) {
|
|
84
|
+
const conversations = input.conversations.filter((conversation) => conversation.updatedAt >= input.since && conversation.file !== input.briefFile).slice(0, Limits.BRIEF_CONVERSATIONS);
|
|
85
|
+
const parts = [];
|
|
86
|
+
if (conversations.length > 0) {
|
|
87
|
+
parts.push("Conversations:");
|
|
88
|
+
for (const conversation of conversations) {
|
|
89
|
+
parts.push(...conversationLines(conversation, input.since, input.states?.get(conversation.file)));
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
const waiting = (input.notices ?? []).filter((notice) => notice.at >= input.since && (notice.level === "ask" || notice.level === "failed"));
|
|
93
|
+
if (waiting.length > 0) {
|
|
94
|
+
parts.push("", "Notices of the time (asks and failures):");
|
|
95
|
+
for (const notice of waiting) {
|
|
96
|
+
parts.push(`- ${notice.level}: ${line(notice.text, ASK_CHARS)}${notice.title ? ` (in "${notice.title}"${notice.sessionFile ? `, ${notice.sessionFile}` : ""})` : ""}`);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
const runs = (input.runs ?? []).filter((run) => run.at >= input.since);
|
|
100
|
+
if (runs.length > 0) {
|
|
101
|
+
parts.push("", "Scheduled tasks that ran:");
|
|
102
|
+
for (const run of runs) {
|
|
103
|
+
parts.push(`- ${run.name}: ${run.status ?? "ran"}${run.summary ? ` — ${line(run.summary, SUMMARY_CHARS)}` : ""}`);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return parts.join(`
|
|
107
|
+
`);
|
|
108
|
+
}
|
|
109
|
+
BriefUtil.material = material;
|
|
110
|
+
function conversationLines(conversation, since2, state) {
|
|
111
|
+
const recent = conversation.said.filter((said) => said.at >= since2);
|
|
112
|
+
const asks = recent.filter((said) => said.role === "user" && !/^\/\S+$/.test(said.text)).slice(-ASKS);
|
|
113
|
+
const answer = [...recent].reverse().find((said) => said.role === "assistant");
|
|
114
|
+
const now = state?.waiting ? " · waits for the user" : state?.streaming ? " · still working" : "";
|
|
115
|
+
const where = conversation.group ? `${conversation.cwd} · of ${conversation.group}` : conversation.cwd;
|
|
116
|
+
return [
|
|
117
|
+
`- [${conversation.title || "Untitled"}](${conversation.file}) · ${where}${now}`,
|
|
118
|
+
...asks.map((ask) => ` - asked: ${line(ask.text, ASK_CHARS)}`),
|
|
119
|
+
...answer ? [` - last answer: ${line(answer.text, ANSWER_CHARS)}`] : []
|
|
120
|
+
];
|
|
121
|
+
}
|
|
122
|
+
function line(text, chars) {
|
|
123
|
+
const flat = text.replace(/\s+/g, " ").trim();
|
|
124
|
+
return flat.length > chars ? `${flat.slice(0, chars)}…` : flat;
|
|
125
|
+
}
|
|
126
|
+
BriefUtil.HEADINGS = { zh: ["做完了", "等你定", "下一步"], en: ["Done", "Waiting for you", "Next"] };
|
|
127
|
+
const PARTS = {
|
|
128
|
+
做完了: "done",
|
|
129
|
+
done: "done",
|
|
130
|
+
等你定: "waiting",
|
|
131
|
+
"waiting for you": "waiting",
|
|
132
|
+
下一步: "next",
|
|
133
|
+
next: "next"
|
|
134
|
+
};
|
|
135
|
+
function summary(text, file, at) {
|
|
136
|
+
const counts = { done: 0, waiting: 0, next: 0 };
|
|
137
|
+
let part;
|
|
138
|
+
let found = false;
|
|
139
|
+
let top;
|
|
140
|
+
const items = [];
|
|
141
|
+
for (const line2 of text.split(/\r?\n/)) {
|
|
142
|
+
const heading = /^\s*#{1,6}\s+(.+?)\s*#*\s*$/.exec(line2) ?? /^\s*\*\*(.+?)\*\*\s*[::]?\s*$/.exec(line2);
|
|
143
|
+
if (heading) {
|
|
144
|
+
part = PARTS[heading[1].replace(/[::]$/, "").trim().toLowerCase()];
|
|
145
|
+
found ||= !!part;
|
|
146
|
+
continue;
|
|
147
|
+
}
|
|
148
|
+
const item = /^\s*(?:[-*+]|\d+[.)])\s+(.+)$/.exec(line2);
|
|
149
|
+
if (part && item) {
|
|
150
|
+
counts[part]++;
|
|
151
|
+
if (part === "waiting") {
|
|
152
|
+
top ??= plain(item[1]);
|
|
153
|
+
if (items.length < Limits.BRIEF_ITEMS) {
|
|
154
|
+
items.push(briefItem(item[1]));
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
return found ? { at, file, ...counts, ...top ? { top } : {}, ...items.length ? { items } : {} } : undefined;
|
|
160
|
+
}
|
|
161
|
+
BriefUtil.summary = summary;
|
|
162
|
+
function briefItem(line2) {
|
|
163
|
+
const link = /\]\(<?([^)>]+?\.jsonl)>?\)/.exec(line2);
|
|
164
|
+
return { text: plain(line2), ...link ? { file: link[1].trim() } : {} };
|
|
165
|
+
}
|
|
166
|
+
function plain(text) {
|
|
167
|
+
return text.replace(/!?\[([^\]]*)\]\([^)]*\)/g, "$1").replace(/[*_`~]+/g, "").replace(/\s+/g, " ").trim().slice(0, 160);
|
|
168
|
+
}
|
|
169
|
+
BriefUtil.plain = plain;
|
|
170
|
+
function message(material2, since2, zh) {
|
|
171
|
+
const heads = zh ? BriefUtil.HEADINGS.zh : BriefUtil.HEADINGS.en;
|
|
172
|
+
const context = [
|
|
173
|
+
"[ta-recall:brief]",
|
|
174
|
+
`Write the daily brief of the user from what happened since ${new Date(since2).toISOString()}, below, in ${zh ? "Chinese" : "English"}. Short, for a phone: up to three parts, each a heading of level 3 with exactly these words, then a list of one line each (Ta counts them),`,
|
|
175
|
+
`- ### ${heads[0]}: what got done;`,
|
|
176
|
+
`- ### ${heads[1]}: what waits for a decision of the user, failed or was left half done, and what they should do, the most pressing first;`,
|
|
177
|
+
`- ### ${heads[2]}: two or three concrete next steps.`,
|
|
178
|
+
"Each line links its conversation as [title](session file). Leave out a part with nothing in it, small talk, and this conversation itself. Use no tools unless something must be checked.",
|
|
179
|
+
"",
|
|
180
|
+
material2
|
|
181
|
+
].join(`
|
|
182
|
+
`);
|
|
183
|
+
return `<context>
|
|
184
|
+
${context}
|
|
185
|
+
</context>
|
|
186
|
+
${zh ? "写今天的简报" : "Write today's brief"}`;
|
|
187
|
+
}
|
|
188
|
+
BriefUtil.message = message;
|
|
189
|
+
})(BriefUtil ||= {});
|
|
190
|
+
|
|
191
|
+
// web-src/conversation-index.ts
|
|
192
|
+
import { readdir, readFile, stat } from "node:fs/promises";
|
|
193
|
+
import { join } from "node:path";
|
|
194
|
+
|
|
195
|
+
// web-src/conversation-util.ts
|
|
196
|
+
var CONTEXT = /^<context>\n?[\s\S]*?\n?<\/context>\n?/;
|
|
197
|
+
var SKILL = /^<skill name="([^"]+)"[^>]*>[\s\S]*?<\/skill>\s*/;
|
|
198
|
+
var IMAGE_NOTE = /^\[Image: original \d+x\d+, displayed at \d+x\d+\. Multiply coordinates by [\d.]+ to map to original image\.\]$|^\[Image converted from [^\]]+ to [^\]]+\.\]$/gm;
|
|
199
|
+
var TITLE_CHARS = 80;
|
|
200
|
+
var ConversationUtil;
|
|
201
|
+
((ConversationUtil) => {
|
|
202
|
+
function parse(file, content, agentDir) {
|
|
203
|
+
let header;
|
|
204
|
+
let name;
|
|
205
|
+
let group;
|
|
206
|
+
let updatedAt = 0;
|
|
207
|
+
const said = [];
|
|
208
|
+
for (const line of content.split(`
|
|
209
|
+
`)) {
|
|
210
|
+
if (!line || !header && !line.includes('"session"') || line.includes('"role":"toolResult"') || !(line.includes('"message"') || line.includes('"session') || line.includes('"custom"'))) {
|
|
211
|
+
continue;
|
|
212
|
+
}
|
|
213
|
+
let entry;
|
|
214
|
+
try {
|
|
215
|
+
entry = JSON.parse(line);
|
|
216
|
+
} catch {
|
|
217
|
+
continue;
|
|
218
|
+
}
|
|
219
|
+
const at = Date.parse(entry.timestamp ?? "") || 0;
|
|
220
|
+
if (entry.type === "session") {
|
|
221
|
+
header = entry;
|
|
222
|
+
} else if (entry.type === "session_info" && typeof entry.name === "string") {
|
|
223
|
+
name = entry.name.trim() || undefined;
|
|
224
|
+
} else if (entry.type === "custom" && entry.customType === "ta-group" && typeof entry.data?.group === "string") {
|
|
225
|
+
group = entry.data.group;
|
|
226
|
+
} else if (entry.type === "message") {
|
|
227
|
+
const role = entry.message?.role;
|
|
228
|
+
if (role !== "user" && role !== "assistant") {
|
|
229
|
+
continue;
|
|
230
|
+
}
|
|
231
|
+
const raw = textOf(entry.message?.content);
|
|
232
|
+
const text = role === "user" ? userText(raw) : raw;
|
|
233
|
+
updatedAt = Math.max(updatedAt, at);
|
|
234
|
+
if (text) {
|
|
235
|
+
said.push(role === "user" && CONTEXT.test(raw) ? { role, text, at, framed: true } : { role, text, at });
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
if (!header) {
|
|
240
|
+
return;
|
|
241
|
+
}
|
|
242
|
+
const createdAt = Date.parse(header.timestamp ?? "") || 0;
|
|
243
|
+
const first = said.find((item) => item.role === "user")?.text.split(`
|
|
244
|
+
`)[0].trim();
|
|
245
|
+
return {
|
|
246
|
+
file,
|
|
247
|
+
cwd: cwdOf(header.cwd ?? "", agentDir),
|
|
248
|
+
title: (name ?? first ?? "").slice(0, TITLE_CHARS),
|
|
249
|
+
createdAt,
|
|
250
|
+
updatedAt: Math.max(updatedAt, createdAt),
|
|
251
|
+
...group ? { group } : {},
|
|
252
|
+
said
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
ConversationUtil.parse = parse;
|
|
256
|
+
function textOf(content) {
|
|
257
|
+
if (typeof content === "string") {
|
|
258
|
+
return content.trim();
|
|
259
|
+
}
|
|
260
|
+
if (!Array.isArray(content)) {
|
|
261
|
+
return "";
|
|
262
|
+
}
|
|
263
|
+
return content.flatMap((part) => part && typeof part === "object" && part.type === "text" && typeof part.text === "string" ? [part.text] : []).join(`
|
|
264
|
+
`).trim();
|
|
265
|
+
}
|
|
266
|
+
ConversationUtil.textOf = textOf;
|
|
267
|
+
function userText(content) {
|
|
268
|
+
const text = textOf(content).replace(CONTEXT, "").replace(IMAGE_NOTE, "");
|
|
269
|
+
const skill = SKILL.exec(text);
|
|
270
|
+
return (skill ? `/skill:${skill[1]} ${text.slice(skill[0].length)}` : text).trim();
|
|
271
|
+
}
|
|
272
|
+
ConversationUtil.userText = userText;
|
|
273
|
+
function cwdOf(cwd, agentDir) {
|
|
274
|
+
const mirror = `${agentDir.replace(/\/+$/, "")}/remote/ssh/`;
|
|
275
|
+
return cwd.startsWith(mirror) ? `ssh://${cwd.slice(mirror.length)}` : cwd;
|
|
276
|
+
}
|
|
277
|
+
ConversationUtil.cwdOf = cwdOf;
|
|
278
|
+
})(ConversationUtil ||= {});
|
|
279
|
+
|
|
280
|
+
// web-src/conversation-index.ts
|
|
281
|
+
class ConversationIndex {
|
|
282
|
+
agentDir;
|
|
283
|
+
kept = new Map;
|
|
284
|
+
reading;
|
|
285
|
+
constructor(agentDir) {
|
|
286
|
+
this.agentDir = agentDir;
|
|
287
|
+
}
|
|
288
|
+
get sessionsDir() {
|
|
289
|
+
return join(this.agentDir, "sessions");
|
|
290
|
+
}
|
|
291
|
+
all() {
|
|
292
|
+
this.reading ??= this.read().finally(() => {
|
|
293
|
+
this.reading = undefined;
|
|
294
|
+
});
|
|
295
|
+
return this.reading;
|
|
296
|
+
}
|
|
297
|
+
async read() {
|
|
298
|
+
const files = await this.files();
|
|
299
|
+
const seen = new Set;
|
|
300
|
+
const conversations = [];
|
|
301
|
+
await Promise.all(files.map(async (file) => {
|
|
302
|
+
seen.add(file);
|
|
303
|
+
const info = await stat(file).catch(() => {
|
|
304
|
+
return;
|
|
305
|
+
});
|
|
306
|
+
if (!info) {
|
|
307
|
+
return;
|
|
308
|
+
}
|
|
309
|
+
let kept = this.kept.get(file);
|
|
310
|
+
if (!kept || kept.mtimeMs !== info.mtimeMs || kept.size !== info.size) {
|
|
311
|
+
const content = await readFile(file, "utf8").catch(() => {
|
|
312
|
+
return;
|
|
313
|
+
});
|
|
314
|
+
kept = {
|
|
315
|
+
mtimeMs: info.mtimeMs,
|
|
316
|
+
size: info.size,
|
|
317
|
+
conversation: content === undefined ? undefined : ConversationUtil.parse(file, content, this.agentDir)
|
|
318
|
+
};
|
|
319
|
+
this.kept.set(file, kept);
|
|
320
|
+
}
|
|
321
|
+
if (kept.conversation) {
|
|
322
|
+
conversations.push(kept.conversation);
|
|
323
|
+
}
|
|
324
|
+
}));
|
|
325
|
+
for (const file of this.kept.keys()) {
|
|
326
|
+
if (!seen.has(file)) {
|
|
327
|
+
this.kept.delete(file);
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
return conversations.sort((a, b) => b.updatedAt - a.updatedAt);
|
|
331
|
+
}
|
|
332
|
+
async files() {
|
|
333
|
+
const root = this.sessionsDir;
|
|
334
|
+
const dirs = await readdir(root, { withFileTypes: true }).catch(() => []);
|
|
335
|
+
const lists = await Promise.all(dirs.filter((entry) => entry.isDirectory()).map(async (entry) => {
|
|
336
|
+
const names = await readdir(join(root, entry.name)).catch(() => []);
|
|
337
|
+
return names.filter((name) => name.endsWith(".jsonl")).map((name) => join(root, entry.name, name));
|
|
338
|
+
}));
|
|
339
|
+
return lists.flat();
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
// web-src/search-util.ts
|
|
344
|
+
var DAY_MS2 = 24 * 60 * 60000;
|
|
345
|
+
var PAIRS_CHARS = 1000;
|
|
346
|
+
var SearchUtil;
|
|
347
|
+
((SearchUtil) => {
|
|
348
|
+
function terms(query) {
|
|
349
|
+
return [
|
|
350
|
+
...new Set(query.toLowerCase().split(/[\s,,、|]+/).filter((term) => term.length > 0))
|
|
351
|
+
].slice(0, 12);
|
|
352
|
+
}
|
|
353
|
+
SearchUtil.terms = terms;
|
|
354
|
+
function search(conversations, query, now = Date.now()) {
|
|
355
|
+
const words = terms(query.query);
|
|
356
|
+
if (words.length === 0) {
|
|
357
|
+
return [];
|
|
358
|
+
}
|
|
359
|
+
const since = now - (query.days ?? Limits.SEARCH_DAYS) * DAY_MS2;
|
|
360
|
+
const hits = [];
|
|
361
|
+
for (const conversation of conversations) {
|
|
362
|
+
if (conversation.updatedAt < since || conversation.file === query.exclude || query.cwd && conversation.cwd !== query.cwd) {
|
|
363
|
+
continue;
|
|
364
|
+
}
|
|
365
|
+
const found = new Set;
|
|
366
|
+
const places = [];
|
|
367
|
+
const title = conversation.title.toLowerCase();
|
|
368
|
+
for (const word of words) {
|
|
369
|
+
if (title.includes(word)) {
|
|
370
|
+
found.add(word);
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
for (const said of conversation.said) {
|
|
374
|
+
const text = said.text.toLowerCase();
|
|
375
|
+
const has = words.filter((word) => text.includes(word));
|
|
376
|
+
if (has.length === 0 || query.all && has.length < words.length) {
|
|
377
|
+
continue;
|
|
378
|
+
}
|
|
379
|
+
for (const word of has) {
|
|
380
|
+
found.add(word);
|
|
381
|
+
}
|
|
382
|
+
places.push({ said, word: has[0] });
|
|
383
|
+
}
|
|
384
|
+
if (places.length === 0 && !(query.all ? words.every((word) => found.has(word)) : found.size > 0)) {
|
|
385
|
+
continue;
|
|
386
|
+
}
|
|
387
|
+
hits.push({
|
|
388
|
+
file: conversation.file,
|
|
389
|
+
cwd: conversation.cwd,
|
|
390
|
+
title: conversation.title,
|
|
391
|
+
updatedAt: conversation.updatedAt,
|
|
392
|
+
matched: found.size,
|
|
393
|
+
places: places.length,
|
|
394
|
+
snippets: places.slice(-Limits.SNIPPETS).map((place) => ({ role: place.said.role, at: place.said.at, text: snippet(place.said.text, place.word) }))
|
|
395
|
+
});
|
|
396
|
+
}
|
|
397
|
+
return hits.sort((a, b) => b.matched - a.matched || Math.min(b.places, 5) - Math.min(a.places, 5) || b.updatedAt - a.updatedAt).slice(0, query.limit ?? Limits.SEARCH_HITS).map(({ places: _, ...hit }) => hit);
|
|
398
|
+
}
|
|
399
|
+
SearchUtil.search = search;
|
|
400
|
+
function snippet(text, word, chars = Limits.SNIPPET_CHARS) {
|
|
401
|
+
const line = text.replace(/\s+/g, " ").trim();
|
|
402
|
+
if (line.length <= chars) {
|
|
403
|
+
return line;
|
|
404
|
+
}
|
|
405
|
+
const at = Math.max(0, line.toLowerCase().indexOf(word));
|
|
406
|
+
const start = Math.max(0, Math.min(at - Math.floor(chars / 3), line.length - chars));
|
|
407
|
+
return `${start > 0 ? "…" : ""}${line.slice(start, start + chars).trim()}${start + chars < line.length ? "…" : ""}`;
|
|
408
|
+
}
|
|
409
|
+
SearchUtil.snippet = snippet;
|
|
410
|
+
})(SearchUtil ||= {});
|
|
411
|
+
var SimilarUtil;
|
|
412
|
+
((SimilarUtil) => {
|
|
413
|
+
function pairs(text) {
|
|
414
|
+
const flat = text.slice(0, PAIRS_CHARS).toLowerCase().replace(/[\s\p{P}\p{S}]+/gu, "");
|
|
415
|
+
const counts = new Map;
|
|
416
|
+
for (let index = 0;index < flat.length - 1; index++) {
|
|
417
|
+
const pair = flat.slice(index, index + 2);
|
|
418
|
+
counts.set(pair, (counts.get(pair) ?? 0) + 1);
|
|
419
|
+
}
|
|
420
|
+
return counts;
|
|
421
|
+
}
|
|
422
|
+
SimilarUtil.pairs = pairs;
|
|
423
|
+
function dice(a, b) {
|
|
424
|
+
let size = 0;
|
|
425
|
+
let shared = 0;
|
|
426
|
+
for (const count of a.values()) {
|
|
427
|
+
size += count;
|
|
428
|
+
}
|
|
429
|
+
for (const [pair, count] of b) {
|
|
430
|
+
size += count;
|
|
431
|
+
shared += Math.min(count, a.get(pair) ?? 0);
|
|
432
|
+
}
|
|
433
|
+
return size === 0 ? 0 : 2 * shared / size;
|
|
434
|
+
}
|
|
435
|
+
SimilarUtil.dice = dice;
|
|
436
|
+
function comparable(text) {
|
|
437
|
+
const trimmed = text.trim();
|
|
438
|
+
return trimmed.length >= Limits.SIMILAR_MIN_CHARS && !trimmed.startsWith("/");
|
|
439
|
+
}
|
|
440
|
+
SimilarUtil.comparable = comparable;
|
|
441
|
+
function find(text, conversations, options = {}) {
|
|
442
|
+
if (!comparable(text)) {
|
|
443
|
+
return [];
|
|
444
|
+
}
|
|
445
|
+
const mine = pairs(text);
|
|
446
|
+
if ((options.declined ?? []).some((declined) => dice(mine, pairs(declined)) >= Limits.SIMILAR_SCORE)) {
|
|
447
|
+
return [];
|
|
448
|
+
}
|
|
449
|
+
const since = (options.now ?? Date.now()) - Limits.SIMILAR_DAYS * DAY_MS2;
|
|
450
|
+
const exclude = new Set(options.exclude ?? []);
|
|
451
|
+
const found = [];
|
|
452
|
+
for (const conversation of conversations) {
|
|
453
|
+
if (conversation.group || exclude.has(conversation.file) || conversation.updatedAt < since) {
|
|
454
|
+
continue;
|
|
455
|
+
}
|
|
456
|
+
let best;
|
|
457
|
+
for (const said of conversation.said) {
|
|
458
|
+
if (said.role !== "user" || said.framed || said.at < since || !comparable(said.text)) {
|
|
459
|
+
continue;
|
|
460
|
+
}
|
|
461
|
+
const score = dice(mine, pairs(said.text));
|
|
462
|
+
if (score >= Limits.SIMILAR_SCORE && (!best || score > best.score)) {
|
|
463
|
+
best = { file: conversation.file, title: conversation.title, text: said.text, at: said.at, score };
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
if (best) {
|
|
467
|
+
found.push(best);
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
return found.sort((a, b) => b.score - a.score).slice(0, 3).map(({ score: _, ...ask }) => ask);
|
|
471
|
+
}
|
|
472
|
+
SimilarUtil.find = find;
|
|
473
|
+
})(SimilarUtil ||= {});
|
|
474
|
+
|
|
475
|
+
// web-src/server-texts.ts
|
|
476
|
+
var RecallServerTexts;
|
|
477
|
+
((RecallServerTexts) => {
|
|
478
|
+
function zh(env = process.env) {
|
|
479
|
+
return /^zh/i.test(env.TA_LANGUAGE || env.LC_ALL || env.LC_MESSAGES || env.LANG || "");
|
|
480
|
+
}
|
|
481
|
+
RecallServerTexts.zh = zh;
|
|
482
|
+
function briefTitle() {
|
|
483
|
+
return zh() ? "每日简报" : "Daily brief";
|
|
484
|
+
}
|
|
485
|
+
RecallServerTexts.briefTitle = briefTitle;
|
|
486
|
+
})(RecallServerTexts ||= {});
|
|
487
|
+
|
|
488
|
+
// web-src/skill-util.ts
|
|
489
|
+
var FENCE = "```";
|
|
490
|
+
var NAME_CHARS = 64;
|
|
491
|
+
var DESCRIPTION_CHARS = 1024;
|
|
492
|
+
var SkillUtil;
|
|
493
|
+
((SkillUtil) => {
|
|
494
|
+
function find(text) {
|
|
495
|
+
const lines = text.split(/\r?\n/);
|
|
496
|
+
let found;
|
|
497
|
+
for (let index = 0;index < lines.length; index++) {
|
|
498
|
+
const open = /^\s*(`{3,})\s*([\w-]+)\s*$/.exec(lines[index]);
|
|
499
|
+
if (open?.[2] !== SKILL_BLOCK) {
|
|
500
|
+
continue;
|
|
501
|
+
}
|
|
502
|
+
const close = new RegExp(`^\\s*${open[1]}\`*\\s*$`);
|
|
503
|
+
const end = lines.findIndex((line, at) => at > index && close.test(line));
|
|
504
|
+
found = lines.slice(index + 1, end < 0 ? lines.length : end);
|
|
505
|
+
index = end < 0 ? lines.length : end;
|
|
506
|
+
}
|
|
507
|
+
return found && parse(found);
|
|
508
|
+
}
|
|
509
|
+
SkillUtil.find = find;
|
|
510
|
+
function parse(lines) {
|
|
511
|
+
const rule = lines.findIndex((line) => line.trim() === "---");
|
|
512
|
+
const head = rule < 0 ? [] : lines.slice(0, rule);
|
|
513
|
+
const body = lines.slice(rule + 1).join(`
|
|
514
|
+
`).trim();
|
|
515
|
+
if (!body) {
|
|
516
|
+
return;
|
|
517
|
+
}
|
|
518
|
+
const field = (key) => head.map((line) => new RegExp(`^\\s*${key}\\s*:\\s*(.*)$`, "i").exec(line)?.[1].trim().replace(/^["'](.*)["']$/, "$1")).find((value) => value !== undefined);
|
|
519
|
+
const description = (field("description") ?? "").replace(/\s+/g, " ").slice(0, DESCRIPTION_CHARS);
|
|
520
|
+
return { name: name(field("name") ?? "") || name(description) || "skill", description, body };
|
|
521
|
+
}
|
|
522
|
+
function name(text) {
|
|
523
|
+
return text.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, NAME_CHARS).replace(/-+$/, "");
|
|
524
|
+
}
|
|
525
|
+
SkillUtil.name = name;
|
|
526
|
+
function check(draft) {
|
|
527
|
+
const body = typeof draft?.body === "string" ? draft.body.trim() : "";
|
|
528
|
+
if (!body) {
|
|
529
|
+
throw new Error("A skill needs a body.");
|
|
530
|
+
}
|
|
531
|
+
const description = (typeof draft.description === "string" ? draft.description : "").replace(/\s+/g, " ").trim().slice(0, DESCRIPTION_CHARS);
|
|
532
|
+
return { name: name(typeof draft.name === "string" ? draft.name : "") || "skill", description: description || body.split(`
|
|
533
|
+
`)[0].slice(0, 200), body };
|
|
534
|
+
}
|
|
535
|
+
SkillUtil.check = check;
|
|
536
|
+
function markdown(draft) {
|
|
537
|
+
return `---
|
|
538
|
+
name: ${draft.name}
|
|
539
|
+
description: ${JSON.stringify(draft.description)}
|
|
540
|
+
---
|
|
541
|
+
|
|
542
|
+
${draft.body.trim()}
|
|
543
|
+
`;
|
|
544
|
+
}
|
|
545
|
+
SkillUtil.markdown = markdown;
|
|
546
|
+
function blockHelp() {
|
|
547
|
+
return [
|
|
548
|
+
`${FENCE}${SKILL_BLOCK}`,
|
|
549
|
+
"name: <lowercase-words-with-dashes>",
|
|
550
|
+
"description: <one line: what it does and when to use it>",
|
|
551
|
+
"---",
|
|
552
|
+
"<the body: the goal, then the steps, commands, files and checks that worked, in general terms, without what held only this once>",
|
|
553
|
+
FENCE,
|
|
554
|
+
"Use a longer fence when the body has fences of its own. Write it in the language of the user."
|
|
555
|
+
].join(`
|
|
556
|
+
`);
|
|
557
|
+
}
|
|
558
|
+
SkillUtil.blockHelp = blockHelp;
|
|
559
|
+
function hint(asks) {
|
|
560
|
+
const lines = asks.map((ask2) => `- "${ask2.title}" (${new Date(ask2.at).toISOString().slice(0, 10)}): ${JSON.stringify(ask2.text.replace(/\s+/g, " ").slice(0, 200))}`);
|
|
561
|
+
return [
|
|
562
|
+
"The user asked for much the same in other conversations before:",
|
|
563
|
+
...lines,
|
|
564
|
+
`Do what is asked first. Then, if it is a way of working worth doing the same way again (steps, commands, checks; not a one-off answer), offer to keep it as a skill in one short sentence and draft it with ${PROPOSE_TOOL}, which Ta shows as a card the user saves with a tap. Without that tool, end your answer with the draft in a fenced block of the language ${SKILL_BLOCK} instead:`,
|
|
565
|
+
blockHelp(),
|
|
566
|
+
"Offer nothing when it is not worth keeping."
|
|
567
|
+
].join(`
|
|
568
|
+
`);
|
|
569
|
+
}
|
|
570
|
+
SkillUtil.hint = hint;
|
|
571
|
+
function ask(language) {
|
|
572
|
+
const context = [
|
|
573
|
+
"[ta-recall:skill]",
|
|
574
|
+
"The user wants the way of working of this conversation kept as a skill of Ta, which Ta loads in every new conversation: written so that one who never saw this conversation does it the same way.",
|
|
575
|
+
"- Keep what worked: the goal, the steps, the commands, files, checks and pitfalls; leave out what was only tried and dropped and what holds only this once.",
|
|
576
|
+
`- Draft it with ${PROPOSE_TOOL}, which Ta shows as a card the user saves, and say in a line what it does; do not write the skill file yourself. Without that tool, end your answer with the draft in a fenced block of the language ${SKILL_BLOCK}:`,
|
|
577
|
+
blockHelp(),
|
|
578
|
+
"- When the conversation holds no way of working worth keeping, say so and draft nothing."
|
|
579
|
+
].join(`
|
|
580
|
+
`);
|
|
581
|
+
return `<context>
|
|
582
|
+
${context}
|
|
583
|
+
</context>
|
|
584
|
+
${/^zh/i.test(language) ? "把这个对话里的做法存成技能" : "Keep how this was done as a skill"}`;
|
|
585
|
+
}
|
|
586
|
+
SkillUtil.ask = ask;
|
|
587
|
+
})(SkillUtil ||= {});
|
|
588
|
+
|
|
589
|
+
// web-src/recall-service.ts
|
|
590
|
+
var NOTIFY = "@celljs/ta-notify";
|
|
591
|
+
var CRON = "@celljs/ta-cron";
|
|
592
|
+
var CHECK_MS = 60000;
|
|
593
|
+
var FIRST_CHECK_MS = 20000;
|
|
594
|
+
|
|
595
|
+
class RecallHost {
|
|
596
|
+
host;
|
|
597
|
+
now;
|
|
598
|
+
index;
|
|
599
|
+
queue = Promise.resolve();
|
|
600
|
+
timers = [];
|
|
601
|
+
briefing;
|
|
602
|
+
constructor(host, now = Date.now) {
|
|
603
|
+
this.host = host;
|
|
604
|
+
this.now = now;
|
|
605
|
+
this.index = new ConversationIndex(host.agentDir);
|
|
606
|
+
}
|
|
607
|
+
start() {
|
|
608
|
+
this.index.all().catch(() => {
|
|
609
|
+
return;
|
|
610
|
+
});
|
|
611
|
+
const first = setTimeout(() => void this.checkBrief(), FIRST_CHECK_MS);
|
|
612
|
+
const every = setInterval(() => void this.checkBrief(), CHECK_MS);
|
|
613
|
+
first.unref?.();
|
|
614
|
+
every.unref?.();
|
|
615
|
+
this.timers.push(first, every);
|
|
616
|
+
}
|
|
617
|
+
dispose() {
|
|
618
|
+
for (const timer of this.timers) {
|
|
619
|
+
clearTimeout(timer);
|
|
620
|
+
clearInterval(timer);
|
|
621
|
+
}
|
|
622
|
+
this.timers = [];
|
|
623
|
+
}
|
|
624
|
+
async search(query) {
|
|
625
|
+
if (typeof query?.query !== "string") {
|
|
626
|
+
throw new Error("Say what to search for in query.");
|
|
627
|
+
}
|
|
628
|
+
const briefFile = await this.read(Keys.BRIEF_FILE);
|
|
629
|
+
const conversations = (await this.index.all()).filter((conversation) => conversation.file !== briefFile);
|
|
630
|
+
return SearchUtil.search(conversations, query, this.now());
|
|
631
|
+
}
|
|
632
|
+
async similar(text, piSessionId) {
|
|
633
|
+
if (typeof text !== "string" || !SimilarUtil.comparable(text) || await this.read(Keys.SUGGEST) === false) {
|
|
634
|
+
return [];
|
|
635
|
+
}
|
|
636
|
+
const session = piSessionId ? (await this.host.listSessions()).find((info) => info.piSessionId === piSessionId) : undefined;
|
|
637
|
+
if (session?.group) {
|
|
638
|
+
return [];
|
|
639
|
+
}
|
|
640
|
+
const [declined, briefFile] = await Promise.all([this.read(Keys.DECLINED), this.read(Keys.BRIEF_FILE)]);
|
|
641
|
+
return SimilarUtil.find(text, await this.index.all(), {
|
|
642
|
+
exclude: [session?.sessionFile, typeof briefFile === "string" ? briefFile : undefined].filter((file) => !!file),
|
|
643
|
+
declined: strings(declined),
|
|
644
|
+
now: this.now()
|
|
645
|
+
});
|
|
646
|
+
}
|
|
647
|
+
saveSkill(key, draft) {
|
|
648
|
+
return this.serial(async () => {
|
|
649
|
+
const checked = SkillUtil.check(draft);
|
|
650
|
+
const root = join2(this.host.agentDir, "skills");
|
|
651
|
+
let name = checked.name;
|
|
652
|
+
for (let count = 2;existsSync(join2(root, name)); count++) {
|
|
653
|
+
name = `${checked.name.slice(0, 60)}-${count}`;
|
|
654
|
+
}
|
|
655
|
+
const file = join2(root, name, "SKILL.md");
|
|
656
|
+
await mkdir(join2(root, name), { recursive: true });
|
|
657
|
+
await writeFile(file, SkillUtil.markdown({ ...checked, name }), "utf8");
|
|
658
|
+
await this.decide(key, { saved: file, name });
|
|
659
|
+
return file;
|
|
660
|
+
});
|
|
661
|
+
}
|
|
662
|
+
declineSkill(key, ask) {
|
|
663
|
+
return this.serial(async () => {
|
|
664
|
+
await this.decide(key, { declined: true });
|
|
665
|
+
if (typeof ask === "string" && SimilarUtil.comparable(ask)) {
|
|
666
|
+
const declined = [...strings(await this.read(Keys.DECLINED)), ask.slice(0, 1000)].slice(-Limits.DECLINED_KEPT);
|
|
667
|
+
await this.host.setExtensionData(NAME, Keys.DECLINED, declined);
|
|
668
|
+
}
|
|
669
|
+
});
|
|
670
|
+
}
|
|
671
|
+
keepAsked(file) {
|
|
672
|
+
return this.serial(async () => {
|
|
673
|
+
if (typeof file !== "string" || !file) {
|
|
674
|
+
throw new Error("Say the session file of the conversation.");
|
|
675
|
+
}
|
|
676
|
+
const asked = strings(await this.read(Keys.ASKED)).filter((item) => item !== file);
|
|
677
|
+
await this.host.setExtensionData(NAME, Keys.ASKED, [...asked, file].slice(-Limits.ASKED_KEPT));
|
|
678
|
+
});
|
|
679
|
+
}
|
|
680
|
+
keepBrief(file, text) {
|
|
681
|
+
return this.serial(async () => {
|
|
682
|
+
const summary = typeof file === "string" && typeof text === "string" ? BriefUtil.summary(text, file, this.now()) : undefined;
|
|
683
|
+
if (summary) {
|
|
684
|
+
await this.host.setExtensionData(NAME, Keys.BRIEF_SUMMARY, summary);
|
|
685
|
+
}
|
|
686
|
+
return summary;
|
|
687
|
+
});
|
|
688
|
+
}
|
|
689
|
+
briefNow() {
|
|
690
|
+
return this.brief(true);
|
|
691
|
+
}
|
|
692
|
+
async checkBrief() {
|
|
693
|
+
try {
|
|
694
|
+
const [settings, last] = await Promise.all([this.read(Keys.BRIEF), this.read(Keys.BRIEF_LAST)]);
|
|
695
|
+
if (last === undefined) {
|
|
696
|
+
await this.host.setExtensionData(NAME, Keys.BRIEF_LAST, this.now());
|
|
697
|
+
return;
|
|
698
|
+
}
|
|
699
|
+
if (BriefUtil.due(BriefUtil.settings(settings), typeof last === "number" ? last : undefined, this.now())) {
|
|
700
|
+
await this.brief(false);
|
|
701
|
+
}
|
|
702
|
+
} catch (error) {
|
|
703
|
+
console.error("ta-recall could not write the daily brief:", error);
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
brief(force) {
|
|
707
|
+
this.briefing ??= this.writeBrief(force).finally(() => {
|
|
708
|
+
this.briefing = undefined;
|
|
709
|
+
});
|
|
710
|
+
return this.briefing;
|
|
711
|
+
}
|
|
712
|
+
async writeBrief(force) {
|
|
713
|
+
const now = this.now();
|
|
714
|
+
const [last, file] = await Promise.all([this.read(Keys.BRIEF_LAST), this.read(Keys.BRIEF_FILE)]);
|
|
715
|
+
const briefFile = typeof file === "string" && file ? file : undefined;
|
|
716
|
+
const since = BriefUtil.since(typeof last === "number" ? last : undefined, now);
|
|
717
|
+
const sessions = await this.host.listSessions();
|
|
718
|
+
const states = new Map(sessions.flatMap((info) => info.sessionFile ? [[info.sessionFile, { streaming: info.isStreaming, waiting: info.waiting }]] : []));
|
|
719
|
+
const material = BriefUtil.material({
|
|
720
|
+
since,
|
|
721
|
+
conversations: await this.index.all(),
|
|
722
|
+
briefFile,
|
|
723
|
+
notices: await this.notices(),
|
|
724
|
+
runs: await this.runs(since),
|
|
725
|
+
states
|
|
726
|
+
});
|
|
727
|
+
if (!material) {
|
|
728
|
+
if (!force) {
|
|
729
|
+
await this.host.setExtensionData(NAME, Keys.BRIEF_LAST, now);
|
|
730
|
+
}
|
|
731
|
+
return;
|
|
732
|
+
}
|
|
733
|
+
const session = await this.briefSession(sessions, briefFile);
|
|
734
|
+
await this.host.prompt(session.sessionId, {
|
|
735
|
+
message: BriefUtil.message(material, since, RecallServerTexts.zh()),
|
|
736
|
+
clientMessageId: `ta-recall-brief:${now}`,
|
|
737
|
+
streamingBehavior: "followUp"
|
|
738
|
+
});
|
|
739
|
+
await this.host.setExtensionData(NAME, Keys.BRIEF_LAST, now);
|
|
740
|
+
const opened = session.sessionFile ?? (await this.host.listSessions()).find((info) => info.sessionId === session.sessionId)?.sessionFile;
|
|
741
|
+
if (opened && opened !== briefFile) {
|
|
742
|
+
await this.host.setExtensionData(NAME, Keys.BRIEF_FILE, opened);
|
|
743
|
+
}
|
|
744
|
+
return opened;
|
|
745
|
+
}
|
|
746
|
+
async briefSession(sessions, file) {
|
|
747
|
+
const open = file ? sessions.find((info) => info.sessionFile === file) : undefined;
|
|
748
|
+
if (open) {
|
|
749
|
+
return open;
|
|
750
|
+
}
|
|
751
|
+
const { cwd } = await this.host.getServerInfo();
|
|
752
|
+
if (file && existsSync(file)) {
|
|
753
|
+
return this.host.openSession({ cwd: await this.host.sessionCwd(file) ?? cwd, sessionFile: file });
|
|
754
|
+
}
|
|
755
|
+
const created = await this.host.openSession({ cwd });
|
|
756
|
+
await this.host.setSessionName(created.sessionId, RecallServerTexts.briefTitle());
|
|
757
|
+
return created;
|
|
758
|
+
}
|
|
759
|
+
async notices() {
|
|
760
|
+
const value = await this.host.getExtensionData(NOTIFY, "notices").catch(() => {
|
|
761
|
+
return;
|
|
762
|
+
});
|
|
763
|
+
return Array.isArray(value) ? value.filter((notice) => !!notice && typeof notice.at === "number" && typeof notice.text === "string") : [];
|
|
764
|
+
}
|
|
765
|
+
async runs(since) {
|
|
766
|
+
const tasks = await this.host.getExtensionData(CRON, "tasks").catch(() => {
|
|
767
|
+
return;
|
|
768
|
+
});
|
|
769
|
+
if (!Array.isArray(tasks)) {
|
|
770
|
+
return [];
|
|
771
|
+
}
|
|
772
|
+
const ran = tasks.filter((task) => task && typeof task.id === "string" && Date.parse(task.lastRunAt ?? "") >= since);
|
|
773
|
+
return Promise.all(ran.map(async (task) => {
|
|
774
|
+
const runs = await this.host.getExtensionData(CRON, `runs/${task.id}`).catch(() => {
|
|
775
|
+
return;
|
|
776
|
+
});
|
|
777
|
+
const run = Array.isArray(runs) ? runs[0] : undefined;
|
|
778
|
+
return {
|
|
779
|
+
name: String(task.name ?? task.id),
|
|
780
|
+
at: Date.parse(task.lastRunAt),
|
|
781
|
+
status: typeof task.lastStatus === "string" ? task.lastStatus : undefined,
|
|
782
|
+
summary: typeof run?.summary === "string" ? run.summary : typeof run?.error === "string" ? run.error : undefined
|
|
783
|
+
};
|
|
784
|
+
}));
|
|
785
|
+
}
|
|
786
|
+
async decide(key, decision) {
|
|
787
|
+
if (typeof key !== "string" || !key) {
|
|
788
|
+
throw new Error("A card needs its key.");
|
|
789
|
+
}
|
|
790
|
+
const stored = await this.read(Keys.DECIDED);
|
|
791
|
+
const decided = stored && typeof stored === "object" ? { ...stored } : {};
|
|
792
|
+
decided[key] = decision;
|
|
793
|
+
await this.host.setExtensionData(NAME, Keys.DECIDED, decided);
|
|
794
|
+
}
|
|
795
|
+
read(key) {
|
|
796
|
+
return this.host.getExtensionData(NAME, key).catch(() => {
|
|
797
|
+
return;
|
|
798
|
+
});
|
|
799
|
+
}
|
|
800
|
+
serial(work) {
|
|
801
|
+
const next = this.queue.then(work, work);
|
|
802
|
+
this.queue = next.catch(() => {
|
|
803
|
+
return;
|
|
804
|
+
});
|
|
805
|
+
return next;
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
function strings(value) {
|
|
809
|
+
return Array.isArray(value) ? value.filter((item) => typeof item === "string") : [];
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
// web-src/host.ts
|
|
813
|
+
function activate(host) {
|
|
814
|
+
const recall = new RecallHost(host);
|
|
815
|
+
recall.start();
|
|
816
|
+
return recall;
|
|
817
|
+
}
|
|
818
|
+
export {
|
|
819
|
+
activate as default
|
|
820
|
+
};
|