@celljs/ta-goals 0.0.0-stage → 4.18.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 ADDED
@@ -0,0 +1,28 @@
1
+ # Cell - Ta Goals
2
+
3
+ A pi package that comes with Ta (on by default; Settings → Extensions of the web client turns it off): goals. Tell Ta a result you want ("get the cold start under 1 s", "two articles a week this month"); Ta first agrees with you on how it is judged done, then works on it step by step in a conversation of its own, at its pace, asks you only when it must, and hands you the result to accept. Design: [docs/design/ta-goals.md](../../docs/design/ta-goals.md).
4
+
5
+ - **One way in**: in your own conversations (the double's too) the system prompt has a section `<ta-goals>`: what you say is one of three; a request is done as always, a direction is kept as you say, a goal is first asked about (3 questions at most), then written as a `ta-goal` block (JSON: `title`, `doneWhen`, `constraints`, `askFirst`, `every`, `budget`). The page draws it as the card of a goal: what to achieve, how it is judged done, what it keeps to, the steps it asks you before, how often it works and how long a day at most, and Start. To change it, say so and Ta writes another. While a card waits, the turn is marked as asking you (`TA_ASK_ENTRY`), under Waiting for you.
6
+ - **Start**: you tap Start (or say so), Ta calls `start_goal`, and the host opens a conversation of the goal's own in the same directory (its role marked `[ta:goal]`), named after it, whose first turn makes the plan. Three goals at most work at once.
7
+ - **On its own**: the host (`pi.host`) runs in the Ta service, with no page open. Each turn is a message of the package (`[ta:from @celljs/ta-goals]`) whose `<context>` is the goal as it stands: its checks, constraints, steps to ask first, plan, latest progress and the time left today. Before it ends a turn Ta calls `goal_update`: the plan, what it did, what comes next, and when to come back (`wakeIn`) if not at the pace (every 4 hours by default). While the conversation still answers, it comes 10 minutes later. Its time a day is counted from the turns of the conversation; past its budget (2 hours by default) it waits for tomorrow.
8
+ - **Quiet**: the ordinary turns of a goal's conversation tell you nothing (ta-notify knows the mark `[ta:tells-of-its-turns]`); failures and questions do as always. For your word, Ta asks with the options of a glance card, and the turn is under Waiting for you. What cannot be undone (pushing, publishing, deleting, paying, writing to others for you) and the steps listed on the card are always asked first.
9
+ - **Means**: the conversation of a goal may hand part of it to a few agents with the team tools (`create_agent`, `create_channel`), and make scheduled tasks for what must recur.
10
+ - **Stuck**: after 3 failed turns in a row (not one you stopped) it pauses, the list saying why; Resume starts the count again.
11
+ - **The daily brief**: the progress of each goal, a result to accept and a goal stuck go to the data `brief` (`TA_BRIEF_SOURCE`), a line a goal in the daily brief; ordinary progress tells you nothing at once.
12
+ - **Settings → Goals**: how often it works on a goal, how long a day at most, how many at once; what a card does not say takes these.
13
+ - **Woken by events**: each goal has a webhook (`POST /api/hooks/ta-goals/<secret>`, its address in the context of each turn, or `ta call @celljs/ta-goals hookUrl <goal>`) that a git hook, a script or a CI of this computer calls to wake it, what is posted told to its next turn; `watch` of `goal_update` wakes it as files of its directory change (once they settle 5 seconds; not `.git`, dependencies and builds, nor what its own turn changed).
14
+ - **Suggestions**: it defines `goal.set` (hand a result you keep coming back to over as a goal) and `goal.update` (change a goal at work) in Initiative, both only asked; the weekly review has a line for each goal.
15
+ - **Directions**: a direction for a goal at work goes into its constraints with `goal_note`; the goal reads it soon.
16
+ - **The result**: once Ta believes every check holds, `goal_update` marks it for review and the reply ends with a `ta-goal-result` block (`summary`, `criteria` met or not with their evidence, `outputs` where to see it). The page draws the result card with Accept and Something is missing. Accepted, the goal is done; otherwise it goes on. Ta never calls a goal done itself.
17
+ - **In the lists**: each goal is a task of the double (`registerTasks`), the row of its conversation, with the icon of goals (`registerChatIcon`) and a line such as "Step 2/5 · next" or "The result waits for you to accept"; the turn that started it has its card. The menu of the row: work on it now, pause / resume, delete the goal (its conversation stays).
18
+
19
+ ## Data and calls
20
+
21
+ The data of the package (`@celljs/ta-goals`): `goals`, every goal, written by the host alone; `settings`, Settings → Goals; `brief`, for the daily brief.
22
+
23
+ The methods of the host, for the web extension by `callHost`, other packages by `callPackageHost('@celljs/ta-goals', …)`, scripts and other agents by `ta call @celljs/ta-goals <method> [params…]`: `list()`, `settings()`, `get(ref)`, `start(draft, { cwd, origin }?)`, `update(ref, change)`, `note(ref, text)`, `wake(ref)`, `hookUrl(ref)`, `pause(ref)`, `resume(ref)`, `remove(ref)`. `ref` is an id, the session file of the goal's conversation, or its title.
24
+
25
+ ```sh
26
+ ta call @celljs/ta-goals start '{"title":"Cold start under 1 s","doneWhen":["bench < 1000 ms"],"every":"4h"}' '{"cwd":"/path/to/project"}'
27
+ ta call @celljs/ta-goals list
28
+ ```
package/README.md CHANGED
@@ -1,3 +1,28 @@
1
- # Temporary Holding Version
1
+ # Cell - Ta Goals
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Ta 自带的 pi 包(默认开启,可在 Web 客户端的 设置 → 扩展 关闭):目标。把想要的结果告诉 Ta("把冷启动降到 1 秒内""这个月每周两篇文章"),Ta 先和你对齐怎样算达成,再在单独的对话里按节奏一步步推进,只在必要时问你,做到后把结果交给你验收。设计见 [docs/design/ta-goals.md](../../docs/design/ta-goals.md)。
4
+
5
+ - **一个入口**:在你自己的对话里(分身也一样),系统提示多一段 `<ta-goals>`:你说的话分三种,需求照常做,方向按你说的记着,目标先问清最多 3 个问题,再写成 `ta-goal` 代码块(JSON:`title`、`doneWhen`、`constraints`、`askFirst`、`every`、`budget`)。页面把它画成目标卡:要达成什么、怎样算达成、约束、哪些步骤先问你、多久推进一次、每天最多多久,下面一个"开始"。想改哪里直接说,Ta 重写一张。卡片在等你时,这一轮记为在问你(`TA_ASK_ENTRY`),出现在"待你决定"里。
6
+ - **开始**:你点"开始"(或说开始),Ta 调 `start_goal`,宿主在同一目录开一个目标自己的对话(角色带 `[ta:goal]` 标记),以目标的名字命名,第一轮从定计划开始。同时最多 3 个目标在做。
7
+ - **自己推进**:宿主(`pi.host`)在 Ta 服务里运行,不用开着页面。每一轮是一条来自本包的消息(`[ta:from @celljs/ta-goals]`),`<context>` 里是目标此刻的样子:标准、约束、先问的步骤、计划、最近的进展、今天还剩多少时间。这一轮结束前 Ta 调 `goal_update` 记下计划、做了什么、下一步,需要时说多久后再来(`wakeIn`);不说就按节奏(默认每 4 小时)。对话还在回答时晚 10 分钟再来。每天的运行时长按对话的回合累计,到了上限(默认 2 小时)就等到明天。
8
+ - **安静**:目标对话的普通回合不提醒你(ta-notify 认 `[ta:tells-of-its-turns]` 标记);失败和在问你时照常提醒。要你拍板时,Ta 用速览卡片的选项问你,这一轮进"待你决定"。不可撤销的事(推送、发布、删除、付款、替你对外发消息)和目标卡上列的步骤,一定先问。
9
+ - **手段**:目标对话可以用团队工具(`create_agent`、`create_channel`)把一部分交给几个智能体,也可以建定时任务做要反复跑的事。
10
+ - **卡住了**:连续 3 轮失败(你停下的不算)就暂停,列表上写明原因;点"继续"重新开始计数。
11
+ - **每日简报**:每个目标的进展、待验收、卡住写进包数据 `brief`(`TA_BRIEF_SOURCE`),每日简报一个目标一行;平常的进展不即时提醒你。
12
+ - **设置 → 目标**:多久推进一次、每天最多做多久、同时进行几个;目标卡没写时用这里的值。
13
+ - **事件叫醒**:每个目标有一个 webhook(`POST /api/hooks/ta-goals/<密钥>`,地址在每轮的上下文里,也可以 `ta call @celljs/ta-goals hookUrl <目标>`),git hook、本机脚本或 CI 调它就叫醒目标,发送的内容告诉下一轮;`goal_update` 的 `watch` 让它在本目录的文件变化时醒来(停下 5 秒后,不含 `.git`、依赖和构建目录,不含它自己这一轮改的)。
14
+ - **建议**:向主动包登记 `goal.set`(把反复在追的结果交给 Ta 当目标)和 `goal.update`(调整进行中的目标),都只会先问你;每周回顾里每个目标一行进展。
15
+ - **方向**:对正在做的目标说的方向,Ta 用 `goal_note` 加进它的约束,目标很快读到。
16
+ - **交结果**:Ta 认为每条标准都满足时,`goal_update` 记为待验收,回复以 `ta-goal-result` 代码块结尾(`summary`、`criteria` 每条是否满足和证据、`outputs` 在哪里看)。页面画成结果卡,下面"验收""还差点"。验收后目标完成;还差点就接着做。Ta 不能自己宣布完成。
17
+ - **在列表里**:每个目标是分身的一个任务(`registerTasks`),就是它那个对话的一行,带目标图标(`registerChatIcon`),第二行写"第 2/5 步 · 下一步"或"结果等你验收";开启它的那一轮里有任务卡片。行的菜单:现在推进一次、暂停 / 继续、删除目标(对话留着)。
18
+
19
+ ## 数据与调用
20
+
21
+ 包数据(`@celljs/ta-goals`):`goals`,全部目标,只由宿主写;`settings`,设置 → 目标;`brief`,给每日简报。
22
+
23
+ 宿主的方法,Web 扩展经 `callHost`、别的包经 `callPackageHost('@celljs/ta-goals', …)`、脚本和外部 Agent 经 `ta call @celljs/ta-goals <方法> [参数…]` 调用:`list()`、`settings()`、`get(ref)`、`start(draft, { cwd, origin }?)`、`update(ref, change)`、`note(ref, text)`、`wake(ref)`、`hookUrl(ref)`、`pause(ref)`、`resume(ref)`、`remove(ref)`。`ref` 是 id、目标对话的会话文件或标题。
24
+
25
+ ```sh
26
+ ta call @celljs/ta-goals start '{"title":"冷启动降到 1 秒内","doneWhen":["基准测试 < 1000 ms"],"every":"4h"}' '{"cwd":"/path/to/project"}'
27
+ ta call @celljs/ta-goals list
28
+ ```