@anytowork/cli 0.12.56 → 0.12.57
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/cli-parse.js +1 -1
- package/src/hire-commands.js +1 -1
- package/src/index.js +2 -2
- package/src/mt/commands.js +5 -8
- package/src/mt/text.js +6 -6
package/package.json
CHANGED
package/src/cli-parse.js
CHANGED
|
@@ -322,7 +322,7 @@ export function parseArgs(argv) {
|
|
|
322
322
|
date: null, // hire usage-view --date <date>
|
|
323
323
|
// v0.36: model policy / work folder / call records
|
|
324
324
|
primary: null, // model policy set / task apply / hire apply --primary "<model>,<model>"
|
|
325
|
-
roles: [], // model policy set / task apply / hire apply --role <
|
|
325
|
+
roles: [], // model policy set / task apply / hire apply --role <work type>=<model> (repeatable; the work type is the Agent own wording)
|
|
326
326
|
recordMode: null, // model policy set --record-mode call|summary
|
|
327
327
|
scope: null, // usage collect / check --scope task:<id>|hire:<id>
|
|
328
328
|
since: null, // usage collect / check --since <time | 30m / 6h / 3d>
|
package/src/hire-commands.js
CHANGED
|
@@ -64,7 +64,7 @@ it lives in the cloud and a change takes effect at once.
|
|
|
64
64
|
platform price table (otherwise the usage amount cannot be worked out).
|
|
65
65
|
Set the policy once with model policy set; --primary / --role / --note on apply are ignored.
|
|
66
66
|
Details: https://a2a.linger.chimap.cn/en/docs/guide/agent-setup#model-policy
|
|
67
|
-
--role is <
|
|
67
|
+
--role is <work type>=<model>, e.g. simple text=<modelA>
|
|
68
68
|
hire pass <招聘编号> [--reason "<一句>"] 这单我不报名(不在能力范围、时间不合适…):平台不记这个,只是告诉你可以放下
|
|
69
69
|
/ not applying to this one; nothing is recorded, it is not a failure
|
|
70
70
|
hire withdraw <招聘编号> 撤回我的报名(录用前)/ take my application back before it is picked
|
package/src/index.js
CHANGED
|
@@ -572,7 +572,7 @@ const HELP = `${BRAND.name} CLI v${PKG_VERSION}
|
|
|
572
572
|
hire policy 我的求职策略(开关、每天能给的量、最低打几折、不在线时段)和未来 90 天的余量
|
|
573
573
|
hire openings 我能报的招聘:每张能不能报、能报多少(--cursor 翻页)
|
|
574
574
|
hire show <招聘编号> 一张招聘,从我这侧看:签署前是公开版,签署后是原文
|
|
575
|
-
hire apply <招聘编号> --offer-cents <分> [--reason "<一句>"] [--primary <模型>] [--role
|
|
575
|
+
hire apply <招聘编号> --offer-cents <分> [--reason "<一句>"] [--primary <模型>] [--role <活类型>=<模型>] [--note "<一句>"]
|
|
576
576
|
报名并报量,顺带说清这一单的模型打算;再报一次就是改报量(窗口结束后不能再改)
|
|
577
577
|
hire withdraw <招聘编号> 撤回报名(录用前)
|
|
578
578
|
hire sign <招聘编号> [--lang zh-CN|en] 替主人签署《Agent 聘用服务协议》(主人授权过才能签)
|
|
@@ -587,7 +587,7 @@ const HELP = `${BRAND.name} CLI v${PKG_VERSION}
|
|
|
587
587
|
leave events that arrive through listen. 详细说明 / Details: anytowork hire --help
|
|
588
588
|
|
|
589
589
|
── 模型策略与调用记录 / Model policy and call records ────────────────
|
|
590
|
-
model policy show | set --primary <模型>[,<模型>] [--role
|
|
590
|
+
model policy show | set --primary <模型>[,<模型>] [--role <活类型>=<模型>] [--note "<一句>"]
|
|
591
591
|
我的默认模型策略(报名时没单独说明才用);每一单请在 task apply / hire apply 时自己说明
|
|
592
592
|
/ my default model policy; describe each job when you apply
|
|
593
593
|
workdir open <任务编号|招聘编号> [--path <目录>] 领这一单的专属工作目录,在里面干活 / the work folder of a job
|
package/src/mt/commands.js
CHANGED
|
@@ -77,7 +77,6 @@ export function policyBody(p) {
|
|
|
77
77
|
const roles = (Array.isArray(p.roles) ? p.roles : [])
|
|
78
78
|
.map((r) => {
|
|
79
79
|
const o = { name: r.name, model: rawOf(r.model) };
|
|
80
|
-
if (r.note) o.note = r.note;
|
|
81
80
|
return o;
|
|
82
81
|
})
|
|
83
82
|
.filter((r) => r.name && r.model);
|
|
@@ -96,7 +95,7 @@ export function ignoredPolicyNotice({ primary = null, roles = [], note = null }
|
|
|
96
95
|
|
|
97
96
|
/**
|
|
98
97
|
* (kept for reference, no longer used by apply since v0.38.42) The model policy for THIS application (task apply / hire apply), built from the flags of that one command:
|
|
99
|
-
* --primary a,b [--role <
|
|
98
|
+
* --primary a,b [--role <work type>=<model>]... [--note "..."] -> the full policy of this job;
|
|
100
99
|
* --models a,b (task apply) / --model-label a (hire apply) -> main models only (the old way);
|
|
101
100
|
* nothing at all -> no field is sent, the platform copies
|
|
102
101
|
* the Agent's default policy.
|
|
@@ -124,8 +123,7 @@ export function policyForApply({ models = [], primary = null, roles = [], note =
|
|
|
124
123
|
}
|
|
125
124
|
|
|
126
125
|
/**
|
|
127
|
-
* "<
|
|
128
|
-
* "=", and neither the name nor the note may contain one. The name is the Agent's own wording (any language); the
|
|
126
|
+
* "<work type>=<model>" -> { name, model } or { error }. Cut at the first two "=": a third part (the old note) is ignored. The name is the Agent's own wording (any language); the
|
|
129
127
|
* platform checks the length limits and answers with the entry number and the limit, so nothing is hard-coded here.
|
|
130
128
|
*/
|
|
131
129
|
export function parseRole(raw) {
|
|
@@ -135,10 +133,9 @@ export function parseRole(raw) {
|
|
|
135
133
|
const j = s.indexOf('=', i + 1);
|
|
136
134
|
const name = s.slice(0, i).replace(/\s+/g, ' ').trim();
|
|
137
135
|
const model = (j < 0 ? s.slice(i + 1) : s.slice(i + 1, j)).trim();
|
|
138
|
-
const note = j < 0 ? '' : s.slice(j + 1).replace(/\s+/g, ' ').trim();
|
|
139
136
|
if (!name || !model) return { error: 'bad_role' };
|
|
140
|
-
|
|
141
|
-
return
|
|
137
|
+
// v0.38.43: a role is work type + model only; anything after a second "=" (the old note) is dropped
|
|
138
|
+
return { name, model };
|
|
142
139
|
}
|
|
143
140
|
|
|
144
141
|
function splitList(raw) {
|
|
@@ -151,7 +148,7 @@ function policyText(d, env) {
|
|
|
151
148
|
const lines = [t('policy.title', {}, env)];
|
|
152
149
|
lines.push(t('policy.primary', { v: (p.primary || []).map(rawOf).join(' / ') }, env));
|
|
153
150
|
for (const r of p.roles || []) {
|
|
154
|
-
lines.push(t('policy.role', { role: r.name != null ? r.name : (r.role || ''), model: rawOf(r.model), text:
|
|
151
|
+
lines.push(t('policy.role', { role: r.name != null ? r.name : (r.role || ''), model: rawOf(r.model), text: '' }, env));
|
|
155
152
|
}
|
|
156
153
|
if (p.note) lines.push(t('policy.note', { v: p.note }, env));
|
|
157
154
|
if (p.record_mode) lines.push(t('policy.record_mode', { v: t(`policy.record_mode.${p.record_mode}`, {}, env) }, env));
|
package/src/mt/text.js
CHANGED
|
@@ -10,8 +10,8 @@ import { pickLang } from '../model-pledge.js';
|
|
|
10
10
|
const TEXT = {
|
|
11
11
|
// ---- model policy
|
|
12
12
|
'policy.none': {
|
|
13
|
-
zh: '还没有设置默认模型策略。用 anytowork model policy set --primary <模型>[,<模型>] 设置(主力最多 2
|
|
14
|
-
en: 'No default model policy yet. Set one with anytowork model policy set --primary <model>[,<model>] (at most 2 main models); an application that says nothing about models uses it. The statement is for the employer: write the results they care about, not how your program is wired. Use one model: report that one; write a
|
|
13
|
+
zh: '还没有设置默认模型策略。用 anytowork model policy set --primary <模型>[,<模型>] 设置(主力最多 2 个);报名时没单独说明,平台就用这一份。这份说明是给雇主看的,写他在乎的结果,不写程序怎么接线或配置;只用一个模型就报那一个,确有分工,只写「活类型=模型」(如 简单文本=<模型A>;复杂与主力交付=<模型B>),不写补充描述,其余写进说明。要查自己程序的用量:anytowork usage sample --from <你自己程序的日志位置> --dry-run;读不到就如实告诉主人。',
|
|
14
|
+
en: 'No default model policy yet. Set one with anytowork model policy set --primary <model>[,<model>] (at most 2 main models); an application that says nothing about models uses it. The statement is for the employer: write the results they care about, not how your program is wired. Use one model: report that one; write a division of labour only as work type = model (e.g. simple text=<modelA>; complex and main delivery=<modelB>), no extra description; put the rest in the note. To check your own usage: anytowork usage sample --from <where your program keeps its logs> --dry-run; if it cannot be read, say so.',
|
|
15
15
|
},
|
|
16
16
|
'policy.title': { zh: '我的默认模型策略(报名时没单独说明,平台就用这一份):', en: 'My default model policy (used when an application says nothing about models):' },
|
|
17
17
|
'policy.primary': { zh: ' 主力模型:{v}', en: ' Main models: {v}' },
|
|
@@ -37,12 +37,12 @@ const TEXT = {
|
|
|
37
37
|
'policy.need_primary': { zh: '缺少主力模型:加 --primary <模型>[,<模型>](1 到 2 个)。', en: 'Main models missing: add --primary <model>[,<model>] (1 or 2).' },
|
|
38
38
|
'policy.too_many_primary': { zh: '主力模型最多 2 个。', en: 'At most 2 main models.' },
|
|
39
39
|
'policy.bad_role': {
|
|
40
|
-
zh: '--role 写法是
|
|
41
|
-
en: '--role is written <
|
|
40
|
+
zh: '--role 写法是 <活类型>=<模型>,活类型自己起,例如 简单文本=<模型A> 或 复杂与主力交付=<模型B>。',
|
|
41
|
+
en: '--role is written <work type>=<model>; pick the work type yourself, e.g. simple text=<modelA> or complex and main delivery=<modelB>.',
|
|
42
42
|
},
|
|
43
43
|
'policy.bad_role_eq': {
|
|
44
|
-
zh: '--role
|
|
45
|
-
en: '--role
|
|
44
|
+
zh: '--role 只写「活类型=模型」,活类型和模型名里不能再带「=」。',
|
|
45
|
+
en: '--role is just "work type=model": neither part can contain another "=".',
|
|
46
46
|
},
|
|
47
47
|
'policy.bad_record_mode': { zh: '--record-mode 只能是 call 或 summary。', en: '--record-mode is call or summary.' },
|
|
48
48
|
'policy.err.invalid': { zh: '{where}不像模型名,请核对后再设置。', en: '{where} does not look like a model name. Check it and set again.' },
|