@cortexkit/aft 0.15.3 → 0.15.4

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
@@ -10115,17 +10115,19 @@ function createGitHubIssue(repo, title, body) {
10115
10115
  if (!isGhInstalled()) {
10116
10116
  return { url: null, stderr: "gh CLI not installed" };
10117
10117
  }
10118
- try {
10119
- const result = execSync4(`gh issue create --repo ${repo} --title ${JSON.stringify(title)} --body-file -`, {
10120
- input: body,
10121
- encoding: "utf-8",
10122
- stdio: ["pipe", "pipe", "pipe"]
10123
- });
10124
- const url = result.trim().split(/\r?\n/).pop();
10125
- return { url: url || null };
10126
- } catch (error) {
10127
- return { url: null, stderr: error instanceof Error ? error.message : String(error) };
10118
+ const result = spawnSync("gh", ["issue", "create", "--repo", repo, "--title", title, "--body-file", "-"], {
10119
+ input: body,
10120
+ encoding: "utf-8",
10121
+ stdio: ["pipe", "pipe", "pipe"]
10122
+ });
10123
+ if (result.error) {
10124
+ return { url: null, stderr: result.error.message };
10125
+ }
10126
+ if (result.status !== 0) {
10127
+ return { url: null, stderr: result.stderr?.trim() || `gh exited with status ${result.status}` };
10128
10128
  }
10129
+ const url = result.stdout.trim().split(/\r?\n/).pop();
10130
+ return { url: url || null };
10129
10131
  }
10130
10132
  var init_github = () => {};
10131
10133
 
@@ -3,6 +3,13 @@ export declare function openBrowser(url: string): void;
3
3
  /**
4
4
  * Create a GitHub issue via `gh issue create`. Returns the issue URL on
5
5
  * success or null on failure.
6
+ *
7
+ * Uses spawnSync with argv array instead of execSync with a shell string —
8
+ * avoids shell metacharacter injection when `title` or `repo` contain
9
+ * backticks, `$(...)`, or `;`. Even though `JSON.stringify` quotes the title,
10
+ * the outer command runs through a shell which reinterprets backticks inside
11
+ * double-quoted strings. spawnSync with shell: false (default) passes argv
12
+ * directly to execve without any shell involvement.
6
13
  */
7
14
  export declare function createGitHubIssue(repo: string, title: string, body: string): {
8
15
  url: string | null;
@@ -1 +1 @@
1
- {"version":3,"file":"github.d.ts","sourceRoot":"","sources":["../../src/lib/github.ts"],"names":[],"mappings":"AAEA,wBAAgB,aAAa,IAAI,OAAO,CAOvC;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAc7C;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,GACX;IAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAkBzC"}
1
+ {"version":3,"file":"github.d.ts","sourceRoot":"","sources":["../../src/lib/github.ts"],"names":[],"mappings":"AAEA,wBAAgB,aAAa,IAAI,OAAO,CAOvC;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAc7C;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,GACX;IAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAqBzC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cortexkit/aft",
3
- "version": "0.15.3",
3
+ "version": "0.15.4",
4
4
  "type": "module",
5
5
  "description": "Unified CLI for Agent File Tools (AFT) — setup, doctor, and diagnostics across supported agent harnesses (OpenCode, Pi)",
6
6
  "license": "MIT",