@moxxy/cli 0.0.10 → 0.0.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/index.js CHANGED
@@ -487,7 +487,9 @@ var init_dist = __esm({
487
487
  cliPath: import_zod9.z.string().default("claude"),
488
488
  model: import_zod9.z.string().default("claude-sonnet-4-5"),
489
489
  timeout: import_zod9.z.number().int().positive().default(3e5),
490
- permissionMode: import_zod9.z.string().default("default")
490
+ permissionMode: import_zod9.z.string().default("default"),
491
+ /** Skip all permission checks — required for --print mode tool execution */
492
+ dangerouslySkipPermissions: import_zod9.z.boolean().default(false)
491
493
  });
492
494
  pipelineConfigSchema = import_zod9.z.object({
493
495
  enabledStages: import_zod9.z.array(import_zod9.z.enum(PIPELINE_STAGES)).default(["triage", "research", "inspect", "plan", "implement"])
@@ -1443,9 +1445,13 @@ var init_process_manager = __esm({
1443
1445
  if (options.thinking && options.thinking !== "none") {
1444
1446
  args.push("--thinking", options.thinking);
1445
1447
  }
1446
- const permissionMode = options.permissionMode || this.config.permissionMode;
1447
- if (permissionMode) {
1448
- args.push("--permission-mode", permissionMode);
1448
+ if (this.config.dangerouslySkipPermissions) {
1449
+ args.push("--dangerously-skip-permissions");
1450
+ } else {
1451
+ const permissionMode = options.permissionMode || this.config.permissionMode;
1452
+ if (permissionMode) {
1453
+ args.push("--permission-mode", permissionMode);
1454
+ }
1449
1455
  }
1450
1456
  const workingDir = options.workingDirectory || this.config.workingDirectory;
1451
1457
  if (workingDir) {
@@ -1770,6 +1776,7 @@ var init_cli = __esm({
1770
1776
  processIdleTimeout: config.processIdleTimeout,
1771
1777
  model: config.model,
1772
1778
  permissionMode: config.permissionMode,
1779
+ dangerouslySkipPermissions: config.dangerouslySkipPermissions,
1773
1780
  workingDirectory: config.workingDirectory
1774
1781
  },
1775
1782
  events
@@ -2133,6 +2140,7 @@ var init_sdk = __esm({
2133
2140
  // 10 minutes
2134
2141
  model: "claude-sonnet-4-5",
2135
2142
  permissionMode: "default",
2143
+ dangerouslySkipPermissions: false,
2136
2144
  workingDirectory: process.cwd(),
2137
2145
  autoConnect: true
2138
2146
  };
@@ -2153,6 +2161,7 @@ var init_sdk = __esm({
2153
2161
  processIdleTimeout: config.processIdleTimeout,
2154
2162
  model: config.model,
2155
2163
  permissionMode: config.permissionMode,
2164
+ dangerouslySkipPermissions: config.dangerouslySkipPermissions,
2156
2165
  workingDirectory: config.workingDirectory,
2157
2166
  autoConnect: false
2158
2167
  // We'll connect manually after initialization
@@ -24467,21 +24476,51 @@ function log3(level, issueKey, message) {
24467
24476
  };
24468
24477
  console.log(`${time} ${levels[level]}${tag} ${issue} ${message}`);
24469
24478
  }
24470
- async function implementIssue(supervisor, agentId, payload, workflow) {
24479
+ async function implementIssue(supervisor, agentId, payload, options) {
24480
+ const { authCloneUrl, branchName, plan } = options;
24481
+ const cloneDir = `/tmp/moxxy-${payload.repo.name}-issue-${payload.issueNumber}`;
24482
+ const commitMessage = plan.commitMessage || `fix: ${payload.title} (#${payload.issueNumber})`;
24483
+ const stepsDescription = plan.steps.map((s, i) => `${i + 1}. **${s.action}** \`${s.path}\`: ${s.description}`).join("\n");
24471
24484
  const instruction = {
24472
- prompt: `Execute this workflow for issue #${payload.issueNumber}: ${payload.title}
24485
+ prompt: `You are implementing changes for GitHub issue #${payload.issueNumber}: ${payload.title}
24486
+
24487
+ Use the moxxy-agent CLI for ALL file and git operations. Install it first if not available.
24488
+
24489
+ ## Step 1: Setup
24490
+ \`\`\`bash
24491
+ npm install -g @moxxy/agent-cli
24492
+ moxxy-agent workspace init --repo "${authCloneUrl}" --branch "${branchName}" --clone-dir "${cloneDir}"
24493
+ cd "${cloneDir}"
24494
+ \`\`\`
24495
+
24496
+ ## Step 2: Implement Changes
24497
+ ${stepsDescription}
24498
+
24499
+ Available moxxy-agent commands:
24500
+ - \`moxxy-agent file read <path>\` \u2014 read a file
24501
+ - \`moxxy-agent file create <path> --content "..."\` \u2014 create a new file
24502
+ - \`moxxy-agent file update <path> --content "..."\` \u2014 overwrite a file
24503
+ - \`moxxy-agent file patch <path> --search "old" --replace "new"\` \u2014 find-and-replace in a file
24504
+ - \`moxxy-agent file delete <path>\` \u2014 delete a file
24505
+ - \`moxxy-agent dir list [path]\` \u2014 list directory contents
24506
+ - \`moxxy-agent search code <pattern>\` \u2014 search code by regex
24473
24507
 
24474
- Workflow:
24475
- ${JSON.stringify(workflow, null, 2)}
24508
+ Read existing files first to understand context before making changes.
24476
24509
 
24477
- Execute each step using the moxxy-agent CLI tool. For each step, run:
24478
- moxxy-agent <plugin> <command> <args>
24510
+ ## Step 3: Commit & Push
24511
+ \`\`\`bash
24512
+ moxxy-agent git add --all
24513
+ moxxy-agent git commit -m "${commitMessage}"
24514
+ moxxy-agent git push --set-upstream
24515
+ \`\`\`
24479
24516
 
24480
- Handle any errors by adapting. Report the results of each step.`,
24517
+ IMPORTANT:
24518
+ - Use ONLY moxxy-agent commands for file and git operations.
24519
+ - Execute all steps in order \u2014 setup, implement, then commit & push.
24520
+ - If a command fails, read the error and adapt your approach.`,
24481
24521
  metadata: {
24482
24522
  stage: "implement",
24483
- issueNumber: payload.issueNumber,
24484
- workflowId: workflow.id
24523
+ issueNumber: payload.issueNumber
24485
24524
  }
24486
24525
  };
24487
24526
  const result = await supervisor.sendInstruction(agentId, instruction);
@@ -24594,6 +24633,32 @@ Respond with exactly this JSON structure (no other text):
24594
24633
  const result = await supervisor.sendInstruction(agentId, instruction);
24595
24634
  return extractJSON(result.response, "triage");
24596
24635
  }
24636
+ function verifyWebhookSignature(payload, signature, secret) {
24637
+ const expected = "sha256=" + (0, import_crypto4.createHmac)("sha256", secret).update(payload).digest("hex");
24638
+ if (expected.length !== signature.length) return false;
24639
+ return (0, import_crypto4.timingSafeEqual)(Buffer.from(expected), Buffer.from(signature));
24640
+ }
24641
+ function parseIssuePayload(body) {
24642
+ const issue = body.issue;
24643
+ if (!issue) return null;
24644
+ return {
24645
+ action: body.action,
24646
+ issueNumber: issue.number,
24647
+ title: issue.title,
24648
+ body: issue.body ?? null,
24649
+ labels: (issue.labels || []).map((l) => l.name),
24650
+ author: issue.user?.login || "unknown",
24651
+ repo: {
24652
+ owner: body.repository.owner.login,
24653
+ name: body.repository.name,
24654
+ fullName: body.repository.full_name,
24655
+ defaultBranch: body.repository.default_branch,
24656
+ cloneUrl: body.repository.clone_url
24657
+ },
24658
+ url: issue.html_url,
24659
+ createdAt: issue.created_at
24660
+ };
24661
+ }
24597
24662
  function buildWorkflow(payload, plan, branchName) {
24598
24663
  const steps = [];
24599
24664
  let stepIndex = 0;
@@ -24656,32 +24721,6 @@ function buildWorkflow(payload, plan, branchName) {
24656
24721
  }
24657
24722
  };
24658
24723
  }
24659
- function verifyWebhookSignature(payload, signature, secret) {
24660
- const expected = "sha256=" + (0, import_crypto4.createHmac)("sha256", secret).update(payload).digest("hex");
24661
- if (expected.length !== signature.length) return false;
24662
- return (0, import_crypto4.timingSafeEqual)(Buffer.from(expected), Buffer.from(signature));
24663
- }
24664
- function parseIssuePayload(body) {
24665
- const issue = body.issue;
24666
- if (!issue) return null;
24667
- return {
24668
- action: body.action,
24669
- issueNumber: issue.number,
24670
- title: issue.title,
24671
- body: issue.body ?? null,
24672
- labels: (issue.labels || []).map((l) => l.name),
24673
- author: issue.user?.login || "unknown",
24674
- repo: {
24675
- owner: body.repository.owner.login,
24676
- name: body.repository.name,
24677
- fullName: body.repository.full_name,
24678
- defaultBranch: body.repository.default_branch,
24679
- cloneUrl: body.repository.clone_url
24680
- },
24681
- url: issue.html_url,
24682
- createdAt: issue.created_at
24683
- };
24684
- }
24685
24724
  async function createBranchFromDefault(client, owner, repo, branchName, defaultBranch) {
24686
24725
  await client.createBranch(owner, repo, branchName, defaultBranch);
24687
24726
  }
@@ -24734,9 +24773,17 @@ var init_dist7 = __esm({
24734
24773
  };
24735
24774
  GitHubClient = class {
24736
24775
  octokit;
24776
+ token;
24737
24777
  constructor(token) {
24778
+ this.token = token;
24738
24779
  this.octokit = new Octokit2({ auth: token });
24739
24780
  }
24781
+ /**
24782
+ * Build an authenticated HTTPS clone URL for git push.
24783
+ */
24784
+ getAuthCloneUrl(owner, repo) {
24785
+ return `https://x-access-token:${this.token}@github.com/${owner}/${repo}.git`;
24786
+ }
24740
24787
  async verifyAuth() {
24741
24788
  try {
24742
24789
  const { data } = await this.octokit.users.getAuthenticated();
@@ -24959,17 +25006,30 @@ var init_dist7 = __esm({
24959
25006
  this.logStageResult(issueKey, planResult);
24960
25007
  if (planResult.status === "failed") throw new Error(`Plan failed: ${planResult.error}`);
24961
25008
  const branchName = `moxxy/issue-${payload.issueNumber}`;
24962
- const workflow = buildWorkflow(payload, planResult.output, branchName);
25009
+ const authCloneUrl = this.github.getAuthCloneUrl(payload.repo.owner, payload.repo.name);
24963
25010
  this.logger.stageStart(issueKey, "implement");
24964
25011
  const implementResult = await this.runStage(
24965
25012
  "implement",
24966
- () => implementIssue(this.supervisor, this.moltAgentId, payload, workflow)
25013
+ () => implementIssue(this.supervisor, this.moltAgentId, payload, {
25014
+ authCloneUrl,
25015
+ branchName,
25016
+ plan: planResult.output
25017
+ })
24967
25018
  );
24968
25019
  pipelineRun.stages.push(implementResult);
24969
25020
  this.logStageResult(issueKey, implementResult);
24970
25021
  if (implementResult.status === "failed")
24971
25022
  throw new Error(`Implement failed: ${implementResult.error}`);
24972
25023
  pipelineRun.branchName = branchName;
25024
+ try {
25025
+ await this.github.createBranch(
25026
+ payload.repo.owner,
25027
+ payload.repo.name,
25028
+ branchName,
25029
+ payload.repo.defaultBranch
25030
+ );
25031
+ } catch {
25032
+ }
24973
25033
  this.logger.info(issueKey, "Creating pull request...");
24974
25034
  const classificationNote = pipelineRun.classification ? `
24975
25035
 
@@ -25212,7 +25272,8 @@ async function createSDK2(config) {
25212
25272
  cliPath: claudeConfig.cliPath,
25213
25273
  model: claudeConfig.model,
25214
25274
  timeout: claudeConfig.timeout,
25215
- permissionMode: claudeConfig.permissionMode
25275
+ permissionMode: claudeConfig.permissionMode,
25276
+ dangerouslySkipPermissions: claudeConfig.dangerouslySkipPermissions
25216
25277
  });
25217
25278
  return { sdk: sdk2, sdkName };
25218
25279
  }
@@ -25426,7 +25487,7 @@ __export(cli_exports, {
25426
25487
  });
25427
25488
  function createProgram() {
25428
25489
  const program = new import_commander.Command();
25429
- program.name("moxxy").description("Moxxy - Agent orchestration platform").version("0.0.10");
25490
+ program.name("moxxy").description("Moxxy - Agent orchestration platform").version("0.0.12");
25430
25491
  registerStartCommand(program);
25431
25492
  registerRepoCommand(program);
25432
25493
  registerConfigCommand(program);
package/dist/index.mjs CHANGED
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  ConfigManager,
3
3
  createProgram
4
- } from "./chunk-USC6R2ON.mjs";
5
- import "./chunk-GSNMMI3H.mjs";
4
+ } from "./chunk-ITBO7BKI.mjs";
5
+ import "./chunk-J33O35WX.mjs";
6
6
  import "./chunk-6DZX6EAA.mjs";
7
7
 
8
8
  // src/index.ts
9
9
  async function run() {
10
- const { createProgram: createProgram2 } = await import("./cli-TBX76KQX.mjs");
10
+ const { createProgram: createProgram2 } = await import("./cli-THCGF7SQ.mjs");
11
11
  const program = createProgram2();
12
12
  await program.parseAsync(process.argv);
13
13
  }