@celljs/ta-extensions 4.9.0 → 4.10.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/package.json +4 -4
- package/skills/ta-package/SKILL.md +7 -3
- package/web/index.js +269 -26
package/README.en.md
CHANGED
|
@@ -10,6 +10,8 @@ A built-in pi package for Ta (enabled by default, can be disabled in Settings
|
|
|
10
10
|
- Import: use the button, the page's top-right menu, or drag files to the page. In the dialog, select a `.tgz` file or enter an `npm:…` / Git address to install (`installPackage`, equivalent to `ta install`). After import, install, or remove, call `reloadExtensions` so the current session and page get the updates immediately.
|
|
11
11
|
- "Share with Others": export → send .tgz file → they import. A three-step diagram shows this flow, with a note explaining that npm, Git sources, or telling Ta directly also work.
|
|
12
12
|
- Each row and the page of a package of the marketplace have Share: the share dialog of Ta (a QR code, a link).
|
|
13
|
+
- Settings → Making extensions (`settings.tsx`, `registerSettings`): the model of the conversations that make or change an extension, kept as `makeModel` in the data of this package (`make-model.ts`); unset, the default model, and the default too, the user told why, when the one set cannot be used (its credentials went). Make and Change of the Extensions page, and Make an extension of a scheduled task, open their conversation on it.
|
|
14
|
+
- Make an extension in the + of the message box of every conversation (`composer.tsx`, `registerComposerAddon`): asks Ta, in that conversation, to make an extension of what it did, its inputs a form or buttons, its steps a command or a tool, its results a view that suits them. The conversation shows one line, the rest for the model is in a `<context>` block; while a reply runs, it waits its turn. With a model set for making extensions, the conversation is copied instead (`forkToFile`) and the copy goes on on that model, the conversation left as it was; the entry names the model. The box of a channel has it too ([@celljs/ta-channels](../ta-channels/README.en.md)), for its lead; the one of a scheduled task is [@celljs/ta-cron](../ta-cron/README.en.md)'s.
|
|
13
15
|
- The search of Quick open gets three sections from here (`search.ts`, `registerSearch`): Installed and Come with Ta, filtered in memory, and Marketplace, npm searched through the host a page at a time, with Install on those not installed.
|
|
14
16
|
- Extensions opened without installing are not listed under "Mine": Quick open installs or deletes them ([@celljs/ta-launcher](../ta-launcher/README.en.md)). The page of a package of the marketplace with a web extension has Open besides Install: its pages run at once as a temporary extension (`pi.openTemporary`), found in Quick open afterwards.
|
|
15
17
|
- "Marketplace" (`market-view.tsx`, `market-detail.tsx`): npm packages with the `pi-package` keyword—the ones listed in pi's official package directory.
|
|
@@ -27,4 +29,4 @@ A built-in pi package for Ta (enabled by default, can be disabled in Settings
|
|
|
27
29
|
- Extensions imported from files are placed only in the user's `extensions/`. To use one in a project, place the directory in the project's `.ta/extensions/` and commit it.
|
|
28
30
|
- Extensions run code on this machine. Before importing extensions from others, the page warns to only import from trusted sources, and the skill asks Ta to review it first and explain what it does. Marketplace installs are one-click (no approval prompts, following pi's practice); you can view the intro and source code at the bottom of the list or in the detail page.
|
|
29
31
|
- The marketplace only recognizes the official npm registry (search, manifests, and download counts at registry.npmjs.org). READMEs depend on jsDelivr or GitHub. If either is unreachable, the page shows why and offers "Retry"; this doesn't affect already-installed extensions. Installation still uses pi's npm, respecting your npm config.
|
|
30
|
-
- Most npm data is in English; Chinese searches won't find everything. Topic buttons use English keywords.
|
|
32
|
+
- Most npm data is in English; Chinese searches won't find everything. Topic buttons use English keywords.
|
package/README.md
CHANGED
|
@@ -15,6 +15,8 @@ Ta 自带的 pi 包(默认开启,可在 设置 → 扩展 关闭):告诉
|
|
|
15
15
|
- 点卡片进入详情页(`Esc` 或"返回"回到列表,滚动位置不变):头像、名称、说明、作者/版本/下载量/许可证/时间、安装或移除、npm/源代码/主页链接,`pi.video` / `pi.image` 预览,以及 README。带 Web 扩展的包还有"打开":不安装,作为临时扩展直接运行它的页面(`pi.openTemporary`,见 [@celljs/ta-launcher](../ta-launcher/README.md)),之后在"快捷打开"里找到它。
|
|
16
16
|
- 免安装打开的临时扩展不列在"我的"里,由"快捷打开"安装或删除。
|
|
17
17
|
- 每一行和市场详情页都有"分享":打开 Ta 的分享弹窗(二维码、链接)。
|
|
18
|
+
- 设置 → 做扩展(`settings.tsx`,`registerSettings`):做、改扩展的对话用哪个模型,存在本包数据的 `makeModel`(`make-model.ts`),不选就跟随默认模型;选的模型用不了时(凭据没了)改用默认模型并提示原因。扩展页的"做一个扩展""修改"、定时任务的"做成扩展"都按它开新对话。
|
|
19
|
+
- 每个对话输入框 + 菜单里的"做成扩展"(`composer.tsx`,`registerComposerAddon`):在这个对话里请 Ta 把对话做的事做成扩展,输入做成表单或按钮,步骤做成命令或工具,结果用合适的界面呈现。对话里只显示一句话,给模型的说明在 `<context>` 块里;回答进行中时排在它后面。设置了做扩展的模型时,改为把这个对话复制一份(`forkToFile`),在副本里用那个模型来做,原对话不动;菜单项的说明会写出模型。频道的输入框也有这个入口([@celljs/ta-channels](../ta-channels/README.md)),由负责人来做;定时任务的"做成扩展"见 [@celljs/ta-cron](../ta-cron/README.md)。
|
|
18
20
|
- 快捷打开的搜索里加了"已安装""内置""市场"三个分区(`search.ts`,`registerSearch`):前两个在内存里过滤,市场经服务端搜 npm、分页,未安装的有"安装"按钮。
|
|
19
21
|
- **服务端**(`pi.host`,`web-src/host.ts` → `host/index.mjs`):页面经 `callHost`(`TaPackageServer.callPackageHost`)调用。
|
|
20
22
|
- `exportPackage(id)`:把包目录打成一个 `.tgz`(gzip 的 tar,顶层是包目录,去掉 `node_modules`、`.git` 和链接),用 base64 交给页面下载。和 `tar -czf <名字>.tgz <名字>` 的格式相同,没有 Ta 也能用 `tar` 解开。
|
|
@@ -27,4 +29,4 @@ Ta 自带的 pi 包(默认开启,可在 设置 → 扩展 关闭):告诉
|
|
|
27
29
|
- 从文件导入的扩展只放进用户的 `extensions/`;要给一个项目用,把目录放进项目的 `.ta/extensions/` 并提交。
|
|
28
30
|
- 扩展会在本机运行代码:导入别人给的扩展前,页面提示只导入信任的来源,技能也要求 Ta 先读一遍再说明它做什么。市场的安装是一键的(照 pi 的做法不弹审批),列表底部和详情里都可以先看介绍和源代码。
|
|
29
31
|
- 市场只认 npm 官方源(搜索、清单、下载量都在 registry.npmjs.org),README 依赖 jsDelivr 或 GitHub;连不上时页面显示原因和"重试",不影响已安装的扩展。安装仍走 pi 的 npm 安装,遵循用户自己的 npm 配置。
|
|
30
|
-
- npm 的数据大多是英文,按中文搜不到;话题按钮用英文关键词。
|
|
32
|
+
- npm 的数据大多是英文,按中文搜不到;话题按钮用英文关键词。
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@celljs/ta-extensions",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.10.0",
|
|
4
4
|
"description": "A pi package for Ta: the page of extensions, where the user makes one by saying what it should do, and hands extensions on or takes them in as one file",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi-package"
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
"watch": "tsc -b -w --preserveWatchOutput"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@celljs/ta-harness": "4.
|
|
31
|
-
"@celljs/ta-protocol": "4.
|
|
32
|
-
"@celljs/ta-web": "4.
|
|
30
|
+
"@celljs/ta-harness": "4.10.0",
|
|
31
|
+
"@celljs/ta-protocol": "4.10.0",
|
|
32
|
+
"@celljs/ta-web": "4.10.0",
|
|
33
33
|
"@types/react": "^19.3.0"
|
|
34
34
|
},
|
|
35
35
|
"publishConfig": {
|
|
@@ -50,6 +50,7 @@ export default function (pi) {
|
|
|
50
50
|
- `registerTool({ name, description, parameters, execute(toolCallId, params) })`: a tool the model can call in the conversations the page opens, which runs in the browser; `parameters` is a JSON schema of an object; `execute` returns the text the model reads, or throws.
|
|
51
51
|
- `registerOpener(link => boolean)`: opens what links of replies point to: `{ type: 'file', cwd, path, selection? }` (`selection` is `{ startLine, startColumn?, endLine?, endColumn? }`, from 1), `{ type: 'directory', cwd, path }` or `{ type: 'url', url }`; return `true` when it opened it, else the next opener is asked. @celljs/ta-workspace opens files, directories and pages already; register one only for links the package shows its own way.
|
|
52
52
|
- `registerComposerAddon({ actions?(conversation), above?, subscribe?(listener) })`: adds to the message box of every conversation (the double's, an agent's, any other): `actions` gives a section of entries of its + menu (`{ key, label, icon?, detail?, run() }`, or `items` for a list shown in its place, entries with `checked` and `group`); `above` is a component drawn above the box with `{ conversation }`; `subscribe` tells the boxes to read `actions` again. `conversation` is `{ sessionId, sessionFile?, cwd?, kind: 'double' | 'chat', group?, title? }`.
|
|
53
|
+
- `registerSettings({ title, icon?, rows })`: a section of Ta's settings, after its own, for what the user sets once (a model the extension uses, a choice it makes); `rows` are `{ key, label, description?, render, stacked? }`, `render` the component of the control (beside the label, under it with `stacked`), its value kept with `storage`. Do not add one for what a page of the extension shows anyway.
|
|
53
54
|
- `on(type, handler)`: events of the conversation shown, as pi sends them (`agent_start`, `agent_end`, `message_end`, `tool_execution_end`, ...).
|
|
54
55
|
- `sendUserMessage(text)`: sends a message to the conversation shown as if the user typed it; `'/name args'` runs a command of a pi extension.
|
|
55
56
|
- `switchSession(sessionId, opening?)`: shows another open session of ta serve (an id of `server.listSessions()`) as the conversation; on a phone the drawer closes. Pass a promise of the id for a session still opening (`{ title, cwd }` in `opening` says what it is): it is in front at once, showing that it opens, so a click never waits on the server.
|
|
@@ -59,14 +60,15 @@ export default function (pi) {
|
|
|
59
60
|
- `ui.openEditor({ id, title, render, icon?, onClose? }, { preview?, preserveFocus? })`: a tab beside the conversation, for a file, a diff, a page or anything to read at length; opening an id that is open shows it again. With `preview` (a single click), the next preview takes its place until it is kept (`ui.pinEditor(id)`, or a double click on it). `ui.setEditorDirty(id, dirty)` marks it changed and not saved: the user is asked before it closes. `ui.closeEditor(id)` closes it; `onClose` runs when the user does. `ui.useActiveEditor()`: a React hook, the id of the tab shown.
|
|
60
61
|
- `ui.CodeEditor` (`{ path, value, readOnly?, line?, column?, endColumn?, selection?, onChange?, onSave? }`; `selection`, `{ startLine, startColumn?, endLine?, endColumn? }`, selects those lines and shows them in the middle) and `ui.DiffEditor` (`{ path, original, modified, inline?, readOnly?, onChange?, onSave?, onDiff? }`): Monaco, bundled with the page, for the text of a file and the change between two texts.
|
|
61
62
|
- `ui.createTerminal({ cols?, rows?, cwd? })`: a terminal as VS Code's (xterm.js on WebGL, in the page's theme), loaded the first time one is made; URLs and paths of files in it (`src/a.ts:10:5`) open with Cmd or Ctrl + click, paths from `cwd` or the directory the shell reports (OSC 7): `write(data)` the program's output, `onData(listener)` what the user types, `onResize(listener)` its new size in characters, `attach(element)` shows it in an element with a size and `position: relative` (returns the function that takes it out; it keeps its screen meanwhile), `focus()`, `dispose()`. `pi.terminals` runs a shell of the server behind it.
|
|
62
|
-
- `ui.useCwd()`: a React hook, the directory of the conversation shown. `ui.useSessionId()`: the session of the conversation shown.
|
|
63
|
+
- `ui.useCwd()`: a React hook, the directory of the conversation shown; the default directory while a page, Discover or the lists of a phone are in front. `ui.useSessionId()`: the session of the conversation shown.
|
|
63
64
|
- `ui.showView(id)`: shows a view of any extension by its id, a page in the main area or a workbench tool as its tab; `''` shows the conversation again. `ui.useView(id)`: a React hook, `{ title, location, shown, menu? }` while that view is loaded, else `undefined`.
|
|
64
65
|
- `ui.Composer`: the message box of every conversation, `{ placeholder?, onSend(text), mentions?, mentionLabel?, actions? }`: `mentions` (`{ name, detail? }[]`) is what `@` lists; `actions` are sections of its + menu, entries `{ key, label, icon?, detail?, insert? | run() }` (`insert` puts text at the caret). Use it for any conversation an extension shows, rather than a box of its own. `ui.Markdown` (`{ text }`) renders messages as the conversations do. `ui.Empty` (`{ title, hint?, compact?, tone?, picture?, children? }`) is what an empty list or view shows, as Ta's own lists: a short title without a full stop, at most one quieter hint, centered in its parent (a column of flex); `compact` in a menu, picker or dialog; `picture` above it where seeing what will be there helps (a first page, a list the user fills). Use it rather than text of your own. `ui.Picture` (`{ width?, height?, frame?, className?, children }`, 160 by 96 in a rounded frame unless told) is a small picture as Ta's own: draw a few `rect`, `circle`, `path` and `text` in it with the classes `ta-pic-pane` (a surface), `ta-pic-line` (a bar of text), `ta-pic-box` (an outline), `ta-pic-accent` (what it is about), `ta-pic-mark` (green), `ta-pic-soft` (half of it), `ta-pic-dot`, `ta-pic-bad` (red), `ta-pic-path` (a dashed way), `ta-pic-stroke` (a green line), `ta-pic-tick` (a line on green) and `ta-pic-text` (code), never colors of your own, so it follows the theme. `ui.PictureCards` (`{ cards, columns?, compactColumns? }`, cards `{ key, picture, label, hint?, title?, disabled?, onPick() }`) is a row of them to pick from, as the suggestions of an empty conversation. `ui.Dialog` (`{ title, onClose, children }`) is a dialog over the whole page, as Ta's own: use it to make or change things rather than a form in a sidebar.
|
|
65
|
-
- `ui.usePages()`: a React hook, every page there is (`{ id, extension, title, icon?, state, onOpen, place, usedAt?, source?, temporary? }`), what Quick open lists; `ui.stopExtension(name)` stops one that started on open, `ui.forgetPage(id)` takes one out of Recent. `openTemporary(source, 'link')` opens a package of npm or Git without installing it and shows its first page: ask the user first. `ui.useContextMenu()`: a React hook, `[menu, open]`: render `menu`, and call `open(event, sections)` from `onContextMenu` (a long press on a touch screen is one), sections of `{ key, label, icon?, disabled?, danger?, run }`. `ui.shareExtension({ title, source?, packageId? })` opens Ta's dialog that shares an extension (a link and its QR code), `ui.openShared(text)` opens such a link after asking, and `registerSearch({ key, title, order?, remote?, search(query, offset), subscribe? })` adds a section to the search of Quick open (entries `{ key, title, detail?, icon?, tint?, action?, open(), menu? }`). `ui.QrCode` (`{ text }`) draws a QR code; `ui.scanCode?.(instructions)`, only in the Ta app, scans one with the camera.
|
|
66
|
+
- `ui.usePages()`: a React hook, every page there is (`{ id, extension, title, icon?, state, onOpen, place, usedAt?, source?, temporary? }`), what Quick open lists; `ui.stopExtension(name)` stops one that started on open, `ui.forgetPage(id)` takes one out of Recent. `openTemporary(source, 'link')` opens a package of npm or Git without installing it and shows its first page: ask the user first. `ui.useContextMenu()`: a React hook, `[menu, open]`: render `menu`, and call `open(event, sections)` from `onContextMenu` (a long press on a touch screen is one), sections of `{ key, label, icon?, disabled?, danger?, run }`. `ui.shareExtension({ title, source?, packageId? })` opens Ta's dialog that shares an extension (a link and its QR code), `ui.openShared(text)` opens such a link after asking, and `registerSearch({ key, title, order?, remote?, search(query, offset), subscribe? })` adds a section to the search of Quick open (entries `{ key, title, detail?, icon?, tint?, action?, open(), menu? }`). `ui.QrCode` (`{ text }`) draws a QR code; `ui.ImageViewer` (`{ src, alt?, className?, onLoad?, onBackground? }`) shows a picture to zoom and drag, as the previews of the workbench do (it fills a column of flex); `ui.scanCode?.(instructions)`, only in the Ta app, scans one with the camera.
|
|
66
67
|
- `ui.Avatar`: Ta's avatar, the Cell logo, as a component `{ size?, mood?, mark? }`; `mark`, one or two characters, tells agents apart. Use it wherever Ta speaks, and draw Ta no other way.
|
|
67
68
|
- `ui.icons`: the lucide icons of the page by name (`Plus`, `Hash`, `Search`, `Files`, ...): a web extension cannot import them. Check for one before using it: the list only grows.
|
|
68
69
|
- `storage.get(key)` and `storage.set(key, value)`: small JSON values kept on the server for the package, so they stay across browsers and devices; setting `null` removes a key. A package keeps at most 4 MB there. `storage.onChange(keys => ...)` hears keys changed by other pages or the server. `storage.directory(cwd)` has the same methods for values of one directory (use `ui.useCwd()`), such as the folders open in a tree: keep there what belongs to a directory, and in `storage` what belongs to the user.
|
|
69
70
|
- `ui.theme` (`'light'` or `'dark'`) and `ui.language` (`'zh-CN'` or `'en-US'`): write the words of the extension in the language of the page.
|
|
71
|
+
- `files`: the bytes of a file, for what the page cannot load by URL. `files.byUrl` is false when the page is not served by ta serve itself (the app on a phone, a page through a relay): then a URL of `workspace.fileUrl` (an image, a page) does not load, and `files.read(url)` gives `{ type, size, data }` instead — over the WebSocket, sealed end to end. Use it for pictures and pages of the workspace that must show anywhere.
|
|
70
72
|
- The services of ta serve, for what the rest cannot do, all on its one connection: `server` (sessions: the commands of pi's RPC mode, `listSessions`, `openSession`, `prompt`, ...), `workspace` (files and programs of a directory: `listDirectory`, `readFile`, `writeFile`, `fileUrl`, `findFiles`, `runCommand`), `terminals` (`openTerminal`, `writeTerminal`, ...; output by `onTerminalData`) and `packages` (`listPackages`, `installPackage`, `removePackage`, and for temporary packages `openTemporaryPackage`, `updateTemporaryPackage`, `installTemporaryPackage`).
|
|
71
73
|
|
|
72
74
|
Look like the page: inherit its font, and use its colors through CSS variables, which follow the light and dark theme: `var(--ta-text)`, `var(--ta-secondary)`, `var(--ta-muted)`, `var(--ta-card)`, `var(--ta-raised)`, `var(--ta-border)`, `var(--ta-accent)`, `var(--ta-red)`. Radius 8px for controls. Write a font size in px as `calc(13px * var(--ta-font-scale))` (a line height in px too), so that it follows the font size of the settings; the messages of a conversation and its field carry the class `ta-conversation`, which adds the font size of conversations. Keep data the extension must remember with `pi.storage`; `localStorage` only for what belongs to one browser, under keys that start with the package name.
|
|
@@ -77,6 +79,8 @@ The two halves talk through the conversation: the web extension sends `/command
|
|
|
77
79
|
|
|
78
80
|
Ta comes with some packages of its own, which are on until the user turns them off in Settings → Extensions: `@celljs/ta-workspace` (the explorer, search, source control, terminals and browser beside the conversation), `@celljs/ta-channels` (agents and channels), `@celljs/ta-computer-use` (desktop apps through Cua Driver), `@celljs/ta-changes` (the files each reply changed, their diffs, and undo), `@celljs/ta-cron` (prompts that run on a schedule, with the Scheduled page, `/loop`, `/remind`, `/schedule` and the tool `schedule_task`), `@celljs/ta-bots` (bots of WeChat and WeCom connected to the double, an agent or a conversation, with the tool `bot_send_file`), `@celljs/ta-agents` (other coding agents such as CodeBuddy Code, Claude Code and Codex as models), `@celljs/ta-launcher` (Quick open: Recent and Mine, and links of extensions opened without installing) and `@celljs/ta-extensions` (this skill, and the Extensions page in the navigation, which lists the user's packages to change, export or remove and imports others). Do not copy or change them; build a new package for something new. The web page calls packages "extensions": use that word with the user.
|
|
79
81
|
|
|
82
|
+
A web extension can read and drive the scheduled tasks of `@celljs/ta-cron`, to show what a task finds in a page of its own: `pi.packages.callPackageHost('@celljs/ta-cron', method, params)` with `list` (the tasks: `{ id, name, prompt, schedule, cwd, enabled, nextRunAt?, lastRunAt?, lastStatus?, runCount, failCount }`), `get` `[id]`, `runs` `[id, limit?]` (newest first: `{ id, status, trigger, startedAt, endedAt?, summary?, error?, sessionFile? }`, `status` one of `running`, `success`, `error`, `missed`; `summary` is the last answer of the run, at most 4000 characters), `run` `[id]` (now; resolves once it started), `setEnabled` `[id, enabled]` and `update` `[id, patch]` (the fields of the update of `schedule_task`). Read them again when the page shows and every few seconds while a run is `running`; the task keeps its schedule, so the extension schedules nothing of its own.
|
|
83
|
+
|
|
80
84
|
Under `ta serve`, with `@celljs/ta-channels` on, you have tools to build a team for what the user wants: `create_agent` (a name and a role: another Ta with its own session), `create_channel` (agents, the lead first), `add_to_channel` (agents that exist, after the members; the lead stays), `post_to_channel` (a message; the agents it names with @ answer, or the lead, and they may hand on a few times) and `list_channels`. The agents run in ta serve, so they go on when the page closes. When the user asks for a team, for roles working together or for a review by several hands, create the agents and the channel and post the goal; do not write a package for it. In `ta` without `serve` the tools say they need `ta serve`: tell the user so.
|
|
81
85
|
|
|
82
86
|
## Hand on and take in
|
|
@@ -92,4 +96,4 @@ A package travels as one `.tgz` file: a gzipped tar of its directory, the direct
|
|
|
92
96
|
|
|
93
97
|
1. `node --check web.js` and, for the pi extension, read it once more against pi's documentation.
|
|
94
98
|
2. When your reply on the web page ends, the page loads new and changed web extensions and their tools, and reloads the pi extensions of its conversation. Otherwise the page loads them when it is shown again, and `/reload` reloads pi extensions in the terminal. Do not ask the user to restart anything.
|
|
95
|
-
3. Tell the user in one or two sentences what the package does and where it shows. No file listings unless asked.
|
|
99
|
+
3. Tell the user in one or two sentences what the package does and where it shows. No file listings unless asked.
|
package/web/index.js
CHANGED
|
@@ -40,6 +40,14 @@ var EN = {
|
|
|
40
40
|
placeholder: "Describe the extension, for example: a pomodoro timer beside the conversation",
|
|
41
41
|
makePrompt: "Make an extension: {text}",
|
|
42
42
|
changePrompt: "Change the extension {name} (in {root}): {text}",
|
|
43
|
+
fromChat: "Make an extension",
|
|
44
|
+
fromChatDetail: "Of what this conversation did",
|
|
45
|
+
fromChatAsk: "Make what this conversation did an extension, to do it again in a click",
|
|
46
|
+
fromChatModel: "In a new conversation, on {model}",
|
|
47
|
+
settingsTitle: "Making extensions",
|
|
48
|
+
modelLabel: "Model",
|
|
49
|
+
modelHint: "The new conversations that make or change an extension use it (the Extensions page, Make an extension of a scheduled task, and of a conversation, which then goes on in a copy of it); unset, the default model",
|
|
50
|
+
modelFailed: "The model for making extensions ({model}) cannot be used, so the default one is: {message}",
|
|
43
51
|
changeTitle: "Change {name}",
|
|
44
52
|
changePlaceholder: "What should it do differently?",
|
|
45
53
|
mine: "Yours",
|
|
@@ -89,6 +97,7 @@ var EN = {
|
|
|
89
97
|
change: "Change",
|
|
90
98
|
remove: "Remove",
|
|
91
99
|
copySource: "Copy the source",
|
|
100
|
+
more: "More",
|
|
92
101
|
copied: "Copied {source}",
|
|
93
102
|
removeTitle: "Remove {name}?",
|
|
94
103
|
removeDetail: "Its pages, cards and commands go with it.",
|
|
@@ -160,6 +169,14 @@ var ZH = {
|
|
|
160
169
|
placeholder: "描述你想要的扩展,例如:在对话旁放一个番茄钟",
|
|
161
170
|
makePrompt: "做一个扩展:{text}",
|
|
162
171
|
changePrompt: "修改扩展 {name}(在 {root}):{text}",
|
|
172
|
+
fromChat: "做成扩展",
|
|
173
|
+
fromChatDetail: "把这次对话做成工具",
|
|
174
|
+
fromChatAsk: "把这次对话做的事做成扩展,以后一键就能再用",
|
|
175
|
+
fromChatModel: "用 {model} 在新对话里做",
|
|
176
|
+
settingsTitle: "做扩展",
|
|
177
|
+
modelLabel: "模型",
|
|
178
|
+
modelHint: "扩展页和各处“做成扩展”开的对话用这个模型;不选就跟随默认模型",
|
|
179
|
+
modelFailed: "做扩展的模型({model})现在用不了,已改用默认模型:{message}",
|
|
163
180
|
changeTitle: "修改 {name}",
|
|
164
181
|
changePlaceholder: "想让它有什么不同?",
|
|
165
182
|
mine: "我的扩展",
|
|
@@ -209,6 +226,7 @@ var ZH = {
|
|
|
209
226
|
change: "修改",
|
|
210
227
|
remove: "移除",
|
|
211
228
|
copySource: "复制来源",
|
|
229
|
+
more: "更多",
|
|
212
230
|
copied: "已复制 {source}",
|
|
213
231
|
removeTitle: "移除扩展 {name}?",
|
|
214
232
|
removeDetail: "它的页面、卡片和命令也会一起移除。",
|
|
@@ -270,6 +288,36 @@ var ExtensionWords;
|
|
|
270
288
|
ExtensionWords.fill = fill;
|
|
271
289
|
})(ExtensionWords ||= {});
|
|
272
290
|
|
|
291
|
+
// web-src/make-model.ts
|
|
292
|
+
var MAKE_MODEL_KEY = "makeModel";
|
|
293
|
+
var MakeModel;
|
|
294
|
+
((MakeModel) => {
|
|
295
|
+
async function get(pi) {
|
|
296
|
+
const value = await pi.storage.get(MAKE_MODEL_KEY).catch(() => {
|
|
297
|
+
return;
|
|
298
|
+
});
|
|
299
|
+
return typeof value === "string" && value ? value : undefined;
|
|
300
|
+
}
|
|
301
|
+
MakeModel.get = get;
|
|
302
|
+
function set(pi, model) {
|
|
303
|
+
return pi.storage.set(MAKE_MODEL_KEY, model || null);
|
|
304
|
+
}
|
|
305
|
+
MakeModel.set = set;
|
|
306
|
+
async function open(pi, options) {
|
|
307
|
+
const model = await get(pi);
|
|
308
|
+
if (model) {
|
|
309
|
+
try {
|
|
310
|
+
return (await pi.server.openSession({ ...options, model })).sessionId;
|
|
311
|
+
} catch (error) {
|
|
312
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
313
|
+
pi.ui.notify(ExtensionWords.fill(ExtensionWords.of(pi.ui.language).modelFailed, { model, message }), "warning");
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
return (await pi.server.openSession(options)).sessionId;
|
|
317
|
+
}
|
|
318
|
+
MakeModel.open = open;
|
|
319
|
+
})(MakeModel ||= {});
|
|
320
|
+
|
|
273
321
|
// web-src/actions.ts
|
|
274
322
|
class PackagesStore {
|
|
275
323
|
pi;
|
|
@@ -434,7 +482,7 @@ class ExtensionActions {
|
|
|
434
482
|
async converse(text) {
|
|
435
483
|
await this.guard(async () => {
|
|
436
484
|
const { cwd } = await this.pi.server.getServerInfo();
|
|
437
|
-
const
|
|
485
|
+
const sessionId = await MakeModel.open(this.pi, { cwd });
|
|
438
486
|
await this.pi.switchSession(sessionId);
|
|
439
487
|
await this.pi.sendUserMessage(text);
|
|
440
488
|
});
|
|
@@ -450,6 +498,86 @@ class ExtensionActions {
|
|
|
450
498
|
}
|
|
451
499
|
}
|
|
452
500
|
|
|
501
|
+
// web-src/context.ts
|
|
502
|
+
function icon(pi, name, fallback = "Square") {
|
|
503
|
+
return pi.ui.icons[name] ?? pi.ui.icons[fallback] ?? (() => null);
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
// web-src/react.ts
|
|
507
|
+
var React;
|
|
508
|
+
function bind(react) {
|
|
509
|
+
React = react;
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
// web-src/composer.tsx
|
|
513
|
+
var ConversationExtension;
|
|
514
|
+
((ConversationExtension) => {
|
|
515
|
+
ConversationExtension.CONTEXT = [
|
|
516
|
+
"The user wants what was done in this conversation made into an extension of Ta, with the ta-package skill, kept in extensions/: a tool that does it again without it being explained again.",
|
|
517
|
+
"- Look back over the conversation for what is worth keeping: the task, the steps that worked, the inputs that change from one time to the next, and what came out.",
|
|
518
|
+
"- The inputs become a form or a few buttons, the steps a command or a tool of its pi extension (or a prompt it sends), and the results a view that suits them: a page, a card of the board, or the view of a message, rather than plain text.",
|
|
519
|
+
"- Leave out what was only tried and dropped. When the conversation holds nothing to make a tool of, say so and ask what the extension should do."
|
|
520
|
+
].join(`
|
|
521
|
+
`);
|
|
522
|
+
function message(language) {
|
|
523
|
+
return `<context>
|
|
524
|
+
${ConversationExtension.CONTEXT}
|
|
525
|
+
</context>
|
|
526
|
+
${ExtensionWords.of(language).fromChatAsk}`;
|
|
527
|
+
}
|
|
528
|
+
ConversationExtension.message = message;
|
|
529
|
+
})(ConversationExtension ||= {});
|
|
530
|
+
function composerAddon(pi) {
|
|
531
|
+
let model;
|
|
532
|
+
const listeners = new Set;
|
|
533
|
+
const read = () => void MakeModel.get(pi).then((next) => {
|
|
534
|
+
if (next !== model) {
|
|
535
|
+
model = next;
|
|
536
|
+
for (const listener of listeners) {
|
|
537
|
+
listener();
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
});
|
|
541
|
+
read();
|
|
542
|
+
pi.storage.onChange((keys) => keys.includes(MAKE_MODEL_KEY) && read());
|
|
543
|
+
const failed = (error) => pi.ui.notify(error instanceof Error ? error.message : String(error), "error");
|
|
544
|
+
const ask = () => ({ clientMessageId: `ta-extensions:conversation:${Date.now()}`, message: ConversationExtension.message(pi.ui.language) });
|
|
545
|
+
const send = async (conversation) => {
|
|
546
|
+
if (!await MakeModel.get(pi)) {
|
|
547
|
+
await pi.server.prompt(conversation.sessionId, { ...ask(), streamingBehavior: "followUp" });
|
|
548
|
+
return;
|
|
549
|
+
}
|
|
550
|
+
const cwd = conversation.cwd ?? (await pi.server.getServerInfo()).cwd;
|
|
551
|
+
const { entries } = await pi.server.getEntries(conversation.sessionId);
|
|
552
|
+
const last = entries.at(-1)?.id;
|
|
553
|
+
const { sessionFile } = last ? await pi.server.forkToFile(conversation.sessionId, last, "at") : { sessionFile: undefined };
|
|
554
|
+
const sessionId = MakeModel.open(pi, { cwd, sessionFile });
|
|
555
|
+
await pi.switchSession(sessionId, { title: ExtensionWords.of(pi.ui.language).fromChat, cwd });
|
|
556
|
+
await pi.server.prompt(await sessionId, ask());
|
|
557
|
+
};
|
|
558
|
+
return {
|
|
559
|
+
subscribe: (listener) => {
|
|
560
|
+
listeners.add(listener);
|
|
561
|
+
return () => listeners.delete(listener);
|
|
562
|
+
},
|
|
563
|
+
actions: (conversation) => {
|
|
564
|
+
const words = ExtensionWords.of(pi.ui.language);
|
|
565
|
+
const Sparkles = icon(pi, "Sparkles");
|
|
566
|
+
return [
|
|
567
|
+
{
|
|
568
|
+
key: "make-extension",
|
|
569
|
+
label: words.fromChat,
|
|
570
|
+
detail: model ? ExtensionWords.fill(words.fromChatModel, { model: model.slice(model.indexOf("/") + 1) }) : words.fromChatDetail,
|
|
571
|
+
icon: /* @__PURE__ */ React.createElement(Sparkles, {
|
|
572
|
+
size: 16
|
|
573
|
+
}),
|
|
574
|
+
run: () => void send(conversation).catch(failed)
|
|
575
|
+
}
|
|
576
|
+
];
|
|
577
|
+
}
|
|
578
|
+
};
|
|
579
|
+
}
|
|
580
|
+
|
|
453
581
|
// web-src/market-store.ts
|
|
454
582
|
class MarketStore {
|
|
455
583
|
pi;
|
|
@@ -672,6 +800,21 @@ var TaLocation;
|
|
|
672
800
|
return name || (remote === null || remote === undefined ? undefined : remote.host) || location;
|
|
673
801
|
}
|
|
674
802
|
TaLocation2.basename = basename;
|
|
803
|
+
function homeRelative(location) {
|
|
804
|
+
var _a;
|
|
805
|
+
const remote = parse(location);
|
|
806
|
+
const path2 = remote ? remote.path ? remote.path.slice(1) : "~" : location;
|
|
807
|
+
const match = /^~(?:[\\/]+(.*))?$/.exec(path2);
|
|
808
|
+
return match ? ((_a = match[1]) !== null && _a !== undefined ? _a : "").replace(/[\\/]+$/, "") : undefined;
|
|
809
|
+
}
|
|
810
|
+
TaLocation2.homeRelative = homeRelative;
|
|
811
|
+
function isAbsolute(location) {
|
|
812
|
+
if (homeRelative(location) !== undefined) {
|
|
813
|
+
return false;
|
|
814
|
+
}
|
|
815
|
+
return isRemote(location) || /^([\\/]|[A-Za-z]:)/.test(location);
|
|
816
|
+
}
|
|
817
|
+
TaLocation2.isAbsolute = isAbsolute;
|
|
675
818
|
function parentPath(path2) {
|
|
676
819
|
const trimmed = path2.replace(/[\\/]+$/, "");
|
|
677
820
|
const at = Math.max(trimmed.lastIndexOf("/"), trimmed.lastIndexOf("\\"));
|
|
@@ -738,6 +881,37 @@ ${message}`;
|
|
|
738
881
|
}
|
|
739
882
|
TaMessageContext2.strip = strip;
|
|
740
883
|
})(TaMessageContext || (TaMessageContext = {}));
|
|
884
|
+
var TaImageNote;
|
|
885
|
+
(function(TaImageNote2) {
|
|
886
|
+
const NOTE = /^\[Image: original \d+x\d+, displayed at \d+x\d+\. Multiply coordinates by [\d.]+ to map to original image\.\]$|^\[Image converted from [^\]]+ to [^\]]+\.\]$/;
|
|
887
|
+
function strip(text) {
|
|
888
|
+
const lines = text.split(`
|
|
889
|
+
`);
|
|
890
|
+
const kept = lines.filter((line) => !NOTE.test(line.trim()));
|
|
891
|
+
if (kept.length === lines.length) {
|
|
892
|
+
return text;
|
|
893
|
+
}
|
|
894
|
+
return kept.join(`
|
|
895
|
+
`).replace(/\n+$/, "").replace(/^\n+/, "");
|
|
896
|
+
}
|
|
897
|
+
TaImageNote2.strip = strip;
|
|
898
|
+
})(TaImageNote || (TaImageNote = {}));
|
|
899
|
+
var TaAgentSummary;
|
|
900
|
+
(function(TaAgentSummary2) {
|
|
901
|
+
const START = /^\s*<conversation_history_summary>/;
|
|
902
|
+
const BLOCK = /^\s*<conversation_history_summary>[\s\S]*?(?:<\/conversation_history_summary>\s*|$)/;
|
|
903
|
+
function read(text) {
|
|
904
|
+
if (!START.test(text)) {
|
|
905
|
+
return;
|
|
906
|
+
}
|
|
907
|
+
return text.replace(/<\/?(?:conversation_history_summary|summary)>/g, "").replace(/<\/?\w*$/, "").trim();
|
|
908
|
+
}
|
|
909
|
+
TaAgentSummary2.read = read;
|
|
910
|
+
function strip(text) {
|
|
911
|
+
return text.replace(BLOCK, "");
|
|
912
|
+
}
|
|
913
|
+
TaAgentSummary2.strip = strip;
|
|
914
|
+
})(TaAgentSummary || (TaAgentSummary = {}));
|
|
741
915
|
var TaSkillUse;
|
|
742
916
|
(function(TaSkillUse2) {
|
|
743
917
|
const BLOCK = /^<skill name="([^"]+)" location="([^"]+)">\n([\s\S]*?)\n<\/skill>(?:\n\n([\s\S]+))?$/;
|
|
@@ -771,17 +945,6 @@ var TaExcludedFiles;
|
|
|
771
945
|
TaExcludedFiles2.filter = filter;
|
|
772
946
|
})(TaExcludedFiles || (TaExcludedFiles = {}));
|
|
773
947
|
var TA_UPLOAD_PART_BYTES = 4 * 1024 * 1024;
|
|
774
|
-
// web-src/context.ts
|
|
775
|
-
function icon(pi, name, fallback = "Square") {
|
|
776
|
-
return pi.ui.icons[name] ?? pi.ui.icons[fallback] ?? (() => null);
|
|
777
|
-
}
|
|
778
|
-
|
|
779
|
-
// web-src/react.ts
|
|
780
|
-
var React;
|
|
781
|
-
function bind(react) {
|
|
782
|
-
React = react;
|
|
783
|
-
}
|
|
784
|
-
|
|
785
948
|
// web-src/import-dialog.tsx
|
|
786
949
|
function ImportDialog({ pi, actions, onClose }) {
|
|
787
950
|
const words = actions.words;
|
|
@@ -1792,24 +1955,46 @@ function ShareSteps({ pi, actions }) {
|
|
|
1792
1955
|
}
|
|
1793
1956
|
function PackageRow({ pi, actions, pkg }) {
|
|
1794
1957
|
const words = actions.words;
|
|
1958
|
+
const { touch, handheld } = pi.ui.useDevice();
|
|
1959
|
+
const [menu, openMenu] = pi.ui.useContextMenu();
|
|
1795
1960
|
const mine = pkg.origin === "directory";
|
|
1796
1961
|
const Icon = icon(pi, pkg.icon ?? (mine ? "Puzzle" : "PackageOpen"), mine ? "Puzzle" : "PackageOpen");
|
|
1962
|
+
const More = icon(pi, "Ellipsis");
|
|
1797
1963
|
const title = TaPackageTextUtil.pick(pkg.title, pi.ui.language) ?? pkg.name;
|
|
1798
1964
|
const summary = TaPackageTextUtil.pick(pkg.summary, pi.ui.language) ?? pkg.description;
|
|
1799
1965
|
const tags = [...pkg.resources.map((type) => words.kinds[type]), ...pkg.scope === "project" ? [words.project] : []];
|
|
1800
1966
|
const share = () => pi.ui.shareExtension({ title, source: mine ? undefined : pkg.source, packageId: pkg.id });
|
|
1967
|
+
const remove = { key: "remove", label: words.remove, icon: "Trash2", danger: true, run: () => actions.remove(pkg) };
|
|
1801
1968
|
const buttons = mine ? [
|
|
1802
1969
|
{ key: "change", label: words.change, icon: "Pencil", run: () => actions.change(pkg) },
|
|
1803
1970
|
{ key: "export", label: words.export, icon: "Download", run: () => actions.exportPackage(pkg) },
|
|
1804
1971
|
{ key: "share", label: words.share, icon: "QrCode", run: async () => share() },
|
|
1805
|
-
|
|
1972
|
+
remove
|
|
1806
1973
|
] : [
|
|
1807
1974
|
{ key: "copy", label: words.copySource, icon: "Copy", run: () => actions.copySource(pkg) },
|
|
1808
1975
|
{ key: "share", label: words.share, icon: "QrCode", run: async () => share() },
|
|
1809
|
-
|
|
1976
|
+
remove
|
|
1810
1977
|
];
|
|
1811
|
-
|
|
1812
|
-
|
|
1978
|
+
const item = (button) => ({
|
|
1979
|
+
key: button.key,
|
|
1980
|
+
label: button.label,
|
|
1981
|
+
icon: icon(pi, button.icon),
|
|
1982
|
+
danger: button.danger,
|
|
1983
|
+
run: () => void button.run()
|
|
1984
|
+
});
|
|
1985
|
+
const items = [buttons.filter((button) => button !== remove).map(item), [item(remove)]];
|
|
1986
|
+
const tagList = tags.map((tag) => /* @__PURE__ */ React.createElement("span", {
|
|
1987
|
+
key: tag,
|
|
1988
|
+
className: "tax-tag"
|
|
1989
|
+
}, tag));
|
|
1990
|
+
const description = summary || (mine ? undefined : pkg.source);
|
|
1991
|
+
const SwipeRow = pi.ui.SwipeRow;
|
|
1992
|
+
return /* @__PURE__ */ React.createElement(SwipeRow, {
|
|
1993
|
+
className: "tax-item",
|
|
1994
|
+
actions: [{ key: "remove", label: words.remove, danger: true, run: () => void remove.run() }]
|
|
1995
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
1996
|
+
className: `tax-row${pkg.enabled ? "" : " tax-off"}`,
|
|
1997
|
+
onContextMenu: (event) => openMenu(event, items)
|
|
1813
1998
|
}, /* @__PURE__ */ React.createElement("span", {
|
|
1814
1999
|
className: "tax-icon"
|
|
1815
2000
|
}, /* @__PURE__ */ React.createElement(Icon, {
|
|
@@ -1822,12 +2007,20 @@ function PackageRow({ pi, actions, pkg }) {
|
|
|
1822
2007
|
title: title === pkg.name ? undefined : pkg.name
|
|
1823
2008
|
}, title), pkg.version && /* @__PURE__ */ React.createElement("span", {
|
|
1824
2009
|
className: "tax-version"
|
|
1825
|
-
}, pkg.version), tags.
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
}, tag))), (summary || !mine) && /* @__PURE__ */ React.createElement("div", {
|
|
2010
|
+
}, pkg.version), !handheld && tagList), (description || handheld && tags.length > 0) && /* @__PURE__ */ React.createElement("div", {
|
|
2011
|
+
className: "tax-meta"
|
|
2012
|
+
}, handheld && tagList, description && /* @__PURE__ */ React.createElement("span", {
|
|
1829
2013
|
className: "tax-description"
|
|
1830
|
-
},
|
|
2014
|
+
}, description))), touch ? /* @__PURE__ */ React.createElement("button", {
|
|
2015
|
+
type: "button",
|
|
2016
|
+
className: "tax-action tax-more",
|
|
2017
|
+
title: words.more,
|
|
2018
|
+
"aria-label": words.more,
|
|
2019
|
+
"aria-haspopup": "menu",
|
|
2020
|
+
onClick: (event) => openMenu(event, items)
|
|
2021
|
+
}, /* @__PURE__ */ React.createElement(More, {
|
|
2022
|
+
size: 17
|
|
2023
|
+
})) : /* @__PURE__ */ React.createElement("div", {
|
|
1831
2024
|
className: "tax-actions"
|
|
1832
2025
|
}, buttons.map((button) => {
|
|
1833
2026
|
const ButtonIcon = icon(pi, button.icon);
|
|
@@ -1849,7 +2042,7 @@ function PackageRow({ pi, actions, pkg }) {
|
|
|
1849
2042
|
"aria-checked": pkg.enabled,
|
|
1850
2043
|
checked: pkg.enabled,
|
|
1851
2044
|
onChange: (event) => void actions.setEnabled(pkg, event.target.checked)
|
|
1852
|
-
}));
|
|
2045
|
+
})), menu);
|
|
1853
2046
|
}
|
|
1854
2047
|
|
|
1855
2048
|
// web-src/search.ts
|
|
@@ -1957,6 +2150,48 @@ function registerSearches(context) {
|
|
|
1957
2150
|
});
|
|
1958
2151
|
}
|
|
1959
2152
|
|
|
2153
|
+
// web-src/settings.tsx
|
|
2154
|
+
function ModelSetting({ pi }) {
|
|
2155
|
+
const [value, setValue] = React.useState("");
|
|
2156
|
+
React.useEffect(() => {
|
|
2157
|
+
let live = true;
|
|
2158
|
+
const read = () => void MakeModel.get(pi).then((model) => live && setValue(model ?? ""));
|
|
2159
|
+
read();
|
|
2160
|
+
const stop = pi.storage.onChange((keys) => keys.includes(MAKE_MODEL_KEY) && read());
|
|
2161
|
+
return () => {
|
|
2162
|
+
live = false;
|
|
2163
|
+
stop();
|
|
2164
|
+
};
|
|
2165
|
+
}, [pi]);
|
|
2166
|
+
const ModelPicker = pi.ui.ModelPicker;
|
|
2167
|
+
return /* @__PURE__ */ React.createElement(ModelPicker, {
|
|
2168
|
+
value,
|
|
2169
|
+
label: ExtensionWords.of(pi.ui.language).modelLabel,
|
|
2170
|
+
onChange: (model) => {
|
|
2171
|
+
setValue(model);
|
|
2172
|
+
MakeModel.set(pi, model).catch((error) => pi.ui.notify(error instanceof Error ? error.message : String(error), "error"));
|
|
2173
|
+
}
|
|
2174
|
+
});
|
|
2175
|
+
}
|
|
2176
|
+
function makeSettings(pi) {
|
|
2177
|
+
const words = () => ExtensionWords.of(pi.ui.language);
|
|
2178
|
+
return {
|
|
2179
|
+
title: () => words().settingsTitle,
|
|
2180
|
+
icon: icon(pi, "Sparkles", "Puzzle"),
|
|
2181
|
+
rows: [
|
|
2182
|
+
{
|
|
2183
|
+
key: "model",
|
|
2184
|
+
label: () => words().modelLabel,
|
|
2185
|
+
description: () => words().modelHint,
|
|
2186
|
+
stacked: true,
|
|
2187
|
+
render: () => /* @__PURE__ */ React.createElement(ModelSetting, {
|
|
2188
|
+
pi
|
|
2189
|
+
})
|
|
2190
|
+
}
|
|
2191
|
+
]
|
|
2192
|
+
};
|
|
2193
|
+
}
|
|
2194
|
+
|
|
1960
2195
|
// web-src/signal.ts
|
|
1961
2196
|
class Signal {
|
|
1962
2197
|
value;
|
|
@@ -2095,9 +2330,9 @@ var STYLE = `
|
|
|
2095
2330
|
.tax-button { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border: 1px solid var(--ta-border-muted); border-radius: 8px; background: var(--ta-raised); color: var(--ta-text); font: inherit; font-size: calc(13px * var(--ta-font-scale)); cursor: pointer; transition: background 120ms, border-color 120ms; }
|
|
2096
2331
|
.tax-button:hover { background: var(--ta-hover); border-color: var(--ta-border); }
|
|
2097
2332
|
.tax-button:disabled { opacity: .55; cursor: default; }
|
|
2098
|
-
.tax-list { border: 1px solid var(--ta-border-muted); border-radius: 12px; overflow: hidden; }
|
|
2333
|
+
.tax-list { --ta-swipe-bg: var(--ta-main); border: 1px solid var(--ta-border-muted); border-radius: 12px; overflow: hidden; }
|
|
2099
2334
|
.tax-row { position: relative; display: flex; align-items: center; gap: 12px; padding: 11px 14px; }
|
|
2100
|
-
.tax-
|
|
2335
|
+
.tax-item + .tax-item { border-top: 1px solid var(--ta-border-muted); }
|
|
2101
2336
|
.tax-row:hover { background: var(--ta-hover); }
|
|
2102
2337
|
.tax-row:hover .tax-icon, .tax-row:hover .tax-tag { background: var(--ta-hover-strong); }
|
|
2103
2338
|
.tax-icon { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; flex: none; border-radius: 9px; background: var(--ta-chip); color: var(--tax-accent); transition: color 160ms; }
|
|
@@ -2105,16 +2340,22 @@ var STYLE = `
|
|
|
2105
2340
|
.tax-name { display: flex; align-items: center; gap: 6px; min-width: 0; font-weight: 600; }
|
|
2106
2341
|
.tax-name > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
2107
2342
|
.tax-version { flex: none; color: var(--ta-muted); font-size: calc(12px * var(--ta-font-scale)); font-weight: 400; }
|
|
2108
|
-
.tax-
|
|
2343
|
+
.tax-meta { display: flex; align-items: center; gap: 6px; min-width: 0; }
|
|
2344
|
+
.tax-description { flex: 1; min-width: 0; overflow: hidden; color: var(--ta-secondary); font-size: calc(12.5px * var(--ta-font-scale)); text-overflow: ellipsis; white-space: nowrap; }
|
|
2109
2345
|
.tax-tag { flex: none; padding: 0 6px; border-radius: 5px; background: var(--ta-chip); color: var(--ta-muted); font-size: calc(11px * var(--ta-font-scale)); font-weight: 400; line-height: calc(17px * var(--ta-font-scale)); }
|
|
2110
2346
|
.tax-off .tax-main { opacity: .5; }
|
|
2111
2347
|
.tax-off .tax-icon { color: var(--ta-muted); }
|
|
2112
2348
|
.tax-actions { display: flex; gap: 2px; flex: none; opacity: 0; transition: opacity 120ms; }
|
|
2113
2349
|
.tax-row:hover .tax-actions, .tax-row:focus-within .tax-actions { opacity: 1; }
|
|
2114
|
-
@media (hover: none) { .tax-actions { opacity: 1; } }
|
|
2115
2350
|
.tax-action { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 7px; background: none; color: var(--ta-muted); cursor: pointer; }
|
|
2116
2351
|
.tax-action:hover { background: var(--ta-hover-strong); color: var(--ta-text); }
|
|
2117
2352
|
.tax-action.tax-danger:hover { color: var(--ta-red); }
|
|
2353
|
+
/* A finger: one … for the menu instead of a row of icons, and a target of a finger's size */
|
|
2354
|
+
.tax-more { flex: none; width: 36px; height: 36px; margin-right: -4px; }
|
|
2355
|
+
:root[data-handheld] .tax-body { gap: 24px; padding: 16px 12px 40px; }
|
|
2356
|
+
:root[data-handheld] .tax-row { gap: 10px; padding: 10px 12px; }
|
|
2357
|
+
:root[data-handheld] .tax-steps { gap: 4px; }
|
|
2358
|
+
:root[data-handheld] .tax-step { flex: 1; width: auto; min-width: 0; }
|
|
2118
2359
|
.tax-switch { appearance: none; -webkit-appearance: none; position: relative; width: 36px; height: 20px; flex: none; margin: 0 0 0 4px; border-radius: 10px; background: var(--ta-hover-strong); cursor: pointer; transition: background 160ms; }
|
|
2119
2360
|
.tax-switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform 180ms var(--ta-ease); }
|
|
2120
2361
|
.tax-switch:checked { background: var(--ta-green); }
|
|
@@ -2184,6 +2425,8 @@ function activate(pi) {
|
|
|
2184
2425
|
order: 90
|
|
2185
2426
|
});
|
|
2186
2427
|
registerSearches(context);
|
|
2428
|
+
pi.registerComposerAddon(composerAddon(pi));
|
|
2429
|
+
pi.registerSettings(makeSettings(pi));
|
|
2187
2430
|
pi.on("agent_end", () => void store.load());
|
|
2188
2431
|
return removeStyle;
|
|
2189
2432
|
}
|