@celljs/ta 4.10.0 → 4.12.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 +1675 -51
- package/dist/gateway.mjs +167 -5
- package/dist/pi/CHANGELOG.md +27 -0
- package/dist/pi/package.json +1 -1
- package/dist/pi/packages/ta-agents/extension/index.mjs +359 -155
- package/dist/pi/packages/ta-agents/lib/acp-agent.js +30 -10
- package/dist/pi/packages/ta-agents/lib/acp-protocol.d.ts +5 -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 +9 -0
- package/dist/pi/packages/ta-agents/lib/agent-prompt.js +25 -0
- package/dist/pi/packages/ta-agents/lib/agent-session.d.ts +71 -1
- package/dist/pi/packages/ta-agents/lib/agent-session.js +177 -17
- package/dist/pi/packages/ta-agents/lib/agent-streamer.js +23 -2
- package/dist/pi/packages/ta-agents/lib/agent-tool.js +4 -3
- package/dist/pi/packages/ta-agents/lib/agent-turn.d.ts +7 -1
- package/dist/pi/packages/ta-agents/lib/agent-turn.js +26 -3
- package/dist/pi/packages/ta-agents/lib/extension.js +7 -0
- package/dist/pi/packages/ta-agents/lib/texts.d.ts +12 -0
- package/dist/pi/packages/ta-agents/lib/texts.js +12 -0
- package/dist/pi/packages/ta-agents/package.json +1 -1
- package/dist/pi/packages/ta-bots/extension/index.mjs +31 -299
- package/dist/pi/packages/ta-bots/host/index.mjs +143 -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 +4 -3
- package/dist/pi/packages/ta-channels/README.md +4 -3
- package/dist/pi/packages/ta-channels/extension/index.mjs +350 -28
- package/dist/pi/packages/ta-channels/host/index.mjs +588 -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 +3 -1
- 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 +6 -0
- 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 +45 -0
- package/dist/pi/packages/ta-channels/lib/i18n.js +90 -0
- 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/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 +13 -2
- package/dist/pi/packages/ta-channels/lib/sidebar.d.ts +1 -6
- package/dist/pi/packages/ta-channels/lib/sidebar.js +160 -79
- package/dist/pi/packages/ta-channels/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-channels/lib/style.js +72 -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 +33 -16
- package/dist/pi/packages/ta-channels/lib/views.js +79 -31
- package/dist/pi/packages/ta-channels/package.json +2 -1
- package/dist/pi/packages/ta-channels/web/index.js +1551 -308
- package/dist/pi/packages/ta-computer-use/package.json +6 -1
- package/dist/pi/packages/ta-cron/README.en.md +4 -2
- package/dist/pi/packages/ta-cron/README.md +4 -2
- package/dist/pi/packages/ta-cron/extension/index.mjs +416 -44
- package/dist/pi/packages/ta-cron/host/index.mjs +24 -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 +5 -3
- 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 +18 -0
- package/dist/pi/packages/ta-cron/lib/i18n.js +36 -0
- package/dist/pi/packages/ta-cron/lib/index.js +4 -0
- package/dist/pi/packages/ta-cron/lib/page.d.ts +5 -1
- package/dist/pi/packages/ta-cron/lib/page.js +12 -0
- 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 +11 -13
- package/dist/pi/packages/ta-cron/lib/task-util.d.ts +2 -0
- package/dist/pi/packages/ta-cron/lib/task-util.js +20 -1
- package/dist/pi/packages/ta-cron/lib/tasks-view.js +6 -2
- 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 +661 -254
- package/dist/pi/packages/ta-extensions/README.en.md +1 -1
- package/dist/pi/packages/ta-extensions/README.md +1 -1
- 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 +13 -4
- 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/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 +12 -7
- 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/style.d.ts +1 -1
- package/dist/pi/packages/ta-extensions/lib/style.js +3 -2
- package/dist/pi/packages/ta-extensions/package.json +6 -1
- package/dist/pi/packages/ta-extensions/skills/ta-package/SKILL.md +20 -8
- package/dist/pi/packages/ta-extensions/web/index.js +191 -22
- 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 +269 -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 +7 -0
- package/dist/pi/packages/ta-glance/lib/glance-spec.js +206 -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 +241 -0
- package/dist/pi/packages/ta-glance/package.json +53 -0
- package/dist/pi/packages/ta-glance/web/index.js +1013 -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-c.d.ts +2 -0
- package/dist/pi/packages/ta-manual/lib/pictures-c.js +53 -0
- package/dist/pi/packages/ta-manual/lib/pictures.d.ts +9 -0
- package/dist/pi/packages/ta-manual/lib/pictures.js +17 -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 +43 -0
- package/dist/pi/packages/ta-manual/lib/topics.js +388 -0
- package/dist/pi/packages/ta-manual/package.json +54 -0
- package/dist/pi/packages/ta-manual/skills/ta-manual/SKILL.md +130 -0
- package/dist/pi/packages/ta-manual/web/index.js +2408 -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 +615 -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 +52 -0
- package/dist/pi/packages/ta-recall/lib/extension.d.ts +24 -0
- package/dist/pi/packages/ta-recall/lib/extension.js +132 -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 +1042 -0
- package/dist/pi/packages/ta-rooms/README.en.md +29 -0
- package/dist/pi/packages/ta-rooms/README.md +29 -0
- package/dist/pi/packages/ta-rooms/extension/index.mjs +362 -0
- package/dist/pi/packages/ta-rooms/host/index.mjs +966 -0
- package/dist/pi/packages/ta-rooms/lib/agents-view.d.ts +25 -0
- package/dist/pi/packages/ta-rooms/lib/agents-view.js +128 -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/double-host.d.ts +114 -0
- package/dist/pi/packages/ta-rooms/lib/double-host.js +645 -0
- package/dist/pi/packages/ta-rooms/lib/double-i18n.d.ts +85 -0
- package/dist/pi/packages/ta-rooms/lib/double-i18n.js +172 -0
- package/dist/pi/packages/ta-rooms/lib/double-protocol.d.ts +165 -0
- package/dist/pi/packages/ta-rooms/lib/double-protocol.js +73 -0
- package/dist/pi/packages/ta-rooms/lib/double-util.d.ts +99 -0
- package/dist/pi/packages/ta-rooms/lib/double-util.js +180 -0
- package/dist/pi/packages/ta-rooms/lib/doubles-store.d.ts +45 -0
- package/dist/pi/packages/ta-rooms/lib/doubles-store.js +145 -0
- package/dist/pi/packages/ta-rooms/lib/doubles-view.d.ts +34 -0
- package/dist/pi/packages/ta-rooms/lib/doubles-view.js +223 -0
- package/dist/pi/packages/ta-rooms/lib/extension.d.ts +24 -0
- package/dist/pi/packages/ta-rooms/lib/extension.js +176 -0
- package/dist/pi/packages/ta-rooms/lib/host.d.ts +7 -0
- package/dist/pi/packages/ta-rooms/lib/host.js +18 -0
- package/dist/pi/packages/ta-rooms/lib/i18n.d.ts +105 -0
- package/dist/pi/packages/ta-rooms/lib/i18n.js +211 -0
- package/dist/pi/packages/ta-rooms/lib/index.d.ts +9 -0
- package/dist/pi/packages/ta-rooms/lib/index.js +106 -0
- package/dist/pi/packages/ta-rooms/lib/members-view.d.ts +3 -0
- package/dist/pi/packages/ta-rooms/lib/members-view.js +94 -0
- package/dist/pi/packages/ta-rooms/lib/page.d.ts +154 -0
- package/dist/pi/packages/ta-rooms/lib/page.js +400 -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 +15 -0
- package/dist/pi/packages/ta-rooms/lib/room-view.js +168 -0
- package/dist/pi/packages/ta-rooms/lib/rooms-home.d.ts +32 -0
- package/dist/pi/packages/ta-rooms/lib/rooms-home.js +141 -0
- package/dist/pi/packages/ta-rooms/lib/rooms-page.d.ts +14 -0
- package/dist/pi/packages/ta-rooms/lib/rooms-page.js +217 -0
- package/dist/pi/packages/ta-rooms/lib/style.d.ts +4 -0
- package/dist/pi/packages/ta-rooms/lib/style.js +205 -0
- package/dist/pi/packages/ta-rooms/package.json +56 -0
- package/dist/pi/packages/ta-rooms/web/index.js +3165 -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 +78 -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 +117 -0
- package/dist/pi/packages/ta-share/package.json +56 -0
- package/dist/pi/packages/ta-share/web/index.js +1224 -0
- package/dist/pi/packages/ta-workspace/README.md +1 -1
- package/dist/pi/packages/ta-workspace/README.zh-cn.md +1 -1
- 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/editors.js +29 -2
- package/dist/pi/packages/ta-workspace/lib/i18n.d.ts +13 -2
- package/dist/pi/packages/ta-workspace/lib/i18n.js +29 -7
- package/dist/pi/packages/ta-workspace/lib/index.js +2 -0
- package/dist/pi/packages/ta-workspace/lib/preview.d.ts +10 -1
- package/dist/pi/packages/ta-workspace/lib/preview.js +136 -11
- package/dist/pi/packages/ta-workspace/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-workspace/lib/style.js +56 -40
- 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/preview.d.ts +27 -0
- package/dist/pi/packages/ta-workspace/lib/util/preview.js +74 -0
- 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 +823 -341
- package/dist/public/assets/OrbitControls-DVf70a7w.js +1 -0
- package/dist/public/assets/{abnfDiagram-S7VZAUFO-BmIko5tV.js → abnfDiagram-S7VZAUFO-BnqtcbpZ.js} +1 -1
- package/dist/public/assets/{architecture-WOLXFQ4H-XgsdQ7ul.js → architecture-WOLXFQ4H-BzPq1Ioe.js} +1 -1
- package/dist/public/assets/{architectureDiagram-YGSQEFNW--sVhMS03.js → architectureDiagram-YGSQEFNW-BsquO3a7.js} +1 -1
- package/dist/public/assets/{blockDiagram-APKKGZFW-8f9b-9k2.js → blockDiagram-APKKGZFW-BQNYOEP4.js} +1 -1
- package/dist/public/assets/{browser-DOHZ0JCf.js → browser-DS711n7Y.js} +1 -1
- package/dist/public/assets/{c4Diagram-KJ2TOQU5-CwYQ0Jfy.js → c4Diagram-KJ2TOQU5-D6e79Ycq.js} +1 -1
- package/dist/public/assets/{chunk-6MUBBAK2-7Y9ezehi.js → chunk-6MUBBAK2-B-sgaPoU.js} +1 -1
- package/dist/public/assets/{chunk-AXFCVDMN-CZIH4pWz.js → chunk-AXFCVDMN-D8pJKIg2.js} +1 -1
- package/dist/public/assets/{chunk-BG4553SI-DsNATY2m.js → chunk-BG4553SI-86TL-vCz.js} +1 -1
- package/dist/public/assets/{chunk-DQASFODM-CoXkfYE-.js → chunk-DQASFODM-CfUVuGjc.js} +1 -1
- package/dist/public/assets/{chunk-HFQBQIA3-C5OLqki8.js → chunk-HFQBQIA3-Drm0FEYk.js} +1 -1
- package/dist/public/assets/{chunk-KQLB2F66-DMHuYGEF.js → chunk-KQLB2F66-BVFRADlC.js} +1 -1
- package/dist/public/assets/{chunk-KS47KZWR-BKeOttO1.js → chunk-KS47KZWR-DfyALEmP.js} +1 -1
- package/dist/public/assets/{chunk-LEVMRMFU-D6zCwkk7.js → chunk-LEVMRMFU-DtJVzk2c.js} +1 -1
- package/dist/public/assets/{chunk-M57EVK23-B5-QqcZg.js → chunk-M57EVK23-DTy27PHQ.js} +1 -1
- package/dist/public/assets/{chunk-OY52VR5R-DQrq3n0T.js → chunk-OY52VR5R-nSgn7jZg.js} +1 -1
- package/dist/public/assets/{chunk-QB3YPZ4I-j6ZT7EDR.js → chunk-QB3YPZ4I-CkSxO_X6.js} +1 -1
- package/dist/public/assets/{chunk-R3KSYZAL-D5MXUO36.js → chunk-R3KSYZAL-Ck6iAjAL.js} +1 -1
- package/dist/public/assets/{chunk-STOXU5M4-DaBkw4dD.js → chunk-STOXU5M4-DQPHdSTh.js} +1 -1
- package/dist/public/assets/{chunk-TU62E6Q5-vXcRfGci.js → chunk-TU62E6Q5-Bc2AbV2Y.js} +1 -1
- package/dist/public/assets/{chunk-X4PVCEUW-CIh6H4Y2.js → chunk-X4PVCEUW-Cgpm0IXm.js} +1 -1
- package/dist/public/assets/{chunk-XXDRQBXY-C_Vwv1FM.js → chunk-XXDRQBXY-CGE4eLpg.js} +1 -1
- package/dist/public/assets/{classDiagram-v2-L25IHNXF-DccDWEJn.js → classDiagram-v2-L25IHNXF-4eQuDPEo.js} +1 -1
- package/dist/public/assets/{cose-bilkent-JH36ORCC-BX47lumZ.js → cose-bilkent-JH36ORCC-tDLCWq07.js} +1 -1
- package/dist/public/assets/cynefin-EF2NZ3EQ-Dd40W2Jh.js +1 -0
- package/dist/public/assets/{cynefinDiagram-L36ESFBY-BE6WOGxW.js → cynefinDiagram-L36ESFBY-ByqcZ8x9.js} +1 -1
- package/dist/public/assets/{d3-selection-ZcE6yRN5.js → d3-selection-Bgn1374-.js} +1 -1
- package/dist/public/assets/{dagre-SPEB5RXH-CE6SOOcN.js → dagre-SPEB5RXH-mCgr71mV.js} +1 -1
- package/dist/public/assets/{diagram-3B7GL73J-xC8VtiYL.js → diagram-3B7GL73J-DpYSwpQ0.js} +1 -1
- package/dist/public/assets/{diagram-DNEMPZML-4dmcBbjL.js → diagram-DNEMPZML-DMozUQzi.js} +1 -1
- package/dist/public/assets/{diagram-L3MUGCDN-D14Yn3sQ.js → diagram-L3MUGCDN-Bk5Uf8PD.js} +1 -1
- package/dist/public/assets/{diagram-LA4NIPWU-GxSXIhsK.js → diagram-LA4NIPWU-DFt5cPVK.js} +1 -1
- package/dist/public/assets/{diagram-MHCOC4E2-Cm7Prlpc.js → diagram-MHCOC4E2-BkZZcKqK.js} +1 -1
- package/dist/public/assets/{diagram-XPFHEONP-mkUnnKFu.js → diagram-XPFHEONP-HEY6kyyN.js} +1 -1
- package/dist/public/assets/{dist-acJS-BlA.js → dist-Bj2CrKn7.js} +1 -1
- package/dist/public/assets/{ebnfDiagram-UZSYDL2S-m77ua3UQ.js → ebnfDiagram-UZSYDL2S-D4JvYyVb.js} +1 -1
- package/dist/public/assets/{editor.api-CljTm-EQ.js → editor.api-BpJFzYbl.js} +1 -1
- package/dist/public/assets/{elk-XV6XMXQE-DsQY1hw9.js → elk-XV6XMXQE-CT6qLJkF.js} +1 -1
- package/dist/public/assets/{erDiagram-EYBAPDEH-CV8gJM0P.js → erDiagram-EYBAPDEH-BGng1goR.js} +1 -1
- package/dist/public/assets/{eventmodeling-K75KTNOO-C1pymbUr.js → eventmodeling-K75KTNOO-Tt8O-Q1Z.js} +1 -1
- package/dist/public/assets/flowDiagram-MALGAFMO-uFzenfA3.js +1 -0
- package/dist/public/assets/{freemarker2-DYJXaMHN.js → freemarker2-Dd5ksoRn.js} +1 -1
- package/dist/public/assets/{ganttDiagram-23REXITY-CppxOWRh.js → ganttDiagram-23REXITY-Jl8VO_g2.js} +1 -1
- package/dist/public/assets/gitGraph-VSP46ZUC-D28I_jUc.js +1 -0
- package/dist/public/assets/{gitGraphDiagram-STJD7YCW-CrQrZhcP.js → gitGraphDiagram-STJD7YCW-Be4qXALb.js} +1 -1
- package/dist/public/assets/{handlebars-DZCnH9e2.js → handlebars-4xabgUi4.js} +1 -1
- package/dist/public/assets/{html-DuzouNES.js → html-Dk3kt2w_.js} +1 -1
- package/dist/public/assets/{index-B7OYKvCE.js → index-Bx0c7eoh.js} +2 -2
- package/dist/public/assets/info-OHQRW6UA-5vIGEIq7.js +1 -0
- package/dist/public/assets/{infoDiagram-KBXO4MBG-6pby19tQ.js → infoDiagram-KBXO4MBG-Coc0tdwb.js} +1 -1
- package/dist/public/assets/{ishikawaDiagram-M35NCXHK-Duf8c8rQ.js → ishikawaDiagram-M35NCXHK-CE_1VQCg.js} +1 -1
- package/dist/public/assets/{javascript-2d_L6cVd.js → javascript-DKLGqy6v.js} +1 -1
- package/dist/public/assets/{journeyDiagram-OPLOXDXO-Dvv-xzNo.js → journeyDiagram-OPLOXDXO-CrolRZ_7.js} +1 -1
- package/dist/public/assets/{jsonMode-CFadYXyI.js → jsonMode-Chcs19_y.js} +1 -1
- package/dist/public/assets/{kanban-definition-BZKZHSQY-Dsk6F-TT.js → kanban-definition-BZKZHSQY-CjJj47De.js} +1 -1
- package/dist/public/assets/{liquid-Din4CF34.js → liquid-jff3p-Ji.js} +1 -1
- package/dist/public/assets/{mdx-DivDuCWI.js → mdx-DW4uRDfJ.js} +1 -1
- package/dist/public/assets/{mermaid-parser.core-BfCv4CYZ.js → mermaid-parser.core-XhQj6FvH.js} +3 -3
- package/dist/public/assets/{mermaid.core-DC20ZwJj.js → mermaid.core-OD4Atimg.js} +4 -4
- package/dist/public/assets/{mindmap-definition-I2QAS2VK-DRZRrJU_.js → mindmap-definition-I2QAS2VK-DpGelVY7.js} +1 -1
- package/dist/public/assets/module-CrD0OHQp.js +1 -0
- package/dist/public/assets/module-DEBMgdtf.js +2273 -0
- package/dist/public/assets/{monaco-D1d6MOPe.js → monaco-BTVZP-tU.js} +3 -3
- package/dist/public/assets/packet-JDAUHWVQ-CBxQ5Mzy.js +1 -0
- package/dist/public/assets/{pegDiagram-FD4XPPHP-DcGr3Tbk.js → pegDiagram-FD4XPPHP-CqcBmPfB.js} +1 -1
- package/dist/public/assets/phaser.esm-BxCDEWDb.js +3202 -0
- package/dist/public/assets/pie-XZMESJXO-DT5V3581.js +1 -0
- package/dist/public/assets/{pieDiagram-J4AKIIQI-GF7pu6ch.js → pieDiagram-J4AKIIQI-CRir3beB.js} +1 -1
- package/dist/public/assets/{python-BQbTTTT5.js → python-BwW_0207.js} +1 -1
- package/dist/public/assets/{quadrantDiagram-XTYBLID2-D-bcu7Ey.js → quadrantDiagram-XTYBLID2-DIY6gdcf.js} +1 -1
- package/dist/public/assets/radar-ABXABTNO-BAOovYEa.js +1 -0
- package/dist/public/assets/railroad-I3PHUGI6-RZ2Rnwzh.js +1 -0
- package/dist/public/assets/{railroad-abnf-LNEFI6M7-BiBHsI-K.js → railroad-abnf-LNEFI6M7-XWNOzunl.js} +1 -1
- package/dist/public/assets/{railroad-ebnf-DWYD2UWJ-zKjrfkHs.js → railroad-ebnf-DWYD2UWJ-CI0-j1Jz.js} +1 -1
- package/dist/public/assets/{railroad-peg-JR7BVNR7-DKuVn0GT.js → railroad-peg-JR7BVNR7-BVB_IaIG.js} +1 -1
- package/dist/public/assets/{railroadDiagram-MRQ6NCDL-Cyn-16mJ.js → railroadDiagram-MRQ6NCDL-CudwT6q2.js} +1 -1
- package/dist/public/assets/{razor-DiLk54O0.js → razor-DrjCyQqB.js} +1 -1
- package/dist/public/assets/{requirementDiagram-Y7LWUY3S-CwU2EBkW.js → requirementDiagram-Y7LWUY3S-CvRMeRqj.js} +1 -1
- package/dist/public/assets/{sankeyDiagram-WGJFYUXA-ajf00HyW.js → sankeyDiagram-WGJFYUXA-adxYCJKr.js} +1 -1
- package/dist/public/assets/{sequenceDiagram-5NDRBG5M-DiX_OIAw.js → sequenceDiagram-5NDRBG5M-lCRsoLUp.js} +1 -1
- package/dist/public/assets/{stateDiagram-v2-FJ4FJNEA-CV5bRqB7.js → stateDiagram-v2-FJ4FJNEA-DNst1BLg.js} +1 -1
- package/dist/public/assets/{swimlanes-UMQ2AFYF-BGQKSlj7.js → swimlanes-UMQ2AFYF-S_omrdvA.js} +1 -1
- package/dist/public/assets/swimlanesDiagram-OMPLPG4O-By5lnz4u.js +8 -0
- package/dist/public/assets/three.module-CeVBJVoU.js +4225 -0
- package/dist/public/assets/{timeline-definition-SEUHKTQE-DhQoApff.js → timeline-definition-SEUHKTQE-_pMGrTE-.js} +1 -1
- package/dist/public/assets/treeView-D4JQ5SDB-Cyb9N8KY.js +1 -0
- package/dist/public/assets/treemap-SAJKECNS-BkMo57pG.js +1 -0
- package/dist/public/assets/{typescript-COQ1g-up.js → typescript-0-z_OYCU.js} +1 -1
- package/dist/public/assets/{usecaseDiagram-AFA6YXN4-CmLFzjie.js → usecaseDiagram-AFA6YXN4-B2oJKi5Q.js} +1 -1
- package/dist/public/assets/{vennDiagram-NNMJR3RB-DOa6JR5K.js → vennDiagram-NNMJR3RB-inPs2Kkr.js} +1 -1
- package/dist/public/assets/wardley-7MLQ67FV-CSt-uQ-Y.js +1 -0
- package/dist/public/assets/{wardleyDiagram-S7YFUSEH-BV7EEShp.js → wardleyDiagram-S7YFUSEH-DNhNHM7b.js} +1 -1
- package/dist/public/assets/{xml-BbvtjuaG.js → xml-BXPxQzKF.js} +1 -1
- package/dist/public/assets/{xychartDiagram-GGNKY7IX-DtMpPbsq.js → xychartDiagram-GGNKY7IX-DJc93dNT.js} +1 -1
- package/dist/public/assets/{yaml-Bw8NFga9.js → yaml-CGmD9Rya.js} +1 -1
- package/dist/public/index.html +1 -1
- package/dist/serve/index.mjs +6664 -2480
- package/package.json +32 -25
- package/dist/public/assets/cynefin-EF2NZ3EQ-MaI-3dMQ.js +0 -1
- package/dist/public/assets/flowDiagram-MALGAFMO-shBnAQFk.js +0 -1
- package/dist/public/assets/gitGraph-VSP46ZUC-BtQWboBz.js +0 -1
- package/dist/public/assets/info-OHQRW6UA-CDSLjba_.js +0 -1
- package/dist/public/assets/module-BAQaY56j.js +0 -1
- package/dist/public/assets/module-DxRGg3ED.js +0 -1947
- package/dist/public/assets/packet-JDAUHWVQ-dYb4P9eU.js +0 -1
- package/dist/public/assets/pie-XZMESJXO-CIompBnc.js +0 -1
- package/dist/public/assets/radar-ABXABTNO-DiJl7BtK.js +0 -1
- package/dist/public/assets/railroad-I3PHUGI6-B5cRBukM.js +0 -1
- package/dist/public/assets/swimlanesDiagram-OMPLPG4O-DxXlavVT.js +0 -8
- package/dist/public/assets/treeView-D4JQ5SDB-BOP6mkZC.js +0 -1
- package/dist/public/assets/treemap-SAJKECNS-BJxuPMz3.js +0 -1
- package/dist/public/assets/wardley-7MLQ67FV-jqlowjVL.js +0 -1
|
@@ -0,0 +1,1224 @@
|
|
|
1
|
+
// web-src/i18n.ts
|
|
2
|
+
var EN = {
|
|
3
|
+
shareConversation: "Share conversation…",
|
|
4
|
+
share: "Share…",
|
|
5
|
+
shareTitle: "Share “{title}”",
|
|
6
|
+
sharesTitle: "My shares",
|
|
7
|
+
who: "Who can open it",
|
|
8
|
+
accessLink: "Anyone with the link",
|
|
9
|
+
accessPassword: "With a password",
|
|
10
|
+
accessSelf: "Only me",
|
|
11
|
+
accessPeople: "Ta friends",
|
|
12
|
+
accessPeopleShort: "Ta friends",
|
|
13
|
+
accessPeopleHint: "Opens only in their own Ta, which proves who it is: the link alone opens nothing. While this computer runs Ta.",
|
|
14
|
+
peopleNone: "No Ta friends yet: whoever is in a room with you (Rooms, under Discover) is one.",
|
|
15
|
+
peopleChoose: "Choose at least one.",
|
|
16
|
+
peopleOnly: "Only the Ta friends it was shared with open it, in their own Ta.",
|
|
17
|
+
peopleLine: "for {names}",
|
|
18
|
+
accessLinkShort: "Public",
|
|
19
|
+
accessPasswordShort: "Password",
|
|
20
|
+
accessSelfShort: "Only me",
|
|
21
|
+
accessSelfHint: "Opens only in your own Ta: this computer and the devices paired with it.",
|
|
22
|
+
password: "Password",
|
|
23
|
+
passwordPlaceholder: "At least 4 characters",
|
|
24
|
+
passwordShort: "The password needs at least 4 characters.",
|
|
25
|
+
generate: "Make one",
|
|
26
|
+
lasts: "Works for",
|
|
27
|
+
day1: "1 day",
|
|
28
|
+
day7: "7 days",
|
|
29
|
+
day30: "30 days",
|
|
30
|
+
forever: "Until stopped",
|
|
31
|
+
outputs: "Include the outputs of tools",
|
|
32
|
+
outputsHint: "Each cut to 4 KB. Without them, only what each call did.",
|
|
33
|
+
offline: "Opens while this computer is off",
|
|
34
|
+
offlineHint: "A copy, encrypted here, is kept on the relay for 30 days at most. The relay cannot read it.",
|
|
35
|
+
offlinePassword: "With a password, keeping it only on this computer is safer: a copy on the relay can be guessed at offline.",
|
|
36
|
+
makeLink: "Make the link",
|
|
37
|
+
making: "Making the link…",
|
|
38
|
+
preview: "What goes",
|
|
39
|
+
previewLoading: "Reading the conversation…",
|
|
40
|
+
stats: "{messages} messages · {tools} tool calls",
|
|
41
|
+
redacted: "{n} things that look like secrets are hidden",
|
|
42
|
+
images: "{n} images are left out",
|
|
43
|
+
outputsLeft: "The outputs of tools are left out",
|
|
44
|
+
nothing: "There is nothing to share in this conversation yet.",
|
|
45
|
+
you: "You",
|
|
46
|
+
ta: "Ta",
|
|
47
|
+
copy: "Copy link",
|
|
48
|
+
copied: "Copied",
|
|
49
|
+
copyPassword: "Copy password",
|
|
50
|
+
passwordApart: "The password is not in the link: tell it apart.",
|
|
51
|
+
send: "Send…",
|
|
52
|
+
stop: "Stop sharing",
|
|
53
|
+
stopTitle: "Stop sharing “{title}”?",
|
|
54
|
+
stopHint: "The link stops working at once, and the copy on the relay is deleted.",
|
|
55
|
+
stopped: "Stopped sharing",
|
|
56
|
+
until: "until {date}",
|
|
57
|
+
untilStopped: "until you stop it",
|
|
58
|
+
onlineOnly: "opens while this computer runs Ta",
|
|
59
|
+
offlineToo: "opens while this computer is off too",
|
|
60
|
+
selfOnly: "opens only in your own Ta",
|
|
61
|
+
qr: "QR code of the link",
|
|
62
|
+
linkReady: "Scan with the Ta app or a phone camera, or send the link. A browser shows it; the Ta app can import it.",
|
|
63
|
+
emptyTitle: "Nothing shared yet",
|
|
64
|
+
emptyHint: "Choose Share conversation… in the + of a message box, or ask Ta to make a link of a file.",
|
|
65
|
+
kindConversation: "Conversation",
|
|
66
|
+
kindFile: "File",
|
|
67
|
+
open: "Open",
|
|
68
|
+
opening: "Opening…",
|
|
69
|
+
passwordTitle: "This share needs a password",
|
|
70
|
+
passwordAsk: "The password is not in the link: ask the one who shared it.",
|
|
71
|
+
wrong: "That password is wrong.",
|
|
72
|
+
busy: "Too many wrong passwords. Try again in a few minutes.",
|
|
73
|
+
gone: "This link no longer works: the share was stopped or ran out.",
|
|
74
|
+
offlineHost: "The computer that shared it is not running Ta now. Try again later.",
|
|
75
|
+
self: "Only the one who shared this opens it, in their own Ta.",
|
|
76
|
+
invalid: "This is not a whole link of Ta.",
|
|
77
|
+
failed: "Cannot open it: {message}",
|
|
78
|
+
import: "Import as my conversation",
|
|
79
|
+
importing: "Importing…",
|
|
80
|
+
importInto: "Into {dir}",
|
|
81
|
+
changeDir: "Change",
|
|
82
|
+
imported: "Imported into {dir}",
|
|
83
|
+
sharedAt: "Shared {date}",
|
|
84
|
+
download: "Download {name}",
|
|
85
|
+
outputLabel: "Output",
|
|
86
|
+
errorLabel: "Error",
|
|
87
|
+
toolShare: "Share",
|
|
88
|
+
oldApp: "Update the Ta app to share from here.",
|
|
89
|
+
read: "Read",
|
|
90
|
+
write: "Write",
|
|
91
|
+
edit: "Edit",
|
|
92
|
+
run: "Run",
|
|
93
|
+
search: "Search",
|
|
94
|
+
find: "Find",
|
|
95
|
+
list: "List",
|
|
96
|
+
fetch: "Open",
|
|
97
|
+
webSearch: "Search the web",
|
|
98
|
+
script: "Run a script",
|
|
99
|
+
use: "Use {name}"
|
|
100
|
+
};
|
|
101
|
+
var ZH = {
|
|
102
|
+
shareConversation: "分享对话…",
|
|
103
|
+
share: "分享…",
|
|
104
|
+
shareTitle: "分享“{title}”",
|
|
105
|
+
sharesTitle: "我的分享",
|
|
106
|
+
who: "谁能打开",
|
|
107
|
+
accessLink: "拿到链接的人",
|
|
108
|
+
accessPassword: "凭口令",
|
|
109
|
+
accessSelf: "仅自己",
|
|
110
|
+
accessPeople: "指定的好友",
|
|
111
|
+
accessPeopleShort: "指定的好友",
|
|
112
|
+
accessPeopleHint: "只能在对方自己的 Ta 里打开,由 Ta 证明身份:光有链接打不开。这台电脑运行 Ta 时可以打开。",
|
|
113
|
+
peopleNone: "还没有 Ta 好友:和你在同一个房间里待过的人就是(发现 → 房间)。",
|
|
114
|
+
peopleChoose: "至少选一位。",
|
|
115
|
+
peopleOnly: "这条链接只给指定的 Ta 好友,请在他们自己的 Ta 里打开。",
|
|
116
|
+
peopleLine: "给{names}",
|
|
117
|
+
accessLinkShort: "公开",
|
|
118
|
+
accessPasswordShort: "口令",
|
|
119
|
+
accessSelfShort: "仅自己",
|
|
120
|
+
accessSelfHint: "只能在你自己的 Ta 里打开:这台电脑和配对过的设备。",
|
|
121
|
+
password: "口令",
|
|
122
|
+
passwordPlaceholder: "至少 4 个字符",
|
|
123
|
+
passwordShort: "口令至少要 4 个字符。",
|
|
124
|
+
generate: "随机生成",
|
|
125
|
+
lasts: "有效期",
|
|
126
|
+
day1: "1 天",
|
|
127
|
+
day7: "7 天",
|
|
128
|
+
day30: "30 天",
|
|
129
|
+
forever: "不过期",
|
|
130
|
+
outputs: "附上工具的输出",
|
|
131
|
+
outputsHint: "每条最多 4 KB。不附时只显示每一步做了什么。",
|
|
132
|
+
offline: "电脑关机也能打开",
|
|
133
|
+
offlineHint: "在这里加密后,把副本放在中继上,最长 30 天。中继看不到内容。",
|
|
134
|
+
offlinePassword: "带口令时建议只放在这台电脑上:中继上的副本可以被离线猜口令。",
|
|
135
|
+
makeLink: "生成链接",
|
|
136
|
+
making: "正在生成链接…",
|
|
137
|
+
preview: "将分享的内容",
|
|
138
|
+
previewLoading: "正在读取对话…",
|
|
139
|
+
stats: "{messages} 条消息 · {tools} 次工具调用",
|
|
140
|
+
redacted: "隐去了 {n} 处疑似密钥",
|
|
141
|
+
images: "去掉了 {n} 张图片",
|
|
142
|
+
outputsLeft: "不含工具的输出",
|
|
143
|
+
nothing: "这个对话里还没有可以分享的内容。",
|
|
144
|
+
you: "你",
|
|
145
|
+
ta: "Ta",
|
|
146
|
+
copy: "复制链接",
|
|
147
|
+
copied: "已复制",
|
|
148
|
+
copyPassword: "复制口令",
|
|
149
|
+
passwordApart: "口令不在链接里,请另外告诉对方。",
|
|
150
|
+
send: "发送…",
|
|
151
|
+
stop: "停止分享",
|
|
152
|
+
stopTitle: "停止分享“{title}”?",
|
|
153
|
+
stopHint: "链接立即失效,中继上的副本也会删除。",
|
|
154
|
+
stopped: "已停止分享",
|
|
155
|
+
until: "{date} 前有效",
|
|
156
|
+
untilStopped: "停止分享前一直有效",
|
|
157
|
+
onlineOnly: "这台电脑运行 Ta 时可打开",
|
|
158
|
+
offlineToo: "电脑关机也能打开",
|
|
159
|
+
selfOnly: "只能在你自己的 Ta 里打开",
|
|
160
|
+
qr: "链接的二维码",
|
|
161
|
+
linkReady: "用 Ta 应用或手机相机扫码,或者把链接发给对方。浏览器里能直接看,Ta 应用里还能导入。",
|
|
162
|
+
emptyTitle: "还没有分享",
|
|
163
|
+
emptyHint: "在输入框的 + 里选“分享对话…”,或者让 Ta 帮你把文件生成分享链接。",
|
|
164
|
+
kindConversation: "对话",
|
|
165
|
+
kindFile: "文件",
|
|
166
|
+
open: "打开",
|
|
167
|
+
opening: "正在打开…",
|
|
168
|
+
passwordTitle: "这个分享需要口令",
|
|
169
|
+
passwordAsk: "口令不在链接里,请向分享的人要。",
|
|
170
|
+
wrong: "口令不对。",
|
|
171
|
+
busy: "口令错得太多了,请过几分钟再试。",
|
|
172
|
+
gone: "这个链接已经失效:分享已停止或已过期。",
|
|
173
|
+
offlineHost: "分享的人的电脑现在没有运行 Ta,请稍后再试。",
|
|
174
|
+
self: "这是仅自己可见的分享,只有分享的人能在自己的 Ta 里打开。",
|
|
175
|
+
invalid: "这不是一个完整的 Ta 分享链接。",
|
|
176
|
+
failed: "打不开:{message}",
|
|
177
|
+
import: "导入为我的对话",
|
|
178
|
+
importing: "正在导入…",
|
|
179
|
+
importInto: "导入到 {dir}",
|
|
180
|
+
changeDir: "更换",
|
|
181
|
+
imported: "已导入到 {dir}",
|
|
182
|
+
sharedAt: "分享于 {date}",
|
|
183
|
+
download: "下载 {name}",
|
|
184
|
+
outputLabel: "输出",
|
|
185
|
+
errorLabel: "出错",
|
|
186
|
+
toolShare: "分享",
|
|
187
|
+
oldApp: "请更新 Ta 应用后再从这里分享。",
|
|
188
|
+
read: "读取",
|
|
189
|
+
write: "写入",
|
|
190
|
+
edit: "编辑",
|
|
191
|
+
run: "运行",
|
|
192
|
+
search: "搜索",
|
|
193
|
+
find: "查找",
|
|
194
|
+
list: "列出",
|
|
195
|
+
fetch: "打开网页",
|
|
196
|
+
webSearch: "搜索网页",
|
|
197
|
+
script: "运行脚本",
|
|
198
|
+
use: "使用 {name}"
|
|
199
|
+
};
|
|
200
|
+
var ShareWords;
|
|
201
|
+
((ShareWords) => {
|
|
202
|
+
function of(language) {
|
|
203
|
+
return language === "zh-CN" ? ZH : EN;
|
|
204
|
+
}
|
|
205
|
+
ShareWords.of = of;
|
|
206
|
+
function format(text, values) {
|
|
207
|
+
return text.replace(/\{(\w+)\}/g, (whole, key) => (key in values) ? String(values[key]) : whole);
|
|
208
|
+
}
|
|
209
|
+
ShareWords.format = format;
|
|
210
|
+
})(ShareWords ||= {});
|
|
211
|
+
|
|
212
|
+
// web-src/react.ts
|
|
213
|
+
var React;
|
|
214
|
+
function bind(react) {
|
|
215
|
+
React = react;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
// web-src/page.ts
|
|
219
|
+
var pi;
|
|
220
|
+
function bindPage(api) {
|
|
221
|
+
pi = api;
|
|
222
|
+
}
|
|
223
|
+
function t(key, values = {}) {
|
|
224
|
+
return ShareWords.format(ShareWords.of(pi.ui.language)[key], values);
|
|
225
|
+
}
|
|
226
|
+
function icon(name) {
|
|
227
|
+
return pi.ui.icons[name] ?? pi.ui.icons.Share2 ?? pi.ui.icons.Link;
|
|
228
|
+
}
|
|
229
|
+
function message(error) {
|
|
230
|
+
return error instanceof Error ? error.message : String(error);
|
|
231
|
+
}
|
|
232
|
+
function baseName(path) {
|
|
233
|
+
return path.replace(/[\\/]+$/, "").split(/[\\/]/).pop() || path;
|
|
234
|
+
}
|
|
235
|
+
function date(at) {
|
|
236
|
+
return new Date(at).toLocaleDateString(pi.ui.language === "zh-CN" ? "zh-CN" : undefined, { month: "short", day: "numeric", year: "numeric" });
|
|
237
|
+
}
|
|
238
|
+
var Host = {
|
|
239
|
+
preview: (sessionFile, options) => pi.callHost("preview", sessionFile, options),
|
|
240
|
+
shareConversation: (sessionFile, options) => pi.callHost("shareConversation", sessionFile, options),
|
|
241
|
+
shareFile: (title, type, data, options) => pi.callHost("shareFile", title, type, data, options),
|
|
242
|
+
list: () => pi.callHost("list"),
|
|
243
|
+
remove: (id) => pi.callHost("remove", id),
|
|
244
|
+
open: (link, password) => pi.callHost("open", link, password),
|
|
245
|
+
importConversation: (link, password, cwd) => pi.callHost("importConversation", link, password, cwd)
|
|
246
|
+
};
|
|
247
|
+
|
|
248
|
+
class ShareList {
|
|
249
|
+
shares;
|
|
250
|
+
listeners = new Set;
|
|
251
|
+
loading;
|
|
252
|
+
get() {
|
|
253
|
+
return this.shares;
|
|
254
|
+
}
|
|
255
|
+
subscribe(listener) {
|
|
256
|
+
this.listeners.add(listener);
|
|
257
|
+
return () => this.listeners.delete(listener);
|
|
258
|
+
}
|
|
259
|
+
load() {
|
|
260
|
+
this.loading ??= Host.list().then((shares) => this.set(shares)).catch(() => this.set(this.shares ?? [])).finally(() => {
|
|
261
|
+
this.loading = undefined;
|
|
262
|
+
});
|
|
263
|
+
return this.loading;
|
|
264
|
+
}
|
|
265
|
+
added(share) {
|
|
266
|
+
this.set([share, ...(this.shares ?? []).filter((other) => other.id !== share.id)]);
|
|
267
|
+
}
|
|
268
|
+
async remove(id) {
|
|
269
|
+
await Host.remove(id);
|
|
270
|
+
this.set((this.shares ?? []).filter((share) => share.id !== id));
|
|
271
|
+
}
|
|
272
|
+
set(shares) {
|
|
273
|
+
this.shares = shares;
|
|
274
|
+
for (const listener of this.listeners) {
|
|
275
|
+
listener();
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
var shares = new ShareList;
|
|
280
|
+
function useShares() {
|
|
281
|
+
const list = React.useSyncExternalStore((listener) => shares.subscribe(listener), () => shares.get());
|
|
282
|
+
React.useEffect(() => {
|
|
283
|
+
shares.load();
|
|
284
|
+
}, []);
|
|
285
|
+
return list;
|
|
286
|
+
}
|
|
287
|
+
function shareLine(share) {
|
|
288
|
+
const access = share.access === "people" ? t("peopleLine", { names: (share.people ?? []).join("、") }) : { link: t("accessLinkShort"), password: t("accessPasswordShort"), self: t("accessSelfShort") }[share.access];
|
|
289
|
+
const until = share.expiresAt ? t("until", { date: date(share.expiresAt) }) : t("untilStopped");
|
|
290
|
+
const where = share.access === "self" ? t("selfOnly") : share.offline ? t("offlineToo") : t("onlineOnly");
|
|
291
|
+
return [access, until, where].join(" · ");
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
// web-src/share-dialog.tsx
|
|
295
|
+
var DAYS = [1, 7, 30, 0];
|
|
296
|
+
function Choice({
|
|
297
|
+
value,
|
|
298
|
+
options,
|
|
299
|
+
onChange,
|
|
300
|
+
label
|
|
301
|
+
}) {
|
|
302
|
+
return /* @__PURE__ */ React.createElement("fieldset", {
|
|
303
|
+
className: "tsh-choice",
|
|
304
|
+
"aria-label": label
|
|
305
|
+
}, options.map((option) => /* @__PURE__ */ React.createElement("button", {
|
|
306
|
+
key: String(option.value),
|
|
307
|
+
type: "button",
|
|
308
|
+
"aria-pressed": option.value === value,
|
|
309
|
+
disabled: option.disabled,
|
|
310
|
+
className: option.value === value ? "tsh-on" : "",
|
|
311
|
+
onClick: () => onChange(option.value)
|
|
312
|
+
}, option.label)));
|
|
313
|
+
}
|
|
314
|
+
function Toggle({
|
|
315
|
+
checked,
|
|
316
|
+
onChange,
|
|
317
|
+
label,
|
|
318
|
+
hint,
|
|
319
|
+
disabled
|
|
320
|
+
}) {
|
|
321
|
+
const Switch = pi.ui.Switch;
|
|
322
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
323
|
+
className: `tsh-toggle${disabled ? " tsh-disabled" : ""}`
|
|
324
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
325
|
+
className: "tsh-toggle-text",
|
|
326
|
+
onClick: () => !disabled && onChange(!checked)
|
|
327
|
+
}, /* @__PURE__ */ React.createElement("span", null, label), hint && /* @__PURE__ */ React.createElement("small", null, hint)), Switch ? /* @__PURE__ */ React.createElement(Switch, {
|
|
328
|
+
checked,
|
|
329
|
+
onChange: (value) => onChange(value),
|
|
330
|
+
label,
|
|
331
|
+
disabled
|
|
332
|
+
}) : /* @__PURE__ */ React.createElement("input", {
|
|
333
|
+
type: "checkbox",
|
|
334
|
+
checked,
|
|
335
|
+
disabled,
|
|
336
|
+
"aria-label": label,
|
|
337
|
+
onChange: (event) => onChange(event.target.checked)
|
|
338
|
+
}));
|
|
339
|
+
}
|
|
340
|
+
function firstText(content) {
|
|
341
|
+
if (typeof content === "string") {
|
|
342
|
+
return content;
|
|
343
|
+
}
|
|
344
|
+
return (Array.isArray(content) ? content : []).flatMap((part) => part?.type === "text" && part.text ? [part.text] : []).join(" ");
|
|
345
|
+
}
|
|
346
|
+
function plain(text) {
|
|
347
|
+
return text.replace(/```[\s\S]*?(```|$)/g, " ").replace(/!?\[([^\]]*)\]\([^)]*\)/g, "$1").replace(/[*_~`#>|]+/g, "").replace(/\s+/g, " ").trim();
|
|
348
|
+
}
|
|
349
|
+
function PreviewBox({ preview, outputs }) {
|
|
350
|
+
if (!preview) {
|
|
351
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
352
|
+
className: "tsh-preview tsh-preview-wait"
|
|
353
|
+
}, t("previewLoading"));
|
|
354
|
+
}
|
|
355
|
+
const { conversation, stats } = preview;
|
|
356
|
+
const lines = (conversation?.messages ?? []).filter((item) => item.role !== "toolResult").map((item) => ({ role: item.role, text: plain(firstText(item.content)) })).filter((line) => line.text).slice(0, 6);
|
|
357
|
+
const tools = stats?.tools ?? conversation?.messages.reduce((count, item) => count + (item.role === "assistant" ? item.content.filter((part) => part.type === "toolCall").length : 0), 0) ?? 0;
|
|
358
|
+
const notes = [
|
|
359
|
+
stats?.redacted ? t("redacted", { n: stats.redacted }) : "",
|
|
360
|
+
stats?.images ? t("images", { n: stats.images }) : "",
|
|
361
|
+
outputs ? "" : t("outputsLeft")
|
|
362
|
+
].filter(Boolean);
|
|
363
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
364
|
+
className: "tsh-preview"
|
|
365
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
366
|
+
className: "tsh-preview-head"
|
|
367
|
+
}, /* @__PURE__ */ React.createElement("span", null, t("preview")), stats && /* @__PURE__ */ React.createElement("span", {
|
|
368
|
+
className: "tsh-muted"
|
|
369
|
+
}, t("stats", { messages: stats.messages, tools }))), lines.length > 0 && /* @__PURE__ */ React.createElement("ul", {
|
|
370
|
+
className: "tsh-lines"
|
|
371
|
+
}, lines.map((line, index) => /* @__PURE__ */ React.createElement("li", {
|
|
372
|
+
key: index,
|
|
373
|
+
className: line.role === "user" ? "tsh-line-user" : ""
|
|
374
|
+
}, /* @__PURE__ */ React.createElement("b", null, line.role === "user" ? t("you") : t("ta")), /* @__PURE__ */ React.createElement("span", null, line.text)))), notes.length > 0 && /* @__PURE__ */ React.createElement("p", {
|
|
375
|
+
className: "tsh-notes"
|
|
376
|
+
}, notes.join(" · ")));
|
|
377
|
+
}
|
|
378
|
+
function randomPassword() {
|
|
379
|
+
const letters = "abcdefghjkmnpqrstuvwxyz23456789";
|
|
380
|
+
const bytes = crypto.getRandomValues(new Uint8Array(8));
|
|
381
|
+
return Array.from(bytes, (byte) => letters[byte % letters.length]).join("");
|
|
382
|
+
}
|
|
383
|
+
function Made({ share, password, close }) {
|
|
384
|
+
const [copied, setCopied] = React.useState();
|
|
385
|
+
const [stopping, setStopping] = React.useState(false);
|
|
386
|
+
const copy = (text, what) => void navigator.clipboard?.writeText(text).then(() => setCopied(what));
|
|
387
|
+
const canSend = typeof navigator !== "undefined" && typeof navigator.share === "function";
|
|
388
|
+
const Copy = icon("Copy");
|
|
389
|
+
const Check = icon("Check");
|
|
390
|
+
const Send = icon("Share2");
|
|
391
|
+
const stop = async () => {
|
|
392
|
+
if (await pi.ui.confirm(t("stopTitle", { title: share.title }), t("stopHint"), { confirmLabel: t("stop"), danger: true })) {
|
|
393
|
+
setStopping(true);
|
|
394
|
+
try {
|
|
395
|
+
await shares.remove(share.id);
|
|
396
|
+
pi.ui.notify(t("stopped"));
|
|
397
|
+
close();
|
|
398
|
+
} catch (error) {
|
|
399
|
+
pi.ui.notify(message(error), "error");
|
|
400
|
+
setStopping(false);
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
};
|
|
404
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
405
|
+
className: "tsh-made"
|
|
406
|
+
}, share.access !== "self" && pi.ui.QrCode && /* @__PURE__ */ React.createElement("div", {
|
|
407
|
+
className: "tsh-qr"
|
|
408
|
+
}, /* @__PURE__ */ React.createElement(pi.ui.QrCode, {
|
|
409
|
+
text: share.link,
|
|
410
|
+
label: t("qr")
|
|
411
|
+
})), /* @__PURE__ */ React.createElement("p", {
|
|
412
|
+
className: "tsh-hint"
|
|
413
|
+
}, share.access === "self" ? t("accessSelfHint") : share.access === "people" ? t("accessPeopleHint") : t("linkReady")), /* @__PURE__ */ React.createElement("div", {
|
|
414
|
+
className: "tsh-link",
|
|
415
|
+
title: share.link
|
|
416
|
+
}, share.link), /* @__PURE__ */ React.createElement("p", {
|
|
417
|
+
className: "tsh-muted tsh-center"
|
|
418
|
+
}, shareLine(share)), password && /* @__PURE__ */ React.createElement("div", {
|
|
419
|
+
className: "tsh-password-note"
|
|
420
|
+
}, /* @__PURE__ */ React.createElement("span", null, t("passwordApart"), " ", /* @__PURE__ */ React.createElement("code", null, password)), /* @__PURE__ */ React.createElement("button", {
|
|
421
|
+
type: "button",
|
|
422
|
+
className: "ta-button",
|
|
423
|
+
onClick: () => copy(password, "password")
|
|
424
|
+
}, copied === "password" ? t("copied") : t("copyPassword"))), /* @__PURE__ */ React.createElement("div", {
|
|
425
|
+
className: "tsh-actions"
|
|
426
|
+
}, /* @__PURE__ */ React.createElement("button", {
|
|
427
|
+
type: "button",
|
|
428
|
+
className: "ta-button ta-primary",
|
|
429
|
+
onClick: () => copy(share.link, "link")
|
|
430
|
+
}, copied === "link" ? /* @__PURE__ */ React.createElement(Check, {
|
|
431
|
+
size: 14
|
|
432
|
+
}) : /* @__PURE__ */ React.createElement(Copy, {
|
|
433
|
+
size: 14
|
|
434
|
+
}), " ", copied === "link" ? t("copied") : t("copy")), canSend && share.access !== "self" && /* @__PURE__ */ React.createElement("button", {
|
|
435
|
+
type: "button",
|
|
436
|
+
className: "ta-button",
|
|
437
|
+
onClick: () => void navigator.share({ title: share.title, url: share.link }).catch(() => {
|
|
438
|
+
return;
|
|
439
|
+
})
|
|
440
|
+
}, /* @__PURE__ */ React.createElement(Send, {
|
|
441
|
+
size: 14
|
|
442
|
+
}), " ", t("send"))), /* @__PURE__ */ React.createElement("button", {
|
|
443
|
+
type: "button",
|
|
444
|
+
className: "tsh-stop",
|
|
445
|
+
disabled: stopping,
|
|
446
|
+
onClick: () => void stop()
|
|
447
|
+
}, t("stop")));
|
|
448
|
+
}
|
|
449
|
+
function useFriends() {
|
|
450
|
+
const [friends, setFriends] = React.useState();
|
|
451
|
+
React.useEffect(() => {
|
|
452
|
+
pi.rooms?.listFriends().then(setFriends).catch(() => {
|
|
453
|
+
return;
|
|
454
|
+
});
|
|
455
|
+
}, []);
|
|
456
|
+
return friends;
|
|
457
|
+
}
|
|
458
|
+
function FriendPicker({ friends, chosen, onChange }) {
|
|
459
|
+
if (friends.length === 0) {
|
|
460
|
+
return /* @__PURE__ */ React.createElement("small", {
|
|
461
|
+
className: "tsh-muted"
|
|
462
|
+
}, t("peopleNone"));
|
|
463
|
+
}
|
|
464
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
465
|
+
className: "tsh-friends"
|
|
466
|
+
}, friends.map((friend) => {
|
|
467
|
+
const on = chosen.includes(friend.id);
|
|
468
|
+
return /* @__PURE__ */ React.createElement("label", {
|
|
469
|
+
key: friend.id,
|
|
470
|
+
className: `tsh-friend${on ? " tsh-on" : ""}`
|
|
471
|
+
}, /* @__PURE__ */ React.createElement("input", {
|
|
472
|
+
type: "checkbox",
|
|
473
|
+
checked: on,
|
|
474
|
+
onChange: (event) => onChange(event.target.checked ? [...chosen, friend.id] : chosen.filter((id) => id !== friend.id))
|
|
475
|
+
}), /* @__PURE__ */ React.createElement("span", null, friend.name));
|
|
476
|
+
}), /* @__PURE__ */ React.createElement("small", {
|
|
477
|
+
className: "tsh-muted"
|
|
478
|
+
}, t("accessPeopleHint")));
|
|
479
|
+
}
|
|
480
|
+
function Options({ target, onMade }) {
|
|
481
|
+
const [access, setAccess] = React.useState("link");
|
|
482
|
+
const [password, setPassword] = React.useState("");
|
|
483
|
+
const [people, setPeople] = React.useState([]);
|
|
484
|
+
const friends = useFriends();
|
|
485
|
+
const [days, setDays] = React.useState(7);
|
|
486
|
+
const [outputs, setOutputs] = React.useState(false);
|
|
487
|
+
const [offline, setOffline] = React.useState(false);
|
|
488
|
+
const [preview, setPreview] = React.useState();
|
|
489
|
+
const [busy, setBusy] = React.useState(false);
|
|
490
|
+
const [error, setError] = React.useState();
|
|
491
|
+
React.useEffect(() => {
|
|
492
|
+
let live = true;
|
|
493
|
+
setPreview(undefined);
|
|
494
|
+
Host.preview(target.sessionFile, { outputs, title: target.title }).then((result) => live && setPreview({ conversation: JSON.parse(result.json), stats: result.stats }), () => live && setPreview({}));
|
|
495
|
+
return () => {
|
|
496
|
+
live = false;
|
|
497
|
+
};
|
|
498
|
+
}, [target.sessionFile, target.title, outputs]);
|
|
499
|
+
const self = access === "self";
|
|
500
|
+
const only = self || access === "people";
|
|
501
|
+
const make = async () => {
|
|
502
|
+
if (access === "password" && password.length < 4) {
|
|
503
|
+
setError(t("passwordShort"));
|
|
504
|
+
return;
|
|
505
|
+
}
|
|
506
|
+
if (access === "people" && people.length === 0) {
|
|
507
|
+
setError(t("peopleChoose"));
|
|
508
|
+
return;
|
|
509
|
+
}
|
|
510
|
+
setBusy(true);
|
|
511
|
+
setError(undefined);
|
|
512
|
+
try {
|
|
513
|
+
const result = await Host.shareConversation(target.sessionFile, {
|
|
514
|
+
access,
|
|
515
|
+
...access === "password" ? { password } : {},
|
|
516
|
+
...access === "people" ? { people } : {},
|
|
517
|
+
days: offline && days === 0 ? 30 : days,
|
|
518
|
+
offline: offline && !only,
|
|
519
|
+
outputs,
|
|
520
|
+
title: target.title
|
|
521
|
+
});
|
|
522
|
+
shares.added(result.share);
|
|
523
|
+
onMade(result, access === "password" ? password : undefined);
|
|
524
|
+
} catch (failure) {
|
|
525
|
+
setError(message(failure));
|
|
526
|
+
setBusy(false);
|
|
527
|
+
}
|
|
528
|
+
};
|
|
529
|
+
const empty = preview?.stats?.messages === 0;
|
|
530
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
531
|
+
className: "tsh-options"
|
|
532
|
+
}, /* @__PURE__ */ React.createElement(PreviewBox, {
|
|
533
|
+
preview,
|
|
534
|
+
outputs
|
|
535
|
+
}), /* @__PURE__ */ React.createElement("div", {
|
|
536
|
+
className: "tsh-field"
|
|
537
|
+
}, /* @__PURE__ */ React.createElement("span", {
|
|
538
|
+
className: "tsh-label"
|
|
539
|
+
}, t("who")), /* @__PURE__ */ React.createElement(Choice, {
|
|
540
|
+
label: t("who"),
|
|
541
|
+
value: access,
|
|
542
|
+
onChange: setAccess,
|
|
543
|
+
options: [
|
|
544
|
+
{ value: "link", label: t("accessLink") },
|
|
545
|
+
{ value: "password", label: t("accessPassword") },
|
|
546
|
+
...friends ? [{ value: "people", label: t("accessPeople") }] : [],
|
|
547
|
+
{ value: "self", label: t("accessSelf") }
|
|
548
|
+
]
|
|
549
|
+
}), self && /* @__PURE__ */ React.createElement("small", {
|
|
550
|
+
className: "tsh-muted"
|
|
551
|
+
}, t("accessSelfHint")), access === "people" && friends && /* @__PURE__ */ React.createElement(FriendPicker, {
|
|
552
|
+
friends,
|
|
553
|
+
chosen: people,
|
|
554
|
+
onChange: setPeople
|
|
555
|
+
}), access === "password" && /* @__PURE__ */ React.createElement("div", {
|
|
556
|
+
className: "tsh-password"
|
|
557
|
+
}, /* @__PURE__ */ React.createElement("input", {
|
|
558
|
+
className: "tsh-input",
|
|
559
|
+
type: "text",
|
|
560
|
+
autoComplete: "off",
|
|
561
|
+
spellCheck: false,
|
|
562
|
+
value: password,
|
|
563
|
+
placeholder: t("passwordPlaceholder"),
|
|
564
|
+
"aria-label": t("password"),
|
|
565
|
+
onChange: (event) => setPassword(event.target.value)
|
|
566
|
+
}), /* @__PURE__ */ React.createElement("button", {
|
|
567
|
+
type: "button",
|
|
568
|
+
className: "ta-button",
|
|
569
|
+
onClick: () => setPassword(randomPassword())
|
|
570
|
+
}, t("generate")))), /* @__PURE__ */ React.createElement("div", {
|
|
571
|
+
className: "tsh-field"
|
|
572
|
+
}, /* @__PURE__ */ React.createElement("span", {
|
|
573
|
+
className: "tsh-label"
|
|
574
|
+
}, t("lasts")), /* @__PURE__ */ React.createElement(Choice, {
|
|
575
|
+
label: t("lasts"),
|
|
576
|
+
value: offline && days === 0 ? 30 : days,
|
|
577
|
+
onChange: setDays,
|
|
578
|
+
options: DAYS.map((value) => ({ value, label: value === 0 ? t("forever") : t(`day${value}`), disabled: value === 0 && offline }))
|
|
579
|
+
})), /* @__PURE__ */ React.createElement(Toggle, {
|
|
580
|
+
checked: outputs,
|
|
581
|
+
onChange: setOutputs,
|
|
582
|
+
label: t("outputs"),
|
|
583
|
+
hint: t("outputsHint")
|
|
584
|
+
}), /* @__PURE__ */ React.createElement(Toggle, {
|
|
585
|
+
checked: offline && !only,
|
|
586
|
+
onChange: setOffline,
|
|
587
|
+
disabled: only,
|
|
588
|
+
label: t("offline"),
|
|
589
|
+
hint: access === "password" ? t("offlinePassword") : t("offlineHint")
|
|
590
|
+
}), (error || empty) && /* @__PURE__ */ React.createElement("p", {
|
|
591
|
+
className: "tsh-error"
|
|
592
|
+
}, error ?? t("nothing")), /* @__PURE__ */ React.createElement("div", {
|
|
593
|
+
className: "tsh-actions"
|
|
594
|
+
}, /* @__PURE__ */ React.createElement("button", {
|
|
595
|
+
type: "button",
|
|
596
|
+
className: `ta-button ta-primary${busy ? " ta-busy" : ""}`,
|
|
597
|
+
disabled: busy || empty,
|
|
598
|
+
onClick: () => void make()
|
|
599
|
+
}, busy ? t("making") : t("makeLink"))));
|
|
600
|
+
}
|
|
601
|
+
function ShareDialog({ target, close }) {
|
|
602
|
+
const [made, setMade] = React.useState(target.kind === "made" ? { share: target.share } : undefined);
|
|
603
|
+
const title = target.kind === "made" ? target.share.title : target.title;
|
|
604
|
+
return /* @__PURE__ */ React.createElement(pi.ui.Dialog, {
|
|
605
|
+
title: t("shareTitle", { title }),
|
|
606
|
+
onClose: close
|
|
607
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
608
|
+
className: "tsh-dialog"
|
|
609
|
+
}, made ? /* @__PURE__ */ React.createElement(Made, {
|
|
610
|
+
share: made.share,
|
|
611
|
+
password: made.password,
|
|
612
|
+
close
|
|
613
|
+
}) : target.kind === "conversation" && /* @__PURE__ */ React.createElement(Options, {
|
|
614
|
+
target,
|
|
615
|
+
onMade: (result, password) => setMade({ share: result.share, password })
|
|
616
|
+
})));
|
|
617
|
+
}
|
|
618
|
+
function openShareDialog(target) {
|
|
619
|
+
if (!pi.ui.custom) {
|
|
620
|
+
pi.ui.notify(t("oldApp"), "warning");
|
|
621
|
+
return;
|
|
622
|
+
}
|
|
623
|
+
pi.ui.custom(({ close }) => /* @__PURE__ */ React.createElement(ShareDialog, {
|
|
624
|
+
target,
|
|
625
|
+
close
|
|
626
|
+
}));
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
// web-src/share-protocol.ts
|
|
630
|
+
var SHARE_TOOL = "share_link";
|
|
631
|
+
var CONVERSATION_KIND = "ta-conversation";
|
|
632
|
+
var FILE_KIND = "file";
|
|
633
|
+
var ShareLink;
|
|
634
|
+
((ShareLink) => {
|
|
635
|
+
const LINK = /^https?:\/\/[^/\s#?]+\/s#v=1&\S+$/i;
|
|
636
|
+
function is(text) {
|
|
637
|
+
const kind = LINK.test(text.trim()) ? fragment(text).get("c") : "none";
|
|
638
|
+
return kind === null || kind === CONVERSATION_KIND || kind === FILE_KIND;
|
|
639
|
+
}
|
|
640
|
+
ShareLink.is = is;
|
|
641
|
+
function fragment(text) {
|
|
642
|
+
return new URLSearchParams(text.slice(text.indexOf("#") + 1));
|
|
643
|
+
}
|
|
644
|
+
function needsPassword(text) {
|
|
645
|
+
return fragment(text).get("p") === "1";
|
|
646
|
+
}
|
|
647
|
+
ShareLink.needsPassword = needsPassword;
|
|
648
|
+
})(ShareLink ||= {});
|
|
649
|
+
|
|
650
|
+
// web-src/shared-view.tsx
|
|
651
|
+
var SharedToolLine;
|
|
652
|
+
((SharedToolLine) => {
|
|
653
|
+
const VERBS = {
|
|
654
|
+
read: ["read", ["path", "file_path"]],
|
|
655
|
+
write: ["write", ["path", "file_path"]],
|
|
656
|
+
edit: ["edit", ["path", "file_path"]],
|
|
657
|
+
bash: ["run", ["command"], true],
|
|
658
|
+
grep: ["search", ["pattern"], true],
|
|
659
|
+
find: ["find", ["pattern", "path"]],
|
|
660
|
+
ls: ["list", ["path"]],
|
|
661
|
+
web_fetch: ["fetch", ["url"]],
|
|
662
|
+
web_search: ["webSearch", ["query"]],
|
|
663
|
+
codemode: ["script", []]
|
|
664
|
+
};
|
|
665
|
+
function of(name, args) {
|
|
666
|
+
const known = VERBS[name];
|
|
667
|
+
const pick = (keys) => keys.map((key) => args?.[key]).find((value) => typeof value === "string" && value);
|
|
668
|
+
if (known) {
|
|
669
|
+
return { verb: t(known[0]), target: pick(known[1]), code: known[2] };
|
|
670
|
+
}
|
|
671
|
+
return {
|
|
672
|
+
verb: t("use", { name }),
|
|
673
|
+
target: Object.values(args ?? {}).find((value) => typeof value === "string" && value.length < 200)
|
|
674
|
+
};
|
|
675
|
+
}
|
|
676
|
+
SharedToolLine.of = of;
|
|
677
|
+
})(SharedToolLine ||= {});
|
|
678
|
+
function words(content) {
|
|
679
|
+
return typeof content === "string" ? content : content.flatMap((part) => part.type === "text" ? [part.text] : []).join(`
|
|
680
|
+
`);
|
|
681
|
+
}
|
|
682
|
+
function ToolLine({ part, result }) {
|
|
683
|
+
const { verb, target, code } = SharedToolLine.of(part.name, part.arguments);
|
|
684
|
+
const output = result ? words(result.content).trim() : "";
|
|
685
|
+
const [open, setOpen] = React.useState(false);
|
|
686
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
687
|
+
className: "tsh-tool-wrap"
|
|
688
|
+
}, /* @__PURE__ */ React.createElement("button", {
|
|
689
|
+
type: "button",
|
|
690
|
+
className: `tsh-tool${result?.isError ? " tsh-failed" : ""}`,
|
|
691
|
+
disabled: !output,
|
|
692
|
+
"aria-expanded": output ? open : undefined,
|
|
693
|
+
onClick: () => setOpen(!open)
|
|
694
|
+
}, /* @__PURE__ */ React.createElement("span", {
|
|
695
|
+
className: "tsh-dot"
|
|
696
|
+
}), /* @__PURE__ */ React.createElement("span", {
|
|
697
|
+
className: "tsh-verb"
|
|
698
|
+
}, verb), target && /* @__PURE__ */ React.createElement("span", {
|
|
699
|
+
className: `tsh-target${code ? " tsh-code" : ""}`
|
|
700
|
+
}, target.split(`
|
|
701
|
+
`)[0])), open && output && /* @__PURE__ */ React.createElement("pre", {
|
|
702
|
+
className: "tsh-output"
|
|
703
|
+
}, output));
|
|
704
|
+
}
|
|
705
|
+
function SharedConversation({ conversation }) {
|
|
706
|
+
const results = React.useMemo(() => {
|
|
707
|
+
const map = new Map;
|
|
708
|
+
for (const item of conversation.messages) {
|
|
709
|
+
if (item.role === "toolResult") {
|
|
710
|
+
map.set(item.toolCallId, item);
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
return map;
|
|
714
|
+
}, [conversation]);
|
|
715
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
716
|
+
className: "tsh-conversation"
|
|
717
|
+
}, conversation.messages.map((item, index) => {
|
|
718
|
+
if (item.role === "user") {
|
|
719
|
+
const text = words(item.content).trim();
|
|
720
|
+
return text ? /* @__PURE__ */ React.createElement("div", {
|
|
721
|
+
key: index,
|
|
722
|
+
className: "tsh-user"
|
|
723
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
724
|
+
className: "tsh-bubble"
|
|
725
|
+
}, text)) : null;
|
|
726
|
+
}
|
|
727
|
+
if (item.role !== "assistant") {
|
|
728
|
+
return null;
|
|
729
|
+
}
|
|
730
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
731
|
+
key: index,
|
|
732
|
+
className: "tsh-ta"
|
|
733
|
+
}, item.content.map((part, at) => part.type === "text" && part.text.trim() ? /* @__PURE__ */ React.createElement("div", {
|
|
734
|
+
key: at,
|
|
735
|
+
className: "tsh-text"
|
|
736
|
+
}, /* @__PURE__ */ React.createElement(pi.ui.Markdown, {
|
|
737
|
+
text: part.text
|
|
738
|
+
})) : part.type === "toolCall" ? /* @__PURE__ */ React.createElement(ToolLine, {
|
|
739
|
+
key: at,
|
|
740
|
+
part,
|
|
741
|
+
result: results.get(part.id)
|
|
742
|
+
}) : null), item.errorMessage && /* @__PURE__ */ React.createElement("p", {
|
|
743
|
+
className: "tsh-error"
|
|
744
|
+
}, item.errorMessage));
|
|
745
|
+
}));
|
|
746
|
+
}
|
|
747
|
+
function SharedPage({ html, title }) {
|
|
748
|
+
const policy = "default-src 'none'; script-src 'unsafe-inline' 'unsafe-eval' https: data: blob:; style-src 'unsafe-inline' https: data:; img-src https: data: blob:; font-src https: data:; media-src https: data: blob:; connect-src 'none'; form-action 'none'";
|
|
749
|
+
const doc = `<meta http-equiv="Content-Security-Policy" content="${policy}">${html}`;
|
|
750
|
+
return /* @__PURE__ */ React.createElement("iframe", {
|
|
751
|
+
className: "tsh-frame",
|
|
752
|
+
title,
|
|
753
|
+
sandbox: "allow-scripts allow-popups",
|
|
754
|
+
referrerPolicy: "no-referrer",
|
|
755
|
+
srcDoc: doc
|
|
756
|
+
});
|
|
757
|
+
}
|
|
758
|
+
function bytesOf(data) {
|
|
759
|
+
const binary = atob(data.replace(/-/g, "+").replace(/_/g, "/"));
|
|
760
|
+
return Uint8Array.from(binary, (char) => char.charCodeAt(0));
|
|
761
|
+
}
|
|
762
|
+
function SharedFile({ content }) {
|
|
763
|
+
const bytes = React.useMemo(() => bytesOf(content.data), [content.data]);
|
|
764
|
+
const type = content.type ?? "application/octet-stream";
|
|
765
|
+
const url = React.useMemo(() => URL.createObjectURL(new Blob([bytes], { type })), [bytes, type]);
|
|
766
|
+
React.useEffect(() => () => URL.revokeObjectURL(url), [url]);
|
|
767
|
+
const text = () => new TextDecoder().decode(bytes);
|
|
768
|
+
if (/^text\/html\b/.test(type)) {
|
|
769
|
+
return /* @__PURE__ */ React.createElement(SharedPage, {
|
|
770
|
+
html: text(),
|
|
771
|
+
title: content.title
|
|
772
|
+
});
|
|
773
|
+
}
|
|
774
|
+
if (/^image\/(png|jpe?g|gif|webp|avif|bmp)$/.test(type)) {
|
|
775
|
+
return /* @__PURE__ */ React.createElement("img", {
|
|
776
|
+
className: "tsh-image",
|
|
777
|
+
src: url,
|
|
778
|
+
alt: content.title
|
|
779
|
+
});
|
|
780
|
+
}
|
|
781
|
+
if (/markdown/.test(type) || /\.(md|markdown)$/i.test(content.title)) {
|
|
782
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
783
|
+
className: "tsh-text tsh-doc"
|
|
784
|
+
}, /* @__PURE__ */ React.createElement(pi.ui.Markdown, {
|
|
785
|
+
text: text()
|
|
786
|
+
}));
|
|
787
|
+
}
|
|
788
|
+
if (/^text\/|json|xml|yaml|javascript|typescript|csv/.test(type)) {
|
|
789
|
+
return /* @__PURE__ */ React.createElement("pre", {
|
|
790
|
+
className: "tsh-plain"
|
|
791
|
+
}, text());
|
|
792
|
+
}
|
|
793
|
+
const Download = icon("Download");
|
|
794
|
+
return /* @__PURE__ */ React.createElement("a", {
|
|
795
|
+
className: "ta-button ta-primary tsh-download",
|
|
796
|
+
href: url,
|
|
797
|
+
download: content.title
|
|
798
|
+
}, /* @__PURE__ */ React.createElement(Download, {
|
|
799
|
+
size: 14
|
|
800
|
+
}), " ", t("download", { name: content.title }));
|
|
801
|
+
}
|
|
802
|
+
var FAILURE = {
|
|
803
|
+
password: "passwordTitle",
|
|
804
|
+
wrong: "wrong",
|
|
805
|
+
busy: "busy",
|
|
806
|
+
gone: "gone",
|
|
807
|
+
offline: "offlineHost",
|
|
808
|
+
self: "self",
|
|
809
|
+
people: "peopleOnly",
|
|
810
|
+
invalid: "invalid",
|
|
811
|
+
timeout: "offlineHost",
|
|
812
|
+
large: "gone"
|
|
813
|
+
};
|
|
814
|
+
function ImportBar({ link, password, title }) {
|
|
815
|
+
const shown = pi.ui.useCwd();
|
|
816
|
+
const [cwd, setCwd] = React.useState(shown);
|
|
817
|
+
const [picking, setPicking] = React.useState(false);
|
|
818
|
+
const [busy, setBusy] = React.useState(false);
|
|
819
|
+
const Download = icon("Download");
|
|
820
|
+
const run = async () => {
|
|
821
|
+
setBusy(true);
|
|
822
|
+
try {
|
|
823
|
+
const result = await Host.importConversation(link, password, cwd);
|
|
824
|
+
if (!result.ok) {
|
|
825
|
+
pi.ui.notify(t(FAILURE[result.reason] ?? "failed", { message: result.message }), "error");
|
|
826
|
+
return;
|
|
827
|
+
}
|
|
828
|
+
pi.ui.notify(t("imported", { dir: baseName(cwd) }));
|
|
829
|
+
await pi.switchSession(pi.server.openSession({ cwd, sessionFile: result.sessionFile }).then((info) => info.sessionId), { title, cwd, sessionFile: result.sessionFile });
|
|
830
|
+
} catch (error) {
|
|
831
|
+
pi.ui.notify(t("failed", { message: message(error) }), "error");
|
|
832
|
+
} finally {
|
|
833
|
+
setBusy(false);
|
|
834
|
+
}
|
|
835
|
+
};
|
|
836
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
837
|
+
className: "tsh-import"
|
|
838
|
+
}, /* @__PURE__ */ React.createElement("button", {
|
|
839
|
+
type: "button",
|
|
840
|
+
className: `ta-button ta-primary${busy ? " ta-busy" : ""}`,
|
|
841
|
+
disabled: busy,
|
|
842
|
+
onClick: () => void run()
|
|
843
|
+
}, /* @__PURE__ */ React.createElement(Download, {
|
|
844
|
+
size: 14
|
|
845
|
+
}), " ", busy ? t("importing") : t("import")), /* @__PURE__ */ React.createElement("span", {
|
|
846
|
+
className: "tsh-muted"
|
|
847
|
+
}, t("importInto", { dir: baseName(cwd) })), pi.ui.FolderPicker && /* @__PURE__ */ React.createElement("button", {
|
|
848
|
+
type: "button",
|
|
849
|
+
className: "tsh-link-button",
|
|
850
|
+
onClick: () => setPicking(true)
|
|
851
|
+
}, t("changeDir")), picking && /* @__PURE__ */ React.createElement(pi.ui.FolderPicker, {
|
|
852
|
+
initial: cwd,
|
|
853
|
+
onPick: (path) => {
|
|
854
|
+
setCwd(path);
|
|
855
|
+
setPicking(false);
|
|
856
|
+
},
|
|
857
|
+
onClose: () => setPicking(false)
|
|
858
|
+
}));
|
|
859
|
+
}
|
|
860
|
+
function SharedView({ link }) {
|
|
861
|
+
const [state, setState] = React.useState({ step: "loading" });
|
|
862
|
+
const [input, setInput] = React.useState("");
|
|
863
|
+
const open = React.useCallback(async (password) => {
|
|
864
|
+
setState({ step: "loading" });
|
|
865
|
+
try {
|
|
866
|
+
const result = await Host.open(link, password);
|
|
867
|
+
if (result.ok) {
|
|
868
|
+
setState({ step: "shown", content: result.content, password });
|
|
869
|
+
} else if (result.reason === "password" || password !== undefined && (result.reason === "wrong" || result.reason === "busy")) {
|
|
870
|
+
setState({ step: "password", error: result.reason === "password" ? undefined : t(FAILURE[result.reason]) });
|
|
871
|
+
} else {
|
|
872
|
+
setState({ step: "failed", text: t(FAILURE[result.reason] ?? "failed", { message: result.message }) });
|
|
873
|
+
}
|
|
874
|
+
} catch (error) {
|
|
875
|
+
setState({ step: "failed", text: t("failed", { message: message(error) }) });
|
|
876
|
+
}
|
|
877
|
+
}, [link]);
|
|
878
|
+
React.useEffect(() => {
|
|
879
|
+
open();
|
|
880
|
+
}, [open]);
|
|
881
|
+
if (state.step === "loading") {
|
|
882
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
883
|
+
className: "tsh-view tsh-center tsh-muted"
|
|
884
|
+
}, t("opening"));
|
|
885
|
+
}
|
|
886
|
+
if (state.step === "failed") {
|
|
887
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
888
|
+
className: "tsh-view"
|
|
889
|
+
}, /* @__PURE__ */ React.createElement(pi.ui.Empty, {
|
|
890
|
+
title: state.text,
|
|
891
|
+
tone: "error"
|
|
892
|
+
}));
|
|
893
|
+
}
|
|
894
|
+
if (state.step === "password") {
|
|
895
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
896
|
+
className: "tsh-view"
|
|
897
|
+
}, /* @__PURE__ */ React.createElement("form", {
|
|
898
|
+
className: "tsh-ask",
|
|
899
|
+
onSubmit: (event) => {
|
|
900
|
+
event.preventDefault();
|
|
901
|
+
if (input) {
|
|
902
|
+
open(input);
|
|
903
|
+
}
|
|
904
|
+
}
|
|
905
|
+
}, /* @__PURE__ */ React.createElement("h3", null, t("passwordTitle")), /* @__PURE__ */ React.createElement("p", {
|
|
906
|
+
className: "tsh-muted"
|
|
907
|
+
}, t("passwordAsk")), /* @__PURE__ */ React.createElement("div", {
|
|
908
|
+
className: "tsh-password"
|
|
909
|
+
}, /* @__PURE__ */ React.createElement("input", {
|
|
910
|
+
className: "tsh-input",
|
|
911
|
+
type: "password",
|
|
912
|
+
autoComplete: "off",
|
|
913
|
+
value: input,
|
|
914
|
+
"aria-label": t("password"),
|
|
915
|
+
placeholder: t("password"),
|
|
916
|
+
onChange: (event) => setInput(event.target.value)
|
|
917
|
+
}), /* @__PURE__ */ React.createElement("button", {
|
|
918
|
+
type: "submit",
|
|
919
|
+
className: "ta-button ta-primary",
|
|
920
|
+
disabled: !input
|
|
921
|
+
}, t("open"))), state.error && /* @__PURE__ */ React.createElement("p", {
|
|
922
|
+
className: "tsh-error"
|
|
923
|
+
}, state.error)));
|
|
924
|
+
}
|
|
925
|
+
const { content } = state;
|
|
926
|
+
if (content.kind === CONVERSATION_KIND) {
|
|
927
|
+
const conversation = JSON.parse(new TextDecoder().decode(bytesOf(content.data)));
|
|
928
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
929
|
+
className: "tsh-view"
|
|
930
|
+
}, /* @__PURE__ */ React.createElement("header", {
|
|
931
|
+
className: "tsh-head"
|
|
932
|
+
}, /* @__PURE__ */ React.createElement("h2", null, conversation.title || content.title), /* @__PURE__ */ React.createElement("p", {
|
|
933
|
+
className: "tsh-muted"
|
|
934
|
+
}, [conversation.place, t("sharedAt", { date: date(content.createdAt) })].filter(Boolean).join(" · ")), /* @__PURE__ */ React.createElement(ImportBar, {
|
|
935
|
+
link,
|
|
936
|
+
password: state.password,
|
|
937
|
+
title: conversation.title || content.title
|
|
938
|
+
})), /* @__PURE__ */ React.createElement(SharedConversation, {
|
|
939
|
+
conversation
|
|
940
|
+
}));
|
|
941
|
+
}
|
|
942
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
943
|
+
className: `tsh-view${/^text\/html\b/.test(content.type ?? "") ? " tsh-view-page" : ""}`
|
|
944
|
+
}, /* @__PURE__ */ React.createElement(SharedFile, {
|
|
945
|
+
content
|
|
946
|
+
}));
|
|
947
|
+
}
|
|
948
|
+
|
|
949
|
+
// web-src/shares-page.tsx
|
|
950
|
+
function kindIcon(share) {
|
|
951
|
+
if (share.kind === CONVERSATION_KIND) {
|
|
952
|
+
return "MessageSquareText";
|
|
953
|
+
}
|
|
954
|
+
if (share.kind === "ta-agent") {
|
|
955
|
+
return "Contact";
|
|
956
|
+
}
|
|
957
|
+
return /^text\/html\b/.test(share.type ?? "") ? "Globe" : /^image\//.test(share.type ?? "") ? "Image" : "FileText";
|
|
958
|
+
}
|
|
959
|
+
function ShareRow({ share }) {
|
|
960
|
+
const [copied, setCopied] = React.useState(false);
|
|
961
|
+
const [stopping, setStopping] = React.useState(false);
|
|
962
|
+
const touch = pi.ui.useDevice().touch;
|
|
963
|
+
const [menu, openMenu] = pi.ui.useContextMenu();
|
|
964
|
+
const Kind = icon(kindIcon(share));
|
|
965
|
+
const Copy = icon("Copy");
|
|
966
|
+
const Qr = icon("QrCode");
|
|
967
|
+
const Stop = icon("Trash2");
|
|
968
|
+
const show = () => openShareDialog({ kind: "made", share });
|
|
969
|
+
const copy = () => void navigator.clipboard?.writeText(share.link).then(() => {
|
|
970
|
+
setCopied(true);
|
|
971
|
+
if (touch) {
|
|
972
|
+
pi.ui.notify(t("copied"));
|
|
973
|
+
}
|
|
974
|
+
}).catch((error) => pi.ui.notify(message(error), "error"));
|
|
975
|
+
const stop = async () => {
|
|
976
|
+
if (await pi.ui.confirm(t("stopTitle", { title: share.title }), t("stopHint"), { confirmLabel: t("stop"), danger: true })) {
|
|
977
|
+
setStopping(true);
|
|
978
|
+
await shares.remove(share.id).catch((error) => {
|
|
979
|
+
pi.ui.notify(message(error), "error");
|
|
980
|
+
setStopping(false);
|
|
981
|
+
});
|
|
982
|
+
}
|
|
983
|
+
};
|
|
984
|
+
const items = [
|
|
985
|
+
[
|
|
986
|
+
{ key: "qr", label: t("qr"), icon: Qr, run: show },
|
|
987
|
+
{ key: "copy", label: t("copy"), icon: Copy, run: copy }
|
|
988
|
+
],
|
|
989
|
+
[{ key: "stop", label: t("stop"), icon: Stop, danger: true, disabled: stopping, run: () => void stop() }]
|
|
990
|
+
];
|
|
991
|
+
const content = /* @__PURE__ */ React.createElement("div", {
|
|
992
|
+
className: `tsh-row${stopping ? " ta-pending" : ""}`,
|
|
993
|
+
"aria-busy": stopping || undefined,
|
|
994
|
+
onContextMenu: (event) => openMenu(event, items)
|
|
995
|
+
}, /* @__PURE__ */ React.createElement("button", {
|
|
996
|
+
type: "button",
|
|
997
|
+
className: "tsh-row-main",
|
|
998
|
+
title: t("qr"),
|
|
999
|
+
onClick: show
|
|
1000
|
+
}, /* @__PURE__ */ React.createElement("span", {
|
|
1001
|
+
className: `tsh-tile tsh-tile-${share.access}`,
|
|
1002
|
+
"aria-hidden": "true"
|
|
1003
|
+
}, /* @__PURE__ */ React.createElement(Kind, {
|
|
1004
|
+
size: 18
|
|
1005
|
+
})), /* @__PURE__ */ React.createElement("span", {
|
|
1006
|
+
className: "tsh-row-text"
|
|
1007
|
+
}, /* @__PURE__ */ React.createElement("span", {
|
|
1008
|
+
className: "tsh-row-title"
|
|
1009
|
+
}, share.title), /* @__PURE__ */ React.createElement("span", {
|
|
1010
|
+
className: "tsh-row-line"
|
|
1011
|
+
}, shareLine(share)))), !touch && /* @__PURE__ */ React.createElement("div", {
|
|
1012
|
+
className: "tsh-row-actions"
|
|
1013
|
+
}, /* @__PURE__ */ React.createElement("button", {
|
|
1014
|
+
type: "button",
|
|
1015
|
+
className: "tsh-icon",
|
|
1016
|
+
title: copied ? t("copied") : t("copy"),
|
|
1017
|
+
"aria-label": t("copy"),
|
|
1018
|
+
onClick: copy
|
|
1019
|
+
}, /* @__PURE__ */ React.createElement(Copy, {
|
|
1020
|
+
size: 15
|
|
1021
|
+
})), /* @__PURE__ */ React.createElement("button", {
|
|
1022
|
+
type: "button",
|
|
1023
|
+
className: "tsh-icon tsh-danger",
|
|
1024
|
+
title: t("stop"),
|
|
1025
|
+
"aria-label": t("stop"),
|
|
1026
|
+
disabled: stopping,
|
|
1027
|
+
onClick: () => void stop()
|
|
1028
|
+
}, /* @__PURE__ */ React.createElement(Stop, {
|
|
1029
|
+
size: 15
|
|
1030
|
+
}))));
|
|
1031
|
+
const SwipeRow = pi.ui.SwipeRow;
|
|
1032
|
+
return /* @__PURE__ */ React.createElement("li", {
|
|
1033
|
+
className: "tsh-item"
|
|
1034
|
+
}, SwipeRow ? /* @__PURE__ */ React.createElement(SwipeRow, {
|
|
1035
|
+
actions: [{ key: "stop", label: t("stop"), danger: true, run: () => void stop() }]
|
|
1036
|
+
}, content) : content, menu);
|
|
1037
|
+
}
|
|
1038
|
+
function SharesPage() {
|
|
1039
|
+
const list = useShares();
|
|
1040
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
1041
|
+
className: "tsh-page"
|
|
1042
|
+
}, list === undefined ? pi.ui.Skeleton ? /* @__PURE__ */ React.createElement(pi.ui.Skeleton, {
|
|
1043
|
+
rows: 3
|
|
1044
|
+
}) : null : list.length === 0 ? /* @__PURE__ */ React.createElement(pi.ui.Empty, {
|
|
1045
|
+
title: t("emptyTitle"),
|
|
1046
|
+
hint: t("emptyHint")
|
|
1047
|
+
}) : /* @__PURE__ */ React.createElement("ul", {
|
|
1048
|
+
className: "tsh-rows"
|
|
1049
|
+
}, list.map((share) => /* @__PURE__ */ React.createElement(ShareRow, {
|
|
1050
|
+
key: share.id,
|
|
1051
|
+
share
|
|
1052
|
+
}))));
|
|
1053
|
+
}
|
|
1054
|
+
|
|
1055
|
+
// web-src/style.ts
|
|
1056
|
+
var STYLE = `
|
|
1057
|
+
.tsh-muted { color: var(--ta-muted); font-size: calc(12.5px * var(--ta-font-scale)); }
|
|
1058
|
+
.tsh-center { text-align: center; }
|
|
1059
|
+
.tsh-error { margin: 0; color: var(--ta-red); font-size: calc(12.5px * var(--ta-font-scale)); }
|
|
1060
|
+
.tsh-input { flex: 1; min-width: 0; height: 32px; padding: 0 10px; border: 1px solid var(--ta-border-field); border-radius: 8px; background: var(--ta-input); color: var(--ta-text); font: inherit; font-size: calc(13px * var(--ta-font-scale)); outline: none; }
|
|
1061
|
+
.tsh-input:focus { border-color: var(--ta-border-focus); }
|
|
1062
|
+
|
|
1063
|
+
/* The dialog. */
|
|
1064
|
+
.tsh-dialog { display: flex; flex-direction: column; gap: 14px; width: min(440px, calc(100vw - 48px)); }
|
|
1065
|
+
.tsh-options { display: flex; flex-direction: column; gap: 14px; }
|
|
1066
|
+
.tsh-preview { border: 1px solid var(--ta-border-muted); border-radius: 12px; background: var(--ta-raised); padding: 10px 12px; }
|
|
1067
|
+
.tsh-preview-wait { color: var(--ta-muted); font-size: calc(12.5px * var(--ta-font-scale)); }
|
|
1068
|
+
.tsh-preview-head { display: flex; justify-content: space-between; gap: 8px; font-size: calc(12.5px * var(--ta-font-scale)); font-weight: 500; }
|
|
1069
|
+
.tsh-lines { margin: 8px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; max-height: 132px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
|
|
1070
|
+
.tsh-lines li { display: flex; gap: 8px; min-width: 0; font-size: calc(12.5px * var(--ta-font-scale)); color: var(--ta-secondary); }
|
|
1071
|
+
.tsh-lines b { flex: none; width: 2.2em; font-weight: 500; color: var(--ta-muted); }
|
|
1072
|
+
.tsh-lines span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
1073
|
+
.tsh-line-user span { color: var(--ta-text); }
|
|
1074
|
+
.tsh-notes { margin: 8px 0 0; color: var(--ta-muted); font-size: calc(12px * var(--ta-font-scale)); }
|
|
1075
|
+
.tsh-field { display: flex; flex-direction: column; gap: 6px; }
|
|
1076
|
+
.tsh-label { font-size: calc(12.5px * var(--ta-font-scale)); font-weight: 500; color: var(--ta-secondary); }
|
|
1077
|
+
.tsh-choice { display: flex; margin: 0; border: 0; min-width: 0; padding: 2px; border-radius: 9px; background: var(--ta-segment); gap: 2px; }
|
|
1078
|
+
.tsh-choice button { flex: 1; min-width: 0; height: 28px; border: 0; border-radius: 7px; background: none; color: var(--ta-secondary); font: inherit; font-size: calc(12.5px * var(--ta-font-scale)); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: background 120ms, color 120ms; }
|
|
1079
|
+
.tsh-choice button:hover:not(:disabled) { color: var(--ta-text); }
|
|
1080
|
+
.tsh-choice button.tsh-on { background: var(--ta-card); color: var(--ta-text); font-weight: 500; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
|
|
1081
|
+
.tsh-choice button:disabled { opacity: .4; cursor: default; }
|
|
1082
|
+
.tsh-password { display: flex; gap: 8px; }
|
|
1083
|
+
.tsh-friends { display: flex; flex-wrap: wrap; gap: 6px; }
|
|
1084
|
+
.tsh-friends small { flex-basis: 100%; }
|
|
1085
|
+
.tsh-friend { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px 0 8px; border: 1px solid var(--ta-border-field); border-radius: 14px; font-size: calc(12.5px * var(--ta-font-scale)); cursor: pointer; }
|
|
1086
|
+
.tsh-friend.tsh-on { border-color: var(--ta-green); background: color-mix(in srgb, var(--ta-green) 10%, transparent); }
|
|
1087
|
+
.tsh-friend input { margin: 0; accent-color: var(--ta-green); }
|
|
1088
|
+
.tsh-toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
|
|
1089
|
+
.tsh-toggle-text { cursor: pointer; display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: calc(13px * var(--ta-font-scale)); }
|
|
1090
|
+
.tsh-toggle-text small { color: var(--ta-muted); font-size: calc(12px * var(--ta-font-scale)); line-height: 1.4; }
|
|
1091
|
+
.tsh-disabled { opacity: .5; }
|
|
1092
|
+
.tsh-actions { display: flex; justify-content: flex-end; gap: 8px; }
|
|
1093
|
+
.tsh-made { display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
|
|
1094
|
+
.tsh-made .tsh-actions { justify-content: center; }
|
|
1095
|
+
.tsh-qr { align-self: center; width: 188px; padding: 10px; border-radius: 14px; background: #fff; border: 1px solid var(--ta-border-muted); }
|
|
1096
|
+
.tsh-qr svg { display: block; width: 100%; height: auto; }
|
|
1097
|
+
.tsh-hint { margin: 0; text-align: center; color: var(--ta-secondary); font-size: calc(12.5px * var(--ta-font-scale)); line-height: 1.5; }
|
|
1098
|
+
.tsh-link { padding: 8px 10px; border-radius: 8px; background: var(--ta-code); font-family: var(--ta-mono); font-size: calc(11.5px * var(--ta-font-scale)); color: var(--ta-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
1099
|
+
.tsh-password-note { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 8px; background: var(--ta-raised); font-size: calc(12.5px * var(--ta-font-scale)); }
|
|
1100
|
+
.tsh-password-note code { font-family: var(--ta-mono); color: var(--ta-text); }
|
|
1101
|
+
.tsh-stop { align-self: center; border: 0; background: none; color: var(--ta-muted); font: inherit; font-size: calc(12.5px * var(--ta-font-scale)); cursor: pointer; padding: 4px 8px; border-radius: 6px; }
|
|
1102
|
+
.tsh-stop:hover { color: var(--ta-red); background: var(--ta-hover); }
|
|
1103
|
+
|
|
1104
|
+
/* My shares: the page fills its place and scrolls, its rows never wider than it. */
|
|
1105
|
+
.tsh-page { flex: 1; min-width: 0; min-height: 0; width: 100%; height: 100%; overflow-y: auto; box-sizing: border-box; padding: 12px 16px 32px; }
|
|
1106
|
+
.tsh-rows { max-width: 720px; margin: 0 auto; padding: 0; list-style: none; display: flex; flex-direction: column; }
|
|
1107
|
+
.tsh-item { --ta-swipe-bg: var(--ta-main); min-width: 0; border-radius: 10px; overflow: hidden; }
|
|
1108
|
+
.tsh-row { display: flex; align-items: center; gap: 4px; min-width: 0; padding-right: 6px; border-radius: 10px; transition: background 120ms, opacity 200ms; }
|
|
1109
|
+
.tsh-row:hover { background: var(--ta-hover); }
|
|
1110
|
+
.tsh-row-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 10px 8px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
|
|
1111
|
+
.tsh-tile { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 11px; color: #fff; background: var(--ta-green); }
|
|
1112
|
+
.tsh-tile-password { background: var(--ta-yellow); }
|
|
1113
|
+
.tsh-tile-self { background: var(--ta-blue); }
|
|
1114
|
+
.tsh-row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
|
|
1115
|
+
.tsh-row-title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
1116
|
+
.tsh-row-line { color: var(--ta-muted); font-size: calc(12px * var(--ta-font-scale)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
1117
|
+
.tsh-row-actions { flex: none; display: flex; gap: 2px; opacity: .75; }
|
|
1118
|
+
.tsh-row:hover .tsh-row-actions, .tsh-row:focus-within .tsh-row-actions { opacity: 1; }
|
|
1119
|
+
:root[data-touch] .tsh-row:hover { background: none; }
|
|
1120
|
+
:root[data-handheld] .tsh-item { border-radius: 0; }
|
|
1121
|
+
:root[data-touch] .tsh-row-main { padding: 12px 8px; }
|
|
1122
|
+
:root[data-touch] .tsh-row-main:active { background: var(--ta-hover); }
|
|
1123
|
+
.tsh-icon { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border: 0; border-radius: 8px; background: none; color: var(--ta-secondary); cursor: pointer; }
|
|
1124
|
+
.tsh-icon:hover:not(:disabled) { background: var(--ta-hover-strong); color: var(--ta-text); }
|
|
1125
|
+
.tsh-icon.tsh-danger:hover:not(:disabled) { color: var(--ta-red); }
|
|
1126
|
+
|
|
1127
|
+
/* What a link shares, in the workbench. */
|
|
1128
|
+
.tsh-view { height: 100%; overflow: auto; padding: 18px 20px 32px; box-sizing: border-box; }
|
|
1129
|
+
.tsh-view-page { padding: 0; overflow: hidden; }
|
|
1130
|
+
.tsh-view.tsh-center { padding-top: 22vh; }
|
|
1131
|
+
.tsh-head { margin: 0 auto 18px; max-width: 760px; }
|
|
1132
|
+
.tsh-head h2 { margin: 0 0 4px; font-size: calc(18px * var(--ta-font-scale)); line-height: 1.35; word-break: break-word; }
|
|
1133
|
+
.tsh-head p { margin: 0 0 12px; }
|
|
1134
|
+
.tsh-import { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; }
|
|
1135
|
+
.tsh-link-button { border: 0; background: none; padding: 2px 4px; color: var(--ta-link); font: inherit; font-size: calc(12.5px * var(--ta-font-scale)); cursor: pointer; }
|
|
1136
|
+
.tsh-conversation { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
|
|
1137
|
+
.tsh-user { display: flex; justify-content: flex-end; }
|
|
1138
|
+
.tsh-bubble { max-width: 85%; padding: 8px 13px; border-radius: 14px 14px 4px 14px; background: var(--ta-user); white-space: pre-wrap; word-break: break-word; }
|
|
1139
|
+
.tsh-ta { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
|
|
1140
|
+
.tsh-text { min-width: 0; word-break: break-word; }
|
|
1141
|
+
.tsh-doc { max-width: 760px; margin: 0 auto; }
|
|
1142
|
+
.tsh-tool-wrap { display: flex; flex-direction: column; }
|
|
1143
|
+
.tsh-tool { display: flex; align-items: baseline; gap: 8px; min-width: 0; max-width: 100%; padding: 2px 0; border: 0; background: none; color: var(--ta-muted); font: inherit; font-size: calc(13px * var(--ta-font-scale)); text-align: left; cursor: pointer; }
|
|
1144
|
+
.tsh-tool:disabled { cursor: default; }
|
|
1145
|
+
.tsh-dot { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--ta-green); transform: translateY(-2px); }
|
|
1146
|
+
.tsh-failed .tsh-dot { background: var(--ta-border-field); }
|
|
1147
|
+
.tsh-verb { flex: none; }
|
|
1148
|
+
.tsh-target { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ta-secondary); }
|
|
1149
|
+
.tsh-code { font-family: var(--ta-mono); font-size: calc(12px * var(--ta-font-scale)); }
|
|
1150
|
+
.tsh-output { margin: 4px 0 4px 14px; max-height: 260px; overflow: auto; padding: 8px 10px; border-radius: 8px; background: var(--ta-code); font-family: var(--ta-mono); font-size: calc(11.5px * var(--ta-font-scale)); white-space: pre-wrap; word-break: break-word; }
|
|
1151
|
+
.tsh-ask { max-width: 360px; margin: 12vh auto 0; display: flex; flex-direction: column; gap: 10px; text-align: center; }
|
|
1152
|
+
.tsh-ask h3 { margin: 0; font-size: calc(16px * var(--ta-font-scale)); }
|
|
1153
|
+
.tsh-ask p { margin: 0; }
|
|
1154
|
+
.tsh-frame { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
|
|
1155
|
+
.tsh-image { display: block; max-width: 100%; margin: 0 auto; border-radius: 10px; }
|
|
1156
|
+
.tsh-plain { margin: 0; padding: 12px 14px; border-radius: 10px; background: var(--ta-code); font-family: var(--ta-mono); font-size: calc(12px * var(--ta-font-scale)); white-space: pre-wrap; word-break: break-word; }
|
|
1157
|
+
.tsh-download { margin: 20vh auto 0; display: flex; width: fit-content; text-decoration: none; }
|
|
1158
|
+
@media (prefers-reduced-motion: reduce) { .tsh-row, .tsh-choice button { transition: none; } }
|
|
1159
|
+
`;
|
|
1160
|
+
function injectStyle() {
|
|
1161
|
+
const element = document.createElement("style");
|
|
1162
|
+
element.dataset.taPackage = "ta-share";
|
|
1163
|
+
element.textContent = STYLE;
|
|
1164
|
+
document.head.appendChild(element);
|
|
1165
|
+
return () => element.remove();
|
|
1166
|
+
}
|
|
1167
|
+
|
|
1168
|
+
// web-src/index.tsx
|
|
1169
|
+
function openLink(pi2, link) {
|
|
1170
|
+
const share = new URLSearchParams(link.slice(link.indexOf("#") + 1)).get("s") ?? link;
|
|
1171
|
+
pi2.ui.openEditor({ id: `ta-share:${share}`, title: () => t("share").replace("…", ""), icon: icon("Share2"), render: () => /* @__PURE__ */ React.createElement(SharedView, {
|
|
1172
|
+
link
|
|
1173
|
+
}) });
|
|
1174
|
+
}
|
|
1175
|
+
function activate(pi2) {
|
|
1176
|
+
bind(pi2.React);
|
|
1177
|
+
bindPage(pi2);
|
|
1178
|
+
const removeStyle = injectStyle();
|
|
1179
|
+
const Share = icon("Share2");
|
|
1180
|
+
pi2.registerComposerAddon({
|
|
1181
|
+
actions: (conversation) => conversation.sessionFile ? [
|
|
1182
|
+
{
|
|
1183
|
+
key: "share",
|
|
1184
|
+
label: t("shareConversation"),
|
|
1185
|
+
icon: /* @__PURE__ */ React.createElement(Share, {
|
|
1186
|
+
size: 16
|
|
1187
|
+
}),
|
|
1188
|
+
run: () => openShareDialog({
|
|
1189
|
+
kind: "conversation",
|
|
1190
|
+
sessionFile: conversation.sessionFile,
|
|
1191
|
+
title: conversation.title || t("kindConversation")
|
|
1192
|
+
})
|
|
1193
|
+
}
|
|
1194
|
+
] : []
|
|
1195
|
+
});
|
|
1196
|
+
pi2.registerSessionMenu?.((session) => session.sessionFile ? [
|
|
1197
|
+
{
|
|
1198
|
+
key: "share",
|
|
1199
|
+
label: t("share"),
|
|
1200
|
+
icon: Share,
|
|
1201
|
+
run: () => openShareDialog({ kind: "conversation", sessionFile: session.sessionFile, title: session.title })
|
|
1202
|
+
}
|
|
1203
|
+
] : []);
|
|
1204
|
+
pi2.registerOpener((link) => {
|
|
1205
|
+
if (link.type !== "url" || !ShareLink.is(link.url)) {
|
|
1206
|
+
return false;
|
|
1207
|
+
}
|
|
1208
|
+
openLink(pi2, link.url);
|
|
1209
|
+
return true;
|
|
1210
|
+
}, { specific: true });
|
|
1211
|
+
pi2.registerView("shares", { title: () => t("sharesTitle"), icon: Share, render: SharesPage, discover: true, order: 80 });
|
|
1212
|
+
pi2.registerToolRenderer((name, next) => name === SHARE_TOOL ? next() ?? {
|
|
1213
|
+
renderCall: (args) => ({
|
|
1214
|
+
verb: t("toolShare"),
|
|
1215
|
+
target: typeof args.path === "string" ? args.path : typeof args.title === "string" ? args.title : undefined
|
|
1216
|
+
})
|
|
1217
|
+
} : next());
|
|
1218
|
+
return () => {
|
|
1219
|
+
removeStyle();
|
|
1220
|
+
};
|
|
1221
|
+
}
|
|
1222
|
+
export {
|
|
1223
|
+
activate as default
|
|
1224
|
+
};
|