@parall/cli 1.46.0 → 1.47.0
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slack.d.ts","sourceRoot":"","sources":["../../src/commands/slack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"slack.d.ts","sourceRoot":"","sources":["../../src/commands/slack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,QAgIrD"}
|
package/dist/commands/slack.js
CHANGED
|
@@ -16,7 +16,7 @@ export function registerSlackCommands(program) {
|
|
|
16
16
|
.description('Send a message to a Slack conversation this connection has seen inbound')
|
|
17
17
|
.requiredOption('--channel <channelId>', 'Vendor-native conversation id from the inbound event (C…/G…/D…)')
|
|
18
18
|
.requiredOption('--text <text>', 'Message text (plain text)')
|
|
19
|
-
.option('--reply-to <messageId>', 'Inbound message id you are answering ({channel}:{ts}); REQUIRED in channels (reply lands in its thread)
|
|
19
|
+
.option('--reply-to <messageId>', 'Inbound message id you are answering ({channel}:{ts}, thread children {channel}:{root}#{ts}); REQUIRED in channels (reply lands in its thread). In DMs pass it too: a thread-child id lands the reply in that thread, a bare id keeps the main flow — the session never forks either way')
|
|
20
20
|
.action(async (opts) => {
|
|
21
21
|
try {
|
|
22
22
|
const { client, orgId } = resolveCredentials();
|
|
@@ -32,4 +32,100 @@ export function registerSlackCommands(program) {
|
|
|
32
32
|
printError(err);
|
|
33
33
|
}
|
|
34
34
|
});
|
|
35
|
+
// Read verbs: workspace visibility as the bot sees it. Authorization is
|
|
36
|
+
// the bot's own Slack permissions (invite it to a channel to read that
|
|
37
|
+
// channel's history) — reads are not limited to seen conversations.
|
|
38
|
+
// Fail fast on a malformed --limit instead of silently falling back to
|
|
39
|
+
// the server default page size.
|
|
40
|
+
const page = (opts) => {
|
|
41
|
+
let limit;
|
|
42
|
+
if (opts.limit !== undefined) {
|
|
43
|
+
limit = Number(opts.limit);
|
|
44
|
+
if (!Number.isInteger(limit) || limit < 1 || limit > 200) {
|
|
45
|
+
throw new Error('--limit must be an integer between 1 and 200');
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return {
|
|
49
|
+
...(opts.cursor ? { cursor: opts.cursor } : {}),
|
|
50
|
+
...(limit !== undefined ? { limit } : {}),
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
slack
|
|
54
|
+
.command('channels')
|
|
55
|
+
.description('List workspace channels as the bot sees them (is_member marks joined ones)')
|
|
56
|
+
.option('--cursor <cursor>', 'Pagination cursor from a previous page')
|
|
57
|
+
.option('--limit <n>', 'Page size (max 200)')
|
|
58
|
+
.action(async (opts) => {
|
|
59
|
+
try {
|
|
60
|
+
const { client, orgId } = resolveCredentials();
|
|
61
|
+
printJson(await client.listSlackChannels(orgId, page(opts)));
|
|
62
|
+
}
|
|
63
|
+
catch (err) {
|
|
64
|
+
printError(err);
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
slack
|
|
68
|
+
.command('users')
|
|
69
|
+
.description('List workspace members')
|
|
70
|
+
.option('--cursor <cursor>', 'Pagination cursor from a previous page')
|
|
71
|
+
.option('--limit <n>', 'Page size (max 200)')
|
|
72
|
+
.action(async (opts) => {
|
|
73
|
+
try {
|
|
74
|
+
const { client, orgId } = resolveCredentials();
|
|
75
|
+
printJson(await client.listSlackUsers(orgId, page(opts)));
|
|
76
|
+
}
|
|
77
|
+
catch (err) {
|
|
78
|
+
printError(err);
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
slack
|
|
82
|
+
.command('history')
|
|
83
|
+
.description('Read a conversation message history (bot must be able to see it)')
|
|
84
|
+
.requiredOption('--conversation <id>', 'Vendor-native conversation id (C…/G…/D…)')
|
|
85
|
+
.option('--cursor <cursor>', 'Pagination cursor from a previous page')
|
|
86
|
+
.option('--limit <n>', 'Page size (max 200)')
|
|
87
|
+
.action(async (opts) => {
|
|
88
|
+
try {
|
|
89
|
+
const { client, orgId } = resolveCredentials();
|
|
90
|
+
printJson(await client.slackHistory(orgId, opts.conversation, page(opts)));
|
|
91
|
+
}
|
|
92
|
+
catch (err) {
|
|
93
|
+
printError(err);
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
slack
|
|
97
|
+
.command('status')
|
|
98
|
+
.description('Set/clear the Agents-pane typing indicator on an assistant thread (cosmetic)')
|
|
99
|
+
.requiredOption('--conversation <id>', 'DM conversation id (D…)')
|
|
100
|
+
.requiredOption('--thread <rootTs>', "The assistant thread's root ts")
|
|
101
|
+
.option('--text <status>', 'Status text (omit to clear)', '')
|
|
102
|
+
.action(async (opts) => {
|
|
103
|
+
try {
|
|
104
|
+
const { client, orgId } = resolveCredentials();
|
|
105
|
+
await client.setSlackStatus(orgId, {
|
|
106
|
+
conversation: opts.conversation,
|
|
107
|
+
thread_ts: opts.thread,
|
|
108
|
+
status: opts.text ?? '',
|
|
109
|
+
});
|
|
110
|
+
printJson({ ok: true });
|
|
111
|
+
}
|
|
112
|
+
catch (err) {
|
|
113
|
+
printError(err);
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
slack
|
|
117
|
+
.command('members')
|
|
118
|
+
.description('List a conversation member ids (resolve names via `parall slack users`)')
|
|
119
|
+
.requiredOption('--conversation <id>', 'Vendor-native conversation id (C…/G…)')
|
|
120
|
+
.option('--cursor <cursor>', 'Pagination cursor from a previous page')
|
|
121
|
+
.option('--limit <n>', 'Page size (max 200)')
|
|
122
|
+
.action(async (opts) => {
|
|
123
|
+
try {
|
|
124
|
+
const { client, orgId } = resolveCredentials();
|
|
125
|
+
printJson(await client.slackMembers(orgId, opts.conversation, page(opts)));
|
|
126
|
+
}
|
|
127
|
+
catch (err) {
|
|
128
|
+
printError(err);
|
|
129
|
+
}
|
|
130
|
+
});
|
|
35
131
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@parall/cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.47.0",
|
|
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/agent-core": "1.
|
|
40
|
-
"@parall/sdk": "1.
|
|
39
|
+
"@parall/agent-core": "1.47.0",
|
|
40
|
+
"@parall/sdk": "1.47.0"
|
|
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.
|
|
46
|
+
"@parall/agent-core": "1.47.0"
|
|
47
47
|
},
|
|
48
48
|
"scripts": {
|
|
49
49
|
"build": "tsc",
|