@ooneex/cli 1.36.0 → 1.36.2

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/index.js CHANGED
@@ -7103,6 +7103,22 @@ ${toYaml(v, indent + 1)}`;
7103
7103
  }).join(`
7104
7104
  `);
7105
7105
  };
7106
+ var createSpinner = (message) => {
7107
+ if (!process.stdout.isTTY)
7108
+ return { stop: () => {} };
7109
+ const frames = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
7110
+ let i = 0;
7111
+ const id = setInterval(() => {
7112
+ process.stdout.write(`\r${frames[i % frames.length]} ${message}`);
7113
+ i++;
7114
+ }, 80);
7115
+ return {
7116
+ stop: () => {
7117
+ clearInterval(id);
7118
+ process.stdout.write("\r\x1B[K");
7119
+ }
7120
+ };
7121
+ };
7106
7122
  var ensureModule = async (module) => {
7107
7123
  const moduleDir = join3(process.cwd(), "modules", module);
7108
7124
  const moduleDirExists = await Bun.file(join3(moduleDir, "package.json")).exists();
@@ -15435,11 +15451,13 @@ class IssueCreateCommand {
15435
15451
  description
15436
15452
  ].join(`
15437
15453
  `);
15454
+ const improveSpinner = createSpinner("Improving description...");
15438
15455
  const proc = Bun.spawn(["claude", "-p", improvePrompt], {
15439
15456
  stdout: "pipe",
15440
- stderr: "inherit"
15457
+ stderr: "pipe"
15441
15458
  });
15442
15459
  await proc.exited;
15460
+ improveSpinner.stop();
15443
15461
  description = await new Response(proc.stdout).text();
15444
15462
  const labelPrompt = [
15445
15463
  "Based on the following issue description, suggest relevant labels as a comma-separated list.",
@@ -15450,11 +15468,13 @@ class IssueCreateCommand {
15450
15468
  description
15451
15469
  ].join(`
15452
15470
  `);
15471
+ const labelSpinner = createSpinner("Extracting labels...");
15453
15472
  const labelProc = Bun.spawn(["claude", "-p", labelPrompt], {
15454
15473
  stdout: "pipe",
15455
- stderr: "inherit"
15474
+ stderr: "pipe"
15456
15475
  });
15457
15476
  await labelProc.exited;
15477
+ labelSpinner.stop();
15458
15478
  const suggestedLabels = (await new Response(labelProc.stdout).text()).trim().split(",").map((l2) => l2.trim()).filter((l2) => l2.length > 0 && !labels.includes(l2));
15459
15479
  if (suggestedLabels.length > 0) {
15460
15480
  const { selectedLabels = [] } = await import_enquirer5.prompt({
@@ -15495,11 +15515,13 @@ class IssueCreateCommand {
15495
15515
  currentDescription
15496
15516
  ].join(`
15497
15517
  `);
15518
+ const checkSpinner = createSpinner("Checking if split is needed...");
15498
15519
  const checkProc = Bun.spawn(["claude", "-p", checkPrompt], {
15499
15520
  stdout: "pipe",
15500
- stderr: "inherit"
15521
+ stderr: "pipe"
15501
15522
  });
15502
15523
  await checkProc.exited;
15524
+ checkSpinner.stop();
15503
15525
  const checkRaw = (await new Response(checkProc.stdout).text()).trim();
15504
15526
  let splitNeeded = true;
15505
15527
  try {
@@ -15540,11 +15562,13 @@ class IssueCreateCommand {
15540
15562
  currentDescription
15541
15563
  ].join(`
15542
15564
  `);
15565
+ const splitSpinner = createSpinner("Splitting issue...");
15543
15566
  const splitProc = Bun.spawn(["claude", "-p", splitPrompt], {
15544
15567
  stdout: "pipe",
15545
- stderr: "inherit"
15568
+ stderr: "pipe"
15546
15569
  });
15547
15570
  await splitProc.exited;
15571
+ splitSpinner.stop();
15548
15572
  const rawJson = (await new Response(splitProc.stdout).text()).trim();
15549
15573
  let splitItems = [];
15550
15574
  try {
@@ -95549,11 +95573,13 @@ class IssuePullCommand {
95549
95573
  description
95550
95574
  ].join(`
