@parall/cli 1.66.0 → 1.67.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/apps.d.ts +8 -0
- package/dist/commands/apps.d.ts.map +1 -0
- package/dist/commands/apps.js +173 -0
- package/dist/index.js +18 -16
- package/package.json +4 -4
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Command } from 'commander';
|
|
2
|
+
/** Mini App entity: an agent-authored app with its own database
|
|
3
|
+
* (docs/engineering-design/mini-app-design.md). This slice manages the entity
|
|
4
|
+
* and its author roster; the data plane (`db query/exec`), publishing and the
|
|
5
|
+
* scaffold arrive in later slices. Every command answers 404 while the
|
|
6
|
+
* deployment has cap:mini-apps off. */
|
|
7
|
+
export declare function registerAppCommands(program: Command): void;
|
|
8
|
+
//# sourceMappingURL=apps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apps.d.ts","sourceRoot":"","sources":["../../src/commands/apps.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIzC;;;;uCAIuC;AACvC,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,QAuKnD"}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { resolveCredentials } from '../lib/client.js';
|
|
2
|
+
import { printError, printJson, printRefHint, stripPrllScheme } from '../lib/output.js';
|
|
3
|
+
/** Mini App entity: an agent-authored app with its own database
|
|
4
|
+
* (docs/engineering-design/mini-app-design.md). This slice manages the entity
|
|
5
|
+
* and its author roster; the data plane (`db query/exec`), publishing and the
|
|
6
|
+
* scaffold arrive in later slices. Every command answers 404 while the
|
|
7
|
+
* deployment has cap:mini-apps off. */
|
|
8
|
+
export function registerAppCommands(program) {
|
|
9
|
+
const app = program
|
|
10
|
+
.command('app')
|
|
11
|
+
.description('Manage Mini Apps (agent-authored apps with their own database)');
|
|
12
|
+
app
|
|
13
|
+
.command('list')
|
|
14
|
+
.description('List Mini Apps in projects you can read')
|
|
15
|
+
.option('--project <projectId>', 'Only apps in this project')
|
|
16
|
+
.option('--include-archived', 'Include archived apps')
|
|
17
|
+
.action(async (opts) => {
|
|
18
|
+
try {
|
|
19
|
+
const { client, orgId } = resolveCredentials();
|
|
20
|
+
const result = await client.getMiniApps(orgId, {
|
|
21
|
+
project_id: opts.project ? stripPrllScheme(opts.project) : undefined,
|
|
22
|
+
include_archived: Boolean(opts.includeArchived),
|
|
23
|
+
});
|
|
24
|
+
printJson(result);
|
|
25
|
+
}
|
|
26
|
+
catch (err) {
|
|
27
|
+
printError(err);
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
app
|
|
31
|
+
.command('get')
|
|
32
|
+
.description('Get a Mini App by ID')
|
|
33
|
+
.argument('<appId>', 'App ID (app_… or prll://app_…)')
|
|
34
|
+
.action(async (appId) => {
|
|
35
|
+
try {
|
|
36
|
+
const { client, orgId } = resolveCredentials();
|
|
37
|
+
printJson(await client.getMiniApp(orgId, stripPrllScheme(appId)));
|
|
38
|
+
}
|
|
39
|
+
catch (err) {
|
|
40
|
+
printError(err);
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
app
|
|
44
|
+
.command('create')
|
|
45
|
+
.description('Create a Mini App in a project you are a member of')
|
|
46
|
+
.requiredOption('--project <projectId>', 'Project the app belongs to')
|
|
47
|
+
.requiredOption('--name <name>', 'App name')
|
|
48
|
+
.option('--slug <slug>', 'URL slug (lowercase kebab-case; derived from the name when omitted)')
|
|
49
|
+
.option('--description <text>', 'App description')
|
|
50
|
+
.option('--members-read-only', 'Only authors and project managers may write app data')
|
|
51
|
+
.action(async (opts) => {
|
|
52
|
+
try {
|
|
53
|
+
const { client, orgId } = resolveCredentials();
|
|
54
|
+
const data = {
|
|
55
|
+
project_id: stripPrllScheme(opts.project),
|
|
56
|
+
name: opts.name,
|
|
57
|
+
};
|
|
58
|
+
if (opts.slug)
|
|
59
|
+
data.slug = opts.slug;
|
|
60
|
+
if (opts.description)
|
|
61
|
+
data.description = opts.description;
|
|
62
|
+
if (opts.membersReadOnly)
|
|
63
|
+
data.members_read_only = true;
|
|
64
|
+
const result = await client.createMiniApp(orgId, data);
|
|
65
|
+
printJson(result);
|
|
66
|
+
printRefHint(result.id);
|
|
67
|
+
}
|
|
68
|
+
catch (err) {
|
|
69
|
+
printError(err);
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
app
|
|
73
|
+
.command('update')
|
|
74
|
+
.description('Update a Mini App (project manager)')
|
|
75
|
+
.argument('<appId>', 'App ID')
|
|
76
|
+
.option('--name <name>', 'New name')
|
|
77
|
+
.option('--description <text>', 'New description (empty string clears)')
|
|
78
|
+
.option('--members-read-only <bool>', 'true = only authors and managers may write app data')
|
|
79
|
+
.action(async (appId, opts) => {
|
|
80
|
+
try {
|
|
81
|
+
const { client, orgId } = resolveCredentials();
|
|
82
|
+
const data = {};
|
|
83
|
+
if (opts.name !== undefined)
|
|
84
|
+
data.name = opts.name;
|
|
85
|
+
if (opts.description !== undefined)
|
|
86
|
+
data.description = opts.description;
|
|
87
|
+
if (opts.membersReadOnly !== undefined) {
|
|
88
|
+
if (opts.membersReadOnly !== 'true' && opts.membersReadOnly !== 'false') {
|
|
89
|
+
throw new Error('--members-read-only must be true or false');
|
|
90
|
+
}
|
|
91
|
+
data.members_read_only = opts.membersReadOnly === 'true';
|
|
92
|
+
}
|
|
93
|
+
if (Object.keys(data).length === 0) {
|
|
94
|
+
throw new Error('Nothing to update: pass at least one of --name, --description, --members-read-only');
|
|
95
|
+
}
|
|
96
|
+
printJson(await client.updateMiniApp(orgId, stripPrllScheme(appId), data));
|
|
97
|
+
}
|
|
98
|
+
catch (err) {
|
|
99
|
+
printError(err);
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
app
|
|
103
|
+
.command('archive')
|
|
104
|
+
.description('Archive a Mini App (project manager); data and versions are kept')
|
|
105
|
+
.argument('<appId>', 'App ID')
|
|
106
|
+
.action(async (appId) => {
|
|
107
|
+
try {
|
|
108
|
+
const { client, orgId } = resolveCredentials();
|
|
109
|
+
printJson(await client.archiveMiniApp(orgId, stripPrllScheme(appId)));
|
|
110
|
+
}
|
|
111
|
+
catch (err) {
|
|
112
|
+
printError(err);
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
app
|
|
116
|
+
.command('restore')
|
|
117
|
+
.description('Restore an archived Mini App (project manager)')
|
|
118
|
+
.argument('<appId>', 'App ID')
|
|
119
|
+
.action(async (appId) => {
|
|
120
|
+
try {
|
|
121
|
+
const { client, orgId } = resolveCredentials();
|
|
122
|
+
printJson(await client.restoreMiniApp(orgId, stripPrllScheme(appId)));
|
|
123
|
+
}
|
|
124
|
+
catch (err) {
|
|
125
|
+
printError(err);
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
const authors = app
|
|
129
|
+
.command('authors')
|
|
130
|
+
.description('Manage who may publish versions and change the app schema');
|
|
131
|
+
authors
|
|
132
|
+
.command('list')
|
|
133
|
+
.description('List the authors of a Mini App')
|
|
134
|
+
.argument('<appId>', 'App ID')
|
|
135
|
+
.action(async (appId) => {
|
|
136
|
+
try {
|
|
137
|
+
const { client, orgId } = resolveCredentials();
|
|
138
|
+
printJson(await client.getMiniAppAuthors(orgId, stripPrllScheme(appId)));
|
|
139
|
+
}
|
|
140
|
+
catch (err) {
|
|
141
|
+
printError(err);
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
authors
|
|
145
|
+
.command('add')
|
|
146
|
+
.description('Add an author (project manager); the user must be on the project roster')
|
|
147
|
+
.argument('<appId>', 'App ID')
|
|
148
|
+
.argument('<userId>', 'User or agent ID (usr_…)')
|
|
149
|
+
.action(async (appId, userId) => {
|
|
150
|
+
try {
|
|
151
|
+
const { client, orgId } = resolveCredentials();
|
|
152
|
+
printJson(await client.addMiniAppAuthor(orgId, stripPrllScheme(appId), stripPrllScheme(userId)));
|
|
153
|
+
}
|
|
154
|
+
catch (err) {
|
|
155
|
+
printError(err);
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
authors
|
|
159
|
+
.command('remove')
|
|
160
|
+
.description('Remove an author (project manager); the creator cannot be removed')
|
|
161
|
+
.argument('<appId>', 'App ID')
|
|
162
|
+
.argument('<userId>', 'User or agent ID (usr_…)')
|
|
163
|
+
.action(async (appId, userId) => {
|
|
164
|
+
try {
|
|
165
|
+
const { client, orgId } = resolveCredentials();
|
|
166
|
+
await client.removeMiniAppAuthor(orgId, stripPrllScheme(appId), stripPrllScheme(userId));
|
|
167
|
+
console.error(`Removed ${stripPrllScheme(userId)} from the authors of ${stripPrllScheme(appId)}`);
|
|
168
|
+
}
|
|
169
|
+
catch (err) {
|
|
170
|
+
printError(err);
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
}
|
package/dist/index.js
CHANGED
|
@@ -1,32 +1,33 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { createRequire } from 'module';
|
|
3
2
|
import { Command } from 'commander';
|
|
3
|
+
import { createRequire } from 'module';
|
|
4
4
|
import { registerAgentCommands } from './commands/agents.js';
|
|
5
5
|
import { registerApprovalCommands } from './commands/approvals.js';
|
|
6
|
+
import { registerAppCommands } from './commands/apps.js';
|
|
7
|
+
import { registerBrowserCommands } from './commands/browser.js';
|
|
6
8
|
import { registerChatCommands } from './commands/chats.js';
|
|
7
|
-
import {
|
|
8
|
-
import { registerMessageCommands } from './commands/messages.js';
|
|
9
|
-
import { registerTaskCommands } from './commands/tasks.js';
|
|
9
|
+
import { registerClipCommands } from './commands/clip.js';
|
|
10
10
|
import { registerCommentCommands } from './commands/comments.js';
|
|
11
|
+
import { registerDMCommands } from './commands/dm.js';
|
|
12
|
+
import { registerFileCommands } from './commands/files.js';
|
|
11
13
|
import { registerLabelCommands } from './commands/labels.js';
|
|
12
|
-
import {
|
|
13
|
-
import { registerProfileCommands } from './commands/profile.js';
|
|
14
|
-
import { registerTeamCommands } from './commands/teams.js';
|
|
15
|
-
import { registerScheduleCommands } from './commands/schedules.js';
|
|
16
|
-
import { registerTriggerCommands } from './commands/triggers.js';
|
|
17
|
-
import { registerUserCommands } from './commands/users.js';
|
|
18
|
-
import { registerWikiCommands } from './commands/wiki.js';
|
|
14
|
+
import { registerMachineCommands } from './commands/machines.js';
|
|
19
15
|
import { registerMcpCommands } from './commands/mcp.js';
|
|
16
|
+
import { registerMessageCommands } from './commands/messages.js';
|
|
20
17
|
import { registerNoReplyCommands } from './commands/no-reply.js';
|
|
18
|
+
import { registerProfileCommands } from './commands/profile.js';
|
|
19
|
+
import { registerProjectCommands } from './commands/projects.js';
|
|
21
20
|
import { registerRefCommands } from './commands/refs.js';
|
|
21
|
+
import { registerScheduleCommands } from './commands/schedules.js';
|
|
22
22
|
import { registerSearchCommands } from './commands/search.js';
|
|
23
|
-
import { registerFileCommands } from './commands/files.js';
|
|
24
|
-
import { registerMachineCommands } from './commands/machines.js';
|
|
25
|
-
import { registerBrowserCommands } from './commands/browser.js';
|
|
26
|
-
import { registerClipCommands } from './commands/clip.js';
|
|
27
23
|
import { registerSlackCommands } from './commands/slack.js';
|
|
28
|
-
import {
|
|
24
|
+
import { registerTaskCommands } from './commands/tasks.js';
|
|
25
|
+
import { registerTeamCommands } from './commands/teams.js';
|
|
26
|
+
import { registerTriggerCommands } from './commands/triggers.js';
|
|
27
|
+
import { registerUserCommands } from './commands/users.js';
|
|
29
28
|
import { registerWatchCommands } from './commands/watch.js';
|
|
29
|
+
import { registerWechatCommands } from './commands/wechat.js';
|
|
30
|
+
import { registerWikiCommands } from './commands/wiki.js';
|
|
30
31
|
import { createUpdateNotifier } from './lib/update-check.js';
|
|
31
32
|
const version = typeof __PARALL_CLI_VERSION__ === 'string'
|
|
32
33
|
? __PARALL_CLI_VERSION__
|
|
@@ -45,6 +46,7 @@ registerWatchCommands(program);
|
|
|
45
46
|
registerTaskCommands(program);
|
|
46
47
|
registerCommentCommands(program);
|
|
47
48
|
registerLabelCommands(program);
|
|
49
|
+
registerAppCommands(program);
|
|
48
50
|
registerProjectCommands(program);
|
|
49
51
|
registerProfileCommands(program);
|
|
50
52
|
registerTeamCommands(program);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@parall/cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.67.0",
|
|
4
4
|
"description": "CLI client for Parall — universal agent & human access to Parall API",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -37,15 +37,15 @@
|
|
|
37
37
|
"js-yaml": "^4.1.0",
|
|
38
38
|
"node-diff3": "3.2.1",
|
|
39
39
|
"zod": "^4.3.6",
|
|
40
|
-
"@parall/agent-core": "1.
|
|
41
|
-
"@parall/sdk": "1.
|
|
40
|
+
"@parall/agent-core": "1.67.0",
|
|
41
|
+
"@parall/sdk": "1.67.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@types/js-yaml": "^4.0.9",
|
|
45
45
|
"@types/node": "^22.0.0",
|
|
46
46
|
"esbuild": "^0.25.0",
|
|
47
47
|
"typescript": "^5.7.0",
|
|
48
|
-
"@parall/agent-core": "1.
|
|
48
|
+
"@parall/agent-core": "1.67.0"
|
|
49
49
|
},
|
|
50
50
|
"scripts": {
|
|
51
51
|
"build": "tsc",
|