@parall/cli 1.75.0 → 1.76.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.
- package/dist/commands/approvals.d.ts.map +1 -1
- package/dist/commands/approvals.js +40 -13
- package/dist/commands/apps-action-local.d.ts +6 -1
- package/dist/commands/apps-action-local.d.ts.map +1 -1
- package/dist/commands/apps-action-local.js +11 -2
- package/dist/commands/apps-actions-sdk.generated.d.ts +1 -1
- package/dist/commands/apps-actions-sdk.generated.d.ts.map +1 -1
- package/dist/commands/apps-actions-sdk.generated.js +1 -1
- package/dist/commands/apps-actions.d.ts.map +1 -1
- package/dist/commands/apps-actions.js +13 -15
- package/dist/commands/apps-add.js +2 -2
- package/dist/commands/apps-args.d.ts +22 -0
- package/dist/commands/apps-args.d.ts.map +1 -0
- package/dist/commands/apps-args.js +62 -0
- package/dist/commands/apps-check.d.ts.map +1 -1
- package/dist/commands/apps-check.js +8 -3
- package/dist/commands/apps-db.d.ts +3 -1
- package/dist/commands/apps-db.d.ts.map +1 -1
- package/dist/commands/apps-db.js +4 -7
- package/dist/commands/apps-dev-server.d.ts +3 -0
- package/dist/commands/apps-dev-server.d.ts.map +1 -1
- package/dist/commands/apps-dev-server.js +4 -0
- package/dist/commands/apps-dev-vars.d.ts +38 -0
- package/dist/commands/apps-dev-vars.d.ts.map +1 -0
- package/dist/commands/apps-dev-vars.js +107 -0
- package/dist/commands/apps-dev.d.ts.map +1 -1
- package/dist/commands/apps-dev.js +2 -1
- package/dist/commands/apps-local-runner.generated.d.ts +2 -1
- package/dist/commands/apps-local-runner.generated.d.ts.map +1 -1
- package/dist/commands/apps-local-runner.generated.js +2 -1
- package/dist/commands/apps-publish.d.ts +3 -1
- package/dist/commands/apps-publish.d.ts.map +1 -1
- package/dist/commands/apps-publish.js +27 -23
- package/dist/commands/apps-templates.gen.js +3 -3
- package/dist/commands/apps.d.ts.map +1 -1
- package/dist/commands/apps.js +35 -40
- package/dist/commands/comments.d.ts.map +1 -1
- package/dist/commands/comments.js +3 -2
- package/dist/commands/db-plane.d.ts +5 -14
- package/dist/commands/db-plane.d.ts.map +1 -1
- package/dist/commands/db-plane.js +63 -32
- package/dist/commands/db-target.d.ts +22 -0
- package/dist/commands/db-target.d.ts.map +1 -0
- package/dist/commands/db-target.js +43 -0
- package/dist/commands/dbs.d.ts +3 -6
- package/dist/commands/dbs.d.ts.map +1 -1
- package/dist/commands/dbs.js +28 -34
- package/dist/commands/secrets.d.ts +3 -0
- package/dist/commands/secrets.d.ts.map +1 -0
- package/dist/commands/secrets.js +66 -0
- package/dist/index.js +18 -2
- package/dist/lib/approvers.d.ts +12 -0
- package/dist/lib/approvers.d.ts.map +1 -0
- package/dist/lib/approvers.js +48 -0
- package/dist/lib/output.d.ts +19 -0
- package/dist/lib/output.d.ts.map +1 -1
- package/dist/lib/output.js +59 -2
- package/dist/lib/update-check.d.ts +4 -0
- package/dist/lib/update-check.d.ts.map +1 -1
- package/dist/lib/update-check.js +3 -1
- package/package.json +4 -4
package/dist/lib/output.js
CHANGED
|
@@ -1,13 +1,58 @@
|
|
|
1
|
+
import { fstatSync } from 'node:fs';
|
|
1
2
|
import { ApiError } from '@parall/sdk';
|
|
2
3
|
export function printJson(data) {
|
|
3
4
|
console.log(JSON.stringify(data, null, 2));
|
|
4
5
|
}
|
|
6
|
+
let joined;
|
|
7
|
+
/**
|
|
8
|
+
* Whether stderr goes into the same pipe as stdout: `parall … 2>&1 | jq`,
|
|
9
|
+
* `$(parall … 2>&1)`, or a caller reading both streams through one pipe or
|
|
10
|
+
* socket (Python `stderr=STDOUT`, Node `exec('parall … 2>&1')`). Then a
|
|
11
|
+
* line on stderr lands inside the output a script is parsing, so the CLI
|
|
12
|
+
* keeps its progress lines and hints to itself and stdout stays exactly the
|
|
13
|
+
* result. Errors are still written: there is no result to protect then.
|
|
14
|
+
*
|
|
15
|
+
* One regular file behind both streams does not count. An agent harness
|
|
16
|
+
* hands a command one file for both and shows it to the model (Claude
|
|
17
|
+
* Code's Bash tool does), and the model needs those lines; `> run.log 2>&1`
|
|
18
|
+
* asks for a log, not a result.
|
|
19
|
+
*/
|
|
20
|
+
export function stderrJoinsStdout() {
|
|
21
|
+
if (joined === undefined) {
|
|
22
|
+
joined = false;
|
|
23
|
+
if (!process.stdout.isTTY && !process.stderr.isTTY) {
|
|
24
|
+
try {
|
|
25
|
+
const out = fstatSync(1);
|
|
26
|
+
const err = fstatSync(2);
|
|
27
|
+
// ino 0: a platform without inode numbers for pipes (Windows) —
|
|
28
|
+
// unknown, so keep the lines.
|
|
29
|
+
joined =
|
|
30
|
+
(out.isFIFO() || out.isSocket()) &&
|
|
31
|
+
out.ino !== 0 &&
|
|
32
|
+
out.dev === err.dev &&
|
|
33
|
+
out.ino === err.ino;
|
|
34
|
+
}
|
|
35
|
+
catch {
|
|
36
|
+
joined = false;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return joined;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* A progress or status line for the person or agent watching: on stderr,
|
|
44
|
+
* never inside a result (see stderrJoinsStdout).
|
|
45
|
+
*/
|
|
46
|
+
export function printProgress(line) {
|
|
47
|
+
if (!stderrJoinsStdout())
|
|
48
|
+
console.error(line);
|
|
49
|
+
}
|
|
5
50
|
/**
|
|
6
51
|
* Print a prll:// URI hint to stderr after a mutation command.
|
|
7
52
|
* Does not affect stdout JSON, but LLMs see it and can copy-paste the URI.
|
|
8
53
|
*/
|
|
9
54
|
export function printRefHint(entityId, action = 'Created') {
|
|
10
|
-
|
|
55
|
+
printProgress(`${action}: prll://${entityId}`);
|
|
11
56
|
}
|
|
12
57
|
/**
|
|
13
58
|
* Strip the `prll://` scheme prefix from an entity ID if present.
|
|
@@ -116,6 +161,13 @@ export function authorshipNextStep(details) {
|
|
|
116
161
|
: `The authors of any of ${apps.map((id) => `prll://${id}`).join(', ')}`;
|
|
117
162
|
return `${whose} and org owners/admins can do this. To become an author, ask one of its authors (parall app authors list ${app}) or an org owner/admin to run:\n parall app authors add ${app} ${user}`;
|
|
118
163
|
}
|
|
164
|
+
/** The request a refused card delete names (`details.approval_id`). */
|
|
165
|
+
function readApprovalId(details) {
|
|
166
|
+
if (!details || typeof details !== 'object')
|
|
167
|
+
return undefined;
|
|
168
|
+
const id = details.approval_id;
|
|
169
|
+
return typeof id === 'string' && id ? id : undefined;
|
|
170
|
+
}
|
|
119
171
|
/** Prints the error and exits 1. `nextStep` is plain-text guidance printed
|
|
120
172
|
* after the error line of an API error. */
|
|
121
173
|
export function printError(err, attemptedPayload, nextStep) {
|
|
@@ -161,9 +213,14 @@ export function printError(err, attemptedPayload, nextStep) {
|
|
|
161
213
|
const payloadArg = attemptedPayload
|
|
162
214
|
? ` --payload '${JSON.stringify(attemptedPayload).replaceAll("'", `'\\''`)}'`
|
|
163
215
|
: '';
|
|
164
|
-
|
|
216
|
+
const resource = err.resourceUri ?? '<resource>';
|
|
217
|
+
console.error(`${lead} First see who can approve it and pick a chat one of them is in (a direct chat with them works):\n parall approvals approvers --action ${err.action} --resource ${resource}${payloadArg} --chat ${chat}\nThen request approval there:\n parall approvals request --action ${err.action} --resource ${resource}${payloadArg} --chat ${chat} --title "..." --reason "..."`);
|
|
165
218
|
}
|
|
166
219
|
}
|
|
220
|
+
if (err.code === 'CARD_NOT_DELETABLE') {
|
|
221
|
+
const approvalId = readApprovalId(err.extras?.details);
|
|
222
|
+
console.error(`This card's request is still waiting. Withdraw the request instead:\n parall approvals cancel ${approvalId ?? '<approval_id>'}`);
|
|
223
|
+
}
|
|
167
224
|
if (nextStep)
|
|
168
225
|
console.error(nextStep);
|
|
169
226
|
}
|
|
@@ -5,6 +5,10 @@ type UpdateNotifierOptions = {
|
|
|
5
5
|
cachePath?: string;
|
|
6
6
|
spawnWorker?: (cachePath: string) => void;
|
|
7
7
|
writeHint?: (hint: string) => void;
|
|
8
|
+
/** False while a hint has nowhere to go but into the command's result
|
|
9
|
+
* (stderr merged into stdout); the hint then waits for a later command
|
|
10
|
+
* instead of counting as shown. */
|
|
11
|
+
canWriteHint?: () => boolean;
|
|
8
12
|
disabled?: boolean;
|
|
9
13
|
};
|
|
10
14
|
type RefreshOptions = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-check.d.ts","sourceRoot":"","sources":["../../src/lib/update-check.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAW3C,eAAO,MAAM,uBAAuB,OAAQ,CAAC;AAS7C,KAAK,qBAAqB,GAAG;IAC3B,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,KAAK,cAAc,GAAG;IACpB,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,sBAAsB,EAAE,MAAM,IAAI,CAAC;CACpC,CAAC;AAQF,wBAAgB,cAAc,CAAC,cAAc,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,OAAO,CAUrF;AA4CD;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,MAAM,EACjB,GAAG,GAAE,MAAM,MAAiB,GAC3B,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,CAkErB;AAgBD,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,GAAE,OAAO,KAAa,GAAG,IAAI,CAW/F;AAWD,wBAAgB,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EAAE,MAAM,EACtB,OAAO,GAAE,qBAA0B,GAClC,cAAc,CA2DhB;AAED,wBAAsB,kBAAkB,CACtC,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE,cAAmB,GAC3B,OAAO,CAAC,IAAI,CAAC,CA+Bf"}
|
package/dist/lib/update-check.js
CHANGED
|
@@ -183,6 +183,7 @@ export function createUpdateNotifier(currentVersion, options = {}) {
|
|
|
183
183
|
const cachePath = options.cachePath ?? defaultCachePath();
|
|
184
184
|
const spawnWorker = options.spawnWorker ?? spawnUpdateCheckWorker;
|
|
185
185
|
const writeHint = options.writeHint ?? ((hint) => process.stderr.write(hint));
|
|
186
|
+
const canWriteHint = options.canWriteHint ?? (() => true);
|
|
186
187
|
const disabled = options.disabled ?? updateChecksDisabled();
|
|
187
188
|
return {
|
|
188
189
|
afterSuccessfulCommand: () => {
|
|
@@ -195,7 +196,8 @@ export function createUpdateNotifier(currentVersion, options = {}) {
|
|
|
195
196
|
let changed = false;
|
|
196
197
|
if (state.latest_version &&
|
|
197
198
|
isNewerRelease(currentVersion, state.latest_version) &&
|
|
198
|
-
timestamp - (state.last_notified_at ?? 0) >= CHECK_INTERVAL_MS
|
|
199
|
+
timestamp - (state.last_notified_at ?? 0) >= CHECK_INTERVAL_MS &&
|
|
200
|
+
canWriteHint()) {
|
|
199
201
|
hint =
|
|
200
202
|
`Update available: parall ${currentVersion} → ${state.latest_version}. ` +
|
|
201
203
|
'Upgrade @parall/cli@latest with your package manager.\n';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@parall/cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.76.0",
|
|
4
4
|
"description": "CLI client for Parall — universal agent & human access to Parall API",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
"node-diff3": "3.2.1",
|
|
43
43
|
"tar-stream": "^3.2.1",
|
|
44
44
|
"zod": "^4.3.6",
|
|
45
|
-
"@parall/agent-core": "1.
|
|
46
|
-
"@parall/sdk": "1.
|
|
45
|
+
"@parall/agent-core": "1.76.0",
|
|
46
|
+
"@parall/sdk": "1.76.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@dnd-kit/core": "6.3.1",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"tw-animate-css": "1.4.0",
|
|
72
72
|
"typescript": "^5.7.0",
|
|
73
73
|
"vite": "6.4.1",
|
|
74
|
-
"@parall/agent-core": "1.
|
|
74
|
+
"@parall/agent-core": "1.76.0"
|
|
75
75
|
},
|
|
76
76
|
"scripts": {
|
|
77
77
|
"build": "node scripts/generate-miniapp-sdk.mjs --check && node scripts/generate-local-runner.mjs --check && node scripts/generate-app-templates.mjs --check && tsc",
|