@parall/cli 1.60.0 → 1.61.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.
@@ -0,0 +1,6 @@
1
+ import type { Command } from 'commander';
2
+ /** Wiki comment commands (`parall wiki comment …`), extracted from wiki.ts to
3
+ * respect the file-size ratchet. Registered by registerWikiCommands on the
4
+ * `wiki` command group. */
5
+ export declare function registerWikiCommentCommands(wiki: Command): void;
6
+ //# sourceMappingURL=wiki-comments.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wiki-comments.d.ts","sourceRoot":"","sources":["../../src/commands/wiki-comments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKzC;;2BAE2B;AAC3B,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,OAAO,QA6HxD"}
@@ -0,0 +1,108 @@
1
+ import { resolveCredentials } from '../lib/client.js';
2
+ import { printError, printJson, stripPrllScheme } from '../lib/output.js';
3
+ import { BODY_FILE_OPTION_DESC, BODY_OPTION_DESC, resolveCommentBody } from '../lib/text-input.js';
4
+ /** Wiki comment commands (`parall wiki comment …`), extracted from wiki.ts to
5
+ * respect the file-size ratchet. Registered by registerWikiCommands on the
6
+ * `wiki` command group. */
7
+ export function registerWikiCommentCommands(wiki) {
8
+ const comment = wiki.command('comment').description('Manage wiki comments');
9
+ comment
10
+ .command('list')
11
+ .description('List comments on a wiki target')
12
+ .argument('[wiki]', 'Wiki ID or slug')
13
+ .requiredOption('--target-type <type>', 'Target type (changeset or page)')
14
+ .requiredOption('--target-id <id>', 'Target ID (changeset ID or page path)')
15
+ .option('--limit <n>', 'Maximum number of comments to return', '50')
16
+ .option('--cursor <cursor>', 'Pagination cursor')
17
+ .option('--order <order>', 'Sort order (asc or desc)')
18
+ .action(async (wikiRef, opts) => {
19
+ try {
20
+ const ctx = resolveCredentials();
21
+ const { resolveWikiRefOrDefault } = await import('../lib/wiki.js');
22
+ const { COMMENT_TARGET } = await import('@parall/sdk');
23
+ const w = await resolveWikiRefOrDefault(ctx, wikiRef);
24
+ if (opts.targetType !== 'changeset' && opts.targetType !== 'page') {
25
+ throw new Error('--target-type must be "changeset" or "page"');
26
+ }
27
+ const targetUri = opts.targetType === 'changeset'
28
+ ? COMMENT_TARGET.changeset(opts.targetId, w.id)
29
+ : COMMENT_TARGET.wikiPage(w.id, opts.targetId);
30
+ const result = await ctx.client.getComments(ctx.orgId, {
31
+ target_uri: targetUri,
32
+ limit: Number(opts.limit),
33
+ cursor: opts.cursor,
34
+ order: opts.order,
35
+ });
36
+ printJson(result);
37
+ }
38
+ catch (err) {
39
+ printError(err);
40
+ }
41
+ });
42
+ comment
43
+ .command('add')
44
+ .description('Add a comment to a wiki target, or reply into an existing thread with --parent')
45
+ .argument('[wiki]', 'Wiki ID or slug')
46
+ .requiredOption('--target-type <type>', 'Target type (changeset or page)')
47
+ .requiredOption('--target-id <id>', 'Target ID (changeset ID or page path)')
48
+ .option('--body <text>', BODY_OPTION_DESC)
49
+ .option('--body-file <path>', BODY_FILE_OPTION_DESC)
50
+ .option('--parent <id>', 'Root comment ID — post as a threaded reply under it')
51
+ .action(async (wikiRef, opts) => {
52
+ try {
53
+ const body = resolveCommentBody(opts);
54
+ const ctx = resolveCredentials();
55
+ const { resolveWikiRefOrDefault } = await import('../lib/wiki.js');
56
+ const { COMMENT_TARGET } = await import('@parall/sdk');
57
+ const w = await resolveWikiRefOrDefault(ctx, wikiRef);
58
+ if (opts.targetType !== 'changeset' && opts.targetType !== 'page') {
59
+ throw new Error('--target-type must be "changeset" or "page"');
60
+ }
61
+ const targetUri = opts.targetType === 'changeset'
62
+ ? COMMENT_TARGET.changeset(opts.targetId, w.id)
63
+ : COMMENT_TARGET.wikiPage(w.id, opts.targetId);
64
+ const result = await ctx.client.createComment(ctx.orgId, {
65
+ target_uri: targetUri,
66
+ body,
67
+ parent_id: opts.parent ? stripPrllScheme(opts.parent) : undefined,
68
+ });
69
+ printJson(result);
70
+ }
71
+ catch (err) {
72
+ printError(err);
73
+ }
74
+ });
75
+ comment
76
+ .command('update')
77
+ .description('Update a wiki comment')
78
+ .argument('<commentId>', 'Comment ID')
79
+ .option('--body <text>', BODY_OPTION_DESC)
80
+ .option('--body-file <path>', BODY_FILE_OPTION_DESC)
81
+ .action(async (commentId, opts) => {
82
+ try {
83
+ const body = resolveCommentBody(opts);
84
+ const ctx = resolveCredentials();
85
+ const result = await ctx.client.updateComment(ctx.orgId, stripPrllScheme(commentId), {
86
+ body,
87
+ });
88
+ printJson(result);
89
+ }
90
+ catch (err) {
91
+ printError(err);
92
+ }
93
+ });
94
+ comment
95
+ .command('delete')
96
+ .description('Delete a wiki comment')
97
+ .argument('<commentId>', 'Comment ID')
98
+ .action(async (commentId) => {
99
+ try {
100
+ const ctx = resolveCredentials();
101
+ await ctx.client.deleteComment(ctx.orgId, stripPrllScheme(commentId));
102
+ printJson({ ok: true });
103
+ }
104
+ catch (err) {
105
+ printError(err);
106
+ }
107
+ });
108
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"wiki.d.ts","sourceRoot":"","sources":["../../src/commands/wiki.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA0BpC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,QA4/BpD"}
1
+ {"version":3,"file":"wiki.d.ts","sourceRoot":"","sources":["../../src/commands/wiki.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA0BpC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,QAy4BpD"}
@@ -1,9 +1,9 @@
1
1
  import { promises as fs } from 'node:fs';
2
2
  import { resolveCredentials, resolveRuntimeContext } from '../lib/client.js';
3
3
  import { printError, printJson } from '../lib/output.js';
4
- import { BODY_FILE_OPTION_DESC, BODY_OPTION_DESC, resolveCommentBody } from '../lib/text-input.js';
5
4
  import { deleteWikiFile, downloadWikiFile, uploadWikiFile } from '../lib/wiki-files.js';
6
5
  import { getAfcsDiff, getAfcsStatus, getWikiBlob, getWikiChangesetDetail, getWikiChangesetDiff, getWikiLog, getWikiOutline, getWikiSection, getWikiTree, listWikiChangesets, queryWiki, requestWikiAccess, resetWikiWorkspace, listWikis, proposeWikiChangeset, searchWiki, syncAllMounts, watchMounts, } from '../lib/wiki.js';
6
+ import { registerWikiCommentCommands } from './wiki-comments.js';
7
7
  export function registerWikiCommands(program) {
8
8
  const wiki = program.command('wiki').description('Parall Wiki — read, edit, and propose changes');
9
9
  // ---- CRUD ----
@@ -756,103 +756,7 @@ export function registerWikiCommands(program) {
756
756
  printError(error);
757
757
  }
758
758
  });
759
- // ---- Comments ----
760
- const comment = wiki.command('comment').description('Manage wiki comments');
761
- comment
762
- .command('list')
763
- .description('List comments on a wiki target')
764
- .argument('[wiki]', 'Wiki ID or slug')
765
- .requiredOption('--target-type <type>', 'Target type (changeset or page)')
766
- .requiredOption('--target-id <id>', 'Target ID (changeset ID or page path)')
767
- .option('--limit <n>', 'Maximum number of comments to return', '50')
768
- .option('--cursor <cursor>', 'Pagination cursor')
769
- .option('--order <order>', 'Sort order (asc or desc)')
770
- .action(async (wikiRef, opts) => {
771
- try {
772
- const ctx = resolveCredentials();
773
- const { resolveWikiRefOrDefault } = await import('../lib/wiki.js');
774
- const { COMMENT_TARGET } = await import('@parall/sdk');
775
- const w = await resolveWikiRefOrDefault(ctx, wikiRef);
776
- if (opts.targetType !== 'changeset' && opts.targetType !== 'page') {
777
- throw new Error('--target-type must be "changeset" or "page"');
778
- }
779
- const targetUri = opts.targetType === 'changeset'
780
- ? COMMENT_TARGET.changeset(opts.targetId, w.id)
781
- : COMMENT_TARGET.wikiPage(w.id, opts.targetId);
782
- const result = await ctx.client.getComments(ctx.orgId, {
783
- target_uri: targetUri,
784
- limit: Number(opts.limit),
785
- cursor: opts.cursor,
786
- order: opts.order,
787
- });
788
- printJson(result);
789
- }
790
- catch (err) {
791
- printError(err);
792
- }
793
- });
794
- comment
795
- .command('add')
796
- .description('Add a comment to a wiki target')
797
- .argument('[wiki]', 'Wiki ID or slug')
798
- .requiredOption('--target-type <type>', 'Target type (changeset or page)')
799
- .requiredOption('--target-id <id>', 'Target ID (changeset ID or page path)')
800
- .option('--body <text>', BODY_OPTION_DESC)
801
- .option('--body-file <path>', BODY_FILE_OPTION_DESC)
802
- .action(async (wikiRef, opts) => {
803
- try {
804
- const body = resolveCommentBody(opts);
805
- const ctx = resolveCredentials();
806
- const { resolveWikiRefOrDefault } = await import('../lib/wiki.js');
807
- const { COMMENT_TARGET } = await import('@parall/sdk');
808
- const w = await resolveWikiRefOrDefault(ctx, wikiRef);
809
- if (opts.targetType !== 'changeset' && opts.targetType !== 'page') {
810
- throw new Error('--target-type must be "changeset" or "page"');
811
- }
812
- const targetUri = opts.targetType === 'changeset'
813
- ? COMMENT_TARGET.changeset(opts.targetId, w.id)
814
- : COMMENT_TARGET.wikiPage(w.id, opts.targetId);
815
- const result = await ctx.client.createComment(ctx.orgId, {
816
- target_uri: targetUri,
817
- body,
818
- });
819
- printJson(result);
820
- }
821
- catch (err) {
822
- printError(err);
823
- }
824
- });
825
- comment
826
- .command('update')
827
- .description('Update a wiki comment')
828
- .argument('<commentId>', 'Comment ID')
829
- .option('--body <text>', BODY_OPTION_DESC)
830
- .option('--body-file <path>', BODY_FILE_OPTION_DESC)
831
- .action(async (commentId, opts) => {
832
- try {
833
- const body = resolveCommentBody(opts);
834
- const ctx = resolveCredentials();
835
- const result = await ctx.client.updateComment(ctx.orgId, commentId, { body });
836
- printJson(result);
837
- }
838
- catch (err) {
839
- printError(err);
840
- }
841
- });
842
- comment
843
- .command('delete')
844
- .description('Delete a wiki comment')
845
- .argument('<commentId>', 'Comment ID')
846
- .action(async (commentId) => {
847
- try {
848
- const ctx = resolveCredentials();
849
- await ctx.client.deleteComment(ctx.orgId, commentId);
850
- printJson({ ok: true });
851
- }
852
- catch (err) {
853
- printError(err);
854
- }
855
- });
759
+ registerWikiCommentCommands(wiki);
856
760
  // ---- Utility (not for direct agent use) ----
857
761
  wiki
858
762
  .command('list')
package/dist/index.js CHANGED
@@ -8,6 +8,7 @@ import { registerDMCommands } from './commands/dm.js';
8
8
  import { registerMessageCommands } from './commands/messages.js';
9
9
  import { registerTaskCommands } from './commands/tasks.js';
10
10
  import { registerCommentCommands } from './commands/comments.js';
11
+ import { registerLabelCommands } from './commands/labels.js';
11
12
  import { registerProjectCommands } from './commands/projects.js';
12
13
  import { registerProfileCommands } from './commands/profile.js';
13
14
  import { registerTeamCommands } from './commands/teams.js';
@@ -41,6 +42,7 @@ registerMessageCommands(program);
41
42
  registerWatchCommands(program);
42
43
  registerTaskCommands(program);
43
44
  registerCommentCommands(program);
45
+ registerLabelCommands(program);
44
46
  registerProjectCommands(program);
45
47
  registerProfileCommands(program);
46
48
  registerTeamCommands(program);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parall/cli",
3
- "version": "1.60.0",
3
+ "version": "1.61.0",
4
4
  "description": "CLI client for Parall — universal agent & human access to Parall API",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -37,14 +37,14 @@
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.60.0",
41
- "@parall/sdk": "1.60.0"
40
+ "@parall/agent-core": "1.61.0",
41
+ "@parall/sdk": "1.61.0"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@types/js-yaml": "^4.0.9",
45
45
  "@types/node": "^22.0.0",
46
46
  "typescript": "^5.7.0",
47
- "@parall/agent-core": "1.60.0"
47
+ "@parall/agent-core": "1.61.0"
48
48
  },
49
49
  "scripts": {
50
50
  "build": "tsc",