@swarmify/agents-cli 1.12.0 → 1.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +33 -0
- package/LICENSE +21 -0
- package/README.md +212 -232
- package/dist/commands/__tests__/sessions.test.js +90 -20
- package/dist/commands/__tests__/sessions.test.js.map +1 -1
- package/dist/commands/cloud.d.ts +11 -0
- package/dist/commands/cloud.d.ts.map +1 -0
- package/dist/commands/cloud.js +363 -0
- package/dist/commands/cloud.js.map +1 -0
- package/dist/commands/commands.d.ts +9 -0
- package/dist/commands/commands.d.ts.map +1 -1
- package/dist/commands/commands.js +330 -139
- package/dist/commands/commands.js.map +1 -1
- package/dist/commands/daemon.d.ts +8 -0
- package/dist/commands/daemon.d.ts.map +1 -1
- package/dist/commands/daemon.js +38 -222
- package/dist/commands/daemon.js.map +1 -1
- package/dist/commands/drive.d.ts +8 -0
- package/dist/commands/drive.d.ts.map +1 -1
- package/dist/commands/drive.js +70 -7
- package/dist/commands/drive.js.map +1 -1
- package/dist/commands/exec.d.ts +9 -1
- package/dist/commands/exec.d.ts.map +1 -1
- package/dist/commands/exec.js +198 -24
- package/dist/commands/exec.js.map +1 -1
- package/dist/commands/factory.d.ts +11 -0
- package/dist/commands/factory.d.ts.map +1 -0
- package/dist/commands/factory.js +445 -0
- package/dist/commands/factory.js.map +1 -0
- package/dist/commands/fork.d.ts +8 -0
- package/dist/commands/fork.d.ts.map +1 -1
- package/dist/commands/fork.js +38 -4
- package/dist/commands/fork.js.map +1 -1
- package/dist/commands/hooks.d.ts +9 -0
- package/dist/commands/hooks.d.ts.map +1 -1
- package/dist/commands/hooks.js +252 -18
- package/dist/commands/hooks.js.map +1 -1
- package/dist/commands/init.d.ts +15 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +137 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/mcp.d.ts +9 -0
- package/dist/commands/mcp.d.ts.map +1 -1
- package/dist/commands/mcp.js +250 -169
- package/dist/commands/mcp.js.map +1 -1
- package/dist/commands/models.d.ts +11 -0
- package/dist/commands/models.d.ts.map +1 -0
- package/dist/commands/models.js +170 -0
- package/dist/commands/models.js.map +1 -0
- package/dist/commands/packages.d.ts +8 -0
- package/dist/commands/packages.d.ts.map +1 -1
- package/dist/commands/packages.js +155 -14
- package/dist/commands/packages.js.map +1 -1
- package/dist/commands/permissions.d.ts +9 -0
- package/dist/commands/permissions.d.ts.map +1 -1
- package/dist/commands/permissions.js +72 -13
- package/dist/commands/permissions.js.map +1 -1
- package/dist/commands/plugins.d.ts +8 -0
- package/dist/commands/plugins.d.ts.map +1 -1
- package/dist/commands/plugins.js +265 -44
- package/dist/commands/plugins.js.map +1 -1
- package/dist/commands/profiles.d.ts +12 -0
- package/dist/commands/profiles.d.ts.map +1 -0
- package/dist/commands/profiles.js +255 -0
- package/dist/commands/profiles.js.map +1 -0
- package/dist/commands/pty.d.ts +1 -0
- package/dist/commands/pty.d.ts.map +1 -1
- package/dist/commands/pty.js +133 -22
- package/dist/commands/pty.js.map +1 -1
- package/dist/commands/pull.d.ts +8 -0
- package/dist/commands/pull.d.ts.map +1 -1
- package/dist/commands/pull.js +103 -14
- package/dist/commands/pull.js.map +1 -1
- package/dist/commands/push.d.ts +8 -0
- package/dist/commands/push.d.ts.map +1 -1
- package/dist/commands/push.js +37 -3
- package/dist/commands/push.js.map +1 -1
- package/dist/commands/refresh-memory.d.ts +16 -0
- package/dist/commands/refresh-memory.d.ts.map +1 -0
- package/dist/commands/refresh-memory.js +52 -0
- package/dist/commands/refresh-memory.js.map +1 -0
- package/dist/commands/resource-view.d.ts +39 -0
- package/dist/commands/resource-view.d.ts.map +1 -0
- package/dist/commands/resource-view.js +197 -0
- package/dist/commands/resource-view.js.map +1 -0
- package/dist/commands/routines.d.ts +8 -0
- package/dist/commands/routines.d.ts.map +1 -1
- package/dist/commands/routines.js +163 -34
- package/dist/commands/routines.js.map +1 -1
- package/dist/commands/rules.d.ts +9 -0
- package/dist/commands/rules.d.ts.map +1 -1
- package/dist/commands/rules.js +83 -12
- package/dist/commands/rules.js.map +1 -1
- package/dist/commands/secrets.d.ts +11 -0
- package/dist/commands/secrets.d.ts.map +1 -0
- package/dist/commands/secrets.js +352 -0
- package/dist/commands/secrets.js.map +1 -0
- package/dist/commands/sessions-picker.d.ts +18 -0
- package/dist/commands/sessions-picker.d.ts.map +1 -0
- package/dist/commands/sessions-picker.js +265 -0
- package/dist/commands/sessions-picker.js.map +1 -0
- package/dist/commands/sessions.d.ts +15 -0
- package/dist/commands/sessions.d.ts.map +1 -1
- package/dist/commands/sessions.js +700 -263
- package/dist/commands/sessions.js.map +1 -1
- package/dist/commands/skills.d.ts +9 -0
- package/dist/commands/skills.d.ts.map +1 -1
- package/dist/commands/skills.js +355 -233
- package/dist/commands/skills.js.map +1 -1
- package/dist/commands/status.d.ts +7 -0
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +7 -0
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/subagents.d.ts +8 -0
- package/dist/commands/subagents.d.ts.map +1 -1
- package/dist/commands/subagents.js +214 -74
- package/dist/commands/subagents.js.map +1 -1
- package/dist/commands/sync.d.ts +8 -0
- package/dist/commands/sync.d.ts.map +1 -1
- package/dist/commands/sync.js +15 -7
- package/dist/commands/sync.js.map +1 -1
- package/dist/commands/teams-picker.d.ts +18 -0
- package/dist/commands/teams-picker.d.ts.map +1 -0
- package/dist/commands/teams-picker.js +290 -0
- package/dist/commands/teams-picker.js.map +1 -0
- package/dist/commands/teams.d.ts +18 -0
- package/dist/commands/teams.d.ts.map +1 -0
- package/dist/commands/teams.js +1098 -0
- package/dist/commands/teams.js.map +1 -0
- package/dist/commands/utils.d.ts +20 -0
- package/dist/commands/utils.d.ts.map +1 -1
- package/dist/commands/utils.js +34 -0
- package/dist/commands/utils.js.map +1 -1
- package/dist/commands/versions.d.ts +8 -0
- package/dist/commands/versions.d.ts.map +1 -1
- package/dist/commands/versions.js +71 -8
- package/dist/commands/versions.js.map +1 -1
- package/dist/commands/view.d.ts +36 -1
- package/dist/commands/view.d.ts.map +1 -1
- package/dist/commands/view.js +375 -15
- package/dist/commands/view.js.map +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +136 -51
- package/dist/index.js.map +1 -1
- package/dist/lib/__tests__/bugfixes.test.js +3 -3
- package/dist/lib/__tests__/bugfixes.test.js.map +1 -1
- package/dist/lib/__tests__/exec.test.js +125 -19
- package/dist/lib/__tests__/exec.test.js.map +1 -1
- package/dist/lib/__tests__/hooks.test.d.ts +2 -0
- package/dist/lib/__tests__/hooks.test.d.ts.map +1 -0
- package/dist/lib/__tests__/hooks.test.js +203 -0
- package/dist/lib/__tests__/hooks.test.js.map +1 -0
- package/dist/lib/__tests__/memory-compile.test.d.ts +2 -0
- package/dist/lib/__tests__/memory-compile.test.d.ts.map +1 -0
- package/dist/lib/__tests__/memory-compile.test.js +95 -0
- package/dist/lib/__tests__/memory-compile.test.js.map +1 -0
- package/dist/lib/__tests__/models.test.d.ts +2 -0
- package/dist/lib/__tests__/models.test.d.ts.map +1 -0
- package/dist/lib/__tests__/models.test.js +239 -0
- package/dist/lib/__tests__/models.test.js.map +1 -0
- package/dist/lib/__tests__/rotate.test.d.ts +2 -0
- package/dist/lib/__tests__/rotate.test.d.ts.map +1 -0
- package/dist/lib/__tests__/rotate.test.js +80 -0
- package/dist/lib/__tests__/rotate.test.js.map +1 -0
- package/dist/lib/__tests__/secrets-bundles.test.d.ts +2 -0
- package/dist/lib/__tests__/secrets-bundles.test.d.ts.map +1 -0
- package/dist/lib/__tests__/secrets-bundles.test.js +104 -0
- package/dist/lib/__tests__/secrets-bundles.test.js.map +1 -0
- package/dist/lib/__tests__/secrets.test.d.ts +2 -0
- package/dist/lib/__tests__/secrets.test.d.ts.map +1 -0
- package/dist/lib/__tests__/secrets.test.js +90 -0
- package/dist/lib/__tests__/secrets.test.js.map +1 -0
- package/dist/lib/__tests__/shims.test.d.ts +2 -0
- package/dist/lib/__tests__/shims.test.d.ts.map +1 -0
- package/dist/lib/__tests__/shims.test.js +39 -0
- package/dist/lib/__tests__/shims.test.js.map +1 -0
- package/dist/lib/__tests__/usage.test.js +4 -2
- package/dist/lib/__tests__/usage.test.js.map +1 -1
- package/dist/lib/__tests__/versions.test.d.ts +2 -0
- package/dist/lib/__tests__/versions.test.d.ts.map +1 -0
- package/dist/lib/__tests__/versions.test.js +63 -0
- package/dist/lib/__tests__/versions.test.js.map +1 -0
- package/dist/lib/agents.d.ts +53 -1
- package/dist/lib/agents.d.ts.map +1 -1
- package/dist/lib/agents.js +178 -37
- package/dist/lib/agents.js.map +1 -1
- package/dist/lib/artifact-actions.d.ts +8 -3
- package/dist/lib/artifact-actions.d.ts.map +1 -1
- package/dist/lib/artifact-actions.js +8 -5
- package/dist/lib/artifact-actions.js.map +1 -1
- package/dist/lib/cloud/codex.d.ts +26 -0
- package/dist/lib/cloud/codex.d.ts.map +1 -0
- package/dist/lib/cloud/codex.js +237 -0
- package/dist/lib/cloud/codex.js.map +1 -0
- package/dist/lib/cloud/factory.d.ts +32 -0
- package/dist/lib/cloud/factory.d.ts.map +1 -0
- package/dist/lib/cloud/factory.js +43 -0
- package/dist/lib/cloud/factory.js.map +1 -0
- package/dist/lib/cloud/registry.d.ts +16 -0
- package/dist/lib/cloud/registry.d.ts.map +1 -0
- package/dist/lib/cloud/registry.js +68 -0
- package/dist/lib/cloud/registry.js.map +1 -0
- package/dist/lib/cloud/rush.d.ts +37 -0
- package/dist/lib/cloud/rush.d.ts.map +1 -0
- package/dist/lib/cloud/rush.js +230 -0
- package/dist/lib/cloud/rush.js.map +1 -0
- package/dist/lib/cloud/rush.test.d.ts +2 -0
- package/dist/lib/cloud/rush.test.d.ts.map +1 -0
- package/dist/lib/cloud/rush.test.js +63 -0
- package/dist/lib/cloud/rush.test.js.map +1 -0
- package/dist/lib/cloud/store.d.ts +23 -0
- package/dist/lib/cloud/store.d.ts.map +1 -0
- package/dist/lib/cloud/store.js +116 -0
- package/dist/lib/cloud/store.js.map +1 -0
- package/dist/lib/cloud/stream.d.ts +24 -0
- package/dist/lib/cloud/stream.d.ts.map +1 -0
- package/dist/lib/cloud/stream.js +145 -0
- package/dist/lib/cloud/stream.js.map +1 -0
- package/dist/lib/cloud/types.d.ts +109 -0
- package/dist/lib/cloud/types.d.ts.map +1 -0
- package/dist/lib/cloud/types.js +33 -0
- package/dist/lib/cloud/types.js.map +1 -0
- package/dist/lib/cloud/types.test.d.ts +2 -0
- package/dist/lib/cloud/types.test.d.ts.map +1 -0
- package/dist/lib/cloud/types.test.js +41 -0
- package/dist/lib/cloud/types.test.js.map +1 -0
- package/dist/lib/commands.d.ts +67 -0
- package/dist/lib/commands.d.ts.map +1 -1
- package/dist/lib/commands.js +161 -2
- package/dist/lib/commands.js.map +1 -1
- package/dist/lib/convert.d.ts +10 -0
- package/dist/lib/convert.d.ts.map +1 -1
- package/dist/lib/convert.js +9 -0
- package/dist/lib/convert.js.map +1 -1
- package/dist/lib/daemon.d.ts +21 -0
- package/dist/lib/daemon.d.ts.map +1 -1
- package/dist/lib/daemon.js +21 -0
- package/dist/lib/daemon.js.map +1 -1
- package/dist/lib/drive-sync.d.ts +18 -0
- package/dist/lib/drive-sync.d.ts.map +1 -1
- package/dist/lib/drive-sync.js +16 -0
- package/dist/lib/drive-sync.js.map +1 -1
- package/dist/lib/exec.d.ts +64 -3
- package/dist/lib/exec.d.ts.map +1 -1
- package/dist/lib/exec.js +218 -80
- package/dist/lib/exec.js.map +1 -1
- package/dist/lib/factory/__tests__/config.test.d.ts +2 -0
- package/dist/lib/factory/__tests__/config.test.d.ts.map +1 -0
- package/dist/lib/factory/__tests__/config.test.js +128 -0
- package/dist/lib/factory/__tests__/config.test.js.map +1 -0
- package/dist/lib/factory/config.d.ts +49 -0
- package/dist/lib/factory/config.d.ts.map +1 -0
- package/dist/lib/factory/config.js +127 -0
- package/dist/lib/factory/config.js.map +1 -0
- package/dist/lib/factory.js +1 -1
- package/dist/lib/factory.js.map +1 -1
- package/dist/lib/git.d.ts +16 -1
- package/dist/lib/git.d.ts.map +1 -1
- package/dist/lib/git.js +33 -4
- package/dist/lib/git.js.map +1 -1
- package/dist/lib/help.d.ts +7 -0
- package/dist/lib/help.d.ts.map +1 -1
- package/dist/lib/help.js +3 -0
- package/dist/lib/help.js.map +1 -1
- package/dist/lib/hooks.d.ts +59 -3
- package/dist/lib/hooks.d.ts.map +1 -1
- package/dist/lib/hooks.js +413 -33
- package/dist/lib/hooks.js.map +1 -1
- package/dist/lib/ledger/__tests__/local.test.d.ts +2 -0
- package/dist/lib/ledger/__tests__/local.test.d.ts.map +1 -0
- package/dist/lib/ledger/__tests__/local.test.js +177 -0
- package/dist/lib/ledger/__tests__/local.test.js.map +1 -0
- package/dist/lib/ledger/__tests__/sync.test.d.ts +2 -0
- package/dist/lib/ledger/__tests__/sync.test.d.ts.map +1 -0
- package/dist/lib/ledger/__tests__/sync.test.js +117 -0
- package/dist/lib/ledger/__tests__/sync.test.js.map +1 -0
- package/dist/lib/ledger/index.d.ts +18 -0
- package/dist/lib/ledger/index.d.ts.map +1 -0
- package/dist/lib/ledger/index.js +32 -0
- package/dist/lib/ledger/index.js.map +1 -0
- package/dist/lib/ledger/local.d.ts +22 -0
- package/dist/lib/ledger/local.d.ts.map +1 -0
- package/dist/lib/ledger/local.js +333 -0
- package/dist/lib/ledger/local.js.map +1 -0
- package/dist/lib/ledger/r2.d.ts +41 -0
- package/dist/lib/ledger/r2.d.ts.map +1 -0
- package/dist/lib/ledger/r2.js +335 -0
- package/dist/lib/ledger/r2.js.map +1 -0
- package/dist/lib/ledger/sync.d.ts +33 -0
- package/dist/lib/ledger/sync.d.ts.map +1 -0
- package/dist/lib/ledger/sync.js +106 -0
- package/dist/lib/ledger/sync.js.map +1 -0
- package/dist/lib/ledger/types.d.ts +100 -0
- package/dist/lib/ledger/types.d.ts.map +1 -0
- package/dist/lib/ledger/types.js +21 -0
- package/dist/lib/ledger/types.js.map +1 -0
- package/dist/lib/manifest.d.ts +6 -0
- package/dist/lib/manifest.d.ts.map +1 -1
- package/dist/lib/manifest.js +12 -0
- package/dist/lib/manifest.js.map +1 -1
- package/dist/lib/markdown.d.ts.map +1 -1
- package/dist/lib/markdown.js +6 -0
- package/dist/lib/markdown.js.map +1 -1
- package/dist/lib/mcp.d.ts +0 -9
- package/dist/lib/mcp.d.ts.map +1 -1
- package/dist/lib/mcp.js +0 -20
- package/dist/lib/mcp.js.map +1 -1
- package/dist/lib/memory-compile.d.ts +65 -0
- package/dist/lib/memory-compile.d.ts.map +1 -0
- package/dist/lib/memory-compile.js +174 -0
- package/dist/lib/memory-compile.js.map +1 -0
- package/dist/lib/memory.d.ts +8 -0
- package/dist/lib/memory.d.ts.map +1 -1
- package/dist/lib/memory.js +8 -0
- package/dist/lib/memory.js.map +1 -1
- package/dist/lib/models.d.ts +98 -0
- package/dist/lib/models.d.ts.map +1 -0
- package/dist/lib/models.js +728 -0
- package/dist/lib/models.js.map +1 -0
- package/dist/lib/permissions.d.ts +24 -1
- package/dist/lib/permissions.d.ts.map +1 -1
- package/dist/lib/permissions.js +52 -3
- package/dist/lib/permissions.js.map +1 -1
- package/dist/lib/picker.d.ts +27 -0
- package/dist/lib/picker.d.ts.map +1 -0
- package/dist/lib/picker.js +110 -0
- package/dist/lib/picker.js.map +1 -0
- package/dist/lib/plugins.d.ts +22 -0
- package/dist/lib/plugins.d.ts.map +1 -1
- package/dist/lib/plugins.js +114 -0
- package/dist/lib/plugins.js.map +1 -1
- package/dist/lib/profiles-keychain.d.ts +11 -0
- package/dist/lib/profiles-keychain.d.ts.map +1 -0
- package/dist/lib/profiles-keychain.js +14 -0
- package/dist/lib/profiles-keychain.js.map +1 -0
- package/dist/lib/profiles-presets.d.ts +25 -0
- package/dist/lib/profiles-presets.d.ts.map +1 -0
- package/dist/lib/profiles-presets.js +104 -0
- package/dist/lib/profiles-presets.js.map +1 -0
- package/dist/lib/profiles.d.ts +70 -0
- package/dist/lib/profiles.d.ts.map +1 -0
- package/dist/lib/profiles.js +145 -0
- package/dist/lib/profiles.js.map +1 -0
- package/dist/lib/pty-client.d.ts +1 -0
- package/dist/lib/pty-client.d.ts.map +1 -1
- package/dist/lib/pty-client.js.map +1 -1
- package/dist/lib/pty-server.d.ts +5 -0
- package/dist/lib/pty-server.d.ts.map +1 -1
- package/dist/lib/pty-server.js +5 -0
- package/dist/lib/pty-server.js.map +1 -1
- package/dist/lib/registry.d.ts +17 -0
- package/dist/lib/registry.d.ts.map +1 -1
- package/dist/lib/registry.js +17 -0
- package/dist/lib/registry.js.map +1 -1
- package/dist/lib/resources.d.ts +5 -0
- package/dist/lib/resources.d.ts.map +1 -1
- package/dist/lib/resources.js.map +1 -1
- package/dist/lib/rotate.d.ts +58 -0
- package/dist/lib/rotate.d.ts.map +1 -0
- package/dist/lib/rotate.js +93 -0
- package/dist/lib/rotate.js.map +1 -0
- package/dist/lib/routines.d.ts +30 -1
- package/dist/lib/routines.d.ts.map +1 -1
- package/dist/lib/routines.js +31 -4
- package/dist/lib/routines.js.map +1 -1
- package/dist/lib/runner.d.ts +14 -0
- package/dist/lib/runner.d.ts.map +1 -1
- package/dist/lib/runner.js +45 -11
- package/dist/lib/runner.js.map +1 -1
- package/dist/lib/sandbox.d.ts +16 -0
- package/dist/lib/sandbox.d.ts.map +1 -1
- package/dist/lib/sandbox.js +19 -2
- package/dist/lib/sandbox.js.map +1 -1
- package/dist/lib/scheduler.d.ts +8 -0
- package/dist/lib/scheduler.d.ts.map +1 -1
- package/dist/lib/scheduler.js +8 -0
- package/dist/lib/scheduler.js.map +1 -1
- package/dist/lib/secrets-bundles.d.ts +38 -0
- package/dist/lib/secrets-bundles.d.ts.map +1 -0
- package/dist/lib/secrets-bundles.js +176 -0
- package/dist/lib/secrets-bundles.js.map +1 -0
- package/dist/lib/secrets.d.ts +53 -0
- package/dist/lib/secrets.d.ts.map +1 -0
- package/dist/lib/secrets.js +140 -0
- package/dist/lib/secrets.js.map +1 -0
- package/dist/lib/session/__tests__/db.test.d.ts +2 -0
- package/dist/lib/session/__tests__/db.test.d.ts.map +1 -0
- package/dist/lib/session/__tests__/db.test.js +54 -0
- package/dist/lib/session/__tests__/db.test.js.map +1 -0
- package/dist/lib/session/__tests__/discover.test.js +54 -91
- package/dist/lib/session/__tests__/discover.test.js.map +1 -1
- package/dist/lib/session/__tests__/prompt.test.d.ts +2 -0
- package/dist/lib/session/__tests__/prompt.test.d.ts.map +1 -0
- package/dist/lib/session/__tests__/prompt.test.js +44 -0
- package/dist/lib/session/__tests__/prompt.test.js.map +1 -0
- package/dist/lib/session/__tests__/render.test.d.ts +2 -0
- package/dist/lib/session/__tests__/render.test.d.ts.map +1 -0
- package/dist/lib/session/__tests__/render.test.js +602 -0
- package/dist/lib/session/__tests__/render.test.js.map +1 -0
- package/dist/lib/session/artifacts.d.ts +15 -0
- package/dist/lib/session/artifacts.d.ts.map +1 -0
- package/dist/lib/session/artifacts.js +86 -0
- package/dist/lib/session/artifacts.js.map +1 -0
- package/dist/lib/session/db.d.ts +140 -0
- package/dist/lib/session/db.d.ts.map +1 -0
- package/dist/lib/session/db.js +599 -0
- package/dist/lib/session/db.js.map +1 -0
- package/dist/lib/session/discover.d.ts +44 -32
- package/dist/lib/session/discover.d.ts.map +1 -1
- package/dist/lib/session/discover.js +418 -464
- package/dist/lib/session/discover.js.map +1 -1
- package/dist/lib/session/parse.d.ts +11 -0
- package/dist/lib/session/parse.d.ts.map +1 -1
- package/dist/lib/session/parse.js +50 -0
- package/dist/lib/session/parse.js.map +1 -1
- package/dist/lib/session/prompt.d.ts +10 -0
- package/dist/lib/session/prompt.d.ts.map +1 -1
- package/dist/lib/session/prompt.js +38 -2
- package/dist/lib/session/prompt.js.map +1 -1
- package/dist/lib/session/prompt.test.d.ts +2 -0
- package/dist/lib/session/prompt.test.d.ts.map +1 -0
- package/dist/lib/session/prompt.test.js +57 -0
- package/dist/lib/session/prompt.test.js.map +1 -0
- package/dist/lib/session/render.d.ts +91 -10
- package/dist/lib/session/render.d.ts.map +1 -1
- package/dist/lib/session/render.js +708 -180
- package/dist/lib/session/render.js.map +1 -1
- package/dist/lib/session/team-filter.d.ts +35 -0
- package/dist/lib/session/team-filter.d.ts.map +1 -0
- package/dist/lib/session/team-filter.js +75 -0
- package/dist/lib/session/team-filter.js.map +1 -0
- package/dist/lib/session/team-filter.test.d.ts +2 -0
- package/dist/lib/session/team-filter.test.d.ts.map +1 -0
- package/dist/lib/session/team-filter.test.js +157 -0
- package/dist/lib/session/team-filter.test.js.map +1 -0
- package/dist/lib/session/types.d.ts +48 -6
- package/dist/lib/session/types.d.ts.map +1 -1
- package/dist/lib/session/types.js +9 -0
- package/dist/lib/session/types.js.map +1 -1
- package/dist/lib/shims.d.ts +101 -2
- package/dist/lib/shims.d.ts.map +1 -1
- package/dist/lib/shims.js +282 -25
- package/dist/lib/shims.js.map +1 -1
- package/dist/lib/skills.d.ts +68 -0
- package/dist/lib/skills.d.ts.map +1 -1
- package/dist/lib/skills.js +267 -1
- package/dist/lib/skills.js.map +1 -1
- package/dist/lib/state.d.ts +41 -2
- package/dist/lib/state.d.ts.map +1 -1
- package/dist/lib/state.js +63 -4
- package/dist/lib/state.js.map +1 -1
- package/dist/lib/subagents.d.ts +9 -0
- package/dist/lib/subagents.d.ts.map +1 -1
- package/dist/lib/subagents.js +9 -1
- package/dist/lib/subagents.js.map +1 -1
- package/dist/lib/teams/__tests__/oracle.test.d.ts +2 -0
- package/dist/lib/teams/__tests__/oracle.test.d.ts.map +1 -0
- package/dist/lib/teams/__tests__/oracle.test.js +89 -0
- package/dist/lib/teams/__tests__/oracle.test.js.map +1 -0
- package/dist/lib/teams/__tests__/supervisor.test.d.ts +2 -0
- package/dist/lib/teams/__tests__/supervisor.test.d.ts.map +1 -0
- package/dist/lib/teams/__tests__/supervisor.test.js +179 -0
- package/dist/lib/teams/__tests__/supervisor.test.js.map +1 -0
- package/dist/lib/teams/agents.d.ts +247 -0
- package/dist/lib/teams/agents.d.ts.map +1 -0
- package/dist/lib/teams/agents.js +1244 -0
- package/dist/lib/teams/agents.js.map +1 -0
- package/dist/lib/teams/api.d.ts +91 -0
- package/dist/lib/teams/api.d.ts.map +1 -0
- package/dist/lib/teams/api.js +239 -0
- package/dist/lib/teams/api.js.map +1 -0
- package/dist/lib/teams/cloud.d.ts +11 -0
- package/dist/lib/teams/cloud.d.ts.map +1 -0
- package/dist/lib/teams/cloud.js +169 -0
- package/dist/lib/teams/cloud.js.map +1 -0
- package/dist/lib/teams/debug.d.ts +8 -0
- package/dist/lib/teams/debug.d.ts.map +1 -0
- package/dist/lib/teams/debug.js +12 -0
- package/dist/lib/teams/debug.js.map +1 -0
- package/dist/lib/teams/file_ops.d.ts +13 -0
- package/dist/lib/teams/file_ops.d.ts.map +1 -0
- package/dist/lib/teams/file_ops.js +66 -0
- package/dist/lib/teams/file_ops.js.map +1 -0
- package/dist/lib/teams/index.d.ts +16 -0
- package/dist/lib/teams/index.d.ts.map +1 -0
- package/dist/lib/teams/index.js +15 -0
- package/dist/lib/teams/index.js.map +1 -0
- package/dist/lib/teams/oracle.d.ts +20 -0
- package/dist/lib/teams/oracle.d.ts.map +1 -0
- package/dist/lib/teams/oracle.js +59 -0
- package/dist/lib/teams/oracle.js.map +1 -0
- package/dist/lib/teams/parsers.d.ts +9 -0
- package/dist/lib/teams/parsers.d.ts.map +1 -0
- package/dist/lib/teams/parsers.js +837 -0
- package/dist/lib/teams/parsers.js.map +1 -0
- package/dist/lib/teams/persistence.d.ts +43 -0
- package/dist/lib/teams/persistence.d.ts.map +1 -0
- package/dist/lib/teams/persistence.js +299 -0
- package/dist/lib/teams/persistence.js.map +1 -0
- package/dist/lib/teams/ralph.d.ts +8 -0
- package/dist/lib/teams/ralph.d.ts.map +1 -0
- package/dist/lib/teams/ralph.js +59 -0
- package/dist/lib/teams/ralph.js.map +1 -0
- package/dist/lib/teams/registry.d.ts +18 -0
- package/dist/lib/teams/registry.d.ts.map +1 -0
- package/dist/lib/teams/registry.js +68 -0
- package/dist/lib/teams/registry.js.map +1 -0
- package/dist/lib/teams/summarizer.d.ts +73 -0
- package/dist/lib/teams/summarizer.d.ts.map +1 -0
- package/dist/lib/teams/summarizer.js +780 -0
- package/dist/lib/teams/summarizer.js.map +1 -0
- package/dist/lib/teams/supervisor.d.ts +49 -0
- package/dist/lib/teams/supervisor.d.ts.map +1 -0
- package/dist/lib/teams/supervisor.js +74 -0
- package/dist/lib/teams/supervisor.js.map +1 -0
- package/dist/lib/template.d.ts +8 -5
- package/dist/lib/template.d.ts.map +1 -1
- package/dist/lib/template.js +8 -5
- package/dist/lib/template.js.map +1 -1
- package/dist/lib/types.d.ts +58 -1
- package/dist/lib/types.d.ts.map +1 -1
- package/dist/lib/types.js +16 -1
- package/dist/lib/types.js.map +1 -1
- package/dist/lib/usage.d.ts +48 -0
- package/dist/lib/usage.d.ts.map +1 -1
- package/dist/lib/usage.js +106 -14
- package/dist/lib/usage.js.map +1 -1
- package/dist/lib/versions.d.ts +12 -1
- package/dist/lib/versions.d.ts.map +1 -1
- package/dist/lib/versions.js +124 -41
- package/dist/lib/versions.js.map +1 -1
- package/package.json +20 -6
- package/scripts/postinstall.js +1 -1
- package/scripts/rebuild-sqlite.sh +46 -0
- package/dist/commands/sessions.test.d.ts +0 -2
- package/dist/commands/sessions.test.d.ts.map +0 -1
- package/dist/commands/sessions.test.js +0 -53
- package/dist/commands/sessions.test.js.map +0 -1
package/dist/commands/skills.js
CHANGED
|
@@ -3,258 +3,98 @@ import ora from 'ora';
|
|
|
3
3
|
import * as fs from 'fs';
|
|
4
4
|
import * as os from 'os';
|
|
5
5
|
import * as path from 'path';
|
|
6
|
-
import { select, checkbox } from '@inquirer/prompts';
|
|
7
|
-
import {
|
|
6
|
+
import { select, checkbox, confirm } from '@inquirer/prompts';
|
|
7
|
+
import { SKILLS_CAPABLE_AGENTS, resolveAgentName, formatAgentError, agentLabel, } from '../lib/agents.js';
|
|
8
8
|
import { cloneRepo } from '../lib/git.js';
|
|
9
|
-
import { discoverSkillsFromRepo, installSkillCentrally, uninstallSkill, listInstalledSkills, listInstalledSkillsWithScope, getSkillInfo, getSkillRules, tryParseSkillMetadata, } from '../lib/skills.js';
|
|
10
|
-
import {
|
|
9
|
+
import { discoverSkillsFromRepo, installSkillCentrally, uninstallSkill, listInstalledSkills, listInstalledSkillsWithScope, getSkillInfo, getSkillRules, getSkillsDir, countSkillFiles, tryParseSkillMetadata, diffVersionSkills, installSkillToVersion, removeSkillFromVersion, iterSkillsCapableVersions, } from '../lib/skills.js';
|
|
10
|
+
import { getGlobalDefault, syncResourcesToVersion, promptAgentVersionSelection, resolveAgentVersionTargets, } from '../lib/versions.js';
|
|
11
11
|
import { recordVersionResources } from '../lib/state.js';
|
|
12
12
|
import { isPromptCancelled, isInteractiveTerminal, parseCommaSeparatedList, printWithPager, requireInteractiveSelection, } from './utils.js';
|
|
13
|
+
import { showResourceList, buildTargetsSection, } from './resource-view.js';
|
|
14
|
+
/** Register the `agents skills` command tree (list, add, remove, sync, prune, view). */
|
|
13
15
|
export function registerSkillsCommands(program) {
|
|
14
16
|
const skillsCmd = program
|
|
15
17
|
.command('skills')
|
|
16
|
-
.description('
|
|
18
|
+
.description('Add domain-specific capabilities to agents via packaged SKILL.md files')
|
|
19
|
+
.addHelpText('after', `
|
|
20
|
+
Skills are structured bundles (SKILL.md + rules/) that teach agents specialized domains: API conventions, testing patterns, code review checklists. Each skill can ship with its own rules that only apply when the skill is invoked.
|
|
21
|
+
|
|
22
|
+
Examples:
|
|
23
|
+
# See what skills are installed
|
|
24
|
+
agents skills list
|
|
25
|
+
|
|
26
|
+
# Check skills for a specific agent version
|
|
27
|
+
agents skills list claude@2.1.112
|
|
28
|
+
|
|
29
|
+
# Install a skill from GitHub
|
|
30
|
+
agents skills add gh:anthropics/skills --agents codex,claude
|
|
31
|
+
|
|
32
|
+
# Interactive: pick from ~/.agents/skills/
|
|
33
|
+
agents skills add
|
|
34
|
+
|
|
35
|
+
# Install a specific skill by name
|
|
36
|
+
agents skills add --names api-testing --agents codex@0.116.0
|
|
37
|
+
|
|
38
|
+
When to use:
|
|
39
|
+
- Onboarding: 'agents skills add gh:team/skills' to share expertise across the team
|
|
40
|
+
- Specialization: install domain skills (rush-product-knowledge, rdev) per project
|
|
41
|
+
- Version isolation: install different skills to different versions for experimentation
|
|
42
|
+
`);
|
|
17
43
|
skillsCmd
|
|
18
44
|
.command('list [agent]')
|
|
19
|
-
.description('
|
|
20
|
-
.option('-a, --agent <agent>', 'Filter
|
|
21
|
-
.option('-s, --scope <scope>', 'Filter by scope: user, project, or all', 'all')
|
|
45
|
+
.description('Show which skills are installed and which agent versions they are synced to')
|
|
46
|
+
.option('-a, --agent <agent>', 'Filter to a specific agent (alternative to positional arg)')
|
|
22
47
|
.action(async (agentArg, options) => {
|
|
23
48
|
const spinner = ora({ text: 'Loading...', isSilent: !process.stdout.isTTY }).start();
|
|
24
|
-
const cwd = process.cwd();
|
|
25
|
-
// Parse agent input - handle agent@version syntax
|
|
26
49
|
const agentInput = agentArg || options.agent;
|
|
27
|
-
let
|
|
28
|
-
let
|
|
50
|
+
let filterAgent;
|
|
51
|
+
let filterVersion;
|
|
29
52
|
if (agentInput) {
|
|
30
53
|
const parts = agentInput.split('@');
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
agentId = resolveAgentName(agentName);
|
|
34
|
-
if (!agentId) {
|
|
54
|
+
const resolved = resolveAgentName(parts[0]);
|
|
55
|
+
if (!resolved) {
|
|
35
56
|
spinner.stop();
|
|
36
|
-
console.log(chalk.red(formatAgentError(
|
|
57
|
+
console.log(chalk.red(formatAgentError(parts[0], SKILLS_CAPABLE_AGENTS)));
|
|
37
58
|
process.exit(1);
|
|
38
59
|
}
|
|
60
|
+
filterAgent = resolved;
|
|
61
|
+
filterVersion = parts[1] || undefined;
|
|
39
62
|
}
|
|
40
|
-
const
|
|
41
|
-
// Get CLI states to determine managed vs unmanaged
|
|
42
|
-
const cliStates = await getAllCliStates();
|
|
43
|
-
// Helper to render skills for a specific version
|
|
44
|
-
const renderVersionSkills = (agentId, version, isDefault, home) => {
|
|
45
|
-
const agent = AGENTS[agentId];
|
|
46
|
-
const errors = [];
|
|
47
|
-
const skills = listInstalledSkillsWithScope(agentId, cwd, { home, errors }).filter((s) => options.scope === 'all' || s.scope === options.scope);
|
|
48
|
-
const defaultLabel = isDefault ? ' default' : '';
|
|
49
|
-
const versionStr = chalk.gray(` (${version}${defaultLabel})`);
|
|
50
|
-
if (skills.length === 0) {
|
|
51
|
-
console.log(` ${chalk.bold(agentLabel(agent.id))}${versionStr}: ${chalk.gray('none')}`);
|
|
52
|
-
}
|
|
53
|
-
else {
|
|
54
|
-
console.log(` ${chalk.bold(agentLabel(agent.id))}${versionStr}:`);
|
|
55
|
-
const userSkills = skills.filter((s) => s.scope === 'user');
|
|
56
|
-
const projectSkills = skills.filter((s) => s.scope === 'project');
|
|
57
|
-
if (userSkills.length > 0 && (options.scope === 'all' || options.scope === 'user')) {
|
|
58
|
-
console.log(` ${chalk.gray('User:')}`);
|
|
59
|
-
for (const skill of userSkills) {
|
|
60
|
-
const desc = skill.metadata.description ? ` ${chalk.gray(skill.metadata.description)}` : '';
|
|
61
|
-
const ruleInfo = skill.ruleCount > 0 ? chalk.gray(` (${skill.ruleCount} rules)`) : '';
|
|
62
|
-
console.log(` ${chalk.cyan(skill.name.padEnd(20))}${desc}${ruleInfo}`);
|
|
63
|
-
if (showPaths)
|
|
64
|
-
console.log(chalk.gray(` ${skill.path}`));
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
if (projectSkills.length > 0 && (options.scope === 'all' || options.scope === 'project')) {
|
|
68
|
-
console.log(` ${chalk.gray('Project:')}`);
|
|
69
|
-
for (const skill of projectSkills) {
|
|
70
|
-
const desc = skill.metadata.description ? ` ${chalk.gray(skill.metadata.description)}` : '';
|
|
71
|
-
const ruleInfo = skill.ruleCount > 0 ? chalk.gray(` (${skill.ruleCount} rules)`) : '';
|
|
72
|
-
console.log(` ${chalk.yellow(skill.name.padEnd(20))}${desc}${ruleInfo}`);
|
|
73
|
-
if (showPaths)
|
|
74
|
-
console.log(chalk.gray(` ${skill.path}`));
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
// Show skills with parse errors
|
|
79
|
-
if (errors.length > 0) {
|
|
80
|
-
console.log(` ${chalk.red('Errors:')}`);
|
|
81
|
-
for (const err of errors) {
|
|
82
|
-
console.log(` ${chalk.red(err.name.padEnd(20))} ${chalk.gray(err.error)}`);
|
|
83
|
-
if (showPaths)
|
|
84
|
-
console.log(chalk.gray(` ${err.path}`));
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
console.log();
|
|
88
|
-
};
|
|
89
|
-
// Helper to render skills for an agent (default version only, for multi-agent view)
|
|
90
|
-
const renderAgentSkillsDefault = (agentId) => {
|
|
91
|
-
const agent = AGENTS[agentId];
|
|
92
|
-
if (!agent.capabilities.skills) {
|
|
93
|
-
console.log(` ${chalk.bold(agentLabel(agent.id))}: ${chalk.gray('skills not supported')}`);
|
|
94
|
-
console.log();
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
const defaultVer = getGlobalDefault(agentId);
|
|
98
|
-
if (defaultVer) {
|
|
99
|
-
const home = getVersionHomePath(agentId, defaultVer);
|
|
100
|
-
renderVersionSkills(agentId, defaultVer, true, home);
|
|
101
|
-
}
|
|
102
|
-
else {
|
|
103
|
-
// No default set, show from effective home
|
|
104
|
-
const errors = [];
|
|
105
|
-
const skills = listInstalledSkillsWithScope(agentId, cwd, { errors }).filter((s) => options.scope === 'all' || s.scope === options.scope);
|
|
106
|
-
if (skills.length === 0 && errors.length === 0) {
|
|
107
|
-
console.log(` ${chalk.bold(agentLabel(agent.id))}: ${chalk.gray('none')}`);
|
|
108
|
-
}
|
|
109
|
-
else {
|
|
110
|
-
console.log(` ${chalk.bold(agentLabel(agent.id))}:`);
|
|
111
|
-
const userSkills = skills.filter((s) => s.scope === 'user');
|
|
112
|
-
if (userSkills.length > 0) {
|
|
113
|
-
console.log(` ${chalk.gray('User:')}`);
|
|
114
|
-
for (const skill of userSkills) {
|
|
115
|
-
const desc = skill.metadata.description ? ` ${chalk.gray(skill.metadata.description)}` : '';
|
|
116
|
-
const ruleInfo = skill.ruleCount > 0 ? chalk.gray(` (${skill.ruleCount} rules)`) : '';
|
|
117
|
-
console.log(` ${chalk.cyan(skill.name.padEnd(20))}${desc}${ruleInfo}`);
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
if (errors.length > 0) {
|
|
121
|
-
console.log(` ${chalk.red('Errors:')}`);
|
|
122
|
-
for (const err of errors) {
|
|
123
|
-
console.log(` ${chalk.red(err.name.padEnd(20))} ${chalk.gray(err.error)}`);
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
console.log();
|
|
128
|
-
}
|
|
129
|
-
};
|
|
63
|
+
const rows = await buildSkillRows({ filterAgent, filterVersion });
|
|
130
64
|
spinner.stop();
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
if (cliState?.installed) {
|
|
144
|
-
console.log(chalk.bold('Not Managed by Agents CLI\n'));
|
|
145
|
-
const skills = listInstalledSkillsWithScope(agentId, cwd).filter((s) => options.scope === 'all' || s.scope === options.scope);
|
|
146
|
-
if (skills.length === 0) {
|
|
147
|
-
console.log(` ${chalk.bold(agentLabel(agent.id))}: ${chalk.gray('none')}`);
|
|
148
|
-
}
|
|
149
|
-
else {
|
|
150
|
-
console.log(` ${chalk.bold(agentLabel(agent.id))}:`);
|
|
151
|
-
const userSkills = skills.filter((s) => s.scope === 'user');
|
|
152
|
-
if (userSkills.length > 0) {
|
|
153
|
-
console.log(` ${chalk.gray('User:')}`);
|
|
154
|
-
for (const skill of userSkills) {
|
|
155
|
-
const desc = skill.metadata.description ? ` - ${chalk.gray(skill.metadata.description)}` : '';
|
|
156
|
-
const ruleInfo = skill.ruleCount > 0 ? chalk.gray(` (${skill.ruleCount} rules)`) : '';
|
|
157
|
-
console.log(` ${chalk.cyan(skill.name)}${desc}${ruleInfo}`);
|
|
158
|
-
if (showPaths)
|
|
159
|
-
console.log(chalk.gray(` ${skill.path}`));
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
else {
|
|
165
|
-
console.log(chalk.gray(` ${agentLabel(agent.id)} is not installed.`));
|
|
166
|
-
}
|
|
167
|
-
return;
|
|
168
|
-
}
|
|
169
|
-
console.log(chalk.bold(`Installed Agent Skills for ${agentLabel(agent.id)}\n`));
|
|
170
|
-
// Determine which versions to show
|
|
171
|
-
let versionsToShow;
|
|
172
|
-
if (requestedVersion === 'default') {
|
|
173
|
-
// Show only default version
|
|
174
|
-
if (!defaultVer) {
|
|
175
|
-
console.log(chalk.yellow(` No default version set for ${agentLabel(agent.id)}. Run: agents use ${agentId}@<version>`));
|
|
176
|
-
return;
|
|
177
|
-
}
|
|
178
|
-
versionsToShow = [defaultVer];
|
|
179
|
-
}
|
|
180
|
-
else if (requestedVersion) {
|
|
181
|
-
// Show specific version
|
|
182
|
-
if (!installedVersions.includes(requestedVersion)) {
|
|
183
|
-
console.log(chalk.red(` Version ${requestedVersion} not installed for ${agentLabel(agent.id)}.`));
|
|
184
|
-
console.log(chalk.gray(` Installed versions: ${installedVersions.join(', ')}`));
|
|
185
|
-
return;
|
|
186
|
-
}
|
|
187
|
-
versionsToShow = [requestedVersion];
|
|
188
|
-
}
|
|
189
|
-
else {
|
|
190
|
-
// Show all versions, default first
|
|
191
|
-
versionsToShow = [...installedVersions].sort((a, b) => {
|
|
192
|
-
if (a === defaultVer)
|
|
193
|
-
return -1;
|
|
194
|
-
if (b === defaultVer)
|
|
195
|
-
return 1;
|
|
196
|
-
return 0;
|
|
197
|
-
});
|
|
198
|
-
}
|
|
199
|
-
for (const version of versionsToShow) {
|
|
200
|
-
const home = getVersionHomePath(agentId, version);
|
|
201
|
-
renderVersionSkills(agentId, version, version === defaultVer, home);
|
|
202
|
-
}
|
|
203
|
-
return;
|
|
204
|
-
}
|
|
205
|
-
// No agent specified - show default version for each agent
|
|
206
|
-
const versionManaged = [];
|
|
207
|
-
const globallyInstalled = [];
|
|
208
|
-
for (const aid of SKILLS_CAPABLE_AGENTS) {
|
|
209
|
-
const versions = listInstalledVersions(aid);
|
|
210
|
-
const cliState = cliStates[aid];
|
|
211
|
-
if (versions.length > 0) {
|
|
212
|
-
versionManaged.push(aid);
|
|
213
|
-
}
|
|
214
|
-
else if (cliState?.installed) {
|
|
215
|
-
globallyInstalled.push(aid);
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
if (versionManaged.length > 0) {
|
|
219
|
-
console.log(chalk.bold('Installed Agent Skills\n'));
|
|
220
|
-
for (const aid of versionManaged) {
|
|
221
|
-
renderAgentSkillsDefault(aid);
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
if (globallyInstalled.length > 0) {
|
|
225
|
-
console.log(chalk.bold('Not Managed by Agents CLI\n'));
|
|
226
|
-
for (const aid of globallyInstalled) {
|
|
227
|
-
const agent = AGENTS[aid];
|
|
228
|
-
const skills = listInstalledSkillsWithScope(aid, cwd).filter((s) => options.scope === 'all' || s.scope === options.scope);
|
|
229
|
-
if (skills.length === 0) {
|
|
230
|
-
console.log(` ${chalk.bold(agentLabel(aid))}: ${chalk.gray('none')}`);
|
|
231
|
-
}
|
|
232
|
-
else {
|
|
233
|
-
console.log(` ${chalk.bold(agentLabel(aid))}:`);
|
|
234
|
-
const userSkills = skills.filter((s) => s.scope === 'user');
|
|
235
|
-
if (userSkills.length > 0) {
|
|
236
|
-
console.log(` ${chalk.gray('User:')}`);
|
|
237
|
-
for (const skill of userSkills) {
|
|
238
|
-
const desc = skill.metadata.description ? ` ${chalk.gray(skill.metadata.description)}` : '';
|
|
239
|
-
const ruleInfo = skill.ruleCount > 0 ? chalk.gray(` (${skill.ruleCount} rules)`) : '';
|
|
240
|
-
console.log(` ${chalk.cyan(skill.name.padEnd(20))}${desc}${ruleInfo}`);
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
console.log();
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
if (versionManaged.length === 0 && globallyInstalled.length === 0) {
|
|
248
|
-
console.log(chalk.gray(' No agents with skills installed.'));
|
|
249
|
-
console.log();
|
|
250
|
-
}
|
|
65
|
+
await showResourceList({
|
|
66
|
+
resourcePlural: 'skills',
|
|
67
|
+
resourceSingular: 'skill',
|
|
68
|
+
extraLabel: 'Files',
|
|
69
|
+
rows,
|
|
70
|
+
emptyMessage: filterAgent
|
|
71
|
+
? `No skills in central storage for ${agentLabel(filterAgent)}.`
|
|
72
|
+
: 'No skills in ~/.agents/skills/. Add one with: agents skills add gh:user/repo',
|
|
73
|
+
centralPath: getSkillsDir(),
|
|
74
|
+
filterAgent,
|
|
75
|
+
filterVersion,
|
|
76
|
+
});
|
|
251
77
|
});
|
|
252
78
|
skillsCmd
|
|
253
79
|
.command('add [source]')
|
|
254
|
-
.description('Install skills from a
|
|
255
|
-
.option('-a, --agents <list>', '
|
|
256
|
-
.option('--names <list>', '
|
|
257
|
-
.option('-y, --yes', 'Skip prompts
|
|
80
|
+
.description('Install skills from a source (GitHub, local) or pick from central storage')
|
|
81
|
+
.option('-a, --agents <list>', 'Targets: claude, codex@0.116.0, or gemini@default')
|
|
82
|
+
.option('--names <list>', 'Skill names from ~/.agents/skills/ (comma-separated)')
|
|
83
|
+
.option('-y, --yes', 'Skip all prompts')
|
|
84
|
+
.addHelpText('after', `
|
|
85
|
+
Examples:
|
|
86
|
+
# Interactive picker from ~/.agents/skills/
|
|
87
|
+
agents skills add
|
|
88
|
+
|
|
89
|
+
# Install a specific skill to one version
|
|
90
|
+
agents skills add --names api-testing --agents codex@0.116.0
|
|
91
|
+
|
|
92
|
+
# Clone and install skills from GitHub
|
|
93
|
+
agents skills add gh:anthropics/skills --agents claude,codex
|
|
94
|
+
|
|
95
|
+
# Add a local skill directory (must contain SKILL.md)
|
|
96
|
+
agents skills add ~/my-skill --agents claude@default
|
|
97
|
+
`)
|
|
258
98
|
.action(async (source, options) => {
|
|
259
99
|
try {
|
|
260
100
|
let skills;
|
|
@@ -444,7 +284,15 @@ export function registerSkillsCommands(program) {
|
|
|
444
284
|
});
|
|
445
285
|
skillsCmd
|
|
446
286
|
.command('remove [name]')
|
|
447
|
-
.description('
|
|
287
|
+
.description('Delete a skill from central storage (interactive picker if no name given)')
|
|
288
|
+
.addHelpText('after', `
|
|
289
|
+
Examples:
|
|
290
|
+
# Remove a skill by name
|
|
291
|
+
agents skills remove api-testing
|
|
292
|
+
|
|
293
|
+
# Interactive: pick skills to remove
|
|
294
|
+
agents skills remove
|
|
295
|
+
`)
|
|
448
296
|
.action(async (name) => {
|
|
449
297
|
let skillsToRemove;
|
|
450
298
|
if (name) {
|
|
@@ -497,9 +345,193 @@ export function registerSkillsCommands(program) {
|
|
|
497
345
|
}
|
|
498
346
|
}
|
|
499
347
|
});
|
|
348
|
+
skillsCmd
|
|
349
|
+
.command('sync')
|
|
350
|
+
.description('Reconcile version-home skills against central ~/.agents/skills/ (add + update, never delete)')
|
|
351
|
+
.option('-a, --agent <agent>', 'Scope to a specific agent or agent@version')
|
|
352
|
+
.option('-m, --method <method>', 'Install method: copy (default) or symlink', 'copy')
|
|
353
|
+
.addHelpText('after', `
|
|
354
|
+
Examples:
|
|
355
|
+
# Sync every installed version of every skills-capable agent
|
|
356
|
+
agents skills sync
|
|
357
|
+
|
|
358
|
+
# Scope to one agent
|
|
359
|
+
agents skills sync --agent claude
|
|
360
|
+
|
|
361
|
+
# Scope to one version
|
|
362
|
+
agents skills sync --agent claude@2.1.113
|
|
363
|
+
|
|
364
|
+
# Symlink into version homes (central updates propagate automatically)
|
|
365
|
+
agents skills sync --method symlink
|
|
366
|
+
|
|
367
|
+
Sync is additive: it installs missing skills and refreshes changed ones. To
|
|
368
|
+
remove orphans (skills in a version home but not in central), use 'agents
|
|
369
|
+
skills prune'.
|
|
370
|
+
`)
|
|
371
|
+
.action(async (options) => {
|
|
372
|
+
const method = (options.method === 'symlink' ? 'symlink' : 'copy');
|
|
373
|
+
let filter;
|
|
374
|
+
if (options.agent) {
|
|
375
|
+
const [name, version] = String(options.agent).split('@');
|
|
376
|
+
const agentId = resolveAgentName(name);
|
|
377
|
+
if (!agentId) {
|
|
378
|
+
console.log(chalk.red(formatAgentError(name, SKILLS_CAPABLE_AGENTS)));
|
|
379
|
+
process.exit(1);
|
|
380
|
+
}
|
|
381
|
+
filter = { agent: agentId, version: version || undefined };
|
|
382
|
+
}
|
|
383
|
+
const pairs = iterSkillsCapableVersions(filter);
|
|
384
|
+
if (pairs.length === 0) {
|
|
385
|
+
console.log(chalk.gray('No matching installed versions.'));
|
|
386
|
+
return;
|
|
387
|
+
}
|
|
388
|
+
const diffs = pairs.map(({ agent, version }) => diffVersionSkills(agent, version));
|
|
389
|
+
const plan = diffs.filter((d) => d.toAdd.length > 0 || d.toUpdate.length > 0);
|
|
390
|
+
if (plan.length === 0) {
|
|
391
|
+
console.log(chalk.green('All version homes are up to date with central.'));
|
|
392
|
+
if (diffs.some((d) => d.orphans.length > 0)) {
|
|
393
|
+
console.log(chalk.gray('Orphan skills present. Run \'agents skills prune --dry-run\' to review.'));
|
|
394
|
+
}
|
|
395
|
+
return;
|
|
396
|
+
}
|
|
397
|
+
console.log(chalk.bold(`Syncing skills (method: ${method})\n`));
|
|
398
|
+
let adds = 0, updates = 0, failures = 0;
|
|
399
|
+
for (const diff of plan) {
|
|
400
|
+
const label = `${diff.agent}@${diff.version}`;
|
|
401
|
+
if (diff.toAdd.length > 0) {
|
|
402
|
+
console.log(` ${chalk.cyan(label)} ${chalk.gray('add:')} ${diff.toAdd.join(', ')}`);
|
|
403
|
+
for (const name of diff.toAdd) {
|
|
404
|
+
const r = installSkillToVersion(diff.agent, diff.version, name, method);
|
|
405
|
+
if (r.success)
|
|
406
|
+
adds++;
|
|
407
|
+
else {
|
|
408
|
+
failures++;
|
|
409
|
+
console.log(chalk.red(` ! ${name}: ${r.error}`));
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
if (diff.toUpdate.length > 0) {
|
|
414
|
+
console.log(` ${chalk.cyan(label)} ${chalk.gray('update:')} ${diff.toUpdate.join(', ')}`);
|
|
415
|
+
for (const name of diff.toUpdate) {
|
|
416
|
+
const r = installSkillToVersion(diff.agent, diff.version, name, method);
|
|
417
|
+
if (r.success)
|
|
418
|
+
updates++;
|
|
419
|
+
else {
|
|
420
|
+
failures++;
|
|
421
|
+
console.log(chalk.red(` ! ${name}: ${r.error}`));
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
console.log();
|
|
427
|
+
console.log(chalk.green(`Synced: ${adds} added, ${updates} updated${failures > 0 ? chalk.red(`, ${failures} failed`) : ''}.`));
|
|
428
|
+
const totalOrphans = diffs.reduce((n, d) => n + d.orphans.length, 0);
|
|
429
|
+
if (totalOrphans > 0) {
|
|
430
|
+
console.log(chalk.gray(`${totalOrphans} orphan(s) remain. Run 'agents skills prune --dry-run' to review.`));
|
|
431
|
+
}
|
|
432
|
+
});
|
|
433
|
+
skillsCmd
|
|
434
|
+
.command('prune')
|
|
435
|
+
.description('Remove orphan skills from version homes (skills present locally but not in central)')
|
|
436
|
+
.option('-a, --agent <agent>', 'Scope to a specific agent or agent@version')
|
|
437
|
+
.option('--dry-run', 'Show orphans without deleting')
|
|
438
|
+
.option('-y, --yes', 'Skip confirmation prompt')
|
|
439
|
+
.addHelpText('after', `
|
|
440
|
+
Examples:
|
|
441
|
+
# See what would be pruned
|
|
442
|
+
agents skills prune --dry-run
|
|
443
|
+
|
|
444
|
+
# Prune across every installed version (prompts for confirmation)
|
|
445
|
+
agents skills prune
|
|
446
|
+
|
|
447
|
+
# Scope to one agent or version
|
|
448
|
+
agents skills prune --agent claude@2.0.65
|
|
449
|
+
|
|
450
|
+
# Skip confirmation (for scripts)
|
|
451
|
+
agents skills prune -y
|
|
452
|
+
|
|
453
|
+
Orphans are skills that exist inside a version home but are missing from the
|
|
454
|
+
central ~/.agents/skills/ source of truth. Usually they are leftovers from a
|
|
455
|
+
skill that was deleted centrally but never removed from the version install.
|
|
456
|
+
`)
|
|
457
|
+
.action(async (options) => {
|
|
458
|
+
let filter;
|
|
459
|
+
if (options.agent) {
|
|
460
|
+
const [name, version] = String(options.agent).split('@');
|
|
461
|
+
const agentId = resolveAgentName(name);
|
|
462
|
+
if (!agentId) {
|
|
463
|
+
console.log(chalk.red(formatAgentError(name, SKILLS_CAPABLE_AGENTS)));
|
|
464
|
+
process.exit(1);
|
|
465
|
+
}
|
|
466
|
+
filter = { agent: agentId, version: version || undefined };
|
|
467
|
+
}
|
|
468
|
+
const pairs = iterSkillsCapableVersions(filter);
|
|
469
|
+
const diffs = pairs
|
|
470
|
+
.map(({ agent, version }) => diffVersionSkills(agent, version))
|
|
471
|
+
.filter((d) => d.orphans.length > 0);
|
|
472
|
+
if (diffs.length === 0) {
|
|
473
|
+
console.log(chalk.green('No orphan skills.'));
|
|
474
|
+
return;
|
|
475
|
+
}
|
|
476
|
+
const total = diffs.reduce((n, d) => n + d.orphans.length, 0);
|
|
477
|
+
console.log(chalk.bold(`Orphans (in version home, not in central)\n`));
|
|
478
|
+
for (const d of diffs) {
|
|
479
|
+
console.log(` ${chalk.cyan(`${d.agent}@${d.version}`)} ${d.orphans.join(', ')}`);
|
|
480
|
+
}
|
|
481
|
+
console.log();
|
|
482
|
+
if (options.dryRun) {
|
|
483
|
+
console.log(chalk.gray(`${total} orphan(s). Run without --dry-run to delete.`));
|
|
484
|
+
return;
|
|
485
|
+
}
|
|
486
|
+
if (!options.yes) {
|
|
487
|
+
if (!isInteractiveTerminal()) {
|
|
488
|
+
console.log(chalk.yellow('Non-interactive shell: pass -y to confirm, or --dry-run to preview.'));
|
|
489
|
+
process.exit(1);
|
|
490
|
+
}
|
|
491
|
+
let ok = false;
|
|
492
|
+
try {
|
|
493
|
+
ok = await confirm({
|
|
494
|
+
message: `Delete ${total} orphan skill director${total === 1 ? 'y' : 'ies'}?`,
|
|
495
|
+
default: false,
|
|
496
|
+
});
|
|
497
|
+
}
|
|
498
|
+
catch (err) {
|
|
499
|
+
if (isPromptCancelled(err)) {
|
|
500
|
+
console.log(chalk.gray('Cancelled'));
|
|
501
|
+
return;
|
|
502
|
+
}
|
|
503
|
+
throw err;
|
|
504
|
+
}
|
|
505
|
+
if (!ok) {
|
|
506
|
+
console.log(chalk.gray('Cancelled'));
|
|
507
|
+
return;
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
let removed = 0, failures = 0;
|
|
511
|
+
for (const d of diffs) {
|
|
512
|
+
for (const name of d.orphans) {
|
|
513
|
+
const r = removeSkillFromVersion(d.agent, d.version, name);
|
|
514
|
+
if (r.success)
|
|
515
|
+
removed++;
|
|
516
|
+
else {
|
|
517
|
+
failures++;
|
|
518
|
+
console.log(chalk.red(` ! ${d.agent}@${d.version} ${name}: ${r.error}`));
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
console.log(chalk.green(`Pruned ${removed} orphan(s)${failures > 0 ? chalk.red(`, ${failures} failed`) : ''}.`));
|
|
523
|
+
});
|
|
500
524
|
skillsCmd
|
|
501
525
|
.command('view [name]')
|
|
502
|
-
.description('
|
|
526
|
+
.description('Read skill metadata (name, description, rules count)')
|
|
527
|
+
.addHelpText('after', `
|
|
528
|
+
Examples:
|
|
529
|
+
# View details for a specific skill
|
|
530
|
+
agents skills view api-testing
|
|
531
|
+
|
|
532
|
+
# Interactive picker
|
|
533
|
+
agents skills view
|
|
534
|
+
`)
|
|
503
535
|
.action(async (name) => {
|
|
504
536
|
// If no name provided, show interactive select
|
|
505
537
|
if (!name) {
|
|
@@ -592,4 +624,94 @@ export function registerSkillsCommands(program) {
|
|
|
592
624
|
await skillsCmd.commands.find((c) => c.name() === 'view')?.parseAsync(['view', ...(name ? [name] : [])], { from: 'user' });
|
|
593
625
|
});
|
|
594
626
|
}
|
|
627
|
+
/**
|
|
628
|
+
* Build the row data for `agents skills list`. Each row = one central skill
|
|
629
|
+
* with a sync-status target per (agent, version) in scope.
|
|
630
|
+
*/
|
|
631
|
+
async function buildSkillRows(opts) {
|
|
632
|
+
const central = listInstalledSkills(); // Map<name, DiscoveredSkill>
|
|
633
|
+
if (central.size === 0)
|
|
634
|
+
return [];
|
|
635
|
+
const targetPairs = iterSkillsCapableVersions({
|
|
636
|
+
agent: opts.filterAgent,
|
|
637
|
+
version: opts.filterVersion,
|
|
638
|
+
});
|
|
639
|
+
// Precompute per-(agent, version) diffs so we can look up each skill's
|
|
640
|
+
// status without re-diffing 16 times per skill.
|
|
641
|
+
const diffByTarget = new Map();
|
|
642
|
+
const defaultByAgent = new Map();
|
|
643
|
+
for (const { agent, version } of targetPairs) {
|
|
644
|
+
if (!defaultByAgent.has(agent))
|
|
645
|
+
defaultByAgent.set(agent, getGlobalDefault(agent));
|
|
646
|
+
diffByTarget.set(`${agent}@${version}`, diffVersionSkills(agent, version));
|
|
647
|
+
}
|
|
648
|
+
const rows = [];
|
|
649
|
+
for (const [name, skill] of central) {
|
|
650
|
+
const targets = [];
|
|
651
|
+
for (const { agent, version } of targetPairs) {
|
|
652
|
+
const diff = diffByTarget.get(`${agent}@${version}`);
|
|
653
|
+
let status;
|
|
654
|
+
if (diff.matched.includes(name))
|
|
655
|
+
status = 'synced';
|
|
656
|
+
else if (diff.toUpdate.includes(name))
|
|
657
|
+
status = 'stale';
|
|
658
|
+
else
|
|
659
|
+
status = 'missing';
|
|
660
|
+
targets.push({
|
|
661
|
+
agent,
|
|
662
|
+
version,
|
|
663
|
+
isDefault: defaultByAgent.get(agent) === version,
|
|
664
|
+
status,
|
|
665
|
+
});
|
|
666
|
+
}
|
|
667
|
+
const fileCount = countSkillFiles(skill.path);
|
|
668
|
+
rows.push({
|
|
669
|
+
name,
|
|
670
|
+
description: skill.metadata.description,
|
|
671
|
+
extra: fileCount > 0 ? `${fileCount}` : '-',
|
|
672
|
+
targets,
|
|
673
|
+
buildDetail: () => formatSkillDetail(name, skill, targets, fileCount),
|
|
674
|
+
});
|
|
675
|
+
}
|
|
676
|
+
// Sort: fully-synced first, then partial, then missing — stable by name within each tier.
|
|
677
|
+
rows.sort((a, b) => {
|
|
678
|
+
const aSynced = a.targets.filter((t) => t.status === 'synced').length;
|
|
679
|
+
const bSynced = b.targets.filter((t) => t.status === 'synced').length;
|
|
680
|
+
if (aSynced !== bSynced)
|
|
681
|
+
return bSynced - aSynced;
|
|
682
|
+
return a.name.localeCompare(b.name);
|
|
683
|
+
});
|
|
684
|
+
return rows;
|
|
685
|
+
}
|
|
686
|
+
function formatSkillDetail(name, skill, targets, fileCount) {
|
|
687
|
+
const lines = [];
|
|
688
|
+
lines.push(chalk.bold.cyan(name));
|
|
689
|
+
if (skill.metadata.description) {
|
|
690
|
+
lines.push(chalk.gray(skill.metadata.description));
|
|
691
|
+
}
|
|
692
|
+
lines.push('');
|
|
693
|
+
const meta = [];
|
|
694
|
+
if (skill.metadata.author)
|
|
695
|
+
meta.push(`author ${chalk.white(skill.metadata.author)}`);
|
|
696
|
+
if (skill.metadata.version)
|
|
697
|
+
meta.push(`v${chalk.white(skill.metadata.version)}`);
|
|
698
|
+
if (skill.metadata.license)
|
|
699
|
+
meta.push(`license ${chalk.white(skill.metadata.license)}`);
|
|
700
|
+
meta.push(`${chalk.white(fileCount)} file${fileCount === 1 ? '' : 's'}`);
|
|
701
|
+
if (skill.ruleCount > 0) {
|
|
702
|
+
meta.push(`${chalk.white(skill.ruleCount)} rule${skill.ruleCount === 1 ? '' : 's'}`);
|
|
703
|
+
}
|
|
704
|
+
lines.push(' ' + meta.join(chalk.gray(' · ')));
|
|
705
|
+
lines.push(' ' + chalk.gray(skill.path));
|
|
706
|
+
const rules = getSkillRules(name);
|
|
707
|
+
if (rules.length > 0) {
|
|
708
|
+
lines.push('');
|
|
709
|
+
lines.push(chalk.bold(' Rules'));
|
|
710
|
+
lines.push(' ' + rules.map((r) => chalk.gray(r)).join(', '));
|
|
711
|
+
}
|
|
712
|
+
lines.push('');
|
|
713
|
+
lines.push(chalk.bold(' Synced to'));
|
|
714
|
+
lines.push(buildTargetsSection(targets));
|
|
715
|
+
return lines.join('\n');
|
|
716
|
+
}
|
|
595
717
|
//# sourceMappingURL=skills.js.map
|