@parall/cli 1.54.0 → 1.55.1

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.
@@ -35,7 +35,7 @@ export function registerProjectCommands(program) {
35
35
  .requiredOption('--name <name>', 'Project name')
36
36
  .requiredOption('--key <key>', 'Project key')
37
37
  .option('--description <text>', 'Project description')
38
- .option('--lead-id <id>', 'Lead user ID')
38
+ .option('--visibility <visibility>', 'public (whole org) or private (roster only)')
39
39
  .option('--color <hex>', 'Project color (hex)')
40
40
  .action(async (opts) => {
41
41
  try {
@@ -43,8 +43,8 @@ export function registerProjectCommands(program) {
43
43
  const data = { name: opts.name, key: opts.key };
44
44
  if (opts.description !== undefined)
45
45
  data.description = opts.description;
46
- if (opts.leadId !== undefined)
47
- data.lead_id = opts.leadId;
46
+ if (opts.visibility !== undefined)
47
+ data.visibility = opts.visibility;
48
48
  if (opts.color !== undefined)
49
49
  data.color = opts.color;
50
50
  const result = await client.createProject(orgId, data);
@@ -60,7 +60,7 @@ export function registerProjectCommands(program) {
60
60
  .argument('<projectId>', 'Project ID')
61
61
  .option('--name <name>', 'Project name')
62
62
  .option('--description <text>', 'Project description')
63
- .option('--lead-id <id>', 'Lead user ID')
63
+ .option('--visibility <visibility>', 'public (whole org) or private (roster only)')
64
64
  .option('--color <hex>', 'Project color (hex)')
65
65
  .option('--status <status>', 'Project status')
66
66
  .action(async (projectId, opts) => {
@@ -71,8 +71,8 @@ export function registerProjectCommands(program) {
71
71
  data.name = opts.name;
72
72
  if (opts.description !== undefined)
73
73
  data.description = opts.description;
74
- if (opts.leadId !== undefined)
75
- data.lead_id = opts.leadId;
74
+ if (opts.visibility !== undefined)
75
+ data.visibility = opts.visibility;
76
76
  if (opts.color !== undefined)
77
77
  data.color = opts.color;
78
78
  if (opts.status !== undefined)
@@ -6,7 +6,7 @@ export declare function buildCreateTaskData(opts: {
6
6
  status?: string;
7
7
  priority?: string;
8
8
  assigneeId?: string;
9
- projectId?: string;
9
+ projectId: string;
10
10
  parentId?: string;
11
11
  sourceChatId?: string;
12
12
  dueDate?: string;
@@ -17,7 +17,7 @@ export declare function buildCreateTaskData(opts: {
17
17
  status: string | undefined;
18
18
  priority: string | undefined;
19
19
  assignee_id: string | undefined;
20
- project_id: string | undefined;
20
+ project_id: string;
21
21
  parent_id: string | undefined;
22
22
  source_chat_id: string | undefined;
23
23
  planned_start_date: string | undefined;
@@ -29,7 +29,6 @@ export declare function buildUpdateTaskData(opts: {
29
29
  priority?: string;
30
30
  assigneeId?: string;
31
31
  description?: string;
32
- projectId?: string;
33
32
  parentId?: string;
34
33
  sortOrder?: string;
35
34
  placement?: string;
@@ -41,7 +40,6 @@ export declare function buildUpdateTaskData(opts: {
41
40
  priority: UpdateTaskRequest["priority"];
42
41
  assignee_id: string | undefined;
43
42
  description: string | undefined;
44
- project_id: string | undefined;
45
43
  parent_id: string | undefined;
46
44
  sort_order: number | undefined;
47
45
  placement: "end" | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"tasks.d.ts","sourceRoot":"","sources":["../../src/commands/tasks.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAgEpC,wBAAgB,mBAAmB,CAAC,IAAI,EAAE;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;;;;;;;;;;;GAaA;AAED,wBAAgB,mB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AAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;;YAS0B,iBAAiB,CAAC,QAAQ,CAAC;cACvB,iBAAiB,CAAC,UAAU,CAAC;;;;;;;;GAS3D;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,QA2WpD"}
@@ -66,7 +66,7 @@ export function buildCreateTaskData(opts) {
66
66
  status: opts.status,
67
67
  priority: opts.priority,
68
68
  assignee_id: opts.assigneeId ? stripPrllScheme(opts.assigneeId) : undefined,
69
- project_id: opts.projectId ? stripPrllScheme(opts.projectId) : undefined,
69
+ project_id: stripPrllScheme(opts.projectId),
70
70
  parent_id: opts.parentId ? stripPrllScheme(opts.parentId) : undefined,
71
71
  source_chat_id: opts.sourceChatId ? stripPrllScheme(opts.sourceChatId) : undefined,
72
72
  planned_start_date: resolveCreateDateFlag('--planned-start', opts.plannedStart),
@@ -86,7 +86,6 @@ export function buildUpdateTaskData(opts) {
86
86
  priority: opts.priority,
87
87
  assignee_id: opts.assigneeId ? stripPrllScheme(opts.assigneeId) : undefined,
88
88
  description: opts.description,
89
- project_id: opts.projectId ? stripPrllScheme(opts.projectId) : undefined,
90
89
  parent_id: opts.parentId ? stripPrllScheme(opts.parentId) : undefined,
91
90
  sort_order: resolveSortOrder(opts.sortOrder),
92
91
  placement: resolvePlacement(opts.placement),
@@ -137,7 +136,7 @@ export function registerTaskCommands(program) {
137
136
  .option('--status <status>', 'Task status')
138
137
  .option('--priority <priority>', 'Task priority')
139
138
  .option('--assignee-id <id>', 'Assignee user ID')
140
- .option('--project-id <id>', 'Project ID')
139
+ .requiredOption('--project-id <id>', 'Project ID the task is created in (required; run "parall projects list" to see available projects)')
141
140
  .option('--parent-id <id>', 'Parent task ID')
142
141
  .option('--source-chat-id <id>', 'Source chat ID')
143
142
  .option('--planned-start <date>', 'Planned start date (YYYY-MM-DD) — must be on or before --due-date when both are set')
@@ -179,7 +178,6 @@ export function registerTaskCommands(program) {
179
178
  .option('--priority <priority>', 'Task priority')
180
179
  .option('--assignee-id <id>', 'Assignee user ID')
181
180
  .option('--description <text>', 'Task description')
182
- .option('--project-id <id>', 'Project ID')
183
181
  .option('--parent-id <id>', 'Parent task ID')
184
182
  .option('--sort-order <n>', 'Explicit sort_order value — only for pinpoint insertion relative to cards you can see; to append to a status column use --placement end')
185
183
  .option('--placement <where>', 'Ordering intent — only "end" is accepted: appends the task to the end of its status column, position resolved by the server (mutually exclusive with --sort-order)')
@@ -5,8 +5,14 @@ import { Command } from 'commander';
5
5
  * architecture). The agent sends as the connected WeChat account itself;
6
6
  * the vendor token + device id never reach the runtime — api-server
7
7
  * performs the vendor call in-process.
8
+ *
9
+ * Verb surface = the vendor's in-scope interface aggregated: postText
10
+ * (send), fetchContactsList + getBriefInfo + getChatroomInfo (contacts),
11
+ * getProfile (profile), checkOnline (status). Every verb renders
12
+ * agent-readable text by default and `--json` for machine output.
13
+ *
8
14
  * INTERNAL research preview: the capability is flag-gated to the internal
9
- * org. Design: docs/engineering-design/wechat-channel-design.md §3.
15
+ * org. Design: docs/engineering-design/wechat-channel-design.md §3, §4.
10
16
  */
11
17
  export declare function registerWechatCommands(program: Command): void;
12
18
  //# sourceMappingURL=wechat.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"wechat.d.ts","sourceRoot":"","sources":["../../src/commands/wechat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,QA6CtD"}
1
+ {"version":3,"file":"wechat.d.ts","sourceRoot":"","sources":["../../src/commands/wechat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,QAwItD"}
@@ -1,13 +1,20 @@
1
1
  import { resolveCredentials } from '../lib/client.js';
2
2
  import { printError, printJson } from '../lib/output.js';
3
+ import { resolveMessageText, TEXT_FILE_OPTION_DESC, TEXT_OPTION_DESC } from '../lib/text-input.js';
3
4
  /**
4
5
  * `parall wechat …` — the per-vendor platform verb for the personal-WeChat
5
6
  * protocol channel (wechatapi.net, tier B in the multi-channel
6
7
  * architecture). The agent sends as the connected WeChat account itself;
7
8
  * the vendor token + device id never reach the runtime — api-server
8
9
  * performs the vendor call in-process.
10
+ *
11
+ * Verb surface = the vendor's in-scope interface aggregated: postText
12
+ * (send), fetchContactsList + getBriefInfo + getChatroomInfo (contacts),
13
+ * getProfile (profile), checkOnline (status). Every verb renders
14
+ * agent-readable text by default and `--json` for machine output.
15
+ *
9
16
  * INTERNAL research preview: the capability is flag-gated to the internal
10
- * org. Design: docs/engineering-design/wechat-channel-design.md §3.
17
+ * org. Design: docs/engineering-design/wechat-channel-design.md §3, §4.
11
18
  */
12
19
  export function registerWechatCommands(program) {
13
20
  const wechat = program
@@ -17,18 +24,29 @@ export function registerWechatCommands(program) {
17
24
  .command('send')
18
25
  .description('Send a message to a WeChat conversation this connection has seen inbound')
19
26
  .requiredOption('--to <wxid>', 'Vendor-native conversation id from the inbound event (a friend wxid, or a room id ending in @chatroom)')
20
- .requiredOption('--text <text>', 'Message text (plain text)')
27
+ .option('--text <text>', TEXT_OPTION_DESC)
28
+ .option('--text-file <path>', TEXT_FILE_OPTION_DESC)
21
29
  .option('--at <wxid>', 'In group replies: @-mention one member (wxid of the person you are answering)')
30
+ .option('--json', 'Emit the full machine-readable response instead of the readable summary')
22
31
  .action(async (opts) => {
23
32
  try {
33
+ const text = resolveMessageText(opts);
34
+ if (text === undefined || text === '') {
35
+ throw new Error('Provide --text or --text-file');
36
+ }
24
37
  const { client, orgId } = resolveCredentials();
25
38
  const sent = await client.sendChannelMessage(orgId, {
26
39
  channel_type: 'wechat',
27
40
  conversation_id: opts.to,
28
- text: opts.text,
41
+ text,
29
42
  ...(opts.at ? { at: opts.at } : {}),
30
43
  });
31
- printJson(sent);
44
+ if (opts.json) {
45
+ printJson(sent);
46
+ return;
47
+ }
48
+ const where = opts.at ? ` @${opts.at}` : '';
49
+ console.log(`sent: ${sent.message_id} → ${sent.conversation_id}${where} (wechat)`);
32
50
  }
33
51
  catch (err) {
34
52
  printError(err);
@@ -36,11 +54,81 @@ export function registerWechatCommands(program) {
36
54
  });
37
55
  wechat
38
56
  .command('contacts')
39
- .description('List the account address book: friend wxids, saved group room ids, followed official accounts (ids only — the vendor returns no names)')
40
- .action(async () => {
57
+ .description('List the account address book with display names: friends, saved groups, followed official accounts')
58
+ .option('--json', 'Emit the full machine-readable response instead of the readable summary')
59
+ .action(async (opts) => {
60
+ try {
61
+ const { client, orgId } = resolveCredentials();
62
+ const page = await client.listWechatContacts(orgId);
63
+ if (opts.json) {
64
+ printJson(page);
65
+ return;
66
+ }
67
+ const friendRows = page.friends.map((f) => `${f.wxid}\t${f.display}`.replace(/\t$/, ''));
68
+ const groupRows = page.chatrooms.map((c) => `${c.chatroom_id}\t${c.display}`.replace(/\t$/, ''));
69
+ console.log(`ADDRESS BOOK — friends: ${page.friends.length}, groups: ${page.chatrooms.length}, official accounts: ${page.ghs.length}`);
70
+ if (friendRows.length) {
71
+ console.log(`\nfriends (${page.friends.length}):\n ${friendRows.join('\n ')}`);
72
+ }
73
+ if (groupRows.length) {
74
+ console.log(`\ngroups (${page.chatrooms.length}):\n ${groupRows.join('\n ')}`);
75
+ }
76
+ if (page.ghs.length) {
77
+ console.log(`\nofficial accounts (${page.ghs.length}):\n ${page.ghs.join('\n ')}`);
78
+ }
79
+ }
80
+ catch (err) {
81
+ printError(err);
82
+ }
83
+ });
84
+ wechat
85
+ .command('profile')
86
+ .description('Show the connected WeChat account identity (wxid / alias / nickName / app id)')
87
+ .option('--json', 'Emit the full machine-readable response instead of the readable summary')
88
+ .action(async (opts) => {
89
+ try {
90
+ const { client, orgId } = resolveCredentials();
91
+ const view = await client.wechatProfile(orgId);
92
+ if (opts.json) {
93
+ printJson(view);
94
+ return;
95
+ }
96
+ console.log('ACCOUNT');
97
+ console.log(` wxid: ${view.wxid}`);
98
+ if (view.nick_name)
99
+ console.log(` nickName: ${view.nick_name}`);
100
+ if (view.alias)
101
+ console.log(` alias: ${view.alias}`);
102
+ console.log(` app_id: ${view.app_id}`);
103
+ }
104
+ catch (err) {
105
+ printError(err);
106
+ }
107
+ });
108
+ wechat
109
+ .command('status')
110
+ .description('Check the connection health: live online probe, identity, last offline time')
111
+ .option('--json', 'Emit the full machine-readable response instead of the readable summary')
112
+ .action(async (opts) => {
41
113
  try {
42
114
  const { client, orgId } = resolveCredentials();
43
- printJson(await client.listWechatContacts(orgId));
115
+ const view = await client.wechatStatus(orgId);
116
+ if (opts.json) {
117
+ printJson(view);
118
+ return;
119
+ }
120
+ const label = view.online ? 'ONLINE' : 'OFFLINE';
121
+ console.log(`WeChat account: ${label}`);
122
+ console.log(` wxid: ${view.wxid}`);
123
+ if (view.nick_name)
124
+ console.log(` nickName: ${view.nick_name}`);
125
+ if (view.alias)
126
+ console.log(` alias: ${view.alias}`);
127
+ console.log(` app_id: ${view.app_id}`);
128
+ console.log(` last_offline_at: ${view.last_offline_at ?? 'never'}`);
129
+ if (!view.online) {
130
+ console.log(' → the account is offline; a human must re-login on the vendor side. Stop and tell the user.');
131
+ }
44
132
  }
45
133
  catch (err) {
46
134
  printError(err);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parall/cli",
3
- "version": "1.54.0",
3
+ "version": "1.55.1",
4
4
  "description": "CLI client for Parall — universal agent & human access to Parall API",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -36,14 +36,14 @@
36
36
  "diff": "^8.0.3",
37
37
  "js-yaml": "^4.1.0",
38
38
  "zod": "^4.3.6",
39
- "@parall/sdk": "1.54.0",
40
- "@parall/agent-core": "1.54.0"
39
+ "@parall/agent-core": "1.55.1",
40
+ "@parall/sdk": "1.55.1"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@types/js-yaml": "^4.0.9",
44
44
  "@types/node": "^22.0.0",
45
45
  "typescript": "^5.7.0",
46
- "@parall/agent-core": "1.54.0"
46
+ "@parall/agent-core": "1.55.1"
47
47
  },
48
48
  "scripts": {
49
49
  "build": "tsc",