@celljs/ta-recall 4.13.1 → 4.14.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
@@ -17,7 +17,7 @@ Settings → Recall: the daily brief, its time, one written now, and the offers
17
17
 
18
18
  Sessions a package opened for a role of its own (an agent of a channel, a run of a schedule) are offered nothing to keep.
19
19
 
20
- Offering to keep something is a kind of Initiative (`@celljs/ta-initiative`), `recall.keep`: declined twice in a row it goes down to In the brief and is no longer offered in conversations; what you keep, have made or decline is told to it. The brief tells too what waits in Suggestions and what Ta did on its own.
20
+ Offering to keep something is a kind of Initiative (`@celljs/ta-initiative`), `recall.keep`: declined twice in a row it goes down to In the brief and is no longer offered in conversations; what you keep, have made or decline is told to it. The brief tells too what waits in Suggestions and what Ta did on its own. The notices, the runs of scheduled tasks and the suggestions are read by the methods of those packages' hosts (`notices` of ta-notify, `list` / `runs` of ta-cron, `proposals` of ta-initiative), never by their data; a package that is off leaves its part out.
21
21
 
22
22
  ## Data and calls
23
23
 
package/README.md CHANGED
@@ -17,7 +17,7 @@ Ta 自带的 pi 包(默认开启,可在 Web 客户端的 设置 → 扩展
17
17
 
18
18
  由别的包打开、承担固定角色的会话(频道里的智能体、定时任务的运行)不建议存下来。
19
19
 
20
- 建议存下来是"主动"(`@celljs/ta-initiative`)的一类事 `recall.keep`:你连续拒绝两次后它降到"只进简报",就不再在对话里建议;存下、做成扩展或拒绝都会回报给它。简报也写上"Ta 的建议"里等你决定的事和 Ta 自己做了的事。
20
+ 建议存下来是"主动"(`@celljs/ta-initiative`)的一类事 `recall.keep`:你连续拒绝两次后它降到"只进简报",就不再在对话里建议;存下、做成扩展或拒绝都会回报给它。简报也写上"Ta 的建议"里等你决定的事和 Ta 自己做了的事。提醒、定时任务的运行和建议都经各包宿主的方法读(`ta-notify` 的 `notices`、`ta-cron` 的 `list` / `runs`、`ta-initiative` 的 `proposals`),不读它们的包数据;包关着时简报就没有那一段。
21
21
 
22
22
  ## 数据与调用
23
23
 
package/host/index.mjs CHANGED
@@ -1096,23 +1096,17 @@ class RecallHost {
1096
1096
  return sources.filter((source) => !!source);
1097
1097
  }
1098
1098
  async notices() {
1099
- const value = await this.host.getExtensionData(NOTIFY, "notices").catch(() => {
1100
- return;
1101
- });
1099
+ const value = await this.fromPackage(NOTIFY, "notices");
1102
1100
  return Array.isArray(value) ? value.filter((notice) => !!notice && typeof notice.at === "number" && typeof notice.text === "string") : [];
1103
1101
  }
1104
1102
  async runs(since) {
1105
- const tasks = await this.host.getExtensionData(CRON2, "tasks").catch(() => {
1106
- return;
1107
- });
1103
+ const tasks = await this.fromPackage(CRON2, "list");
1108
1104
  if (!Array.isArray(tasks)) {
1109
1105
  return [];
1110
1106
  }
1111
1107
  const ran = tasks.filter((task) => task && typeof task.id === "string" && Date.parse(task.lastRunAt ?? "") >= since);
1112
1108
  return Promise.all(ran.map(async (task) => {
1113
- const runs = await this.host.getExtensionData(CRON2, `runs/${task.id}`).catch(() => {
1114
- return;
1115
- });
1109
+ const runs = await this.fromPackage(CRON2, "runs", task.id, 1);
1116
1110
  const run = Array.isArray(runs) ? runs[0] : undefined;
1117
1111
  return {
1118
1112
  name: String(task.name ?? task.id),
@@ -1123,9 +1117,7 @@ class RecallHost {
1123
1117
  }));
1124
1118
  }
1125
1119
  async suggestions() {
1126
- const value = await this.host.getExtensionData(INITIATIVE, "proposals").catch(() => {
1127
- return;
1128
- });
1120
+ const value = await this.fromPackage(INITIATIVE, "proposals");
1129
1121
  return Array.isArray(value) ? value.filter((one) => !!one && typeof one.title === "string" && typeof one.state === "string" && typeof one.at === "number") : [];
1130
1122
  }
1131
1123
  async initiative(method, ...params) {
@@ -1153,6 +1145,11 @@ class RecallHost {
1153
1145
  return;
1154
1146
  });
1155
1147
  }
1148
+ fromPackage(name, method, ...params) {
1149
+ return this.host.callPackageHost(name, method, params).catch(() => {
1150
+ return;
1151
+ });
1152
+ }
1156
1153
  serial(work) {
1157
1154
  const next = this.queue.then(work, work);
1158
1155
  this.queue = next.catch(() => {
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@celljs/ta-recall",
3
- "version": "4.13.1",
3
+ "version": "4.14.0",
4
4
  "description": "A pi package for Ta: asks earlier conversations what was done, offers to keep a request asked again as an extension (steps, a card, a page), and writes a daily brief of what got done and what waits for the user",
5
5
  "keywords": [
6
6
  "pi-package"
7
7
  ],
8
- "homepage": "https://github.com/cellbang/cell",
8
+ "homepage": "https://github.com/cellbang/ta",
9
9
  "bugs": {
10
- "url": "https://github.com/cellbang/cell/issues"
10
+ "url": "https://github.com/cellbang/ta/issues"
11
11
  },
12
12
  "repository": {
13
13
  "type": "git",
@@ -27,8 +27,8 @@
27
27
  "watch": "tsc -b -w --preserveWatchOutput"
28
28
  },
29
29
  "devDependencies": {
30
- "@celljs/ta-protocol": "4.13.1",
31
- "@celljs/ta-web": "4.13.1",
30
+ "@celljs/ta-protocol": "4.14.0",
31
+ "@celljs/ta-web": "4.14.0",
32
32
  "@types/react": "^19.3.0"
33
33
  },
34
34
  "publishConfig": {