95551
95575
  `);
95576
+ const improveSpinner = createSpinner("Improving description...");
95552
95577
  const proc = Bun.spawn(["claude", "-p", improvePrompt], {
95553
95578
  stdout: "pipe",
95554
- stderr: "inherit"
95579
+ stderr: "pipe"
95555
95580
  });
95556
95581
  await proc.exited;
95582
+ improveSpinner.stop();
95557
95583
  description = await new Response(proc.stdout).text();
95558
95584
  const labelPrompt = [
95559
95585
  "Based on the following issue description, suggest relevant labels as a comma-separated list.",
@@ -95564,11 +95590,13 @@ class IssuePullCommand {
95564
95590
  description
95565
95591
  ].join(`
95566
95592
  `);
95593
+ const labelSpinner = createSpinner("Extracting labels...");
95567
95594
  const labelProc = Bun.spawn(["claude", "-p", labelPrompt], {
95568
95595
  stdout: "pipe",
95569
- stderr: "inherit"
95596
+ stderr: "pipe"
95570
95597
  });
95571
95598
  await labelProc.exited;
95599
+ labelSpinner.stop();
95572
95600
  const existingLabelNames = issue.labels?.map((l2) => l2.name).filter((n2) => n2 != null) ?? [];
95573
95601
  const suggestedLabels = (await new Response(labelProc.stdout).text()).trim().split(",").map((l2) => l2.trim()).filter((l2) => l2.length > 0 && !existingLabelNames.includes(l2));
95574
95602
  let extraLabels = [];
@@ -95615,11 +95643,13 @@ class IssuePullCommand {
95615
95643
  currentDescription
95616
95644
  ].join(`
95617
95645
  `);
95646
+ const checkSpinner = createSpinner("Checking if split is needed...");
95618
95647
  const checkProc = Bun.spawn(["claude", "-p", checkPrompt], {
95619
95648
  stdout: "pipe",
95620
- stderr: "inherit"
95649
+ stderr: "pipe"
95621
95650
  });
95622
95651
  await checkProc.exited;
95652
+ checkSpinner.stop();
95623
95653
  const checkRaw = (await new Response(checkProc.stdout).text()).trim();
95624
95654
  let splitNeeded = true;
95625
95655
  try {
@@ -95660,11 +95690,13 @@ class IssuePullCommand {
95660
95690
  currentDescription
95661
95691
  ].join(`
