@parall/cli 1.82.0 → 1.83.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.
@@ -20,6 +20,15 @@ export declare function resolveInitTarget(raw: string): Promise<InitTarget>;
20
20
  export declare function templateRefusal(template: AppTemplate, target: InitTarget): string | undefined;
21
21
  /** The project's files, sorted by path. */
22
22
  export declare function templateProject(name: string, template: AppTemplate): Array<[string, string]>;
23
+ /** The `--actions` scaffold with the template's overlay over it, sorted by
24
+ * path: the project before init adds the skill and the template's blocks.
25
+ * Named {{APP_NAME}}, it is the project a template version carries
26
+ * (mini-app-template-registry-design.md §4). */
27
+ export declare function templateProjectFiles(name: string, template: AppTemplate): Array<[string, string]>;
28
+ /** The project with the template's skill as SKILL.md and, under the title
29
+ * of AGENTS.md, the line that points to it: what init writes beside the
30
+ * project, sorted by path. */
31
+ export declare function withTemplateSkill(project: ReadonlyArray<readonly [string, string]>, template: AppTemplate): Array<[string, string]>;
23
32
  /** The blocks the template names (_overlay.json `blocks`). */
24
33
  export declare function templateBlocks(template: AppTemplate): string[];
25
34
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"apps-template-init.d.ts","sourceRoot":"","sources":["../../src/commands/apps-template-init.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAKpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAE9D;;;;;;;GAOG;AAEH;eACe;AACf,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,gBAAgB,CAAC;CAC7B;AAED,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAYxE;AAED,8EAA8E;AAC9E,wBAAgB,eAAe,CAAC,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,GAAG,M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AYD,2CAA2C;AAC3C,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,GAAG,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAE5F;AAED;;;gDAGgD;AAChD,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,GAAG,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAajG;AAED;;8BAE8B;AAC9B,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,aAAa,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EACjD,QAAQ,EAAE,WAAW,GACpB,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAQzB;AAMD,8DAA8D;AAC9D,wBAAgB,cAAc,CAAC,QAAQ,EAAE,WAAW,GAAG,MAAM,EAAE,CAG9D;AAED;;;;GAIG;AACH,wBAAsB,oBAAoB,CACxC,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EAC9B,MAAM,EAAE,MAAM,EAAE,GACf,OAAO,CAAC,IAAI,CAAC,CAkCf;AAED,wCAAwC;AACxC,wBAAgB,iBAAiB,CAAC,CAAC,EAAE;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,WAAW,CAAC;IACtB,MAAM,EAAE,UAAU,CAAC;CACpB,GAAG,MAAM,CAcT"}
@@ -34,6 +34,13 @@ function skillPointer(template) {
34
34
  }
35
35
  /** The project's files, sorted by path. */
36
36
  export function templateProject(name, template) {
37
+ return withTemplateSkill(templateProjectFiles(name, template), template);
38
+ }
39
+ /** The `--actions` scaffold with the template's overlay over it, sorted by
40
+ * path: the project before init adds the skill and the template's blocks.
41
+ * Named {{APP_NAME}}, it is the project a template version carries
42
+ * (mini-app-template-registry-design.md §4). */
43
+ export function templateProjectFiles(name, template) {
37
44
  const files = new Map(scaffoldProject({ name, actions: true }));
38
45
  const pkg = files.get('package.json');
39
46
  applyOverlay(files, template.overlay);
@@ -46,11 +53,21 @@ export function templateProject(name, template) {
46
53
  }
47
54
  files.set('package.json', `${JSON.stringify(merged, null, 2)}\n`);
48
55
  }
56
+ return sortedByPath(files);
57
+ }
58
+ /** The project with the template's skill as SKILL.md and, under the title
59
+ * of AGENTS.md, the line that points to it: what init writes beside the
60
+ * project, sorted by path. */
61
+ export function withTemplateSkill(project, template) {
62
+ const files = new Map(project);
49
63
  files.set('SKILL.md', template.skill);
50
64
  const agents = (files.get('AGENTS.md') ?? '').split('\n');
51
65
  const at = agents[0]?.startsWith('# ') ? 1 : 0;
52
66
  agents.splice(at, 0, ...(at ? ['', skillPointer(template)] : [skillPointer(template), '']));
53
67
  files.set('AGENTS.md', agents.join('\n'));
68
+ return sortedByPath(files);
69
+ }
70
+ function sortedByPath(files) {
54
71
  return [...files].sort(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0));
55
72
  }
56
73
  /** The blocks the template names (_overlay.json `blocks`). */
@@ -12,6 +12,14 @@ export interface ScaffoldOptions {
12
12
  }
