paqad-ai 1.0.4 → 1.0.5

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # paqad-ai
2
2
 
3
+ ## 1.0.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [#35](https://github.com/Eliyce/paqad-ai/pull/35) [`c8f7f03`](https://github.com/Eliyce/paqad-ai/commit/c8f7f03c60f4149579b4f3fb1c3c89be21c77811) Thanks [@HLasani](https://github.com/HLasani)! - Normalize generated path strings to forward slashes at more production output boundaries for cross-platform consistency ([#30](https://github.com/Eliyce/paqad-ai/issues/30), [#33](https://github.com/Eliyce/paqad-ai/issues/33)). Retry `runScript` once on transient bash-subprocess failures ([#25](https://github.com/Eliyce/paqad-ai/issues/25)). Skip Windows-incompatible tests in CI excludes and align timeouts ([#28](https://github.com/Eliyce/paqad-ai/issues/28)).
8
+
3
9
  ## 1.0.4
4
10
 
5
11
  ### Patch Changes
package/dist/cli/index.js CHANGED
@@ -9,11 +9,11 @@ var __export = (target, all) => {
9
9
  __defProp(target, name, { get: all[name], enumerable: true });
10
10
  };
11
11
 
12
- // node_modules/.pnpm/tsup@8.5.1_postcss@8.5.8_typescript@5.9.3_yaml@2.8.2/node_modules/tsup/assets/esm_shims.js
12
+ // node_modules/.pnpm/tsup@8.5.1_postcss@8.5.8_typescript@5.9.3_yaml@2.9.0/node_modules/tsup/assets/esm_shims.js
13
13
  import path from "path";
14
14
  import { fileURLToPath } from "url";
15
15
  var init_esm_shims = __esm({
16
- "node_modules/.pnpm/tsup@8.5.1_postcss@8.5.8_typescript@5.9.3_yaml@2.8.2/node_modules/tsup/assets/esm_shims.js"() {
16
+ "node_modules/.pnpm/tsup@8.5.1_postcss@8.5.8_typescript@5.9.3_yaml@2.9.0/node_modules/tsup/assets/esm_shims.js"() {
17
17
  "use strict";
18
18
  }
19
19
  });
@@ -4360,11 +4360,23 @@ var init_audit = __esm({
4360
4360
  }
4361
4361
  });
4362
4362
 
4363
+ // src/core/path-utils.ts
4364
+ import { sep } from "path";
4365
+ function toPosixPath(path11) {
4366
+ return path11.split(sep).join("/");
4367
+ }
4368
+ var init_path_utils = __esm({
4369
+ "src/core/path-utils.ts"() {
4370
+ "use strict";
4371
+ init_esm_shims();
4372
+ }
4373
+ });
4374
+
4363
4375
  // src/rag/file-filter.ts
4364
4376
  import { existsSync as existsSync7, readFileSync as readFileSync4 } from "fs";
4365
4377
  import { lstat, readFile as readFile9, stat as stat3 } from "fs/promises";
4366
4378
  import { homedir as homedir5 } from "os";
4367
- import { isAbsolute, join as join16, matchesGlob, relative, sep } from "path";
4379
+ import { isAbsolute, join as join16, matchesGlob, relative } from "path";
4368
4380
  import Ajv2 from "ajv";
4369
4381
  import fg from "fast-glob";
4370
4382
  import YAML3 from "yaml";
