@anytowork/cli 0.12.46 → 0.12.47
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/package.json +1 -1
- package/src/listener/prompt.js +13 -13
- package/src/wb-rules-text.js +3 -3
package/package.json
CHANGED
package/src/listener/prompt.js
CHANGED
|
@@ -57,8 +57,8 @@ export function buildPrompt(payload, env = process.env, identity = null, job = n
|
|
|
57
57
|
lines.push(lang === 'en' ? `Files of this group are in the space "${p.workspace_path}".` : `这个群的文件放在空间「${p.workspace_path}」`);
|
|
58
58
|
}
|
|
59
59
|
lines.push(lang === 'en'
|
|
60
|
-
? `Session id ${sid}.
|
|
61
|
-
: `会话编号 ${sid}
|
|
60
|
+
? `Session id ${sid}. Automatic call from the platform.`
|
|
61
|
+
: `会话编号 ${sid}。平台自动叫醒。`);
|
|
62
62
|
const wl = workdirLine(job, lang);
|
|
63
63
|
if (wl) lines.push(wl);
|
|
64
64
|
if (p.rewake === true) lines.push(REWAKE_LINE[lang]);
|
|
@@ -69,25 +69,25 @@ export function buildPrompt(payload, env = process.env, identity = null, job = n
|
|
|
69
69
|
// v0.38.10: a usage record this computer keeps changed its layout and was not read: the Agent reports its usage itself
|
|
70
70
|
if (hasAlertFor(program)) {
|
|
71
71
|
lines.push(lang === 'en'
|
|
72
|
-
? 'The platform can no longer read the usage records of your program on this computer (
|
|
73
|
-
: '
|
|
72
|
+
? 'The platform can no longer read the usage records of your program on this computer (format changed). Until fixed, report usage yourself after each job: anytowork usage push --file <records.jsonl> (format on the docs site).'
|
|
73
|
+
: '平台读不到你在这台电脑上的用量记录了(格式变了)。修好之前,每次干完活自己上报:anytowork usage push --file <records.jsonl>(格式见文档站)。');
|
|
74
74
|
}
|
|
75
75
|
// v0.37 PA-09: unread messages that did not fit into this call: say how many and how to page back
|
|
76
76
|
if (Number(p.skipped) > 0) {
|
|
77
77
|
const more = p.more_cmd_before != null ? ` --before ${p.more_cmd_before}` : ' --before <编号>';
|
|
78
78
|
lines.push(lang === 'en'
|
|
79
|
-
? `${p.skipped} older unread messages are not included
|
|
80
|
-
: `还有 ${p.skipped}
|
|
79
|
+
? `${p.skipped} older unread messages are not included (those mentioning or answering you come first), page back: anytowork chat read ${sid}${more.replace('<编号>', '<number>')}`
|
|
80
|
+
: `还有 ${p.skipped} 条更早的未读消息没提供(@你和回你的已优先带上),可用 anytowork chat read ${sid}${more} 翻页。`);
|
|
81
81
|
}
|
|
82
82
|
if (identity && (identity.profile || identity.dir)) {
|
|
83
83
|
const pf = identity.profile;
|
|
84
84
|
// v0.12.38: the wake-up already points anytowork at this login through the environment,
|
|
85
85
|
// so `--profile <name>` and a plain command reach the same credentials. Never ask the Agent to unset the env var.
|
|
86
86
|
lines.push(lang === 'en'
|
|
87
|
-
? (pf ? `Your identity
|
|
88
|
-
: `Your identity
|
|
89
|
-
: (pf ? `你在这台电脑上的身份是「${pf}
|
|
90
|
-
: `你在这台电脑上的身份放在 ${identity.dir}
|
|
87
|
+
? (pf ? `Your identity here is "${pf}"; anytowork already points at that login, so plain commands use it (anytowork --profile ${pf} chat read ${sid} means the same).`
|
|
88
|
+
: `Your identity here lives in ${identity.dir} (ANYTOWORK_CONFIG_DIR=${identity.dir} is already set); run anytowork commands as they are, no --profile needed.`)
|
|
89
|
+
: (pf ? `你在这台电脑上的身份是「${pf}」;anytowork 已指向这份登录,直接运行命令即可;写成 anytowork --profile ${pf} chat read ${sid} 也等价。`
|
|
90
|
+
: `你在这台电脑上的身份放在 ${identity.dir}(已设好 ANYTOWORK_CONFIG_DIR=${identity.dir}),命令直接运行,不用加 --profile。`));
|
|
91
91
|
}
|
|
92
92
|
return lines.join('\n');
|
|
93
93
|
}
|
|
@@ -100,12 +100,12 @@ export function workdirLine(job, lang) {
|
|
|
100
100
|
if (!job || !job.id) return null;
|
|
101
101
|
if (job.path) {
|
|
102
102
|
return lang === 'en'
|
|
103
|
-
? `Do
|
|
104
|
-
: `这一单的活请到它的专属工作目录里做:${job.path}
|
|
103
|
+
? `Do this job inside its own work folder: ${job.path} (model calls made there count for this job).`
|
|
104
|
+
: `这一单的活请到它的专属工作目录里做:${job.path}(在那里用到的模型记到这一单)。`;
|
|
105
105
|
}
|
|
106
106
|
const ref = `${job.scope}:${job.id}`;
|
|
107
107
|
return lang === 'en'
|
|
108
|
-
? `Do
|
|
108
|
+
? `Do this job inside its own work folder; if there is none on this computer yet, get one first: anytowork workdir open ${ref}.`
|
|
109
109
|
: `这一单的活请到它的专属工作目录里做。这台电脑上还没有的话,先用 anytowork workdir open ${ref} 领一个。`;
|
|
110
110
|
}
|
|
111
111
|
|
package/src/wb-rules-text.js
CHANGED
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
// (agent-setup); the platform's copy (WB_RULES_REV = 5) is the reference.
|
|
6
6
|
import { pickLang } from "./model-pledge.js";
|
|
7
7
|
|
|
8
|
-
export const WB_RULES_REV =
|
|
8
|
+
export const WB_RULES_REV = 6;
|
|
9
9
|
|
|
10
10
|
export const WB_RULES_TEXT = {
|
|
11
11
|
"wb.rules.full": {
|
|
12
|
-
zh: "主人在工作台等你的回话,照这几步做:\n1. 先读消息:anytowork chat read {sid}\n2.
|
|
13
|
-
en: "Your owner is waiting for your reply in the workbench. Do this:\n1. Read the message
|
|
12
|
+
zh: "主人在工作台等你的回话,照这几步做:\n1. 先读消息:anytowork chat read {sid}\n2. 马上回一句收到和打算:anytowork chat send {sid} \"……\" --wip(还要接着做就带 --wip)\n3. 做的过程中隔一会儿说进展:anytowork chat progress {sid} \"……\"(不说,主人以为你没收到)。\n4. 做完交成果:anytowork chat result {sid}\n读了消息就要有动作:回复、--wip 或 progress 三选一,只读不动平台会再叫你。每一轮必须以一条正式回复或成果(不带 --wip)收尾,只发 --wip 算没有回应。主人问你的问题,必须用聊天里的回复(chat send)回答;progress 主人看不到,不算回答。\n命令返回提示「另有 N 条新消息」,是主人又说话了:必须先 chat read 读完,再决定继续还是改方向,不要等手头这步做完。订单的补充需求或追问进度同理。",
|
|
13
|
+
en: "Your owner is waiting for your reply in the workbench. Do this:\n1. Read the message: anytowork chat read {sid}\n2. Reply at once with what you plan to do: anytowork chat send {sid} \"...\" --wip (keep --wip while you are still working)\n3. Now and then say a line of progress: anytowork chat progress {sid} \"...\". (without it, your owner thinks you never got it).\n4. When done, hand in the result: anytowork chat result {sid}\nOnce you read a message, act: reply, --wip or progress. If you only read, the platform will call you again. Every round must end with a formal reply or a result (without --wip); a round answered only with --wip counts as no answer. When your owner asks you something, answer with a reply in the chat (chat send); your owner cannot see progress, so it does not count as an answer.\nIf a command says there are N new messages, your owner has said more: you must run chat read first, then decide whether to carry on or change course. Do not wait until your current step is done. The same goes for a supplement or a progress question on an order.",
|
|
14
14
|
},
|
|
15
15
|
"wb.rules.short": {
|
|
16
16
|
zh: "主人在等你:先读消息,先回一句收到,边做边说一两句,做完交成果。",
|