95662
95692
  `);
95693
+ const splitSpinner = createSpinner("Splitting issue...");
95663
95694
  const splitProc = Bun.spawn(["claude", "-p", splitPrompt], {
95664
95695
  stdout: "pipe",
95665
- stderr: "inherit"
95696
+ stderr: "pipe"
95666
95697
  });
95667
95698
  await splitProc.exited;
95699
+ splitSpinner.stop();
95668
95700
  const rawJson = (await new Response(splitProc.stdout).text()).trim();
95669
95701
  let splitItems = [];
95670
95702
  try {
@@ -95900,7 +95932,9 @@ class IssuePushCommand {
95900
95932
  const service = new LinearService(new AppEnv, { apiKey, ...teamId ? { teamId } : {} });
95901
95933
  let existingIssue = null;
95902
95934
  try {
95935
+ const fetchSpinner = createSpinner("Fetching issue from Linear...");
95903
95936
  existingIssue = await service.getIssue(parsed.id ?? id);
95937
+ fetchSpinner.stop();
95904
95938
  } catch {}
95905
95939
  if (existingIssue) {
95906
95940
  await this.pushUpdate(service, existingIssue, parsed, logger);
@@ -95926,7 +95960,9 @@ class IssuePushCommand {
95926
95960
  if (stateId)
95927
95961
  updateInput.state = { id: stateId };
95928
95962
  updateInput.labels = labelIds.map((lid) => ({ id: lid }));
95963
+ const updateSpinner = createSpinner("Updating issue in Linear...");
95929
95964
  await service.updateIssue(issueId, updateInput);
95965
+ updateSpinner.stop();
95930
95966
  logger.success(`Issue ${existing.identifier} updated in Linear`, undefined, {
95931
95967
  showTimestamp: false,
95932
95968
  showArrow: false,
@@ -95943,7 +95979,9 @@ class IssuePushCommand {
95943
95979
  });
95944
95980
  return;
95945
95981
  }
95982
+ const teamsSpinner = createSpinner("Fetching teams from Linear...");
95946
95983
  const teams = await service.getTeams();
95984
+ teamsSpinner.stop();
95947
95985
  if (teams.length === 0) {
95948
95986
  logger.error("No teams found in Linear", undefined, {
95949
95987
  showTimestamp: false,
@@ -95988,7 +96026,9 @@ class IssuePushCommand {
95988
96026
  createInput.state = { id: stateId };
95989
96027
  if (labelIds.length > 0)
95990
96028
  createInput.labels = labelIds.map((lid) => ({ id: lid }));
96029
+ const createIssueSpinner = createSpinner("Creating issue in Linear...");
95991
96030
  const created = await service.createIssue(createInput);
96031
+ createIssueSpinner.stop();
95992
96032
  logger.success(`Issue ${created.identifier} created in Linear`, undefined, {
95993
96033
  showTimestamp: false,
95994
96034
  showArrow: false,
@@ -95996,7 +96036,9 @@ class IssuePushCommand {
95996
96036
  });
95997
96037
  for (const comment of parsed.comments) {
95998
96038
  if (comment.message.trim() && created.id) {
96039
+ const commentSpinner = createSpinner("Adding comment...");
95999
96040
  await service.createComment(created.id, comment.message);
96041
+ commentSpinner.stop();
96000
96042
  }
96001
96043
  }
96002
96044
  if (created.identifier && created.identifier !== localId) {
@@ -96013,7 +96055,9 @@ class IssuePushCommand {
96013
96055
  }
96014
96056
  }
96015
96057
  async resolveState(service, stateName, teamId, logger) {
96058
+ const statesSpinner = createSpinner("Fetching states from Linear...");
96016
96059
  const states = await service.getStates(teamId);
96060
+ statesSpinner.stop();
96017
96061
  const found = states.find((s) => s.name?.toLowerCase() === stateName.toLowerCase());
96018
96062
  if (found?.id)
96019
96063
  return found.id;
@@ -96037,7 +96081,9 @@ class IssuePushCommand {
96037
96081
  message: "State type",
96038
96082
  choices: ["backlog", "unstarted", "started", "completed", "cancelled"]
96039
96083
  });
96084
+ const stateCreateSpinner = createSpinner(`Creating state "${stateName}"...`);
96040
96085
  const created = await service.createState({ name: stateName, color, type, teamId });
96086
+ stateCreateSpinner.stop();
96041
96087
  logger.success(`State "${stateName}" created in Linear`, undefined, {
96042
96088
  showTimestamp: false,
96043
96089
  showArrow: false,
@@ -96048,7 +96094,9 @@ class IssuePushCommand {
96048
96094
  async resolveLabels(service, labelNames, teamId, logger) {
96049
96095
  if (labelNames.length === 0)
96050
96096
  return [];
96097
+ const labelsSpinner = createSpinner("Fetching labels from Linear...");
96051
96098
  const existing = await service.getLabels();
96099
+ labelsSpinner.stop();
96052
96100
  const ids = [];
96053
96101
  for (const name of labelNames) {
96054
96102
  const found = existing.find((l2) => l2.name?.toLowerCase() === name.toLowerCase());
@@ -96056,7 +96104,9 @@ class IssuePushCommand {
96056
96104
  ids.push(found.id);
96057
96105
  continue;
96058
96106
  }
96107
+ const labelCreateSpinner = createSpinner(`Creating label "${name}"...`);
96059
96108
  const created = await service.createLabel({ name, ...teamId ? { teamId } : {} });
96109
+ labelCreateSpinner.stop();
96060
96110
  if (created.id) {
96061
96111
  ids.push(created.id);
96062
96112
  logger.success(`Label "${name}" created in Linear`, undefined, {
@@ -96074,7 +96124,9 @@ class IssuePushCommand {
96074
96124
  const existingBodies = new Set((existing.comments ?? []).map((c3) => c3.body));
96075
96125
  for (const comment of newComments) {
96076
96126
  if (comment.message.trim() && !existingBodies.has(comment.message)) {
96127
+ const syncCommentSpinner = createSpinner("Adding comment...");
96077
96128
  await service.createComment(issueId, comment.message);
96129
+ syncCommentSpinner.stop();
96078
96130
  logger.success("Comment added to issue", undefined, {
96079
96131
  showTimestamp: false,
96080
96132
  showArrow: false,
@@ -100855,7 +100907,7 @@ class SpecImplementCommand {
100855
100907
  return;
100856
100908
  }
100857
100909
  const content = await file.text();
100858
- const implementPrompt = ["/spec:implement", "", `**Module:** ${module}`, "", "## Spec", "", content].join(`
100910
+ const implementPrompt = [spec_implement_md_default, "", `**Module:** ${module}`, "", "## Spec", "", content].join(`
100859
100911
  `).trim();
