@phnx-labs/agents-cli 1.12.0 → 1.14.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -1
- package/README.md +308 -297
- package/dist/commands/alias.d.ts +11 -0
- package/dist/commands/alias.js +117 -0
- package/dist/commands/beta.d.ts +2 -0
- package/dist/commands/beta.js +53 -0
- package/dist/commands/cloud.d.ts +10 -0
- package/dist/commands/cloud.js +408 -0
- package/dist/commands/commands.d.ts +9 -1
- package/dist/commands/commands.js +24 -172
- package/dist/commands/daemon.d.ts +8 -1
- package/dist/commands/daemon.js +13 -5
- package/dist/commands/doctor.d.ts +15 -0
- package/dist/commands/doctor.js +132 -0
- package/dist/commands/drive.d.ts +8 -1
- package/dist/commands/drive.js +20 -3
- package/dist/commands/exec.d.ts +8 -1
- package/dist/commands/exec.js +207 -20
- package/dist/commands/factory.d.ts +19 -0
- package/dist/commands/factory.js +71 -0
- package/dist/commands/fork.d.ts +8 -1
- package/dist/commands/fork.js +11 -4
- package/dist/commands/hooks.d.ts +9 -1
- package/dist/commands/hooks.js +30 -182
- package/dist/commands/init.d.ts +15 -1
- package/dist/commands/init.js +168 -74
- package/dist/commands/mcp.d.ts +9 -1
- package/dist/commands/mcp.js +11 -7
- package/dist/commands/models.d.ts +8 -1
- package/dist/commands/models.js +45 -6
- package/dist/commands/packages.d.ts +8 -1
- package/dist/commands/packages.js +13 -7
- package/dist/commands/permissions.d.ts +9 -1
- package/dist/commands/permissions.js +3 -3
- package/dist/commands/plugins.d.ts +8 -1
- package/dist/commands/plugins.js +13 -2
- package/dist/commands/profiles.d.ts +11 -0
- package/dist/commands/profiles.js +291 -0
- package/dist/commands/prune.d.ts +22 -0
- package/dist/commands/prune.js +191 -0
- package/dist/commands/pty.d.ts +1 -1
- package/dist/commands/pty.js +2 -1
- package/dist/commands/pull.d.ts +8 -1
- package/dist/commands/pull.js +93 -129
- package/dist/commands/refresh-memory.d.ts +7 -1
- package/dist/commands/refresh-memory.js +7 -1
- package/dist/commands/repo.d.ts +15 -0
- package/dist/commands/repo.js +570 -0
- package/dist/commands/resource-view.d.ts +10 -3
- package/dist/commands/resource-view.js +18 -5
- package/dist/commands/routines.d.ts +8 -1
- package/dist/commands/routines.js +17 -4
- package/dist/commands/rules.d.ts +9 -1
- package/dist/commands/rules.js +16 -11
- package/dist/commands/secrets.d.ts +10 -0
- package/dist/commands/secrets.js +518 -0
- package/dist/commands/sessions-picker.d.ts +2 -1
- package/dist/commands/sessions-picker.js +88 -11
- package/dist/commands/sessions-tail.d.ts +19 -0
- package/dist/commands/sessions-tail.js +235 -0
- package/dist/commands/sessions.d.ts +2 -1
- package/dist/commands/sessions.js +288 -7
- package/dist/commands/skills.d.ts +9 -1
- package/dist/commands/skills.js +28 -178
- package/dist/commands/status.d.ts +7 -1
- package/dist/commands/status.js +7 -1
- package/dist/commands/subagents.d.ts +8 -1
- package/dist/commands/subagents.js +11 -1
- package/dist/commands/sync.d.ts +8 -1
- package/dist/commands/sync.js +8 -1
- package/dist/commands/teams-picker.d.ts +4 -1
- package/dist/commands/teams-picker.js +55 -3
- package/dist/commands/teams.d.ts +15 -1
- package/dist/commands/teams.js +323 -69
- package/dist/commands/usage.d.ts +11 -0
- package/dist/commands/usage.js +60 -0
- package/dist/commands/utils.d.ts +6 -1
- package/dist/commands/utils.js +6 -1
- package/dist/commands/versions.d.ts +8 -1
- package/dist/commands/versions.js +4 -3
- package/dist/commands/view.d.ts +47 -2
- package/dist/commands/view.js +353 -20
- package/dist/index.d.ts +7 -2
- package/dist/index.js +205 -38
- package/dist/lib/acp/client.d.ts +31 -0
- package/dist/lib/acp/client.js +117 -0
- package/dist/lib/acp/harnesses.d.ts +26 -0
- package/dist/lib/acp/harnesses.js +65 -0
- package/dist/lib/acp/run.d.ts +18 -0
- package/dist/lib/acp/run.js +39 -0
- package/dist/lib/agents.d.ts +74 -2
- package/dist/lib/agents.js +207 -23
- package/dist/lib/artifact-actions.d.ts +8 -4
- package/dist/lib/artifact-actions.js +8 -6
- package/dist/lib/auto-pull-worker.d.ts +11 -0
- package/dist/lib/auto-pull-worker.js +121 -0
- package/dist/lib/auto-pull.d.ts +31 -0
- package/dist/lib/auto-pull.js +97 -0
- package/dist/lib/beta.d.ts +23 -0
- package/dist/lib/beta.js +90 -0
- package/dist/lib/capabilities.d.ts +29 -0
- package/dist/lib/capabilities.js +74 -0
- package/dist/lib/cloud/codex.d.ts +25 -0
- package/dist/lib/cloud/codex.js +250 -0
- package/dist/lib/cloud/factory.d.ts +31 -0
- package/dist/lib/cloud/factory.js +53 -0
- package/dist/lib/cloud/registry.d.ts +15 -0
- package/dist/lib/cloud/registry.js +67 -0
- package/dist/lib/cloud/rush.d.ts +75 -0
- package/dist/lib/cloud/rush.js +438 -0
- package/dist/lib/cloud/store.d.ts +22 -0
- package/dist/lib/cloud/store.js +115 -0
- package/dist/lib/cloud/stream.d.ts +23 -0
- package/dist/lib/cloud/stream.js +194 -0
- package/dist/lib/cloud/types.d.ts +205 -0
- package/dist/lib/cloud/types.js +34 -0
- package/dist/lib/command-skills.d.ts +20 -0
- package/dist/lib/command-skills.js +142 -0
- package/dist/lib/commands.d.ts +22 -2
- package/dist/lib/commands.js +51 -11
- package/dist/lib/convert.d.ts +10 -1
- package/dist/lib/convert.js +9 -1
- package/dist/lib/daemon.d.ts +21 -1
- package/dist/lib/daemon.js +97 -4
- package/dist/lib/drive-sync.d.ts +18 -1
- package/dist/lib/drive-sync.js +57 -15
- package/dist/lib/exec.d.ts +25 -5
- package/dist/lib/exec.js +72 -27
- package/dist/lib/fs-walk.d.ts +2 -0
- package/dist/lib/fs-walk.js +40 -0
- package/dist/lib/fuzzy.d.ts +53 -0
- package/dist/lib/fuzzy.js +72 -0
- package/dist/lib/gemini-settings.d.ts +4 -0
- package/dist/lib/gemini-settings.js +33 -0
- package/dist/lib/git.d.ts +12 -2
- package/dist/lib/git.js +17 -6
- package/dist/lib/help.d.ts +20 -1
- package/dist/lib/help.js +45 -6
- package/dist/lib/hooks/match.d.ts +32 -0
- package/dist/lib/hooks/match.js +120 -0
- package/dist/lib/hooks.d.ts +17 -4
- package/dist/lib/hooks.js +191 -21
- package/dist/lib/manifest.d.ts +6 -1
- package/dist/lib/manifest.js +15 -4
- package/dist/lib/markdown.d.ts +0 -1
- package/dist/lib/markdown.js +6 -1
- package/dist/lib/mcp.d.ts +0 -1
- package/dist/lib/mcp.js +29 -33
- package/dist/lib/memory-compile.d.ts +13 -3
- package/dist/lib/memory-compile.js +31 -9
- package/dist/lib/memory.d.ts +14 -7
- package/dist/lib/memory.js +67 -38
- package/dist/lib/migrate.d.ts +8 -0
- package/dist/lib/migrate.js +85 -0
- package/dist/lib/models.d.ts +25 -11
- package/dist/lib/models.js +405 -16
- package/dist/lib/onepassword.d.ts +63 -0
- package/dist/lib/onepassword.js +186 -0
- package/dist/lib/paths.d.ts +8 -0
- package/dist/lib/paths.js +20 -0
- package/dist/lib/permissions.d.ts +24 -2
- package/dist/lib/permissions.js +117 -48
- package/dist/lib/picker.d.ts +10 -1
- package/dist/lib/picker.js +15 -1
- package/dist/lib/plugins.d.ts +7 -1
- package/dist/lib/plugins.js +10 -1
- package/dist/lib/profiles-presets.d.ts +24 -0
- package/dist/lib/profiles-presets.js +103 -0
- package/dist/lib/profiles.d.ts +69 -0
- package/dist/lib/profiles.js +144 -0
- package/dist/lib/pty-client.d.ts +1 -1
- package/dist/lib/pty-client.js +0 -1
- package/dist/lib/pty-server.d.ts +16 -2
- package/dist/lib/pty-server.js +92 -3
- package/dist/lib/registry.d.ts +23 -3
- package/dist/lib/registry.js +153 -8
- package/dist/lib/resources.d.ts +28 -1
- package/dist/lib/resources.js +79 -1
- package/dist/lib/rotate.d.ts +89 -0
- package/dist/lib/rotate.js +327 -0
- package/dist/lib/routines.d.ts +29 -1
- package/dist/lib/routines.js +32 -5
- package/dist/lib/runner.d.ts +14 -1
- package/dist/lib/runner.js +22 -3
- package/dist/lib/sandbox.d.ts +16 -1
- package/dist/lib/sandbox.js +39 -16
- package/dist/lib/scheduler.d.ts +8 -1
- package/dist/lib/scheduler.js +8 -1
- package/dist/lib/secrets/AgentsKeychain.app/Contents/CodeResources +0 -0
- package/dist/lib/secrets/AgentsKeychain.app/Contents/Info.plist +22 -0
- package/dist/lib/secrets/AgentsKeychain.app/Contents/MacOS/AgentsKeychain +0 -0
- package/dist/lib/secrets/AgentsKeychain.app/Contents/_CodeSignature/CodeResources +123 -0
- package/dist/lib/secrets/AgentsKeychain.app/Contents/embedded.provisionprofile +0 -0
- package/dist/lib/secrets/bundles.d.ts +39 -0
- package/dist/lib/secrets/bundles.js +189 -0
- package/dist/lib/secrets/index.d.ts +55 -0
- package/dist/lib/secrets/index.js +211 -0
- package/dist/lib/secrets/profiles.d.ts +10 -0
- package/dist/lib/secrets/profiles.js +13 -0
- package/dist/lib/session/active.d.ts +43 -0
- package/dist/lib/session/active.js +392 -0
- package/dist/lib/session/artifacts.d.ts +16 -0
- package/dist/lib/session/artifacts.js +95 -0
- package/dist/lib/session/cloud.d.ts +30 -0
- package/dist/lib/session/cloud.js +121 -0
- package/dist/lib/session/db.d.ts +23 -2
- package/dist/lib/session/db.js +76 -12
- package/dist/lib/session/discover.d.ts +19 -4
- package/dist/lib/session/discover.js +344 -48
- package/dist/lib/session/parse.d.ts +28 -1
- package/dist/lib/session/parse.js +267 -9
- package/dist/lib/session/prompt.d.ts +9 -1
- package/dist/lib/session/prompt.js +17 -3
- package/dist/lib/session/render.d.ts +13 -1
- package/dist/lib/session/render.js +20 -1
- package/dist/lib/session/team-filter.d.ts +9 -1
- package/dist/lib/session/team-filter.js +11 -2
- package/dist/lib/session/types.d.ts +24 -2
- package/dist/lib/session/types.js +10 -2
- package/dist/lib/shims.d.ts +93 -5
- package/dist/lib/shims.js +380 -67
- package/dist/lib/skills.d.ts +27 -2
- package/dist/lib/skills.js +127 -65
- package/dist/lib/sqlite.d.ts +43 -0
- package/dist/lib/sqlite.js +94 -0
- package/dist/lib/state.d.ts +114 -22
- package/dist/lib/state.js +323 -138
- package/dist/lib/subagents.d.ts +9 -1
- package/dist/lib/subagents.js +70 -63
- package/dist/lib/sync-manifest.d.ts +81 -0
- package/dist/lib/sync-manifest.js +450 -0
- package/dist/lib/teams/agents.d.ts +103 -5
- package/dist/lib/teams/agents.js +414 -91
- package/dist/lib/teams/api.d.ts +26 -3
- package/dist/lib/teams/api.js +63 -3
- package/dist/lib/teams/debug.d.ts +6 -1
- package/dist/lib/teams/debug.js +6 -1
- package/dist/lib/teams/file_ops.d.ts +7 -1
- package/dist/lib/teams/file_ops.js +7 -1
- package/dist/lib/teams/index.d.ts +15 -0
- package/dist/lib/teams/index.js +14 -0
- package/dist/lib/teams/parsers.d.ts +4 -1
- package/dist/lib/teams/parsers.js +11 -1
- package/dist/lib/teams/persistence.d.ts +15 -1
- package/dist/lib/teams/persistence.js +102 -20
- package/dist/lib/teams/registry.d.ts +12 -1
- package/dist/lib/teams/registry.js +116 -33
- package/dist/lib/teams/summarizer.d.ts +15 -1
- package/dist/lib/teams/summarizer.js +14 -1
- package/dist/lib/teams/supervisor.d.ts +48 -0
- package/dist/lib/teams/supervisor.js +73 -0
- package/dist/lib/template.d.ts +8 -6
- package/dist/lib/template.js +8 -6
- package/dist/lib/types.d.ts +147 -8
- package/dist/lib/types.js +26 -3
- package/dist/lib/usage.d.ts +48 -1
- package/dist/lib/usage.js +97 -16
- package/dist/lib/version-duplicates.d.ts +21 -0
- package/dist/lib/version-duplicates.js +90 -0
- package/dist/lib/versions.d.ts +39 -4
- package/dist/lib/versions.js +401 -111
- package/package.json +33 -18
- package/scripts/postinstall.js +126 -30
- package/dist/commands/__tests__/sessions.test.d.ts +0 -2
- package/dist/commands/__tests__/sessions.test.d.ts.map +0 -1
- package/dist/commands/__tests__/sessions.test.js +0 -636
- package/dist/commands/__tests__/sessions.test.js.map +0 -1
- package/dist/commands/commands.d.ts.map +0 -1
- package/dist/commands/commands.js.map +0 -1
- package/dist/commands/daemon.d.ts.map +0 -1
- package/dist/commands/daemon.js.map +0 -1
- package/dist/commands/drive.d.ts.map +0 -1
- package/dist/commands/drive.js.map +0 -1
- package/dist/commands/exec.d.ts.map +0 -1
- package/dist/commands/exec.js.map +0 -1
- package/dist/commands/fork.d.ts.map +0 -1
- package/dist/commands/fork.js.map +0 -1
- package/dist/commands/hooks.d.ts.map +0 -1
- package/dist/commands/hooks.js.map +0 -1
- package/dist/commands/init.d.ts.map +0 -1
- package/dist/commands/init.js.map +0 -1
- package/dist/commands/mcp.d.ts.map +0 -1
- package/dist/commands/mcp.js.map +0 -1
- package/dist/commands/models.d.ts.map +0 -1
- package/dist/commands/models.js.map +0 -1
- package/dist/commands/packages.d.ts.map +0 -1
- package/dist/commands/packages.js.map +0 -1
- package/dist/commands/permissions.d.ts.map +0 -1
- package/dist/commands/permissions.js.map +0 -1
- package/dist/commands/plugins.d.ts.map +0 -1
- package/dist/commands/plugins.js.map +0 -1
- package/dist/commands/pty.d.ts.map +0 -1
- package/dist/commands/pty.js.map +0 -1
- package/dist/commands/pull.d.ts.map +0 -1
- package/dist/commands/pull.js.map +0 -1
- package/dist/commands/push.d.ts +0 -3
- package/dist/commands/push.d.ts.map +0 -1
- package/dist/commands/push.js +0 -180
- package/dist/commands/push.js.map +0 -1
- package/dist/commands/refresh-memory.d.ts.map +0 -1
- package/dist/commands/refresh-memory.js.map +0 -1
- package/dist/commands/resource-view.d.ts.map +0 -1
- package/dist/commands/resource-view.js.map +0 -1
- package/dist/commands/routines.d.ts.map +0 -1
- package/dist/commands/routines.js.map +0 -1
- package/dist/commands/rules.d.ts.map +0 -1
- package/dist/commands/rules.js.map +0 -1
- package/dist/commands/sessions-picker.d.ts.map +0 -1
- package/dist/commands/sessions-picker.js.map +0 -1
- package/dist/commands/sessions.d.ts.map +0 -1
- package/dist/commands/sessions.js.map +0 -1
- package/dist/commands/skills.d.ts.map +0 -1
- package/dist/commands/skills.js.map +0 -1
- package/dist/commands/status.d.ts.map +0 -1
- package/dist/commands/status.js.map +0 -1
- package/dist/commands/subagents.d.ts.map +0 -1
- package/dist/commands/subagents.js.map +0 -1
- package/dist/commands/sync.d.ts.map +0 -1
- package/dist/commands/sync.js.map +0 -1
- package/dist/commands/teams-picker.d.ts.map +0 -1
- package/dist/commands/teams-picker.js.map +0 -1
- package/dist/commands/teams.d.ts.map +0 -1
- package/dist/commands/teams.js.map +0 -1
- package/dist/commands/utils.d.ts.map +0 -1
- package/dist/commands/utils.js.map +0 -1
- package/dist/commands/versions.d.ts.map +0 -1
- package/dist/commands/versions.js.map +0 -1
- package/dist/commands/view.d.ts.map +0 -1
- package/dist/commands/view.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/lib/__tests__/bugfixes.test.d.ts +0 -2
- package/dist/lib/__tests__/bugfixes.test.d.ts.map +0 -1
- package/dist/lib/__tests__/bugfixes.test.js +0 -192
- package/dist/lib/__tests__/bugfixes.test.js.map +0 -1
- package/dist/lib/__tests__/exec.test.d.ts +0 -2
- package/dist/lib/__tests__/exec.test.d.ts.map +0 -1
- package/dist/lib/__tests__/exec.test.js +0 -446
- package/dist/lib/__tests__/exec.test.js.map +0 -1
- package/dist/lib/__tests__/git-sync.test.d.ts +0 -2
- package/dist/lib/__tests__/git-sync.test.d.ts.map +0 -1
- package/dist/lib/__tests__/git-sync.test.js +0 -138
- package/dist/lib/__tests__/git-sync.test.js.map +0 -1
- package/dist/lib/__tests__/hooks.test.d.ts +0 -2
- package/dist/lib/__tests__/hooks.test.d.ts.map +0 -1
- package/dist/lib/__tests__/hooks.test.js +0 -203
- package/dist/lib/__tests__/hooks.test.js.map +0 -1
- package/dist/lib/__tests__/memory-compile.test.d.ts +0 -2
- package/dist/lib/__tests__/memory-compile.test.d.ts.map +0 -1
- package/dist/lib/__tests__/memory-compile.test.js +0 -95
- package/dist/lib/__tests__/memory-compile.test.js.map +0 -1
- package/dist/lib/__tests__/models.test.d.ts +0 -2
- package/dist/lib/__tests__/models.test.d.ts.map +0 -1
- package/dist/lib/__tests__/models.test.js +0 -184
- package/dist/lib/__tests__/models.test.js.map +0 -1
- package/dist/lib/__tests__/usage.test.d.ts +0 -2
- package/dist/lib/__tests__/usage.test.d.ts.map +0 -1
- package/dist/lib/__tests__/usage.test.js +0 -218
- package/dist/lib/__tests__/usage.test.js.map +0 -1
- package/dist/lib/agents.d.ts.map +0 -1
- package/dist/lib/agents.js.map +0 -1
- package/dist/lib/artifact-actions.d.ts.map +0 -1
- package/dist/lib/artifact-actions.js.map +0 -1
- package/dist/lib/commands.d.ts.map +0 -1
- package/dist/lib/commands.js.map +0 -1
- package/dist/lib/convert.d.ts.map +0 -1
- package/dist/lib/convert.js.map +0 -1
- package/dist/lib/daemon.d.ts.map +0 -1
- package/dist/lib/daemon.js.map +0 -1
- package/dist/lib/drive-sync.d.ts.map +0 -1
- package/dist/lib/drive-sync.js.map +0 -1
- package/dist/lib/exec.d.ts.map +0 -1
- package/dist/lib/exec.js.map +0 -1
- package/dist/lib/factory.d.ts +0 -57
- package/dist/lib/factory.d.ts.map +0 -1
- package/dist/lib/factory.js +0 -110
- package/dist/lib/factory.js.map +0 -1
- package/dist/lib/git.d.ts.map +0 -1
- package/dist/lib/git.js.map +0 -1
- package/dist/lib/help.d.ts.map +0 -1
- package/dist/lib/help.js.map +0 -1
- package/dist/lib/hooks.d.ts.map +0 -1
- package/dist/lib/hooks.js.map +0 -1
- package/dist/lib/manifest.d.ts.map +0 -1
- package/dist/lib/manifest.js.map +0 -1
- package/dist/lib/markdown.d.ts.map +0 -1
- package/dist/lib/markdown.js.map +0 -1
- package/dist/lib/mcp.d.ts.map +0 -1
- package/dist/lib/mcp.js.map +0 -1
- package/dist/lib/memory-compile.d.ts.map +0 -1
- package/dist/lib/memory-compile.js.map +0 -1
- package/dist/lib/memory.d.ts.map +0 -1
- package/dist/lib/memory.js.map +0 -1
- package/dist/lib/models.d.ts.map +0 -1
- package/dist/lib/models.js.map +0 -1
- package/dist/lib/permissions.d.ts.map +0 -1
- package/dist/lib/permissions.js.map +0 -1
- package/dist/lib/picker.d.ts.map +0 -1
- package/dist/lib/picker.js.map +0 -1
- package/dist/lib/plugins.d.ts.map +0 -1
- package/dist/lib/plugins.js.map +0 -1
- package/dist/lib/pty-client.d.ts.map +0 -1
- package/dist/lib/pty-client.js.map +0 -1
- package/dist/lib/pty-server.d.ts.map +0 -1
- package/dist/lib/pty-server.js.map +0 -1
- package/dist/lib/registry.d.ts.map +0 -1
- package/dist/lib/registry.js.map +0 -1
- package/dist/lib/resources.d.ts.map +0 -1
- package/dist/lib/resources.js.map +0 -1
- package/dist/lib/routines.d.ts.map +0 -1
- package/dist/lib/routines.js.map +0 -1
- package/dist/lib/runner.d.ts.map +0 -1
- package/dist/lib/runner.js.map +0 -1
- package/dist/lib/sandbox.d.ts.map +0 -1
- package/dist/lib/sandbox.js.map +0 -1
- package/dist/lib/scheduler.d.ts.map +0 -1
- package/dist/lib/scheduler.js.map +0 -1
- package/dist/lib/session/__tests__/db.test.d.ts +0 -2
- package/dist/lib/session/__tests__/db.test.d.ts.map +0 -1
- package/dist/lib/session/__tests__/db.test.js +0 -54
- package/dist/lib/session/__tests__/db.test.js.map +0 -1
- package/dist/lib/session/__tests__/discover.test.d.ts +0 -2
- package/dist/lib/session/__tests__/discover.test.d.ts.map +0 -1
- package/dist/lib/session/__tests__/discover.test.js +0 -63
- package/dist/lib/session/__tests__/discover.test.js.map +0 -1
- package/dist/lib/session/__tests__/prompt.test.d.ts +0 -2
- package/dist/lib/session/__tests__/prompt.test.d.ts.map +0 -1
- package/dist/lib/session/__tests__/prompt.test.js +0 -44
- package/dist/lib/session/__tests__/prompt.test.js.map +0 -1
- package/dist/lib/session/__tests__/render.test.d.ts +0 -2
- package/dist/lib/session/__tests__/render.test.d.ts.map +0 -1
- package/dist/lib/session/__tests__/render.test.js +0 -602
- package/dist/lib/session/__tests__/render.test.js.map +0 -1
- package/dist/lib/session/db.d.ts.map +0 -1
- package/dist/lib/session/db.js.map +0 -1
- package/dist/lib/session/discover.d.ts.map +0 -1
- package/dist/lib/session/discover.js.map +0 -1
- package/dist/lib/session/parse.d.ts.map +0 -1
- package/dist/lib/session/parse.js.map +0 -1
- package/dist/lib/session/prompt.d.ts.map +0 -1
- package/dist/lib/session/prompt.js.map +0 -1
- package/dist/lib/session/prompt.test.d.ts +0 -2
- package/dist/lib/session/prompt.test.d.ts.map +0 -1
- package/dist/lib/session/prompt.test.js +0 -57
- package/dist/lib/session/prompt.test.js.map +0 -1
- package/dist/lib/session/render.d.ts.map +0 -1
- package/dist/lib/session/render.js.map +0 -1
- package/dist/lib/session/team-filter.d.ts.map +0 -1
- package/dist/lib/session/team-filter.js.map +0 -1
- package/dist/lib/session/team-filter.test.d.ts +0 -2
- package/dist/lib/session/team-filter.test.d.ts.map +0 -1
- package/dist/lib/session/team-filter.test.js +0 -157
- package/dist/lib/session/team-filter.test.js.map +0 -1
- package/dist/lib/session/types.d.ts.map +0 -1
- package/dist/lib/session/types.js.map +0 -1
- package/dist/lib/shims.d.ts.map +0 -1
- package/dist/lib/shims.js.map +0 -1
- package/dist/lib/skills.d.ts.map +0 -1
- package/dist/lib/skills.js.map +0 -1
- package/dist/lib/state.d.ts.map +0 -1
- package/dist/lib/state.js.map +0 -1
- package/dist/lib/subagents.d.ts.map +0 -1
- package/dist/lib/subagents.js.map +0 -1
- package/dist/lib/teams/agents.d.ts.map +0 -1
- package/dist/lib/teams/agents.js.map +0 -1
- package/dist/lib/teams/api.d.ts.map +0 -1
- package/dist/lib/teams/api.js.map +0 -1
- package/dist/lib/teams/cloud.d.ts +0 -11
- package/dist/lib/teams/cloud.d.ts.map +0 -1
- package/dist/lib/teams/cloud.js +0 -169
- package/dist/lib/teams/cloud.js.map +0 -1
- package/dist/lib/teams/debug.d.ts.map +0 -1
- package/dist/lib/teams/debug.js.map +0 -1
- package/dist/lib/teams/file_ops.d.ts.map +0 -1
- package/dist/lib/teams/file_ops.js.map +0 -1
- package/dist/lib/teams/parsers.d.ts.map +0 -1
- package/dist/lib/teams/parsers.js.map +0 -1
- package/dist/lib/teams/persistence.d.ts.map +0 -1
- package/dist/lib/teams/persistence.js.map +0 -1
- package/dist/lib/teams/ralph.d.ts +0 -8
- package/dist/lib/teams/ralph.d.ts.map +0 -1
- package/dist/lib/teams/ralph.js +0 -59
- package/dist/lib/teams/ralph.js.map +0 -1
- package/dist/lib/teams/registry.d.ts.map +0 -1
- package/dist/lib/teams/registry.js.map +0 -1
- package/dist/lib/teams/summarizer.d.ts.map +0 -1
- package/dist/lib/teams/summarizer.js.map +0 -1
- package/dist/lib/template.d.ts.map +0 -1
- package/dist/lib/template.js.map +0 -1
- package/dist/lib/types.d.ts.map +0 -1
- package/dist/lib/types.js.map +0 -1
- package/dist/lib/usage.d.ts.map +0 -1
- package/dist/lib/usage.js.map +0 -1
- package/dist/lib/versions.d.ts.map +0 -1
- package/dist/lib/versions.js.map +0 -1
- package/scripts/rebuild-sqlite.sh +0 -46
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
import { confirm } from '@inquirer/prompts';
|
|
3
|
+
import { diffVersionCommands, iterCommandsCapableVersions, removeCommandFromVersion, } from '../lib/commands.js';
|
|
4
|
+
import { diffVersionSkills, iterSkillsCapableVersions, removeSkillFromVersion, } from '../lib/skills.js';
|
|
5
|
+
import { diffVersionHooks, iterHooksCapableVersions, removeHookFromVersion, } from '../lib/hooks.js';
|
|
6
|
+
import { getGlobalDefault } from '../lib/versions.js';
|
|
7
|
+
import { resolveAgentName, formatAgentError } from '../lib/agents.js';
|
|
8
|
+
import { pruneDuplicates } from './view.js';
|
|
9
|
+
import { isInteractiveTerminal, isPromptCancelled } from './utils.js';
|
|
10
|
+
const RESOURCE_TYPES = ['commands', 'skills', 'hooks'];
|
|
11
|
+
const ALL_TYPES = [...RESOURCE_TYPES, 'versions'];
|
|
12
|
+
function scopePairs(pairs, all) {
|
|
13
|
+
if (all)
|
|
14
|
+
return pairs;
|
|
15
|
+
return pairs.filter((p) => p.version === getGlobalDefault(p.agent));
|
|
16
|
+
}
|
|
17
|
+
function collectOrphans(types, all) {
|
|
18
|
+
const groups = [];
|
|
19
|
+
if (types.includes('commands')) {
|
|
20
|
+
for (const { agent, version } of scopePairs(iterCommandsCapableVersions(), all)) {
|
|
21
|
+
const diff = diffVersionCommands(agent, version);
|
|
22
|
+
if (diff.orphans.length > 0) {
|
|
23
|
+
groups.push({ type: 'commands', agent, version, orphans: diff.orphans });
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
if (types.includes('skills')) {
|
|
28
|
+
for (const { agent, version } of scopePairs(iterSkillsCapableVersions(), all)) {
|
|
29
|
+
const diff = diffVersionSkills(agent, version);
|
|
30
|
+
if (diff.orphans.length > 0) {
|
|
31
|
+
groups.push({ type: 'skills', agent, version, orphans: diff.orphans });
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
if (types.includes('hooks')) {
|
|
36
|
+
for (const { agent, version } of scopePairs(iterHooksCapableVersions(), all)) {
|
|
37
|
+
const diff = diffVersionHooks(agent, version);
|
|
38
|
+
if (diff.orphans.length > 0) {
|
|
39
|
+
groups.push({ type: 'hooks', agent, version, orphans: diff.orphans });
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return groups;
|
|
44
|
+
}
|
|
45
|
+
function removeOne(group, name) {
|
|
46
|
+
switch (group.type) {
|
|
47
|
+
case 'commands':
|
|
48
|
+
return removeCommandFromVersion(group.agent, group.version, name);
|
|
49
|
+
case 'skills':
|
|
50
|
+
return removeSkillFromVersion(group.agent, group.version, name);
|
|
51
|
+
case 'hooks':
|
|
52
|
+
return removeHookFromVersion(group.agent, group.version, name);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
function parseTarget(arg) {
|
|
56
|
+
if (!arg) {
|
|
57
|
+
return { resourceTypes: RESOURCE_TYPES, includeVersions: true };
|
|
58
|
+
}
|
|
59
|
+
if (RESOURCE_TYPES.includes(arg)) {
|
|
60
|
+
return { resourceTypes: [arg], includeVersions: false };
|
|
61
|
+
}
|
|
62
|
+
if (arg === 'versions') {
|
|
63
|
+
return { resourceTypes: [], includeVersions: true };
|
|
64
|
+
}
|
|
65
|
+
// Try treating as an agent name — shortcut for `prune versions <agent>`.
|
|
66
|
+
const agentId = resolveAgentName(arg);
|
|
67
|
+
if (agentId) {
|
|
68
|
+
return { resourceTypes: [], includeVersions: true, versionAgent: agentId };
|
|
69
|
+
}
|
|
70
|
+
console.log(chalk.red(`Unknown prune target: ${arg}`));
|
|
71
|
+
console.log(chalk.gray(`Available types: ${ALL_TYPES.join(', ')}`));
|
|
72
|
+
console.log(chalk.gray(formatAgentError(arg)));
|
|
73
|
+
process.exit(1);
|
|
74
|
+
}
|
|
75
|
+
async function runOrphanPrune(resourceTypes, options) {
|
|
76
|
+
const groups = collectOrphans(resourceTypes, options.all === true);
|
|
77
|
+
if (groups.length === 0) {
|
|
78
|
+
console.log(chalk.green('No orphans.'));
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
const total = groups.reduce((n, g) => n + g.orphans.length, 0);
|
|
82
|
+
console.log(chalk.bold('Orphans (in version home, not in any source)\n'));
|
|
83
|
+
for (const g of groups) {
|
|
84
|
+
const label = `${g.type} · ${g.agent}@${g.version}`;
|
|
85
|
+
console.log(` ${chalk.cyan(label)} ${g.orphans.join(', ')}`);
|
|
86
|
+
}
|
|
87
|
+
console.log();
|
|
88
|
+
if (options.dryRun) {
|
|
89
|
+
console.log(chalk.gray(`${total} orphan(s). Run without --dry-run to delete.`));
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
if (!options.yes) {
|
|
93
|
+
if (!isInteractiveTerminal()) {
|
|
94
|
+
console.log(chalk.yellow('Non-interactive shell: pass -y to confirm, or --dry-run to preview.'));
|
|
95
|
+
process.exit(1);
|
|
96
|
+
}
|
|
97
|
+
let ok = false;
|
|
98
|
+
try {
|
|
99
|
+
ok = await confirm({
|
|
100
|
+
message: `Delete ${total} orphan${total === 1 ? '' : 's'}?`,
|
|
101
|
+
default: false,
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
catch (err) {
|
|
105
|
+
if (isPromptCancelled(err)) {
|
|
106
|
+
console.log(chalk.gray('Cancelled'));
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
throw err;
|
|
110
|
+
}
|
|
111
|
+
if (!ok) {
|
|
112
|
+
console.log(chalk.gray('Cancelled'));
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
let removed = 0;
|
|
117
|
+
let failures = 0;
|
|
118
|
+
for (const g of groups) {
|
|
119
|
+
for (const name of g.orphans) {
|
|
120
|
+
const r = removeOne(g, name);
|
|
121
|
+
if (r.success) {
|
|
122
|
+
removed++;
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
failures++;
|
|
126
|
+
console.log(chalk.red(` ! ${g.type} ${g.agent}@${g.version} ${name}: ${r.error}`));
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
const summary = `Pruned ${removed} orphan${removed === 1 ? '' : 's'}`;
|
|
131
|
+
console.log(chalk.green(summary) + (failures > 0 ? chalk.red(`, ${failures} failed`) : '') + '.');
|
|
132
|
+
}
|
|
133
|
+
export function registerPruneCommand(program) {
|
|
134
|
+
program
|
|
135
|
+
.command('prune [target]')
|
|
136
|
+
.description('Remove orphan resources (commands/skills/hooks) and/or older duplicate version installs')
|
|
137
|
+
.option('--all', 'For orphan cleanup: sweep every installed version (default: current default version per agent)')
|
|
138
|
+
.option('--dry-run', 'Show what would be removed without deleting')
|
|
139
|
+
.option('-y, --yes', 'Skip confirmation prompt')
|
|
140
|
+
.addHelpText('after', `
|
|
141
|
+
Targets:
|
|
142
|
+
(none) Orphans across commands, skills, hooks + duplicate versions
|
|
143
|
+
commands Orphan command files only
|
|
144
|
+
skills Orphan skill directories only
|
|
145
|
+
hooks Orphan hook scripts only
|
|
146
|
+
versions Older duplicate version installs only
|
|
147
|
+
<agent> Older duplicate versions for one agent (e.g. 'claude')
|
|
148
|
+
|
|
149
|
+
Examples:
|
|
150
|
+
# Full sweep: orphan resources + duplicate versions for current defaults
|
|
151
|
+
agents prune
|
|
152
|
+
|
|
153
|
+
# Just orphan skills
|
|
154
|
+
agents prune skills
|
|
155
|
+
|
|
156
|
+
# Just version dedup
|
|
157
|
+
agents prune versions
|
|
158
|
+
|
|
159
|
+
# Just version dedup for one agent
|
|
160
|
+
agents prune claude
|
|
161
|
+
|
|
162
|
+
# Sweep every installed version's orphans, not only the defaults
|
|
163
|
+
agents prune --all
|
|
164
|
+
|
|
165
|
+
# Preview without deleting
|
|
166
|
+
agents prune --dry-run
|
|
167
|
+
|
|
168
|
+
What's an orphan?
|
|
169
|
+
A command, skill, or hook present inside a version home but missing from every
|
|
170
|
+
configured source (project .agents/, central ~/.agents/, and any enabled extra
|
|
171
|
+
repos). Usually leftovers from a resource that was deleted or moved but never
|
|
172
|
+
reconciled into the version install.
|
|
173
|
+
|
|
174
|
+
What this does NOT do:
|
|
175
|
+
This is destructive cleanup only. Adds and updates flow through the auto-sync
|
|
176
|
+
that runs when you launch the agent — there is no manual sync verb.
|
|
177
|
+
`)
|
|
178
|
+
.action(async (target, options) => {
|
|
179
|
+
const parsed = parseTarget(target);
|
|
180
|
+
if (parsed.resourceTypes.length > 0) {
|
|
181
|
+
await runOrphanPrune(parsed.resourceTypes, options);
|
|
182
|
+
if (parsed.includeVersions)
|
|
183
|
+
console.log();
|
|
184
|
+
}
|
|
185
|
+
if (parsed.includeVersions) {
|
|
186
|
+
const versionLabel = parsed.versionAgent ? ` for ${parsed.versionAgent}` : '';
|
|
187
|
+
console.log(chalk.bold(`Duplicate versions${versionLabel}`));
|
|
188
|
+
await pruneDuplicates(parsed.versionAgent, options.yes === true, options.dryRun === true);
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
}
|
package/dist/commands/pty.d.ts
CHANGED
package/dist/commands/pty.js
CHANGED
|
@@ -19,6 +19,7 @@ import chalk from 'chalk';
|
|
|
19
19
|
import { ptyRequest, unescapeInput } from '../lib/pty-client.js';
|
|
20
20
|
import { isPtyServerRunning, runPtyServer, getPtyPidPath, getPtyLogPath } from '../lib/pty-server.js';
|
|
21
21
|
import * as fs from 'fs';
|
|
22
|
+
/** Register the `agents pty` command tree. */
|
|
22
23
|
export function registerPtyCommands(program) {
|
|
23
24
|
const pty = program
|
|
24
25
|
.command('pty')
|
|
@@ -376,6 +377,7 @@ Example:
|
|
|
376
377
|
await runPtyServer();
|
|
377
378
|
});
|
|
378
379
|
}
|
|
380
|
+
/** Format a millisecond duration as a compact human-readable string (e.g. "5m", "2h 30m"). */
|
|
379
381
|
function formatAge(ms) {
|
|
380
382
|
const secs = Math.floor(ms / 1000);
|
|
381
383
|
if (secs < 60)
|
|
@@ -386,4 +388,3 @@ function formatAge(ms) {
|
|
|
386
388
|
const hours = Math.floor(mins / 60);
|
|
387
389
|
return `${hours}h ${mins % 60}m`;
|
|
388
390
|
}
|
|
389
|
-
//# sourceMappingURL=pty.js.map
|
package/dist/commands/pull.d.ts
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Config pull command.
|
|
3
|
+
*
|
|
4
|
+
* Registers the `agents pull` command which clones or updates the
|
|
5
|
+
* system ~/.agents-system/ git repo and syncs CLI versions, MCP servers,
|
|
6
|
+
* resources, and hooks to installed agent versions.
|
|
7
|
+
*/
|
|
1
8
|
import type { Command } from 'commander';
|
|
9
|
+
/** Register the `agents pull` command. */
|
|
2
10
|
export declare function registerPullCommand(program: Command): void;
|
|
3
|
-
//# sourceMappingURL=pull.d.ts.map
|
package/dist/commands/pull.js
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Config pull command.
|
|
3
|
+
*
|
|
4
|
+
* Registers the `agents pull` command which clones or updates the
|
|
5
|
+
* system ~/.agents-system/ git repo and syncs CLI versions, MCP servers,
|
|
6
|
+
* resources, and hooks to installed agent versions.
|
|
7
|
+
*/
|
|
1
8
|
import chalk from 'chalk';
|
|
2
9
|
import ora from 'ora';
|
|
3
|
-
import { AGENTS, ALL_AGENT_IDS, MCP_CAPABLE_AGENTS, getAllCliStates, registerMcpToTargets, isAgentName, resolveAgentName, agentLabel, } from '../lib/agents.js';
|
|
10
|
+
import { AGENTS, ALL_AGENT_IDS, HOOKS_CAPABLE_AGENTS, MCP_CAPABLE_AGENTS, getAllCliStates, registerMcpToTargets, isAgentName, resolveAgentName, agentLabel, } from '../lib/agents.js';
|
|
4
11
|
import { readManifest, MANIFEST_FILENAME, } from '../lib/manifest.js';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { isGitRepo, cloneIntoExisting, pullRepo, pullFromUpstream, parseSource, getGitHubUsername, checkGitHubRepoExists, hasUpstreamRemote, getUpstreamUrl, } from '../lib/git.js';
|
|
12
|
+
import { getUserAgentsDir, ensureAgentsDir, getEnabledExtraRepos, } from '../lib/state.js';
|
|
13
|
+
import { isGitRepo, pullRepo, isSystemRepoOrigin, } from '../lib/git.js';
|
|
8
14
|
import * as fs from 'fs';
|
|
9
15
|
import * as path from 'path';
|
|
10
16
|
import { installVersion, listInstalledVersions, getGlobalDefault, setGlobalDefault, getVersionHomePath, syncResourcesToVersion, getAvailableResources, getActuallySyncedResources, getNewResources, hasNewResources, promptNewResourceSelection, promptResourceSelection, resolveConfiguredAgentTargets, } from '../lib/versions.js';
|
|
@@ -12,24 +18,43 @@ import { ensureShimCurrent, isShimsInPath, addShimsToPath, getPathSetupInstructi
|
|
|
12
18
|
import { parseHookManifest, registerHooksToSettings } from '../lib/hooks.js';
|
|
13
19
|
import { select } from '@inquirer/prompts';
|
|
14
20
|
import { isInteractiveTerminal, isPromptCancelled } from './utils.js';
|
|
21
|
+
/**
|
|
22
|
+
* Old repo layout stored promptcuts under claude/promptcuts.yaml (agent-scoped).
|
|
23
|
+
* The new layout is ~/.agents-system/promptcuts.yaml at the repo root — the hook
|
|
24
|
+
* reads from a fixed path so it survives version upgrades. If the root file
|
|
25
|
+
* doesn't exist yet but an agent-scoped one does, hoist the first one found.
|
|
26
|
+
*/
|
|
27
|
+
function migratePromptcutsToRoot(agentsDir) {
|
|
28
|
+
const rootPath = path.join(agentsDir, 'promptcuts.yaml');
|
|
29
|
+
if (fs.existsSync(rootPath))
|
|
30
|
+
return;
|
|
31
|
+
const agentDirs = ['claude', 'codex', 'cursor', 'gemini', 'opencode'];
|
|
32
|
+
for (const dir of agentDirs) {
|
|
33
|
+
const legacyPath = path.join(agentsDir, dir, 'promptcuts.yaml');
|
|
34
|
+
if (fs.existsSync(legacyPath)) {
|
|
35
|
+
try {
|
|
36
|
+
fs.renameSync(legacyPath, rootPath);
|
|
37
|
+
console.log(chalk.gray(`Moved ${dir}/promptcuts.yaml → promptcuts.yaml (repo root)`));
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
// Best-effort migration; hook still works if the user moves it manually.
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
/** Register the `agents pull` command. */
|
|
15
47
|
export function registerPullCommand(program) {
|
|
16
48
|
program
|
|
17
|
-
.command('pull [
|
|
18
|
-
.description('
|
|
49
|
+
.command('pull [agent]')
|
|
50
|
+
.description('Pull your user repo at ~/.agents/ and refresh installed agent versions.')
|
|
19
51
|
.option('-y, --yes', 'Auto-sync all resources without prompting')
|
|
20
52
|
.option('--skip-clis', 'Pull config changes but do not install or upgrade agent CLIs')
|
|
21
|
-
.option('--upstream', 'Pull from the upstream remote instead of origin (for forked repos)')
|
|
22
53
|
.addHelpText('after', `
|
|
23
54
|
Examples:
|
|
24
|
-
# First time: clone
|
|
25
|
-
agents pull gh:yourname/.agents
|
|
26
|
-
|
|
27
|
-
# Update your config from origin (GitHub)
|
|
55
|
+
# First time: clone the system repo into ~/.agents-system/
|
|
28
56
|
agents pull
|
|
29
57
|
|
|
30
|
-
# Pull updates from the upstream default repo (after you've forked)
|
|
31
|
-
agents pull --upstream
|
|
32
|
-
|
|
33
58
|
# Sync only one agent's config
|
|
34
59
|
agents pull claude
|
|
35
60
|
|
|
@@ -37,9 +62,8 @@ Examples:
|
|
|
37
62
|
agents pull -y
|
|
38
63
|
|
|
39
64
|
When to use:
|
|
40
|
-
- Initial setup: clone
|
|
41
|
-
- Daily sync: pull
|
|
42
|
-
- Upstream updates: get new skills, commands, or MCP servers from the default repo
|
|
65
|
+
- Initial setup: clone the system repo to a new machine
|
|
66
|
+
- Daily sync: pull the latest system skills, commands, or MCP servers
|
|
43
67
|
- Per-agent: sync just one agent's config without touching others
|
|
44
68
|
|
|
45
69
|
What it syncs:
|
|
@@ -51,102 +75,44 @@ What it syncs:
|
|
|
51
75
|
|
|
52
76
|
Skip CLI installs with --skip-clis when you only want config updates, not version changes.
|
|
53
77
|
`)
|
|
54
|
-
.action(async (arg1,
|
|
78
|
+
.action(async (arg1, options) => {
|
|
79
|
+
// Deprecation banner — `agents pull` is on its way out. agents-cli now
|
|
80
|
+
// auto-syncs the system repo in the background and surfaces upstream
|
|
81
|
+
// changes for user/extra repos as one-line notices. Repo lifecycle is
|
|
82
|
+
// managed under `agents repo`. We keep this command functional today
|
|
83
|
+
// because `agents init` still invokes it for first-time setup; once
|
|
84
|
+
// init is refactored to call the bootstrap helpers directly, this
|
|
85
|
+
// command will hard-error like `agents memory` does.
|
|
86
|
+
if (!options.yes && process.argv[2] === 'pull') {
|
|
87
|
+
process.stderr.write('agents-cli: "agents pull" is deprecated.\n' +
|
|
88
|
+
' First-time setup: agents init\n' +
|
|
89
|
+
' Force a sync now: agents repo pull\n' +
|
|
90
|
+
' Push your repo: agents repo push\n\n');
|
|
91
|
+
}
|
|
55
92
|
const skipPrompts = options.yes || !isInteractiveTerminal();
|
|
56
|
-
// Parse source and agent filter from positional args
|
|
57
|
-
let targetSource;
|
|
58
93
|
let agentFilter;
|
|
59
94
|
if (arg1) {
|
|
60
95
|
if (isAgentName(arg1)) {
|
|
61
|
-
// agents pull claude
|
|
62
96
|
agentFilter = resolveAgentName(arg1);
|
|
63
97
|
}
|
|
64
98
|
else {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
if (arg2 && isAgentName(arg2)) {
|
|
68
|
-
agentFilter = resolveAgentName(arg2);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
const agentsDir = getAgentsDir();
|
|
73
|
-
ensureAgentsDir();
|
|
74
|
-
// Handle --upstream: pull from upstream remote
|
|
75
|
-
if (options.upstream) {
|
|
76
|
-
if (!isGitRepo(agentsDir)) {
|
|
77
|
-
console.log(chalk.red('~/.agents/ is not a git repository.'));
|
|
78
|
-
console.log(chalk.gray('\nInitialize first: agents pull'));
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
if (!await hasUpstreamRemote(agentsDir)) {
|
|
82
|
-
console.log(chalk.red('No upstream remote configured.'));
|
|
83
|
-
console.log(chalk.gray('\nIf you forked from the system repo, run: agents fork'));
|
|
84
|
-
console.log(chalk.gray('This will set up the upstream remote automatically.'));
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
// Migration nudge: one-time notice if upstream still points at the legacy personal repo.
|
|
88
|
-
const legacySlug = systemRepoSlug(LEGACY_SYSTEM_REPO).toLowerCase();
|
|
89
|
-
const currentSlug = systemRepoSlug(DEFAULT_SYSTEM_REPO);
|
|
90
|
-
const nudgeMarker = path.join(agentsDir, '.migration-nudge-shown');
|
|
91
|
-
const upstreamUrl = await getUpstreamUrl(agentsDir);
|
|
92
|
-
if (upstreamUrl && upstreamUrl.toLowerCase().includes(legacySlug) && !fs.existsSync(nudgeMarker)) {
|
|
93
|
-
console.log(chalk.yellow(`\nYour upstream points at a personal repo (${legacySlug}).`));
|
|
94
|
-
console.log(chalk.yellow(`The curated upstream is now ${currentSlug}.`));
|
|
95
|
-
console.log(chalk.gray('To switch:'));
|
|
96
|
-
console.log(chalk.cyan(` cd ~/.agents && git remote set-url upstream git@github.com:${currentSlug}.git\n`));
|
|
97
|
-
try {
|
|
98
|
-
fs.writeFileSync(nudgeMarker, new Date().toISOString() + '\n');
|
|
99
|
-
}
|
|
100
|
-
catch { /* best-effort */ }
|
|
101
|
-
}
|
|
102
|
-
const spinner = ora('Pulling from upstream...').start();
|
|
103
|
-
const result = await pullFromUpstream(agentsDir);
|
|
104
|
-
if (!result.success) {
|
|
105
|
-
spinner.fail(`Failed: ${result.error}`);
|
|
99
|
+
console.log(chalk.red(`Invalid agent: ${arg1}`));
|
|
100
|
+
console.log(chalk.gray(`Available: ${ALL_AGENT_IDS.join(', ')}`));
|
|
106
101
|
return;
|
|
107
102
|
}
|
|
108
|
-
spinner.succeed(`Merged upstream changes (${result.commit})`);
|
|
109
|
-
// Continue with the rest of the sync (CLI versions, MCP, resources)
|
|
110
|
-
// Skip the source determination since we already pulled
|
|
111
|
-
targetSource = 'existing';
|
|
112
|
-
}
|
|
113
|
-
// Determine source
|
|
114
|
-
const meta = readMeta();
|
|
115
|
-
if (!targetSource) {
|
|
116
|
-
// Check if ~/.agents/ is already a git repo
|
|
117
|
-
if (isGitRepo(agentsDir)) {
|
|
118
|
-
targetSource = 'existing';
|
|
119
|
-
}
|
|
120
|
-
else {
|
|
121
|
-
// Try to infer from GitHub username
|
|
122
|
-
const spinner = ora('Checking GitHub...').start();
|
|
123
|
-
const username = await getGitHubUsername();
|
|
124
|
-
if (username) {
|
|
125
|
-
const repoExists = await checkGitHubRepoExists(username, '.agents');
|
|
126
|
-
if (repoExists) {
|
|
127
|
-
targetSource = `gh:${username}/.agents`;
|
|
128
|
-
spinner.succeed(`Found ${username}/.agents`);
|
|
129
|
-
}
|
|
130
|
-
else {
|
|
131
|
-
spinner.info(`No .agents repo found for ${username}`);
|
|
132
|
-
console.log(chalk.gray('\nTo create one:'));
|
|
133
|
-
console.log(chalk.cyan(' gh repo create .agents --public'));
|
|
134
|
-
console.log(chalk.gray('\nThen run: agents pull'));
|
|
135
|
-
return;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
else {
|
|
139
|
-
// Fall back to system default repo
|
|
140
|
-
targetSource = DEFAULT_SYSTEM_REPO;
|
|
141
|
-
spinner.info(`Using default: ${DEFAULT_SYSTEM_REPO}`);
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
103
|
}
|
|
104
|
+
const agentsDir = getUserAgentsDir();
|
|
105
|
+
ensureAgentsDir();
|
|
145
106
|
const spinner = ora('Syncing...').start();
|
|
146
107
|
try {
|
|
147
|
-
let commit;
|
|
148
|
-
if (
|
|
149
|
-
//
|
|
108
|
+
let commit = '';
|
|
109
|
+
if (isGitRepo(agentsDir)) {
|
|
110
|
+
// Don't pull if the remote is the system repo — that's a misconfiguration
|
|
111
|
+
if (await isSystemRepoOrigin(agentsDir)) {
|
|
112
|
+
spinner.fail('~/.agents/ is pointing at the system repo. Use a personal repo instead.');
|
|
113
|
+
console.log(chalk.gray('\nCreate your own repo: agents repo init'));
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
150
116
|
spinner.text = 'Pulling updates...';
|
|
151
117
|
const result = await pullRepo(agentsDir);
|
|
152
118
|
if (!result.success) {
|
|
@@ -157,35 +123,29 @@ Skip CLI installs with --skip-clis when you only want config updates, not versio
|
|
|
157
123
|
spinner.succeed(`Updated to ${commit}`);
|
|
158
124
|
}
|
|
159
125
|
else {
|
|
160
|
-
//
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
126
|
+
// ~/.agents/ is not a git repo yet — skip git pull, proceed with local resource sync
|
|
127
|
+
spinner.succeed('Using local ~/.agents/ (no remote configured)');
|
|
128
|
+
}
|
|
129
|
+
// Pull extra DotAgent repos before resource sync so any new skills /
|
|
130
|
+
// commands they ship land in the version homes on this same run.
|
|
131
|
+
const extraRepos = getEnabledExtraRepos();
|
|
132
|
+
if (extraRepos.length > 0) {
|
|
133
|
+
console.log(chalk.bold(`\nExtra repos (${extraRepos.length}):\n`));
|
|
134
|
+
for (const { alias, dir } of extraRepos) {
|
|
135
|
+
const extraSpinner = ora(`Pulling ${alias}...`).start();
|
|
136
|
+
const result = await pullRepo(dir);
|
|
137
|
+
if (result.success) {
|
|
138
|
+
extraSpinner.succeed(`${alias} -> ${result.commit}`);
|
|
169
139
|
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
}
|
|
173
|
-
else {
|
|
174
|
-
// Clone into existing ~/.agents/
|
|
175
|
-
spinner.text = `Cloning ${targetSource}...`;
|
|
176
|
-
const result = await cloneIntoExisting(targetSource, agentsDir);
|
|
177
|
-
if (!result.success) {
|
|
178
|
-
spinner.fail(`Clone failed: ${result.error}`);
|
|
179
|
-
return;
|
|
140
|
+
else {
|
|
141
|
+
extraSpinner.warn(`${alias}: ${result.error}`);
|
|
180
142
|
}
|
|
181
|
-
commit = result.commit;
|
|
182
|
-
spinner.succeed(`Initialized from ${targetSource}`);
|
|
183
143
|
}
|
|
184
|
-
// Save source to meta
|
|
185
|
-
updateMeta({
|
|
186
|
-
source: parsed.url,
|
|
187
|
-
});
|
|
188
144
|
}
|
|
145
|
+
// One-time migration: promptcuts.yaml moved from agent-scoped
|
|
146
|
+
// (e.g. claude/promptcuts.yaml) to repo root. We move it so the
|
|
147
|
+
// hook at ~/.agents-system/hooks/ can always find it at a fixed path.
|
|
148
|
+
migratePromptcutsToRoot(agentsDir);
|
|
189
149
|
// Read manifest for CLI versions and MCP config
|
|
190
150
|
const manifest = readManifest(agentsDir);
|
|
191
151
|
if (!manifest) {
|
|
@@ -318,12 +278,17 @@ Skip CLI installs with --skip-clis when you only want config updates, not versio
|
|
|
318
278
|
}
|
|
319
279
|
}
|
|
320
280
|
}
|
|
321
|
-
// Register hooks as lifecycle events in
|
|
281
|
+
// Register hooks as lifecycle events in each agent's config file.
|
|
282
|
+
// Claude/codex/gemini all support prompt-time hooks, though only
|
|
283
|
+
// claude can replace the prompt — codex/gemini append via
|
|
284
|
+
// additionalContext. The hook script detects the caller and emits
|
|
285
|
+
// the correct protocol.
|
|
322
286
|
const hookManifest = parseHookManifest();
|
|
323
287
|
if (Object.keys(hookManifest).length > 0) {
|
|
324
288
|
let hookRegistered = 0;
|
|
289
|
+
const hookAgents = new Set(HOOKS_CAPABLE_AGENTS);
|
|
325
290
|
for (const agentId of agentsToSync) {
|
|
326
|
-
if (agentId
|
|
291
|
+
if (!hookAgents.has(agentId))
|
|
327
292
|
continue;
|
|
328
293
|
const versions = listInstalledVersions(agentId);
|
|
329
294
|
const defaultVer = getGlobalDefault(agentId);
|
|
@@ -411,4 +376,3 @@ Skip CLI installs with --skip-clis when you only want config updates, not versio
|
|
|
411
376
|
}
|
|
412
377
|
});
|
|
413
378
|
}
|
|
414
|
-
//# sourceMappingURL=pull.js.map
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal memory refresh command.
|
|
3
|
+
*
|
|
4
|
+
* Registers the hidden `agents refresh-memory` command invoked by
|
|
5
|
+
* shims for agents that do not natively resolve @-imports in their
|
|
6
|
+
* memory file. Recompiles memory only when source files have changed.
|
|
7
|
+
*/
|
|
1
8
|
import { Command } from 'commander';
|
|
2
9
|
/**
|
|
3
10
|
* Hidden command invoked by shims for agents that don't natively resolve
|
|
@@ -6,4 +13,3 @@ import { Command } from 'commander';
|
|
|
6
13
|
* sync. Typical cost: 10-20ms when memory is fresh.
|
|
7
14
|
*/
|
|
8
15
|
export declare function registerRefreshMemoryCommand(program: Command): void;
|
|
9
|
-
//# sourceMappingURL=refresh-memory.d.ts.map
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal memory refresh command.
|
|
3
|
+
*
|
|
4
|
+
* Registers the hidden `agents refresh-memory` command invoked by
|
|
5
|
+
* shims for agents that do not natively resolve @-imports in their
|
|
6
|
+
* memory file. Recompiles memory only when source files have changed.
|
|
7
|
+
*/
|
|
1
8
|
import chalk from 'chalk';
|
|
2
9
|
import { AGENTS } from '../lib/agents.js';
|
|
3
10
|
import { isVersionInstalled } from '../lib/versions.js';
|
|
@@ -42,4 +49,3 @@ export function registerRefreshMemoryCommand(program) {
|
|
|
42
49
|
}
|
|
43
50
|
});
|
|
44
51
|
}
|
|
45
|
-
//# sourceMappingURL=refresh-memory.js.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extra DotAgent repo management.
|
|
3
|
+
*
|
|
4
|
+
* Registers `agents repo add|init|list|remove|enable|disable` which manage
|
|
5
|
+
* additional DotAgent repos alongside the primary ~/.agents-system/ repo so
|
|
6
|
+
* private, work, or team skills can ship separately from public ones.
|
|
7
|
+
*
|
|
8
|
+
* Extras are user-level config: managed clones live at ~/.agents-<alias>/ as
|
|
9
|
+
* peer dirs to ~/.agents/, and user-owned repos may live anywhere. All extras
|
|
10
|
+
* are registered in meta.extraRepos. Sync functions merge their resources into
|
|
11
|
+
* agent version homes after the user repo's (user-wins on name collisions).
|
|
12
|
+
*/
|
|
13
|
+
import type { Command } from 'commander';
|
|
14
|
+
/** Register the `agents repo` command tree. */
|
|
15
|
+
export declare function registerRepoCommands(program: Command): void;
|