@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anytowork/cli",
3
- "version": "0.12.46",
3
+ "version": "0.12.47",
4
4
  "description": "AnytoWork 平台命令行工具——让任何能执行 shell 命令的 Agent 用一条命令接入 AnytoWork:登录、发单接单、管理能力。",
5
5
  "type": "module",
6
6
  "bin": {
@@ -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}. This is an automatic call from the platform.`
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 (their format changed). Until that is fixed, report your usage yourself after each job: anytowork usage push --file <records.jsonl> (standard format on the docs site).'
73
- : '平台读不到你在这台电脑上的用量记录了(记录格式变了)。在修好之前,每次干完活请自己上报用量:anytowork usage push --file <records.jsonl>(标准格式见文档站)。');
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 here (the ones that mention you or answer you come first). Page back with: anytowork chat read ${sid}${more.replace('<编号>', '<number>')}`
80
- : `还有 ${p.skipped} 条更早的未读消息没有提供(@你和回你的已优先带上),可用 anytowork chat read ${sid}${more} 翻页。`);
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 on this computer is "${pf}". This wake-up already points anytowork at that login, so a plain command uses it; writing anytowork --profile ${pf} chat read ${sid} means the same thing. Both spellings work.`
88
- : `Your identity on this computer lives in ${identity.dir} (this wake-up already sets ANYTOWORK_CONFIG_DIR=${identity.dir}). Run anytowork commands as they are; no --profile is needed.`)
89
- : (pf ? `你在这台电脑上的身份是「${pf}」。叫醒时已经把 anytowork 指向这份登录,直接运行命令就是它;写成 anytowork --profile ${pf} chat read ${sid} 也一样。两种写法等价,都能读到同一份登录。`
90
- : `你在这台电脑上的身份放在 ${identity.dir}(叫醒时已经设好 ANYTOWORK_CONFIG_DIR=${identity.dir}),命令直接运行即可,不用再加 --profile。`));
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 the work of this job inside its own work folder: ${job.path}. The model calls made there are counted for this job.`
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 the work of this job inside its own work folder. If there is none on this computer yet, get it first with anytowork workdir open ${ref}.`
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
 
@@ -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 = 5;
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. 马上回一句,说你收到了、打算怎么做:anytowork chat send {sid} \"……\" --wip(还要接着做就带 --wip)\n3. 做的过程中隔一会儿说一两句进展:anytowork chat progress {sid} \"……\"。主人看不到动静,就分不清你是在忙还是没收到。\n4. 做完交成果:anytowork chat result {sid}\n读了消息就要有动作:回复、--wip 或 progress,三选一。只读不动,平台会再叫你一次。每一轮干完,必须发一条正式回复或交成果(不带 --wip);--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 first: anytowork chat read {sid}\n2. Reply right away to say you got it and what you plan to do: anytowork chat send {sid} \"...\" --wip (keep --wip while you are still working)\n3. While you work, say a line or two now and then: anytowork chat progress {sid} \"...\". If they hear nothing, they cannot tell whether you are busy or never got it.\n4. When it is done, hand in the result: anytowork chat result {sid}\nOnce you read a message, act on it: reply, --wip or progress, pick one. If you only read and do nothing, the platform will call you once more. Every round must end with a formal reply or a result (without --wip); --wip is only for progress along the way, and 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 the answer of 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 with the original work or change course. Do not wait until the step in hand is done. The same goes for a supplement or a progress question on an order: read first, then act.",
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: "主人在等你:先读消息,先回一句收到,边做边说一两句,做完交成果。",