100860
100912
  const logger = new TerminalLogger38;
100861
100913
  logger.info(`Running /spec:implement for ${spec}.spec.yml...`, undefined, {
@@ -100910,11 +100962,13 @@ async function suggestResources(issueContent) {
100910
100962
  ].join(`
100911
100963
  `);
100912
100964
  try {
100965
+ const suggestionSpinner = createSpinner("Suggesting resources...");
100913
100966
  const proc = Bun.spawn(["claude", "-p", suggestionPrompt], {
100914
100967
  stdout: "pipe",
100915
100968
  stderr: "pipe"
100916
100969
  });
100917
100970
  await proc.exited;
100971
+ suggestionSpinner.stop();
100918
100972
  const raw = await new Response(proc.stdout).text();
100919
100973
  const parsed = JSON.parse(raw.trim());
100920
100974
  if (Array.isArray(parsed)) {
@@ -100986,7 +101040,7 @@ class SpecPlanCommand {
100986
101040
  });
100987
101041
  const specsDir = join41(process.cwd(), "modules", module, "specs");
100988
101042
  const planPrompt = [
100989
- "/spec:plan",
101043
+ spec_plan_md_default,
100990
101044
  "",
100991
101045
  `**Module:** ${module}`,
100992
101046
  `**Spec output directory:** ${specsDir}`,
@@ -101007,7 +101061,8 @@ class SpecPlanCommand {
101007
101061
  showArrow: false,
101008
101062
  useSymbol: true
101009
101063
  });
101010
- const planProc = Bun.spawn(["claude", "-p", planPrompt], {
101064
+ const planProc = Bun.spawn(["claude", "-p"], {
101065
+ stdin: Buffer.from(planPrompt),
101011
101066
  stdout: "inherit",
101012
101067
  stderr: "inherit"
101013
101068
  });
@@ -101020,4 +101075,4 @@ SpecPlanCommand = __legacyDecorateClassTS([
101020
101075
  // src/index.ts
101021
101076
  await run();
101022
101077
 
101023
- //# debugId=80DD094B359B724E64756E2164756E21
101078
+ //# debugId=4D85614A43F301F864756E2164756E21