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.
- package/LICENSE +202 -0
- package/README.md +91 -2
- package/dist/agent/install.d.ts +23 -0
- package/dist/agent/install.js +77 -0
- package/dist/agent/install.js.map +1 -0
- package/dist/cache/runs.d.ts +18 -0
- package/dist/cache/runs.js +91 -0
- package/dist/cache/runs.js.map +1 -0
- package/dist/cli/args.d.ts +20 -0
- package/dist/cli/args.js +116 -0
- package/dist/cli/args.js.map +1 -0
- package/dist/cli/commands/agent.d.ts +2 -0
- package/dist/cli/commands/agent.js +48 -0
- package/dist/cli/commands/agent.js.map +1 -0
- package/dist/cli/commands/fix.d.ts +2 -0
- package/dist/cli/commands/fix.js +284 -0
- package/dist/cli/commands/fix.js.map +1 -0
- package/dist/cli/commands/init.d.ts +2 -0
- package/dist/cli/commands/init.js +62 -0
- package/dist/cli/commands/init.js.map +1 -0
- package/dist/cli/commands/insights.d.ts +17 -0
- package/dist/cli/commands/insights.js +143 -0
- package/dist/cli/commands/insights.js.map +1 -0
- package/dist/cli/commands/rules.d.ts +5 -0
- package/dist/cli/commands/rules.js +86 -0
- package/dist/cli/commands/rules.js.map +1 -0
- package/dist/cli/commands/scan.d.ts +14 -0
- package/dist/cli/commands/scan.js +127 -0
- package/dist/cli/commands/scan.js.map +1 -0
- package/dist/cli/commands-list.d.ts +6 -0
- package/dist/cli/commands-list.js +15 -0
- package/dist/cli/commands-list.js.map +1 -0
- package/dist/cli/context.d.ts +26 -0
- package/dist/cli/context.js +108 -0
- package/dist/cli/context.js.map +1 -0
- package/dist/cli/io.d.ts +16 -0
- package/dist/cli/io.js +28 -0
- package/dist/cli/io.js.map +1 -0
- package/dist/cli/main.d.ts +15 -0
- package/dist/cli/main.js +118 -0
- package/dist/cli/main.js.map +1 -0
- package/dist/collect/crawl.d.ts +51 -0
- package/dist/collect/crawl.js +187 -0
- package/dist/collect/crawl.js.map +1 -0
- package/dist/config/config.d.ts +86 -0
- package/dist/config/config.js +396 -0
- package/dist/config/config.js.map +1 -0
- package/dist/core/errors.d.ts +20 -0
- package/dist/core/errors.js +32 -0
- package/dist/core/errors.js.map +1 -0
- package/dist/core/hash.d.ts +7 -0
- package/dist/core/hash.js +28 -0
- package/dist/core/hash.js.map +1 -0
- package/dist/core/redact.d.ts +3 -0
- package/dist/core/redact.js +23 -0
- package/dist/core/redact.js.map +1 -0
- package/dist/core/tty.d.ts +12 -0
- package/dist/core/tty.js +33 -0
- package/dist/core/tty.js.map +1 -0
- package/dist/core/version.d.ts +6 -0
- package/dist/core/version.js +10 -0
- package/dist/core/version.js.map +1 -0
- package/dist/fix/apply.d.ts +119 -0
- package/dist/fix/apply.js +334 -0
- package/dist/fix/apply.js.map +1 -0
- package/dist/fix/diff.d.ts +1 -0
- package/dist/fix/diff.js +35 -0
- package/dist/fix/diff.js.map +1 -0
- package/dist/fix/plan.d.ts +42 -0
- package/dist/fix/plan.js +385 -0
- package/dist/fix/plan.js.map +1 -0
- package/dist/fix/serve.d.ts +13 -0
- package/dist/fix/serve.js +112 -0
- package/dist/fix/serve.js.map +1 -0
- package/dist/fix/variants.d.ts +13 -0
- package/dist/fix/variants.js +8 -0
- package/dist/fix/variants.js.map +1 -0
- package/dist/frameworks/ast.d.ts +84 -0
- package/dist/frameworks/ast.js +231 -0
- package/dist/frameworks/ast.js.map +1 -0
- package/dist/frameworks/nextjs-app/analyze.d.ts +92 -0
- package/dist/frameworks/nextjs-app/analyze.js +350 -0
- package/dist/frameworks/nextjs-app/analyze.js.map +1 -0
- package/dist/frameworks/static/analyze.d.ts +18 -0
- package/dist/frameworks/static/analyze.js +66 -0
- package/dist/frameworks/static/analyze.js.map +1 -0
- package/dist/html/parse.d.ts +50 -0
- package/dist/html/parse.js +205 -0
- package/dist/html/parse.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/insights/validate.d.ts +74 -0
- package/dist/insights/validate.js +213 -0
- package/dist/insights/validate.js.map +1 -0
- package/dist/net/address.d.ts +10 -0
- package/dist/net/address.js +116 -0
- package/dist/net/address.js.map +1 -0
- package/dist/net/fetch.d.ts +53 -0
- package/dist/net/fetch.js +281 -0
- package/dist/net/fetch.js.map +1 -0
- package/dist/repo/detect.d.ts +3 -0
- package/dist/repo/detect.js +92 -0
- package/dist/repo/detect.js.map +1 -0
- package/dist/repo/reader.d.ts +12 -0
- package/dist/repo/reader.js +97 -0
- package/dist/repo/reader.js.map +1 -0
- package/dist/report/render.d.ts +20 -0
- package/dist/report/render.js +176 -0
- package/dist/report/render.js.map +1 -0
- package/dist/robots/crawlers.d.ts +10 -0
- package/dist/robots/crawlers.js +20 -0
- package/dist/robots/crawlers.js.map +1 -0
- package/dist/robots/robots.d.ts +33 -0
- package/dist/robots/robots.js +133 -0
- package/dist/robots/robots.js.map +1 -0
- package/dist/rules/catalogue.d.ts +43 -0
- package/dist/rules/catalogue.js +361 -0
- package/dist/rules/catalogue.js.map +1 -0
- package/dist/rules/context.d.ts +36 -0
- package/dist/rules/context.js +129 -0
- package/dist/rules/context.js.map +1 -0
- package/dist/rules/evaluate.d.ts +11 -0
- package/dist/rules/evaluate.js +1070 -0
- package/dist/rules/evaluate.js.map +1 -0
- package/dist/rules/finalize.d.ts +34 -0
- package/dist/rules/finalize.js +93 -0
- package/dist/rules/finalize.js.map +1 -0
- package/dist/scan.d.ts +27 -0
- package/dist/scan.js +147 -0
- package/dist/scan.js.map +1 -0
- package/dist/scoring/compare.d.ts +21 -0
- package/dist/scoring/compare.js +47 -0
- package/dist/scoring/compare.js.map +1 -0
- package/dist/scoring/score.d.ts +21 -0
- package/dist/scoring/score.js +112 -0
- package/dist/scoring/score.js.map +1 -0
- package/dist/sitemap/sitemap.d.ts +10 -0
- package/dist/sitemap/sitemap.js +48 -0
- package/dist/sitemap/sitemap.js.map +1 -0
- package/dist/types.d.ts +155 -0
- package/dist/types.js +13 -0
- package/dist/types.js.map +1 -0
- package/hosts/claude-project/.claude/agents/geopilot-explainer.md +36 -0
- package/hosts/claude-project/.claude/agents/geopilot-fixer.md +42 -0
- package/hosts/claude-project/.claude/agents/geopilot-investigator.md +45 -0
- package/hosts/claude-project/.claude/agents/geopilot-reviewer.md +41 -0
- package/hosts/claude-project/.claude/agents/geopilot-scanner.md +47 -0
- package/hosts/claude-project/.claude/skills/geo/SKILL.md +95 -0
- package/hosts/claude-project/.claude/skills/geo/references/frameworks.md +20 -0
- package/hosts/claude-project/.claude/skills/geo/references/insight-contract.md +42 -0
- package/hosts/claude-project/.claude/skills/geo/references/safety.md +30 -0
- package/hosts/claude-project/.claude/skills/geo/references/workflow-explain.md +8 -0
- package/hosts/claude-project/.claude/skills/geo/references/workflow-fix.md +20 -0
- package/hosts/claude-project/.claude/skills/geo/references/workflow-init.md +6 -0
- package/hosts/claude-project/.claude/skills/geo/references/workflow-insights.md +13 -0
- package/hosts/claude-project/.claude/skills/geo/references/workflow-plan.md +13 -0
- package/hosts/claude-project/.claude/skills/geo/references/workflow-review.md +8 -0
- package/hosts/claude-project/.claude/skills/geo/references/workflow-scan.md +18 -0
- package/hosts/claude-project/.claude/skills/geo/schemas/insights.schema.json +255 -0
- package/hosts/claude-project/.claude/skills/geo/scripts/geo.ps1 +14 -0
- package/hosts/claude-project/.claude/skills/geo/scripts/geo.sh +13 -0
- package/hosts/claude-project/.claude/skills/geopilot-explain/SKILL.md +9 -0
- package/hosts/claude-project/.claude/skills/geopilot-fix/SKILL.md +12 -0
- package/hosts/claude-project/.claude/skills/geopilot-init/SKILL.md +15 -0
- package/hosts/claude-project/.claude/skills/geopilot-insights/SKILL.md +11 -0
- package/hosts/claude-project/.claude/skills/geopilot-review/SKILL.md +11 -0
- package/hosts/claude-project/.claude/skills/geopilot-scan/SKILL.md +11 -0
- package/hosts/codex/plugin.json +21 -0
- package/hosts/codex/skills/explain/SKILL.md +38 -0
- package/hosts/codex/skills/fix/SKILL.md +46 -0
- package/hosts/codex/skills/fix/agents/openai.yaml +2 -0
- package/hosts/codex/skills/geo/SKILL.md +95 -0
- package/hosts/codex/skills/geo/references/frameworks.md +20 -0
- package/hosts/codex/skills/geo/references/insight-contract.md +42 -0
- package/hosts/codex/skills/geo/references/safety.md +30 -0
- package/hosts/codex/skills/geo/references/workflow-explain.md +8 -0
- package/hosts/codex/skills/geo/references/workflow-fix.md +20 -0
- package/hosts/codex/skills/geo/references/workflow-init.md +6 -0
- package/hosts/codex/skills/geo/references/workflow-insights.md +13 -0
- package/hosts/codex/skills/geo/references/workflow-plan.md +13 -0
- package/hosts/codex/skills/geo/references/workflow-review.md +8 -0
- package/hosts/codex/skills/geo/references/workflow-scan.md +18 -0
- package/hosts/codex/skills/geo/schemas/insights.schema.json +255 -0
- package/hosts/codex/skills/geo/scripts/geo.ps1 +14 -0
- package/hosts/codex/skills/geo/scripts/geo.sh +13 -0
- package/hosts/codex/skills/init/SKILL.md +13 -0
- package/hosts/codex/skills/init/agents/openai.yaml +2 -0
- package/hosts/codex/skills/insights/SKILL.md +49 -0
- package/hosts/codex/skills/review/SKILL.md +45 -0
- package/hosts/codex/skills/scan/SKILL.md +51 -0
- package/hosts/codex-project/.agents/skills/geo/SKILL.md +95 -0
- package/hosts/codex-project/.agents/skills/geo/references/frameworks.md +20 -0
- package/hosts/codex-project/.agents/skills/geo/references/insight-contract.md +42 -0
- package/hosts/codex-project/.agents/skills/geo/references/safety.md +30 -0
- package/hosts/codex-project/.agents/skills/geo/references/workflow-explain.md +8 -0
- package/hosts/codex-project/.agents/skills/geo/references/workflow-fix.md +20 -0
- package/hosts/codex-project/.agents/skills/geo/references/workflow-init.md +6 -0
- package/hosts/codex-project/.agents/skills/geo/references/workflow-insights.md +13 -0
- package/hosts/codex-project/.agents/skills/geo/references/workflow-plan.md +13 -0
- package/hosts/codex-project/.agents/skills/geo/references/workflow-review.md +8 -0
- package/hosts/codex-project/.agents/skills/geo/references/workflow-scan.md +18 -0
- package/hosts/codex-project/.agents/skills/geo/schemas/insights.schema.json +255 -0
- package/hosts/codex-project/.agents/skills/geo/scripts/geo.ps1 +14 -0
- package/hosts/codex-project/.agents/skills/geo/scripts/geo.sh +13 -0
- package/hosts/codex-project/.agents/skills/geopilot-explain/SKILL.md +8 -0
- package/hosts/codex-project/.agents/skills/geopilot-fix/SKILL.md +10 -0
- package/hosts/codex-project/.agents/skills/geopilot-fix/agents/openai.yaml +2 -0
- package/hosts/codex-project/.agents/skills/geopilot-init/SKILL.md +13 -0
- package/hosts/codex-project/.agents/skills/geopilot-init/agents/openai.yaml +2 -0
- package/hosts/codex-project/.agents/skills/geopilot-insights/SKILL.md +10 -0
- package/hosts/codex-project/.agents/skills/geopilot-review/SKILL.md +10 -0
- package/hosts/codex-project/.agents/skills/geopilot-scan/SKILL.md +10 -0
- package/hosts/codex-project/.codex/agents/geopilot-explainer.toml +34 -0
- package/hosts/codex-project/.codex/agents/geopilot-fixer.toml +40 -0
- package/hosts/codex-project/.codex/agents/geopilot-investigator.toml +43 -0
- package/hosts/codex-project/.codex/agents/geopilot-reviewer.toml +39 -0
- package/hosts/codex-project/.codex/agents/geopilot-scanner.toml +45 -0
- package/hosts/geopilot/.claude-plugin/plugin.json +22 -0
- package/hosts/geopilot/README.md +25 -0
- package/hosts/geopilot/agents/explainer.agent.md +36 -0
- package/hosts/geopilot/agents/fixer.agent.md +42 -0
- package/hosts/geopilot/agents/investigator.agent.md +45 -0
- package/hosts/geopilot/agents/reviewer.agent.md +41 -0
- package/hosts/geopilot/agents/scanner.agent.md +47 -0
- package/hosts/geopilot/assets/icon.png +0 -0
- package/hosts/geopilot/skills/explain/SKILL.md +9 -0
- package/hosts/geopilot/skills/fix/SKILL.md +12 -0
- package/hosts/geopilot/skills/geo/SKILL.md +95 -0
- package/hosts/geopilot/skills/geo/references/frameworks.md +20 -0
- package/hosts/geopilot/skills/geo/references/insight-contract.md +42 -0
- package/hosts/geopilot/skills/geo/references/safety.md +30 -0
- package/hosts/geopilot/skills/geo/references/workflow-explain.md +8 -0
- package/hosts/geopilot/skills/geo/references/workflow-fix.md +20 -0
- package/hosts/geopilot/skills/geo/references/workflow-init.md +6 -0
- package/hosts/geopilot/skills/geo/references/workflow-insights.md +13 -0
- package/hosts/geopilot/skills/geo/references/workflow-plan.md +13 -0
- package/hosts/geopilot/skills/geo/references/workflow-review.md +8 -0
- package/hosts/geopilot/skills/geo/references/workflow-scan.md +18 -0
- package/hosts/geopilot/skills/geo/schemas/insights.schema.json +255 -0
- package/hosts/geopilot/skills/geo/scripts/geo.ps1 +14 -0
- package/hosts/geopilot/skills/geo/scripts/geo.sh +13 -0
- package/hosts/geopilot/skills/init/SKILL.md +15 -0
- package/hosts/geopilot/skills/insights/SKILL.md +11 -0
- package/hosts/geopilot/skills/review/SKILL.md +11 -0
- package/hosts/geopilot/skills/scan/SKILL.md +11 -0
- package/hosts/opencode/.opencode/agents/geopilot-explainer.md +39 -0
- package/hosts/opencode/.opencode/agents/geopilot-fixer.md +45 -0
- package/hosts/opencode/.opencode/agents/geopilot-investigator.md +48 -0
- package/hosts/opencode/.opencode/agents/geopilot-reviewer.md +44 -0
- package/hosts/opencode/.opencode/agents/geopilot-scanner.md +50 -0
- package/hosts/opencode/.opencode/commands/geopilot-explain.md +8 -0
- package/hosts/opencode/.opencode/commands/geopilot-fix.md +10 -0
- package/hosts/opencode/.opencode/commands/geopilot-init.md +12 -0
- package/hosts/opencode/.opencode/commands/geopilot-insights.md +10 -0
- package/hosts/opencode/.opencode/commands/geopilot-review.md +10 -0
- package/hosts/opencode/.opencode/commands/geopilot-scan.md +10 -0
- package/hosts/opencode/.opencode/skills/geo/SKILL.md +95 -0
- package/hosts/opencode/.opencode/skills/geo/references/frameworks.md +20 -0
- package/hosts/opencode/.opencode/skills/geo/references/insight-contract.md +42 -0
- package/hosts/opencode/.opencode/skills/geo/references/safety.md +30 -0
- package/hosts/opencode/.opencode/skills/geo/references/workflow-explain.md +8 -0
- package/hosts/opencode/.opencode/skills/geo/references/workflow-fix.md +20 -0
- package/hosts/opencode/.opencode/skills/geo/references/workflow-init.md +6 -0
- package/hosts/opencode/.opencode/skills/geo/references/workflow-insights.md +13 -0
- package/hosts/opencode/.opencode/skills/geo/references/workflow-plan.md +13 -0
- package/hosts/opencode/.opencode/skills/geo/references/workflow-review.md +8 -0
- package/hosts/opencode/.opencode/skills/geo/references/workflow-scan.md +18 -0
- package/hosts/opencode/.opencode/skills/geo/schemas/insights.schema.json +255 -0
- package/hosts/opencode/.opencode/skills/geo/scripts/geo.ps1 +14 -0
- package/hosts/opencode/.opencode/skills/geo/scripts/geo.sh +13 -0
- package/package.json +65 -4
- package/schemas/config-v1.json +392 -0
- package/schemas/insights-v1.json +255 -0
- package/schemas/merged-v1.json +71 -0
- package/schemas/report-v1.json +836 -0
- package/skill/geo/SKILL.md +95 -0
- package/skill/geo/references/frameworks.md +20 -0
- package/skill/geo/references/insight-contract.md +42 -0
- package/skill/geo/references/safety.md +30 -0
- package/skill/geo/references/workflow-explain.md +8 -0
- package/skill/geo/references/workflow-fix.md +20 -0
- package/skill/geo/references/workflow-init.md +6 -0
- package/skill/geo/references/workflow-insights.md +13 -0
- package/skill/geo/references/workflow-plan.md +13 -0
- package/skill/geo/references/workflow-review.md +8 -0
- package/skill/geo/references/workflow-scan.md +18 -0
- package/skill/geo/schemas/insights.schema.json +255 -0
- package/skill/geo/scripts/geo.ps1 +14 -0
- package/skill/geo/scripts/geo.sh +13 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,3 +1,92 @@
|
|
|
1
|
-
#
|
|
1
|
+
# geopilot
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**Find the issue. Trace it to source. Prove the fix.**
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/geopilot)
|
|
6
|
+
[](https://www.npmjs.com/package/geopilot)
|
|
7
|
+
[](https://github.com/moelzanaty3/geopilot/blob/main/LICENSE)
|
|
8
|
+
[](https://moelzanaty3.github.io/geopilot/)
|
|
9
|
+
|
|
10
|
+
**[Documentation](https://moelzanaty3.github.io/geopilot/)** · [Getting started](https://moelzanaty3.github.io/geopilot/docs/getting-started/) · [Rules](https://moelzanaty3.github.io/geopilot/docs/rules/) · [CLI](https://moelzanaty3.github.io/geopilot/docs/cli/) · [Agent plugins](https://moelzanaty3.github.io/geopilot/docs/agent/) · [GitHub](https://github.com/moelzanaty3/geopilot)
|
|
11
|
+
|
|
12
|
+
geopilot audits any website for the technical conditions crawlers and AI search systems document: robots, sitemaps, indexability, canonicals, metadata and structured data. It shows the evidence, maps the problem to the line that caused it, proposes the smallest safe change, and reports honestly what was verified.
|
|
13
|
+
|
|
14
|
+
It runs on your machine, with no accounts, telemetry or model calls.
|
|
15
|
+
|
|
16
|
+
> Technical readiness only. geopilot does not measure or predict citations, rankings, traffic or inclusion in any AI or search product.
|
|
17
|
+
|
|
18
|
+
## Quick start
|
|
19
|
+
|
|
20
|
+
Requires Node 22.18 or newer.
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npx geopilot scan https://www.example.com # any stack
|
|
24
|
+
npx geopilot scan . # a repository, with source locations
|
|
25
|
+
npx geopilot scan . --url http://127.0.0.1:3000 # both: the strongest evidence
|
|
26
|
+
npx geopilot fix # preview fixes; nothing is written
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
A repository scan on a Next.js app looks like this:
|
|
30
|
+
|
|
31
|
+
```text
|
|
32
|
+
Readiness insufficient evidence
|
|
33
|
+
Coverage 43% Confidence 82% Assessment partial
|
|
34
|
+
· 6 rules need runtime evidence — re-run with --url
|
|
35
|
+
|
|
36
|
+
HIGH GEO-014 /pricing /pricing sets robots noindex in its metadata
|
|
37
|
+
app/pricing/page.tsx:5 provenance exact
|
|
38
|
+
fix G1-b75653d6 (guarded) → geopilot fix --rule GEO-014
|
|
39
|
+
MED GEO-011 site public/robots.txt has no Sitemap: line
|
|
40
|
+
public/robots.txt provenance exact
|
|
41
|
+
fix S1-6d0f6bea (safe) → geopilot fix --rule GEO-011
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Apply a guarded fix by its id, then have geopilot verify it on a server it starts after the write:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
npx geopilot fix --apply --approve <fixId> --serve
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Use it from your coding agent
|
|
51
|
+
|
|
52
|
+
Plugins add five agents and six commands that drive the same CLI. On Codex, the marketplace plugin carries them as skills; install into the repo for real subagents. They keep engine findings apart from their own recommendations, and they never apply a guarded fix without its id.
|
|
53
|
+
|
|
54
|
+
| Host | Install | Status |
|
|
55
|
+
| --- | --- | --- |
|
|
56
|
+
| Claude Code | `/plugin install geopilot --marketplace moelzanaty3/geopilot` | Supported |
|
|
57
|
+
| GitHub Copilot CLI | `copilot plugin marketplace add moelzanaty3/geopilot`<br>`copilot plugin install geopilot@geopilot` | Supported |
|
|
58
|
+
| OpenCode | `npx geopilot agent install --host opencode` | Supported |
|
|
59
|
+
| OpenAI Codex | `codex plugin marketplace add moelzanaty3/geopilot`<br>`codex plugin add geopilot@geopilot` | Supported |
|
|
60
|
+
| Claude Code or Codex, committed to one repo | `npx geopilot agent install --host claude-code`<br>`npx geopilot agent install --host codex` | Supported |
|
|
61
|
+
| Other hosts that read `AGENTS.md` | `npx geopilot agent install --host agents-md --write-agents-md` | Provisional |
|
|
62
|
+
|
|
63
|
+
**Agents:** `scanner`, `fixer`, `reviewer`, `investigator`, `explainer`
|
|
64
|
+
**Commands:** `scan`, `fix`, `review`, `explain`, `insights`, `init`
|
|
65
|
+
|
|
66
|
+
[Read the plugin guide →](https://moelzanaty3.github.io/geopilot/docs/agent/)
|
|
67
|
+
|
|
68
|
+
## What you get
|
|
69
|
+
|
|
70
|
+
| | |
|
|
71
|
+
| --- | --- |
|
|
72
|
+
| **Rules** | A closed catalogue covering robots, crawler access, indexability, canonicals, server HTML, JSON-LD, sitemaps, metadata, links and snippet controls. Each rule cites the documentation it rests on. [Browse the rules](https://moelzanaty3.github.io/geopilot/docs/rules/). |
|
|
73
|
+
| **Four separate outputs** | Readiness, coverage, confidence and assessment scope are never blended. Below 50% coverage, geopilot shows no readiness number rather than guess. [How scoring works](https://moelzanaty3.github.io/geopilot/docs/scoring/). |
|
|
74
|
+
| **Source tracing** | On Next.js App Router and static HTML, findings map to file and line by reading source as an AST. Source is never executed, and every mapping states how much to trust it. [Provenance](https://moelzanaty3.github.io/geopilot/docs/provenance/). |
|
|
75
|
+
| **Fixes** | Five closed-list fixes, each with snapshots and byte-exact rollback. Safe fixes apply with `--apply`; guarded fixes also need their id. [Fixes and verification](https://moelzanaty3.github.io/geopilot/docs/fixes/). |
|
|
76
|
+
| **Honest verification** | Runtime verification counts only on a server geopilot started after the write. Anything less is reported as `applied_unverified`. |
|
|
77
|
+
| **Safety** | An SSRF guard, private targets only when you name them, and robots.txt respected. [Security and privacy](https://moelzanaty3.github.io/geopilot/docs/security/). |
|
|
78
|
+
|
|
79
|
+
## Status
|
|
80
|
+
|
|
81
|
+
This is an early alpha. A browser renderer, SARIF output, the GitHub Action, the `review` CLI command, baselines and hooks aren't built yet. [See the current scope](https://github.com/moelzanaty3/geopilot/blob/main/docs/adr/0004-phase-scope.md).
|
|
82
|
+
|
|
83
|
+
## Links
|
|
84
|
+
|
|
85
|
+
- [Documentation](https://moelzanaty3.github.io/geopilot/)
|
|
86
|
+
- [Source code](https://github.com/moelzanaty3/geopilot)
|
|
87
|
+
- [Issues](https://github.com/moelzanaty3/geopilot/issues)
|
|
88
|
+
- [Contributing](https://github.com/moelzanaty3/geopilot/blob/main/CONTRIBUTING.md)
|
|
89
|
+
|
|
90
|
+
## License
|
|
91
|
+
|
|
92
|
+
[Apache-2.0](https://github.com/moelzanaty3/geopilot/blob/main/LICENSE)
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export type Host = 'claude-code' | 'opencode' | 'codex' | 'agents-md';
|
|
2
|
+
export type HostStatus = 'supported' | 'provisional' | 'marketplace' | 'not_available';
|
|
3
|
+
export declare const HOSTS: readonly {
|
|
4
|
+
readonly id: string;
|
|
5
|
+
readonly status: HostStatus;
|
|
6
|
+
readonly note: string;
|
|
7
|
+
}[];
|
|
8
|
+
export declare const VERSION_PLACEHOLDER = "{{ENGINE_VERSION}}";
|
|
9
|
+
/** A generated host bundle: published under hosts/, in the repository under plugins/. */
|
|
10
|
+
export declare function bundleSource(bundle: 'claude-project' | 'opencode' | 'codex-project' | 'codex' | 'geopilot'): string;
|
|
11
|
+
export declare function skillSource(): string;
|
|
12
|
+
export declare function listSkillFiles(root: string): string[];
|
|
13
|
+
export declare function installedVersion(repoRoot: string): string | null;
|
|
14
|
+
export interface InstallPlan {
|
|
15
|
+
readonly host: Host;
|
|
16
|
+
readonly writes: readonly {
|
|
17
|
+
readonly path: string;
|
|
18
|
+
readonly content: string;
|
|
19
|
+
readonly exists: boolean;
|
|
20
|
+
}[];
|
|
21
|
+
}
|
|
22
|
+
export declare function planInstall(repoRoot: string, host: Host): InstallPlan;
|
|
23
|
+
export declare function executeInstall(plan: InstallPlan): void;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, readdirSync, readFileSync, statSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import { dirname, join, relative } from 'node:path';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
import { TOOL_VERSION } from "../core/version.js";
|
|
5
|
+
export const HOSTS = [
|
|
6
|
+
{ id: 'claude-code', status: 'supported', note: 'project install: .claude/agents and .claude/skills; or the plugin: /plugin install geopilot --marketplace moelzanaty3/geopilot' },
|
|
7
|
+
{ id: 'opencode', status: 'supported', note: 'project install: .opencode/agents, .opencode/commands, .opencode/skills' },
|
|
8
|
+
{ id: 'copilot', status: 'marketplace', note: 'copilot plugin marketplace add moelzanaty3/geopilot && copilot plugin install geopilot@geopilot' },
|
|
9
|
+
{ id: 'codex', status: 'supported', note: 'project install: .codex/agents and .agents/skills; or the plugin: codex plugin marketplace add moelzanaty3/geopilot && codex plugin add geopilot@geopilot' },
|
|
10
|
+
{ id: 'agents-md', status: 'provisional', note: 'a section in AGENTS.md, with --write-agents-md' },
|
|
11
|
+
{ id: 'cursor', status: 'not_available', note: 'not tested yet; use agents-md' },
|
|
12
|
+
];
|
|
13
|
+
export const VERSION_PLACEHOLDER = '{{ENGINE_VERSION}}';
|
|
14
|
+
/** A generated host bundle: published under hosts/, in the repository under plugins/. */
|
|
15
|
+
export function bundleSource(bundle) {
|
|
16
|
+
const published = fileURLToPath(new URL(`../../hosts/${bundle}/`, import.meta.url));
|
|
17
|
+
if (existsSync(published))
|
|
18
|
+
return published;
|
|
19
|
+
return fileURLToPath(new URL(`../../../../plugins/${bundle}/`, import.meta.url));
|
|
20
|
+
}
|
|
21
|
+
export function skillSource() {
|
|
22
|
+
return join(bundleSource('claude-project'), '.claude', 'skills', 'geo');
|
|
23
|
+
}
|
|
24
|
+
export function listSkillFiles(root) {
|
|
25
|
+
const out = [];
|
|
26
|
+
const walk = (dir) => {
|
|
27
|
+
for (const name of readdirSync(dir).sort()) {
|
|
28
|
+
const abs = join(dir, name);
|
|
29
|
+
if (statSync(abs).isDirectory())
|
|
30
|
+
walk(abs);
|
|
31
|
+
else
|
|
32
|
+
out.push(relative(root, abs).split('\\').join('/'));
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
walk(root);
|
|
36
|
+
return out;
|
|
37
|
+
}
|
|
38
|
+
export function installedVersion(repoRoot) {
|
|
39
|
+
const file = join(repoRoot, '.claude', 'skills', 'geo', 'SKILL.md');
|
|
40
|
+
if (!existsSync(file))
|
|
41
|
+
return null;
|
|
42
|
+
const m = /engine-version:\s*"?([^"\n]+)"?/.exec(readFileSync(file, 'utf8'));
|
|
43
|
+
return m ? m[1].trim() : null;
|
|
44
|
+
}
|
|
45
|
+
const AGENTS_START = '<!-- geopilot:begin -->';
|
|
46
|
+
const AGENTS_END = '<!-- geopilot:end -->';
|
|
47
|
+
export function planInstall(repoRoot, host) {
|
|
48
|
+
if (host !== 'agents-md') {
|
|
49
|
+
const src = bundleSource(host === 'claude-code' ? 'claude-project' : host === 'codex' ? 'codex-project' : 'opencode');
|
|
50
|
+
const writes = listSkillFiles(src).map((rel) => {
|
|
51
|
+
const content = readFileSync(join(src, rel), 'utf8').replaceAll(VERSION_PLACEHOLDER, TOOL_VERSION);
|
|
52
|
+
const path = join(repoRoot, rel);
|
|
53
|
+
return { path, content, exists: existsSync(path) };
|
|
54
|
+
});
|
|
55
|
+
return { host, writes };
|
|
56
|
+
}
|
|
57
|
+
const path = join(repoRoot, 'AGENTS.md');
|
|
58
|
+
// --prefix keeps npx from running or configuring itself from the repository being scanned.
|
|
59
|
+
const cli = `npx --yes --prefix "$(mktemp -d)" geopilot@${TOOL_VERSION}`;
|
|
60
|
+
const section = `${AGENTS_START}\n## geopilot (GEO technical readiness)\n\nUse the geopilot CLI for technical readiness checks; never claim rule outcomes it did not report.\n\n- Scan: \`${cli} scan --format json\`\n- Explain a rule: \`${cli} explain <ruleId>\`\n- Fixes are dry-run by default; apply only after the user approves each guarded fix (\`--approve <fixId>\`).\n- Label your own file attributions as agent-suggested; they are not engine provenance.\n- Report verification honestly: \`applied_unverified\` is not success.\n\nTechnical readiness only. GEO does not measure or predict citations, rankings, traffic or inclusion in any AI or search product.\n${AGENTS_END}\n`;
|
|
61
|
+
const exists = existsSync(path);
|
|
62
|
+
let content = section;
|
|
63
|
+
if (exists) {
|
|
64
|
+
const current = readFileSync(path, 'utf8');
|
|
65
|
+
const s = current.indexOf(AGENTS_START);
|
|
66
|
+
const e = current.indexOf(AGENTS_END);
|
|
67
|
+
content = s !== -1 && e > s ? `${current.slice(0, s)}${section}${current.slice(e + AGENTS_END.length + 1)}` : `${current.replace(/\n*$/, '\n\n')}${section}`;
|
|
68
|
+
}
|
|
69
|
+
return { host, writes: [{ path, content, exists }] };
|
|
70
|
+
}
|
|
71
|
+
export function executeInstall(plan) {
|
|
72
|
+
for (const w of plan.writes) {
|
|
73
|
+
mkdirSync(dirname(w.path), { recursive: true });
|
|
74
|
+
writeFileSync(w.path, w.content, { mode: w.path.endsWith('.sh') ? 0o755 : 0o644 });
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=install.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install.js","sourceRoot":"","sources":["../../src/agent/install.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACpG,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAQlD,MAAM,CAAC,MAAM,KAAK,GAA2F;IAC3G,EAAE,EAAE,EAAE,aAAa,EAAE,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,gIAAgI,EAAE;IAClL,EAAE,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,yEAAyE,EAAE;IACxH,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,iGAAiG,EAAE;IACjJ,EAAE,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,2JAA2J,EAAE;IACvM,EAAE,EAAE,EAA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S,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAChD,aAAa,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC;IACrF,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Report } from '../types.ts';
|
|
2
|
+
export declare const RETAIN_RUNS = 10;
|
|
3
|
+
export declare const SNAPSHOT_MAX_BYTES: number;
|
|
4
|
+
export declare function userCacheDir(env?: NodeJS.ProcessEnv): string;
|
|
5
|
+
export declare function cacheRoot(repoRoot: string | null, env?: NodeJS.ProcessEnv): string;
|
|
6
|
+
export declare function ensureGeoDir(root: string): void;
|
|
7
|
+
export declare function runDir(root: string, runId: string): string;
|
|
8
|
+
export declare function snapshotName(url: string): string;
|
|
9
|
+
export declare function saveRun(root: string, report: Report, snapshots: ReadonlyMap<string, string>): string;
|
|
10
|
+
export declare function listRuns(root: string): string[];
|
|
11
|
+
export interface LoadedRun {
|
|
12
|
+
readonly report: Report;
|
|
13
|
+
readonly reportSha256: string;
|
|
14
|
+
readonly dir: string;
|
|
15
|
+
readonly dom: ReadonlyMap<string, string>;
|
|
16
|
+
}
|
|
17
|
+
export declare function loadRun(root: string, runId: string): LoadedRun | null;
|
|
18
|
+
export declare function latestRun(root: string): string | null;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, readdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import { homedir, platform } from 'node:os';
|
|
3
|
+
import { join } from 'node:path';
|
|
4
|
+
import { canonicalJson, sha256 } from "../core/hash.js";
|
|
5
|
+
import { redact } from "../core/redact.js";
|
|
6
|
+
// `.geo/runs/<runId>` inside a repository, otherwise the OS user cache
|
|
7
|
+
// (spec 5.1). Ten runs are kept. DOM snapshots are bounded and redacted; no
|
|
8
|
+
// cookies, auth headers or full response bodies beyond the cap are stored.
|
|
9
|
+
export const RETAIN_RUNS = 10;
|
|
10
|
+
export const SNAPSHOT_MAX_BYTES = 512 * 1024;
|
|
11
|
+
export function userCacheDir(env = process.env) {
|
|
12
|
+
if (env.GEO_CACHE_DIR)
|
|
13
|
+
return env.GEO_CACHE_DIR;
|
|
14
|
+
if (platform() === 'win32')
|
|
15
|
+
return join(env.LOCALAPPDATA ?? join(homedir(), 'AppData', 'Local'), 'geopilot');
|
|
16
|
+
if (platform() === 'darwin')
|
|
17
|
+
return join(homedir(), 'Library', 'Caches', 'geopilot');
|
|
18
|
+
return join(env.XDG_CACHE_HOME ?? join(homedir(), '.cache'), 'geopilot');
|
|
19
|
+
}
|
|
20
|
+
export function cacheRoot(repoRoot, env = process.env) {
|
|
21
|
+
return repoRoot ? join(repoRoot, '.geo') : userCacheDir(env);
|
|
22
|
+
}
|
|
23
|
+
export function ensureGeoDir(root) {
|
|
24
|
+
mkdirSync(join(root, 'runs'), { recursive: true });
|
|
25
|
+
const gi = join(root, '.gitignore');
|
|
26
|
+
if (root.endsWith('.geo') && !existsSync(gi))
|
|
27
|
+
writeFileSync(gi, '*\n');
|
|
28
|
+
}
|
|
29
|
+
export function runDir(root, runId) {
|
|
30
|
+
if (!/^r-[0-9TZ]+-[0-9a-f]{6}$/.test(runId))
|
|
31
|
+
throw new Error(`not a run id: ${runId}`);
|
|
32
|
+
return join(root, 'runs', runId);
|
|
33
|
+
}
|
|
34
|
+
export function snapshotName(url) {
|
|
35
|
+
return `${sha256(url).slice(0, 16)}.html`;
|
|
36
|
+
}
|
|
37
|
+
export function saveRun(root, report, snapshots) {
|
|
38
|
+
ensureGeoDir(root);
|
|
39
|
+
const dir = runDir(root, report.run.id);
|
|
40
|
+
mkdirSync(join(dir, 'dom'), { recursive: true });
|
|
41
|
+
const json = canonicalJson(report);
|
|
42
|
+
writeFileSync(join(dir, 'report.json'), json);
|
|
43
|
+
const index = {};
|
|
44
|
+
for (const [url, html] of snapshots) {
|
|
45
|
+
const name = snapshotName(url);
|
|
46
|
+
const bounded = Buffer.byteLength(html) > SNAPSHOT_MAX_BYTES ? Buffer.from(html).subarray(0, SNAPSHOT_MAX_BYTES).toString('utf8') : html;
|
|
47
|
+
writeFileSync(join(dir, 'dom', name), redact(bounded));
|
|
48
|
+
index[url] = name;
|
|
49
|
+
}
|
|
50
|
+
writeFileSync(join(dir, 'dom', 'index.json'), canonicalJson(index));
|
|
51
|
+
prune(root);
|
|
52
|
+
return dir;
|
|
53
|
+
}
|
|
54
|
+
export function listRuns(root) {
|
|
55
|
+
const dir = join(root, 'runs');
|
|
56
|
+
if (!existsSync(dir))
|
|
57
|
+
return [];
|
|
58
|
+
return readdirSync(dir).filter((d) => /^r-/.test(d)).sort();
|
|
59
|
+
}
|
|
60
|
+
function prune(root) {
|
|
61
|
+
const runs = listRuns(root);
|
|
62
|
+
for (const old of runs.slice(0, Math.max(0, runs.length - RETAIN_RUNS))) {
|
|
63
|
+
// Runs holding fix snapshots are kept: rollback depends on them.
|
|
64
|
+
if (existsSync(join(root, 'runs', old, 'fix')))
|
|
65
|
+
continue;
|
|
66
|
+
rmSync(join(root, 'runs', old), { recursive: true, force: true });
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
export function loadRun(root, runId) {
|
|
70
|
+
const dir = runDir(root, runId);
|
|
71
|
+
const file = join(dir, 'report.json');
|
|
72
|
+
if (!existsSync(file))
|
|
73
|
+
return null;
|
|
74
|
+
const text = readFileSync(file, 'utf8');
|
|
75
|
+
const dom = new Map();
|
|
76
|
+
const idx = join(dir, 'dom', 'index.json');
|
|
77
|
+
if (existsSync(idx)) {
|
|
78
|
+
const index = JSON.parse(readFileSync(idx, 'utf8'));
|
|
79
|
+
for (const [url, name] of Object.entries(index)) {
|
|
80
|
+
const p = join(dir, 'dom', name);
|
|
81
|
+
if (existsSync(p))
|
|
82
|
+
dom.set(url, readFileSync(p, 'utf8'));
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return { report: JSON.parse(text), reportSha256: sha256(text), dir, dom };
|
|
86
|
+
}
|
|
87
|
+
export function latestRun(root) {
|
|
88
|
+
const runs = listRuns(root).filter((r) => existsSync(join(root, 'runs', r, 'report.json')));
|
|
89
|
+
return runs[runs.length - 1] ?? null;
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=runs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runs.js","sourceRoot":"","sources":["../../src/cache/runs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAClG,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAG3C,uEAAuE;AACvE,4EAA4E;AAC5E,2EAA2E;AAE3E,MAAM,CAAC,MAAM,WAAW,GAAG,EAAE,CAAC;AAC9B,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,GAAG,IAAI,CAAC;AAE7C,MAAM,UAAU,YAAY,CAAC,MAAyB,OAAO,CAAC,GAAG;IAC/D,IAAI,GAAG,CAAC,aAAa;QAAE,OAAO,GAAG,CAAC,aAAa,CAAC;IAChD,IAAI,QAAQ,EAAE,KAAK,OAAO;QAAE,OAAO,IAAI,CAAC,GAAG,CAAC,YAAY,IAAI,IAAI,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,UAAU,CAAC,CAAC;IAC7G,IAAI,QAAQ,E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,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,CAA2B,CAAC;QAC9E,KAAK,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YAChD,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;YACjC,IAAI,UAAU,CAAC,CAAC,CAAC;gBAAE,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;QAC3D,CAAC;IACH,CAAC;IACD,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAW,EAAE,YAAY,EAAE,MAAM,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AACtF,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,IAAY;IACpC,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;IAC5F,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,IAAI,CAAC;AACvC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface FlagSpec {
|
|
2
|
+
readonly name: string;
|
|
3
|
+
readonly type: 'boolean' | 'string' | 'multi';
|
|
4
|
+
readonly short?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const GLOBAL_FLAGS: readonly FlagSpec[];
|
|
7
|
+
export declare const SCAN_FLAGS: readonly FlagSpec[];
|
|
8
|
+
export declare const FIX_FLAGS: readonly FlagSpec[];
|
|
9
|
+
export declare const INIT_FLAGS: readonly FlagSpec[];
|
|
10
|
+
export declare const AGENT_FLAGS: readonly FlagSpec[];
|
|
11
|
+
export declare const RULES_FLAGS: readonly FlagSpec[];
|
|
12
|
+
export declare const INSIGHTS_FLAGS: readonly FlagSpec[];
|
|
13
|
+
export interface Parsed {
|
|
14
|
+
readonly positionals: string[];
|
|
15
|
+
readonly bool: ReadonlySet<string>;
|
|
16
|
+
readonly str: ReadonlyMap<string, string>;
|
|
17
|
+
readonly multi: ReadonlyMap<string, string[]>;
|
|
18
|
+
}
|
|
19
|
+
export declare function parseArgs(argv: readonly string[], specs: readonly FlagSpec[]): Parsed;
|
|
20
|
+
export declare function intFlag(p: Parsed, name: string, min: number, max: number): number | undefined;
|