@howlil/ez-agents 2.0.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +157 -110
- package/README.zh-CN.md +84 -84
- package/agents/ez-plan-checker.md +2 -2
- package/agents/ez-research-synthesizer.md +1 -1
- package/agents/ez-ui-auditor.md +0 -2
- package/agents/ez-ui-checker.md +2 -4
- package/agents/ez-ui-researcher.md +0 -2
- package/agents/ez-verifier.md +1 -1
- package/bin/install.js +211 -211
- package/commands/ez/debug.md +1 -1
- package/commands/ez/map-codebase.md +1 -1
- package/commands/ez/reapply-patches.md +3 -3
- package/commands/ez/research-phase.md +1 -1
- package/{get-shit-done → ez-agents}/bin/ez-tools.cjs +1 -1
- package/{get-shit-done → ez-agents}/bin/lib/assistant-adapter.cjs +205 -205
- package/{get-shit-done → ez-agents}/bin/lib/audit-exec.cjs +150 -150
- package/{get-shit-done → ez-agents}/bin/lib/auth.cjs +175 -175
- package/{get-shit-done → ez-agents}/bin/lib/circuit-breaker.cjs +118 -118
- package/{get-shit-done → ez-agents}/bin/lib/commands.cjs +666 -666
- package/{get-shit-done → ez-agents}/bin/lib/config.cjs +183 -183
- package/{get-shit-done → ez-agents}/bin/lib/core.cjs +495 -495
- package/{get-shit-done → ez-agents}/bin/lib/file-lock.cjs +236 -236
- package/{get-shit-done → ez-agents}/bin/lib/frontmatter.cjs +299 -299
- package/{get-shit-done → ez-agents}/bin/lib/fs-utils.cjs +153 -153
- package/{get-shit-done → ez-agents}/bin/lib/git-utils.cjs +203 -203
- package/{get-shit-done → ez-agents}/bin/lib/health-check.cjs +163 -163
- package/{get-shit-done → ez-agents}/bin/lib/index.cjs +113 -113
- package/{get-shit-done → ez-agents}/bin/lib/init.cjs +710 -710
- package/{get-shit-done → ez-agents}/bin/lib/logger.cjs +117 -117
- package/{get-shit-done → ez-agents}/bin/lib/milestone.cjs +241 -241
- package/{get-shit-done → ez-agents}/bin/lib/model-provider.cjs +146 -146
- package/{get-shit-done → ez-agents}/bin/lib/phase.cjs +908 -908
- package/{get-shit-done → ez-agents}/bin/lib/retry.cjs +119 -119
- package/{get-shit-done → ez-agents}/bin/lib/roadmap.cjs +305 -305
- package/{get-shit-done → ez-agents}/bin/lib/safe-exec.cjs +128 -128
- package/{get-shit-done → ez-agents}/bin/lib/safe-path.cjs +130 -130
- package/{get-shit-done → ez-agents}/bin/lib/state.cjs +721 -721
- package/{get-shit-done → ez-agents}/bin/lib/temp-file.cjs +239 -239
- package/{get-shit-done → ez-agents}/bin/lib/template.cjs +222 -222
- package/{get-shit-done → ez-agents}/bin/lib/test-file-lock.cjs +112 -112
- package/{get-shit-done → ez-agents}/bin/lib/test-graceful.cjs +93 -93
- package/{get-shit-done → ez-agents}/bin/lib/test-logger.cjs +60 -60
- package/{get-shit-done → ez-agents}/bin/lib/test-safe-exec.cjs +38 -38
- package/{get-shit-done → ez-agents}/bin/lib/test-safe-path.cjs +33 -33
- package/{get-shit-done → ez-agents}/bin/lib/test-temp-file.cjs +125 -125
- package/{get-shit-done → ez-agents}/bin/lib/timeout-exec.cjs +62 -62
- package/{get-shit-done → ez-agents}/bin/lib/verify.cjs +820 -820
- package/{get-shit-done → ez-agents}/references/checkpoints.md +776 -776
- package/{get-shit-done → ez-agents}/references/questioning.md +162 -162
- package/{get-shit-done → ez-agents}/references/tdd.md +263 -263
- package/{get-shit-done → ez-agents}/templates/codebase/concerns.md +310 -310
- package/{get-shit-done → ez-agents}/templates/codebase/conventions.md +307 -307
- package/{get-shit-done → ez-agents}/templates/codebase/integrations.md +280 -280
- package/{get-shit-done → ez-agents}/templates/codebase/stack.md +186 -186
- package/{get-shit-done → ez-agents}/templates/codebase/testing.md +480 -480
- package/{get-shit-done → ez-agents}/templates/config.json +37 -37
- package/{get-shit-done → ez-agents}/templates/continue-here.md +78 -78
- package/{get-shit-done → ez-agents}/templates/milestone-archive.md +123 -123
- package/{get-shit-done → ez-agents}/templates/milestone.md +115 -115
- package/{get-shit-done → ez-agents}/templates/requirements.md +231 -231
- package/{get-shit-done → ez-agents}/templates/research-project/ARCHITECTURE.md +204 -204
- package/{get-shit-done → ez-agents}/templates/research-project/FEATURES.md +147 -147
- package/{get-shit-done → ez-agents}/templates/research-project/PITFALLS.md +200 -200
- package/{get-shit-done → ez-agents}/templates/research-project/STACK.md +120 -120
- package/{get-shit-done → ez-agents}/templates/research-project/SUMMARY.md +170 -170
- package/{get-shit-done → ez-agents}/templates/retrospective.md +54 -54
- package/{get-shit-done → ez-agents}/templates/roadmap.md +202 -202
- package/{get-shit-done → ez-agents}/templates/summary-minimal.md +41 -41
- package/{get-shit-done → ez-agents}/templates/summary-standard.md +48 -48
- package/{get-shit-done → ez-agents}/templates/summary.md +248 -248
- package/{get-shit-done → ez-agents}/templates/user-setup.md +311 -311
- package/{get-shit-done → ez-agents}/templates/verification-report.md +322 -322
- package/{get-shit-done → ez-agents}/workflows/add-phase.md +112 -112
- package/{get-shit-done → ez-agents}/workflows/add-tests.md +351 -351
- package/{get-shit-done → ez-agents}/workflows/add-todo.md +158 -158
- package/{get-shit-done → ez-agents}/workflows/audit-milestone.md +332 -332
- package/{get-shit-done → ez-agents}/workflows/autonomous.md +743 -743
- package/{get-shit-done → ez-agents}/workflows/check-todos.md +177 -177
- package/{get-shit-done → ez-agents}/workflows/cleanup.md +152 -152
- package/{get-shit-done → ez-agents}/workflows/complete-milestone.md +766 -766
- package/ez-agents/workflows/debug.md +0 -0
- package/{get-shit-done → ez-agents}/workflows/diagnose-issues.md +219 -219
- package/{get-shit-done → ez-agents}/workflows/discovery-phase.md +289 -289
- package/{get-shit-done → ez-agents}/workflows/discuss-phase.md +762 -762
- package/{get-shit-done → ez-agents}/workflows/execute-phase.md +468 -468
- package/{get-shit-done → ez-agents}/workflows/execute-plan.md +483 -483
- package/{get-shit-done → ez-agents}/workflows/health.md +159 -159
- package/{get-shit-done → ez-agents}/workflows/help.md +492 -492
- package/{get-shit-done → ez-agents}/workflows/insert-phase.md +130 -130
- package/{get-shit-done → ez-agents}/workflows/list-phase-assumptions.md +178 -178
- package/{get-shit-done → ez-agents}/workflows/map-codebase.md +316 -316
- package/{get-shit-done → ez-agents}/workflows/new-milestone.md +384 -384
- package/{get-shit-done → ez-agents}/workflows/new-project.md +1111 -1111
- package/{get-shit-done → ez-agents}/workflows/node-repair.md +92 -92
- package/{get-shit-done → ez-agents}/workflows/pause-work.md +122 -122
- package/{get-shit-done → ez-agents}/workflows/plan-milestone-gaps.md +274 -274
- package/{get-shit-done → ez-agents}/workflows/plan-phase.md +651 -651
- package/{get-shit-done → ez-agents}/workflows/progress.md +382 -382
- package/{get-shit-done → ez-agents}/workflows/quick.md +610 -610
- package/{get-shit-done → ez-agents}/workflows/remove-phase.md +155 -155
- package/{get-shit-done → ez-agents}/workflows/research-phase.md +74 -74
- package/{get-shit-done → ez-agents}/workflows/resume-project.md +307 -307
- package/{get-shit-done → ez-agents}/workflows/set-profile.md +81 -81
- package/{get-shit-done → ez-agents}/workflows/settings.md +242 -242
- package/{get-shit-done → ez-agents}/workflows/stats.md +57 -57
- package/{get-shit-done → ez-agents}/workflows/transition.md +544 -544
- package/{get-shit-done → ez-agents}/workflows/ui-phase.md +290 -290
- package/{get-shit-done → ez-agents}/workflows/ui-review.md +157 -157
- package/{get-shit-done → ez-agents}/workflows/update.md +320 -320
- package/{get-shit-done → ez-agents}/workflows/validate-phase.md +167 -167
- package/{get-shit-done → ez-agents}/workflows/verify-phase.md +243 -243
- package/{get-shit-done → ez-agents}/workflows/verify-work.md +5 -5
- package/hooks/dist/ez-check-update.js +81 -0
- package/hooks/dist/ez-context-monitor.js +141 -0
- package/hooks/dist/ez-statusline.js +115 -0
- package/package.json +13 -3
- package/scripts/build-hooks.js +43 -43
- package/scripts/run-tests.cjs +29 -29
- /package/{get-shit-done → ez-agents}/references/continuation-format.md +0 -0
- /package/{get-shit-done → ez-agents}/references/decimal-phase-calculation.md +0 -0
- /package/{get-shit-done → ez-agents}/references/git-integration.md +0 -0
- /package/{get-shit-done → ez-agents}/references/git-planning-commit.md +0 -0
- /package/{get-shit-done → ez-agents}/references/model-profile-resolution.md +0 -0
- /package/{get-shit-done → ez-agents}/references/model-profiles.md +0 -0
- /package/{get-shit-done → ez-agents}/references/phase-argument-parsing.md +0 -0
- /package/{get-shit-done → ez-agents}/references/planning-config.md +0 -0
- /package/{get-shit-done → ez-agents}/references/ui-brand.md +0 -0
- /package/{get-shit-done → ez-agents}/references/verification-patterns.md +0 -0
- /package/{get-shit-done → ez-agents}/templates/DEBUG.md +0 -0
- /package/{get-shit-done → ez-agents}/templates/UAT.md +0 -0
- /package/{get-shit-done → ez-agents}/templates/UI-SPEC.md +0 -0
- /package/{get-shit-done → ez-agents}/templates/VALIDATION.md +0 -0
- /package/{get-shit-done → ez-agents}/templates/codebase/architecture.md +0 -0
- /package/{get-shit-done → ez-agents}/templates/codebase/structure.md +0 -0
- /package/{get-shit-done → ez-agents}/templates/context.md +0 -0
- /package/{get-shit-done → ez-agents}/templates/copilot-instructions.md +0 -0
- /package/{get-shit-done → ez-agents}/templates/debug-subagent-prompt.md +0 -0
- /package/{get-shit-done → ez-agents}/templates/discovery.md +0 -0
- /package/{get-shit-done → ez-agents}/templates/phase-prompt.md +0 -0
- /package/{get-shit-done → ez-agents}/templates/planner-subagent-prompt.md +0 -0
- /package/{get-shit-done → ez-agents}/templates/project.md +0 -0
- /package/{get-shit-done → ez-agents}/templates/research.md +0 -0
- /package/{get-shit-done → ez-agents}/templates/state.md +0 -0
- /package/{get-shit-done → ez-agents}/templates/summary-complex.md +0 -0
package/bin/install.js
CHANGED
|
@@ -14,11 +14,11 @@ const dim = '\x1b[2m';
|
|
|
14
14
|
const reset = '\x1b[0m';
|
|
15
15
|
|
|
16
16
|
// Codex config.toml constants
|
|
17
|
-
const EZ_CODEX_MARKER = '#
|
|
17
|
+
const EZ_CODEX_MARKER = '# EZ_Agents Agent Configuration \u2014 managed by ez-agents installer';
|
|
18
18
|
|
|
19
19
|
// Copilot instructions marker constants
|
|
20
|
-
const EZ_COPILOT_INSTRUCTIONS_MARKER = '<!--
|
|
21
|
-
const EZ_COPILOT_INSTRUCTIONS_CLOSE_MARKER = '<!-- /
|
|
20
|
+
const EZ_COPILOT_INSTRUCTIONS_MARKER = '<!-- EZ_Agents Configuration \u2014 managed by ez-agents installer -->';
|
|
21
|
+
const EZ_COPILOT_INSTRUCTIONS_CLOSE_MARKER = '<!-- /EZ_Agents Configuration -->';
|
|
22
22
|
|
|
23
23
|
const CODEX_AGENT_SANDBOX = {
|
|
24
24
|
'ez-executor': 'workspace-write',
|
|
@@ -249,14 +249,14 @@ function getGlobalDir(runtime, explicitDir = null) {
|
|
|
249
249
|
}
|
|
250
250
|
|
|
251
251
|
const banner = '\n' +
|
|
252
|
-
cyan + '
|
|
253
|
-
'
|
|
254
|
-
'
|
|
255
|
-
'
|
|
256
|
-
'
|
|
257
|
-
'
|
|
252
|
+
cyan + ' ███████╗██╗ ██╗\n' +
|
|
253
|
+
' ██╔════╝╚██╗██╔╝\n' +
|
|
254
|
+
' █████╗ ╚███╔╝ \n' +
|
|
255
|
+
' ██╔══╝ ██╔██╗ \n' +
|
|
256
|
+
' ███████╗██╔╝╚██╗\n' +
|
|
257
|
+
' ╚══════╝╚═╝ ╚═╝' + reset + '\n' +
|
|
258
258
|
'\n' +
|
|
259
|
-
'
|
|
259
|
+
' EZ_Agents ' + dim + 'v' + pkg.version + reset + '\n' +
|
|
260
260
|
' ' + dim + 'Multi-Model Edition' + reset + '\n' +
|
|
261
261
|
' A meta-prompting, context engineering and spec-driven\n' +
|
|
262
262
|
' development system for Claude Code, OpenCode, Gemini, Codex, Copilot,\n' +
|
|
@@ -299,7 +299,7 @@ if (hasUninstall) {
|
|
|
299
299
|
|
|
300
300
|
// Show help if requested
|
|
301
301
|
if (hasHelp) {
|
|
302
|
-
console.log(` ${yellow}Usage:${reset} npx ez-agents [options]\n\n ${yellow}Options:${reset}\n ${cyan}-g, --global${reset} Install globally (to config directory)\n ${cyan}-l, --local${reset} Install locally (to current directory)\n ${cyan}--claude${reset} Install for Claude Code only\n ${cyan}--opencode${reset} Install for OpenCode only\n ${cyan}--gemini${reset} Install for Gemini only\n ${cyan}--codex${reset} Install for Codex only\n ${cyan}--copilot${reset} Install for Copilot only\n ${cyan}--all${reset} Install for all runtimes\n ${cyan}-u, --uninstall${reset} Uninstall
|
|
302
|
+
console.log(` ${yellow}Usage:${reset} npx ez-agents [options]\n\n ${yellow}Options:${reset}\n ${cyan}-g, --global${reset} Install globally (to config directory)\n ${cyan}-l, --local${reset} Install locally (to current directory)\n ${cyan}--claude${reset} Install for Claude Code only\n ${cyan}--opencode${reset} Install for OpenCode only\n ${cyan}--gemini${reset} Install for Gemini only\n ${cyan}--codex${reset} Install for Codex only\n ${cyan}--copilot${reset} Install for Copilot only\n ${cyan}--all${reset} Install for all runtimes\n ${cyan}-u, --uninstall${reset} Uninstall EZ_Agents (remove all EZ_Agents files)\n ${cyan}-c, --config-dir <path>${reset} Specify custom config directory\n ${cyan}-h, --help${reset} Show this help message\n ${cyan}--force-statusline${reset} Replace existing statusline config\n\n ${yellow}Examples:${reset}\n ${dim}# Interactive install (prompts for runtime and location)${reset}\n npx ez-agents\n\n ${dim}# Install for Claude Code globally${reset}\n npx ez-agents --claude --global\n\n ${dim}# Install for all runtimes globally${reset}\n npx ez-agents --all --global\n\n ${dim}# Uninstall EZ_Agents globally${reset}\n npx ez-agents --all --global --uninstall\n\n ${yellow}Notes:${reset}\n The --config-dir option is useful when you have multiple configurations.\n It takes priority over CLAUDE_CONFIG_DIR / GEMINI_CONFIG_DIR / CODEX_HOME / COPILOT_CONFIG_DIR environment variables.\n`);
|
|
303
303
|
process.exit(0);
|
|
304
304
|
}
|
|
305
305
|
|
|
@@ -666,7 +666,7 @@ function getCodexSkillAdapterHeader(skillName) {
|
|
|
666
666
|
- If no arguments are present, treat \`{{EZ_ARGS}}\` as empty.
|
|
667
667
|
|
|
668
668
|
## B. AskUserQuestion → request_user_input Mapping
|
|
669
|
-
|
|
669
|
+
EZ_Agents workflows use \`AskUserQuestion\` (Claude Code syntax). Translate to Codex \`request_user_input\`:
|
|
670
670
|
|
|
671
671
|
Parameter mapping:
|
|
672
672
|
- \`header\` → \`header\`
|
|
@@ -684,12 +684,12 @@ Execute mode fallback:
|
|
|
684
684
|
- When \`request_user_input\` is rejected (Execute mode), present a plain-text numbered list and pick a reasonable default.
|
|
685
685
|
|
|
686
686
|
## C. Task() → spawn_agent Mapping
|
|
687
|
-
|
|
687
|
+
EZ_Agents workflows use \`Task(...)\` (Claude Code syntax). Translate to Codex collaboration tools:
|
|
688
688
|
|
|
689
689
|
Direct mapping:
|
|
690
690
|
- \`Task(subagent_type="X", prompt="Y")\` → \`spawn_agent(agent_type="X", message="Y")\`
|
|
691
691
|
- \`Task(model="...")\` → omit (Codex uses per-role config, not inline model selection)
|
|
692
|
-
- \`fork_context: false\` by default —
|
|
692
|
+
- \`fork_context: false\` by default — EZ_Agents agents load their own context via \`<files_to_read>\` blocks
|
|
693
693
|
|
|
694
694
|
Parallel fan-out:
|
|
695
695
|
- Spawn multiple agents → collect agent IDs → \`wait(ids)\` for all to complete
|
|
@@ -703,7 +703,7 @@ Result parsing:
|
|
|
703
703
|
function convertClaudeCommandToCodexSkill(content, skillName) {
|
|
704
704
|
const converted = convertClaudeToCodexMarkdown(content);
|
|
705
705
|
const { frontmatter, body } = extractFrontmatterAndBody(converted);
|
|
706
|
-
let description = `Run
|
|
706
|
+
let description = `Run EZ_Agents workflow ${skillName}.`;
|
|
707
707
|
if (frontmatter) {
|
|
708
708
|
const maybeDescription = extractFrontmatterField(frontmatter, 'description');
|
|
709
709
|
if (maybeDescription) {
|
|
@@ -764,7 +764,7 @@ function generateCodexAgentToml(agentName, agentContent) {
|
|
|
764
764
|
}
|
|
765
765
|
|
|
766
766
|
/**
|
|
767
|
-
* Generate the
|
|
767
|
+
* Generate the EZ_Agents config block for Codex config.toml.
|
|
768
768
|
* @param {Array<{name: string, description: string}>} agents
|
|
769
769
|
*/
|
|
770
770
|
function generateCodexConfigBlock(agents) {
|
|
@@ -784,16 +784,16 @@ function generateCodexConfigBlock(agents) {
|
|
|
784
784
|
}
|
|
785
785
|
|
|
786
786
|
/**
|
|
787
|
-
* Strip
|
|
787
|
+
* Strip EZ_Agents sections from Codex config.toml content.
|
|
788
788
|
* Returns cleaned content, or null if file would be empty.
|
|
789
789
|
*/
|
|
790
|
-
function
|
|
790
|
+
function stripEzAgentsFromCodexConfig(content) {
|
|
791
791
|
const markerIndex = content.indexOf(EZ_CODEX_MARKER);
|
|
792
792
|
|
|
793
793
|
if (markerIndex !== -1) {
|
|
794
|
-
// Has
|
|
794
|
+
// Has EZ_Agents marker — remove everything from marker to EOF
|
|
795
795
|
let before = content.substring(0, markerIndex).trimEnd();
|
|
796
|
-
// Also strip EZ
|
|
796
|
+
// Also strip EZ-injected feature keys above the marker (Case 3 inject)
|
|
797
797
|
before = before.replace(/^multi_agent\s*=\s*true\s*\n?/m, '');
|
|
798
798
|
before = before.replace(/^default_mode_request_user_input\s*=\s*true\s*\n?/m, '');
|
|
799
799
|
before = before.replace(/^\[features\]\s*\n(?=\[|$)/m, '');
|
|
@@ -802,7 +802,7 @@ function stripGsdFromCodexConfig(content) {
|
|
|
802
802
|
return before + '\n';
|
|
803
803
|
}
|
|
804
804
|
|
|
805
|
-
// No marker but may have EZ
|
|
805
|
+
// No marker but may have EZ-injected feature keys
|
|
806
806
|
let cleaned = content;
|
|
807
807
|
cleaned = cleaned.replace(/^multi_agent\s*=\s*true\s*\n?/m, '');
|
|
808
808
|
cleaned = cleaned.replace(/^default_mode_request_user_input\s*=\s*true\s*\n?/m, '');
|
|
@@ -824,56 +824,56 @@ function stripGsdFromCodexConfig(content) {
|
|
|
824
824
|
}
|
|
825
825
|
|
|
826
826
|
/**
|
|
827
|
-
* Merge
|
|
828
|
-
* Three cases: new file, existing with
|
|
827
|
+
* Merge EZ_Agents config block into an existing or new config.toml.
|
|
828
|
+
* Three cases: new file, existing with EZ_Agents marker, existing without marker.
|
|
829
829
|
*/
|
|
830
|
-
function mergeCodexConfig(configPath,
|
|
830
|
+
function mergeCodexConfig(configPath, EZ_AgentsBlock) {
|
|
831
831
|
// Case 1: No config.toml — create fresh
|
|
832
832
|
if (!fs.existsSync(configPath)) {
|
|
833
|
-
fs.writeFileSync(configPath,
|
|
833
|
+
fs.writeFileSync(configPath, EZ_AgentsBlock + '\n');
|
|
834
834
|
return;
|
|
835
835
|
}
|
|
836
836
|
|
|
837
837
|
const existing = fs.readFileSync(configPath, 'utf8');
|
|
838
838
|
const markerIndex = existing.indexOf(EZ_CODEX_MARKER);
|
|
839
839
|
|
|
840
|
-
// Case 2: Has
|
|
840
|
+
// Case 2: Has EZ_Agents marker — truncate and re-append
|
|
841
841
|
if (markerIndex !== -1) {
|
|
842
842
|
let before = existing.substring(0, markerIndex).trimEnd();
|
|
843
843
|
if (before) {
|
|
844
|
-
// Strip any EZ
|
|
844
|
+
// Strip any EZ-managed sections that leaked above the marker from previous installs
|
|
845
845
|
before = before.replace(/^\[agents\.ez-[^\]]+\]\n(?:(?!\[)[^\n]*\n?)*/gm, '');
|
|
846
846
|
before = before.replace(/^\[agents\]\n(?:(?!\[)[^\n]*\n?)*/m, '');
|
|
847
847
|
before = before.replace(/\n{3,}/g, '\n\n').trimEnd();
|
|
848
848
|
|
|
849
|
-
fs.writeFileSync(configPath, before + '\n\n' +
|
|
849
|
+
fs.writeFileSync(configPath, before + '\n\n' + EZ_AgentsBlock + '\n');
|
|
850
850
|
} else {
|
|
851
|
-
fs.writeFileSync(configPath,
|
|
851
|
+
fs.writeFileSync(configPath, EZ_AgentsBlock + '\n');
|
|
852
852
|
}
|
|
853
853
|
return;
|
|
854
854
|
}
|
|
855
855
|
|
|
856
|
-
// Case 3: No marker — append
|
|
856
|
+
// Case 3: No marker — append EZ_Agents block
|
|
857
857
|
let content = existing;
|
|
858
|
-
content = content.trimEnd() + '\n\n' +
|
|
858
|
+
content = content.trimEnd() + '\n\n' + EZ_AgentsBlock + '\n';
|
|
859
859
|
|
|
860
860
|
fs.writeFileSync(configPath, content);
|
|
861
861
|
}
|
|
862
862
|
|
|
863
863
|
/**
|
|
864
|
-
* Merge
|
|
864
|
+
* Merge EZ_Agents instructions into copilot-instructions.md.
|
|
865
865
|
* Three cases: new file, existing with markers, existing without markers.
|
|
866
866
|
* @param {string} filePath - Full path to copilot-instructions.md
|
|
867
|
-
* @param {string}
|
|
867
|
+
* @param {string} EZ_AgentsContent - Template content (without markers)
|
|
868
868
|
*/
|
|
869
|
-
function mergeCopilotInstructions(filePath,
|
|
870
|
-
const
|
|
871
|
-
|
|
869
|
+
function mergeCopilotInstructions(filePath, EZ_AgentsContent) {
|
|
870
|
+
const EZ_AgentsBlock = EZ_COPILOT_INSTRUCTIONS_MARKER + '\n' +
|
|
871
|
+
EZ_AgentsContent.trim() + '\n' +
|
|
872
872
|
EZ_COPILOT_INSTRUCTIONS_CLOSE_MARKER;
|
|
873
873
|
|
|
874
874
|
// Case 1: No file — create fresh
|
|
875
875
|
if (!fs.existsSync(filePath)) {
|
|
876
|
-
fs.writeFileSync(filePath,
|
|
876
|
+
fs.writeFileSync(filePath, EZ_AgentsBlock + '\n');
|
|
877
877
|
return;
|
|
878
878
|
}
|
|
879
879
|
|
|
@@ -881,13 +881,13 @@ function mergeCopilotInstructions(filePath, gsdContent) {
|
|
|
881
881
|
const openIndex = existing.indexOf(EZ_COPILOT_INSTRUCTIONS_MARKER);
|
|
882
882
|
const closeIndex = existing.indexOf(EZ_COPILOT_INSTRUCTIONS_CLOSE_MARKER);
|
|
883
883
|
|
|
884
|
-
// Case 2: Has
|
|
884
|
+
// Case 2: Has EZ_Agents markers — replace between markers
|
|
885
885
|
if (openIndex !== -1 && closeIndex !== -1) {
|
|
886
886
|
const before = existing.substring(0, openIndex).trimEnd();
|
|
887
887
|
const after = existing.substring(closeIndex + EZ_COPILOT_INSTRUCTIONS_CLOSE_MARKER.length).trimStart();
|
|
888
888
|
let newContent = '';
|
|
889
889
|
if (before) newContent += before + '\n\n';
|
|
890
|
-
newContent +=
|
|
890
|
+
newContent += EZ_AgentsBlock;
|
|
891
891
|
if (after) newContent += '\n\n' + after;
|
|
892
892
|
newContent += '\n';
|
|
893
893
|
fs.writeFileSync(filePath, newContent);
|
|
@@ -895,17 +895,17 @@ function mergeCopilotInstructions(filePath, gsdContent) {
|
|
|
895
895
|
}
|
|
896
896
|
|
|
897
897
|
// Case 3: No markers — append at end
|
|
898
|
-
const content = existing.trimEnd() + '\n\n' +
|
|
898
|
+
const content = existing.trimEnd() + '\n\n' + EZ_AgentsBlock + '\n';
|
|
899
899
|
fs.writeFileSync(filePath, content);
|
|
900
900
|
}
|
|
901
901
|
|
|
902
902
|
/**
|
|
903
|
-
* Strip
|
|
904
|
-
* Returns cleaned content, or null if file should be deleted (was
|
|
903
|
+
* Strip EZ_Agents section from copilot-instructions.md content.
|
|
904
|
+
* Returns cleaned content, or null if file should be deleted (was EZ-only).
|
|
905
905
|
* @param {string} content - File content
|
|
906
906
|
* @returns {string|null} - Cleaned content or null if empty
|
|
907
907
|
*/
|
|
908
|
-
function
|
|
908
|
+
function stripEzAgentsFromCopilotInstructions(content) {
|
|
909
909
|
const openIndex = content.indexOf(EZ_COPILOT_INSTRUCTIONS_MARKER);
|
|
910
910
|
const closeIndex = content.indexOf(EZ_COPILOT_INSTRUCTIONS_CLOSE_MARKER);
|
|
911
911
|
|
|
@@ -930,7 +930,7 @@ function installCodexConfig(targetDir, agentsSrc) {
|
|
|
930
930
|
const agentsTomlDir = path.join(targetDir, 'agents');
|
|
931
931
|
fs.mkdirSync(agentsTomlDir, { recursive: true });
|
|
932
932
|
|
|
933
|
-
const agentEntries = fs.readdirSync(agentsSrc).filter(f => f.startsWith('
|
|
933
|
+
const agentEntries = fs.readdirSync(agentsSrc).filter(f => f.startsWith('EZ-') && f.endsWith('.md'));
|
|
934
934
|
const agents = [];
|
|
935
935
|
|
|
936
936
|
// Compute the Codex pathPrefix for replacing .claude paths
|
|
@@ -952,8 +952,8 @@ function installCodexConfig(targetDir, agentsSrc) {
|
|
|
952
952
|
fs.writeFileSync(path.join(agentsTomlDir, `${name}.toml`), tomlContent);
|
|
953
953
|
}
|
|
954
954
|
|
|
955
|
-
const
|
|
956
|
-
mergeCodexConfig(configPath,
|
|
955
|
+
const EZ_AgentsBlock = generateCodexConfigBlock(agents);
|
|
956
|
+
mergeCodexConfig(configPath, EZ_AgentsBlock);
|
|
957
957
|
|
|
958
958
|
return agents.length;
|
|
959
959
|
}
|
|
@@ -1062,7 +1062,7 @@ function convertClaudeToGeminiAgent(content) {
|
|
|
1062
1062
|
// Escape ${VAR} patterns in agent body for Gemini CLI compatibility.
|
|
1063
1063
|
// Gemini's templateString() treats all ${word} patterns as template variables
|
|
1064
1064
|
// and throws "Template validation failed: Missing required input parameters"
|
|
1065
|
-
// when they can't be resolved.
|
|
1065
|
+
// when they can't be resolved. EZ_Agents agents use ${PHASE}, ${PLAN}, etc. as
|
|
1066
1066
|
// shell variables in bash code blocks — convert to $VAR (no braces) which
|
|
1067
1067
|
// is equivalent bash and invisible to Gemini's /\$\{(\w+)\}/g regex.
|
|
1068
1068
|
const escapedBody = body.replace(/\$\{(\w+)\}/g, '$$$1');
|
|
@@ -1220,12 +1220,12 @@ function convertClaudeToGeminiToml(content) {
|
|
|
1220
1220
|
|
|
1221
1221
|
/**
|
|
1222
1222
|
* Copy commands to a flat structure for OpenCode
|
|
1223
|
-
* OpenCode expects: command/
|
|
1224
|
-
* Source structure: commands/
|
|
1225
|
-
*
|
|
1226
|
-
* @param {string} srcDir - Source directory (e.g., commands/
|
|
1223
|
+
* OpenCode expects: command/ez-help.md (invoked as /ez-help)
|
|
1224
|
+
* Source structure: commands/ez/help.md
|
|
1225
|
+
*
|
|
1226
|
+
* @param {string} srcDir - Source directory (e.g., commands/ez/)
|
|
1227
1227
|
* @param {string} destDir - Destination directory (e.g., command/)
|
|
1228
|
-
* @param {string} prefix - Prefix for filenames (e.g., '
|
|
1228
|
+
* @param {string} prefix - Prefix for filenames (e.g., 'ez')
|
|
1229
1229
|
* @param {string} pathPrefix - Path prefix for file references
|
|
1230
1230
|
* @param {string} runtime - Target runtime ('claude' or 'opencode')
|
|
1231
1231
|
*/
|
|
@@ -1233,8 +1233,8 @@ function copyFlattenedCommands(srcDir, destDir, prefix, pathPrefix, runtime) {
|
|
|
1233
1233
|
if (!fs.existsSync(srcDir)) {
|
|
1234
1234
|
return;
|
|
1235
1235
|
}
|
|
1236
|
-
|
|
1237
|
-
// Remove old
|
|
1236
|
+
|
|
1237
|
+
// Remove old ez-*.md files before copying new ones
|
|
1238
1238
|
if (fs.existsSync(destDir)) {
|
|
1239
1239
|
for (const file of fs.readdirSync(destDir)) {
|
|
1240
1240
|
if (file.startsWith(`${prefix}-`) && file.endsWith('.md')) {
|
|
@@ -1244,18 +1244,18 @@ function copyFlattenedCommands(srcDir, destDir, prefix, pathPrefix, runtime) {
|
|
|
1244
1244
|
} else {
|
|
1245
1245
|
fs.mkdirSync(destDir, { recursive: true });
|
|
1246
1246
|
}
|
|
1247
|
-
|
|
1247
|
+
|
|
1248
1248
|
const entries = fs.readdirSync(srcDir, { withFileTypes: true });
|
|
1249
|
-
|
|
1249
|
+
|
|
1250
1250
|
for (const entry of entries) {
|
|
1251
1251
|
const srcPath = path.join(srcDir, entry.name);
|
|
1252
|
-
|
|
1252
|
+
|
|
1253
1253
|
if (entry.isDirectory()) {
|
|
1254
1254
|
// Recurse into subdirectories, adding to prefix
|
|
1255
|
-
// e.g., commands/
|
|
1255
|
+
// e.g., commands/ez/debug/start.md -> command/ez-debug-start.md
|
|
1256
1256
|
copyFlattenedCommands(srcPath, destDir, `${prefix}-${entry.name}`, pathPrefix, runtime);
|
|
1257
1257
|
} else if (entry.name.endsWith('.md')) {
|
|
1258
|
-
// Flatten: help.md ->
|
|
1258
|
+
// Flatten: help.md -> ez-help.md
|
|
1259
1259
|
const baseName = entry.name.replace('.md', '');
|
|
1260
1260
|
const destName = `${prefix}-${baseName}.md`;
|
|
1261
1261
|
const destPath = path.join(destDir, destName);
|
|
@@ -1277,7 +1277,7 @@ function copyFlattenedCommands(srcDir, destDir, prefix, pathPrefix, runtime) {
|
|
|
1277
1277
|
}
|
|
1278
1278
|
}
|
|
1279
1279
|
|
|
1280
|
-
function listCodexSkillNames(skillsDir, prefix = '
|
|
1280
|
+
function listCodexSkillNames(skillsDir, prefix = 'ez-') {
|
|
1281
1281
|
if (!fs.existsSync(skillsDir)) return [];
|
|
1282
1282
|
const entries = fs.readdirSync(skillsDir, { withFileTypes: true });
|
|
1283
1283
|
return entries
|
|
@@ -1294,7 +1294,7 @@ function copyCommandsAsCodexSkills(srcDir, skillsDir, prefix, pathPrefix, runtim
|
|
|
1294
1294
|
|
|
1295
1295
|
fs.mkdirSync(skillsDir, { recursive: true });
|
|
1296
1296
|
|
|
1297
|
-
// Remove previous
|
|
1297
|
+
// Remove previous EZ Codex skills to avoid stale command skills.
|
|
1298
1298
|
const existing = fs.readdirSync(skillsDir, { withFileTypes: true });
|
|
1299
1299
|
for (const entry of existing) {
|
|
1300
1300
|
if (entry.isDirectory() && entry.name.startsWith(`${prefix}-`)) {
|
|
@@ -1351,7 +1351,7 @@ function copyCommandsAsCopilotSkills(srcDir, skillsDir, prefix, isGlobal = false
|
|
|
1351
1351
|
|
|
1352
1352
|
fs.mkdirSync(skillsDir, { recursive: true });
|
|
1353
1353
|
|
|
1354
|
-
// Remove previous
|
|
1354
|
+
// Remove previous EZ Copilot skills
|
|
1355
1355
|
const existing = fs.readdirSync(skillsDir, { withFileTypes: true });
|
|
1356
1356
|
for (const entry of existing) {
|
|
1357
1357
|
if (entry.isDirectory() && entry.name.startsWith(`${prefix}-`)) {
|
|
@@ -1468,12 +1468,12 @@ function copyWithPathReplacement(srcDir, destDir, pathPrefix, runtime, isCommand
|
|
|
1468
1468
|
}
|
|
1469
1469
|
|
|
1470
1470
|
/**
|
|
1471
|
-
* Clean up orphaned files from previous
|
|
1471
|
+
* Clean up orphaned files from previous versions
|
|
1472
1472
|
*/
|
|
1473
1473
|
function cleanupOrphanedFiles(configDir) {
|
|
1474
1474
|
const orphanedFiles = [
|
|
1475
|
-
'hooks/
|
|
1476
|
-
'hooks/statusline.js', // Renamed to
|
|
1475
|
+
'hooks/ez-notify.sh', // Removed in v1.6.x
|
|
1476
|
+
'hooks/statusline.js', // Renamed to ez-statusline.js in v1.9.0
|
|
1477
1477
|
];
|
|
1478
1478
|
|
|
1479
1479
|
for (const relPath of orphanedFiles) {
|
|
@@ -1490,11 +1490,11 @@ function cleanupOrphanedFiles(configDir) {
|
|
|
1490
1490
|
*/
|
|
1491
1491
|
function cleanupOrphanedHooks(settings) {
|
|
1492
1492
|
const orphanedHookPatterns = [
|
|
1493
|
-
'
|
|
1494
|
-
'hooks/statusline.js', // Renamed to
|
|
1495
|
-
'
|
|
1496
|
-
'
|
|
1497
|
-
'
|
|
1493
|
+
'ez-notify.sh', // Removed in v1.6.x
|
|
1494
|
+
'hooks/statusline.js', // Renamed to ez-statusline.js in v1.9.0
|
|
1495
|
+
'ez-intel-index.js', // Removed in v1.9.2
|
|
1496
|
+
'ez-intel-session.js', // Removed in v1.9.2
|
|
1497
|
+
'ez-intel-prune.js', // Removed in v1.9.2
|
|
1498
1498
|
];
|
|
1499
1499
|
|
|
1500
1500
|
let cleanedHooks = false;
|
|
@@ -1527,24 +1527,24 @@ function cleanupOrphanedHooks(settings) {
|
|
|
1527
1527
|
console.log(` ${green}✓${reset} Removed orphaned hook registrations`);
|
|
1528
1528
|
}
|
|
1529
1529
|
|
|
1530
|
-
// Fix #330: Update statusLine if it points to old
|
|
1531
|
-
// Only match the specific old
|
|
1530
|
+
// Fix #330: Update statusLine if it points to old statusline.js path
|
|
1531
|
+
// Only match the specific old path pattern (hooks/statusline.js),
|
|
1532
1532
|
// not third-party statusline scripts that happen to contain 'statusline.js'
|
|
1533
1533
|
if (settings.statusLine && settings.statusLine.command &&
|
|
1534
1534
|
/hooks[\/\\]statusline\.js/.test(settings.statusLine.command)) {
|
|
1535
1535
|
settings.statusLine.command = settings.statusLine.command.replace(
|
|
1536
1536
|
/hooks([\/\\])statusline\.js/,
|
|
1537
|
-
'hooks$
|
|
1537
|
+
'hooks$1ez-statusline.js'
|
|
1538
1538
|
);
|
|
1539
|
-
console.log(` ${green}✓${reset} Updated statusline path (hooks/statusline.js → hooks/
|
|
1539
|
+
console.log(` ${green}✓${reset} Updated statusline path (hooks/statusline.js → hooks/ez-statusline.js)`);
|
|
1540
1540
|
}
|
|
1541
1541
|
|
|
1542
1542
|
return settings;
|
|
1543
1543
|
}
|
|
1544
1544
|
|
|
1545
1545
|
/**
|
|
1546
|
-
* Uninstall
|
|
1547
|
-
* Removes only EZ
|
|
1546
|
+
* Uninstall EZ_Agents from the specified directory for a specific runtime
|
|
1547
|
+
* Removes only EZ-specific files/directories, preserves user content
|
|
1548
1548
|
* @param {boolean} isGlobal - Whether to uninstall from global or local
|
|
1549
1549
|
* @param {string} runtime - Target runtime ('claude', 'opencode', 'gemini', 'codex', 'copilot')
|
|
1550
1550
|
*/
|
|
@@ -1569,7 +1569,7 @@ function uninstall(isGlobal, runtime = 'claude') {
|
|
|
1569
1569
|
if (runtime === 'codex') runtimeLabel = 'Codex';
|
|
1570
1570
|
if (runtime === 'copilot') runtimeLabel = 'Copilot';
|
|
1571
1571
|
|
|
1572
|
-
console.log(` Uninstalling
|
|
1572
|
+
console.log(` Uninstalling EZ_Agents from ${cyan}${runtimeLabel}${reset} at ${cyan}${locationLabel}${reset}\n`);
|
|
1573
1573
|
|
|
1574
1574
|
// Check if target directory exists
|
|
1575
1575
|
if (!fs.existsSync(targetDir)) {
|
|
@@ -1580,28 +1580,28 @@ function uninstall(isGlobal, runtime = 'claude') {
|
|
|
1580
1580
|
|
|
1581
1581
|
let removedCount = 0;
|
|
1582
1582
|
|
|
1583
|
-
// 1. Remove
|
|
1583
|
+
// 1. Remove EZ commands/skills
|
|
1584
1584
|
if (isOpencode) {
|
|
1585
|
-
// OpenCode: remove command/
|
|
1585
|
+
// OpenCode: remove command/ez-*.md files
|
|
1586
1586
|
const commandDir = path.join(targetDir, 'command');
|
|
1587
1587
|
if (fs.existsSync(commandDir)) {
|
|
1588
1588
|
const files = fs.readdirSync(commandDir);
|
|
1589
1589
|
for (const file of files) {
|
|
1590
|
-
if (file.startsWith('
|
|
1590
|
+
if (file.startsWith('ez-') && file.endsWith('.md')) {
|
|
1591
1591
|
fs.unlinkSync(path.join(commandDir, file));
|
|
1592
1592
|
removedCount++;
|
|
1593
1593
|
}
|
|
1594
1594
|
}
|
|
1595
|
-
console.log(` ${green}✓${reset} Removed
|
|
1595
|
+
console.log(` ${green}✓${reset} Removed EZ_Agents commands from command/`);
|
|
1596
1596
|
}
|
|
1597
1597
|
} else if (isCodex) {
|
|
1598
|
-
// Codex: remove skills/
|
|
1598
|
+
// Codex: remove skills/ez-*/SKILL.md skill directories
|
|
1599
1599
|
const skillsDir = path.join(targetDir, 'skills');
|
|
1600
1600
|
if (fs.existsSync(skillsDir)) {
|
|
1601
1601
|
let skillCount = 0;
|
|
1602
1602
|
const entries = fs.readdirSync(skillsDir, { withFileTypes: true });
|
|
1603
1603
|
for (const entry of entries) {
|
|
1604
|
-
if (entry.isDirectory() && entry.name.startsWith('
|
|
1604
|
+
if (entry.isDirectory() && entry.name.startsWith('ez-')) {
|
|
1605
1605
|
fs.rmSync(path.join(skillsDir, entry.name), { recursive: true });
|
|
1606
1606
|
skillCount++;
|
|
1607
1607
|
}
|
|
@@ -1612,13 +1612,13 @@ function uninstall(isGlobal, runtime = 'claude') {
|
|
|
1612
1612
|
}
|
|
1613
1613
|
}
|
|
1614
1614
|
|
|
1615
|
-
// Codex: remove
|
|
1615
|
+
// Codex: remove EZ agent .toml config files
|
|
1616
1616
|
const codexAgentsDir = path.join(targetDir, 'agents');
|
|
1617
1617
|
if (fs.existsSync(codexAgentsDir)) {
|
|
1618
1618
|
const tomlFiles = fs.readdirSync(codexAgentsDir);
|
|
1619
1619
|
let tomlCount = 0;
|
|
1620
1620
|
for (const file of tomlFiles) {
|
|
1621
|
-
if (file.startsWith('
|
|
1621
|
+
if (file.startsWith('ez-') && file.endsWith('.toml')) {
|
|
1622
1622
|
fs.unlinkSync(path.join(codexAgentsDir, file));
|
|
1623
1623
|
tomlCount++;
|
|
1624
1624
|
}
|
|
@@ -1629,30 +1629,30 @@ function uninstall(isGlobal, runtime = 'claude') {
|
|
|
1629
1629
|
}
|
|
1630
1630
|
}
|
|
1631
1631
|
|
|
1632
|
-
// Codex: clean
|
|
1632
|
+
// Codex: clean EZ sections from config.toml
|
|
1633
1633
|
const configPath = path.join(targetDir, 'config.toml');
|
|
1634
1634
|
if (fs.existsSync(configPath)) {
|
|
1635
1635
|
const content = fs.readFileSync(configPath, 'utf8');
|
|
1636
|
-
const cleaned =
|
|
1636
|
+
const cleaned = stripEzAgentsFromCodexConfig(content);
|
|
1637
1637
|
if (cleaned === null) {
|
|
1638
1638
|
// File is empty after stripping — delete it
|
|
1639
1639
|
fs.unlinkSync(configPath);
|
|
1640
1640
|
removedCount++;
|
|
1641
|
-
console.log(` ${green}✓${reset} Removed config.toml (was EZ
|
|
1641
|
+
console.log(` ${green}✓${reset} Removed config.toml (was EZ-only)`);
|
|
1642
1642
|
} else if (cleaned !== content) {
|
|
1643
1643
|
fs.writeFileSync(configPath, cleaned);
|
|
1644
1644
|
removedCount++;
|
|
1645
|
-
console.log(` ${green}✓${reset} Cleaned
|
|
1645
|
+
console.log(` ${green}✓${reset} Cleaned EZ_Agents sections from config.toml`);
|
|
1646
1646
|
}
|
|
1647
1647
|
}
|
|
1648
1648
|
} else if (isCopilot) {
|
|
1649
|
-
// Copilot: remove skills/
|
|
1649
|
+
// Copilot: remove skills/ez-*/ directories (same layout as Codex skills)
|
|
1650
1650
|
const skillsDir = path.join(targetDir, 'skills');
|
|
1651
1651
|
if (fs.existsSync(skillsDir)) {
|
|
1652
1652
|
let skillCount = 0;
|
|
1653
1653
|
const entries = fs.readdirSync(skillsDir, { withFileTypes: true });
|
|
1654
1654
|
for (const entry of entries) {
|
|
1655
|
-
if (entry.isDirectory() && entry.name.startsWith('
|
|
1655
|
+
if (entry.isDirectory() && entry.name.startsWith('ez-')) {
|
|
1656
1656
|
fs.rmSync(path.join(skillsDir, entry.name), { recursive: true });
|
|
1657
1657
|
skillCount++;
|
|
1658
1658
|
}
|
|
@@ -1663,61 +1663,61 @@ function uninstall(isGlobal, runtime = 'claude') {
|
|
|
1663
1663
|
}
|
|
1664
1664
|
}
|
|
1665
1665
|
|
|
1666
|
-
// Copilot: clean
|
|
1666
|
+
// Copilot: clean EZ section from copilot-instructions.md
|
|
1667
1667
|
const instructionsPath = path.join(targetDir, 'copilot-instructions.md');
|
|
1668
1668
|
if (fs.existsSync(instructionsPath)) {
|
|
1669
1669
|
const content = fs.readFileSync(instructionsPath, 'utf8');
|
|
1670
|
-
const cleaned =
|
|
1670
|
+
const cleaned = stripEzAgentsFromCopilotInstructions(content);
|
|
1671
1671
|
if (cleaned === null) {
|
|
1672
1672
|
fs.unlinkSync(instructionsPath);
|
|
1673
1673
|
removedCount++;
|
|
1674
|
-
console.log(` ${green}✓${reset} Removed copilot-instructions.md (was EZ
|
|
1674
|
+
console.log(` ${green}✓${reset} Removed copilot-instructions.md (was EZ-only)`);
|
|
1675
1675
|
} else if (cleaned !== content) {
|
|
1676
1676
|
fs.writeFileSync(instructionsPath, cleaned);
|
|
1677
1677
|
removedCount++;
|
|
1678
|
-
console.log(` ${green}✓${reset} Cleaned
|
|
1678
|
+
console.log(` ${green}✓${reset} Cleaned EZ_Agents section from copilot-instructions.md`);
|
|
1679
1679
|
}
|
|
1680
1680
|
}
|
|
1681
1681
|
} else {
|
|
1682
|
-
const
|
|
1683
|
-
if (fs.existsSync(
|
|
1684
|
-
fs.rmSync(
|
|
1682
|
+
const ezCommandsDir = path.join(targetDir, 'commands', 'ez');
|
|
1683
|
+
if (fs.existsSync(ezCommandsDir)) {
|
|
1684
|
+
fs.rmSync(ezCommandsDir, { recursive: true });
|
|
1685
1685
|
removedCount++;
|
|
1686
|
-
console.log(` ${green}✓${reset} Removed commands/
|
|
1686
|
+
console.log(` ${green}✓${reset} Removed commands/ez/`);
|
|
1687
1687
|
}
|
|
1688
1688
|
}
|
|
1689
1689
|
|
|
1690
|
-
// 2. Remove
|
|
1691
|
-
const
|
|
1692
|
-
if (fs.existsSync(
|
|
1693
|
-
fs.rmSync(
|
|
1690
|
+
// 2. Remove ez-agents directory
|
|
1691
|
+
const ezDir = path.join(targetDir, 'ez-agents');
|
|
1692
|
+
if (fs.existsSync(ezDir)) {
|
|
1693
|
+
fs.rmSync(ezDir, { recursive: true });
|
|
1694
1694
|
removedCount++;
|
|
1695
|
-
console.log(` ${green}✓${reset} Removed
|
|
1695
|
+
console.log(` ${green}✓${reset} Removed ez-agents/`);
|
|
1696
1696
|
}
|
|
1697
1697
|
|
|
1698
|
-
// 3. Remove
|
|
1698
|
+
// 3. Remove EZ_Agents agents (ez-*.md files only)
|
|
1699
1699
|
const agentsDir = path.join(targetDir, 'agents');
|
|
1700
1700
|
if (fs.existsSync(agentsDir)) {
|
|
1701
1701
|
const files = fs.readdirSync(agentsDir);
|
|
1702
1702
|
let agentCount = 0;
|
|
1703
1703
|
for (const file of files) {
|
|
1704
|
-
if (file.startsWith('
|
|
1704
|
+
if (file.startsWith('ez-') && file.endsWith('.md')) {
|
|
1705
1705
|
fs.unlinkSync(path.join(agentsDir, file));
|
|
1706
1706
|
agentCount++;
|
|
1707
1707
|
}
|
|
1708
1708
|
}
|
|
1709
1709
|
if (agentCount > 0) {
|
|
1710
1710
|
removedCount++;
|
|
1711
|
-
console.log(` ${green}✓${reset} Removed ${agentCount}
|
|
1711
|
+
console.log(` ${green}✓${reset} Removed ${agentCount} EZ_Agents agents`);
|
|
1712
1712
|
}
|
|
1713
1713
|
}
|
|
1714
1714
|
|
|
1715
|
-
// 4. Remove
|
|
1715
|
+
// 4. Remove EZ hooks
|
|
1716
1716
|
const hooksDir = path.join(targetDir, 'hooks');
|
|
1717
1717
|
if (fs.existsSync(hooksDir)) {
|
|
1718
|
-
const
|
|
1718
|
+
const ezHooks = ['ez-statusline.js', 'ez-check-update.js', 'ez-check-update.sh', 'ez-context-monitor.js'];
|
|
1719
1719
|
let hookCount = 0;
|
|
1720
|
-
for (const hook of
|
|
1720
|
+
for (const hook of ezHooks) {
|
|
1721
1721
|
const hookPath = path.join(hooksDir, hook);
|
|
1722
1722
|
if (fs.existsSync(hookPath)) {
|
|
1723
1723
|
fs.unlinkSync(hookPath);
|
|
@@ -1726,11 +1726,11 @@ function uninstall(isGlobal, runtime = 'claude') {
|
|
|
1726
1726
|
}
|
|
1727
1727
|
if (hookCount > 0) {
|
|
1728
1728
|
removedCount++;
|
|
1729
|
-
console.log(` ${green}✓${reset} Removed ${hookCount}
|
|
1729
|
+
console.log(` ${green}✓${reset} Removed ${hookCount} EZ hooks`);
|
|
1730
1730
|
}
|
|
1731
1731
|
}
|
|
1732
1732
|
|
|
1733
|
-
// 5. Remove
|
|
1733
|
+
// 5. Remove EZ package.json (CommonJS mode marker)
|
|
1734
1734
|
const pkgJsonPath = path.join(targetDir, 'package.json');
|
|
1735
1735
|
if (fs.existsSync(pkgJsonPath)) {
|
|
1736
1736
|
try {
|
|
@@ -1739,43 +1739,43 @@ function uninstall(isGlobal, runtime = 'claude') {
|
|
|
1739
1739
|
if (content === '{"type":"commonjs"}') {
|
|
1740
1740
|
fs.unlinkSync(pkgJsonPath);
|
|
1741
1741
|
removedCount++;
|
|
1742
|
-
console.log(` ${green}✓${reset} Removed
|
|
1742
|
+
console.log(` ${green}✓${reset} Removed EZ package.json`);
|
|
1743
1743
|
}
|
|
1744
1744
|
} catch (e) {
|
|
1745
1745
|
// Ignore read errors
|
|
1746
1746
|
}
|
|
1747
1747
|
}
|
|
1748
1748
|
|
|
1749
|
-
// 6. Clean up settings.json (remove
|
|
1749
|
+
// 6. Clean up settings.json (remove EZ hooks and statusline)
|
|
1750
1750
|
const settingsPath = path.join(targetDir, 'settings.json');
|
|
1751
1751
|
if (fs.existsSync(settingsPath)) {
|
|
1752
1752
|
let settings = readSettings(settingsPath);
|
|
1753
1753
|
let settingsModified = false;
|
|
1754
1754
|
|
|
1755
|
-
// Remove
|
|
1755
|
+
// Remove EZ statusline if it references our hook
|
|
1756
1756
|
if (settings.statusLine && settings.statusLine.command &&
|
|
1757
|
-
settings.statusLine.command.includes('
|
|
1757
|
+
settings.statusLine.command.includes('ez-statusline')) {
|
|
1758
1758
|
delete settings.statusLine;
|
|
1759
1759
|
settingsModified = true;
|
|
1760
|
-
console.log(` ${green}✓${reset} Removed
|
|
1760
|
+
console.log(` ${green}✓${reset} Removed EZ statusline from settings`);
|
|
1761
1761
|
}
|
|
1762
1762
|
|
|
1763
|
-
// Remove
|
|
1763
|
+
// Remove EZ hooks from SessionStart
|
|
1764
1764
|
if (settings.hooks && settings.hooks.SessionStart) {
|
|
1765
1765
|
const before = settings.hooks.SessionStart.length;
|
|
1766
1766
|
settings.hooks.SessionStart = settings.hooks.SessionStart.filter(entry => {
|
|
1767
1767
|
if (entry.hooks && Array.isArray(entry.hooks)) {
|
|
1768
|
-
// Filter out
|
|
1769
|
-
const
|
|
1770
|
-
h.command && (h.command.includes('
|
|
1768
|
+
// Filter out EZ hooks
|
|
1769
|
+
const hasEzHook = entry.hooks.some(h =>
|
|
1770
|
+
h.command && (h.command.includes('ez-check-update') || h.command.includes('ez-statusline'))
|
|
1771
1771
|
);
|
|
1772
|
-
return !
|
|
1772
|
+
return !hasEzHook;
|
|
1773
1773
|
}
|
|
1774
1774
|
return true;
|
|
1775
1775
|
});
|
|
1776
1776
|
if (settings.hooks.SessionStart.length < before) {
|
|
1777
1777
|
settingsModified = true;
|
|
1778
|
-
console.log(` ${green}✓${reset} Removed
|
|
1778
|
+
console.log(` ${green}✓${reset} Removed EZ hooks from settings`);
|
|
1779
1779
|
}
|
|
1780
1780
|
// Clean up empty array
|
|
1781
1781
|
if (settings.hooks.SessionStart.length === 0) {
|
|
@@ -1783,16 +1783,16 @@ function uninstall(isGlobal, runtime = 'claude') {
|
|
|
1783
1783
|
}
|
|
1784
1784
|
}
|
|
1785
1785
|
|
|
1786
|
-
// Remove
|
|
1786
|
+
// Remove EZ hooks from PostToolUse and AfterTool (Gemini uses AfterTool)
|
|
1787
1787
|
for (const eventName of ['PostToolUse', 'AfterTool']) {
|
|
1788
1788
|
if (settings.hooks && settings.hooks[eventName]) {
|
|
1789
1789
|
const before = settings.hooks[eventName].length;
|
|
1790
1790
|
settings.hooks[eventName] = settings.hooks[eventName].filter(entry => {
|
|
1791
1791
|
if (entry.hooks && Array.isArray(entry.hooks)) {
|
|
1792
|
-
const
|
|
1793
|
-
h.command && h.command.includes('
|
|
1792
|
+
const hasEzHook = entry.hooks.some(h =>
|
|
1793
|
+
h.command && h.command.includes('ez-context-monitor')
|
|
1794
1794
|
);
|
|
1795
|
-
return !
|
|
1795
|
+
return !hasEzHook;
|
|
1796
1796
|
}
|
|
1797
1797
|
return true;
|
|
1798
1798
|
});
|
|
@@ -1830,13 +1830,13 @@ function uninstall(isGlobal, runtime = 'claude') {
|
|
|
1830
1830
|
const config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
|
|
1831
1831
|
let modified = false;
|
|
1832
1832
|
|
|
1833
|
-
// Remove
|
|
1833
|
+
// Remove EZ permission entries
|
|
1834
1834
|
if (config.permission) {
|
|
1835
1835
|
for (const permType of ['read', 'external_directory']) {
|
|
1836
1836
|
if (config.permission[permType]) {
|
|
1837
1837
|
const keys = Object.keys(config.permission[permType]);
|
|
1838
1838
|
for (const key of keys) {
|
|
1839
|
-
if (key.includes('
|
|
1839
|
+
if (key.includes('ez-agents')) {
|
|
1840
1840
|
delete config.permission[permType][key];
|
|
1841
1841
|
modified = true;
|
|
1842
1842
|
}
|
|
@@ -1855,7 +1855,7 @@ function uninstall(isGlobal, runtime = 'claude') {
|
|
|
1855
1855
|
if (modified) {
|
|
1856
1856
|
fs.writeFileSync(configPath, JSON.stringify(config, null, 2) + '\n');
|
|
1857
1857
|
removedCount++;
|
|
1858
|
-
console.log(` ${green}✓${reset} Removed
|
|
1858
|
+
console.log(` ${green}✓${reset} Removed EZ permissions from opencode.json`);
|
|
1859
1859
|
}
|
|
1860
1860
|
} catch (e) {
|
|
1861
1861
|
// Ignore JSON parse errors
|
|
@@ -1864,11 +1864,11 @@ function uninstall(isGlobal, runtime = 'claude') {
|
|
|
1864
1864
|
}
|
|
1865
1865
|
|
|
1866
1866
|
if (removedCount === 0) {
|
|
1867
|
-
console.log(` ${yellow}⚠${reset} No
|
|
1867
|
+
console.log(` ${yellow}⚠${reset} No EZ_Agents files found to remove.`);
|
|
1868
1868
|
}
|
|
1869
1869
|
|
|
1870
1870
|
console.log(`
|
|
1871
|
-
${green}Done!${reset}
|
|
1871
|
+
${green}Done!${reset} EZ_Agents has been uninstalled from ${runtimeLabel}.
|
|
1872
1872
|
Your other files and settings have been preserved.
|
|
1873
1873
|
`);
|
|
1874
1874
|
}
|
|
@@ -1935,8 +1935,8 @@ function parseJsonc(content) {
|
|
|
1935
1935
|
}
|
|
1936
1936
|
|
|
1937
1937
|
/**
|
|
1938
|
-
* Configure OpenCode permissions to allow reading
|
|
1939
|
-
* This prevents permission prompts when
|
|
1938
|
+
* Configure OpenCode permissions to allow reading EZ reference docs
|
|
1939
|
+
* This prevents permission prompts when EZ accesses the ez-agents directory
|
|
1940
1940
|
* @param {boolean} isGlobal - Whether this is a global or local install
|
|
1941
1941
|
*/
|
|
1942
1942
|
function configureOpencodePermissions(isGlobal = true) {
|
|
@@ -1970,21 +1970,21 @@ function configureOpencodePermissions(isGlobal = true) {
|
|
|
1970
1970
|
config.permission = {};
|
|
1971
1971
|
}
|
|
1972
1972
|
|
|
1973
|
-
// Build the
|
|
1973
|
+
// Build the EZ path using the actual config directory
|
|
1974
1974
|
// Use ~ shorthand if it's in the default location, otherwise use full path
|
|
1975
1975
|
const defaultConfigDir = path.join(os.homedir(), '.config', 'opencode');
|
|
1976
|
-
const
|
|
1977
|
-
? '~/.config/opencode/
|
|
1978
|
-
: `${opencodeConfigDir.replace(/\\/g, '/')}/
|
|
1979
|
-
|
|
1976
|
+
const ezPath = opencodeConfigDir === defaultConfigDir
|
|
1977
|
+
? '~/.config/opencode/ez-agents/*'
|
|
1978
|
+
: `${opencodeConfigDir.replace(/\\/g, '/')}/ez-agents/*`;
|
|
1979
|
+
|
|
1980
1980
|
let modified = false;
|
|
1981
1981
|
|
|
1982
1982
|
// Configure read permission
|
|
1983
1983
|
if (!config.permission.read || typeof config.permission.read !== 'object') {
|
|
1984
1984
|
config.permission.read = {};
|
|
1985
1985
|
}
|
|
1986
|
-
if (config.permission.read[
|
|
1987
|
-
config.permission.read[
|
|
1986
|
+
if (config.permission.read[ezPath] !== 'allow') {
|
|
1987
|
+
config.permission.read[ezPath] = 'allow';
|
|
1988
1988
|
modified = true;
|
|
1989
1989
|
}
|
|
1990
1990
|
|
|
@@ -1992,8 +1992,8 @@ function configureOpencodePermissions(isGlobal = true) {
|
|
|
1992
1992
|
if (!config.permission.external_directory || typeof config.permission.external_directory !== 'object') {
|
|
1993
1993
|
config.permission.external_directory = {};
|
|
1994
1994
|
}
|
|
1995
|
-
if (config.permission.external_directory[
|
|
1996
|
-
config.permission.external_directory[
|
|
1995
|
+
if (config.permission.external_directory[ezPath] !== 'allow') {
|
|
1996
|
+
config.permission.external_directory[ezPath] = 'allow';
|
|
1997
1997
|
modified = true;
|
|
1998
1998
|
}
|
|
1999
1999
|
|
|
@@ -2003,7 +2003,7 @@ function configureOpencodePermissions(isGlobal = true) {
|
|
|
2003
2003
|
|
|
2004
2004
|
// Write config back
|
|
2005
2005
|
fs.writeFileSync(configPath, JSON.stringify(config, null, 2) + '\n');
|
|
2006
|
-
console.log(` ${green}✓${reset} Configured read permission for
|
|
2006
|
+
console.log(` ${green}✓${reset} Configured read permission for EZ_Agents docs`);
|
|
2007
2007
|
}
|
|
2008
2008
|
|
|
2009
2009
|
/**
|
|
@@ -2048,8 +2048,8 @@ function verifyFileInstalled(filePath, description) {
|
|
|
2048
2048
|
// Local Patch Persistence
|
|
2049
2049
|
// ──────────────────────────────────────────────────────
|
|
2050
2050
|
|
|
2051
|
-
const PATCHES_DIR_NAME = '
|
|
2052
|
-
const MANIFEST_NAME = '
|
|
2051
|
+
const PATCHES_DIR_NAME = 'ez-local-patches';
|
|
2052
|
+
const MANIFEST_NAME = 'ez-file-manifest.json';
|
|
2053
2053
|
|
|
2054
2054
|
/**
|
|
2055
2055
|
* Compute SHA256 hash of file contents
|
|
@@ -2086,26 +2086,26 @@ function writeManifest(configDir, runtime = 'claude') {
|
|
|
2086
2086
|
const isOpencode = runtime === 'opencode';
|
|
2087
2087
|
const isCodex = runtime === 'codex';
|
|
2088
2088
|
const isCopilot = runtime === 'copilot';
|
|
2089
|
-
const
|
|
2090
|
-
const commandsDir = path.join(configDir, 'commands', '
|
|
2089
|
+
const ezDir = path.join(configDir, 'ez-agents');
|
|
2090
|
+
const commandsDir = path.join(configDir, 'commands', 'ez');
|
|
2091
2091
|
const opencodeCommandDir = path.join(configDir, 'command');
|
|
2092
2092
|
const codexSkillsDir = path.join(configDir, 'skills');
|
|
2093
2093
|
const agentsDir = path.join(configDir, 'agents');
|
|
2094
2094
|
const manifest = { version: pkg.version, timestamp: new Date().toISOString(), files: {} };
|
|
2095
2095
|
|
|
2096
|
-
const
|
|
2097
|
-
for (const [rel, hash] of Object.entries(
|
|
2098
|
-
manifest.files['
|
|
2096
|
+
const ezHashes = generateManifest(ezDir);
|
|
2097
|
+
for (const [rel, hash] of Object.entries(ezHashes)) {
|
|
2098
|
+
manifest.files['ez-agents/' + rel] = hash;
|
|
2099
2099
|
}
|
|
2100
2100
|
if (!isOpencode && !isCodex && !isCopilot && fs.existsSync(commandsDir)) {
|
|
2101
2101
|
const cmdHashes = generateManifest(commandsDir);
|
|
2102
2102
|
for (const [rel, hash] of Object.entries(cmdHashes)) {
|
|
2103
|
-
manifest.files['commands/
|
|
2103
|
+
manifest.files['commands/ez/' + rel] = hash;
|
|
2104
2104
|
}
|
|
2105
2105
|
}
|
|
2106
2106
|
if (isOpencode && fs.existsSync(opencodeCommandDir)) {
|
|
2107
2107
|
for (const file of fs.readdirSync(opencodeCommandDir)) {
|
|
2108
|
-
if (file.startsWith('
|
|
2108
|
+
if (file.startsWith('ez-') && file.endsWith('.md')) {
|
|
2109
2109
|
manifest.files['command/' + file] = fileHash(path.join(opencodeCommandDir, file));
|
|
2110
2110
|
}
|
|
2111
2111
|
}
|
|
@@ -2121,7 +2121,7 @@ function writeManifest(configDir, runtime = 'claude') {
|
|
|
2121
2121
|
}
|
|
2122
2122
|
if (fs.existsSync(agentsDir)) {
|
|
2123
2123
|
for (const file of fs.readdirSync(agentsDir)) {
|
|
2124
|
-
if (file.startsWith('
|
|
2124
|
+
if (file.startsWith('ez-') && file.endsWith('.md')) {
|
|
2125
2125
|
manifest.files['agents/' + file] = fileHash(path.join(agentsDir, file));
|
|
2126
2126
|
}
|
|
2127
2127
|
}
|
|
@@ -2132,8 +2132,8 @@ function writeManifest(configDir, runtime = 'claude') {
|
|
|
2132
2132
|
}
|
|
2133
2133
|
|
|
2134
2134
|
/**
|
|
2135
|
-
* Detect user-modified
|
|
2136
|
-
* Backs up modified files to
|
|
2135
|
+
* Detect user-modified EZ_Agents files by comparing against install manifest.
|
|
2136
|
+
* Backs up modified files to ez-local-patches/ for reapply after update.
|
|
2137
2137
|
*/
|
|
2138
2138
|
function saveLocalPatches(configDir) {
|
|
2139
2139
|
const manifestPath = path.join(configDir, MANIFEST_NAME);
|
|
@@ -2164,7 +2164,7 @@ function saveLocalPatches(configDir) {
|
|
|
2164
2164
|
files: modified
|
|
2165
2165
|
};
|
|
2166
2166
|
fs.writeFileSync(path.join(patchesDir, 'backup-meta.json'), JSON.stringify(meta, null, 2));
|
|
2167
|
-
console.log(' ' + yellow + 'i' + reset + ' Found ' + modified.length + ' locally modified
|
|
2167
|
+
console.log(' ' + yellow + 'i' + reset + ' Found ' + modified.length + ' locally modified EZ file(s) — backed up to ' + PATCHES_DIR_NAME + '/');
|
|
2168
2168
|
for (const f of modified) {
|
|
2169
2169
|
console.log(' ' + dim + f + reset);
|
|
2170
2170
|
}
|
|
@@ -2239,64 +2239,64 @@ function install(isGlobal, runtime = 'claude') {
|
|
|
2239
2239
|
// Track installation failures
|
|
2240
2240
|
const failures = [];
|
|
2241
2241
|
|
|
2242
|
-
// Save any locally modified
|
|
2242
|
+
// Save any locally modified EZ_Agents files before they get wiped
|
|
2243
2243
|
saveLocalPatches(targetDir);
|
|
2244
2244
|
|
|
2245
2245
|
// Clean up orphaned files from previous versions
|
|
2246
2246
|
cleanupOrphanedFiles(targetDir);
|
|
2247
2247
|
|
|
2248
|
-
// OpenCode uses command/ (flat), Codex uses skills/, Claude/Gemini use commands/
|
|
2248
|
+
// OpenCode uses command/ (flat), Codex uses skills/, Claude/Gemini use commands/ez/
|
|
2249
2249
|
if (isOpencode) {
|
|
2250
2250
|
// OpenCode: flat structure in command/ directory
|
|
2251
2251
|
const commandDir = path.join(targetDir, 'command');
|
|
2252
2252
|
fs.mkdirSync(commandDir, { recursive: true });
|
|
2253
|
-
|
|
2254
|
-
// Copy commands/
|
|
2255
|
-
const
|
|
2256
|
-
copyFlattenedCommands(
|
|
2257
|
-
if (verifyInstalled(commandDir, 'command/
|
|
2258
|
-
const count = fs.readdirSync(commandDir).filter(f => f.startsWith('
|
|
2253
|
+
|
|
2254
|
+
// Copy commands/ez/*.md as command/ez-*.md (flatten structure)
|
|
2255
|
+
const ezSrc = path.join(src, 'commands', 'ez');
|
|
2256
|
+
copyFlattenedCommands(ezSrc, commandDir, 'ez', pathPrefix, runtime);
|
|
2257
|
+
if (verifyInstalled(commandDir, 'command/ez-*')) {
|
|
2258
|
+
const count = fs.readdirSync(commandDir).filter(f => f.startsWith('ez-')).length;
|
|
2259
2259
|
console.log(` ${green}✓${reset} Installed ${count} commands to command/`);
|
|
2260
2260
|
} else {
|
|
2261
|
-
failures.push('command/
|
|
2261
|
+
failures.push('command/ez-*');
|
|
2262
2262
|
}
|
|
2263
2263
|
} else if (isCodex) {
|
|
2264
2264
|
const skillsDir = path.join(targetDir, 'skills');
|
|
2265
|
-
const
|
|
2266
|
-
copyCommandsAsCodexSkills(
|
|
2265
|
+
const ezSrc = path.join(src, 'commands', 'ez');
|
|
2266
|
+
copyCommandsAsCodexSkills(ezSrc, skillsDir, 'ez', pathPrefix, runtime);
|
|
2267
2267
|
const installedSkillNames = listCodexSkillNames(skillsDir);
|
|
2268
2268
|
if (installedSkillNames.length > 0) {
|
|
2269
2269
|
console.log(` ${green}✓${reset} Installed ${installedSkillNames.length} skills to skills/`);
|
|
2270
2270
|
} else {
|
|
2271
|
-
failures.push('skills/
|
|
2271
|
+
failures.push('skills/ez-*');
|
|
2272
2272
|
}
|
|
2273
2273
|
} else if (isCopilot) {
|
|
2274
2274
|
const skillsDir = path.join(targetDir, 'skills');
|
|
2275
|
-
const
|
|
2276
|
-
copyCommandsAsCopilotSkills(
|
|
2275
|
+
const ezSrc = path.join(src, 'commands', 'ez');
|
|
2276
|
+
copyCommandsAsCopilotSkills(ezSrc, skillsDir, 'ez', isGlobal);
|
|
2277
2277
|
if (fs.existsSync(skillsDir)) {
|
|
2278
2278
|
const count = fs.readdirSync(skillsDir, { withFileTypes: true })
|
|
2279
|
-
.filter(e => e.isDirectory() && e.name.startsWith('
|
|
2279
|
+
.filter(e => e.isDirectory() && e.name.startsWith('ez-')).length;
|
|
2280
2280
|
if (count > 0) {
|
|
2281
2281
|
console.log(` ${green}✓${reset} Installed ${count} skills to skills/`);
|
|
2282
2282
|
} else {
|
|
2283
|
-
failures.push('skills/
|
|
2283
|
+
failures.push('skills/ez-*');
|
|
2284
2284
|
}
|
|
2285
2285
|
} else {
|
|
2286
|
-
failures.push('skills/
|
|
2286
|
+
failures.push('skills/ez-*');
|
|
2287
2287
|
}
|
|
2288
2288
|
} else {
|
|
2289
2289
|
// Claude Code & Gemini: nested structure in commands/ directory
|
|
2290
2290
|
const commandsDir = path.join(targetDir, 'commands');
|
|
2291
2291
|
fs.mkdirSync(commandsDir, { recursive: true });
|
|
2292
|
-
|
|
2293
|
-
const
|
|
2294
|
-
const
|
|
2295
|
-
copyWithPathReplacement(
|
|
2296
|
-
if (verifyInstalled(
|
|
2297
|
-
console.log(` ${green}✓${reset} Installed commands/
|
|
2292
|
+
|
|
2293
|
+
const ezSrc = path.join(src, 'commands', 'ez');
|
|
2294
|
+
const ezDest = path.join(commandsDir, 'ez');
|
|
2295
|
+
copyWithPathReplacement(ezSrc, ezDest, pathPrefix, runtime, true, isGlobal);
|
|
2296
|
+
if (verifyInstalled(ezDest, 'commands/ez')) {
|
|
2297
|
+
console.log(` ${green}✓${reset} Installed commands/ez`);
|
|
2298
2298
|
} else {
|
|
2299
|
-
failures.push('commands/
|
|
2299
|
+
failures.push('commands/ez');
|
|
2300
2300
|
}
|
|
2301
2301
|
}
|
|
2302
2302
|
|
|
@@ -2309,14 +2309,14 @@ function install(isGlobal, runtime = 'claude') {
|
|
|
2309
2309
|
console.log(` ${green}✓${reset} Installed ez-agents-update command`);
|
|
2310
2310
|
}
|
|
2311
2311
|
|
|
2312
|
-
// Copy
|
|
2313
|
-
const skillSrc = path.join(src, '
|
|
2314
|
-
const skillDest = path.join(targetDir, '
|
|
2312
|
+
// Copy ez-agents skill with path replacement
|
|
2313
|
+
const skillSrc = path.join(src, 'ez-agents');
|
|
2314
|
+
const skillDest = path.join(targetDir, 'ez-agents');
|
|
2315
2315
|
copyWithPathReplacement(skillSrc, skillDest, pathPrefix, runtime, false, isGlobal);
|
|
2316
|
-
if (verifyInstalled(skillDest, '
|
|
2317
|
-
console.log(` ${green}✓${reset} Installed
|
|
2316
|
+
if (verifyInstalled(skillDest, 'ez-agents')) {
|
|
2317
|
+
console.log(` ${green}✓${reset} Installed ez-agents`);
|
|
2318
2318
|
} else {
|
|
2319
|
-
failures.push('
|
|
2319
|
+
failures.push('ez-agents');
|
|
2320
2320
|
}
|
|
2321
2321
|
|
|
2322
2322
|
// Copy agents to agents directory
|
|
@@ -2325,10 +2325,10 @@ function install(isGlobal, runtime = 'claude') {
|
|
|
2325
2325
|
const agentsDest = path.join(targetDir, 'agents');
|
|
2326
2326
|
fs.mkdirSync(agentsDest, { recursive: true });
|
|
2327
2327
|
|
|
2328
|
-
// Remove old
|
|
2328
|
+
// Remove old EZ_Agents agents (ez-*.md) before copying new ones
|
|
2329
2329
|
if (fs.existsSync(agentsDest)) {
|
|
2330
2330
|
for (const file of fs.readdirSync(agentsDest)) {
|
|
2331
|
-
if (file.startsWith('
|
|
2331
|
+
if (file.startsWith('ez-') && file.endsWith('.md')) {
|
|
2332
2332
|
fs.unlinkSync(path.join(agentsDest, file));
|
|
2333
2333
|
}
|
|
2334
2334
|
}
|
|
@@ -2370,7 +2370,7 @@ function install(isGlobal, runtime = 'claude') {
|
|
|
2370
2370
|
|
|
2371
2371
|
// Copy CHANGELOG.md
|
|
2372
2372
|
const changelogSrc = path.join(src, 'CHANGELOG.md');
|
|
2373
|
-
const changelogDest = path.join(targetDir, '
|
|
2373
|
+
const changelogDest = path.join(targetDir, 'ez-agents', 'CHANGELOG.md');
|
|
2374
2374
|
if (fs.existsSync(changelogSrc)) {
|
|
2375
2375
|
fs.copyFileSync(changelogSrc, changelogDest);
|
|
2376
2376
|
if (verifyFileInstalled(changelogDest, 'CHANGELOG.md')) {
|
|
@@ -2381,7 +2381,7 @@ function install(isGlobal, runtime = 'claude') {
|
|
|
2381
2381
|
}
|
|
2382
2382
|
|
|
2383
2383
|
// Write VERSION file
|
|
2384
|
-
const versionDest = path.join(targetDir, '
|
|
2384
|
+
const versionDest = path.join(targetDir, 'ez-agents', 'VERSION');
|
|
2385
2385
|
fs.writeFileSync(versionDest, pkg.version);
|
|
2386
2386
|
if (verifyFileInstalled(versionDest, 'VERSION')) {
|
|
2387
2387
|
console.log(` ${green}✓${reset} Wrote VERSION (${pkg.version})`);
|
|
@@ -2390,7 +2390,7 @@ function install(isGlobal, runtime = 'claude') {
|
|
|
2390
2390
|
}
|
|
2391
2391
|
|
|
2392
2392
|
if (!isCodex && !isCopilot) {
|
|
2393
|
-
// Write package.json to force CommonJS mode for
|
|
2393
|
+
// Write package.json to force CommonJS mode for EZ scripts
|
|
2394
2394
|
// Prevents "require is not defined" errors when project has "type": "module"
|
|
2395
2395
|
// Node.js walks up looking for package.json - this stops inheritance from project
|
|
2396
2396
|
const pkgJsonDest = path.join(targetDir, 'package.json');
|
|
@@ -2482,7 +2482,7 @@ function install(isGlobal, runtime = 'claude') {
|
|
|
2482
2482
|
|
|
2483
2483
|
if (isCopilot) {
|
|
2484
2484
|
// Generate copilot-instructions.md
|
|
2485
|
-
const templatePath = path.join(targetDir, '
|
|
2485
|
+
const templatePath = path.join(targetDir, 'ez-agents', 'templates', 'copilot-instructions.md');
|
|
2486
2486
|
const instructionsPath = path.join(targetDir, 'copilot-instructions.md');
|
|
2487
2487
|
if (fs.existsSync(templatePath)) {
|
|
2488
2488
|
const template = fs.readFileSync(templatePath, 'utf8');
|
|
@@ -2499,14 +2499,14 @@ function install(isGlobal, runtime = 'claude') {
|
|
|
2499
2499
|
const settingsPath = path.join(targetDir, 'settings.json');
|
|
2500
2500
|
const settings = cleanupOrphanedHooks(readSettings(settingsPath));
|
|
2501
2501
|
const statuslineCommand = isGlobal
|
|
2502
|
-
? buildHookCommand(targetDir, '
|
|
2503
|
-
: 'node ' + dirName + '/hooks/
|
|
2502
|
+
? buildHookCommand(targetDir, 'ez-statusline.js')
|
|
2503
|
+
: 'node ' + dirName + '/hooks/ez-statusline.js';
|
|
2504
2504
|
const updateCheckCommand = isGlobal
|
|
2505
|
-
? buildHookCommand(targetDir, '
|
|
2506
|
-
: 'node ' + dirName + '/hooks/
|
|
2505
|
+
? buildHookCommand(targetDir, 'ez-check-update.js')
|
|
2506
|
+
: 'node ' + dirName + '/hooks/ez-check-update.js';
|
|
2507
2507
|
const contextMonitorCommand = isGlobal
|
|
2508
|
-
? buildHookCommand(targetDir, '
|
|
2509
|
-
: 'node ' + dirName + '/hooks/
|
|
2508
|
+
? buildHookCommand(targetDir, 'ez-context-monitor.js')
|
|
2509
|
+
: 'node ' + dirName + '/hooks/ez-context-monitor.js';
|
|
2510
2510
|
|
|
2511
2511
|
// Enable experimental agents for Gemini CLI (required for custom sub-agents)
|
|
2512
2512
|
if (isGemini) {
|
|
@@ -2528,11 +2528,11 @@ function install(isGlobal, runtime = 'claude') {
|
|
|
2528
2528
|
settings.hooks.SessionStart = [];
|
|
2529
2529
|
}
|
|
2530
2530
|
|
|
2531
|
-
const
|
|
2532
|
-
entry.hooks && entry.hooks.some(h => h.command && h.command.includes('
|
|
2531
|
+
const hasEzUpdateHook = settings.hooks.SessionStart.some(entry =>
|
|
2532
|
+
entry.hooks && entry.hooks.some(h => h.command && h.command.includes('ez-check-update'))
|
|
2533
2533
|
);
|
|
2534
2534
|
|
|
2535
|
-
if (!
|
|
2535
|
+
if (!hasEzUpdateHook) {
|
|
2536
2536
|
settings.hooks.SessionStart.push({
|
|
2537
2537
|
hooks: [
|
|
2538
2538
|
{
|
|
@@ -2550,7 +2550,7 @@ function install(isGlobal, runtime = 'claude') {
|
|
|
2550
2550
|
}
|
|
2551
2551
|
|
|
2552
2552
|
const hasContextMonitorHook = settings.hooks[postToolEvent].some(entry =>
|
|
2553
|
-
entry.hooks && entry.hooks.some(h => h.command && h.command.includes('
|
|
2553
|
+
entry.hooks && entry.hooks.some(h => h.command && h.command.includes('ez-context-monitor'))
|
|
2554
2554
|
);
|
|
2555
2555
|
|
|
2556
2556
|
if (!hasContextMonitorHook) {
|
|
@@ -2608,7 +2608,7 @@ function finishInstall(settingsPath, settings, statuslineCommand, shouldInstallS
|
|
|
2608
2608
|
console.log(`
|
|
2609
2609
|
${green}Done!${reset} Open a blank directory in ${program} and run ${cyan}${command}${reset}.
|
|
2610
2610
|
|
|
2611
|
-
${cyan}Join the community:${reset} https://discord.gg/
|
|
2611
|
+
${cyan}Join the community:${reset} https://discord.gg/ez-agents
|
|
2612
2612
|
`);
|
|
2613
2613
|
}
|
|
2614
2614
|
|
|
@@ -2647,13 +2647,13 @@ function handleStatusline(settings, isInteractive, callback) {
|
|
|
2647
2647
|
Your current statusline:
|
|
2648
2648
|
${dim}command: ${existingCmd}${reset}
|
|
2649
2649
|
|
|
2650
|
-
|
|
2650
|
+
EZ_Agents includes a statusline showing:
|
|
2651
2651
|
• Model name
|
|
2652
2652
|
• Current task (from todo list)
|
|
2653
2653
|
• Context window usage (color-coded)
|
|
2654
2654
|
|
|
2655
2655
|
${cyan}1${reset}) Keep existing
|
|
2656
|
-
${cyan}2${reset}) Replace with
|
|
2656
|
+
${cyan}2${reset}) Replace with EZ_Agents statusline
|
|
2657
2657
|
`);
|
|
2658
2658
|
|
|
2659
2659
|
rl.question(` Choice ${dim}[1]${reset}: `, (answer) => {
|
|
@@ -2756,7 +2756,7 @@ function promptLocation(runtimes) {
|
|
|
2756
2756
|
}
|
|
2757
2757
|
|
|
2758
2758
|
/**
|
|
2759
|
-
* Install
|
|
2759
|
+
* Install EZ_Agents for all selected runtimes
|
|
2760
2760
|
*/
|
|
2761
2761
|
function installAllRuntimes(runtimes, isGlobal, isInteractive) {
|
|
2762
2762
|
const results = [];
|
|
@@ -2791,14 +2791,14 @@ function installAllRuntimes(runtimes, isGlobal, isInteractive) {
|
|
|
2791
2791
|
}
|
|
2792
2792
|
|
|
2793
2793
|
// Test-only exports — skip main logic when loaded as a module for testing
|
|
2794
|
-
if (process.env.
|
|
2794
|
+
if (process.env.EZ_AGENTS_TEST_MODE) {
|
|
2795
2795
|
module.exports = {
|
|
2796
2796
|
getCodexSkillAdapterHeader,
|
|
2797
2797
|
convertClaudeToGeminiAgent,
|
|
2798
2798
|
convertClaudeAgentToCodexAgent,
|
|
2799
2799
|
generateCodexAgentToml,
|
|
2800
2800
|
generateCodexConfigBlock,
|
|
2801
|
-
|
|
2801
|
+
stripEzAgentsFromCodexConfig,
|
|
2802
2802
|
mergeCodexConfig,
|
|
2803
2803
|
installCodexConfig,
|
|
2804
2804
|
convertClaudeCommandToCodexSkill,
|
|
@@ -2816,7 +2816,7 @@ if (process.env.GSD_TEST_MODE) {
|
|
|
2816
2816
|
EZ_COPILOT_INSTRUCTIONS_MARKER,
|
|
2817
2817
|
EZ_COPILOT_INSTRUCTIONS_CLOSE_MARKER,
|
|
2818
2818
|
mergeCopilotInstructions,
|
|
2819
|
-
|
|
2819
|
+
stripEzAgentsFromCopilotInstructions,
|
|
2820
2820
|
writeManifest,
|
|
2821
2821
|
reportLocalPatches,
|
|
2822
2822
|
};
|
|
@@ -2859,4 +2859,4 @@ if (hasGlobal && hasLocal) {
|
|
|
2859
2859
|
}
|
|
2860
2860
|
}
|
|
2861
2861
|
|
|
2862
|
-
} // end of else block for
|
|
2862
|
+
} // end of else block for EZ_AGENTS_TEST_MODE
|