geopilot 0.0.0-stage → 0.0.1

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 (290) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +91 -2
  3. package/dist/agent/install.d.ts +23 -0
  4. package/dist/agent/install.js +77 -0
  5. package/dist/agent/install.js.map +1 -0
  6. package/dist/cache/runs.d.ts +18 -0
  7. package/dist/cache/runs.js +91 -0
  8. package/dist/cache/runs.js.map +1 -0
  9. package/dist/cli/args.d.ts +20 -0
  10. package/dist/cli/args.js +116 -0
  11. package/dist/cli/args.js.map +1 -0
  12. package/dist/cli/commands/agent.d.ts +2 -0
  13. package/dist/cli/commands/agent.js +48 -0
  14. package/dist/cli/commands/agent.js.map +1 -0
  15. package/dist/cli/commands/fix.d.ts +2 -0
  16. package/dist/cli/commands/fix.js +284 -0
  17. package/dist/cli/commands/fix.js.map +1 -0
  18. package/dist/cli/commands/init.d.ts +2 -0
  19. package/dist/cli/commands/init.js +62 -0
  20. package/dist/cli/commands/init.js.map +1 -0
  21. package/dist/cli/commands/insights.d.ts +17 -0
  22. package/dist/cli/commands/insights.js +143 -0
  23. package/dist/cli/commands/insights.js.map +1 -0
  24. package/dist/cli/commands/rules.d.ts +5 -0
  25. package/dist/cli/commands/rules.js +86 -0
  26. package/dist/cli/commands/rules.js.map +1 -0
  27. package/dist/cli/commands/scan.d.ts +14 -0
  28. package/dist/cli/commands/scan.js +127 -0
  29. package/dist/cli/commands/scan.js.map +1 -0
  30. package/dist/cli/commands-list.d.ts +6 -0
  31. package/dist/cli/commands-list.js +15 -0
  32. package/dist/cli/commands-list.js.map +1 -0
  33. package/dist/cli/context.d.ts +26 -0
  34. package/dist/cli/context.js +108 -0
  35. package/dist/cli/context.js.map +1 -0
  36. package/dist/cli/io.d.ts +16 -0
  37. package/dist/cli/io.js +28 -0
  38. package/dist/cli/io.js.map +1 -0
  39. package/dist/cli/main.d.ts +15 -0
  40. package/dist/cli/main.js +118 -0
  41. package/dist/cli/main.js.map +1 -0
  42. package/dist/collect/crawl.d.ts +51 -0
  43. package/dist/collect/crawl.js +187 -0
  44. package/dist/collect/crawl.js.map +1 -0
  45. package/dist/config/config.d.ts +86 -0
  46. package/dist/config/config.js +396 -0
  47. package/dist/config/config.js.map +1 -0
  48. package/dist/core/errors.d.ts +20 -0
  49. package/dist/core/errors.js +32 -0
  50. package/dist/core/errors.js.map +1 -0
  51. package/dist/core/hash.d.ts +7 -0
  52. package/dist/core/hash.js +28 -0
  53. package/dist/core/hash.js.map +1 -0
  54. package/dist/core/redact.d.ts +3 -0
  55. package/dist/core/redact.js +23 -0
  56. package/dist/core/redact.js.map +1 -0
  57. package/dist/core/tty.d.ts +12 -0
  58. package/dist/core/tty.js +33 -0
  59. package/dist/core/tty.js.map +1 -0
  60. package/dist/core/version.d.ts +6 -0
  61. package/dist/core/version.js +10 -0
  62. package/dist/core/version.js.map +1 -0
  63. package/dist/fix/apply.d.ts +119 -0
  64. package/dist/fix/apply.js +334 -0
  65. package/dist/fix/apply.js.map +1 -0
  66. package/dist/fix/diff.d.ts +1 -0
  67. package/dist/fix/diff.js +35 -0
  68. package/dist/fix/diff.js.map +1 -0
  69. package/dist/fix/plan.d.ts +42 -0
  70. package/dist/fix/plan.js +385 -0
  71. package/dist/fix/plan.js.map +1 -0
  72. package/dist/fix/serve.d.ts +13 -0
  73. package/dist/fix/serve.js +112 -0
  74. package/dist/fix/serve.js.map +1 -0
  75. package/dist/fix/variants.d.ts +13 -0
  76. package/dist/fix/variants.js +8 -0
  77. package/dist/fix/variants.js.map +1 -0
  78. package/dist/frameworks/ast.d.ts +84 -0
  79. package/dist/frameworks/ast.js +231 -0
  80. package/dist/frameworks/ast.js.map +1 -0
  81. package/dist/frameworks/nextjs-app/analyze.d.ts +92 -0
  82. package/dist/frameworks/nextjs-app/analyze.js +350 -0
  83. package/dist/frameworks/nextjs-app/analyze.js.map +1 -0
  84. package/dist/frameworks/static/analyze.d.ts +18 -0
  85. package/dist/frameworks/static/analyze.js +66 -0
  86. package/dist/frameworks/static/analyze.js.map +1 -0
  87. package/dist/html/parse.d.ts +50 -0
  88. package/dist/html/parse.js +205 -0
  89. package/dist/html/parse.js.map +1 -0
  90. package/dist/index.d.ts +10 -0
  91. package/dist/index.js +11 -0
  92. package/dist/index.js.map +1 -0
  93. package/dist/insights/validate.d.ts +74 -0
  94. package/dist/insights/validate.js +213 -0
  95. package/dist/insights/validate.js.map +1 -0
  96. package/dist/net/address.d.ts +10 -0
  97. package/dist/net/address.js +116 -0
  98. package/dist/net/address.js.map +1 -0
  99. package/dist/net/fetch.d.ts +53 -0
  100. package/dist/net/fetch.js +281 -0
  101. package/dist/net/fetch.js.map +1 -0
  102. package/dist/repo/detect.d.ts +3 -0
  103. package/dist/repo/detect.js +92 -0
  104. package/dist/repo/detect.js.map +1 -0
  105. package/dist/repo/reader.d.ts +12 -0
  106. package/dist/repo/reader.js +97 -0
  107. package/dist/repo/reader.js.map +1 -0
  108. package/dist/report/render.d.ts +20 -0
  109. package/dist/report/render.js +176 -0
  110. package/dist/report/render.js.map +1 -0
  111. package/dist/robots/crawlers.d.ts +10 -0
  112. package/dist/robots/crawlers.js +20 -0
  113. package/dist/robots/crawlers.js.map +1 -0
  114. package/dist/robots/robots.d.ts +33 -0
  115. package/dist/robots/robots.js +133 -0
  116. package/dist/robots/robots.js.map +1 -0
  117. package/dist/rules/catalogue.d.ts +43 -0
  118. package/dist/rules/catalogue.js +361 -0
  119. package/dist/rules/catalogue.js.map +1 -0
  120. package/dist/rules/context.d.ts +36 -0
  121. package/dist/rules/context.js +129 -0
  122. package/dist/rules/context.js.map +1 -0
  123. package/dist/rules/evaluate.d.ts +11 -0
  124. package/dist/rules/evaluate.js +1070 -0
  125. package/dist/rules/evaluate.js.map +1 -0
  126. package/dist/rules/finalize.d.ts +34 -0
  127. package/dist/rules/finalize.js +93 -0
  128. package/dist/rules/finalize.js.map +1 -0
  129. package/dist/scan.d.ts +27 -0
  130. package/dist/scan.js +147 -0
  131. package/dist/scan.js.map +1 -0
  132. package/dist/scoring/compare.d.ts +21 -0
  133. package/dist/scoring/compare.js +47 -0
  134. package/dist/scoring/compare.js.map +1 -0
  135. package/dist/scoring/score.d.ts +21 -0
  136. package/dist/scoring/score.js +112 -0
  137. package/dist/scoring/score.js.map +1 -0
  138. package/dist/sitemap/sitemap.d.ts +10 -0
  139. package/dist/sitemap/sitemap.js +48 -0
  140. package/dist/sitemap/sitemap.js.map +1 -0
  141. package/dist/types.d.ts +155 -0
  142. package/dist/types.js +13 -0
  143. package/dist/types.js.map +1 -0
  144. package/hosts/claude-project/.claude/agents/geopilot-explainer.md +36 -0
  145. package/hosts/claude-project/.claude/agents/geopilot-fixer.md +42 -0
  146. package/hosts/claude-project/.claude/agents/geopilot-investigator.md +45 -0
  147. package/hosts/claude-project/.claude/agents/geopilot-reviewer.md +41 -0
  148. package/hosts/claude-project/.claude/agents/geopilot-scanner.md +47 -0
  149. package/hosts/claude-project/.claude/skills/geo/SKILL.md +95 -0
  150. package/hosts/claude-project/.claude/skills/geo/references/frameworks.md +20 -0
  151. package/hosts/claude-project/.claude/skills/geo/references/insight-contract.md +42 -0
  152. package/hosts/claude-project/.claude/skills/geo/references/safety.md +30 -0
  153. package/hosts/claude-project/.claude/skills/geo/references/workflow-explain.md +8 -0
  154. package/hosts/claude-project/.claude/skills/geo/references/workflow-fix.md +20 -0
  155. package/hosts/claude-project/.claude/skills/geo/references/workflow-init.md +6 -0
  156. package/hosts/claude-project/.claude/skills/geo/references/workflow-insights.md +13 -0
  157. package/hosts/claude-project/.claude/skills/geo/references/workflow-plan.md +13 -0
  158. package/hosts/claude-project/.claude/skills/geo/references/workflow-review.md +8 -0
  159. package/hosts/claude-project/.claude/skills/geo/references/workflow-scan.md +18 -0
  160. package/hosts/claude-project/.claude/skills/geo/schemas/insights.schema.json +255 -0
  161. package/hosts/claude-project/.claude/skills/geo/scripts/geo.ps1 +14 -0
  162. package/hosts/claude-project/.claude/skills/geo/scripts/geo.sh +13 -0
  163. package/hosts/claude-project/.claude/skills/geopilot-explain/SKILL.md +9 -0
  164. package/hosts/claude-project/.claude/skills/geopilot-fix/SKILL.md +12 -0
  165. package/hosts/claude-project/.claude/skills/geopilot-init/SKILL.md +15 -0
  166. package/hosts/claude-project/.claude/skills/geopilot-insights/SKILL.md +11 -0
  167. package/hosts/claude-project/.claude/skills/geopilot-review/SKILL.md +11 -0
  168. package/hosts/claude-project/.claude/skills/geopilot-scan/SKILL.md +11 -0
  169. package/hosts/codex/plugin.json +21 -0
  170. package/hosts/codex/skills/explain/SKILL.md +38 -0
  171. package/hosts/codex/skills/fix/SKILL.md +46 -0
  172. package/hosts/codex/skills/fix/agents/openai.yaml +2 -0
  173. package/hosts/codex/skills/geo/SKILL.md +95 -0
  174. package/hosts/codex/skills/geo/references/frameworks.md +20 -0
  175. package/hosts/codex/skills/geo/references/insight-contract.md +42 -0
  176. package/hosts/codex/skills/geo/references/safety.md +30 -0
  177. package/hosts/codex/skills/geo/references/workflow-explain.md +8 -0
  178. package/hosts/codex/skills/geo/references/workflow-fix.md +20 -0
  179. package/hosts/codex/skills/geo/references/workflow-init.md +6 -0
  180. package/hosts/codex/skills/geo/references/workflow-insights.md +13 -0
  181. package/hosts/codex/skills/geo/references/workflow-plan.md +13 -0
  182. package/hosts/codex/skills/geo/references/workflow-review.md +8 -0
  183. package/hosts/codex/skills/geo/references/workflow-scan.md +18 -0
  184. package/hosts/codex/skills/geo/schemas/insights.schema.json +255 -0
  185. package/hosts/codex/skills/geo/scripts/geo.ps1 +14 -0
  186. package/hosts/codex/skills/geo/scripts/geo.sh +13 -0
  187. package/hosts/codex/skills/init/SKILL.md +13 -0
  188. package/hosts/codex/skills/init/agents/openai.yaml +2 -0
  189. package/hosts/codex/skills/insights/SKILL.md +49 -0
  190. package/hosts/codex/skills/review/SKILL.md +45 -0
  191. package/hosts/codex/skills/scan/SKILL.md +51 -0
  192. package/hosts/codex-project/.agents/skills/geo/SKILL.md +95 -0
  193. package/hosts/codex-project/.agents/skills/geo/references/frameworks.md +20 -0
  194. package/hosts/codex-project/.agents/skills/geo/references/insight-contract.md +42 -0
  195. package/hosts/codex-project/.agents/skills/geo/references/safety.md +30 -0
  196. package/hosts/codex-project/.agents/skills/geo/references/workflow-explain.md +8 -0
  197. package/hosts/codex-project/.agents/skills/geo/references/workflow-fix.md +20 -0
  198. package/hosts/codex-project/.agents/skills/geo/references/workflow-init.md +6 -0
  199. package/hosts/codex-project/.agents/skills/geo/references/workflow-insights.md +13 -0
  200. package/hosts/codex-project/.agents/skills/geo/references/workflow-plan.md +13 -0
  201. package/hosts/codex-project/.agents/skills/geo/references/workflow-review.md +8 -0
  202. package/hosts/codex-project/.agents/skills/geo/references/workflow-scan.md +18 -0
  203. package/hosts/codex-project/.agents/skills/geo/schemas/insights.schema.json +255 -0
  204. package/hosts/codex-project/.agents/skills/geo/scripts/geo.ps1 +14 -0
  205. package/hosts/codex-project/.agents/skills/geo/scripts/geo.sh +13 -0
  206. package/hosts/codex-project/.agents/skills/geopilot-explain/SKILL.md +8 -0
  207. package/hosts/codex-project/.agents/skills/geopilot-fix/SKILL.md +10 -0
  208. package/hosts/codex-project/.agents/skills/geopilot-fix/agents/openai.yaml +2 -0
  209. package/hosts/codex-project/.agents/skills/geopilot-init/SKILL.md +13 -0
  210. package/hosts/codex-project/.agents/skills/geopilot-init/agents/openai.yaml +2 -0
  211. package/hosts/codex-project/.agents/skills/geopilot-insights/SKILL.md +10 -0
  212. package/hosts/codex-project/.agents/skills/geopilot-review/SKILL.md +10 -0
  213. package/hosts/codex-project/.agents/skills/geopilot-scan/SKILL.md +10 -0
  214. package/hosts/codex-project/.codex/agents/geopilot-explainer.toml +34 -0
  215. package/hosts/codex-project/.codex/agents/geopilot-fixer.toml +40 -0
  216. package/hosts/codex-project/.codex/agents/geopilot-investigator.toml +43 -0
  217. package/hosts/codex-project/.codex/agents/geopilot-reviewer.toml +39 -0
  218. package/hosts/codex-project/.codex/agents/geopilot-scanner.toml +45 -0
  219. package/hosts/geopilot/.claude-plugin/plugin.json +22 -0
  220. package/hosts/geopilot/README.md +25 -0
  221. package/hosts/geopilot/agents/explainer.agent.md +36 -0
  222. package/hosts/geopilot/agents/fixer.agent.md +42 -0
  223. package/hosts/geopilot/agents/investigator.agent.md +45 -0
  224. package/hosts/geopilot/agents/reviewer.agent.md +41 -0
  225. package/hosts/geopilot/agents/scanner.agent.md +47 -0
  226. package/hosts/geopilot/assets/icon.png +0 -0
  227. package/hosts/geopilot/skills/explain/SKILL.md +9 -0
  228. package/hosts/geopilot/skills/fix/SKILL.md +12 -0
  229. package/hosts/geopilot/skills/geo/SKILL.md +95 -0
  230. package/hosts/geopilot/skills/geo/references/frameworks.md +20 -0
  231. package/hosts/geopilot/skills/geo/references/insight-contract.md +42 -0
  232. package/hosts/geopilot/skills/geo/references/safety.md +30 -0
  233. package/hosts/geopilot/skills/geo/references/workflow-explain.md +8 -0
  234. package/hosts/geopilot/skills/geo/references/workflow-fix.md +20 -0
  235. package/hosts/geopilot/skills/geo/references/workflow-init.md +6 -0
  236. package/hosts/geopilot/skills/geo/references/workflow-insights.md +13 -0
  237. package/hosts/geopilot/skills/geo/references/workflow-plan.md +13 -0
  238. package/hosts/geopilot/skills/geo/references/workflow-review.md +8 -0
  239. package/hosts/geopilot/skills/geo/references/workflow-scan.md +18 -0
  240. package/hosts/geopilot/skills/geo/schemas/insights.schema.json +255 -0
  241. package/hosts/geopilot/skills/geo/scripts/geo.ps1 +14 -0
  242. package/hosts/geopilot/skills/geo/scripts/geo.sh +13 -0
  243. package/hosts/geopilot/skills/init/SKILL.md +15 -0
  244. package/hosts/geopilot/skills/insights/SKILL.md +11 -0
  245. package/hosts/geopilot/skills/review/SKILL.md +11 -0
  246. package/hosts/geopilot/skills/scan/SKILL.md +11 -0
  247. package/hosts/opencode/.opencode/agents/geopilot-explainer.md +39 -0
  248. package/hosts/opencode/.opencode/agents/geopilot-fixer.md +45 -0
  249. package/hosts/opencode/.opencode/agents/geopilot-investigator.md +48 -0
  250. package/hosts/opencode/.opencode/agents/geopilot-reviewer.md +44 -0
  251. package/hosts/opencode/.opencode/agents/geopilot-scanner.md +50 -0
  252. package/hosts/opencode/.opencode/commands/geopilot-explain.md +8 -0
  253. package/hosts/opencode/.opencode/commands/geopilot-fix.md +10 -0
  254. package/hosts/opencode/.opencode/commands/geopilot-init.md +12 -0
  255. package/hosts/opencode/.opencode/commands/geopilot-insights.md +10 -0
  256. package/hosts/opencode/.opencode/commands/geopilot-review.md +10 -0
  257. package/hosts/opencode/.opencode/commands/geopilot-scan.md +10 -0
  258. package/hosts/opencode/.opencode/skills/geo/SKILL.md +95 -0
  259. package/hosts/opencode/.opencode/skills/geo/references/frameworks.md +20 -0
  260. package/hosts/opencode/.opencode/skills/geo/references/insight-contract.md +42 -0
  261. package/hosts/opencode/.opencode/skills/geo/references/safety.md +30 -0
  262. package/hosts/opencode/.opencode/skills/geo/references/workflow-explain.md +8 -0
  263. package/hosts/opencode/.opencode/skills/geo/references/workflow-fix.md +20 -0
  264. package/hosts/opencode/.opencode/skills/geo/references/workflow-init.md +6 -0
  265. package/hosts/opencode/.opencode/skills/geo/references/workflow-insights.md +13 -0
  266. package/hosts/opencode/.opencode/skills/geo/references/workflow-plan.md +13 -0
  267. package/hosts/opencode/.opencode/skills/geo/references/workflow-review.md +8 -0
  268. package/hosts/opencode/.opencode/skills/geo/references/workflow-scan.md +18 -0
  269. package/hosts/opencode/.opencode/skills/geo/schemas/insights.schema.json +255 -0
  270. package/hosts/opencode/.opencode/skills/geo/scripts/geo.ps1 +14 -0
  271. package/hosts/opencode/.opencode/skills/geo/scripts/geo.sh +13 -0
  272. package/package.json +65 -4
  273. package/schemas/config-v1.json +392 -0
  274. package/schemas/insights-v1.json +255 -0
  275. package/schemas/merged-v1.json +71 -0
  276. package/schemas/report-v1.json +836 -0
  277. package/skill/geo/SKILL.md +95 -0
  278. package/skill/geo/references/frameworks.md +20 -0
  279. package/skill/geo/references/insight-contract.md +42 -0
  280. package/skill/geo/references/safety.md +30 -0
  281. package/skill/geo/references/workflow-explain.md +8 -0
  282. package/skill/geo/references/workflow-fix.md +20 -0
  283. package/skill/geo/references/workflow-init.md +6 -0
  284. package/skill/geo/references/workflow-insights.md +13 -0
  285. package/skill/geo/references/workflow-plan.md +13 -0
  286. package/skill/geo/references/workflow-review.md +8 -0
  287. package/skill/geo/references/workflow-scan.md +18 -0
  288. package/skill/geo/schemas/insights.schema.json +255 -0
  289. package/skill/geo/scripts/geo.ps1 +14 -0
  290. package/skill/geo/scripts/geo.sh +13 -0
