@parall/cli 1.24.0 → 1.25.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":"approvals.d.ts","sourceRoot":"","sources":["../../src/commands/approvals.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"approvals.d.ts","sourceRoot":"","sources":["../../src/commands/approvals.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,OAAO,QAkIxD"}
|
|
@@ -37,6 +37,20 @@ export function registerApprovalCommands(program) {
|
|
|
37
37
|
printError(err);
|
|
38
38
|
}
|
|
39
39
|
});
|
|
40
|
+
approvals
|
|
41
|
+
.command('get')
|
|
42
|
+
.description('Get the status of a specific approval request')
|
|
43
|
+
.argument('<approvalId>', 'Approval request ID')
|
|
44
|
+
.action(async (approvalId) => {
|
|
45
|
+
try {
|
|
46
|
+
const { client } = resolveCredentials();
|
|
47
|
+
const result = await client.getApproval(stripPrllScheme(approvalId));
|
|
48
|
+
printJson(result);
|
|
49
|
+
}
|
|
50
|
+
catch (err) {
|
|
51
|
+
printError(err);
|
|
52
|
+
}
|
|
53
|
+
});
|
|
40
54
|
approvals
|
|
41
55
|
.command('cancel')
|
|
42
56
|
.description('Cancel a pending approval request')
|
|
@@ -64,4 +78,55 @@ export function registerApprovalCommands(program) {
|
|
|
64
78
|
printError(err);
|
|
65
79
|
}
|
|
66
80
|
});
|
|
81
|
+
approvals
|
|
82
|
+
.command('wait')
|
|
83
|
+
.description('Wait for an approval to reach a terminal state')
|
|
84
|
+
.argument('<approvalId>', 'Approval request ID')
|
|
85
|
+
.option('--timeout <seconds>', 'Max seconds to wait', '300')
|
|
86
|
+
.action(async (approvalId, opts) => {
|
|
87
|
+
try {
|
|
88
|
+
const { client } = resolveCredentials();
|
|
89
|
+
const id = stripPrllScheme(approvalId);
|
|
90
|
+
const timeoutSeconds = Number(opts.timeout);
|
|
91
|
+
if (!Number.isFinite(timeoutSeconds) || timeoutSeconds <= 0) {
|
|
92
|
+
printError(new Error('--timeout must be a positive number of seconds'));
|
|
93
|
+
}
|
|
94
|
+
const timeoutMs = timeoutSeconds * 1000;
|
|
95
|
+
const pollMs = 5000;
|
|
96
|
+
const deadline = Date.now() + timeoutMs;
|
|
97
|
+
while (true) {
|
|
98
|
+
const approval = await client.getApproval(id);
|
|
99
|
+
const isTerminal = approval.status !== 'pending'
|
|
100
|
+
&& !(approval.status === 'approved' && !approval.execution_status);
|
|
101
|
+
if (isTerminal) {
|
|
102
|
+
printJson(approval);
|
|
103
|
+
const ok = approval.status === 'approved' && approval.execution_status === 'succeeded';
|
|
104
|
+
process.exit(ok ? 0 : 1);
|
|
105
|
+
}
|
|
106
|
+
const now = Date.now();
|
|
107
|
+
if (now >= deadline) {
|
|
108
|
+
printJson(approval);
|
|
109
|
+
console.error('Timed out waiting for approval decision');
|
|
110
|
+
process.exit(2);
|
|
111
|
+
}
|
|
112
|
+
await new Promise(r => setTimeout(r, Math.min(pollMs, deadline - now)));
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
catch (err) {
|
|
116
|
+
printError(err);
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
approvals
|
|
120
|
+
.command('actions')
|
|
121
|
+
.description('List available approval action types')
|
|
122
|
+
.action(async () => {
|
|
123
|
+
try {
|
|
124
|
+
const { client } = resolveCredentials();
|
|
125
|
+
const result = await client.getApprovableActions();
|
|
126
|
+
printJson(result);
|
|
127
|
+
}
|
|
128
|
+
catch (err) {
|
|
129
|
+
printError(err);
|
|
130
|
+
}
|
|
131
|
+
});
|
|
67
132
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chats.d.ts","sourceRoot":"","sources":["../../src/commands/chats.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"chats.d.ts","sourceRoot":"","sources":["../../src/commands/chats.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,QAyIpD"}
|
package/dist/commands/chats.js
CHANGED
|
@@ -34,6 +34,42 @@ export function registerChatCommands(program) {
|
|
|
34
34
|
printError(err);
|
|
35
35
|
}
|
|
36
36
|
});
|
|
37
|
+
chats
|
|
38
|
+
.command('discoverable')
|
|
39
|
+
.description('List discoverable chats in the organization')
|
|
40
|
+
.option('--query <q>', 'Optional name substring filter')
|
|
41
|
+
.option('--limit <n>', 'Maximum number of results', '20')
|
|
42
|
+
.action(async (opts) => {
|
|
43
|
+
try {
|
|
44
|
+
const { client, orgId } = resolveCredentials();
|
|
45
|
+
const params = {};
|
|
46
|
+
if (opts.query !== undefined)
|
|
47
|
+
params.q = opts.query;
|
|
48
|
+
const limit = Number(opts.limit);
|
|
49
|
+
if (Number.isFinite(limit))
|
|
50
|
+
params.limit = limit;
|
|
51
|
+
const result = await client.getDiscoverableChats(orgId, params);
|
|
52
|
+
printJson(result);
|
|
53
|
+
}
|
|
54
|
+
catch (err) {
|
|
55
|
+
printError(err);
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
chats
|
|
59
|
+
.command('join')
|
|
60
|
+
.description('Join a discoverable chat')
|
|
61
|
+
.argument('<chatId>', 'Chat ID')
|
|
62
|
+
.action(async (chatId) => {
|
|
63
|
+
try {
|
|
64
|
+
const { client, orgId } = resolveCredentials();
|
|
65
|
+
const result = await client.joinChat(orgId, stripPrllScheme(chatId));
|
|
66
|
+
printJson(result);
|
|
67
|
+
printRefHint(stripPrllScheme(chatId), 'Joined');
|
|
68
|
+
}
|
|
69
|
+
catch (err) {
|
|
70
|
+
printError(err);
|
|
71
|
+
}
|
|
72
|
+
});
|
|
37
73
|
chats
|
|
38
74
|
.command('create')
|
|
39
75
|
.description('Create a new chat')
|
package/dist/lib/output.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../src/lib/output.ts"],"names":[],"mappings":"AAEA,wBAAgB,SAAS,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAE7C;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,SAAY,GAAG,IAAI,CAEvE;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEvD;AAED,wBAAgB,UAAU,CAAC,GAAG,EAAE,OAAO,GAAG,KAAK,
|
|
1
|
+
{"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../src/lib/output.ts"],"names":[],"mappings":"AAEA,wBAAgB,SAAS,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAE7C;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,SAAY,GAAG,IAAI,CAEvE;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEvD;AAED,wBAAgB,UAAU,CAAC,GAAG,EAAE,OAAO,GAAG,KAAK,CAyB9C"}
|
package/dist/lib/output.js
CHANGED
|
@@ -20,13 +20,27 @@ export function printError(err) {
|
|
|
20
20
|
let msg;
|
|
21
21
|
if (err instanceof ApiError) {
|
|
22
22
|
msg = { error: err.message, status: err.status, ...(err.code ? { code: err.code } : {}) };
|
|
23
|
+
console.error(JSON.stringify(msg));
|
|
24
|
+
if (err.code === 'PERMISSION_DENIED' && err.extras) {
|
|
25
|
+
const { action, resource_uri } = err.extras;
|
|
26
|
+
// Subset of authz.Service.RegisteredActions() — only actions agents commonly encounter.
|
|
27
|
+
// Verify the full list via GET /approvals/actions.
|
|
28
|
+
const approvable = new Set([
|
|
29
|
+
'chat.delete', 'chat.archive', 'chat.restore',
|
|
30
|
+
'task.delete', 'task.archive', 'task.restore',
|
|
31
|
+
]);
|
|
32
|
+
if (typeof action === 'string' && typeof resource_uri === 'string' && approvable.has(action)) {
|
|
33
|
+
console.error(`Tip: parall approvals request --action ${action} --resource ${resource_uri} --chat <chat_id> --title "..." --reason "..."`);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
23
36
|
}
|
|
24
37
|
else if (err instanceof Error) {
|
|
25
38
|
msg = { error: err.message };
|
|
39
|
+
console.error(JSON.stringify(msg));
|
|
26
40
|
}
|
|
27
41
|
else {
|
|
28
42
|
msg = { error: String(err) };
|
|
43
|
+
console.error(JSON.stringify(msg));
|
|
29
44
|
}
|
|
30
|
-
console.error(JSON.stringify(msg));
|
|
31
45
|
return process.exit(1);
|
|
32
46
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@parall/cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.25.0",
|
|
4
4
|
"description": "CLI client for Parall — universal agent & human access to Parall API",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"@modelcontextprotocol/sdk": "1.27.1",
|
|
31
31
|
"commander": "^13.0.0",
|
|
32
32
|
"zod": "^4.3.6",
|
|
33
|
-
"@parall/sdk": "1.
|
|
33
|
+
"@parall/sdk": "1.25.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@types/node": "^22.0.0",
|