@xdevops/issue-auto-finish 1.0.7 → 1.0.8

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.
@@ -1 +1 @@
1
- {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/init.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAsB,WAAW,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAqDrE"}
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/init.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAsB,WAAW,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CA0DrE"}
package/dist/cli.js CHANGED
@@ -23,7 +23,7 @@ var pkg = JSON.parse(readFileSync(findPackageJson(), "utf-8"));
23
23
  var program = new Command();
24
24
  program.name("issue-auto-finish").description("Issue Auto-Finish: AI-powered issue resolution daemon").version(pkg.version);
25
25
  program.command("init").description("Launch the interactive web setup wizard").option("-p, --port <port>", "Port for the setup wizard", "3456").option("-c, --config <path>", "Config file path to generate").action(async (opts) => {
26
- const { initCommand } = await import("./init-G4JOLOGK.js");
26
+ const { initCommand } = await import("./init-YMWYE6XB.js");
27
27
  await initCommand({ port: parseInt(opts.port, 10), config: opts.config });
28
28
  });
29
29
  program.command("start").description("Start the issue-auto-finish daemon service").option("-c, --config <path>", "Path to .env config file").action(async (opts) => {
@@ -34,10 +34,15 @@ async function initCommand(options) {
34
34
  app.use(setupRouter);
35
35
  const packageRoot = path.resolve(__dirname, "..");
36
36
  const publicDir = path.resolve(packageRoot, "src/web/frontend/dist");
37
- if (fs.existsSync(publicDir)) {
37
+ const indexHtml = path.join(publicDir, "index.html");
38
+ if (fs.existsSync(indexHtml)) {
38
39
  app.use(express.static(publicDir));
39
40
  app.get("{*path}", (_req, res) => {
40
- res.sendFile(path.join(publicDir, "index.html"));
41
+ res.sendFile(indexHtml, (err) => {
42
+ if (err) {
43
+ res.status(404).type("html").send("<!DOCTYPE html><html><body>Not Found</body></html>");
44
+ }
45
+ });
41
46
  });
42
47
  } else {
43
48
  app.get("/", (_req, res) => {
@@ -67,4 +72,4 @@ async function initCommand(options) {
67
72
  export {
68
73
  initCommand
69
74
  };
70
- //# sourceMappingURL=init-G4JOLOGK.js.map
75
+ //# sourceMappingURL=init-YMWYE6XB.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/cli/commands/init.ts"],"sourcesContent":["import express from 'express';\nimport fs from 'node:fs';\nimport path from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport { createSetupRouter } from '../../web/routes/setup.js';\n\nconst __dirname = path.dirname(fileURLToPath(import.meta.url));\n\nexport interface InitOptions {\n port: number;\n config?: string;\n}\n\nexport async function initCommand(options: InitOptions): Promise<void> {\n const app = express();\n app.use(express.json());\n\n let serverRef: ReturnType<typeof app.listen> | null = null;\n\n const setupRouter = createSetupRouter({\n configPath: options.config,\n onComplete: (configPath) => {\n console.log(`\\n Configuration saved to: ${configPath}`);\n console.log(' Run \"issue-auto-finish start\" to start the service.\\n');\n setTimeout(() => {\n serverRef?.close();\n process.exit(0);\n }, 1000);\n },\n });\n\n app.use(setupRouter);\n\n const packageRoot = path.resolve(__dirname, '..');\n const publicDir = path.resolve(packageRoot, 'src/web/frontend/dist');\n\n const indexHtml = path.join(publicDir, 'index.html');\n if (fs.existsSync(indexHtml)) {\n app.use(express.static(publicDir));\n app.get('{*path}', (_req, res) => {\n res.sendFile(indexHtml, (err) => {\n if (err) {\n res.status(404).type('html').send('<!DOCTYPE html><html><body>Not Found</body></html>');\n }\n });\n });\n } else {\n app.get('/', (_req, res) => {\n res.type('html').send(`<!DOCTYPE html>\n<html><head><title>Issue Auto-Finish Setup</title></head>\n<body style=\"font-family:system-ui;max-width:600px;margin:60px auto;padding:20px\">\n<h1>Issue Auto-Finish Setup</h1>\n<p>Frontend assets not found. Please build the frontend first:</p>\n<pre>cd issue-auto-finish && pnpm web:build</pre>\n<p>Or use the API directly at <code>/api/setup/*</code></p>\n</body></html>`);\n });\n }\n\n serverRef = app.listen(options.port, async () => {\n const url = `http://localhost:${options.port}`;\n console.log(`\\n Issue Auto-Finish Setup Wizard`);\n console.log(` Open: ${url}\\n`);\n\n try {\n const open = (await import('open')).default;\n await open(url);\n } catch {\n // Browser open failed, user can manually navigate\n }\n });\n}\n"],"mappings":";;;;;;;;;;;;AAAA,OAAO,aAAa;AACpB,OAAO,QAAQ;AACf,OAAO,UAAU;AACjB,SAAS,qBAAqB;AAG9B,IAAM,YAAY,KAAK,QAAQ,cAAc,YAAY,GAAG,CAAC;AAO7D,eAAsB,YAAY,SAAqC;AACrE,QAAM,MAAM,QAAQ;AACpB,MAAI,IAAI,QAAQ,KAAK,CAAC;AAEtB,MAAI,YAAkD;AAEtD,QAAM,cAAc,kBAAkB;AAAA,IACpC,YAAY,QAAQ;AAAA,IACpB,YAAY,CAAC,eAAe;AAC1B,cAAQ,IAAI;AAAA,4BAA+B,UAAU,EAAE;AACvD,cAAQ,IAAI,yDAAyD;AACrE,iBAAW,MAAM;AACf,mBAAW,MAAM;AACjB,gBAAQ,KAAK,CAAC;AAAA,MAChB,GAAG,GAAI;AAAA,IACT;AAAA,EACF,CAAC;AAED,MAAI,IAAI,WAAW;AAEnB,QAAM,cAAc,KAAK,QAAQ,WAAW,IAAI;AAChD,QAAM,YAAY,KAAK,QAAQ,aAAa,uBAAuB;AAEnE,QAAM,YAAY,KAAK,KAAK,WAAW,YAAY;AACnD,MAAI,GAAG,WAAW,SAAS,GAAG;AAC5B,QAAI,IAAI,QAAQ,OAAO,SAAS,CAAC;AACjC,QAAI,IAAI,WAAW,CAAC,MAAM,QAAQ;AAChC,UAAI,SAAS,WAAW,CAAC,QAAQ;AAC/B,YAAI,KAAK;AACP,cAAI,OAAO,GAAG,EAAE,KAAK,MAAM,EAAE,KAAK,oDAAoD;AAAA,QACxF;AAAA,MACF,CAAC;AAAA,IACH,CAAC;AAAA,EACH,OAAO;AACL,QAAI,IAAI,KAAK,CAAC,MAAM,QAAQ;AAC1B,UAAI,KAAK,MAAM,EAAE,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,eAOb;AAAA,IACX,CAAC;AAAA,EACH;AAEA,cAAY,IAAI,OAAO,QAAQ,MAAM,YAAY;AAC/C,UAAM,MAAM,oBAAoB,QAAQ,IAAI;AAC5C,YAAQ,IAAI;AAAA,iCAAoC;AAChD,YAAQ,IAAI,WAAW,GAAG;AAAA,CAAI;AAE9B,QAAI;AACF,YAAM,QAAQ,MAAM,OAAO,MAAM,GAAG;AACpC,YAAM,KAAK,GAAG;AAAA,IAChB,QAAQ;AAAA,IAER;AAAA,EACF,CAAC;AACH;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xdevops/issue-auto-finish",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "description": "Issue Auto-Finish: AI-powered issue resolution daemon",
5
5
  "type": "module",
6
6
  "main": "./dist/lib.js",