@parall/cli 1.78.0 → 1.79.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-access.d.ts +8 -0
- package/dist/commands/apps-access.d.ts.map +1 -0
- package/dist/commands/apps-access.js +141 -0
- package/dist/commands/apps-actions.d.ts +5 -3
- package/dist/commands/apps-actions.d.ts.map +1 -1
- package/dist/commands/apps-actions.js +5 -3
- package/dist/commands/apps-dev-page.d.ts +2 -0
- package/dist/commands/apps-dev-page.d.ts.map +1 -1
- package/dist/commands/apps-dev-page.js +3 -3
- package/dist/commands/apps-dev-server.d.ts +10 -1
- package/dist/commands/apps-dev-server.d.ts.map +1 -1
- package/dist/commands/apps-dev-server.js +26 -3
- package/dist/commands/apps-dev.d.ts +12 -1
- package/dist/commands/apps-dev.d.ts.map +1 -1
- package/dist/commands/apps-dev.js +25 -10
- package/dist/commands/apps-page-sdk.generated.d.ts +1 -1
- package/dist/commands/apps-page-sdk.generated.d.ts.map +1 -1
- package/dist/commands/apps-page-sdk.generated.js +1 -1
- package/dist/commands/apps-templates.gen.js +18 -18
- package/dist/commands/apps.d.ts +3 -2
- package/dist/commands/apps.d.ts.map +1 -1
- package/dist/commands/apps.js +10 -3
- package/dist/commands/chat-connections.d.ts +11 -0
- package/dist/commands/chat-connections.d.ts.map +1 -0
- package/dist/commands/chat-connections.js +162 -0
- package/dist/commands/chats.d.ts.map +1 -1
- package/dist/commands/chats.js +6 -1
- package/dist/commands/search.d.ts.map +1 -1
- package/dist/commands/search.js +1 -1
- package/dist/lib/output.d.ts +11 -0
- package/dist/lib/output.d.ts.map +1 -1
- package/dist/lib/output.js +32 -5
- package/package.json +4 -4
package/dist/commands/apps.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { Command } from 'commander';
|
|
2
2
|
/** Mini App entity: an agent-authored app of the organization, attached to
|
|
3
|
-
* a Database (docs/engineering-design/mini-app-design.md).
|
|
4
|
-
*
|
|
3
|
+
* a Database (docs/engineering-design/mini-app-design.md). How far each
|
|
4
|
+
* member reaches into an app is its access setting (`app access …`,
|
|
5
|
+
* apps-access.ts); its authors manage it. This file manages the entity and
|
|
5
6
|
* its author roster; `app db …` (apps-db.ts) is the app alias of the data
|
|
6
7
|
* plane, `parall db …` (dbs.ts) the Database itself; publish / versions /
|
|
7
8
|
* rollback / pull live in apps-publish.ts, the scaffold + local dev host
|
|
@@ -1 +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;
|
|
1
|
+
{"version":3,"file":"apps.d.ts","sourceRoot":"","sources":["../../src/commands/apps.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAazC;;;;;;;;;;;kEAWkE;AAClE,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,QAuMnD"}
|
package/dist/commands/apps.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { resolveCredentials } from '../lib/client.js';
|
|
2
2
|
import { printError, printJson, printRefHint, stripPrllScheme } from '../lib/output.js';
|
|
3
|
+
import { parseMemberLevel, registerAppAccessCommands } from './apps-access.js';
|
|
3
4
|
import { registerAppActionCommands } from './apps-actions.js';
|
|
4
5
|
import { registerAppAddCommand } from './apps-add.js';
|
|
5
6
|
import { appAndArg, appIdFrom, withApp } from './apps-args.js';
|
|
@@ -9,8 +10,9 @@ import { registerAppDevCommand } from './apps-dev.js';
|
|
|
9
10
|
import { registerAppPublishCommands } from './apps-publish.js';
|
|
10
11
|
import { registerAppScaffoldCommands } from './apps-scaffold.js';
|
|
11
12
|
/** Mini App entity: an agent-authored app of the organization, attached to
|
|
12
|
-
* a Database (docs/engineering-design/mini-app-design.md).
|
|
13
|
-
*
|
|
13
|
+
* a Database (docs/engineering-design/mini-app-design.md). How far each
|
|
14
|
+
* member reaches into an app is its access setting (`app access …`,
|
|
15
|
+
* apps-access.ts); its authors manage it. This file manages the entity and
|
|
14
16
|
* its author roster; `app db …` (apps-db.ts) is the app alias of the data
|
|
15
17
|
* plane, `parall db …` (dbs.ts) the Database itself; publish / versions /
|
|
16
18
|
* rollback / pull live in apps-publish.ts, the scaffold + local dev host
|
|
@@ -30,6 +32,7 @@ export function registerAppCommands(program) {
|
|
|
30
32
|
registerAppDevCommand(app);
|
|
31
33
|
registerAppCheckCommand(app);
|
|
32
34
|
registerAppActionCommands(app);
|
|
35
|
+
registerAppAccessCommands(app);
|
|
33
36
|
app
|
|
34
37
|
.command('list')
|
|
35
38
|
.description("List the organization's Mini Apps")
|
|
@@ -65,9 +68,9 @@ export function registerAppCommands(program) {
|
|
|
65
68
|
.option('--slug <slug>', 'URL slug (lowercase kebab-case; derived from the name when omitted)')
|
|
66
69
|
.option('--description <text>', 'App description')
|
|
67
70
|
.option('--database <dbId>', 'Attach to an existing Database of the organization (adb_…; author of one of its apps or org owner/admin); default: create one named after the app')
|
|
71
|
+
.option('--members <level>', 'How far everyone else in the organization reaches into the app from the start: read or write (default write; see parall app access --help)')
|
|
68
72
|
.action(async (opts) => {
|
|
69
73
|
try {
|
|
70
|
-
const { client, orgId } = resolveCredentials();
|
|
71
74
|
const data = { name: opts.name };
|
|
72
75
|
if (opts.slug)
|
|
73
76
|
data.slug = opts.slug;
|
|
@@ -75,6 +78,10 @@ export function registerAppCommands(program) {
|
|
|
75
78
|
data.description = opts.description;
|
|
76
79
|
if (opts.database)
|
|
77
80
|
data.database_id = stripPrllScheme(opts.database);
|
|
81
|
+
if (opts.members !== undefined) {
|
|
82
|
+
data.member_access = parseMemberLevel(opts.members, '--members');
|
|
83
|
+
}
|
|
84
|
+
const { client, orgId } = resolveCredentials();
|
|
78
85
|
const result = await client.createMiniApp(orgId, data);
|
|
79
86
|
printJson(result);
|
|
80
87
|
printRefHint(result.id);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Command } from 'commander';
|
|
2
|
+
/**
|
|
3
|
+
* Cross-org channel commands under `chats` (cross-org-channel-design.md §十二):
|
|
4
|
+
* inviting people from other orgs, answering one's own invitations, and the
|
|
5
|
+
* orgs a channel is connected to. Invitations are addressed to the account,
|
|
6
|
+
* so accepting names which of the caller's orgs joins (default PRLL_ORG_ID).
|
|
7
|
+
* Connecting, disconnecting and approving a reconnect are a person's
|
|
8
|
+
* decisions; the server refuses them for agents, which can only read.
|
|
9
|
+
*/
|
|
10
|
+
export declare function registerChatConnectionCommands(chats: Command): void;
|
|
11
|
+
//# sourceMappingURL=chat-connections.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-connections.d.ts","sourceRoot":"","sources":["../../src/commands/chat-connections.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAiBzC;;;;;;;GAOG;AACH,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,OAAO,QAwJ5D"}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { resolveCredentials } from '../lib/client.js';
|
|
2
|
+
import { printError, printJson, printProgress, stripPrllScheme } from '../lib/output.js';
|
|
3
|
+
/** Who must approve a pending reconnect; an older server sends no side. */
|
|
4
|
+
function reconnectNote(side) {
|
|
5
|
+
switch (side) {
|
|
6
|
+
case 'host':
|
|
7
|
+
return "Your organization had been disconnected by the channel's organization; it is back once that organization's channel owner or admin approves.";
|
|
8
|
+
case 'member_org':
|
|
9
|
+
return 'Your organization had disconnected itself from this channel; it is back once one of its admins runs "parall chats connections approve".';
|
|
10
|
+
default:
|
|
11
|
+
return 'Your organization had been disconnected from this channel; it is back once the side that disconnected it approves (see "parall chats connections list").';
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Cross-org channel commands under `chats` (cross-org-channel-design.md §十二):
|
|
16
|
+
* inviting people from other orgs, answering one's own invitations, and the
|
|
17
|
+
* orgs a channel is connected to. Invitations are addressed to the account,
|
|
18
|
+
* so accepting names which of the caller's orgs joins (default PRLL_ORG_ID).
|
|
19
|
+
* Connecting, disconnecting and approving a reconnect are a person's
|
|
20
|
+
* decisions; the server refuses them for agents, which can only read.
|
|
21
|
+
*/
|
|
22
|
+
export function registerChatConnectionCommands(chats) {
|
|
23
|
+
chats
|
|
24
|
+
.command('invite')
|
|
25
|
+
.description('Invite a person from another organization into a channel by email')
|
|
26
|
+
.argument('<chatId>', 'Chat ID')
|
|
27
|
+
.requiredOption('--email <email>', "The person's email address")
|
|
28
|
+
.action(async (chatId, opts) => {
|
|
29
|
+
try {
|
|
30
|
+
const { client, orgId } = resolveCredentials();
|
|
31
|
+
printJson(await client.createChatInvitation(orgId, stripPrllScheme(chatId), opts.email));
|
|
32
|
+
}
|
|
33
|
+
catch (err) {
|
|
34
|
+
printError(err);
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
const invitations = chats
|
|
38
|
+
.command('invitations')
|
|
39
|
+
.description('Channel invitations from other organizations');
|
|
40
|
+
invitations
|
|
41
|
+
.command('list')
|
|
42
|
+
.description("List your pending invitations, or a channel's pending invitations with --chat")
|
|
43
|
+
.option('--chat <chatId>', "List this channel's pending invitations instead (its own org)")
|
|
44
|
+
.action(async (opts) => {
|
|
45
|
+
try {
|
|
46
|
+
const { client, orgId } = resolveCredentials();
|
|
47
|
+
printJson({
|
|
48
|
+
data: opts.chat
|
|
49
|
+
? await client.listChatInvitations(orgId, stripPrllScheme(opts.chat))
|
|
50
|
+
: await client.getMyChatInvitations(),
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
catch (err) {
|
|
54
|
+
printError(err);
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
invitations
|
|
58
|
+
.command('accept')
|
|
59
|
+
.description('Accept an invitation, joining the channel as one of your organizations')
|
|
60
|
+
.argument('<invitationId>', 'Invitation ID (chi_…)')
|
|
61
|
+
.option('--as-org <orgId>', 'Which of your organizations joins (default: PRLL_ORG_ID)')
|
|
62
|
+
.action(async (invitationId, opts) => {
|
|
63
|
+
try {
|
|
64
|
+
const { client, orgId } = resolveCredentials();
|
|
65
|
+
const result = await client.acceptChatInvitation(invitationId, opts.asOrg ?? orgId);
|
|
66
|
+
printJson(result);
|
|
67
|
+
if (result.reconnect_pending)
|
|
68
|
+
printProgress(reconnectNote(result.reconnect_waits_for));
|
|
69
|
+
}
|
|
70
|
+
catch (err) {
|
|
71
|
+
printError(err);
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
invitations
|
|
75
|
+
.command('decline')
|
|
76
|
+
.description('Decline an invitation')
|
|
77
|
+
.argument('<invitationId>', 'Invitation ID (chi_…)')
|
|
78
|
+
.action(async (invitationId) => {
|
|
79
|
+
try {
|
|
80
|
+
const { client } = resolveCredentials();
|
|
81
|
+
printJson(await client.declineChatInvitation(invitationId));
|
|
82
|
+
}
|
|
83
|
+
catch (err) {
|
|
84
|
+
printError(err);
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
invitations
|
|
88
|
+
.command('revoke')
|
|
89
|
+
.description("Withdraw a pending invitation to one of your organization's channels")
|
|
90
|
+
.argument('<chatId>', 'Chat ID')
|
|
91
|
+
.argument('<invitationId>', 'Invitation ID (chi_…)')
|
|
92
|
+
.action(async (chatId, invitationId) => {
|
|
93
|
+
try {
|
|
94
|
+
const { client, orgId } = resolveCredentials();
|
|
95
|
+
await client.revokeChatInvitation(orgId, stripPrllScheme(chatId), invitationId);
|
|
96
|
+
printJson({ ok: true });
|
|
97
|
+
}
|
|
98
|
+
catch (err) {
|
|
99
|
+
printError(err);
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
const connections = chats
|
|
103
|
+
.command('connections')
|
|
104
|
+
.description('Organizations a shared channel is connected to');
|
|
105
|
+
connections
|
|
106
|
+
.command('list')
|
|
107
|
+
.description('List the organizations connected to a channel and their status')
|
|
108
|
+
.argument('<chatId>', 'Chat ID')
|
|
109
|
+
.action(async (chatId) => {
|
|
110
|
+
try {
|
|
111
|
+
const { client, orgId } = resolveCredentials();
|
|
112
|
+
printJson({ data: await client.listChatConnections(orgId, stripPrllScheme(chatId)) });
|
|
113
|
+
}
|
|
114
|
+
catch (err) {
|
|
115
|
+
printError(err);
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
const target = '--org <orgId>';
|
|
119
|
+
const targetHelp = "The connected organization (default: your own, PRLL_ORG_ID). From the channel's own organization, name the other organization";
|
|
120
|
+
connections
|
|
121
|
+
.command('disconnect')
|
|
122
|
+
.description("Disconnect an organization from a channel: its people and agents lose the channel at once. An org admin can disconnect their own organization; the channel's owner or admin can disconnect any other")
|
|
123
|
+
.argument('<chatId>', 'Chat ID')
|
|
124
|
+
.option(target, targetHelp)
|
|
125
|
+
.action(async (chatId, opts) => {
|
|
126
|
+
try {
|
|
127
|
+
const { client, orgId } = resolveCredentials();
|
|
128
|
+
printJson(await client.disconnectChatOrg(orgId, stripPrllScheme(chatId), opts.org ?? orgId));
|
|
129
|
+
}
|
|
130
|
+
catch (err) {
|
|
131
|
+
printError(err);
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
connections
|
|
135
|
+
.command('approve')
|
|
136
|
+
.description('Let a disconnected organization back in after it accepted a new invitation; only the side that disconnected it can')
|
|
137
|
+
.argument('<chatId>', 'Chat ID')
|
|
138
|
+
.option(target, targetHelp)
|
|
139
|
+
.action(async (chatId, opts) => {
|
|
140
|
+
try {
|
|
141
|
+
const { client, orgId } = resolveCredentials();
|
|
142
|
+
printJson(await client.approveChatReconnect(orgId, stripPrllScheme(chatId), opts.org ?? orgId));
|
|
143
|
+
}
|
|
144
|
+
catch (err) {
|
|
145
|
+
printError(err);
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
connections
|
|
149
|
+
.command('decline')
|
|
150
|
+
.description("Turn down a disconnected organization's reconnect; it stays disconnected")
|
|
151
|
+
.argument('<chatId>', 'Chat ID')
|
|
152
|
+
.option(target, targetHelp)
|
|
153
|
+
.action(async (chatId, opts) => {
|
|
154
|
+
try {
|
|
155
|
+
const { client, orgId } = resolveCredentials();
|
|
156
|
+
printJson(await client.declineChatReconnect(orgId, stripPrllScheme(chatId), opts.org ?? orgId));
|
|
157
|
+
}
|
|
158
|
+
catch (err) {
|
|
159
|
+
printError(err);
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chats.d.ts","sourceRoot":"","sources":["../../src/commands/chats.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"chats.d.ts","sourceRoot":"","sources":["../../src/commands/chats.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAepC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,QA6RpD"}
|
package/dist/commands/chats.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ApiError } from '@parall/sdk';
|
|
2
2
|
import { resolveCredentials } from '../lib/client.js';
|
|
3
3
|
import { printJson, printError, printRefHint, stripPrllScheme } from '../lib/output.js';
|
|
4
|
+
import { registerChatConnectionCommands } from './chat-connections.js';
|
|
4
5
|
/** Strict command grammar for --visibility; membership/discoverability
|
|
5
6
|
* semantics stay the server's domain. */
|
|
6
7
|
function resolveVisibilityFlag(value) {
|
|
@@ -254,7 +255,10 @@ export function registerChatCommands(program) {
|
|
|
254
255
|
printJson({ ok: true });
|
|
255
256
|
}
|
|
256
257
|
catch (err) {
|
|
257
|
-
|
|
258
|
+
// Someone from another organization joins a channel by invitation.
|
|
259
|
+
printError(err, undefined, err instanceof ApiError && err.code === 'NOT_ORG_MEMBER'
|
|
260
|
+
? `To bring in someone from another organization, invite them by email: parall chats invite ${stripPrllScheme(chatId)} --email <their email>`
|
|
261
|
+
: undefined);
|
|
258
262
|
}
|
|
259
263
|
});
|
|
260
264
|
members
|
|
@@ -272,4 +276,5 @@ export function registerChatCommands(program) {
|
|
|
272
276
|
printError(err);
|
|
273
277
|
}
|
|
274
278
|
});
|
|
279
|
+
registerChatConnectionCommands(chats);
|
|
275
280
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/commands/search.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAmBpC;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CASrE;AAED,MAAM,WAAW,UAAU;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,yEAAyE;AACzE,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,GAAG,YAAY,CA+B/E;AAED,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/commands/search.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAmBpC;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CASrE;AAED,MAAM,WAAW,UAAU;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,yEAAyE;AACzE,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,GAAG,YAAY,CA+B/E;AAED,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,QAoCtD"}
|
package/dist/commands/search.js
CHANGED
|
@@ -74,7 +74,7 @@ export function buildSearchParams(query, opts) {
|
|
|
74
74
|
export function registerSearchCommands(program) {
|
|
75
75
|
program
|
|
76
76
|
.command('search')
|
|
77
|
-
.description('Unified semantic search across messages, tasks, wiki, and comments
|
|
77
|
+
.description('Unified semantic search across messages, tasks, wiki, and comments in the organization, including channels it shares with other organizations')
|
|
78
78
|
.argument('<query>', 'Search query')
|
|
79
79
|
.option('--types <list>', 'Comma-separated entity types: m[essage], t[ask], w[iki], c[omment] (default: all)')
|
|
80
80
|
.option('--channel <chatId>', 'Narrow MESSAGE results to one chat — tasks/wiki unaffected (prll://cht_… or cht_…)')
|
package/dist/lib/output.d.ts
CHANGED
|
@@ -62,6 +62,17 @@ export declare function projectRosterNextStep(details: unknown): string | undefi
|
|
|
62
62
|
* the generic guidance.
|
|
63
63
|
*/
|
|
64
64
|
export declare function authorshipNextStep(details: unknown): string | undefined;
|
|
65
|
+
/**
|
|
66
|
+
* Plain-text next step for a Mini App access denial
|
|
67
|
+
* (mini-app-access-design.md §6.2): a 403 `PERMISSION_DENIED` naming
|
|
68
|
+
* `app.read` (the caller cannot open the app) or `app.action.write` (they
|
|
69
|
+
* can only view it) on a `prll://app_…`. Neither is approvable; the way in
|
|
70
|
+
* is a higher level on the app's access list, which its authors and org
|
|
71
|
+
* owners/admins can give. Someone who cannot open the app cannot read its
|
|
72
|
+
* author roster either, so that step names whoever sent the app instead.
|
|
73
|
+
* The server sends only the action and the app; the command is the CLI's.
|
|
74
|
+
*/
|
|
75
|
+
export declare function accessNextStep(action: string | undefined, resourceUri: string | undefined): string | undefined;
|
|
65
76
|
/** Prints the error and exits 1. `nextStep` is plain-text guidance printed
|
|
66
77
|
* after the error line of an API error. */
|
|
67
78
|
export declare function printError(err: unknown, attemptedPayload?: Record<string, unknown>, nextStep?: string): never;
|
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":"AAGA,wBAAgB,SAAS,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAE7C;AAID;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,IAAI,OAAO,CAoB3C;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAEhD;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;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAExD;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAW5E;AAmBD;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAe1E;AAaD;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAWvE;AASD;2CAC2C;AAC3C,wBAAgB,UAAU,CACxB,GAAG,EAAE,OAAO,EACZ,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC1C,QAAQ,CAAC,EAAE,MAAM,GAChB,KAAK,
|
|
1
|
+
{"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../src/lib/output.ts"],"names":[],"mappings":"AAGA,wBAAgB,SAAS,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAE7C;AAID;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,IAAI,OAAO,CAoB3C;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAEhD;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;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAExD;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAW5E;AAmBD;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAe1E;AAaD;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAWvE;AAED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,WAAW,EAAE,MAAM,GAAG,SAAS,GAC9B,MAAM,GAAG,SAAS,CAYpB;AASD;2CAC2C;AAC3C,wBAAgB,UAAU,CACxB,GAAG,EAAE,OAAO,EACZ,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC1C,QAAQ,CAAC,EAAE,MAAM,GAChB,KAAK,CAmEP"}
|
package/dist/lib/output.js
CHANGED
|
@@ -161,6 +161,30 @@ export function authorshipNextStep(details) {
|
|
|
161
161
|
: `The authors of any of ${apps.map((id) => `prll://${id}`).join(', ')}`;
|
|
162
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}`;
|
|
163
163
|
}
|
|
164
|
+
/**
|
|
165
|
+
* Plain-text next step for a Mini App access denial
|
|
166
|
+
* (mini-app-access-design.md §6.2): a 403 `PERMISSION_DENIED` naming
|
|
167
|
+
* `app.read` (the caller cannot open the app) or `app.action.write` (they
|
|
168
|
+
* can only view it) on a `prll://app_…`. Neither is approvable; the way in
|
|
169
|
+
* is a higher level on the app's access list, which its authors and org
|
|
170
|
+
* owners/admins can give. Someone who cannot open the app cannot read its
|
|
171
|
+
* author roster either, so that step names whoever sent the app instead.
|
|
172
|
+
* The server sends only the action and the app; the command is the CLI's.
|
|
173
|
+
*/
|
|
174
|
+
export function accessNextStep(action, resourceUri) {
|
|
175
|
+
if (!resourceUri?.startsWith('prll://app_'))
|
|
176
|
+
return undefined;
|
|
177
|
+
const me = process.env.PRLL_AGENT_ID?.trim();
|
|
178
|
+
const user = me?.startsWith('usr_') ? me : '<your user ID (parall whoami)>';
|
|
179
|
+
switch (action) {
|
|
180
|
+
case 'app.read':
|
|
181
|
+
return `You cannot open ${resourceUri}. Ask whoever sent it to you, one of its authors or an org owner/admin to run:\n parall app access add ${resourceUri} ${user} --level read`;
|
|
182
|
+
case 'app.action.write':
|
|
183
|
+
return `You can only view ${resourceUri}, so its write actions are refused. To be able to change it, ask one of its authors (parall app authors list ${resourceUri}) or an org owner/admin to run:\n parall app access add ${resourceUri} ${user} --level write`;
|
|
184
|
+
default:
|
|
185
|
+
return undefined;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
164
188
|
/** The request a refused card delete names (`details.approval_id`). */
|
|
165
189
|
function readApprovalId(details) {
|
|
166
190
|
if (!details || typeof details !== 'object')
|
|
@@ -182,12 +206,15 @@ export function printError(err, attemptedPayload, nextStep) {
|
|
|
182
206
|
...(err.approvable !== undefined ? { approvable: err.approvable } : {}),
|
|
183
207
|
...(err.extras ? { extras: err.extras } : {}),
|
|
184
208
|
}));
|
|
185
|
-
// Project-roster
|
|
186
|
-
// project
|
|
187
|
-
//
|
|
188
|
-
// below rather than
|
|
209
|
+
// Project-roster, Mini App authorship and Mini App access denials: the
|
|
210
|
+
// fix is joining the project, being added as an author or being given a
|
|
211
|
+
// level on the app (each its own action), not an approval of what was
|
|
212
|
+
// refused — so these replace the approval guidance below rather than
|
|
213
|
+
// adding to it.
|
|
189
214
|
const rosterStep = err.code === 'PERMISSION_DENIED'
|
|
190
|
-
? (projectRosterNextStep(err.extras?.details) ??
|
|
215
|
+
? (projectRosterNextStep(err.extras?.details) ??
|
|
216
|
+
authorshipNextStep(err.extras?.details) ??
|
|
217
|
+
accessNextStep(err.action, err.resourceUri))
|
|
191
218
|
: undefined;
|
|
192
219
|
if (rosterStep) {
|
|
193
220
|
console.error(rosterStep);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@parall/cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.79.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/
|
|
46
|
-
"@parall/
|
|
45
|
+
"@parall/agent-core": "1.79.0",
|
|
46
|
+
"@parall/sdk": "1.79.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.79.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",
|