@anytowork/cli 0.12.38 → 0.12.39

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/format.js +9 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anytowork/cli",
3
- "version": "0.12.38",
3
+ "version": "0.12.39",
4
4
  "description": "AnytoWork 平台命令行工具——让任何能执行 shell 命令的 Agent 用一条命令接入 AnytoWork:登录、发单接单、管理能力。",
5
5
  "type": "module",
6
6
  "bin": {
package/src/format.js CHANGED
@@ -114,6 +114,12 @@ function asJson(data) {
114
114
  * @param {object} data { tasks, total }
115
115
  * @param {object} opts { json }
116
116
  */
117
+ /** v0.38.0: the platform's `sim_notice` ({en, zh}) as one line; empty when the order carries none. */
118
+ function simNoticeText(n) {
119
+ if (!n || typeof n !== 'object') return '';
120
+ return [n.zh, n.en].filter(Boolean).join(' / ');
121
+ }
122
+
117
123
  export function formatHall(data, { json = false } = {}) {
118
124
  if (json) return asJson(data);
119
125
  const tasks = data.tasks || [];
@@ -133,6 +139,7 @@ export function formatHall(data, { json = false } = {}) {
133
139
  else if (t.my_application_status === 'pending') mark = ' 【已报名·等选人】';
134
140
  else if (t.my_application_status === 'outranked') mark = ` 【${OUTRANKED_LABEL}】`;
135
141
  lines.push(` • ${t.title} —— 赏金 ${bounty}${mark}`);
142
+ if (t.sim_notice) lines.push(` ⚠ ${simNoticeText(t.sim_notice)}`);
136
143
  if (t.description) {
137
144
  const desc = String(t.description).slice(0, 50);
138
145
  lines.push(` ${desc}${String(t.description).length > 50 ? '…' : ''}`);
@@ -253,6 +260,7 @@ export function formatTaskApply(data, { json = false, env, sentPolicy = true } =
253
260
  if (data.quote_cents != null) lines.push(` 我的报价(整单成交价):${moneyText(data.quote_cents, data.currency)}`);
254
261
  if (data.status) lines.push(` 申请状态:${applicationStatusText(data.status)}`);
255
262
  if (data.task_status) lines.push(` 任务当前状态:${data.task_status}`);
263
+ if (data.sim_notice) lines.push(` ⚠ ${simNoticeText(data.sim_notice)}`);
256
264
  // v0.27.25: the models the platform stored (normalised names), the notes, and the promise reminder
257
265
  lines.push(...describeApplyModels(data, env, { sentPolicy }));
258
266
  return lines.join('\n');
@@ -518,6 +526,7 @@ export function formatTaskDetail(data, { json = false } = {}) {
518
526
  // v0.20.0: when the platform sent the buyer-input shell, print that (prefixed); else the plain field.
519
527
  if (data.title_input || data.title) lines.push(` 标题:${data.title_input ? shellText(data.title_input) : data.title}`);
520
528
  if (data.status) lines.push(` 状态:${data.status}`);
529
+ if (data.sim_notice) lines.push(` ⚠ ${simNoticeText(data.sim_notice)}`);
521
530
  // v0.26.58: after a refund the settled amount (paid - refunded) is the real number; the posted price stays as a note
522
531
  const money = data.money;
523
532
  if (money && money.has_payment && money.refund_cents > 0) {