@@ -4552,9 +4564,6 @@ function toProjectRelativePath(projectRoot, absolutePath) {
4552
4564
  function normalizeAbsolutePath(path11) {
4553
4565
  return isAbsolute(path11) ? path11 : join16(process.cwd(), path11);
4554
4566
  }
4555
- function toPosixPath(path11) {
4556
- return path11.split(sep).join("/");
4557
- }
4558
4567
  function trimSlashes(value) {
4559
4568
  return value.replace(/^\/+|\/+$/g, "");
4560
4569
  }
@@ -4568,6 +4577,7 @@ var init_file_filter = __esm({
4568
4577
  "src/rag/file-filter.ts"() {
4569
4578
  "use strict";
4570
4579
  init_esm_shims();
4580
+ init_path_utils();
4571
4581
  init_paths();
4572
4582
  BASE_EXTENSIONS = /* @__PURE__ */ new Set([".md", ".mdx", ".yaml", ".yml", ".json"]);
4573
4583
  BASE_BASENAME_INCLUDES = /* @__PURE__ */ new Set([
@@ -13479,6 +13489,7 @@ import { dirname as dirname17 } from "path";
13479
13489
  // src/onboarding/manifest-writer.ts
13480
13490
  init_esm_shims();
13481
13491
  init_paths();
13492
+ init_path_utils();
13482
13493
  init_project_profile();
13483
13494
  import { mkdirSync as mkdirSync5, writeFileSync as writeFileSync4 } from "fs";
13484
13495
  import { homedir as homedir7 } from "os";
@@ -13510,7 +13521,7 @@ function writeOnboardingManifest(projectRoot, manifest) {
13510
13521
  return path11;
13511
13522
  }
13512
13523
  function resolveFrameworkInstallPath() {
13513
- return process.env.PAQAD_FRAMEWORK_HOME ?? join38(homedir7(), ".paqad-ai/current");
13524
+ return process.env.PAQAD_FRAMEWORK_HOME ?? toPosixPath(join38(homedir7(), ".paqad-ai/current"));
13514
13525
  }
13515
13526
  function resolveFrameworkInstallReference() {
13516
13527
  return process.env.PAQAD_FRAMEWORK_HOME ? "$PAQAD_FRAMEWORK_HOME" : "~/.paqad-ai/current";
@@ -13643,6 +13654,7 @@ init_esm_shims();
13643
13654
  // src/document/workflow.ts
13644
13655
  init_esm_shims();
13645
13656
  init_paths();
13657
+ init_path_utils();
13646
13658
  init_project_profile();
13647
13659
  import { mkdir as mkdir21, readFile as readFile28, readdir as readdir6, writeFile as writeFile22 } from "fs/promises";
13648
13660
  import { dirname as dirname19, join as join43, relative as relative5 } from "path";
@@ -14977,7 +14989,7 @@ async function findOrphanedModuleDirs(projectRoot, reviewedSlugs) {
14977
14989
  const modulesRoot = join43(projectRoot, PATHS.MODULES_DIR);
14978
14990
  const entries = await readdir6(modulesRoot, { withFileTypes: true });
14979
14991
  const slugSet = new Set(reviewedSlugs);
14980
- return entries.filter((e) => e.isDirectory() && !e.name.startsWith(".") && !slugSet.has(e.name)).map((e) => join43(PATHS.MODULES_DIR, e.name));
14992
+ return entries.filter((e) => e.isDirectory() && !e.name.startsWith(".") && !slugSet.has(e.name)).map((e) => toPosixPath(join43(PATHS.MODULES_DIR, e.name)));
14981
14993
  } catch {
14982
14994
  return [];
14983
14995
  }
@@ -15571,15 +15583,17 @@ init_esm_shims();
15571
15583
 
15572
15584
  // src/onboarding/file-writer.ts
15573
15585
  init_esm_shims();
15586
+ init_path_utils();
15574
15587
  import { chmodSync as chmodSync2, existsSync as existsSync20, mkdirSync as mkdirSync7, writeFileSync as writeFileSync5 } from "fs";
15575
15588
  import { dirname as dirname20, join as join44 } from "path";
15576
15589
  function writeGeneratedFiles(projectRoot, files) {
15577
15590
  const written = [];
15578
15591
  const skipped = [];
15579
15592
  for (const file of files) {
15593
+ const reportedPath = toPosixPath(file.path);
15580
15594
  const target = join44(projectRoot, file.path);
15581
15595
  if (!file.autoUpdate && existsSync20(target)) {
15582
- skipped.push(file.path);
15596
+ skipped.push(reportedPath);
15583
15597
  continue;
15584
15598
  }
15585
15599
  mkdirSync7(dirname20(target), { recursive: true });
@@ -15587,7 +15601,7 @@ function writeGeneratedFiles(projectRoot, files) {
15587
15601
  if (file.executable === true) {
15588
15602
  chmodSync2(target, 493);
15589
15603
  }
15590
- written.push(file.path);
15604
+ written.push(reportedPath);
15591
15605
  }
15592
15606
  return { written, skipped };
15593
15607
  }
@@ -21550,6 +21564,7 @@ async function enableRagDuringOnboarding(projectRoot, ragSelection) {
21550
21564
 
21551
21565
  // src/onboarding/reference-generator.ts
21552
21566
  init_esm_shims();
21567
+ init_path_utils();
21553
21568
  init_paths();
21554
21569
  import { existsSync as existsSync35 } from "fs";
21555
21570
  import { readFile as readFile41 } from "fs/promises";
@@ -21587,14 +21602,14 @@ async function generateReferenceGuides(runtimeRoot, context) {
21587
21602
  function toProjectReferencePath(stack, relativePath) {
21588
21603
  const normalized = relativePath.replaceAll("\\", "/");
21589
21604
  if (normalized === "tools-catalog.md") {
21590
- return join72(PATHS.TOOLS_DIR, stack, "README.md");
21605
+ return toPosixPath(join72(PATHS.TOOLS_DIR, stack, "README.md"));
21591
21606
  }
21592
- return join72(PATHS.TOOLS_DIR, stack, normalized.replace(/^tools\//, ""));
21607
+ return toPosixPath(join72(PATHS.TOOLS_DIR, stack, normalized.replace(/^tools\//, "")));
21593
21608
  }
21594
21609
  function buildFallbackReferenceGuide(stack) {
21595
21610
  const title = stack.split("-").map((segment) => segment.slice(0, 1).toUpperCase() + segment.slice(1)).join(" ");
21596
21611
  return {
21597
- path: join72(PATHS.TOOLS_DIR, stack, "README.md"),
21612
+ path: toPosixPath(join72(PATHS.TOOLS_DIR, stack, "README.md")),
21598
21613
  autoUpdate: false,
21599
21614
  content: [
21600
21615
  `# ${title} Tool References`,
@@ -22183,6 +22198,7 @@ function buildRustCommands(usingCompose) {
22183
22198
  // src/onboarding/scaffold-generator.ts
22184
22199
  init_esm_shims();
22185
22200
  init_paths();
22201
+ init_path_utils();
22186
22202
  init_runtime_paths();
22187
22203
  import { join as join75 } from "path";
22188
22204
 
@@ -22220,8 +22236,8 @@ import { basename as basename9, relative as relative13 } from "pathe";
22220
22236
 
22221
22237
  // src/onboarding/scaffold-generator.ts
22222
22238
  var FEATURE_TEMPLATE_TARGETS = [
22223
- ["business.md.hbs", join75(PATHS.MODULE_FEATURES_DIR, "core", "business.md")],
22224
- ["technical.md.hbs", join75(PATHS.MODULE_FEATURES_DIR, "core", "technical.md")]
22239
+ ["business.md.hbs", toPosixPath(join75(PATHS.MODULE_FEATURES_DIR, "core", "business.md"))],
22240
+ ["technical.md.hbs", toPosixPath(join75(PATHS.MODULE_FEATURES_DIR, "core", "technical.md"))]
22225
22241
  ];
22226
22242
 
22227
22243
  // src/packs/index.ts
@@ -22302,6 +22318,7 @@ init_validator();
22302
22318
  // src/pentest/shared.ts
22303
22319
  init_esm_shims();
22304
22320
  init_paths();
22321
+ init_path_utils();
22305
22322
  import { createHash as createHash15 } from "crypto";
22306
22323
  import { existsSync as existsSync36 } from "fs";
22307
22324
  import { mkdir as mkdir32, readFile as readFile43, readdir as readdir9, writeFile as writeFile33 } from "fs/promises";
@@ -22397,12 +22414,18 @@ async function runProjectScript(projectRoot, scriptName, env, logDir) {
22397
22414
  await mkdir32(logDir, { recursive: true });
22398
22415
  if (!existsSync36(scriptPath)) {
22399
22416
  await writeFile33(stdoutPath, "");
22400
- await writeFile33(stderrPath, `Missing script: ${relative14(projectRoot, scriptPath)}
22401
- `);
22417
+ await writeFile33(
22418
+ stderrPath,
22419
+ `Missing script: ${toPosixPath(relative14(projectRoot, scriptPath))}
22420
+ `
22421
+ );
22402
22422
  return {
22403
22423
  script: scriptName,
22404
22424
  status: "blocked",
22405
- artifact_paths: [relative14(projectRoot, stdoutPath), relative14(projectRoot, stderrPath)],
22425
+ artifact_paths: [
22426
+ toPosixPath(relative14(projectRoot, stdoutPath)),
22427
+ toPosixPath(relative14(projectRoot, stderrPath))
22428
+ ],
22406
22429
  exit_code: null,
22407
22430
  summary: `Missing project script ${scriptName}`
22408
22431
  };
@@ -22451,7 +22474,7 @@ async function loadModuleDocs(projectRoot, focusModules = []) {
22451
22474
  const content = (await Promise.all(paths.map((path11) => readFile43(path11, "utf8").catch(() => "")))).join("\n");
22452
22475
  return {
22453
22476
  module: moduleName,
22454
- paths: paths.map((path11) => relative14(projectRoot, path11)),
22477
+ paths: paths.map((path11) => toPosixPath(relative14(projectRoot, path11))),
22455
22478
  content
22456
22479
  };
22457
22480
  })
@@ -22469,7 +22492,7 @@ async function loadTests(projectRoot, focusModules = []) {
22469
22492
  ) : files;
22470
22493
  return Promise.all(
22471
22494
  filtered.map(async (path11) => ({
22472
- path: relative14(projectRoot, path11),
22495
+ path: toPosixPath(relative14(projectRoot, path11)),
22473
22496
  content: await readFile43(path11, "utf8").catch(() => "")
22474
22497
  }))
22475
22498
  );
@@ -23201,6 +23224,7 @@ init_esm_shims();
23201
23224
  import { mkdir as mkdir37, writeFile as writeFile38 } from "fs/promises";
23202
23225
  import { join as join86, relative as relative17 } from "path";
23203
23226
  init_paths();
23227
+ init_path_utils();
23204
23228
 
23205
23229
  // src/pentest/findings.ts
23206
23230
  init_esm_shims();
@@ -24234,7 +24258,10 @@ var PentestWorkflow = class {
24234
24258
  this.tracker.markStepCompleted(
24235
24259
  progress,
24236
24260
  "collect-context",
24237
- [relative17(options.projectRoot, docsPath), relative17(options.projectRoot, testsPath)],
24261
+ [
24262
+ toPosixPath(relative17(options.projectRoot, docsPath)),
24263
+ toPosixPath(relative17(options.projectRoot, testsPath))
24264
+ ],
24238
24265
  [...PENTEST_SKILLS.context].map(skillPath)
24239
24266
  );
24240
24267
  await this.tracker.save(options.projectRoot, progress);
@@ -24333,7 +24360,10 @@ var PentestWorkflow = class {
24333
24360
  this.tracker.markStepCompleted(
24334
24361
  progress,
24335
24362
  "synthesize-findings",
24336
- [relative17(options.projectRoot, findingIndexPath), ...report.raw_evidence_paths],
24363
+ [
24364
+ toPosixPath(relative17(options.projectRoot, findingIndexPath)),
24365
+ ...report.raw_evidence_paths
24366
+ ],
24337
24367
  [...PENTEST_SKILLS.normalize].map(skillPath)
24338
24368
  );
24339
24369
  await this.tracker.save(options.projectRoot, progress);
@@ -24480,11 +24510,15 @@ async function buildCurrentPentestReport(input4) {
24480
24510
  ],
24481
24511
  next_remediation_priorities: remediationPriorities(findings),
24482
24512
  raw_evidence_paths: [
24483
- relative17(input4.projectRoot, osvPath),
24513
+ toPosixPath(relative17(input4.projectRoot, osvPath)),
24484
24514
  ...[
24485
- join86(PATHS.PENTEST_RUNS_DIR, input4.progressRunId, "finding-index.json"),
24486
- join86(PATHS.PENTEST_RUNS_DIR, input4.progressRunId, "artifacts", "docs-summary.json"),
24487
- join86(PATHS.PENTEST_RUNS_DIR, input4.progressRunId, "artifacts", "tests-summary.json")
24515
+ toPosixPath(join86(PATHS.PENTEST_RUNS_DIR, input4.progressRunId, "finding-index.json")),
24516
+ toPosixPath(
24517
+ join86(PATHS.PENTEST_RUNS_DIR, input4.progressRunId, "artifacts", "docs-summary.json")
24518
+ ),
24519
+ toPosixPath(
24520
+ join86(PATHS.PENTEST_RUNS_DIR, input4.progressRunId, "artifacts", "tests-summary.json")
24521
+ )
24488
24522
  ]
24489
24523
  ]
24490
24524
  };
@@ -25237,6 +25271,7 @@ init_esm_shims();
25237
25271
  // src/workflows/root-cause-analysis.ts
25238
25272
  init_esm_shims();
25239
25273
  init_paths();
25274
+ init_path_utils();
25240
25275
  import { mkdir as mkdir40, writeFile as writeFile41 } from "fs/promises";
25241
25276
  import { dirname as dirname37, join as join91 } from "path";
25242
25277
  var DEFAULT_TITLE_SLUG = "root-cause-analysis";
@@ -25262,7 +25297,9 @@ var RootCauseAnalysisWorkflow = class {
25262
25297
  await mkdir40(dirname37(outputPath), { recursive: true });
25263
25298
  await writeFile41(outputPath, buildRcaDocument(title, options.classification));
25264
25299
  return {
25265
- output_path: relativePath,
25300
+ // POSIX-normalize the user-facing output_path; on Windows path.join
25301
+ // would produce backslashes.
25302
+ output_path: toPosixPath(relativePath),
25266
25303
  title
25267
25304
  };
25268
25305
  }
@@ -27284,6 +27321,7 @@ function appendAuditLogFailure(projectRoot, previous, target, error) {
27284
27321
  // src/update/updater.ts
27285
27322
  init_esm_shims();
27286
27323
  init_paths();
27324
+ init_path_utils();
27287
27325
  init_project_profile();
27288
27326
  import { chmodSync as chmodSync4, existsSync as existsSync48, mkdirSync as mkdirSync12, readFileSync as readFileSync26, writeFileSync as writeFileSync10 } from "fs";
27289
27327
  import { mkdtemp, readdir as readdir13, readFile as readFile62, rm as rm7 } from "fs/promises";
@@ -27304,12 +27342,13 @@ var FrameworkUpdater = class {
27304
27342
  const skipped = [];
27305
27343
  const newScripts = [];
27306
27344
  for (const candidate of candidates) {
27345
+ const reportedPath = toPosixPath(candidate.path);
27307
27346
  const target = join104(projectRoot, candidate.path);
27308
27347
  const existed = existsSync48(target);
27309
27348
  const autoUpdate = artifactPolicy.get(candidate.path) ?? candidate.autoUpdate;
27310
27349
  if (existed && autoUpdate === false) {
27311
27350
  skipped.push({
27312
- path: candidate.path,
27351
+ path: reportedPath,
27313
27352
  before: readFileSync26(target, "utf8"),
27314
27353
  after: candidate.content
27315
27354
  });
@@ -27320,9 +27359,9 @@ var FrameworkUpdater = class {
27320
27359
  if (candidate.executable === true) {
27321
27360
  chmodSync4(target, 493);
27322
27361
  }
27323
- regenerated.push(candidate.path);
27324
- if (!existed && candidate.path.startsWith("scripts/")) {
27325
- newScripts.push(candidate.path);
27362
+ regenerated.push(reportedPath);
27363
+ if (!existed && reportedPath.startsWith("scripts/")) {
27364
+ newScripts.push(reportedPath);
27326
27365
  }
27327
27366
  }
27328
27367
  mkdirSync12(dirname45(join104(projectRoot, PATHS.FRAMEWORK_VERSION)), { recursive: true });
@@ -27505,7 +27544,7 @@ init_esm_shims();
27505
27544
  init_esm_shims();
27506
27545
 
27507
27546
  // src/index.ts
27508
- var VERSION = "1.0.4";
27547
+ var VERSION = "1.0.5";
27509
27548
 
27510
27549
  // src/cli/commands/capabilities.ts
27511
27550
  init_esm_shims();