13
13
  /** The project's files, sorted by path. */
14
14
  export declare function scaffoldProject(options: ScaffoldOptions): Array<[string, string]>;
15
+ /**
16
+ * Names a project whose app name was left as {{APP_NAME}} — the project a
17
+ * template version carries, scaffold, overlay and blocks already laid
18
+ * together (mini-app-template-registry-design.md §4) — the way
19
+ * scaffoldProject names one: the placeholder takes the name, escaped in HTML
20
+ * files, and package.json's name is the npm-valid form of it.
21
+ */
22
+ export declare function nameProject(files: ReadonlyArray<readonly [string, string]>, name: string): Array<[string, string]>;
15
23
  /** An npm-valid package name from a directory name ("My App" → "my-app"). */
16
24
  export declare function packageName(name: string): string;
17
25
  /** Applies the --actions overlay: _overlay.json's remove list drops base
@@ -1 +1 @@
1
- {"version":3,"file":"apps-template.d.ts","sourceRoot":"","sources":["../../src/commands/apps-template.ts"],"names":[],"mappings":"AA+BA;mBACmB;AACnB,MAAM,MAAM,UAAU,GAAG,UAAU,GAAG,OAAO,CAAC;AAE9C,MAAM,WAAW,eAAe;IAC9B,mDAAmD;IACnD,IAAI,EAAE,MAAM,CAAC;IACb,wDAAwD;IACxD,OAAO,EAAE,OAAO,CAAC;IACjB;4CACwC;IACxC,OAAO,CAAC,EAAE,UAAU,CAAC;CACtB;AAED,2CAA2C;AAC3C,wBAAgB,eAAe,CAAC,OAAO,EAAE,eAAe,GAAG,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CA8BjF;AAMD,6EAA6E;AAC7E,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAOhD;AAED;;;eAGe;AACf,wBAAgB,YAAY,CAC1B,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAC1B,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,QAoB1C;AAED,6EAA6E;AAC7E,wBAAgB,SAAS,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO,CAO/D;AAED,0EAA0E;AAC1E,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAIxE"}
1
+ {"version":3,"file":"apps-template.d.ts","sourceRoot":"","sources":["../../src/commands/apps-template.ts"],"names":[],"mappings":"AA+BA;mBACmB;AACnB,MAAM,MAAM,UAAU,GAAG,UAAU,GAAG,OAAO,CAAC;AAE9C,MAAM,WAAW,eAAe;IAC9B,mDAAmD;IACnD,IAAI,EAAE,MAAM,CAAC;IACb,wDAAwD;IACxD,OAAO,EAAE,OAAO,CAAC;IACjB;4CACwC;IACxC,OAAO,CAAC,EAAE,UAAU,CAAC;CACtB;AAED,2CAA2C;AAC3C,wBAAgB,eAAe,CAAC,OAAO,EAAE,eAAe,GAAG,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CA8BjF;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,aAAa,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EAC/C,IAAI,EAAE,MAAM,GACX,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAYzB;AAMD,6EAA6E;AAC7E,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAOhD;AAED;;;eAGe;AACf,wBAAgB,YAAY,CAC1B,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAC1B,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,QAoB1C;AAED,6EAA6E;AAC7E,wBAAgB,SAAS,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO,CAO/D;AAED,0EAA0E;AAC1E,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAIxE"}
@@ -57,6 +57,26 @@ export function scaffoldProject(options) {
57
57
  }
58
58
  return out.sort(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0));
59
59
  }
60
+ /**
61
+ * Names a project whose app name was left as {{APP_NAME}} — the project a
62
+ * template version carries, scaffold, overlay and blocks already laid
63
+ * together (mini-app-template-registry-design.md §4) — the way
64
+ * scaffoldProject names one: the placeholder takes the name, escaped in HTML
65
+ * files, and package.json's name is the npm-valid form of it.
66
+ */
67
+ export function nameProject(files, name) {
68
+ return files.map(([path, content]) => {
69
+ let named = content;
70
+ if (path === 'package.json') {
71
+ const pkg = JSON.parse(content);
72
+ pkg.name = packageName(name);
73
+ named = `${JSON.stringify(pkg, null, 2)}\n`;
74
+ }
75
+ const value = path.endsWith('.html') ? escapeHtml(name) : name;
76
+ // A function, so a `$&` in the name is not a replacement pattern.
77
+ return [path, named.replace(NAME_PLACEHOLDER, () => value)];
78
+ });
79
+ }
60
80
  function escapeHtml(text) {
61
81
  return text.replace(/[&<>"']/g, (c) => `&#${c.charCodeAt(0)};`);
62
82
  }
@@ -1,3 +1,5 @@
1
1
  import { Command } from 'commander';
2
+ /** Accepts team_… or prll://team_…; anything else is refused before a request. */
3
+ export declare function parseTeamId(raw: string, usage: string): string;
2
4
  export declare function registerTeamCommands(program: Command): void;
3
5
  //# sourceMappingURL=teams.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"teams.d.ts","sourceRoot":"","sources":["../../src/commands/teams.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAOpC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,QAiGpD"}
1
+ {"version":3,"file":"teams.d.ts","sourceRoot":"","sources":["../../src/commands/teams.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,kFAAkF;AAClF,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAM9D;AAMD,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,QAuIpD"}
@@ -1,8 +1,16 @@
1
1
  import { resolveCredentials } from '../lib/client.js';
2
- import { printJson, printError, stripPrllScheme } from '../lib/output.js';
3
- // Teams are pure permission rosters (ACL subjects for wiki/project ACLs);
4
- // server-side authorization decides who may mutate them — the CLI only
5
- // exposes the same surface the web Teams settings use.
2
+ import { printJson, printError, printProgress, stripPrllScheme } from '../lib/output.js';
3
+ /** Accepts team_… or prll://team_…; anything else is refused before a request. */
4
+ export function parseTeamId(raw, usage) {
5
+ const id = stripPrllScheme(raw.trim());
6
+ if (id.startsWith('team_'))
7
+ return id;
8
+ throw new Error(`parall teams ${usage} takes a team ID (team_… or prll://team_…), got "${raw}". List teams with: parall teams list`);
9
+ }
10
+ // Teams are permission rosters (ACL subjects for wiki/project ACLs) that can
11
+ // nest: a grant to a team reaches the members of every team below it.
12
+ // Server-side authorization decides who may mutate them — the CLI only exposes
13
+ // the same surface the web Teams settings use.
6
14
  export function registerTeamCommands(program) {
7
15
  const teams = program.command('teams').description('Manage permission teams');
8
16
  teams
@@ -32,15 +40,43 @@ export function registerTeamCommands(program) {
32
40
  printError(err);
33
41
  }
34
42
  });
43
+ teams
44
+ .command('move')
45
+ .description('Place a team under another team, or back at the top level (org admin)')
46
+ .argument('<teamId>', 'Team to move (team_... or prll://team_...)')
47
+ .option('--under <parentTeamId>', "Parent team: its grants then reach this team's members")
48
+ .option('--top', 'Move the team to the top level')
49
+ .addHelpText('after', '\nExamples:\n parall teams move team_web --under team_eng\n parall teams move team_web --top\n')
50
+ .action(async (teamArg, opts) => {
51
+ try {
52
+ const teamId = parseTeamId(teamArg, 'move');
53
+ if (Boolean(opts.under) === Boolean(opts.top)) {
54
+ throw new Error(`Pass exactly one of --under or --top, e.g. parall teams move ${teamId} --under <team_…>`);
55
+ }
56
+ const parentId = opts.under ? parseTeamId(opts.under, 'move --under') : null;
57
+ const { client, orgId } = resolveCredentials();
58
+ const team = await client.setTeamParent(orgId, teamId, parentId);
59
+ printJson(team);
60
+ printProgress(parentId
61
+ ? `Moved prll://${teamId} under prll://${parentId}`
62
+ : `Moved prll://${teamId} to the top level`);
63
+ }
64
+ catch (err) {
65
+ printError(err);
66
+ }
67
+ });
35
68
  const members = teams.command('members').description('Manage a team roster');
36
69
  members
37
70
  .command('list')
38
71
  .description('List team members')
39
72
  .argument('<teamId>', 'Team ID')
40
- .action(async (teamId) => {
73
+ .option('--include-subteams', 'Also list members of every team below it (rows carry via_team_id)')
74
+ .action(async (teamId, opts) => {
41
75
  try {
42
76
  const { client, orgId } = resolveCredentials();
43
- const result = await client.getTeamMembers(orgId, stripPrllScheme(teamId));
77
+ const result = await client.getTeamMembers(orgId, stripPrllScheme(teamId), {
78
+ includeSubteams: Boolean(opts.includeSubteams),
79
+ });
44
80
  printJson(result);
45
81
  }
46
82
  catch (err) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parall/cli",
3
- "version": "1.82.0",
3
+ "version": "1.83.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.82.0",
46
- "@parall/sdk": "1.82.0"
45
+ "@parall/agent-core": "1.83.0",
46
+ "@parall/sdk": "1.83.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.82.0"
74
+ "@parall/agent-core": "1.83.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 && node scripts/generate-app-template-catalog.mjs --check && tsc",