arkgate 2.9.1 → 2.10.0

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.
Files changed (43) hide show
  1. package/CHANGELOG.md +72 -0
  2. package/README.md +14 -2
  3. package/bin/ark-mcp.mjs +282 -102
  4. package/bin/lib/agent-gates.mjs +181 -6
  5. package/bin/lib/architecture-scan.mjs +19 -0
  6. package/bin/lib/auto-patch.mjs +264 -0
  7. package/bin/lib/doctor-plan.mjs +54 -0
  8. package/bin/lib/port-proof.mjs +309 -0
  9. package/bin/lib/prepare-write.mjs +130 -0
  10. package/bin/lib/remediation.mjs +21 -0
  11. package/dist/index.cjs +13 -4
  12. package/dist/index.cjs.map +1 -1
  13. package/dist/index.d.cts +1 -1
  14. package/dist/index.d.ts +1 -1
  15. package/dist/index.js +13 -4
  16. package/dist/index.js.map +1 -1
  17. package/dist/nestjs/index.cjs +1 -1
  18. package/dist/nestjs/index.cjs.map +1 -1
  19. package/dist/nestjs/index.js +1 -1
  20. package/dist/nestjs/index.js.map +1 -1
  21. package/dist/runtime/index.cjs +13 -4
  22. package/dist/runtime/index.cjs.map +1 -1
  23. package/dist/runtime/index.js +13 -4
  24. package/dist/runtime/index.js.map +1 -1
  25. package/docs/agent-guide.md +14 -0
  26. package/docs/ai-gates.md +43 -3
  27. package/docs/enthusiast/how-to-agent-gates.md +8 -0
  28. package/docs/enthusiast/reference-commands.md +1 -1
  29. package/package.json +2 -1
  30. package/server.json +2 -2
  31. package/templates/skills/ark-adopt.md +57 -10
  32. package/templates/skills/ark-architect.md +33 -2
  33. package/templates/skills/ark-autopilot.md +75 -20
  34. package/templates/skills/ark-contract.md +36 -0
  35. package/templates/skills/ark-coverage.md +81 -27
  36. package/templates/skills/ark-explain.md +35 -2
  37. package/templates/skills/ark-explore.md +119 -0
  38. package/templates/skills/ark-fix.md +47 -2
  39. package/templates/skills/ark-loop.md +50 -3
  40. package/templates/skills/ark-place.md +36 -0
  41. package/templates/skills/ark-runtime.md +36 -0
  42. package/templates/skills/ark-think.md +63 -12
  43. package/templates/skills/ark-upgrade.md +33 -1
@@ -80,7 +80,7 @@ __export(runtime_exports, {
80
80
  module.exports = __toCommonJS(runtime_exports);
81
81
 
82
82
  // src/version.ts
83
- var version = "2.9.1";
83
+ var version = "2.10.0";
84
84
 
85
85
  // src/kernel/intent/IntentRegistry.ts
86
86
  var IntentRegistry = class {
@@ -2255,7 +2255,9 @@ function extractModuleSpecifiers(source) {
2255
2255
  let match;
2256
2256
  while ((match = pattern.re.exec(source)) !== null) {
2257
2257
  const index = match.index + match[0].indexOf(match[1]);
2258
- matches.push({ value: match[1], index, kind: pattern.kind });
2258
+ const raw = match[0];
2259
+ const typeOnly = pattern.kind === "import" && /\bimport\s+type\b/.test(raw) || pattern.kind === "export" && /\bexport\s+type\b/.test(raw);
2260
+ matches.push({ value: match[1], index, kind: pattern.kind, typeOnly });
2259
2261
  }
2260
2262
  }
2261
2263
  return matches.sort((a, b) => a.index - b.index);
@@ -2495,6 +2497,9 @@ function createAICodeGate(options = {}) {
2495
2497
  }
2496
2498
  );
2497
2499
  if (blocked) {
2500
+ if (specifier.typeOnly && !blocked.peerIsolation) {
2501
+ continue;
2502
+ }
2498
2503
  const peer = Boolean(blocked.peerIsolation);
2499
2504
  violations.push(
2500
2505
  violation(
@@ -2508,7 +2513,11 @@ function createAICodeGate(options = {}) {
2508
2513
  fromLayer: contextLayer,
2509
2514
  toLayer: targetLayer,
2510
2515
  suggestion: peer ? "Extract shared code to a shared layer, or coordinate slices via events/ports \u2014 do not import across feature/context slices." : "Depend on a port/interface owned by an inner layer instead, or move this code to a layer allowed to make this import.",
2511
- details: { importKind: specifier.kind, peerIsolation: peer }
2516
+ details: {
2517
+ importKind: specifier.kind,
2518
+ peerIsolation: peer,
2519
+ ...specifier.typeOnly ? { typeOnly: true } : {}
2520
+ }
2512
2521
  }
2513
2522
  )
2514
2523
  );
@@ -2518,7 +2527,7 @@ function createAICodeGate(options = {}) {
2518
2527
  continue;
2519
2528
  }
2520
2529
  }
2521
- if (exemptFromInfraHeuristics) continue;
2530
+ if (exemptFromInfraHeuristics || specifier.typeOnly) continue;
2522
2531
  if (!hasInfrastructureToken(specifier.value) && !isKnownInfrastructurePackage(specifier.value)) {
2523
2532
  continue;
2524
2533
  }