@@ -0,0 +1,116 @@
1
+ import { usage } from "../core/errors.js";
2
+ export const GLOBAL_FLAGS = [
3
+ { name: 'config', type: 'string' },
4
+ { name: 'cwd', type: 'string' },
5
+ { name: 'format', type: 'multi' },
6
+ { name: 'output', type: 'multi', short: 'o' },
7
+ { name: 'non-interactive', type: 'boolean' },
8
+ { name: 'yes', type: 'boolean', short: 'y' },
9
+ { name: 'quiet', type: 'boolean', short: 'q' },
10
+ { name: 'verbose', type: 'boolean' },
11
+ { name: 'no-color', type: 'boolean' },
12
+ { name: 'no-cache', type: 'boolean' },
13
+ { name: 'print-config', type: 'boolean' },
14
+ { name: 'help', type: 'boolean', short: 'h' },
15
+ ];
16
+ export const SCAN_FLAGS = [
17
+ { name: 'url', type: 'multi' },
18
+ { name: 'max-pages', type: 'string' },
19
+ { name: 'max-depth', type: 'string' },
20
+ { name: 'routes', type: 'multi' },
21
+ { name: 'render', type: 'string' },
22
+ { name: 'follow-external', type: 'boolean' },
23
+ { name: 'ignore-robots', type: 'boolean' },
24
+ { name: 'fail-on', type: 'string' },
25
+ { name: 'min-readiness', type: 'string' },
26
+ { name: 'fail-on-incomplete', type: 'boolean' },
27
+ { name: 'baseline', type: 'string' },
28
+ { name: 'rule', type: 'multi' },
29
+ { name: 'skip-rule', type: 'multi' },
30
+ ];
31
+ export const FIX_FLAGS = [
32
+ { name: 'rule', type: 'multi' },
33
+ { name: 'apply', type: 'boolean' },
34
+ { name: 'approve', type: 'multi' },
35
+ { name: 'verify', type: 'string' },
36
+ { name: 'rollback', type: 'string' },
37
+ { name: 'verify-cmd', type: 'multi' },
38
+ { name: 'serve', type: 'boolean' },
39
+ { name: 'allow-dirty', type: 'boolean' },
40
+ { name: 'url', type: 'multi' },
41
+ ];
42
+ export const INIT_FLAGS = [
43
+ { name: 'origin', type: 'string' },
44
+ { name: 'language', type: 'string' },
45
+ { name: 'force', type: 'boolean' },
46
+ ];
47
+ export const AGENT_FLAGS = [
48
+ { name: 'host', type: 'string' },
49
+ { name: 'write-agents-md', type: 'boolean' },
50
+ ];
51
+ export const RULES_FLAGS = [
52
+ { name: 'all', type: 'boolean' },
53
+ { name: 'json', type: 'boolean' },
54
+ ];
55
+ export const INSIGHTS_FLAGS = [{ name: 'run', type: 'string' }];
56
+ export function parseArgs(argv, specs) {
57
+ const byName = new Map(specs.map((s) => [s.name, s]));
58
+ const byShort = new Map(specs.filter((s) => s.short).map((s) => [s.short, s]));
59
+ const positionals = [];
60
+ const bool = new Set();
61
+ const str = new Map();
62
+ const multi = new Map();
63
+ for (let i = 0; i < argv.length; i++) {
64
+ const arg = argv[i];
65
+ if (arg === '--') {
66
+ positionals.push(...argv.slice(i + 1));
67
+ break;
68
+ }
69
+ let spec;
70
+ let inline;
71
+ if (arg.startsWith('--')) {
72
+ const eq = arg.indexOf('=');
73
+ const name = eq === -1 ? arg.slice(2) : arg.slice(2, eq);
74
+ inline = eq === -1 ? undefined : arg.slice(eq + 1);
75
+ spec = byName.get(name);
76
+ if (!spec)
77
+ throw usage(`unknown flag --${name}`, 'Run geopilot --help for the flags each command takes.');
78
+ }
79
+ else if (arg.startsWith('-') && arg.length === 2) {
80
+ spec = byShort.get(arg[1]);
81
+ if (!spec)
82
+ throw usage(`unknown flag ${arg}`);
83
+ }
84
+ else {
85
+ positionals.push(arg);
86
+ continue;
87
+ }
88
+ if (spec.type === 'boolean') {
89
+ if (inline !== undefined)
90
+ throw usage(`--${spec.name} takes no value`);
91
+ bool.add(spec.name);
92
+ continue;
93
+ }
94
+ const value = inline ?? argv[++i];
95
+ if (value === undefined || (inline === undefined && value.startsWith('--')))
96
+ throw usage(`--${spec.name} needs a value`);
97
+ if (spec.type === 'string') {
98
+ if (str.has(spec.name))
99
+ throw usage(`--${spec.name} was given twice`);
100
+ str.set(spec.name, value);
101
+ }
102
+ else
103
+ multi.set(spec.name, [...(multi.get(spec.name) ?? []), value]);
104
+ }
105
+ return { positionals, bool, str, multi };
106
+ }
107
+ export function intFlag(p, name, min, max) {
108
+ const v = p.str.get(name);
109
+ if (v === undefined)
110
+ return undefined;
111
+ const n = Number(v);
112
+ if (!Number.isInteger(n) || n < min || n > max)
113
+ throw usage(`--${name} must be an integer from ${min} to ${max}`);
114
+ return n;
115
+ }
116
+ //# sourceMappingURL=args.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"args.js","sourceRoot":"","sources":["../../src/cli/args.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAW1C,MAAM,CAAC,MAAM,YAAY,GAAwB;IAC/C,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE;IAClC,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE;IAC/B,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE;IACjC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE;IAC7C,EAAE,IAAI,EAAE,iBAAiB,EAAE,IAAI,EAAE,SAAS,EAAE;IAC5C,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,EAAE;IAC5C,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,EAAE;IAC9C,EAAE,IAAI,E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,KAAK,QAAQ,EAAE,CAAC;YAC3B,IAAI,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC;gBAAE,MAAM,KAAK,CAAC,KAAK,IAAI,CAAC,IAAI,kBAAkB,CAAC,CAAC;YACtE,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAC5B,CAAC;;YAAM,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;IACxE,CAAC;IACD,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC;AAC3C,CAAC;AAED,MAAM,UAAU,OAAO,CAAC,CAAS,EAAE,IAAY,EAAE,GAAW,EAAE,GAAW;IACvE,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC1B,IAAI,CAAC,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IACtC,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;IACpB,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,GAAG;QAAE,MAAM,KAAK,CAAC,KAAK,IAAI,4BAA4B,GAAG,OAAO,GAAG,EAAE,CAAC,CAAC;IAClH,OAAO,CAAC,CAAC;AACX,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { type Deps } from '../context.ts';
2
+ export declare function agentCommand(argv: readonly string[], deps: Deps): Promise<number>;
@@ -0,0 +1,48 @@
1
+ import { relative } from 'node:path';
2
+ import { EXIT, usage } from "../../core/errors.js";
3
+ import { TOOL_VERSION } from "../../core/version.js";
4
+ import { executeInstall, HOSTS, installedVersion, planInstall } from "../../agent/install.js";
5
+ import { AGENT_FLAGS, GLOBAL_FLAGS, parseArgs } from "../args.js";
6
+ import { gitRoot, resolveCwd } from "../context.js";
7
+ export async function agentCommand(argv, deps) {
8
+ const p = parseArgs(argv, [...GLOBAL_FLAGS, ...AGENT_FLAGS]);
9
+ const sub = p.positionals[0];
10
+ const cwd = resolveCwd(p, deps);
11
+ const root = gitRoot(cwd) ?? cwd;
12
+ const io = deps.io;
13
+ if (sub === 'status') {
14
+ const v = installedVersion(root);
15
+ io.out(`engine ${TOOL_VERSION}\nclaude-code skill ${v ?? 'not installed'}${v && v !== TOOL_VERSION ? ' (version mismatch: the skill stops until they match; re-run agent install)' : ''}\n`);
16
+ for (const h of HOSTS)
17
+ io.out(` ${h.id.padEnd(12)} ${h.status.padEnd(14)} ${h.note}\n`);
18
+ return v && v !== TOOL_VERSION ? EXIT.gate : EXIT.ok;
19
+ }
20
+ if (sub !== 'install')
21
+ throw usage('agent takes install or status', 'geopilot agent install --host claude-code');
22
+ const host = p.str.get('host');
23
+ if (!host)
24
+ throw usage('agent install needs --host', `Hosts: ${HOSTS.map((h) => `${h.id} (${h.status})`).join(', ')}`);
25
+ const known = HOSTS.find((h) => h.id === host);
26
+ if (!known)
27
+ throw usage(`unknown host ${host}`);
28
+ if (known.status === 'not_available')
29
+ throw usage(`${host} is not available in this release`, known.note);
30
+ if (known.status === 'marketplace') {
31
+ io.out(`${host} installs the geopilot plugin from its marketplace; nothing is written here:\n ${known.note}\n`);
32
+ return EXIT.ok;
33
+ }
34
+ if (host === 'agents-md' && !p.bool.has('write-agents-md'))
35
+ throw usage('the AGENTS.md section is written only with --write-agents-md');
36
+ const plan = planInstall(root, host);
37
+ io.out(`agent install --host ${host} (${known.status}) will write:\n`);
38
+ for (const w of plan.writes)
39
+ io.out(` ${w.exists ? 'update' : 'create'} ${relative(cwd, w.path) || w.path}\n`);
40
+ io.out('Nothing else is changed: no hooks, CI, lockfiles or other agent configuration.\n');
41
+ const ok = p.bool.has('yes') || (await io.confirm('Proceed?'));
42
+ if (!ok)
43
+ throw usage('agent install needs approval: answer the prompt or pass --yes');
44
+ executeInstall(plan);
45
+ io.out(`installed (engine ${TOOL_VERSION})\n`);
46
+ return EXIT.ok;
47
+ }
48
+ //# sourceMappingURL=agent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent.js","sourceRoot":"","sources":["../../../src/cli/commands/agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAa,MAAM,wBAAwB,CAAC;AACzG,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAa,MAAM,eAAe,CAAC;AAE/D,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,IAAuB,EAAE,IAAU;IACpE,MAAM,CAAC,GAAG,SAAS,CAAC,IAAI,EAAE,CAAC,GAAG,YAAY,EAAE,GAAG,WAAW,CAAC,CAAC,CAAC;IAC7D,MAAM,GAAG,GAAG,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IAC7B,MAAM,GAAG,GAAG,UAAU,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;IAChC,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC;IACjC,MAAM,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;IACnB,IAAI,GAAG,KAAK,QAAQ,EAAE,CAAC;QACrB,MAAM,CAAC,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;QACjC,EAAE,CAAC,GAAG,CAAC,UAAU,YAAY,uBAAuB,CAAC,IAAI,eAAe,GAAG,CAAC,IAA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AC,GAAG,CAAC,GAAG,IAAI,mFAAmF,KAAK,CAAC,IAAI,IAAI,CAAC,CAAC;QACjH,OAAO,IAAI,CAAC,EAAE,CAAC;IACjB,CAAC;IACD,IAAI,IAAI,KAAK,WAAW,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC;QAAE,MAAM,KAAK,CAAC,8DAA8D,CAAC,CAAC;IACxI,MAAM,IAAI,GAAG,WAAW,CAAC,IAAI,EAAE,IAAY,CAAC,CAAC;IAC7C,EAAE,CAAC,GAAG,CAAC,wBAAwB,IAAI,KAAK,KAAK,CAAC,MAAM,iBAAiB,CAAC,CAAC;IACvE,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,MAAM;QAAE,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,IAAI,QAAQ,CAAC,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC;IAChH,EAAE,CAAC,GAAG,CAAC,kFAAkF,CAAC,CAAC;IAC3F,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC;IAC/D,IAAI,CAAC,EAAE;QAAE,MAAM,KAAK,CAAC,+DAA+D,CAAC,CAAC;IACtF,cAAc,CAAC,IAAI,CAAC,CAAC;IACrB,EAAE,CAAC,GAAG,CAAC,qBAAqB,YAAY,KAAK,CAAC,CAAC;IAC/C,OAAO,IAAI,CAAC,EAAE,CAAC;AACjB,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { type Deps } from '../context.ts';
2
+ export declare function fixCommand(argv: readonly string[], deps: Deps): Promise<number>;
@@ -0,0 +1,284 @@
1
+ import { EXIT, GeoError, usage } from "../../core/errors.js";
2
+ import { canonicalJson } from "../../core/hash.js";
3
+ import { loadRun, runDir } from "../../cache/runs.js";
4
+ import { scan } from "../../scan.js";
5
+ import { planAll } from "../../fix/plan.js";
6
+ import { unifiedDiff } from "../../fix/diff.js";
7
+ import { applyFixes, currentV1, loadBefore, readManifest, rollback, verifyApplied } from "../../fix/apply.js";
8
+ import { isLoopbackUrl } from "../../net/address.js";
9
+ import { subjectKey } from "../../types.js";
10
+ import { FIX_FLAGS, GLOBAL_FLAGS, parseArgs } from "../args.js";
11
+ import { cacheFor, currentBranch, defaultBranch, dirtyFiles, gitRoot, loadFor, resolveCwd } from "../context.js";
12
+ import { runScan } from "./scan.js";
13
+ function printProposal(f, c) {
14
+ const lines = [];
15
+ lines.push(`${c.bold(f.fixId)} ${f.class === 'safe' ? c.green('safe') : c.yellow('guarded')} ${f.title}`);
16
+ lines.push(` ${c.dim('rule')} ${f.ruleId} ${f.subCheck} ${c.dim('subjects')} ${f.subjects.map(subjectKey).join(', ')}`);
17
+ lines.push(` ${c.dim('provenance')} ${f.provenance.level} — ${f.provenance.reason}`);
18
+ lines.push(` ${c.dim('requires')} ${f.required} verification${f.required === 'V4' ? ' (a server GEO starts after the write: configure fix.serve and pass --serve)' : ''}`);
19
+ if (f.affectedRoutes.length > 1)
20
+ lines.push(` ${c.dim('affects')} ${f.affectedRoutes.join(', ')}`);
21
+ for (const pc of f.preconditions)
22
+ lines.push(` ${c.green('✓')} ${pc.check} ${c.dim(`(${pc.detail})`)}`);
23
+ for (const ch of f.changes) {
24
+ for (const l of unifiedDiff(ch.path, ch.before, ch.after).trimEnd().split('\n')) {
25
+ lines.push(` ${l.startsWith('+') && !l.startsWith('+++') ? c.green(l) : l.startsWith('-') && !l.startsWith('---') ? c.red(l) : c.dim(l)}`);
26
+ }
27
+ }
28
+ if (f.alternative)
29
+ lines.push(` ${c.dim('alternative')} ${f.alternative}`);
30
+ return lines.join('\n');
31
+ }
32
+ function printBlocked(b, c) {
33
+ const failing = b.preconditions.filter((p) => !p.ok);
34
+ return `${c.dim(`${b.variant} not offered for ${subjectKey(b.subject)}:`)} ${failing.map((p) => `${p.check} (${p.detail})`).join('; ')}`;
35
+ }
36
+ function printChange(r, c) {
37
+ const tag = r.outcome === 'verified' ? c.green('verified') : r.outcome === 'rolled_back' ? c.red('rolled back') : c.yellow('applied, unverified');
38
+ const lines = [`${c.bold(r.fixId)} ${tag} ${r.ruleId} ${r.subjects.join(', ')}`];
39
+ lines.push(` ${c.dim('files')} ${r.files.map((f) => `${f.path}${f.created ? ' (created)' : ''} ±${f.linesChanged}`).join(', ')}`);
40
+ lines.push(` ${c.dim('condition')} ${r.conditionBefore} → ${r.conditionAfter} ${c.dim('verification')} required ${r.verification.required}, achieved ${r.verification.achieved ?? 'none'}`);
41
+ for (const ch of r.verification.checks) {
42
+ const mark = ch.status === 'pass' ? c.green('pass') : ch.status === 'fail' ? c.red('FAIL') : c.dim('----');
43
+ lines.push(` ${ch.level} ${mark} ${ch.detail}`);
44
+ }
45
+ lines.push(` ${c.dim('runtime_observation')} ${r.runtime_observation} ${c.dim('source_freshness')} ${r.source_freshness}${r.freshness_basis ? ` (${r.freshness_basis})` : ''} ${c.dim('rule_outcome')} ${r.rule_outcome}`);
46
+ if (r.newAffectedFindings.length)
47
+ lines.push(` ${c.red('new findings')} ${r.newAffectedFindings.join('; ')}`);
48
+ return lines.join('\n');
49
+ }
50
+ function configuredCommand(config, value) {
51
+ return config.fix.verifyCommands.find((cmd) => cmd.join(' ') === value.trim()) ?? null;
52
+ }
53
+ async function authority(p, deps, config) {
54
+ const io = deps.io;
55
+ const commands = [];
56
+ const requested = p.multi.get('verify-cmd') ?? [];
57
+ for (const v of requested) {
58
+ const cmd = configuredCommand(config, v);
59
+ if (!cmd)
60
+ throw usage(`--verify-cmd "${v}" is not one of the commands in fix.verifyCommands`, 'GEO runs only exact owner-configured commands; it never infers them from package scripts.');
61
+ commands.push(cmd);
62
+ }
63
+ if (requested.length === 0 && config.fix.verifyCommands.length > 0) {
64
+ if (io.interactive) {
65
+ for (const cmd of config.fix.verifyCommands)
66
+ if (await io.confirm(`Run configured verify command \`${cmd.join(' ')}\`?`))
67
+ commands.push(cmd);
68
+ }
69
+ else if (deps.env.GEO_ALLOW_VERIFY_COMMAND === '1')
70
+ commands.push(...config.fix.verifyCommands);
71
+ }
72
+ let serve = null;
73
+ const s = config.fix.serve;
74
+ if (p.bool.has('serve') && (!s.command || !s.url))
75
+ throw usage('--serve needs fix.serve.command and fix.serve.url in geo.config.json');
76
+ if (s.command && s.url) {
77
+ const authorised = p.bool.has('serve') || (io.interactive ? await io.confirm(`Start \`${s.command.join(' ')}\` (no shell) and observe ${s.url} for V4?`) : deps.env.GEO_ALLOW_SERVE_COMMAND === '1');
78
+ if (authorised)
79
+ serve = { command: s.command, url: s.url, readyTimeoutSeconds: s.readyTimeoutSeconds };
80
+ }
81
+ const urls = p.multi.get('url') ?? [];
82
+ const observeUrl = urls.find((u) => {
83
+ try {
84
+ return isLoopbackUrl(new URL(u));
85
+ }
86
+ catch {
87
+ return false;
88
+ }
89
+ }) ?? null;
90
+ return { commands, serve, observeUrl, runtimeTimeoutSeconds: config.fix.runtimeTimeoutSeconds };
91
+ }
92
+ function rescanner(repoPath, config, deps) {
93
+ return {
94
+ repo: async () => (await scan({ repoPath, urls: [], config, configHash: 'rescan', ...(deps.now ? { now: deps.now } : {}) })).report,
95
+ urls: async (urls) => (await scan({ repoPath: null, urls, config, configHash: 'rescan', maxPages: urls.length + 2, maxDepth: 0, ...(deps.fetcher ? { fetcher: deps.fetcher } : {}), ...(deps.now ? { now: deps.now } : {}) })).report,
96
+ };
97
+ }
98
+ function exitFor(reports) {
99
+ if (reports.some((r) => r.outcome === 'rolled_back'))
100
+ return EXIT.rolledBack;
101
+ if (reports.some((r) => r.outcome === 'applied_unverified'))
102
+ return EXIT.unverified;
103
+ return EXIT.ok;
104
+ }
105
+ function hintFor(reports, runId) {
106
+ const lines = [];
107
+ if (reports.some((r) => r.outcome === 'applied_unverified')) {
108
+ lines.push(`Some fixes are applied but not verified to their required level. Re-check later with: geopilot fix --verify ${runId} --serve`);
109
+ if (reports.some((r) => r.runtime_unavailable === 'not_configured'))
110
+ lines.push('Configure fix.serve with a from-source dev command (for example ["pnpm", "next", "dev", "--port", "3100"]); a command that serves stale prebuilt output defeats the freshness check.');
111
+ }
112
+ if (reports.some((r) => r.outcome !== 'rolled_back'))
113
+ lines.push(`Undo with: geopilot fix --rollback ${runId}`);
114
+ return lines.join('\n');
115
+ }
116
+ async function verifyRun(p, deps, runId) {
117
+ const cwd = resolveCwd(p, deps);
118
+ const loaded = loadFor(cwd, p, deps.env);
119
+ const root = gitRoot(cwd) ?? cwd;
120
+ const cache = cacheFor(root, cwd, loaded, deps.env);
121
+ const dir = runDir(cache, runId);
122
+ const manifest = readManifest(dir);
123
+ if (!manifest)
124
+ throw usage(`run ${runId} has no applied fixes in ${cache}`);
125
+ const auth = await authority(p, deps, loaded.config);
126
+ const rs = rescanner(root, loaded.config, deps);
127
+ const reports = [];
128
+ const after = await rs.repo();
129
+ for (const entry of manifest.fixes.filter((f) => f.outcome !== 'rolled_back')) {
130
+ const before = loadBefore(dir, entry.fixId) ?? after;
131
+ const result = await verifyApplied({ proposal: entry.proposal, lastWriteMs: entry.lastWriteMs, before, after, authority: auth, repoRoot: root, rescan: rs, priorRuntime: loadRun(cache, runId)?.report ?? null, v1Checks: currentV1(root, entry) });
132
+ // --verify never rewrites source: a failed check is reported, not rolled back.
133
+ reports.push({
134
+ fixId: entry.fixId,
135
+ variant: entry.proposal.variant,
136
+ class: entry.proposal.class,
137
+ ruleId: entry.proposal.ruleId,
138
+ subjects: entry.proposal.subjects.map(subjectKey),
139
+ fingerprints: entry.proposal.fingerprints,
140
+ files: entry.files.map((f) => ({ path: f.path, linesChanged: 0, created: !f.existedBefore })),
141
+ conditionBefore: 'fail',
142
+ conditionAfter: result.conditionAfter,
143
+ newAffectedFindings: result.newAffected,
144
+ verification: { required: entry.proposal.required, achieved: result.achieved, checks: result.checks },
145
+ runtime_observation: result.runtime_observation,
146
+ source_freshness: result.source_freshness,
147
+ freshness_basis: result.freshness_basis,
148
+ rule_outcome: result.rule_outcome,
149
+ runtime_unavailable: result.runtime_unavailable,
150
+ outcome: result.outcome === 'rolled_back' ? 'applied_unverified' : result.outcome,
151
+ snapshot: dir,
152
+ });
153
+ if (result.outcome === 'rolled_back')
154
+ deps.io.err(`${entry.fixId}: a check failed. The change is still applied; roll it back with geopilot fix --rollback ${runId}\n`);
155
+ }
156
+ if ((p.multi.get('format') ?? []).includes('json'))
157
+ deps.io.out(canonicalJson({ runId, changes: reports }));
158
+ else
159
+ for (const r of reports)
160
+ deps.io.out(`${printChange(r, deps.io.color)}\n\n`);
161
+ const failed = reports.some((r) => r.verification.checks.some((c) => c.status === 'fail'));
162
+ return failed ? EXIT.gate : exitFor(reports);
163
+ }
164
+ async function rollbackRun(p, deps, runId) {
165
+ const cwd = resolveCwd(p, deps);
166
+ const loaded = loadFor(cwd, p, deps.env);
167
+ const root = gitRoot(cwd) ?? cwd;
168
+ const dir = runDir(cacheFor(root, cwd, loaded, deps.env), runId);
169
+ const check = rollback(root, dir, true);
170
+ if (check.conflicts.length > 0) {
171
+ deps.io.err(`rollback refused:\n ${check.conflicts.join('\n ')}\nGEO never overwrites later edits. Resolve these files by hand.\n`);
172
+ return EXIT.gate;
173
+ }
174
+ const ok = p.bool.has('yes') || (await deps.io.confirm(`Restore the snapshots from ${runId}?`));
175
+ if (!ok)
176
+ throw usage('rollback needs confirmation: answer the prompt or pass --yes');
177
+ const done = rollback(root, dir, false);
178
+ deps.io.out(done.restored.length ? `restored ${done.restored.join(', ')}\n` : 'nothing to roll back\n');
179
+ return EXIT.ok;
180
+ }
181
+ export async function fixCommand(argv, deps) {
182
+ const p = parseArgs(argv, [...GLOBAL_FLAGS, ...FIX_FLAGS]);
183
+ const verifyId = p.str.get('verify');
184
+ const rollbackId = p.str.get('rollback');
185
+ if (verifyId && rollbackId)
186
+ throw usage('--verify and --rollback cannot be combined');
187
+ if (verifyId)
188
+ return verifyRun(p, deps, verifyId);
189
+ if (rollbackId)
190
+ return rollbackRun(p, deps, rollbackId);
191
+ if (p.bool.has('no-cache') && p.bool.has('apply'))
192
+ throw usage('--apply needs the run cache for snapshots and rollback; drop --no-cache');
193
+ const inv = await runScan(p, deps, true);
194
+ const { result, repoPath, config } = inv;
195
+ if (!repoPath)
196
+ throw usage('fix needs a repository');
197
+ const c = deps.io.color;
198
+ const plan = planAll(result.context, result.report.evaluations);
199
+ const only = new Set((p.multi.get('rule') ?? []).flatMap((r) => r.split(',')).map((r) => r.trim().toUpperCase()));
200
+ const proposals = plan.proposals.filter((f) => only.size === 0 || only.has(f.ruleId));
201
+ const json = (p.multi.get('format') ?? []).includes('json');
202
+ if (!p.bool.has('apply')) {
203
+ if (json)
204
+ deps.io.out(canonicalJson({ runId: result.report.run.id, proposals, blocked: plan.blocked, disclaimer: result.report.disclaimer }));
205
+ else {
206
+ deps.io.out(proposals.length === 0 ? 'No closed-list fix applies to the current findings.\n' : `${proposals.length} fix${proposals.length === 1 ? '' : 'es'} available (dry run — nothing was written)\n\n`);
207
+ for (const f of proposals)
208
+ deps.io.out(`${printProposal(f, c)}\n\n`);
209
+ for (const b of plan.blocked.filter((x) => only.size === 0 || only.has(x.variant)))
210
+ deps.io.out(`${printBlocked(b, c)}\n`);
211
+ if (proposals.length > 0)
212
+ deps.io.out(`\nApply safe fixes with: geopilot fix --apply\nApprove a guarded fix with: geopilot fix --apply --approve <fixId>\n`);
213
+ deps.io.out(c.dim(`\n${result.report.disclaimer}\n`));
214
+ }
215
+ return EXIT.ok;
216
+ }
217
+ // Every approval is settled before the first byte is written.
218
+ const approveIds = new Set(p.multi.get('approve') ?? []);
219
+ for (const id of approveIds)
220
+ if (!proposals.some((f) => f.fixId === id))
221
+ throw usage(`--approve ${id} does not name an available fix`, 'Run geopilot fix (dry run) to list fix ids.');
222
+ const selected = [];
223
+ const skippedGuarded = [];
224
+ for (const f of proposals) {
225
+ if (f.class === 'safe') {
226
+ selected.push(f);
227
+ continue;
228
+ }
229
+ if (approveIds.has(f.fixId))
230
+ selected.push(f);
231
+ else if (deps.io.interactive) {
232
+ deps.io.out(`${printProposal(f, c)}\n`);
233
+ if (await deps.io.confirm(`Apply guarded fix ${f.fixId}?`))
234
+ selected.push(f);
235
+ }
236
+ else if (only.size > 0) {
237
+ // The user asked for this rule's fix by name: a missing approval is an error, raised before any write.
238
+ throw usage(`guarded fix ${f.fixId} needs explicit approval`, `Pass --approve ${f.fixId}. --yes never approves a guarded fix.`);
239
+ }
240
+ else {
241
+ skippedGuarded.push(f.fixId);
242
+ }
243
+ }
244
+ for (const id of skippedGuarded)
245
+ deps.io.err(`skipped guarded fix ${id}: approve it with --approve ${id} (--yes never approves a guarded fix)\n`);
246
+ if (selected.length === 0) {
247
+ deps.io.out('Nothing to apply.\n');
248
+ return EXIT.ok;
249
+ }
250
+ const targets = selected.flatMap((f) => f.changes.map((ch) => ch.path));
251
+ const dirty = dirtyFiles(repoPath, targets);
252
+ if (dirty.length > 0 && !p.bool.has('allow-dirty'))
253
+ throw usage(`target files have uncommitted changes: ${dirty.join(', ')}`, 'Commit or stash them, or pass --allow-dirty.');
254
+ const branch = currentBranch(repoPath);
255
+ const def = defaultBranch(repoPath) ?? (branch === 'main' || branch === 'master' ? branch : null);
256
+ if (branch !== null && branch === def && !p.bool.has('yes') && !(await deps.io.confirm(`You are on the default branch ${branch}. Apply here anyway?`))) {
257
+ throw usage(`refusing to apply on the default branch ${branch} without confirmation`, 'Switch to a feature branch, or confirm with --yes.');
258
+ }
259
+ const auth = await authority(p, deps, config);
260
+ if (!inv.cache)
261
+ throw new GeoError('internal', 'run cache unavailable');
262
+ const reports = await applyFixes({
263
+ proposals: selected,
264
+ repoRoot: repoPath,
265
+ runDir: runDir(inv.cache, result.report.run.id),
266
+ runId: result.report.run.id,
267
+ before: result.report,
268
+ priorRuntime: result.report.run.mode === 'repo' ? null : result.report,
269
+ authority: auth,
270
+ rescan: rescanner(repoPath, config, deps),
271
+ });
272
+ if (json)
273
+ deps.io.out(canonicalJson({ runId: result.report.run.id, changes: reports, disclaimer: result.report.disclaimer }));
274
+ else {
275
+ for (const r of reports)
276
+ deps.io.out(`${printChange(r, c)}\n\n`);
277
+ const hint = hintFor(reports, result.report.run.id);
278
+ if (hint)
279
+ deps.io.out(`${hint}\n`);
280
+ deps.io.out(c.dim(`${result.report.disclaimer}\n`));
281
+ }
282
+ return exitFor(reports);
283
+ }
284
+ //# sourceMappingURL=fix.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fix.js","sourceRoot":"","sources":["../../../src/cli/commands/fix.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,OAAO,EAAqC,MAAM,mBAAmB,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,EAAE,QAAQ,EAAE,aAAa,EAA2D,MAAM,oBAAoB,CAAC;AACvK,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAGrD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAe,MAAM,YAAY,CAAC;AAC7E,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,aAAa,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAa,MAAM,eAAe,CAAC;AAC5H,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,SAAS,aAAa,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AC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC;QACjE,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACpD,IAAI,IAAI;YAAE,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,IAAI,IAAI,CAAC,CAAC;QACnC,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,UAAU,IAAI,CAAC,CAAC,CAAC;IACtD,CAAC;IACD,OAAO,OAAO,CAAC,OAAO,CAAC,CAAC;AAC1B,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { type Deps } from '../context.ts';
2
+ export declare function initCommand(argv: readonly string[], deps: Deps): Promise<number>;
@@ -0,0 +1,62 @@
1
+ import { existsSync, mkdirSync, writeFileSync } from 'node:fs';
2
+ import { join } from 'node:path';
3
+ import { EXIT, usage } from "../../core/errors.js";
4
+ import { CONFIG_FILE, validateConfig } from "../../config/config.js";
5
+ import { openRepo } from "../../repo/reader.js";
6
+ import { detectFramework } from "../../repo/detect.js";
7
+ import { GLOBAL_FLAGS, INIT_FLAGS, parseArgs } from "../args.js";
8
+ import { gitRoot, resolveCwd } from "../context.js";
9
+ // init writes exactly two tool-managed files after a preview and approval:
10
+ // geo.config.json and .geo/.gitignore. It never infers origin, language,
11
+ // crawler policy or app identifiers, and never installs hooks.
12
+ function suggestServe(dir) {
13
+ const pm = existsSync(join(dir, 'pnpm-lock.yaml')) ? 'pnpm' : existsSync(join(dir, 'yarn.lock')) ? 'yarn' : existsSync(join(dir, 'bun.lock')) || existsSync(join(dir, 'bun.lockb')) ? 'bun' : 'npm';
14
+ const runner = pm === 'npm' ? ['npx'] : pm === 'pnpm' ? ['pnpm', 'exec'] : pm === 'bun' ? ['bunx'] : ['yarn'];
15
+ return [...runner, 'next', 'dev', '--port', '3100'];
16
+ }
17
+ export async function initCommand(argv, deps) {
18
+ const p = parseArgs(argv, [...GLOBAL_FLAGS, ...INIT_FLAGS]);
19
+ const cwd = resolveCwd(p, deps);
20
+ const target = join(cwd, CONFIG_FILE);
21
+ if (existsSync(target) && !p.bool.has('force'))
22
+ throw usage(`${CONFIG_FILE} already exists`, 'Edit it by hand, or pass --force to replace it.');
23
+ const io = deps.io;
24
+ const framework = detectFramework(openRepo(cwd), 'auto');
25
+ let origin = p.str.get('origin') ?? null;
26
+ let language = p.str.get('language') ?? null;
27
+ if (origin === null && io.interactive)
28
+ origin = (await io.ask('Site origin (e.g. https://www.example.com, blank to skip): ')) || null;
29
+ if (language === null && io.interactive)
30
+ language = (await io.ask('Site language (BCP 47, e.g. en, blank to skip): ')) || null;
31
+ const config = {
32
+ $schema: 'https://moelzanaty3.github.io/geopilot/schema/config/v1.json',
33
+ version: 1,
34
+ framework: 'auto',
35
+ site: { origin, language },
36
+ routes: { include: ['/**'], exclude: ['/api/**'] },
37
+ policy: { aiSearchCrawlers: 'allow', aiTrainingCrawlers: 'undecided', userTriggeredFetchers: 'allow' },
38
+ fix: { verifyCommands: [], runtimeTimeoutSeconds: 60, serve: { command: null, url: null, readyTimeoutSeconds: 120 } },
39
+ };
40
+ const serve = framework.id === 'nextjs-app' ? suggestServe(cwd) : null;
41
+ validateConfig(config);
42
+ io.out(`Detected: ${framework.id} (${framework.state}); ${framework.evidence.slice(0, 3).join('; ') || 'no evidence'}\n`);
43
+ io.out(`\nWill write ${CONFIG_FILE}:\n\n${JSON.stringify(config, null, 2)}\n\nand .geo/.gitignore (the run cache stays out of git).\n`);
44
+ if (origin === null)
45
+ io.out('\nsite.origin is not set. GEO never infers it; canonical checks and origin-dependent fixes stay unavailable until you set it.\n');
46
+ if (serve)
47
+ io.out(`\nSuggested (not written unless you accept): fix.serve.command ${JSON.stringify(serve)} with url http://127.0.0.1:3100.\nUse a from-source dev command: a command that serves stale prebuilt output defeats the freshness check.\n`);
48
+ const approved = p.bool.has('yes') || (await io.confirm(`Write ${CONFIG_FILE}?`));
49
+ if (!approved)
50
+ throw usage('init needs approval: answer the prompt or pass --yes');
51
+ if (serve && io.interactive && !p.bool.has('yes') && (await io.confirm('Also write the suggested serve command?'))) {
52
+ config.fix = { verifyCommands: [], runtimeTimeoutSeconds: 60, serve: { command: serve, url: 'http://127.0.0.1:3100', readyTimeoutSeconds: 120 } };
53
+ }
54
+ writeFileSync(target, `${JSON.stringify(config, null, 2)}\n`);
55
+ const geoDir = join(gitRoot(cwd) ?? cwd, '.geo');
56
+ mkdirSync(geoDir, { recursive: true });
57
+ if (!existsSync(join(geoDir, '.gitignore')))
58
+ writeFileSync(join(geoDir, '.gitignore'), '*\n');
59
+ io.out(`wrote ${target}\n`);
60
+ return EXIT.ok;
61
+ }
62
+ //# sourceMappingURL=init.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init.js","sourceRoot":"","sources":["../../../src/cli/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAa,MAAM,eAAe,CAAC;AAE/D,2EAA2E;AAC3E,yEAAyE;AACzE,+DAA+D;AAE/D,SAAS,YAAY,CAAC,GAAW;IAC/B,MAAM,EAAE,GAAG,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAA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AAC,CAAC;IAC9D,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,GAAG,EAAE,MAAM,CAAC,CAAC;IACjD,SAAS,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACvC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;QAAE,aAAa,CAAC,IAAI,CAAC,MAAM,EAAE,YAAY,CAAC,EAAE,KAAK,CAAC,CAAC;IAC9F,EAAE,CAAC,GAAG,CAAC,SAAS,MAAM,IAAI,CAAC,CAAC;IAC5B,OAAO,IAAI,CAAC,EAAE,CAAC;AACjB,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { type InsightsDoc, type ValidationResult } from '../../insights/validate.ts';
2
+ import type { Report } from '../../types.ts';
3
+ import { type Deps } from '../context.ts';
4
+ export declare function insightsCommand(argv: readonly string[], deps: Deps): Promise<number>;
5
+ export interface Merged {
6
+ readonly schemaVersion: 'geo-merged/v1';
7
+ readonly report: Report;
8
+ readonly insights: InsightsDoc | null;
9
+ readonly validation: ValidationResult | null;
10
+ readonly sections: {
11
+ readonly verifiedEngineFindings: readonly string[];
12
+ readonly agentRecommendations: readonly string[];
13
+ readonly hypothesesToValidate: readonly string[];
14
+ };
15
+ readonly disclaimer: string;
16
+ }
17
+ export declare function reportCommand(argv: readonly string[], deps: Deps): Promise<number>;