@phnx-labs/agents-cli 0.1.0 → 1.14.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 +7 -1
- package/README.md +283 -372
- 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 +8 -1
- package/dist/commands/cloud.js +108 -22
- 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 +96 -27
- 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 +16 -4
- 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 +9 -1
- package/dist/commands/profiles.js +56 -7
- 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 +58 -128
- 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 +8 -1
- package/dist/commands/secrets.js +235 -63
- 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 +188 -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 +317 -24
- package/dist/index.d.ts +7 -2
- package/dist/index.js +172 -34
- 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 +197 -21
- 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 +9 -3
- package/dist/lib/cloud/codex.js +53 -13
- package/dist/lib/cloud/factory.d.ts +8 -3
- package/dist/lib/cloud/factory.js +19 -3
- package/dist/lib/cloud/registry.d.ts +10 -1
- package/dist/lib/cloud/registry.js +14 -3
- package/dist/lib/cloud/rush.d.ts +63 -3
- package/dist/lib/cloud/rush.js +273 -20
- package/dist/lib/cloud/store.d.ts +13 -1
- package/dist/lib/cloud/store.js +23 -4
- package/dist/lib/cloud/stream.d.ts +6 -1
- package/dist/lib/cloud/stream.js +95 -39
- package/dist/lib/cloud/types.d.ts +153 -8
- package/dist/lib/cloud/types.js +34 -2
- 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 +23 -6
- package/dist/lib/exec.js +53 -17
- 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 +119 -101
- 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 +10 -4
- package/dist/lib/models.js +36 -15
- 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 +10 -1
- package/dist/lib/profiles-presets.js +9 -1
- package/dist/lib/profiles.d.ts +35 -1
- package/dist/lib/profiles.js +36 -15
- 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 +40 -13
- package/dist/lib/rotate.js +238 -40
- 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 → secrets/bundles.d.ts} +12 -2
- package/dist/lib/{secrets-bundles.js → secrets/bundles.js} +38 -17
- 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 +12 -1
- package/dist/lib/session/artifacts.js +25 -5
- 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 +16 -2
- package/dist/lib/session/types.js +10 -2
- package/dist/lib/shims.d.ts +64 -5
- package/dist/lib/shims.js +309 -47
- 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 +112 -27
- package/dist/lib/state.js +320 -148
- 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 +32 -1
- package/dist/lib/usage.js +70 -6
- package/dist/lib/version-duplicates.d.ts +21 -0
- package/dist/lib/version-duplicates.js +90 -0
- package/dist/lib/versions.d.ts +33 -4
- package/dist/lib/versions.js +376 -108
- package/package.json +32 -17
- 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/cloud.d.ts.map +0 -1
- package/dist/commands/cloud.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/profiles.d.ts.map +0 -1
- package/dist/commands/profiles.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/secrets.d.ts.map +0 -1
- package/dist/commands/secrets.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 -239
- package/dist/lib/__tests__/models.test.js.map +0 -1
- package/dist/lib/__tests__/rotate.test.d.ts +0 -2
- package/dist/lib/__tests__/rotate.test.d.ts.map +0 -1
- package/dist/lib/__tests__/rotate.test.js +0 -80
- package/dist/lib/__tests__/rotate.test.js.map +0 -1
- package/dist/lib/__tests__/secrets-bundles.test.d.ts +0 -2
- package/dist/lib/__tests__/secrets-bundles.test.d.ts.map +0 -1
- package/dist/lib/__tests__/secrets-bundles.test.js +0 -104
- package/dist/lib/__tests__/secrets-bundles.test.js.map +0 -1
- package/dist/lib/__tests__/secrets.test.d.ts +0 -2
- package/dist/lib/__tests__/secrets.test.d.ts.map +0 -1
- package/dist/lib/__tests__/secrets.test.js +0 -90
- package/dist/lib/__tests__/secrets.test.js.map +0 -1
- package/dist/lib/__tests__/shims.test.d.ts +0 -2
- package/dist/lib/__tests__/shims.test.d.ts.map +0 -1
- package/dist/lib/__tests__/shims.test.js +0 -39
- package/dist/lib/__tests__/shims.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 -220
- package/dist/lib/__tests__/usage.test.js.map +0 -1
- package/dist/lib/__tests__/versions.test.d.ts +0 -2
- package/dist/lib/__tests__/versions.test.d.ts.map +0 -1
- package/dist/lib/__tests__/versions.test.js +0 -63
- package/dist/lib/__tests__/versions.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/cloud/codex.d.ts.map +0 -1
- package/dist/lib/cloud/codex.js.map +0 -1
- package/dist/lib/cloud/factory.d.ts.map +0 -1
- package/dist/lib/cloud/factory.js.map +0 -1
- package/dist/lib/cloud/registry.d.ts.map +0 -1
- package/dist/lib/cloud/registry.js.map +0 -1
- package/dist/lib/cloud/rush.d.ts.map +0 -1
- package/dist/lib/cloud/rush.js.map +0 -1
- package/dist/lib/cloud/store.d.ts.map +0 -1
- package/dist/lib/cloud/store.js.map +0 -1
- package/dist/lib/cloud/stream.d.ts.map +0 -1
- package/dist/lib/cloud/stream.js.map +0 -1
- package/dist/lib/cloud/types.d.ts.map +0 -1
- package/dist/lib/cloud/types.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/profiles-keychain.d.ts +0 -3
- package/dist/lib/profiles-keychain.d.ts.map +0 -1
- package/dist/lib/profiles-keychain.js +0 -10
- package/dist/lib/profiles-keychain.js.map +0 -1
- package/dist/lib/profiles-presets.d.ts.map +0 -1
- package/dist/lib/profiles-presets.js.map +0 -1
- package/dist/lib/profiles.d.ts.map +0 -1
- package/dist/lib/profiles.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/rotate.d.ts.map +0 -1
- package/dist/lib/rotate.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/secrets-bundles.d.ts.map +0 -1
- package/dist/lib/secrets-bundles.js.map +0 -1
- package/dist/lib/secrets.d.ts +0 -27
- package/dist/lib/secrets.d.ts.map +0 -1
- package/dist/lib/secrets.js +0 -127
- package/dist/lib/secrets.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/artifacts.d.ts.map +0 -1
- package/dist/lib/session/artifacts.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
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Session discovery, search, and rendering commands.
|
|
3
|
+
*
|
|
4
|
+
* Implements `agents sessions` -- the unified interface for finding, browsing,
|
|
5
|
+
* and reading agent conversation transcripts across Claude, Codex, Gemini,
|
|
6
|
+
* and OpenCode. Supports interactive picker mode, text/path search, markdown
|
|
7
|
+
* and JSON rendering, role/turn filtering, artifact inspection, and session
|
|
8
|
+
* resume via agent-native CLI flags.
|
|
9
|
+
*/
|
|
1
10
|
import * as fs from 'fs';
|
|
2
11
|
import * as os from 'os';
|
|
3
12
|
import * as path from 'path';
|
|
@@ -6,19 +15,22 @@ import chalk from 'chalk';
|
|
|
6
15
|
import ora from 'ora';
|
|
7
16
|
import { SESSION_AGENTS } from '../lib/session/types.js';
|
|
8
17
|
import { discoverArtifacts, readArtifact, resolveArtifact } from '../lib/session/artifacts.js';
|
|
18
|
+
import { getActiveSessions } from '../lib/session/active.js';
|
|
9
19
|
import { discoverSessions, countSessionsInScope, resolveSessionById, searchContentIndex } from '../lib/session/discover.js';
|
|
10
20
|
import { filterTeamSessions } from '../lib/session/team-filter.js';
|
|
11
21
|
import { parseSession } from '../lib/session/parse.js';
|
|
12
22
|
import { renderConversationMarkdown, renderSummary, renderSummaryHeader, computeSummaryStats, renderJson, filterEvents, parseRoleList } from '../lib/session/render.js';
|
|
13
23
|
import { renderMarkdown } from '../lib/markdown.js';
|
|
14
|
-
import { colorAgent } from '../lib/agents.js';
|
|
15
|
-
import { resolveVersion } from '../lib/versions.js';
|
|
24
|
+
import { colorAgent, resolveAgentName } from '../lib/agents.js';
|
|
25
|
+
import { resolveVersion, resolveVersionAliasLoose } from '../lib/versions.js';
|
|
16
26
|
import { isInteractiveTerminal, isPromptCancelled } from './utils.js';
|
|
17
27
|
import { sessionPicker } from './sessions-picker.js';
|
|
28
|
+
import { registerSessionsTailCommand } from './sessions-tail.js';
|
|
18
29
|
const SESSION_AGENT_FILTER_HELP = `Filter by agent, e.g. claude, codex, claude@2.0.65`;
|
|
19
30
|
const CLAUDE_RESUME_MATCH_WINDOW_MS = 10 * 60_000;
|
|
20
31
|
const LOAD_VERBS = ['Loading', 'Scanning', 'Gathering', 'Indexing', 'Reading'];
|
|
21
32
|
const FIND_VERBS = ['Finding', 'Searching', 'Locating', 'Matching'];
|
|
33
|
+
/** Build a spinner-backed progress tracker that cycles through verbs while scanning sessions. */
|
|
22
34
|
function createScanProgressTracker(verbs, suffix, spinner) {
|
|
23
35
|
const counts = new Map();
|
|
24
36
|
let verbIndex = 0;
|
|
@@ -121,7 +133,87 @@ async function renderArtifactsForSession(session, listAll, name) {
|
|
|
121
133
|
}
|
|
122
134
|
console.log(chalk.gray(`\n${artifacts.length} artifact${artifacts.length !== 1 ? 's' : ''}.`));
|
|
123
135
|
}
|
|
136
|
+
function statusColor(status) {
|
|
137
|
+
switch (status) {
|
|
138
|
+
case 'running': return chalk.green;
|
|
139
|
+
case 'idle': return chalk.gray;
|
|
140
|
+
case 'queued': return chalk.blue;
|
|
141
|
+
case 'input_required': return chalk.yellow;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
function contextColor(context) {
|
|
145
|
+
switch (context) {
|
|
146
|
+
case 'terminal': return chalk.magenta;
|
|
147
|
+
case 'teams': return chalk.cyan;
|
|
148
|
+
case 'cloud': return chalk.blue;
|
|
149
|
+
case 'headless': return chalk.gray;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
function shortCwd(cwd) {
|
|
153
|
+
if (!cwd)
|
|
154
|
+
return '-';
|
|
155
|
+
const home = os.homedir();
|
|
156
|
+
return cwd.startsWith(home) ? '~' + cwd.slice(home.length) : cwd;
|
|
157
|
+
}
|
|
158
|
+
function formatStartedAt(startedAtMs) {
|
|
159
|
+
if (!startedAtMs)
|
|
160
|
+
return '-';
|
|
161
|
+
return formatRelativeTime(new Date(startedAtMs).toISOString());
|
|
162
|
+
}
|
|
163
|
+
/** Render the unified active-session view. */
|
|
164
|
+
async function renderActiveSessions(asJson) {
|
|
165
|
+
const sessions = await getActiveSessions();
|
|
166
|
+
if (asJson) {
|
|
167
|
+
process.stdout.write(JSON.stringify(sessions, null, 2) + '\n');
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
if (sessions.length === 0) {
|
|
171
|
+
console.log(chalk.gray('No active agent sessions.'));
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
for (const s of sessions) {
|
|
175
|
+
const kindCol = colorAgent(s.kind)(padRight(truncate(s.kind, 8), 9));
|
|
176
|
+
const ctxCol = contextColor(s.context)(padRight(truncate(s.context, 8), 9));
|
|
177
|
+
const hostCol = chalk.gray(padRight(truncate(s.host ?? '-', 8), 9));
|
|
178
|
+
const statusCol = statusColor(s.status)(padRight(truncate(s.status, 8), 9));
|
|
179
|
+
const pidCol = chalk.yellow(padRight(s.pid ? String(s.pid) : '-', 7));
|
|
180
|
+
const idCol = chalk.white(padRight(s.sessionId ? s.sessionId.slice(0, 8) : '-', 10));
|
|
181
|
+
const detail = s.context === 'cloud'
|
|
182
|
+
? `${s.cloudProvider ?? ''}${s.cloudTaskId ? ` · ${s.cloudTaskId.slice(0, 12)}` : ''}`
|
|
183
|
+
: s.context === 'teams'
|
|
184
|
+
? `${s.teamName ?? ''}${s.label ? ` · ${s.label}` : ''}`
|
|
185
|
+
: s.label ?? shortCwd(s.cwd);
|
|
186
|
+
console.log(pidCol +
|
|
187
|
+
kindCol +
|
|
188
|
+
ctxCol +
|
|
189
|
+
hostCol +
|
|
190
|
+
statusCol +
|
|
191
|
+
idCol +
|
|
192
|
+
chalk.cyan(padRight(truncate(detail || '-', 30), 32)) +
|
|
193
|
+
chalk.gray(formatStartedAt(s.startedAtMs)));
|
|
194
|
+
}
|
|
195
|
+
const runningCount = sessions.filter(s => s.status === 'running').length;
|
|
196
|
+
const idleCount = sessions.filter(s => s.status === 'idle').length;
|
|
197
|
+
const queuedCount = sessions.filter(s => s.status === 'queued' || s.status === 'input_required').length;
|
|
198
|
+
const parts = [];
|
|
199
|
+
if (runningCount > 0)
|
|
200
|
+
parts.push(`${runningCount} running`);
|
|
201
|
+
if (idleCount > 0)
|
|
202
|
+
parts.push(`${idleCount} idle`);
|
|
203
|
+
if (queuedCount > 0)
|
|
204
|
+
parts.push(`${queuedCount} queued`);
|
|
205
|
+
console.log(chalk.gray(`\n${sessions.length} active (${parts.join(', ')}).`));
|
|
206
|
+
}
|
|
207
|
+
/** Main action handler for `agents sessions`. Routes to picker, table, or single-session render. */
|
|
124
208
|
async function sessionsAction(query, options) {
|
|
209
|
+
if (options.active) {
|
|
210
|
+
await renderActiveSessions(options.json === true);
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
if (options.cloud) {
|
|
214
|
+
await runCloudSessions(query, options);
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
125
217
|
let filterOpts;
|
|
126
218
|
try {
|
|
127
219
|
filterOpts = buildFilterOptions(options);
|
|
@@ -531,9 +623,82 @@ export function buildResumeCommand(session, activeVersion) {
|
|
|
531
623
|
return ['opencode', '--session', session.id];
|
|
532
624
|
case 'gemini':
|
|
533
625
|
case 'openclaw':
|
|
626
|
+
case 'rush':
|
|
627
|
+
case 'hermes':
|
|
628
|
+
// Rush and Hermes sessions are captured artifacts, not resumable locally.
|
|
534
629
|
return null;
|
|
535
630
|
}
|
|
536
631
|
}
|
|
632
|
+
// ---------------------------------------------------------------------------
|
|
633
|
+
// Cloud session source (--cloud)
|
|
634
|
+
// ---------------------------------------------------------------------------
|
|
635
|
+
/**
|
|
636
|
+
* Handle `agents sessions --cloud [id] [filters]`.
|
|
637
|
+
* - Without id: list captured cloud-runs, optionally as JSON.
|
|
638
|
+
* - With id: fetch the jsonl, parse with the recorded format, render via
|
|
639
|
+
* the same pipeline as local sessions (summary / markdown / json).
|
|
640
|
+
*/
|
|
641
|
+
async function runCloudSessions(query, options) {
|
|
642
|
+
const { discoverCloudSessions, ensureCloudSessionCached } = await import('../lib/session/cloud.js');
|
|
643
|
+
let filterOpts;
|
|
644
|
+
try {
|
|
645
|
+
filterOpts = buildFilterOptions(options);
|
|
646
|
+
}
|
|
647
|
+
catch (err) {
|
|
648
|
+
console.error(chalk.red(err.message));
|
|
649
|
+
process.exit(1);
|
|
650
|
+
}
|
|
651
|
+
const mode = resolveViewMode(options, filterOpts);
|
|
652
|
+
const spinner = options.json ? null : ora('Loading cloud sessions...').start();
|
|
653
|
+
let sessions;
|
|
654
|
+
try {
|
|
655
|
+
sessions = await discoverCloudSessions({ limit: parseInt(options.limit || '50', 10) });
|
|
656
|
+
}
|
|
657
|
+
catch (err) {
|
|
658
|
+
spinner?.stop();
|
|
659
|
+
console.error(chalk.red(`Failed to list cloud sessions: ${err?.message || err}`));
|
|
660
|
+
process.exit(1);
|
|
661
|
+
}
|
|
662
|
+
spinner?.stop();
|
|
663
|
+
if (!query) {
|
|
664
|
+
if (options.json) {
|
|
665
|
+
process.stdout.write(JSON.stringify(sessions, null, 2) + '\n');
|
|
666
|
+
return;
|
|
667
|
+
}
|
|
668
|
+
if (sessions.length === 0) {
|
|
669
|
+
console.log(chalk.gray('No cloud sessions captured yet.'));
|
|
670
|
+
return;
|
|
671
|
+
}
|
|
672
|
+
printSessionTable(sessions);
|
|
673
|
+
return;
|
|
674
|
+
}
|
|
675
|
+
const matches = sessions.filter((s) => s.id === query || s.shortId === query || s.id.startsWith(query));
|
|
676
|
+
if (matches.length === 0) {
|
|
677
|
+
console.error(chalk.red(`No cloud session matching: ${query}`));
|
|
678
|
+
process.exit(1);
|
|
679
|
+
}
|
|
680
|
+
if (matches.length > 1) {
|
|
681
|
+
console.error(chalk.red(`Multiple cloud sessions match "${query}":`));
|
|
682
|
+
for (const m of matches.slice(0, 10)) {
|
|
683
|
+
console.error(chalk.cyan(` ${m.shortId} ${m.id}`));
|
|
684
|
+
}
|
|
685
|
+
process.exit(1);
|
|
686
|
+
}
|
|
687
|
+
const meta = matches[0];
|
|
688
|
+
const cachedSpinner = options.json ? null : ora('Fetching session...').start();
|
|
689
|
+
let cachedPath;
|
|
690
|
+
try {
|
|
691
|
+
cachedPath = await ensureCloudSessionCached(meta.id, meta.filePath);
|
|
692
|
+
}
|
|
693
|
+
catch (err) {
|
|
694
|
+
cachedSpinner?.stop();
|
|
695
|
+
console.error(chalk.red(`Failed to fetch session: ${err?.message || err}`));
|
|
696
|
+
process.exit(1);
|
|
697
|
+
}
|
|
698
|
+
cachedSpinner?.stop();
|
|
699
|
+
// Ensure the SessionMeta points at the local cache path for renderSession.
|
|
700
|
+
await renderSession({ ...meta, filePath: cachedPath }, mode, filterOpts);
|
|
701
|
+
}
|
|
537
702
|
function parseAgentFilter(agentName) {
|
|
538
703
|
if (!agentName)
|
|
539
704
|
return {};
|
|
@@ -555,6 +720,7 @@ function formatSearchMessage(options) {
|
|
|
555
720
|
return 'Search sessions:';
|
|
556
721
|
return `Search sessions (${filters.join(', ')}):`;
|
|
557
722
|
}
|
|
723
|
+
/** Filter and rank sessions by a multi-term search query across metadata and content. */
|
|
558
724
|
export function filterSessionsByQuery(sessions, query) {
|
|
559
725
|
const trimmed = query?.trim().toLowerCase() || '';
|
|
560
726
|
if (!trimmed)
|
|
@@ -658,8 +824,10 @@ function applyScopeFilters(sessions, scope) {
|
|
|
658
824
|
});
|
|
659
825
|
}
|
|
660
826
|
if (scope.agent) {
|
|
661
|
-
// Accept "claude" or "claude@2.1.112". Version suffix narrows further.
|
|
662
|
-
const [wantAgent,
|
|
827
|
+
// Accept "claude" or "claude@2.1.112" / "claude@default" / "claude@latest". Version suffix narrows further.
|
|
828
|
+
const [wantAgent, rawVersion] = scope.agent.split('@');
|
|
829
|
+
const resolvedAgent = resolveAgentName(wantAgent);
|
|
830
|
+
const wantVersion = resolvedAgent ? resolveVersionAliasLoose(resolvedAgent, rawVersion) : rawVersion;
|
|
663
831
|
filtered = filtered.filter((s) => {
|
|
664
832
|
if (s.agent !== wantAgent)
|
|
665
833
|
return false;
|
|
@@ -786,8 +954,9 @@ async function renderOneSession(query, mode, scope) {
|
|
|
786
954
|
process.exit(1);
|
|
787
955
|
}
|
|
788
956
|
}
|
|
957
|
+
/** Register the `agents sessions` command with all its options and help text. */
|
|
789
958
|
export function registerSessionsCommands(program) {
|
|
790
|
-
program
|
|
959
|
+
const sessionsCmd = program
|
|
791
960
|
.command('sessions')
|
|
792
961
|
.argument('[query]', 'Session ID, search query, or path (., ../, /path) to filter by project')
|
|
793
962
|
.description('Find, browse, and read agent conversation transcripts across Claude, Codex, Gemini, and OpenCode.')
|
|
@@ -806,6 +975,8 @@ export function registerSessionsCommands(program) {
|
|
|
806
975
|
.option('--last <n>', 'Keep only the last N turns (a turn starts at each user message)')
|
|
807
976
|
.option('--artifacts', 'List all files written or edited during a session')
|
|
808
977
|
.option('--artifact <name>', 'Read a specific artifact by filename or path (outputs to stdout)')
|
|
978
|
+
.option('--active', 'Show only sessions running right now across terminals, teams, cloud, and headless agents')
|
|
979
|
+
.option('--cloud', 'Source sessions from Rush Cloud (captured runs) instead of local disk')
|
|
809
980
|
.addHelpText('after', `
|
|
810
981
|
Examples:
|
|
811
982
|
# Interactive picker: browse and search recent sessions (TTY only)
|
|
@@ -824,7 +995,7 @@ Examples:
|
|
|
824
995
|
agents sessions --agent claude --since 7d
|
|
825
996
|
|
|
826
997
|
# Filter sessions in a specific directory
|
|
827
|
-
agents sessions
|
|
998
|
+
agents sessions ~/src/my-project
|
|
828
999
|
|
|
829
1000
|
# Default summary view for one session
|
|
830
1001
|
agents sessions a1b2c3d4
|
|
@@ -853,6 +1024,16 @@ Examples:
|
|
|
853
1024
|
# Include team-spawned sessions in results
|
|
854
1025
|
agents sessions --teams
|
|
855
1026
|
|
|
1027
|
+
# Show only live sessions across terminals, teams, cloud, and headless agents
|
|
1028
|
+
agents sessions --active
|
|
1029
|
+
agents sessions --active --json
|
|
1030
|
+
|
|
1031
|
+
# List captured cloud-run sessions (claude/codex/rush) via Rush Cloud
|
|
1032
|
+
agents sessions --cloud
|
|
1033
|
+
agents sessions --cloud <execution_id>
|
|
1034
|
+
agents sessions --cloud <execution_id> --markdown
|
|
1035
|
+
agents sessions --cloud <execution_id> --include user,assistant --last 3
|
|
1036
|
+
|
|
856
1037
|
Notes:
|
|
857
1038
|
- --include and --exclude are mutually exclusive.
|
|
858
1039
|
- --first and --last are mutually exclusive.
|
|
@@ -861,6 +1042,7 @@ Notes:
|
|
|
861
1042
|
.action(async (query, options) => {
|
|
862
1043
|
await sessionsAction(query, options);
|
|
863
1044
|
});
|
|
1045
|
+
registerSessionsTailCommand(sessionsCmd);
|
|
864
1046
|
}
|
|
865
1047
|
function formatNoSessionsMessage(showAll, project) {
|
|
866
1048
|
const projectQuery = project?.trim();
|
|
@@ -1074,4 +1256,3 @@ function formatRelativeTime(isoTimestamp) {
|
|
|
1074
1256
|
const months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
1075
1257
|
return `${months[d.getMonth()]} ${d.getDate()}`;
|
|
1076
1258
|
}
|
|
1077
|
-
//# sourceMappingURL=sessions.js.map
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Skill management commands for adding domain-specific capabilities to agents.
|
|
3
|
+
*
|
|
4
|
+
* Implements `agents skills` -- list, add, remove, sync, prune, and view
|
|
5
|
+
* packaged SKILL.md bundles (with optional rules/ directories). Central
|
|
6
|
+
* storage lives in ~/.agents/skills/ and skills are synced to individual
|
|
7
|
+
* version homes via copy or symlink.
|
|
8
|
+
*/
|
|
1
9
|
import type { Command } from 'commander';
|
|
10
|
+
/** Register the `agents skills` command tree (list, add, remove, sync, prune, view). */
|
|
2
11
|
export declare function registerSkillsCommands(program: Command): void;
|
|
3
|
-
//# sourceMappingURL=skills.d.ts.map
|
package/dist/commands/skills.js
CHANGED
|
@@ -3,14 +3,15 @@ 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
|
|
6
|
+
import { select, checkbox } from '@inquirer/prompts';
|
|
7
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, getSkillsDir, countSkillFiles, tryParseSkillMetadata, diffVersionSkills,
|
|
10
|
-
import { getGlobalDefault, syncResourcesToVersion, promptAgentVersionSelection, resolveAgentVersionTargets, } from '../lib/versions.js';
|
|
9
|
+
import { discoverSkillsFromRepo, installSkillCentrally, uninstallSkill, listInstalledSkills, listInstalledSkillsWithScope, getSkillInfo, getSkillRules, getSkillsDir, countSkillFiles, tryParseSkillMetadata, diffVersionSkills, iterSkillsCapableVersions, } from '../lib/skills.js';
|
|
10
|
+
import { getGlobalDefault, resolveVersionAlias, 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
13
|
import { showResourceList, buildTargetsSection, } from './resource-view.js';
|
|
14
|
+
/** Register the `agents skills` command tree (list, add, remove, sync, prune, view). */
|
|
14
15
|
export function registerSkillsCommands(program) {
|
|
15
16
|
const skillsCmd = program
|
|
16
17
|
.command('skills')
|
|
@@ -57,7 +58,7 @@ When to use:
|
|
|
57
58
|
process.exit(1);
|
|
58
59
|
}
|
|
59
60
|
filterAgent = resolved;
|
|
60
|
-
filterVersion = parts[1]
|
|
61
|
+
filterVersion = resolveVersionAlias(resolved, parts[1]);
|
|
61
62
|
}
|
|
62
63
|
const rows = await buildSkillRows({ filterAgent, filterVersion });
|
|
63
64
|
spinner.stop();
|
|
@@ -344,181 +345,26 @@ Examples:
|
|
|
344
345
|
}
|
|
345
346
|
}
|
|
346
347
|
});
|
|
348
|
+
// `skills sync` is gone — sync runs automatically when the agent launches.
|
|
347
349
|
skillsCmd
|
|
348
|
-
.command('sync')
|
|
349
|
-
.
|
|
350
|
-
.
|
|
351
|
-
.
|
|
352
|
-
.
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
# Scope to one agent
|
|
358
|
-
agents skills sync --agent claude
|
|
359
|
-
|
|
360
|
-
# Scope to one version
|
|
361
|
-
agents skills sync --agent claude@2.1.113
|
|
362
|
-
|
|
363
|
-
# Symlink into version homes (central updates propagate automatically)
|
|
364
|
-
agents skills sync --method symlink
|
|
365
|
-
|
|
366
|
-
Sync is additive: it installs missing skills and refreshes changed ones. To
|
|
367
|
-
remove orphans (skills in a version home but not in central), use 'agents
|
|
368
|
-
skills prune'.
|
|
369
|
-
`)
|
|
370
|
-
.action(async (options) => {
|
|
371
|
-
const method = (options.method === 'symlink' ? 'symlink' : 'copy');
|
|
372
|
-
let filter;
|
|
373
|
-
if (options.agent) {
|
|
374
|
-
const [name, version] = String(options.agent).split('@');
|
|
375
|
-
const agentId = resolveAgentName(name);
|
|
376
|
-
if (!agentId) {
|
|
377
|
-
console.log(chalk.red(formatAgentError(name, SKILLS_CAPABLE_AGENTS)));
|
|
378
|
-
process.exit(1);
|
|
379
|
-
}
|
|
380
|
-
filter = { agent: agentId, version: version || undefined };
|
|
381
|
-
}
|
|
382
|
-
const pairs = iterSkillsCapableVersions(filter);
|
|
383
|
-
if (pairs.length === 0) {
|
|
384
|
-
console.log(chalk.gray('No matching installed versions.'));
|
|
385
|
-
return;
|
|
386
|
-
}
|
|
387
|
-
const diffs = pairs.map(({ agent, version }) => diffVersionSkills(agent, version));
|
|
388
|
-
const plan = diffs.filter((d) => d.toAdd.length > 0 || d.toUpdate.length > 0);
|
|
389
|
-
if (plan.length === 0) {
|
|
390
|
-
console.log(chalk.green('All version homes are up to date with central.'));
|
|
391
|
-
if (diffs.some((d) => d.orphans.length > 0)) {
|
|
392
|
-
console.log(chalk.gray('Orphan skills present. Run \'agents skills prune --dry-run\' to review.'));
|
|
393
|
-
}
|
|
394
|
-
return;
|
|
395
|
-
}
|
|
396
|
-
console.log(chalk.bold(`Syncing skills (method: ${method})\n`));
|
|
397
|
-
let adds = 0, updates = 0, failures = 0;
|
|
398
|
-
for (const diff of plan) {
|
|
399
|
-
const label = `${diff.agent}@${diff.version}`;
|
|
400
|
-
if (diff.toAdd.length > 0) {
|
|
401
|
-
console.log(` ${chalk.cyan(label)} ${chalk.gray('add:')} ${diff.toAdd.join(', ')}`);
|
|
402
|
-
for (const name of diff.toAdd) {
|
|
403
|
-
const r = installSkillToVersion(diff.agent, diff.version, name, method);
|
|
404
|
-
if (r.success)
|
|
405
|
-
adds++;
|
|
406
|
-
else {
|
|
407
|
-
failures++;
|
|
408
|
-
console.log(chalk.red(` ! ${name}: ${r.error}`));
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
}
|
|
412
|
-
if (diff.toUpdate.length > 0) {
|
|
413
|
-
console.log(` ${chalk.cyan(label)} ${chalk.gray('update:')} ${diff.toUpdate.join(', ')}`);
|
|
414
|
-
for (const name of diff.toUpdate) {
|
|
415
|
-
const r = installSkillToVersion(diff.agent, diff.version, name, method);
|
|
416
|
-
if (r.success)
|
|
417
|
-
updates++;
|
|
418
|
-
else {
|
|
419
|
-
failures++;
|
|
420
|
-
console.log(chalk.red(` ! ${name}: ${r.error}`));
|
|
421
|
-
}
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
-
}
|
|
425
|
-
console.log();
|
|
426
|
-
console.log(chalk.green(`Synced: ${adds} added, ${updates} updated${failures > 0 ? chalk.red(`, ${failures} failed`) : ''}.`));
|
|
427
|
-
const totalOrphans = diffs.reduce((n, d) => n + d.orphans.length, 0);
|
|
428
|
-
if (totalOrphans > 0) {
|
|
429
|
-
console.log(chalk.gray(`${totalOrphans} orphan(s) remain. Run 'agents skills prune --dry-run' to review.`));
|
|
430
|
-
}
|
|
350
|
+
.command('sync', { hidden: true })
|
|
351
|
+
.allowUnknownOption()
|
|
352
|
+
.allowExcessArguments()
|
|
353
|
+
.action(() => {
|
|
354
|
+
console.error(chalk.red('"agents skills sync" is gone.'));
|
|
355
|
+
console.error(chalk.gray('Sync runs automatically when you launch the agent.'));
|
|
356
|
+
console.error(chalk.gray('To remove orphans, use: agents prune skills'));
|
|
357
|
+
process.exit(1);
|
|
431
358
|
});
|
|
359
|
+
// `skills prune` moved to the top-level `agents prune` command.
|
|
432
360
|
skillsCmd
|
|
433
|
-
.command('prune')
|
|
434
|
-
.
|
|
435
|
-
.
|
|
436
|
-
.
|
|
437
|
-
.
|
|
438
|
-
.
|
|
439
|
-
|
|
440
|
-
# See what would be pruned
|
|
441
|
-
agents skills prune --dry-run
|
|
442
|
-
|
|
443
|
-
# Prune across every installed version (prompts for confirmation)
|
|
444
|
-
agents skills prune
|
|
445
|
-
|
|
446
|
-
# Scope to one agent or version
|
|
447
|
-
agents skills prune --agent claude@2.0.65
|
|
448
|
-
|
|
449
|
-
# Skip confirmation (for scripts)
|
|
450
|
-
agents skills prune -y
|
|
451
|
-
|
|
452
|
-
Orphans are skills that exist inside a version home but are missing from the
|
|
453
|
-
central ~/.agents/skills/ source of truth. Usually they are leftovers from a
|
|
454
|
-
skill that was deleted centrally but never removed from the version install.
|
|
455
|
-
`)
|
|
456
|
-
.action(async (options) => {
|
|
457
|
-
let filter;
|
|
458
|
-
if (options.agent) {
|
|
459
|
-
const [name, version] = String(options.agent).split('@');
|
|
460
|
-
const agentId = resolveAgentName(name);
|
|
461
|
-
if (!agentId) {
|
|
462
|
-
console.log(chalk.red(formatAgentError(name, SKILLS_CAPABLE_AGENTS)));
|
|
463
|
-
process.exit(1);
|
|
464
|
-
}
|
|
465
|
-
filter = { agent: agentId, version: version || undefined };
|
|
466
|
-
}
|
|
467
|
-
const pairs = iterSkillsCapableVersions(filter);
|
|
468
|
-
const diffs = pairs
|
|
469
|
-
.map(({ agent, version }) => diffVersionSkills(agent, version))
|
|
470
|
-
.filter((d) => d.orphans.length > 0);
|
|
471
|
-
if (diffs.length === 0) {
|
|
472
|
-
console.log(chalk.green('No orphan skills.'));
|
|
473
|
-
return;
|
|
474
|
-
}
|
|
475
|
-
const total = diffs.reduce((n, d) => n + d.orphans.length, 0);
|
|
476
|
-
console.log(chalk.bold(`Orphans (in version home, not in central)\n`));
|
|
477
|
-
for (const d of diffs) {
|
|
478
|
-
console.log(` ${chalk.cyan(`${d.agent}@${d.version}`)} ${d.orphans.join(', ')}`);
|
|
479
|
-
}
|
|
480
|
-
console.log();
|
|
481
|
-
if (options.dryRun) {
|
|
482
|
-
console.log(chalk.gray(`${total} orphan(s). Run without --dry-run to delete.`));
|
|
483
|
-
return;
|
|
484
|
-
}
|
|
485
|
-
if (!options.yes) {
|
|
486
|
-
if (!isInteractiveTerminal()) {
|
|
487
|
-
console.log(chalk.yellow('Non-interactive shell: pass -y to confirm, or --dry-run to preview.'));
|
|
488
|
-
process.exit(1);
|
|
489
|
-
}
|
|
490
|
-
let ok = false;
|
|
491
|
-
try {
|
|
492
|
-
ok = await confirm({
|
|
493
|
-
message: `Delete ${total} orphan skill director${total === 1 ? 'y' : 'ies'}?`,
|
|
494
|
-
default: false,
|
|
495
|
-
});
|
|
496
|
-
}
|
|
497
|
-
catch (err) {
|
|
498
|
-
if (isPromptCancelled(err)) {
|
|
499
|
-
console.log(chalk.gray('Cancelled'));
|
|
500
|
-
return;
|
|
501
|
-
}
|
|
502
|
-
throw err;
|
|
503
|
-
}
|
|
504
|
-
if (!ok) {
|
|
505
|
-
console.log(chalk.gray('Cancelled'));
|
|
506
|
-
return;
|
|
507
|
-
}
|
|
508
|
-
}
|
|
509
|
-
let removed = 0, failures = 0;
|
|
510
|
-
for (const d of diffs) {
|
|
511
|
-
for (const name of d.orphans) {
|
|
512
|
-
const r = removeSkillFromVersion(d.agent, d.version, name);
|
|
513
|
-
if (r.success)
|
|
514
|
-
removed++;
|
|
515
|
-
else {
|
|
516
|
-
failures++;
|
|
517
|
-
console.log(chalk.red(` ! ${d.agent}@${d.version} ${name}: ${r.error}`));
|
|
518
|
-
}
|
|
519
|
-
}
|
|
520
|
-
}
|
|
521
|
-
console.log(chalk.green(`Pruned ${removed} orphan(s)${failures > 0 ? chalk.red(`, ${failures} failed`) : ''}.`));
|
|
361
|
+
.command('prune', { hidden: true })
|
|
362
|
+
.allowUnknownOption()
|
|
363
|
+
.allowExcessArguments()
|
|
364
|
+
.action(() => {
|
|
365
|
+
console.error(chalk.red('"agents skills prune" moved.'));
|
|
366
|
+
console.error(chalk.gray('Use: agents prune skills (or `agents prune` for everything)'));
|
|
367
|
+
process.exit(1);
|
|
522
368
|
});
|
|
523
369
|
skillsCmd
|
|
524
370
|
.command('view [name]')
|
|
@@ -664,9 +510,14 @@ async function buildSkillRows(opts) {
|
|
|
664
510
|
});
|
|
665
511
|
}
|
|
666
512
|
const fileCount = countSkillFiles(skill.path);
|
|
513
|
+
// Append repo source when a skill comes from a registered extra so users
|
|
514
|
+
// can see which DotAgent repo owns it at a glance.
|
|
515
|
+
const description = skill.source
|
|
516
|
+
? `${skill.metadata.description || ''}${skill.metadata.description ? ' ' : ''}${chalk.gray(`[${skill.source}]`)}`
|
|
517
|
+
: skill.metadata.description;
|
|
667
518
|
rows.push({
|
|
668
519
|
name,
|
|
669
|
-
description
|
|
520
|
+
description,
|
|
670
521
|
extra: fileCount > 0 ? `${fileCount}` : '-',
|
|
671
522
|
targets,
|
|
672
523
|
buildDetail: () => formatSkillDetail(name, skill, targets, fileCount),
|
|
@@ -713,4 +564,3 @@ function formatSkillDetail(name, skill, targets, fileCount) {
|
|
|
713
564
|
lines.push(buildTargetsSection(targets));
|
|
714
565
|
return lines.join('\n');
|
|
715
566
|
}
|
|
716
|
-
//# sourceMappingURL=skills.js.map
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deprecated status command.
|
|
3
|
+
*
|
|
4
|
+
* Registers the `agents status` command as a backward-compatible alias
|
|
5
|
+
* for `agents view`. Prints a deprecation notice and delegates to viewAction.
|
|
6
|
+
*/
|
|
1
7
|
import type { Command } from 'commander';
|
|
8
|
+
/** Register the deprecated `agents status` command (alias for `agents view`). */
|
|
2
9
|
export declare function registerStatusCommand(program: Command): void;
|
|
3
|
-
//# sourceMappingURL=status.d.ts.map
|
package/dist/commands/status.js
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deprecated status command.
|
|
3
|
+
*
|
|
4
|
+
* Registers the `agents status` command as a backward-compatible alias
|
|
5
|
+
* for `agents view`. Prints a deprecation notice and delegates to viewAction.
|
|
6
|
+
*/
|
|
1
7
|
import chalk from 'chalk';
|
|
2
8
|
import { viewAction } from './view.js';
|
|
9
|
+
/** Register the deprecated `agents status` command (alias for `agents view`). */
|
|
3
10
|
export function registerStatusCommand(program) {
|
|
4
11
|
// Deprecated: use `agents view` instead
|
|
5
12
|
program
|
|
@@ -16,4 +23,3 @@ export function registerStatusCommand(program) {
|
|
|
16
23
|
}
|
|
17
24
|
});
|
|
18
25
|
}
|
|
19
|
-
//# sourceMappingURL=status.js.map
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Subagent management commands.
|
|
3
|
+
*
|
|
4
|
+
* Registers the `agents subagents` command tree for listing, viewing,
|
|
5
|
+
* installing, and removing lightweight agent definitions (AGENT.md files)
|
|
6
|
+
* that parent agents can spawn for focused subtasks.
|
|
7
|
+
*/
|
|
1
8
|
import type { Command } from 'commander';
|
|
9
|
+
/** Register the `agents subagents` command tree. */
|
|
2
10
|
export declare function registerSubagentsCommands(program: Command): void;
|
|
3
|
-
//# sourceMappingURL=subagents.d.ts.map
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Subagent management commands.
|
|
3
|
+
*
|
|
4
|
+
* Registers the `agents subagents` command tree for listing, viewing,
|
|
5
|
+
* installing, and removing lightweight agent definitions (AGENT.md files)
|
|
6
|
+
* that parent agents can spawn for focused subtasks.
|
|
7
|
+
*/
|
|
1
8
|
import chalk from 'chalk';
|
|
2
9
|
import ora from 'ora';
|
|
3
10
|
import * as fs from 'fs';
|
|
@@ -10,6 +17,7 @@ import { listInstalledVersions, syncResourcesToVersion, getGlobalDefault, getVer
|
|
|
10
17
|
import { getSubagentsDir } from '../lib/state.js';
|
|
11
18
|
import { isInteractiveTerminal, isPromptCancelled, requireInteractiveSelection, requireDestructiveArg, } from './utils.js';
|
|
12
19
|
import { showResourceList, buildTargetsSection, } from './resource-view.js';
|
|
20
|
+
/** Replace the home directory prefix with ~ for display. */
|
|
13
21
|
function formatPath(p) {
|
|
14
22
|
const home = process.env.HOME || '';
|
|
15
23
|
if (home && p.startsWith(home)) {
|
|
@@ -17,6 +25,7 @@ function formatPath(p) {
|
|
|
17
25
|
}
|
|
18
26
|
return p;
|
|
19
27
|
}
|
|
28
|
+
/** Register the `agents subagents` command tree. */
|
|
20
29
|
export function registerSubagentsCommands(program) {
|
|
21
30
|
const subagentsCmd = program
|
|
22
31
|
.command('subagents')
|
|
@@ -271,6 +280,7 @@ function buildSubagentTargets(name) {
|
|
|
271
280
|
}
|
|
272
281
|
return targets;
|
|
273
282
|
}
|
|
283
|
+
/** Build resource rows for all centrally-installed subagents with sync status. */
|
|
274
284
|
function buildSubagentRows() {
|
|
275
285
|
const central = listInstalledSubagents();
|
|
276
286
|
if (central.length === 0)
|
|
@@ -311,6 +321,7 @@ function buildSubagentRows() {
|
|
|
311
321
|
});
|
|
312
322
|
return rows;
|
|
313
323
|
}
|
|
324
|
+
/** Build the multi-line detail pane shown when a subagent is selected in the picker. */
|
|
314
325
|
function formatSubagentDetail(sub, targets) {
|
|
315
326
|
const lines = [];
|
|
316
327
|
lines.push(chalk.bold.cyan(sub.name));
|
|
@@ -347,4 +358,3 @@ function formatSubagentDetail(sub, targets) {
|
|
|
347
358
|
}
|
|
348
359
|
return lines.join('\n');
|
|
349
360
|
}
|
|
350
|
-
//# sourceMappingURL=subagents.js.map
|
package/dist/commands/sync.d.ts
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal resource sync command.
|
|
3
|
+
*
|
|
4
|
+
* Registers the hidden `agents sync` command invoked by shims to
|
|
5
|
+
* synchronize resources (commands, skills, hooks, memory, MCP, etc.)
|
|
6
|
+
* into a specific agent version home before launch.
|
|
7
|
+
*/
|
|
1
8
|
import { Command } from 'commander';
|
|
9
|
+
/** Register the hidden `agents sync` command. */
|
|
2
10
|
export declare function registerSyncCommand(program: Command): void;
|
|
3
|
-
//# sourceMappingURL=sync.d.ts.map
|
package/dist/commands/sync.js
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal resource sync command.
|
|
3
|
+
*
|
|
4
|
+
* Registers the hidden `agents sync` command invoked by shims to
|
|
5
|
+
* synchronize resources (commands, skills, hooks, memory, MCP, etc.)
|
|
6
|
+
* into a specific agent version home before launch.
|
|
7
|
+
*/
|
|
1
8
|
import chalk from 'chalk';
|
|
2
9
|
import { AGENTS } from '../lib/agents.js';
|
|
3
10
|
import { isVersionInstalled, syncResourcesToVersion } from '../lib/versions.js';
|
|
11
|
+
/** Register the hidden `agents sync` command. */
|
|
4
12
|
export function registerSyncCommand(program) {
|
|
5
13
|
program
|
|
6
14
|
.command('sync', { hidden: true })
|
|
@@ -59,4 +67,3 @@ export function registerSyncCommand(program) {
|
|
|
59
67
|
}
|
|
60
68
|
});
|
|
61
69
|
}
|
|
62
|
-
//# sourceMappingURL=sync.js.map
|