@phnx-labs/agents-cli 1.12.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 +293 -300
- package/dist/commands/alias.d.ts +11 -0
- package/dist/commands/alias.js +117 -0
- package/dist/commands/beta.d.ts +2 -0
- package/dist/commands/beta.js +53 -0
- package/dist/commands/cloud.d.ts +10 -0
- package/dist/commands/cloud.js +408 -0
- package/dist/commands/commands.d.ts +9 -1
- package/dist/commands/commands.js +24 -172
- package/dist/commands/daemon.d.ts +8 -1
- package/dist/commands/daemon.js +13 -5
- package/dist/commands/doctor.d.ts +15 -0
- package/dist/commands/doctor.js +132 -0
- package/dist/commands/drive.d.ts +8 -1
- package/dist/commands/drive.js +20 -3
- package/dist/commands/exec.d.ts +8 -1
- package/dist/commands/exec.js +207 -20
- package/dist/commands/factory.d.ts +19 -0
- package/dist/commands/factory.js +71 -0
- package/dist/commands/fork.d.ts +8 -1
- package/dist/commands/fork.js +11 -4
- package/dist/commands/hooks.d.ts +9 -1
- package/dist/commands/hooks.js +30 -182
- package/dist/commands/init.d.ts +15 -1
- package/dist/commands/init.js +168 -74
- package/dist/commands/mcp.d.ts +9 -1
- package/dist/commands/mcp.js +11 -7
- package/dist/commands/models.d.ts +8 -1
- package/dist/commands/models.js +45 -6
- package/dist/commands/packages.d.ts +8 -1
- package/dist/commands/packages.js +13 -7
- package/dist/commands/permissions.d.ts +9 -1
- package/dist/commands/permissions.js +3 -3
- package/dist/commands/plugins.d.ts +8 -1
- package/dist/commands/plugins.js +13 -2
- package/dist/commands/profiles.d.ts +11 -0
- package/dist/commands/profiles.js +291 -0
- package/dist/commands/prune.d.ts +22 -0
- package/dist/commands/prune.js +191 -0
- package/dist/commands/pty.d.ts +1 -1
- package/dist/commands/pty.js +2 -1
- package/dist/commands/pull.d.ts +8 -1
- package/dist/commands/pull.js +93 -129
- package/dist/commands/refresh-memory.d.ts +7 -1
- package/dist/commands/refresh-memory.js +7 -1
- package/dist/commands/repo.d.ts +15 -0
- package/dist/commands/repo.js +570 -0
- package/dist/commands/resource-view.d.ts +10 -3
- package/dist/commands/resource-view.js +18 -5
- package/dist/commands/routines.d.ts +8 -1
- package/dist/commands/routines.js +17 -4
- package/dist/commands/rules.d.ts +9 -1
- package/dist/commands/rules.js +16 -11
- package/dist/commands/secrets.d.ts +10 -0
- package/dist/commands/secrets.js +511 -0
- package/dist/commands/sessions-picker.d.ts +2 -1
- package/dist/commands/sessions-picker.js +88 -11
- package/dist/commands/sessions-tail.d.ts +19 -0
- package/dist/commands/sessions-tail.js +235 -0
- package/dist/commands/sessions.d.ts +2 -1
- package/dist/commands/sessions.js +288 -7
- package/dist/commands/skills.d.ts +9 -1
- package/dist/commands/skills.js +28 -178
- package/dist/commands/status.d.ts +7 -1
- package/dist/commands/status.js +7 -1
- package/dist/commands/subagents.d.ts +8 -1
- package/dist/commands/subagents.js +11 -1
- package/dist/commands/sync.d.ts +8 -1
- package/dist/commands/sync.js +8 -1
- package/dist/commands/teams-picker.d.ts +4 -1
- package/dist/commands/teams-picker.js +55 -3
- package/dist/commands/teams.d.ts +15 -1
- package/dist/commands/teams.js +323 -69
- package/dist/commands/usage.d.ts +11 -0
- package/dist/commands/usage.js +60 -0
- package/dist/commands/utils.d.ts +6 -1
- package/dist/commands/utils.js +6 -1
- package/dist/commands/versions.d.ts +8 -1
- package/dist/commands/versions.js +4 -3
- package/dist/commands/view.d.ts +47 -2
- package/dist/commands/view.js +353 -20
- package/dist/index.d.ts +7 -2
- package/dist/index.js +205 -38
- package/dist/lib/acp/client.d.ts +31 -0
- package/dist/lib/acp/client.js +117 -0
- package/dist/lib/acp/harnesses.d.ts +26 -0
- package/dist/lib/acp/harnesses.js +65 -0
- package/dist/lib/acp/run.d.ts +18 -0
- package/dist/lib/acp/run.js +39 -0
- package/dist/lib/agents.d.ts +74 -2
- package/dist/lib/agents.js +207 -23
- package/dist/lib/artifact-actions.d.ts +8 -4
- package/dist/lib/artifact-actions.js +8 -6
- package/dist/lib/auto-pull-worker.d.ts +11 -0
- package/dist/lib/auto-pull-worker.js +121 -0
- package/dist/lib/auto-pull.d.ts +31 -0
- package/dist/lib/auto-pull.js +97 -0
- package/dist/lib/beta.d.ts +23 -0
- package/dist/lib/beta.js +90 -0
- package/dist/lib/capabilities.d.ts +29 -0
- package/dist/lib/capabilities.js +74 -0
- package/dist/lib/cloud/codex.d.ts +25 -0
- package/dist/lib/cloud/codex.js +250 -0
- package/dist/lib/cloud/factory.d.ts +31 -0
- package/dist/lib/cloud/factory.js +53 -0
- package/dist/lib/cloud/registry.d.ts +15 -0
- package/dist/lib/cloud/registry.js +67 -0
- package/dist/lib/cloud/rush.d.ts +75 -0
- package/dist/lib/cloud/rush.js +438 -0
- package/dist/lib/cloud/store.d.ts +22 -0
- package/dist/lib/cloud/store.js +115 -0
- package/dist/lib/cloud/stream.d.ts +23 -0
- package/dist/lib/cloud/stream.js +194 -0
- package/dist/lib/cloud/types.d.ts +205 -0
- package/dist/lib/cloud/types.js +34 -0
- package/dist/lib/command-skills.d.ts +20 -0
- package/dist/lib/command-skills.js +142 -0
- package/dist/lib/commands.d.ts +22 -2
- package/dist/lib/commands.js +51 -11
- package/dist/lib/convert.d.ts +10 -1
- package/dist/lib/convert.js +9 -1
- package/dist/lib/daemon.d.ts +21 -1
- package/dist/lib/daemon.js +97 -4
- package/dist/lib/drive-sync.d.ts +18 -1
- package/dist/lib/drive-sync.js +57 -15
- package/dist/lib/exec.d.ts +25 -5
- package/dist/lib/exec.js +72 -27
- package/dist/lib/fs-walk.d.ts +2 -0
- package/dist/lib/fs-walk.js +40 -0
- package/dist/lib/fuzzy.d.ts +53 -0
- package/dist/lib/fuzzy.js +72 -0
- package/dist/lib/gemini-settings.d.ts +4 -0
- package/dist/lib/gemini-settings.js +33 -0
- package/dist/lib/git.d.ts +12 -2
- package/dist/lib/git.js +17 -6
- package/dist/lib/help.d.ts +20 -1
- package/dist/lib/help.js +45 -6
- package/dist/lib/hooks/match.d.ts +32 -0
- package/dist/lib/hooks/match.js +120 -0
- package/dist/lib/hooks.d.ts +17 -4
- package/dist/lib/hooks.js +191 -21
- package/dist/lib/manifest.d.ts +6 -1
- package/dist/lib/manifest.js +15 -4
- package/dist/lib/markdown.d.ts +0 -1
- package/dist/lib/markdown.js +6 -1
- package/dist/lib/mcp.d.ts +0 -1
- package/dist/lib/mcp.js +29 -33
- package/dist/lib/memory-compile.d.ts +13 -3
- package/dist/lib/memory-compile.js +31 -9
- package/dist/lib/memory.d.ts +14 -7
- package/dist/lib/memory.js +67 -38
- package/dist/lib/migrate.d.ts +8 -0
- package/dist/lib/migrate.js +85 -0
- package/dist/lib/models.d.ts +25 -11
- package/dist/lib/models.js +405 -16
- package/dist/lib/onepassword.d.ts +63 -0
- package/dist/lib/onepassword.js +186 -0
- package/dist/lib/paths.d.ts +8 -0
- package/dist/lib/paths.js +20 -0
- package/dist/lib/permissions.d.ts +24 -2
- package/dist/lib/permissions.js +117 -48
- package/dist/lib/picker.d.ts +10 -1
- package/dist/lib/picker.js +15 -1
- package/dist/lib/plugins.d.ts +7 -1
- package/dist/lib/plugins.js +10 -1
- package/dist/lib/profiles-presets.d.ts +24 -0
- package/dist/lib/profiles-presets.js +103 -0
- package/dist/lib/profiles.d.ts +69 -0
- package/dist/lib/profiles.js +144 -0
- package/dist/lib/pty-client.d.ts +1 -1
- package/dist/lib/pty-client.js +0 -1
- package/dist/lib/pty-server.d.ts +16 -2
- package/dist/lib/pty-server.js +92 -3
- package/dist/lib/registry.d.ts +23 -3
- package/dist/lib/registry.js +153 -8
- package/dist/lib/resources.d.ts +28 -1
- package/dist/lib/resources.js +79 -1
- package/dist/lib/rotate.d.ts +79 -0
- package/dist/lib/rotate.js +285 -0
- package/dist/lib/routines.d.ts +29 -1
- package/dist/lib/routines.js +32 -5
- package/dist/lib/runner.d.ts +14 -1
- package/dist/lib/runner.js +22 -3
- package/dist/lib/sandbox.d.ts +16 -1
- package/dist/lib/sandbox.js +39 -16
- package/dist/lib/scheduler.d.ts +8 -1
- package/dist/lib/scheduler.js +8 -1
- package/dist/lib/secrets/AgentsKeychain.app/Contents/CodeResources +0 -0
- package/dist/lib/secrets/AgentsKeychain.app/Contents/Info.plist +22 -0
- package/dist/lib/secrets/AgentsKeychain.app/Contents/MacOS/AgentsKeychain +0 -0
- package/dist/lib/secrets/AgentsKeychain.app/Contents/_CodeSignature/CodeResources +123 -0
- package/dist/lib/secrets/AgentsKeychain.app/Contents/embedded.provisionprofile +0 -0
- package/dist/lib/secrets/bundles.d.ts +39 -0
- package/dist/lib/secrets/bundles.js +189 -0
- package/dist/lib/secrets/index.d.ts +55 -0
- package/dist/lib/secrets/index.js +211 -0
- package/dist/lib/secrets/profiles.d.ts +10 -0
- package/dist/lib/secrets/profiles.js +13 -0
- package/dist/lib/session/active.d.ts +43 -0
- package/dist/lib/session/active.js +392 -0
- package/dist/lib/session/artifacts.d.ts +16 -0
- package/dist/lib/session/artifacts.js +95 -0
- package/dist/lib/session/cloud.d.ts +30 -0
- package/dist/lib/session/cloud.js +121 -0
- package/dist/lib/session/db.d.ts +23 -2
- package/dist/lib/session/db.js +76 -12
- package/dist/lib/session/discover.d.ts +19 -4
- package/dist/lib/session/discover.js +344 -48
- package/dist/lib/session/parse.d.ts +28 -1
- package/dist/lib/session/parse.js +267 -9
- package/dist/lib/session/prompt.d.ts +9 -1
- package/dist/lib/session/prompt.js +17 -3
- package/dist/lib/session/render.d.ts +13 -1
- package/dist/lib/session/render.js +20 -1
- package/dist/lib/session/team-filter.d.ts +9 -1
- package/dist/lib/session/team-filter.js +11 -2
- package/dist/lib/session/types.d.ts +24 -2
- package/dist/lib/session/types.js +10 -2
- package/dist/lib/shims.d.ts +93 -5
- package/dist/lib/shims.js +380 -67
- package/dist/lib/skills.d.ts +27 -2
- package/dist/lib/skills.js +127 -65
- package/dist/lib/sqlite.d.ts +43 -0
- package/dist/lib/sqlite.js +94 -0
- package/dist/lib/state.d.ts +114 -22
- package/dist/lib/state.js +323 -138
- package/dist/lib/subagents.d.ts +9 -1
- package/dist/lib/subagents.js +70 -63
- package/dist/lib/sync-manifest.d.ts +81 -0
- package/dist/lib/sync-manifest.js +450 -0
- package/dist/lib/teams/agents.d.ts +103 -5
- package/dist/lib/teams/agents.js +414 -91
- package/dist/lib/teams/api.d.ts +26 -3
- package/dist/lib/teams/api.js +63 -3
- package/dist/lib/teams/debug.d.ts +6 -1
- package/dist/lib/teams/debug.js +6 -1
- package/dist/lib/teams/file_ops.d.ts +7 -1
- package/dist/lib/teams/file_ops.js +7 -1
- package/dist/lib/teams/index.d.ts +15 -0
- package/dist/lib/teams/index.js +14 -0
- package/dist/lib/teams/parsers.d.ts +4 -1
- package/dist/lib/teams/parsers.js +11 -1
- package/dist/lib/teams/persistence.d.ts +15 -1
- package/dist/lib/teams/persistence.js +102 -20
- package/dist/lib/teams/registry.d.ts +12 -1
- package/dist/lib/teams/registry.js +116 -33
- package/dist/lib/teams/summarizer.d.ts +15 -1
- package/dist/lib/teams/summarizer.js +14 -1
- package/dist/lib/teams/supervisor.d.ts +48 -0
- package/dist/lib/teams/supervisor.js +73 -0
- package/dist/lib/template.d.ts +8 -6
- package/dist/lib/template.js +8 -6
- package/dist/lib/types.d.ts +147 -8
- package/dist/lib/types.js +26 -3
- package/dist/lib/usage.d.ts +48 -1
- package/dist/lib/usage.js +97 -16
- package/dist/lib/version-duplicates.d.ts +21 -0
- package/dist/lib/version-duplicates.js +90 -0
- package/dist/lib/versions.d.ts +39 -4
- package/dist/lib/versions.js +401 -111
- package/package.json +33 -18
- package/scripts/postinstall.js +126 -30
- package/dist/commands/__tests__/sessions.test.d.ts +0 -2
- package/dist/commands/__tests__/sessions.test.d.ts.map +0 -1
- package/dist/commands/__tests__/sessions.test.js +0 -636
- package/dist/commands/__tests__/sessions.test.js.map +0 -1
- package/dist/commands/commands.d.ts.map +0 -1
- package/dist/commands/commands.js.map +0 -1
- package/dist/commands/daemon.d.ts.map +0 -1
- package/dist/commands/daemon.js.map +0 -1
- package/dist/commands/drive.d.ts.map +0 -1
- package/dist/commands/drive.js.map +0 -1
- package/dist/commands/exec.d.ts.map +0 -1
- package/dist/commands/exec.js.map +0 -1
- package/dist/commands/fork.d.ts.map +0 -1
- package/dist/commands/fork.js.map +0 -1
- package/dist/commands/hooks.d.ts.map +0 -1
- package/dist/commands/hooks.js.map +0 -1
- package/dist/commands/init.d.ts.map +0 -1
- package/dist/commands/init.js.map +0 -1
- package/dist/commands/mcp.d.ts.map +0 -1
- package/dist/commands/mcp.js.map +0 -1
- package/dist/commands/models.d.ts.map +0 -1
- package/dist/commands/models.js.map +0 -1
- package/dist/commands/packages.d.ts.map +0 -1
- package/dist/commands/packages.js.map +0 -1
- package/dist/commands/permissions.d.ts.map +0 -1
- package/dist/commands/permissions.js.map +0 -1
- package/dist/commands/plugins.d.ts.map +0 -1
- package/dist/commands/plugins.js.map +0 -1
- package/dist/commands/pty.d.ts.map +0 -1
- package/dist/commands/pty.js.map +0 -1
- package/dist/commands/pull.d.ts.map +0 -1
- package/dist/commands/pull.js.map +0 -1
- package/dist/commands/push.d.ts +0 -3
- package/dist/commands/push.d.ts.map +0 -1
- package/dist/commands/push.js +0 -180
- package/dist/commands/push.js.map +0 -1
- package/dist/commands/refresh-memory.d.ts.map +0 -1
- package/dist/commands/refresh-memory.js.map +0 -1
- package/dist/commands/resource-view.d.ts.map +0 -1
- package/dist/commands/resource-view.js.map +0 -1
- package/dist/commands/routines.d.ts.map +0 -1
- package/dist/commands/routines.js.map +0 -1
- package/dist/commands/rules.d.ts.map +0 -1
- package/dist/commands/rules.js.map +0 -1
- package/dist/commands/sessions-picker.d.ts.map +0 -1
- package/dist/commands/sessions-picker.js.map +0 -1
- package/dist/commands/sessions.d.ts.map +0 -1
- package/dist/commands/sessions.js.map +0 -1
- package/dist/commands/skills.d.ts.map +0 -1
- package/dist/commands/skills.js.map +0 -1
- package/dist/commands/status.d.ts.map +0 -1
- package/dist/commands/status.js.map +0 -1
- package/dist/commands/subagents.d.ts.map +0 -1
- package/dist/commands/subagents.js.map +0 -1
- package/dist/commands/sync.d.ts.map +0 -1
- package/dist/commands/sync.js.map +0 -1
- package/dist/commands/teams-picker.d.ts.map +0 -1
- package/dist/commands/teams-picker.js.map +0 -1
- package/dist/commands/teams.d.ts.map +0 -1
- package/dist/commands/teams.js.map +0 -1
- package/dist/commands/utils.d.ts.map +0 -1
- package/dist/commands/utils.js.map +0 -1
- package/dist/commands/versions.d.ts.map +0 -1
- package/dist/commands/versions.js.map +0 -1
- package/dist/commands/view.d.ts.map +0 -1
- package/dist/commands/view.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/lib/__tests__/bugfixes.test.d.ts +0 -2
- package/dist/lib/__tests__/bugfixes.test.d.ts.map +0 -1
- package/dist/lib/__tests__/bugfixes.test.js +0 -192
- package/dist/lib/__tests__/bugfixes.test.js.map +0 -1
- package/dist/lib/__tests__/exec.test.d.ts +0 -2
- package/dist/lib/__tests__/exec.test.d.ts.map +0 -1
- package/dist/lib/__tests__/exec.test.js +0 -446
- package/dist/lib/__tests__/exec.test.js.map +0 -1
- package/dist/lib/__tests__/git-sync.test.d.ts +0 -2
- package/dist/lib/__tests__/git-sync.test.d.ts.map +0 -1
- package/dist/lib/__tests__/git-sync.test.js +0 -138
- package/dist/lib/__tests__/git-sync.test.js.map +0 -1
- package/dist/lib/__tests__/hooks.test.d.ts +0 -2
- package/dist/lib/__tests__/hooks.test.d.ts.map +0 -1
- package/dist/lib/__tests__/hooks.test.js +0 -203
- package/dist/lib/__tests__/hooks.test.js.map +0 -1
- package/dist/lib/__tests__/memory-compile.test.d.ts +0 -2
- package/dist/lib/__tests__/memory-compile.test.d.ts.map +0 -1
- package/dist/lib/__tests__/memory-compile.test.js +0 -95
- package/dist/lib/__tests__/memory-compile.test.js.map +0 -1
- package/dist/lib/__tests__/models.test.d.ts +0 -2
- package/dist/lib/__tests__/models.test.d.ts.map +0 -1
- package/dist/lib/__tests__/models.test.js +0 -184
- package/dist/lib/__tests__/models.test.js.map +0 -1
- package/dist/lib/__tests__/usage.test.d.ts +0 -2
- package/dist/lib/__tests__/usage.test.d.ts.map +0 -1
- package/dist/lib/__tests__/usage.test.js +0 -218
- package/dist/lib/__tests__/usage.test.js.map +0 -1
- package/dist/lib/agents.d.ts.map +0 -1
- package/dist/lib/agents.js.map +0 -1
- package/dist/lib/artifact-actions.d.ts.map +0 -1
- package/dist/lib/artifact-actions.js.map +0 -1
- package/dist/lib/commands.d.ts.map +0 -1
- package/dist/lib/commands.js.map +0 -1
- package/dist/lib/convert.d.ts.map +0 -1
- package/dist/lib/convert.js.map +0 -1
- package/dist/lib/daemon.d.ts.map +0 -1
- package/dist/lib/daemon.js.map +0 -1
- package/dist/lib/drive-sync.d.ts.map +0 -1
- package/dist/lib/drive-sync.js.map +0 -1
- package/dist/lib/exec.d.ts.map +0 -1
- package/dist/lib/exec.js.map +0 -1
- package/dist/lib/factory.d.ts +0 -57
- package/dist/lib/factory.d.ts.map +0 -1
- package/dist/lib/factory.js +0 -110
- package/dist/lib/factory.js.map +0 -1
- package/dist/lib/git.d.ts.map +0 -1
- package/dist/lib/git.js.map +0 -1
- package/dist/lib/help.d.ts.map +0 -1
- package/dist/lib/help.js.map +0 -1
- package/dist/lib/hooks.d.ts.map +0 -1
- package/dist/lib/hooks.js.map +0 -1
- package/dist/lib/manifest.d.ts.map +0 -1
- package/dist/lib/manifest.js.map +0 -1
- package/dist/lib/markdown.d.ts.map +0 -1
- package/dist/lib/markdown.js.map +0 -1
- package/dist/lib/mcp.d.ts.map +0 -1
- package/dist/lib/mcp.js.map +0 -1
- package/dist/lib/memory-compile.d.ts.map +0 -1
- package/dist/lib/memory-compile.js.map +0 -1
- package/dist/lib/memory.d.ts.map +0 -1
- package/dist/lib/memory.js.map +0 -1
- package/dist/lib/models.d.ts.map +0 -1
- package/dist/lib/models.js.map +0 -1
- package/dist/lib/permissions.d.ts.map +0 -1
- package/dist/lib/permissions.js.map +0 -1
- package/dist/lib/picker.d.ts.map +0 -1
- package/dist/lib/picker.js.map +0 -1
- package/dist/lib/plugins.d.ts.map +0 -1
- package/dist/lib/plugins.js.map +0 -1
- package/dist/lib/pty-client.d.ts.map +0 -1
- package/dist/lib/pty-client.js.map +0 -1
- package/dist/lib/pty-server.d.ts.map +0 -1
- package/dist/lib/pty-server.js.map +0 -1
- package/dist/lib/registry.d.ts.map +0 -1
- package/dist/lib/registry.js.map +0 -1
- package/dist/lib/resources.d.ts.map +0 -1
- package/dist/lib/resources.js.map +0 -1
- package/dist/lib/routines.d.ts.map +0 -1
- package/dist/lib/routines.js.map +0 -1
- package/dist/lib/runner.d.ts.map +0 -1
- package/dist/lib/runner.js.map +0 -1
- package/dist/lib/sandbox.d.ts.map +0 -1
- package/dist/lib/sandbox.js.map +0 -1
- package/dist/lib/scheduler.d.ts.map +0 -1
- package/dist/lib/scheduler.js.map +0 -1
- package/dist/lib/session/__tests__/db.test.d.ts +0 -2
- package/dist/lib/session/__tests__/db.test.d.ts.map +0 -1
- package/dist/lib/session/__tests__/db.test.js +0 -54
- package/dist/lib/session/__tests__/db.test.js.map +0 -1
- package/dist/lib/session/__tests__/discover.test.d.ts +0 -2
- package/dist/lib/session/__tests__/discover.test.d.ts.map +0 -1
- package/dist/lib/session/__tests__/discover.test.js +0 -63
- package/dist/lib/session/__tests__/discover.test.js.map +0 -1
- package/dist/lib/session/__tests__/prompt.test.d.ts +0 -2
- package/dist/lib/session/__tests__/prompt.test.d.ts.map +0 -1
- package/dist/lib/session/__tests__/prompt.test.js +0 -44
- package/dist/lib/session/__tests__/prompt.test.js.map +0 -1
- package/dist/lib/session/__tests__/render.test.d.ts +0 -2
- package/dist/lib/session/__tests__/render.test.d.ts.map +0 -1
- package/dist/lib/session/__tests__/render.test.js +0 -602
- package/dist/lib/session/__tests__/render.test.js.map +0 -1
- package/dist/lib/session/db.d.ts.map +0 -1
- package/dist/lib/session/db.js.map +0 -1
- package/dist/lib/session/discover.d.ts.map +0 -1
- package/dist/lib/session/discover.js.map +0 -1
- package/dist/lib/session/parse.d.ts.map +0 -1
- package/dist/lib/session/parse.js.map +0 -1
- package/dist/lib/session/prompt.d.ts.map +0 -1
- package/dist/lib/session/prompt.js.map +0 -1
- package/dist/lib/session/prompt.test.d.ts +0 -2
- package/dist/lib/session/prompt.test.d.ts.map +0 -1
- package/dist/lib/session/prompt.test.js +0 -57
- package/dist/lib/session/prompt.test.js.map +0 -1
- package/dist/lib/session/render.d.ts.map +0 -1
- package/dist/lib/session/render.js.map +0 -1
- package/dist/lib/session/team-filter.d.ts.map +0 -1
- package/dist/lib/session/team-filter.js.map +0 -1
- package/dist/lib/session/team-filter.test.d.ts +0 -2
- package/dist/lib/session/team-filter.test.d.ts.map +0 -1
- package/dist/lib/session/team-filter.test.js +0 -157
- package/dist/lib/session/team-filter.test.js.map +0 -1
- package/dist/lib/session/types.d.ts.map +0 -1
- package/dist/lib/session/types.js.map +0 -1
- package/dist/lib/shims.d.ts.map +0 -1
- package/dist/lib/shims.js.map +0 -1
- package/dist/lib/skills.d.ts.map +0 -1
- package/dist/lib/skills.js.map +0 -1
- package/dist/lib/state.d.ts.map +0 -1
- package/dist/lib/state.js.map +0 -1
- package/dist/lib/subagents.d.ts.map +0 -1
- package/dist/lib/subagents.js.map +0 -1
- package/dist/lib/teams/agents.d.ts.map +0 -1
- package/dist/lib/teams/agents.js.map +0 -1
- package/dist/lib/teams/api.d.ts.map +0 -1
- package/dist/lib/teams/api.js.map +0 -1
- package/dist/lib/teams/cloud.d.ts +0 -11
- package/dist/lib/teams/cloud.d.ts.map +0 -1
- package/dist/lib/teams/cloud.js +0 -169
- package/dist/lib/teams/cloud.js.map +0 -1
- package/dist/lib/teams/debug.d.ts.map +0 -1
- package/dist/lib/teams/debug.js.map +0 -1
- package/dist/lib/teams/file_ops.d.ts.map +0 -1
- package/dist/lib/teams/file_ops.js.map +0 -1
- package/dist/lib/teams/parsers.d.ts.map +0 -1
- package/dist/lib/teams/parsers.js.map +0 -1
- package/dist/lib/teams/persistence.d.ts.map +0 -1
- package/dist/lib/teams/persistence.js.map +0 -1
- package/dist/lib/teams/ralph.d.ts +0 -8
- package/dist/lib/teams/ralph.d.ts.map +0 -1
- package/dist/lib/teams/ralph.js +0 -59
- package/dist/lib/teams/ralph.js.map +0 -1
- package/dist/lib/teams/registry.d.ts.map +0 -1
- package/dist/lib/teams/registry.js.map +0 -1
- package/dist/lib/teams/summarizer.d.ts.map +0 -1
- package/dist/lib/teams/summarizer.js.map +0 -1
- package/dist/lib/template.d.ts.map +0 -1
- package/dist/lib/template.js.map +0 -1
- package/dist/lib/types.d.ts.map +0 -1
- package/dist/lib/types.js.map +0 -1
- package/dist/lib/usage.d.ts.map +0 -1
- package/dist/lib/usage.js.map +0 -1
- package/dist/lib/versions.d.ts.map +0 -1
- package/dist/lib/versions.js.map +0 -1
- package/scripts/rebuild-sqlite.sh +0 -46
|
@@ -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';
|
|
@@ -5,19 +14,23 @@ import { spawn } from 'child_process';
|
|
|
5
14
|
import chalk from 'chalk';
|
|
6
15
|
import ora from 'ora';
|
|
7
16
|
import { SESSION_AGENTS } from '../lib/session/types.js';
|
|
17
|
+
import { discoverArtifacts, readArtifact, resolveArtifact } from '../lib/session/artifacts.js';
|
|
18
|
+
import { getActiveSessions } from '../lib/session/active.js';
|
|
8
19
|
import { discoverSessions, countSessionsInScope, resolveSessionById, searchContentIndex } from '../lib/session/discover.js';
|
|
9
20
|
import { filterTeamSessions } from '../lib/session/team-filter.js';
|
|
10
21
|
import { parseSession } from '../lib/session/parse.js';
|
|
11
22
|
import { renderConversationMarkdown, renderSummary, renderSummaryHeader, computeSummaryStats, renderJson, filterEvents, parseRoleList } from '../lib/session/render.js';
|
|
12
23
|
import { renderMarkdown } from '../lib/markdown.js';
|
|
13
|
-
import { colorAgent } from '../lib/agents.js';
|
|
14
|
-
import { resolveVersion } from '../lib/versions.js';
|
|
24
|
+
import { colorAgent, resolveAgentName } from '../lib/agents.js';
|
|
25
|
+
import { resolveVersion, resolveVersionAliasLoose } from '../lib/versions.js';
|
|
15
26
|
import { isInteractiveTerminal, isPromptCancelled } from './utils.js';
|
|
16
27
|
import { sessionPicker } from './sessions-picker.js';
|
|
28
|
+
import { registerSessionsTailCommand } from './sessions-tail.js';
|
|
17
29
|
const SESSION_AGENT_FILTER_HELP = `Filter by agent, e.g. claude, codex, claude@2.0.65`;
|
|
18
30
|
const CLAUDE_RESUME_MATCH_WINDOW_MS = 10 * 60_000;
|
|
19
31
|
const LOAD_VERBS = ['Loading', 'Scanning', 'Gathering', 'Indexing', 'Reading'];
|
|
20
32
|
const FIND_VERBS = ['Finding', 'Searching', 'Locating', 'Matching'];
|
|
33
|
+
/** Build a spinner-backed progress tracker that cycles through verbs while scanning sessions. */
|
|
21
34
|
function createScanProgressTracker(verbs, suffix, spinner) {
|
|
22
35
|
const counts = new Map();
|
|
23
36
|
let verbIndex = 0;
|
|
@@ -73,7 +86,134 @@ function resolvePathFilter(query) {
|
|
|
73
86
|
: query;
|
|
74
87
|
return path.resolve(expanded);
|
|
75
88
|
}
|
|
89
|
+
function formatBytes(n) {
|
|
90
|
+
if (n < 1024)
|
|
91
|
+
return `${n} B`;
|
|
92
|
+
if (n < 1024 * 1024)
|
|
93
|
+
return `${(n / 1024).toFixed(1)} KB`;
|
|
94
|
+
return `${(n / (1024 * 1024)).toFixed(1)} MB`;
|
|
95
|
+
}
|
|
96
|
+
async function renderArtifactsForSession(session, listAll, name) {
|
|
97
|
+
const artifacts = discoverArtifacts(session);
|
|
98
|
+
if (name !== undefined) {
|
|
99
|
+
const artifact = resolveArtifact(artifacts, name);
|
|
100
|
+
if (!artifact) {
|
|
101
|
+
console.error(chalk.red(`No artifact matching "${name}" in session ${session.shortId}.`));
|
|
102
|
+
if (artifacts.length > 0) {
|
|
103
|
+
console.error(chalk.gray('Available artifacts:'));
|
|
104
|
+
for (const a of artifacts) {
|
|
105
|
+
console.error(chalk.gray(` ${a.path}`));
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
process.exit(1);
|
|
109
|
+
}
|
|
110
|
+
if (!artifact.exists) {
|
|
111
|
+
console.error(chalk.red(`Artifact exists in session history but the file is no longer on disk: ${artifact.path}`));
|
|
112
|
+
process.exit(1);
|
|
113
|
+
}
|
|
114
|
+
process.stdout.write(readArtifact(artifact));
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
if (artifacts.length === 0) {
|
|
118
|
+
console.log(chalk.gray('No file-write artifacts found in this session.'));
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
const agentColor = colorAgent(session.agent);
|
|
122
|
+
console.log('');
|
|
123
|
+
console.log(agentColor(session.agent) +
|
|
124
|
+
chalk.gray(` · ${session.shortId} · ${formatRelativeTime(session.timestamp)}`));
|
|
125
|
+
console.log(chalk.gray('─'.repeat(72)));
|
|
126
|
+
for (const a of artifacts) {
|
|
127
|
+
const exists = a.exists ? chalk.green('yes') : chalk.red('no');
|
|
128
|
+
const size = a.exists && a.sizeBytes !== undefined ? chalk.cyan(formatBytes(a.sizeBytes)) : chalk.gray('-');
|
|
129
|
+
const tool = chalk.yellow(padRight(a.tool, 10));
|
|
130
|
+
const when = chalk.gray(formatRelativeTime(a.timestamp));
|
|
131
|
+
const p = chalk.white(a.path);
|
|
132
|
+
console.log(` ${exists} ${size.padEnd(10)} ${tool} ${when.padEnd(16)} ${p}`);
|
|
133
|
+
}
|
|
134
|
+
console.log(chalk.gray(`\n${artifacts.length} artifact${artifacts.length !== 1 ? 's' : ''}.`));
|
|
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. */
|
|
76
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
|
+
}
|
|
77
217
|
let filterOpts;
|
|
78
218
|
try {
|
|
79
219
|
filterOpts = buildFilterOptions(options);
|
|
@@ -98,9 +238,19 @@ async function sessionsAction(query, options) {
|
|
|
98
238
|
else {
|
|
99
239
|
searchQuery = query;
|
|
100
240
|
}
|
|
241
|
+
// Artifact flags require a session query.
|
|
242
|
+
if ((options.artifacts || options.artifact !== undefined) && !query) {
|
|
243
|
+
console.error(chalk.red('--artifacts and --artifact require a session ID or query.'));
|
|
244
|
+
process.exit(1);
|
|
245
|
+
}
|
|
101
246
|
const mode = resolveViewMode(options, filterOpts);
|
|
102
247
|
// --markdown or any filter flag forces single-session render.
|
|
103
248
|
const wantsRender = mode === 'markdown' || hasAnyFilter(filterOpts);
|
|
249
|
+
// Artifact-list or artifact-read paths: widen scope and resolve session globally.
|
|
250
|
+
if ((options.artifacts || options.artifact !== undefined) && searchQuery) {
|
|
251
|
+
await renderArtifactsGlobal(searchQuery, options.artifacts ?? false, options.artifact, { agent: options.agent, project: options.project });
|
|
252
|
+
return;
|
|
253
|
+
}
|
|
104
254
|
// When the user explicitly asks to render (via mode flag), resolve the
|
|
105
255
|
// query globally so sessions outside the default cwd/30d window are found.
|
|
106
256
|
if (wantsRender && searchQuery) {
|
|
@@ -473,9 +623,82 @@ export function buildResumeCommand(session, activeVersion) {
|
|
|
473
623
|
return ['opencode', '--session', session.id];
|
|
474
624
|
case 'gemini':
|
|
475
625
|
case 'openclaw':
|
|
626
|
+
case 'rush':
|
|
627
|
+
case 'hermes':
|
|
628
|
+
// Rush and Hermes sessions are captured artifacts, not resumable locally.
|
|
476
629
|
return null;
|
|
477
630
|
}
|
|
478
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
|
+
}
|
|
479
702
|
function parseAgentFilter(agentName) {
|
|
480
703
|
if (!agentName)
|
|
481
704
|
return {};
|
|
@@ -497,6 +720,7 @@ function formatSearchMessage(options) {
|
|
|
497
720
|
return 'Search sessions:';
|
|
498
721
|
return `Search sessions (${filters.join(', ')}):`;
|
|
499
722
|
}
|
|
723
|
+
/** Filter and rank sessions by a multi-term search query across metadata and content. */
|
|
500
724
|
export function filterSessionsByQuery(sessions, query) {
|
|
501
725
|
const trimmed = query?.trim().toLowerCase() || '';
|
|
502
726
|
if (!trimmed)
|
|
@@ -600,8 +824,10 @@ function applyScopeFilters(sessions, scope) {
|
|
|
600
824
|
});
|
|
601
825
|
}
|
|
602
826
|
if (scope.agent) {
|
|
603
|
-
// Accept "claude" or "claude@2.1.112". Version suffix narrows further.
|
|
604
|
-
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;
|
|
605
831
|
filtered = filtered.filter((s) => {
|
|
606
832
|
if (s.agent !== wantAgent)
|
|
607
833
|
return false;
|
|
@@ -612,6 +838,46 @@ function applyScopeFilters(sessions, scope) {
|
|
|
612
838
|
}
|
|
613
839
|
return filtered;
|
|
614
840
|
}
|
|
841
|
+
async function renderArtifactsGlobal(query, listAll, name, scope) {
|
|
842
|
+
const spinner = ora().start();
|
|
843
|
+
const tracker = createScanProgressTracker(FIND_VERBS, 'session', spinner);
|
|
844
|
+
try {
|
|
845
|
+
const discovered = await discoverSessions({
|
|
846
|
+
all: true,
|
|
847
|
+
cwd: process.cwd(),
|
|
848
|
+
limit: 5000,
|
|
849
|
+
onProgress: tracker.onProgress,
|
|
850
|
+
});
|
|
851
|
+
tracker.stop();
|
|
852
|
+
const allSessions = applyScopeFilters(discovered, scope);
|
|
853
|
+
const matches = resolveSessionById(allSessions, query);
|
|
854
|
+
const queryMatches = matches.length > 0 ? matches : filterSessionsByQuery(allSessions, query);
|
|
855
|
+
if (queryMatches.length === 0) {
|
|
856
|
+
spinner.stop();
|
|
857
|
+
console.error(chalk.red(`No session found matching: ${query}`));
|
|
858
|
+
process.exit(1);
|
|
859
|
+
}
|
|
860
|
+
if (queryMatches.length > 1) {
|
|
861
|
+
spinner.stop();
|
|
862
|
+
console.error(chalk.red(`Multiple sessions match "${query}":`));
|
|
863
|
+
for (const m of queryMatches.slice(0, 10)) {
|
|
864
|
+
console.error(chalk.cyan(` ${m.shortId} ${m.id} ${m.label ?? m.topic ?? ''}`));
|
|
865
|
+
}
|
|
866
|
+
console.error(chalk.gray('Pass a longer ID to narrow it down.'));
|
|
867
|
+
process.exit(1);
|
|
868
|
+
}
|
|
869
|
+
spinner.stop();
|
|
870
|
+
await renderArtifactsForSession(queryMatches[0], listAll, name);
|
|
871
|
+
}
|
|
872
|
+
catch (err) {
|
|
873
|
+
if (isPromptCancelled(err))
|
|
874
|
+
return;
|
|
875
|
+
tracker.stop();
|
|
876
|
+
spinner.stop();
|
|
877
|
+
console.error(chalk.red(`Failed to read session: ${err.message}`));
|
|
878
|
+
process.exit(1);
|
|
879
|
+
}
|
|
880
|
+
}
|
|
615
881
|
async function renderOneSession(query, mode, scope) {
|
|
616
882
|
const spinner = ora().start();
|
|
617
883
|
const tracker = createScanProgressTracker(FIND_VERBS, 'session', spinner);
|
|
@@ -688,8 +954,9 @@ async function renderOneSession(query, mode, scope) {
|
|
|
688
954
|
process.exit(1);
|
|
689
955
|
}
|
|
690
956
|
}
|
|
957
|
+
/** Register the `agents sessions` command with all its options and help text. */
|
|
691
958
|
export function registerSessionsCommands(program) {
|
|
692
|
-
program
|
|
959
|
+
const sessionsCmd = program
|
|
693
960
|
.command('sessions')
|
|
694
961
|
.argument('[query]', 'Session ID, search query, or path (., ../, /path) to filter by project')
|
|
695
962
|
.description('Find, browse, and read agent conversation transcripts across Claude, Codex, Gemini, and OpenCode.')
|
|
@@ -706,6 +973,10 @@ export function registerSessionsCommands(program) {
|
|
|
706
973
|
.option('--exclude <roles>', 'Exclude these roles (comma-separated): user, assistant, thinking, tools')
|
|
707
974
|
.option('--first <n>', 'Keep only the first N turns (a turn starts at each user message)')
|
|
708
975
|
.option('--last <n>', 'Keep only the last N turns (a turn starts at each user message)')
|
|
976
|
+
.option('--artifacts', 'List all files written or edited during a session')
|
|
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')
|
|
709
980
|
.addHelpText('after', `
|
|
710
981
|
Examples:
|
|
711
982
|
# Interactive picker: browse and search recent sessions (TTY only)
|
|
@@ -724,7 +995,7 @@ Examples:
|
|
|
724
995
|
agents sessions --agent claude --since 7d
|
|
725
996
|
|
|
726
997
|
# Filter sessions in a specific directory
|
|
727
|
-
agents sessions
|
|
998
|
+
agents sessions ~/src/my-project
|
|
728
999
|
|
|
729
1000
|
# Default summary view for one session
|
|
730
1001
|
agents sessions a1b2c3d4
|
|
@@ -753,6 +1024,16 @@ Examples:
|
|
|
753
1024
|
# Include team-spawned sessions in results
|
|
754
1025
|
agents sessions --teams
|
|
755
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
|
+
|
|
756
1037
|
Notes:
|
|
757
1038
|
- --include and --exclude are mutually exclusive.
|
|
758
1039
|
- --first and --last are mutually exclusive.
|
|
@@ -761,6 +1042,7 @@ Notes:
|
|
|
761
1042
|
.action(async (query, options) => {
|
|
762
1043
|
await sessionsAction(query, options);
|
|
763
1044
|
});
|
|
1045
|
+
registerSessionsTailCommand(sessionsCmd);
|
|
764
1046
|
}
|
|
765
1047
|
function formatNoSessionsMessage(showAll, project) {
|
|
766
1048
|
const projectQuery = project?.trim();
|
|
@@ -974,4 +1256,3 @@ function formatRelativeTime(isoTimestamp) {
|
|
|
974
1256
|
const months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
975
1257
|
return `${months[d.getMonth()]} ${d.getDate()}`;
|
|
976
1258
|
}
|
|
977
|
-
//# 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
|