@remixhq/cli 0.1.11 → 0.1.12

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/cli.js CHANGED
@@ -2030,7 +2030,7 @@ import {
2030
2030
  collabAdd as collabAddCore,
2031
2031
  collabRecordTurn as collabRecordTurnCore,
2032
2032
  collabApprove as collabApproveCore,
2033
- collabInbox as collabInboxCore,
2033
+ collabListMergeRequests as collabListMergeRequestsCore,
2034
2034
  collabInit as collabInitCore,
2035
2035
  collabInvite as collabInviteCore,
2036
2036
  collabList as collabListCore,
@@ -2065,6 +2065,13 @@ function printResultWarnings(json, value) {
2065
2065
  console.log(pc10.yellow(warning));
2066
2066
  }
2067
2067
  }
2068
+ function printMergeRequests(result, json) {
2069
+ if (json) return;
2070
+ const items = Array.isArray(result.mergeRequests) ? result.mergeRequests : [];
2071
+ for (const mr of items) {
2072
+ console.log(`${mr.id} ${mr.status} ${mr.title ?? "(untitled)"}`);
2073
+ }
2074
+ }
2068
2075
  async function createCollabApi(params) {
2069
2076
  await ensureAuth({ yes: params.yes, json: params.json });
2070
2077
  const cfg = await resolveConfig({ yes: params.yes });
@@ -2425,15 +2432,39 @@ async function collabRequestMerge(params) {
2425
2432
  if (!params.json) console.log(pc10.green(`Opened merge request. id=${result.id}`));
2426
2433
  return result;
2427
2434
  }
2428
- async function collabInbox(params) {
2435
+ async function collabReviewQueue(params) {
2429
2436
  const api = await createCollabApi(params);
2430
- const result = await collabInboxCore({ api });
2431
- if (!params.json) {
2432
- const items = Array.isArray(result.mergeRequests) ? result.mergeRequests : result.mergeRequests ? Object.values(result.mergeRequests).flat() : [];
2433
- for (const mr of items) {
2434
- console.log(`${mr.id} ${mr.status} ${mr.title ?? "(untitled)"}`);
2435
- }
2436
- }
2437
+ const result = await collabListMergeRequestsCore({
2438
+ api,
2439
+ queue: "reviewable",
2440
+ status: params.status ?? "open",
2441
+ kind: params.kind ?? "merge"
2442
+ });
2443
+ printMergeRequests(result, params.json);
2444
+ return result;
2445
+ }
2446
+ async function collabMyMergeRequests(params) {
2447
+ const api = await createCollabApi(params);
2448
+ const result = await collabListMergeRequestsCore({
2449
+ api,
2450
+ queue: "created_by_me",
2451
+ status: params.status ?? "open",
2452
+ kind: params.kind ?? "merge"
2453
+ });
2454
+ printMergeRequests(result, params.json);
2455
+ return result;
2456
+ }
2457
+ async function collabListAppMergeRequests(params) {
2458
+ const api = await createCollabApi(params);
2459
+ const result = await collabListMergeRequestsCore({
2460
+ api,
2461
+ cwd: params.cwd,
2462
+ appId: params.appId ?? null,
2463
+ queue: params.queue,
2464
+ status: params.status ?? "open",
2465
+ kind: params.kind ?? "merge"
2466
+ });
2467
+ printMergeRequests(result, params.json);
2437
2468
  return result;
2438
2469
  }
2439
2470
  async function collabView(params) {
@@ -2785,6 +2816,20 @@ function parseInviteScope(value) {
2785
2816
  if (normalized === "app") return "app";
2786
2817
  throw new Error("scope must be one of: organization, project, app");
2787
2818
  }
2819
+ function parseMergeRequestKind(value) {
2820
+ const normalized = String(value).trim().toLowerCase();
2821
+ if (normalized === "merge" || normalized === "sync" || normalized === "all") {
2822
+ return normalized;
2823
+ }
2824
+ throw new Error("kind must be one of: merge, sync, all");
2825
+ }
2826
+ function parseAppMergeRequestQueue(value) {
2827
+ const normalized = String(value).trim().toLowerCase();
2828
+ if (normalized === "app_reviewable" || normalized === "app_outgoing" || normalized === "app_related_visible") {
2829
+ return normalized;
2830
+ }
2831
+ throw new Error("queue must be one of: app_reviewable, app_outgoing, app_related_visible");
2832
+ }
2788
2833
  function registerCollabCommands(program) {
2789
2834
  const collab = program.command("collab").description("Generic collaboration workflow for any software repository");
2790
2835
  const memory = collab.command("memory").description("Inspect collaboration memory for the current bound repository or an explicit app");
@@ -2938,8 +2983,38 @@ function registerCollabCommands(program) {
2938
2983
  });
2939
2984
  if (opts.json) console.log(JSON.stringify(result, null, 2));
2940
2985
  });
2941
- collab.command("inbox").description("List open merge requests available for review").option("--yes", "Run non-interactively", false).option("--non-interactive", "Run non-interactively", false).option("--json", "Output JSON", false).action(async (opts) => {
2942
- const result = await collabInbox({ json: Boolean(opts.json), yes: Boolean(opts.yes || opts.nonInteractive) });
2986
+ collab.command("review-queue").description("List reviewable merge requests available to the current user").option("--status <status>", "Filter merge requests by status").option("--kind <kind>", "Filter merge requests by kind (merge|sync|all)", parseMergeRequestKind).option("--yes", "Run non-interactively", false).option("--non-interactive", "Run non-interactively", false).option("--json", "Output JSON", false).action(async (opts) => {
2987
+ const result = await collabReviewQueue({
2988
+ status: opts.status ? String(opts.status) : void 0,
2989
+ kind: opts.kind,
2990
+ json: Boolean(opts.json),
2991
+ yes: Boolean(opts.yes || opts.nonInteractive)
2992
+ });
2993
+ if (opts.json) console.log(JSON.stringify(result, null, 2));
2994
+ });
2995
+ collab.command("my-merge-requests").description("List merge requests created by the current user").option("--status <status>", "Filter merge requests by status").option("--kind <kind>", "Filter merge requests by kind (merge|sync|all)", parseMergeRequestKind).option("--yes", "Run non-interactively", false).option("--non-interactive", "Run non-interactively", false).option("--json", "Output JSON", false).action(async (opts) => {
2996
+ const result = await collabMyMergeRequests({
2997
+ status: opts.status ? String(opts.status) : void 0,
2998
+ kind: opts.kind,
2999
+ json: Boolean(opts.json),
3000
+ yes: Boolean(opts.yes || opts.nonInteractive)
3001
+ });
3002
+ if (opts.json) console.log(JSON.stringify(result, null, 2));
3003
+ });
3004
+ collab.command("list-app-merge-requests").description("List merge requests for the current bound app or an explicit app").requiredOption(
3005
+ "--queue <queue>",
3006
+ "App-scoped queue (app_reviewable|app_outgoing|app_related_visible)",
3007
+ parseAppMergeRequestQueue
3008
+ ).option("--cwd <path>", "Working directory for repository detection").option("--app-id <id>", "Explicit app id instead of the current bound repository").option("--status <status>", "Filter merge requests by status").option("--kind <kind>", "Filter merge requests by kind (merge|sync|all)", parseMergeRequestKind).option("--yes", "Run non-interactively", false).option("--non-interactive", "Run non-interactively", false).option("--json", "Output JSON", false).action(async (opts) => {
3009
+ const result = await collabListAppMergeRequests({
3010
+ cwd: opts.cwd ? String(opts.cwd) : process.cwd(),
3011
+ appId: opts.appId ? String(opts.appId) : null,
3012
+ queue: opts.queue,
3013
+ status: opts.status ? String(opts.status) : void 0,
3014
+ kind: opts.kind,
3015
+ json: Boolean(opts.json),
3016
+ yes: Boolean(opts.yes || opts.nonInteractive)
3017
+ });
2943
3018
  if (opts.json) console.log(JSON.stringify(result, null, 2));
2944
3019
  });
2945
3020
  collab.command("view <mrId>").description("View merge request prompts and diffs").option("--yes", "Run non-interactively", false).option("--non-interactive", "Run non-interactively", false).option("--json", "Output JSON", false).action(async (mrId, opts) => {