@celljs/ta-cron 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 CHANGED
@@ -18,7 +18,7 @@ A pi package that comes with Ta (on by default; turn it off in Settings → Exte
18
18
  /schedule help
19
19
  ```
20
20
 
21
- Or just say "sum up yesterday's commits every day at 9": Ta makes the task with the tool `schedule_task`. The Scheduled page of the web client (under Discover by default; pin it there or under Settings > Navigation) lists every task with its rule, its next run and a switch; opened, its prompt and the summary of each run, and "Open conversation" goes to the conversation of that run. Tasks are made, edited, run and deleted there too; the dialog picks a task's model from a list with a search box (type part of its name, id or provider; arrows and Enter pick; the models with credentials in the settings of its directory, pi packages' such as other agents included) and its thinking level, or leaves the defaults of the settings.
21
+ Or just say "sum up yesterday's commits every day at 9": Ta makes the task with the tool `schedule_task`. The Scheduled page of the web client (under Discover by default; pin it there or under Settings > Navigation) lists every task with its rule, its next run and a switch, two lines a task on a phone; the switch moves as it is tapped, before the service answers. Opened, its prompt and the summary of each run, and "Open conversation" goes to the conversation of that run. The … of a task opens its menu (a right click or a hold does too): run it now, edit it, delete it. Tasks are made, edited, run and deleted there too; the dialog picks a task's model from a list with a search box (type part of its name, id or provider; arrows and Enter pick; the models with credentials in the settings of its directory, pi packages' such as other agents included) and its thinking level, or leaves the defaults of the settings. An opened task starts with Run now, Edit and Make an extension, its prompt shows four lines until "Show all", and the page scrolls in its own box, however long the summary of a run that is open. Make an extension opens a new conversation that asks Ta, with the ta-package skill, for an extension of the task: a page of its own that shows its results in a form that suits them (and a card of the board when that helps), where the user goes through past runs, runs it now and turns it on or off. The task keeps running here; the extension reads and drives it with `pi.packages.callPackageHost('@celljs/ta-cron', …)` (`list`, `get`, `runs`, `run`, `setEnabled`, `update`). The conversation shows one line; the task, its prompt and its last result are in a `<context>` block for the model (`web-src/task-extension.ts`), so that another coding agent without the tool `schedule_task` can make it too. The conversation is on the model of Settings → Making extensions (`makeModel` in the data of `@celljs/ta-extensions`), else the default.
22
22
 
23
23
  ## Time rules
24
24
 
@@ -45,4 +45,4 @@ Times are local to the machine of the Ta service. A command may end with `--name
45
45
 
46
46
  - Tasks run only while the Ta service runs (`ta serve`; Ta Desktop starts it); in `ta` in a terminal the commands and the tool say they need it.
47
47
  - A run's tools cannot be limited: it is a conversation like any other, with your settings and the project's extensions and skills.
48
- - No outside channels such as email or webhooks, and no export or import.
48
+ - No outside channels such as email or webhooks, and no export or import.
package/README.md CHANGED
@@ -18,7 +18,7 @@ Ta 自带的 pi 包(默认开启,可在 Web 客户端的 设置 → 扩展
18
18
  /schedule help
19
19
  ```
20
20
 
21
- 也可以直接说"每天 9 点帮我汇总昨天的提交":Ta 用工具 `schedule_task` 建任务。Web 客户端的"定时任务"页(默认收在"发现"里,可以在那里或 设置 → 导航 固定到导航栏)列出所有任务:时间规则、下次运行、开关,展开看提示词和每次运行的总结,点"打开对话"进入那次运行的对话;也能在这里新建、编辑、立即运行和删除;新建和编辑时从可搜索的列表里选这个任务用的模型(输入名字、模型 id 或提供方即可筛选,方向键和回车选择;任务所在目录的设置里有凭据的模型,包括 pi 包提供的,如外部 Agent)和思考级别,不选就用设置里的默认值。
21
+ 也可以直接说"每天 9 点帮我汇总昨天的提交":Ta 用工具 `schedule_task` 建任务。Web 客户端的"定时任务"页(默认收在"发现"里,可以在那里或 设置 → 导航 固定到导航栏)列出所有任务:时间规则、下次运行、开关(手机上每个任务两行),开关一点就动,不用等服务回答;展开看提示词和每次运行的总结,点"打开对话"进入那次运行的对话,任务右边的 … 是它的菜单(右键或长按也一样):立即运行、编辑、删除;也能在这里新建、编辑、立即运行和删除;新建和编辑时从可搜索的列表里选这个任务用的模型(输入名字、模型 id 或提供方即可筛选,方向键和回车选择;任务所在目录的设置里有凭据的模型,包括 pi 包提供的,如外部 Agent)和思考级别,不选就用设置里的默认值。展开的任务顶部是"立即运行""编辑"和"做成扩展",提示词先显示四行,"展开全文"看全部;页面在自己的区域里滚动,展开再长的运行总结也能滚到底。"做成扩展"开一个新对话,请 Ta 用 ta-package 技能为这个任务做一个扩展:按结果的特点做专属页面(需要时加一张小组件卡片),在里面看历史运行、立即运行、开关任务。任务仍由这里按时运行,扩展经 `pi.packages.callPackageHost('@celljs/ta-cron', …)` 读写它(`list`、`get`、`runs`、`run`、`setEnabled`、`update`);对话里只显示一句话,任务、提示词和最近一次结果放在给模型的 `<context>` 块里(`web-src/task-extension.ts`),没有 `schedule_task` 工具的外部 Agent 也能做。这个对话用 设置 → 做扩展 选的模型(`@celljs/ta-extensions` 的包数据 `makeModel`),不选就跟随默认模型。
22
22
 
23
23
  ## 时间规则
24
24
 
@@ -45,4 +45,4 @@ Ta 自带的 pi 包(默认开启,可在 Web 客户端的 设置 → 扩展
45
45
 
46
46
  - 只在 Ta 服务(`ta serve`,Ta 桌面版会自动启动它)运行时调度;单独运行 `ta`(终端)时命令和工具会提示需要 Ta 服务。
47
47
  - 不能限定一次运行可用的工具:运行和普通对话一样,用你的设置和项目里的扩展、技能。
48
- - 没有邮件、Webhook 之类的外部通知渠道,也没有导入导出。
48
+ - 没有邮件、Webhook 之类的外部通知渠道,也没有导入导出。
package/host/index.mjs CHANGED
@@ -556,6 +556,12 @@ var TaskUtil;
556
556
  }
557
557
  return value;
558
558
  }
559
+ function firstLine(text) {
560
+ const line = text.split(`
561
+ `).find((candidate) => candidate.trim()) ?? "";
562
+ return line.replace(/^\s*(?:#{1,6}\s+|[-*+]\s+|>\s*|\d+[.)]\s+)/, "").replace(/\*\*|__|`/g, "").replace(/\[([^\]]*)\]\([^)]*\)/g, "$1").trim();
563
+ }
564
+ TaskUtil.firstLine = firstLine;
559
565
  function missed(task, now) {
560
566
  return task.schedule.kind === "once" && !!task.nextRunAt && now.getTime() - new Date(task.nextRunAt).getTime() > Limits.GRACE_MS;
561
567
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@celljs/ta-cron",
3
- "version": "4.9.0",
3
+ "version": "4.10.0",
4
4
  "description": "A pi package for Ta: prompts that run on a schedule, once, every so often or by a cron expression, each run in a conversation of its own in the Ta service",
5
5
  "keywords": [
6
6
  "pi-package"
@@ -27,8 +27,8 @@
27
27
  "watch": "tsc -b -w --preserveWatchOutput"
28
28
  },
29
29
  "devDependencies": {
30
- "@celljs/ta-protocol": "4.9.0",
31
- "@celljs/ta-web": "4.9.0",
30
+ "@celljs/ta-protocol": "4.10.0",
31
+ "@celljs/ta-web": "4.10.0",
32
32
  "@types/react": "^19.3.0"
33
33
  },
34
34
  "publishConfig": {