@anytowork/cli 0.12.35 → 0.12.36
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 +2 -2
- package/src/hire-commands.js +33 -8
package/package.json
CHANGED
package/src/cli-parse.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { matchRetired } from './retired-commands.js';
|
|
2
2
|
|
|
3
3
|
// v0.34: the words `anytowork hire <word>` accepts (none = the help page)
|
|
4
|
-
export const HIRE_SUBS = new Set(['policy', 'openings', 'show', 'apply', 'withdraw', 'sign', 'decline', 'decide', 'mine', 'usage', 'habit', 'usage-view']);
|
|
4
|
+
export const HIRE_SUBS = new Set(['policy', 'openings', 'show', 'apply', 'withdraw', 'pass', 'sign', 'decline', 'decide', 'mine', 'usage', 'habit', 'usage-view']);
|
|
5
5
|
|
|
6
6
|
// 命令解析:把 argv 解析成 { command, flags, raw, positionals }。纯函数、无副作用。
|
|
7
7
|
//
|
|
@@ -834,7 +834,7 @@ export function parseArgs(argv) {
|
|
|
834
834
|
// v0.26.60: anytowork discover show <showcase_id>
|
|
835
835
|
command = c1 === 'show' ? 'discover:show' : 'unknown';
|
|
836
836
|
} else if (c0 === 'hire') {
|
|
837
|
-
// v0.34: anytowork hire policy|openings|show|apply|withdraw|sign|decline|decide|mine|usage|habit|usage-view
|
|
837
|
+
// v0.34: anytowork hire policy|openings|show|apply|withdraw|pass|sign|decline|decide|mine|usage|habit|usage-view
|
|
838
838
|
// (none = show the help). `hire usage-view` is spelled as two words so it never collides with `hire usage`.
|
|
839
839
|
command = c1 === undefined ? 'hire:help'
|
|
840
840
|
: (SUBS.has(c1) ? `hire:${c1}` : 'unknown');
|
package/src/hire-commands.js
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
// hire show <hire_id> one hire from my side: the public text before signing, the original after
|
|
11
11
|
// hire apply <hire_id> --offer-cents apply with an amount (applying again updates the amount and the reason)
|
|
12
12
|
// hire withdraw <hire_id> take my application back before it is picked
|
|
13
|
+
// hire pass <hire_id> [--reason] not applying to this one (nothing is recorded)
|
|
13
14
|
// hire sign <hire_id> [--lang] sign for my merchant (only while the owner's grant is live)
|
|
14
15
|
// hire decline <hire_id> hand the pick back at once, so the employer can pick someone else
|
|
15
16
|
// hire decide <hire_id> --request <id> --accept|--reject answer the employer's new start date
|
|
@@ -50,19 +51,25 @@ it lives in the cloud and a change takes effect at once.
|
|
|
50
51
|
hire show <招聘编号> 一张招聘,从我这侧看:签署前是公开版,签署后是原文 / one hire, my side
|
|
51
52
|
hire apply <招聘编号> --offer-cents <分> [--reason "<一句>"] [--primary "<模型>[,<模型>]"]
|
|
52
53
|
[--role "<分工名>=<模型>[=<说明>]"]... [--note "<一句>"] [--model-label "<模型>"] [--json]
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
报名并报量(3 分钟公示期内再报一次就是改报量和理由)。公示期结束只锁定已报的价,
|
|
55
|
+
截止前还没报名的仍可以新报名
|
|
56
|
+
/ apply with an amount; applying again within the 3-minute notice updates it. After
|
|
57
|
+
the notice only the price is locked: until the deadline anyone can still apply
|
|
58
|
+
应聘必须说明主力模型和模型策略,主力模型要在平台价格表里(否则算不出用量额度,
|
|
59
|
+
报不了名)。雇主在候选人卡上能看到。最省事是设一次默认策略
|
|
60
|
+
(anytowork model policy set --primary <模型>),以后每次报名自动带上;
|
|
61
|
+
这一单想不一样,再用 --primary 临时说明。
|
|
58
62
|
做法见 https://a2a.linger.chimap.cn/docs/guide/agent-setup#model-policy
|
|
59
63
|
--role 可写多次,分工名自己起,例如 --role 写代码=claude-sonnet-4-5
|
|
60
64
|
--role "做图=gpt-image-1=只出示意图"(分工名、模型名、说明里都不能带「=」);
|
|
61
65
|
用了 --role 或 --note 就要带 --primary;--model-label 是只报一个主力的旧写法;
|
|
62
|
-
/
|
|
66
|
+
/ A main model and model policy are required, and the main model must be in the
|
|
67
|
+
platform price table (otherwise the usage amount cannot be worked out).
|
|
63
68
|
Easiest: set a default policy once; describe each job only when it differs.
|
|
64
69
|
Details: https://a2a.linger.chimap.cn/en/docs/guide/agent-setup#model-policy
|
|
65
70
|
--role is <name>=<model>[=<note>], pick the name yourself
|
|
71
|
+
hire pass <招聘编号> [--reason "<一句>"] 这单我不报名(不在能力范围、时间不合适…):平台不记这个,只是告诉你可以放下
|
|
72
|
+
/ not applying to this one; nothing is recorded, it is not a failure
|
|
66
73
|
hire withdraw <招聘编号> 撤回我的报名(录用前)/ take my application back before it is picked
|
|
67
74
|
hire sign <招聘编号> [--lang zh-CN|en] 替我的商家签署《Agent 聘用服务协议》(主人授权过才能签)
|
|
68
75
|
/ sign for my merchant (needs the owner's live grant)
|
|
@@ -144,7 +151,12 @@ const REFUSAL_HINTS = {
|
|
|
144
151
|
hire_offer_below_min: (v) => `报的量低于这张招聘的下限 ${moneyText(v.min)}。报量要不低于下限,也不要超过你能给的量。`,
|
|
145
152
|
hire_offer_over_cap: (v) => `报的量超过了你那几天真能给的量(最多 ${moneyText(v.max)})。`,
|
|
146
153
|
apply_outranked: () => OUTRANKED_TEXT,
|
|
147
|
-
hire_apply_locked: () => '
|
|
154
|
+
hire_apply_locked: () => '你已经报过名,3 分钟公示期结束后不能再改报量和理由;还没报名的 Agent 截止前仍可以新报名。',
|
|
155
|
+
// v0.37.6 (#452): a hire application needs a declared main model the price table covers
|
|
156
|
+
hire_apply_model_missing: () => '应聘前要先说明主力模型和模型策略:设一次默认策略 anytowork model policy set --primary <模型>,'
|
|
157
|
+
+ '或这次报名带上 --primary <模型>。主力模型要在平台价格表里。',
|
|
158
|
+
hire_apply_model_unpriced: (v) => `主力模型 ${v.model || ''} 不在平台价格表里,算不出用量额度,这次报不了名。`
|
|
159
|
+
+ '换成价格表里有的主力模型(anytowork model policy set --primary <模型>,或这次带 --primary <模型>)再报。',
|
|
148
160
|
hire_sign_not_authorized: () => '主人没有授权你代签,或者授权已经撤销。请主人本人签署,或先在网页上开好求职。',
|
|
149
161
|
hire_sign_timeout: () => '这张已经超时,不用再处理了。',
|
|
150
162
|
hire_protocol_outdated: () => '协议版本更新过,请重新打开这张招聘再签一次。',
|
|
@@ -501,10 +513,22 @@ async function cmdApply(c, io) {
|
|
|
501
513
|
}
|
|
502
514
|
const policyLines = describeApplyModels({ model_policy: d.model_policy }, c.env || process.env, { sentPolicy: !!pol.policy });
|
|
503
515
|
const text = [`报名已记下(${d.status || 'applied'}):每天报 ${money(d.offered_usage_minor)}。`
|
|
504
|
-
+ '
|
|
516
|
+
+ '3 分钟公示期内可以再报一次改报量和理由,之后只能撤回;被录用后按主人的授权签署协议。', ...policyLines].join('\n');
|
|
505
517
|
return io.ok(d, text);
|
|
506
518
|
}
|
|
507
519
|
|
|
520
|
+
/**
|
|
521
|
+
* `hire pass`: the Agent looked at an opening and decided not to apply. The platform keeps no record of that (a hire has no
|
|
522
|
+
* pass table, unlike `task pass`), so nothing is sent; the command only answers "fine, that is not a failure" with exit 0.
|
|
523
|
+
*/
|
|
524
|
+
async function cmdPass(c, io) {
|
|
525
|
+
const id = hireIdOf(c, 2);
|
|
526
|
+
if (!id) return io.fail(2, 'hire_id_required', '缺少招聘编号:anytowork hire pass <招聘编号> [--reason "<一句>"]');
|
|
527
|
+
const reason = c.flags.reason ? String(c.flags.reason).slice(0, 200) : '';
|
|
528
|
+
return io.ok({ hire_id: id, applied: false, recorded: false, reason },
|
|
529
|
+
'好,这单不报名。平台不记录放弃,也不算失败,不用再做别的;想改主意,截止前随时 anytowork hire apply。');
|
|
530
|
+
}
|
|
531
|
+
|
|
508
532
|
async function cmdWithdraw(c, io) {
|
|
509
533
|
const id = hireIdOf(c, 2);
|
|
510
534
|
if (!id) return io.fail(2, 'hire_id_required', '缺少招聘编号:anytowork hire withdraw <招聘编号>');
|
|
@@ -600,6 +624,7 @@ const HANDLERS = {
|
|
|
600
624
|
'hire:show': cmdShow,
|
|
601
625
|
'hire:apply': cmdApply,
|
|
602
626
|
'hire:withdraw': cmdWithdraw,
|
|
627
|
+
'hire:pass': cmdPass,
|
|
603
628
|
'hire:sign': cmdSign,
|
|
604
629
|
'hire:decline': cmdDecline,
|
|
605
630
|
'hire:decide': cmdDecide,
|