@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
package/dist/lib/teams/api.d.ts
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
import { AgentManager } from './agents.js';
|
|
1
|
+
import { AgentManager, type TaskType } from './agents.js';
|
|
2
2
|
import { AgentType } from './parsers.js';
|
|
3
|
+
export interface ToolCallDetail {
|
|
4
|
+
tool: string;
|
|
5
|
+
summary: string;
|
|
6
|
+
timestamp: string | null;
|
|
7
|
+
}
|
|
8
|
+
/** Result returned after spawning a new teammate. */
|
|
3
9
|
export interface SpawnResult {
|
|
4
10
|
task_name: string;
|
|
5
11
|
agent_id: string;
|
|
@@ -10,17 +16,25 @@ export interface SpawnResult {
|
|
|
10
16
|
remote_session_id?: string | null;
|
|
11
17
|
name?: string | null;
|
|
12
18
|
after?: string[];
|
|
19
|
+
task_type?: TaskType | null;
|
|
20
|
+
cloud_provider?: string | null;
|
|
21
|
+
cloud_session_id?: string | null;
|
|
13
22
|
}
|
|
23
|
+
/** Detailed status of a single teammate, including file ops, commands, and a cursor for delta polling. */
|
|
14
24
|
export interface AgentStatusDetail {
|
|
15
25
|
agent_id: string;
|
|
16
26
|
agent_type: string;
|
|
17
27
|
status: string;
|
|
28
|
+
prompt: string;
|
|
29
|
+
started_at: string;
|
|
30
|
+
completed_at: string | null;
|
|
18
31
|
duration: string | null;
|
|
19
32
|
files_created: string[];
|
|
20
33
|
files_modified: string[];
|
|
21
34
|
files_read: string[];
|
|
22
35
|
files_deleted: string[];
|
|
23
36
|
bash_commands: string[];
|
|
37
|
+
recent_tool_calls: ToolCallDetail[];
|
|
24
38
|
last_messages: string[];
|
|
25
39
|
tool_count: number;
|
|
26
40
|
has_errors: boolean;
|
|
@@ -31,9 +45,12 @@ export interface AgentStatusDetail {
|
|
|
31
45
|
pr_url?: string | null;
|
|
32
46
|
version?: string | null;
|
|
33
47
|
remote_session_id?: string | null;
|
|
48
|
+
session_label?: string | null;
|
|
34
49
|
name?: string | null;
|
|
35
50
|
after?: string[];
|
|
51
|
+
task_type?: TaskType | null;
|
|
36
52
|
}
|
|
53
|
+
/** Aggregated status of all teammates in a task, with per-status counts and a global cursor. */
|
|
37
54
|
export interface TaskStatusResult {
|
|
38
55
|
task_name: string;
|
|
39
56
|
agents: AgentStatusDetail[];
|
|
@@ -46,12 +63,14 @@ export interface TaskStatusResult {
|
|
|
46
63
|
};
|
|
47
64
|
cursor: string;
|
|
48
65
|
}
|
|
66
|
+
/** Result of stopping one or more teammates. */
|
|
49
67
|
export interface StopResult {
|
|
50
68
|
task_name: string;
|
|
51
69
|
stopped: string[];
|
|
52
70
|
already_stopped: string[];
|
|
53
71
|
not_found: string[];
|
|
54
72
|
}
|
|
73
|
+
/** Summary metadata for a single task (team), including agent counts by status and timestamps. */
|
|
55
74
|
export interface TaskInfo {
|
|
56
75
|
task_name: string;
|
|
57
76
|
agent_count: number;
|
|
@@ -64,14 +83,18 @@ export interface TaskInfo {
|
|
|
64
83
|
created_at: string;
|
|
65
84
|
modified_at: string;
|
|
66
85
|
}
|
|
86
|
+
/** Paginated list of tasks sorted by most recent activity. */
|
|
67
87
|
export interface TasksResult {
|
|
68
88
|
tasks: TaskInfo[];
|
|
69
89
|
}
|
|
70
|
-
|
|
90
|
+
/** Spawn a new teammate in a task and return its initial metadata. */
|
|
91
|
+
export declare function handleSpawn(manager: AgentManager, taskName: string, agentType: AgentType, prompt: string, cwd: string | null, mode: string | null, effort?: 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'auto' | null, parentSessionId?: string | null, workspaceDir?: string | null, version?: string | null, name?: string | null, after?: string[], model?: string | null, envOverrides?: Record<string, string> | null, taskType?: TaskType | null, cloudProvider?: string | null, cloudSessionId?: string | null, cloudRepo?: string | null, cloudBranch?: string | null): Promise<SpawnResult>;
|
|
92
|
+
/** Retrieve the current status of all teammates in a task, with optional timestamp-based delta filtering. */
|
|
71
93
|
export declare function handleStatus(manager: AgentManager, taskName: string | null | undefined, filter?: string, since?: string, // Optional ISO timestamp - return only events after this time
|
|
72
94
|
parentSessionId?: string | null): Promise<TaskStatusResult>;
|
|
95
|
+
/** List all known tasks grouped by task name, sorted by most recent activity. */
|
|
73
96
|
export declare function handleTasks(manager: AgentManager, limit?: number): Promise<TasksResult>;
|
|
97
|
+
/** Stop a specific teammate or all teammates in a task. */
|
|
74
98
|
export declare function handleStop(manager: AgentManager, taskName: string, agentId?: string): Promise<StopResult | {
|
|
75
99
|
error: string;
|
|
76
100
|
}>;
|
|
77
|
-
//# sourceMappingURL=api.d.ts.map
|
package/dist/lib/teams/api.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { AgentStatus, resolveMode } from './agents.js';
|
|
2
2
|
import { getDelta } from './summarizer.js';
|
|
3
3
|
import { debug } from './debug.js';
|
|
4
|
+
import { buildClaudeLabelMap } from '../session/discover.js';
|
|
4
5
|
/**
|
|
5
6
|
* Truncate a bash command for status output.
|
|
6
7
|
* Handles heredocs specially - shows the redirect target instead of contents.
|
|
@@ -16,12 +17,51 @@ function truncateBashCommand(cmd, maxLen = 120) {
|
|
|
16
17
|
return cmd;
|
|
17
18
|
return cmd.substring(0, maxLen - 3) + '...';
|
|
18
19
|
}
|
|
19
|
-
|
|
20
|
+
function eventToolName(event) {
|
|
21
|
+
const eventType = event.type || '';
|
|
22
|
+
if (eventType === 'bash')
|
|
23
|
+
return 'Bash';
|
|
24
|
+
if (eventType === 'file_write')
|
|
25
|
+
return 'Write';
|
|
26
|
+
if (eventType === 'file_create')
|
|
27
|
+
return 'Create';
|
|
28
|
+
if (eventType === 'file_read')
|
|
29
|
+
return 'Read';
|
|
30
|
+
if (eventType === 'file_delete')
|
|
31
|
+
return 'Delete';
|
|
32
|
+
if (eventType === 'directory_list')
|
|
33
|
+
return 'List';
|
|
34
|
+
if (eventType === 'tool_use')
|
|
35
|
+
return event.tool || 'Tool';
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
function eventToolSummary(event) {
|
|
39
|
+
const value = event.command ||
|
|
40
|
+
event.path ||
|
|
41
|
+
event.args?.command ||
|
|
42
|
+
event.args?.path ||
|
|
43
|
+
event.input?.command ||
|
|
44
|
+
event.input?.path ||
|
|
45
|
+
'';
|
|
46
|
+
return truncateBashCommand(String(value || eventToolName(event) || 'tool call'));
|
|
47
|
+
}
|
|
48
|
+
function recentToolCalls(events, max = 10) {
|
|
49
|
+
return events
|
|
50
|
+
.filter((event) => eventToolName(event))
|
|
51
|
+
.slice(-max)
|
|
52
|
+
.map((event) => ({
|
|
53
|
+
tool: eventToolName(event) || 'Tool',
|
|
54
|
+
summary: eventToolSummary(event),
|
|
55
|
+
timestamp: typeof event.timestamp === 'string' ? event.timestamp : null,
|
|
56
|
+
}));
|
|
57
|
+
}
|
|
58
|
+
/** Spawn a new teammate in a task and return its initial metadata. */
|
|
59
|
+
export async function handleSpawn(manager, taskName, agentType, prompt, cwd, mode, effort = 'medium', parentSessionId = null, workspaceDir = null, version = null, name = null, after = [], model = null, envOverrides = null, taskType = null, cloudProvider = null, cloudSessionId = null, cloudRepo = null, cloudBranch = null) {
|
|
20
60
|
const defaultMode = manager.getDefaultMode();
|
|
21
61
|
const resolvedMode = resolveMode(mode, defaultMode);
|
|
22
62
|
const resolvedEffort = effort ?? 'medium';
|
|
23
63
|
debug(`[spawn] Spawning ${agentType} agent for task "${taskName}" [${resolvedMode}] effort=${resolvedEffort}...`);
|
|
24
|
-
const agent = await manager.spawn(taskName, agentType, prompt, cwd, resolvedMode, resolvedEffort, parentSessionId, workspaceDir, version, name, after, model, envOverrides);
|
|
64
|
+
const agent = await manager.spawn(taskName, agentType, prompt, cwd, resolvedMode, resolvedEffort, parentSessionId, workspaceDir, version, name, after, model, envOverrides, taskType, cloudProvider, cloudSessionId, cloudRepo, cloudBranch);
|
|
25
65
|
debug(`[spawn] Spawned ${agentType} agent ${agent.agentId} for task "${taskName}"`);
|
|
26
66
|
return {
|
|
27
67
|
task_name: taskName,
|
|
@@ -33,8 +73,12 @@ export async function handleSpawn(manager, taskName, agentType, prompt, cwd, mod
|
|
|
33
73
|
remote_session_id: agent.remoteSessionId,
|
|
34
74
|
name: agent.name,
|
|
35
75
|
after: agent.after,
|
|
76
|
+
task_type: agent.taskType,
|
|
77
|
+
cloud_provider: agent.cloudProvider,
|
|
78
|
+
cloud_session_id: agent.cloudSessionId,
|
|
36
79
|
};
|
|
37
80
|
}
|
|
81
|
+
/** Retrieve the current status of all teammates in a task, with optional timestamp-based delta filtering. */
|
|
38
82
|
export async function handleStatus(manager, taskName, filter, since, // Optional ISO timestamp - return only events after this time
|
|
39
83
|
parentSessionId) {
|
|
40
84
|
// Default to 'all' so callers see completed/failed agents unless they opt to filter
|
|
@@ -72,6 +116,9 @@ parentSessionId) {
|
|
|
72
116
|
}
|
|
73
117
|
// Build details only for filtered agents
|
|
74
118
|
let maxTimestamp = since || new Date(0).toISOString(); // Track max timestamp for cursor
|
|
119
|
+
const claudeLabels = allAgents.some((agent) => agent.agentType === 'claude')
|
|
120
|
+
? buildClaudeLabelMap()
|
|
121
|
+
: new Map();
|
|
75
122
|
for (const agent of agents) {
|
|
76
123
|
await agent.readNewEvents();
|
|
77
124
|
const events = agent.events;
|
|
@@ -87,16 +134,28 @@ parentSessionId) {
|
|
|
87
134
|
agent_id: agent.agentId,
|
|
88
135
|
agent_type: agent.agentType,
|
|
89
136
|
status: agent.status,
|
|
137
|
+
prompt: agent.prompt,
|
|
138
|
+
started_at: agent.startedAt.toISOString(),
|
|
139
|
+
completed_at: agent.completedAt?.toISOString() ?? null,
|
|
90
140
|
duration: agent.duration(),
|
|
91
141
|
version: agent.version,
|
|
92
142
|
remote_session_id: agent.remoteSessionId,
|
|
143
|
+
session_label: agent.remoteSessionId
|
|
144
|
+
? claudeLabels.get(agent.remoteSessionId) ?? null
|
|
145
|
+
: null,
|
|
93
146
|
name: agent.name,
|
|
94
147
|
after: agent.after,
|
|
148
|
+
task_type: agent.taskType,
|
|
149
|
+
mode: agent.mode,
|
|
150
|
+
cloud_session_id: agent.cloudSessionId,
|
|
151
|
+
cloud_provider: agent.cloudProvider,
|
|
152
|
+
pr_url: agent.prUrl,
|
|
95
153
|
files_created: delta.new_files_created,
|
|
96
154
|
files_modified: delta.new_files_modified,
|
|
97
155
|
files_read: delta.new_files_read,
|
|
98
156
|
files_deleted: delta.new_files_deleted,
|
|
99
157
|
bash_commands: delta.new_bash_commands.map((cmd) => truncateBashCommand(cmd)),
|
|
158
|
+
recent_tool_calls: recentToolCalls(events),
|
|
100
159
|
last_messages: delta.new_messages,
|
|
101
160
|
tool_count: delta.new_tool_count,
|
|
102
161
|
has_errors: delta.new_errors.length > 0,
|
|
@@ -112,6 +171,7 @@ parentSessionId) {
|
|
|
112
171
|
cursor: maxTimestamp, // Max timestamp across all agents
|
|
113
172
|
};
|
|
114
173
|
}
|
|
174
|
+
/** List all known tasks grouped by task name, sorted by most recent activity. */
|
|
115
175
|
export async function handleTasks(manager, limit = 10) {
|
|
116
176
|
debug(`[tasks] Listing tasks (limit=${limit})...`);
|
|
117
177
|
const allAgents = await manager.listAll();
|
|
@@ -177,6 +237,7 @@ export async function handleTasks(manager, limit = 10) {
|
|
|
177
237
|
debug(`[tasks] Returning ${limitedTasks.length}/${tasks.length} tasks`);
|
|
178
238
|
return { tasks: limitedTasks };
|
|
179
239
|
}
|
|
240
|
+
/** Stop a specific teammate or all teammates in a task. */
|
|
180
241
|
export async function handleStop(manager, taskName, agentId) {
|
|
181
242
|
if (agentId) {
|
|
182
243
|
debug(`[stop] Stopping agent ${agentId} in task "${taskName}"...`);
|
|
@@ -226,4 +287,3 @@ export async function handleStop(manager, taskName, agentId) {
|
|
|
226
287
|
};
|
|
227
288
|
}
|
|
228
289
|
}
|
|
229
|
-
//# sourceMappingURL=api.js.map
|
|
@@ -1,2 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Debug logging for the teams module.
|
|
3
|
+
*
|
|
4
|
+
* Outputs to stderr when AGENTS_DEBUG or DEBUG environment variables are set.
|
|
5
|
+
*/
|
|
6
|
+
/** Log debug messages to stderr when debug mode is enabled. */
|
|
1
7
|
export declare function debug(...args: unknown[]): void;
|
|
2
|
-
//# sourceMappingURL=debug.d.ts.map
|
package/dist/lib/teams/debug.js
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Debug logging for the teams module.
|
|
3
|
+
*
|
|
4
|
+
* Outputs to stderr when AGENTS_DEBUG or DEBUG environment variables are set.
|
|
5
|
+
*/
|
|
1
6
|
const ENABLED = Boolean(process.env.AGENTS_DEBUG || process.env.DEBUG);
|
|
7
|
+
/** Log debug messages to stderr when debug mode is enabled. */
|
|
2
8
|
export function debug(...args) {
|
|
3
9
|
if (ENABLED)
|
|
4
10
|
console.error(...args);
|
|
5
11
|
}
|
|
6
|
-
//# sourceMappingURL=debug.js.map
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bash command file-operation inference.
|
|
3
|
+
*
|
|
4
|
+
* Heuristically extracts file read, write, and delete operations from
|
|
5
|
+
* shell command strings using regex patterns. Used by the event parsers
|
|
6
|
+
* and summarizer to attribute file-level side effects to bash tool calls.
|
|
7
|
+
*/
|
|
1
8
|
/**
|
|
2
9
|
* Try to infer file operations (read/write/delete) from a bash command string.
|
|
3
10
|
* Returns three arrays: files read, written, and deleted.
|
|
4
11
|
*/
|
|
5
12
|
export declare function extractFileOpsFromBash(command: string): [string[], string[], string[]];
|
|
6
|
-
//# sourceMappingURL=file_ops.d.ts.map
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bash command file-operation inference.
|
|
3
|
+
*
|
|
4
|
+
* Heuristically extracts file read, write, and delete operations from
|
|
5
|
+
* shell command strings using regex patterns. Used by the event parsers
|
|
6
|
+
* and summarizer to attribute file-level side effects to bash tool calls.
|
|
7
|
+
*/
|
|
1
8
|
/**
|
|
2
9
|
* Try to infer file operations (read/write/delete) from a bash command string.
|
|
3
10
|
* Returns three arrays: files read, written, and deleted.
|
|
@@ -56,4 +63,3 @@ export function extractFileOpsFromBash(command) {
|
|
|
56
63
|
const unique = (paths) => Array.from(new Set(paths.filter(Boolean)));
|
|
57
64
|
return [unique(filesRead), unique(filesWritten), unique(filesDeleted)];
|
|
58
65
|
}
|
|
59
|
-
//# sourceMappingURL=file_ops.js.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public library surface for the teams subsystem.
|
|
3
|
+
*
|
|
4
|
+
* Consumers import from '@phnx-labs/agents-cli/teams'
|
|
5
|
+
* to reuse the same agent lifecycle, parsing, summarization, and persistence
|
|
6
|
+
* layer that powers the `agents teams` CLI.
|
|
7
|
+
*/
|
|
8
|
+
export { AgentManager, AgentProcess, AgentStatus, VALID_TASK_TYPES, AGENT_COMMANDS, computePathLCA, checkAllClis, checkCliAvailable, ensureGeminiPlanMode, getAgentsDir, resolveMode, type TaskType, type CloudDispatchFn, } from './agents.js';
|
|
9
|
+
export { type AgentType } from './parsers.js';
|
|
10
|
+
export { normalizeEvents, normalizeEvent, parseEvent } from './parsers.js';
|
|
11
|
+
export { handleSpawn, handleStatus, handleStop, handleTasks, type SpawnResult, type AgentStatusDetail, type TaskStatusResult, type StopResult, type TaskInfo, type TasksResult, } from './api.js';
|
|
12
|
+
export { readConfig, resolveAgentsDir, resolveBaseDir, type EffortLevel, type ModelOverrides, type ProviderConfig, type AgentConfig, type SwarmConfig, type ReadConfigResult, } from './persistence.js';
|
|
13
|
+
export { collapseEvents, getToolBreakdown, groupAndFlattenEvents, summarizeEvents, getDelta, filterEventsByPriority, getLastTool, getToolUses, getLastMessages, getQuickStatus, getStatusSummary, AgentSummary, PRIORITY, type QuickStatus, } from './summarizer.js';
|
|
14
|
+
export { extractFileOpsFromBash } from './file_ops.js';
|
|
15
|
+
export { debug } from './debug.js';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public library surface for the teams subsystem.
|
|
3
|
+
*
|
|
4
|
+
* Consumers import from '@phnx-labs/agents-cli/teams'
|
|
5
|
+
* to reuse the same agent lifecycle, parsing, summarization, and persistence
|
|
6
|
+
* layer that powers the `agents teams` CLI.
|
|
7
|
+
*/
|
|
8
|
+
export { AgentManager, AgentProcess, AgentStatus, VALID_TASK_TYPES, AGENT_COMMANDS, computePathLCA, checkAllClis, checkCliAvailable, ensureGeminiPlanMode, getAgentsDir, resolveMode, } from './agents.js';
|
|
9
|
+
export { normalizeEvents, normalizeEvent, parseEvent } from './parsers.js';
|
|
10
|
+
export { handleSpawn, handleStatus, handleStop, handleTasks, } from './api.js';
|
|
11
|
+
export { readConfig, resolveAgentsDir, resolveBaseDir, } from './persistence.js';
|
|
12
|
+
export { collapseEvents, getToolBreakdown, groupAndFlattenEvents, summarizeEvents, getDelta, filterEventsByPriority, getLastTool, getToolUses, getLastMessages, getQuickStatus, getStatusSummary, AgentSummary, PRIORITY, } from './summarizer.js';
|
|
13
|
+
export { extractFileOpsFromBash } from './file_ops.js';
|
|
14
|
+
export { debug } from './debug.js';
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
/** Supported agent CLI types for team spawning. */
|
|
1
2
|
export type AgentType = 'codex' | 'gemini' | 'cursor' | 'claude' | 'opencode';
|
|
3
|
+
/** Normalize a raw JSON event from any agent type into an array of unified event objects. */
|
|
2
4
|
export declare function normalizeEvents(agentType: AgentType, raw: any): any[];
|
|
5
|
+
/** Normalize a raw JSON event, returning only the first unified event (convenience wrapper). */
|
|
3
6
|
export declare function normalizeEvent(agentType: AgentType, raw: any): any;
|
|
7
|
+
/** Parse a single JSONL line into normalized events. Returns null if the line is not valid JSON. */
|
|
4
8
|
export declare function parseEvent(agentType: AgentType, line: string): any[] | null;
|
|
5
|
-
//# sourceMappingURL=parsers.d.ts.map
|
|
@@ -1,5 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent event stream parsers.
|
|
3
|
+
*
|
|
4
|
+
* Normalizes the heterogeneous JSON event formats emitted by each agent CLI
|
|
5
|
+
* (Claude, Codex, Gemini, Cursor, OpenCode) into a unified event schema
|
|
6
|
+
* with consistent types: init, message, tool_use, bash, file_read, file_write,
|
|
7
|
+
* file_create, file_delete, result, error, and others.
|
|
8
|
+
*/
|
|
1
9
|
import { extractFileOpsFromBash } from './file_ops.js';
|
|
2
10
|
const claudeToolUseMap = new Map();
|
|
11
|
+
/** Normalize a raw JSON event from any agent type into an array of unified event objects. */
|
|
3
12
|
export function normalizeEvents(agentType, raw) {
|
|
4
13
|
if (agentType === 'codex') {
|
|
5
14
|
return normalizeCodex(raw);
|
|
@@ -24,6 +33,7 @@ export function normalizeEvents(agentType, raw) {
|
|
|
24
33
|
timestamp: timestamp,
|
|
25
34
|
}];
|
|
26
35
|
}
|
|
36
|
+
/** Normalize a raw JSON event, returning only the first unified event (convenience wrapper). */
|
|
27
37
|
export function normalizeEvent(agentType, raw) {
|
|
28
38
|
const events = normalizeEvents(agentType, raw);
|
|
29
39
|
if (events.length > 0) {
|
|
@@ -814,6 +824,7 @@ function normalizeOpencode(raw) {
|
|
|
814
824
|
timestamp: timestamp,
|
|
815
825
|
}];
|
|
816
826
|
}
|
|
827
|
+
/** Parse a single JSONL line into normalized events. Returns null if the line is not valid JSON. */
|
|
817
828
|
export function parseEvent(agentType, line) {
|
|
818
829
|
try {
|
|
819
830
|
const raw = JSON.parse(line);
|
|
@@ -823,4 +834,3 @@ export function parseEvent(agentType, line) {
|
|
|
823
834
|
return null;
|
|
824
835
|
}
|
|
825
836
|
}
|
|
826
|
-
//# sourceMappingURL=parsers.js.map
|
|
@@ -1,28 +1,42 @@
|
|
|
1
1
|
import { AgentType } from './parsers.js';
|
|
2
|
+
/** Resolve the base data directory for teams, preferring ~/.agents/teams/ with a temp fallback. */
|
|
2
3
|
export declare function resolveBaseDir(): Promise<string>;
|
|
4
|
+
/** Reasoning-intensity levels supported by the teams system. */
|
|
3
5
|
export type EffortLevel = 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'auto';
|
|
6
|
+
/**
|
|
7
|
+
* Legacy type retained for config-file back-compat. Older configs pinned a
|
|
8
|
+
* model per effort tier; we no longer act on these entries but accept them
|
|
9
|
+
* without error when loading from disk.
|
|
10
|
+
*/
|
|
4
11
|
export type ModelOverrides = Partial<Record<AgentType, Partial<Record<EffortLevel, string>>>>;
|
|
12
|
+
/** API endpoint configuration for a model provider. */
|
|
5
13
|
export interface ProviderConfig {
|
|
6
14
|
apiEndpoint: string | null;
|
|
7
15
|
}
|
|
16
|
+
/** Per-agent-type configuration: CLI command template, enabled state, optional pinned model, and provider. */
|
|
8
17
|
export interface AgentConfig {
|
|
9
18
|
command: string;
|
|
10
19
|
enabled: boolean;
|
|
11
20
|
model: string | null;
|
|
12
21
|
provider: string;
|
|
13
22
|
}
|
|
23
|
+
/** Top-level teams configuration structure persisted to config.json. */
|
|
14
24
|
export interface SwarmConfig {
|
|
15
25
|
agents: Record<AgentType, AgentConfig>;
|
|
16
26
|
providers: Record<string, ProviderConfig>;
|
|
17
27
|
}
|
|
28
|
+
/** Result of reading the teams config, including resolved agent and provider configurations. */
|
|
18
29
|
export interface ReadConfigResult {
|
|
19
30
|
hasConfig: boolean;
|
|
20
31
|
enabledAgents: AgentType[];
|
|
21
32
|
agentConfigs: Record<AgentType, AgentConfig>;
|
|
22
33
|
providerConfigs: Record<string, ProviderConfig>;
|
|
23
34
|
}
|
|
35
|
+
/** Resolve and ensure the agents subdirectory exists under the teams base dir. */
|
|
24
36
|
export declare function resolveAgentsDir(): Promise<string>;
|
|
37
|
+
/** Read teams config from disk, migrating legacy formats if needed. Returns defaults when no config exists. */
|
|
25
38
|
export declare function readConfig(): Promise<ReadConfigResult>;
|
|
39
|
+
/** Write teams config to disk. */
|
|
26
40
|
export declare function writeConfig(config: SwarmConfig): Promise<void>;
|
|
41
|
+
/** Update the enabled/disabled status of a specific agent type in the config file. */
|
|
27
42
|
export declare function setAgentEnabled(agentType: AgentType, enabled: boolean): Promise<void>;
|
|
28
|
-
//# sourceMappingURL=persistence.d.ts.map
|
|
@@ -1,13 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Teams configuration persistence.
|
|
3
|
+
*
|
|
4
|
+
* Manages reading, writing, and migrating the teams config file
|
|
5
|
+
* (~/.agents/teams/config.json) that stores per-agent-type settings
|
|
6
|
+
* (command templates, enabled state, pinned models) and provider configs.
|
|
7
|
+
* Also resolves the base data directory for teammate process storage.
|
|
8
|
+
*/
|
|
1
9
|
import * as fs from 'fs/promises';
|
|
10
|
+
import * as fsSync from 'fs';
|
|
2
11
|
import * as path from 'path';
|
|
3
12
|
import { homedir, tmpdir } from 'os';
|
|
4
13
|
import { constants as fsConstants } from 'fs';
|
|
14
|
+
import { randomBytes } from 'crypto';
|
|
15
|
+
import lockfile from 'proper-lockfile';
|
|
16
|
+
import { getAgentsDir } from '../state.js';
|
|
17
|
+
/**
|
|
18
|
+
* Atomic JSON write: writes to a sibling tmp file then renames over the
|
|
19
|
+
* target. rename(2) is atomic on POSIX, so a crashed/interrupted write
|
|
20
|
+
* leaves the old config intact instead of leaving a half-written file the
|
|
21
|
+
* next read will reject.
|
|
22
|
+
*/
|
|
23
|
+
async function atomicWriteJson(p, data) {
|
|
24
|
+
await fs.mkdir(path.dirname(p), { recursive: true });
|
|
25
|
+
const tmp = `${p}.tmp.${process.pid}.${randomBytes(4).toString('hex')}`;
|
|
26
|
+
const body = JSON.stringify(data, null, 2);
|
|
27
|
+
await fs.writeFile(tmp, body);
|
|
28
|
+
try {
|
|
29
|
+
await fs.rename(tmp, p);
|
|
30
|
+
}
|
|
31
|
+
catch (err) {
|
|
32
|
+
await fs.unlink(tmp).catch(() => { });
|
|
33
|
+
throw err;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Hold an exclusive cross-process lock on the config file while running
|
|
38
|
+
* `fn`. proper-lockfile requires the target to exist, so we touch it
|
|
39
|
+
* first. Stale locks auto-expire after 10s.
|
|
40
|
+
*/
|
|
41
|
+
async function withConfigLock(p, fn) {
|
|
42
|
+
await fs.mkdir(path.dirname(p), { recursive: true });
|
|
43
|
+
if (!fsSync.existsSync(p)) {
|
|
44
|
+
try {
|
|
45
|
+
await fs.writeFile(p, '{}', { flag: 'wx' });
|
|
46
|
+
}
|
|
47
|
+
catch (err) {
|
|
48
|
+
if (err && err.code !== 'EEXIST')
|
|
49
|
+
throw err;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
const release = await lockfile.lock(p, {
|
|
53
|
+
retries: { retries: 60, minTimeout: 25, maxTimeout: 250, factor: 1.5 },
|
|
54
|
+
stale: 10_000,
|
|
55
|
+
});
|
|
56
|
+
try {
|
|
57
|
+
return await fn();
|
|
58
|
+
}
|
|
59
|
+
finally {
|
|
60
|
+
await release();
|
|
61
|
+
}
|
|
62
|
+
}
|
|
5
63
|
// All supported teammate agent types
|
|
6
64
|
const ALL_AGENTS = ['claude', 'codex', 'gemini', 'cursor', 'opencode'];
|
|
7
|
-
// Teams data lives under ~/.agents/teams/
|
|
8
|
-
const TEAMS_DIR = path.join(
|
|
65
|
+
// Teams data lives under ~/.agents-system/teams/
|
|
66
|
+
const TEAMS_DIR = path.join(getAgentsDir(), 'teams');
|
|
9
67
|
// Legacy paths (for migration)
|
|
10
68
|
const LEGACY_CONFIG_DIR = path.join(homedir(), '.agents');
|
|
69
|
+
// Legacy migration from pre-OSS brand; safe to remove after 2026-07
|
|
11
70
|
const LEGACY_BASE_DIR = path.join(homedir(), '.swarmify');
|
|
12
71
|
const TMP_FALLBACK_DIR = path.join(tmpdir(), 'agents');
|
|
13
72
|
async function pathExists(p) {
|
|
@@ -29,6 +88,7 @@ async function ensureWritableDir(p) {
|
|
|
29
88
|
return false;
|
|
30
89
|
}
|
|
31
90
|
}
|
|
91
|
+
/** Resolve the base data directory for teams, preferring ~/.agents/teams/ with a temp fallback. */
|
|
32
92
|
export async function resolveBaseDir() {
|
|
33
93
|
if (await ensureWritableDir(TEAMS_DIR)) {
|
|
34
94
|
return TEAMS_DIR;
|
|
@@ -55,6 +115,7 @@ async function resolveLegacySwarmifyConfigPath() {
|
|
|
55
115
|
}
|
|
56
116
|
let AGENTS_DIR = null;
|
|
57
117
|
let CONFIG_PATH = null;
|
|
118
|
+
/** Resolve and ensure the agents subdirectory exists under the teams base dir. */
|
|
58
119
|
export async function resolveAgentsDir() {
|
|
59
120
|
if (!AGENTS_DIR) {
|
|
60
121
|
AGENTS_DIR = await resolveAgentsPath();
|
|
@@ -174,20 +235,20 @@ async function migrateLegacyConfig() {
|
|
|
174
235
|
// Try ~/.agents/config.json first (most recent legacy location)
|
|
175
236
|
const legacyConfigPath = await resolveLegacyConfigPath();
|
|
176
237
|
let config = await tryReadLegacyConfig(legacyConfigPath);
|
|
177
|
-
// Try ~/.swarmify/agents/config.json
|
|
238
|
+
// Try ~/.swarmify/agents/config.json (legacy pre-OSS brand path)
|
|
178
239
|
if (!config) {
|
|
179
|
-
const
|
|
180
|
-
config = await tryReadLegacyConfig(
|
|
240
|
+
const legacyBrandConfigPath = await resolveLegacySwarmifyConfigPath();
|
|
241
|
+
config = await tryReadLegacyConfig(legacyBrandConfigPath);
|
|
181
242
|
}
|
|
182
243
|
if (!config)
|
|
183
244
|
return null;
|
|
184
245
|
// Write migrated config to new location
|
|
185
246
|
const newConfigPath = await ensureConfigPath();
|
|
186
247
|
await fs.writeFile(newConfigPath, JSON.stringify(config, null, 2));
|
|
187
|
-
console.warn(`[agents
|
|
248
|
+
console.warn(`[agents] Migrated config to ${newConfigPath}`);
|
|
188
249
|
return config;
|
|
189
250
|
}
|
|
190
|
-
|
|
251
|
+
/** Read teams config from disk, migrating legacy formats if needed. Returns defaults when no config exists. */
|
|
191
252
|
export async function readConfig() {
|
|
192
253
|
const configPath = await ensureConfigPath();
|
|
193
254
|
// Try to read new config first
|
|
@@ -268,22 +329,43 @@ export async function readConfig() {
|
|
|
268
329
|
return { enabledAgents, agentConfigs, providerConfigs, hasConfig: false };
|
|
269
330
|
}
|
|
270
331
|
}
|
|
271
|
-
|
|
332
|
+
/** Write teams config to disk. */
|
|
272
333
|
export async function writeConfig(config) {
|
|
273
334
|
const configPath = await ensureConfigPath();
|
|
274
|
-
await
|
|
335
|
+
await withConfigLock(configPath, async () => {
|
|
336
|
+
await atomicWriteJson(configPath, config);
|
|
337
|
+
});
|
|
275
338
|
}
|
|
276
|
-
|
|
339
|
+
/** Update the enabled/disabled status of a specific agent type in the config file. */
|
|
277
340
|
export async function setAgentEnabled(agentType, enabled) {
|
|
278
|
-
const { agentConfigs } = await readConfig();
|
|
279
|
-
agentConfigs[agentType].enabled = enabled;
|
|
280
341
|
const configPath = await ensureConfigPath();
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
342
|
+
await withConfigLock(configPath, async () => {
|
|
343
|
+
let parsed;
|
|
344
|
+
try {
|
|
345
|
+
const raw = await fs.readFile(configPath, 'utf-8');
|
|
346
|
+
parsed = JSON.parse(raw);
|
|
347
|
+
}
|
|
348
|
+
catch (err) {
|
|
349
|
+
// ENOENT: the lock held briefly above touched a placeholder, but a
|
|
350
|
+
// racing writer could still have produced an empty file. Fall back
|
|
351
|
+
// to defaults rather than wedge the call.
|
|
352
|
+
if (err && err.code === 'ENOENT') {
|
|
353
|
+
parsed = getDefaultSwarmConfig();
|
|
354
|
+
}
|
|
355
|
+
else if (err instanceof SyntaxError) {
|
|
356
|
+
throw new Error(`Teams config corrupted at ${configPath}: ${err.message}. Inspect and restore from backup.`);
|
|
357
|
+
}
|
|
358
|
+
else {
|
|
359
|
+
throw err;
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
if (!parsed.agents) {
|
|
363
|
+
parsed.agents = getDefaultSwarmConfig().agents;
|
|
364
|
+
}
|
|
365
|
+
if (!parsed.agents[agentType]) {
|
|
366
|
+
parsed.agents[agentType] = getDefaultAgentConfig(agentType);
|
|
367
|
+
}
|
|
368
|
+
parsed.agents[agentType].enabled = enabled;
|
|
369
|
+
await atomicWriteJson(configPath, parsed);
|
|
370
|
+
});
|
|
288
371
|
}
|
|
289
|
-
//# sourceMappingURL=persistence.js.map
|
|
@@ -1,11 +1,22 @@
|
|
|
1
|
+
/** Metadata for a registered team. */
|
|
1
2
|
export interface TeamMeta {
|
|
2
3
|
created_at: string;
|
|
3
4
|
description?: string;
|
|
4
5
|
}
|
|
6
|
+
/** Map of team name to team metadata. */
|
|
5
7
|
export type TeamRegistry = Record<string, TeamMeta>;
|
|
8
|
+
/**
|
|
9
|
+
* Load all teams from the registry file. Returns an empty object only when
|
|
10
|
+
* the file does not exist. A malformed file is a hard error — silently
|
|
11
|
+
* returning {} would let any caller wipe the user's registry on the next
|
|
12
|
+
* write, which is exactly the data-loss path we are trying to close.
|
|
13
|
+
*/
|
|
6
14
|
export declare function loadTeams(): Promise<TeamRegistry>;
|
|
15
|
+
/** Create a new team. Throws if a team with the same name already exists. */
|
|
7
16
|
export declare function createTeam(name: string, description?: string): Promise<TeamMeta>;
|
|
17
|
+
/** Return existing team metadata or create a new team if it does not exist. */
|
|
8
18
|
export declare function ensureTeam(name: string): Promise<TeamMeta>;
|
|
19
|
+
/** Remove a team from the registry. Returns false if the team did not exist. */
|
|
9
20
|
export declare function removeTeam(name: string): Promise<boolean>;
|
|
21
|
+
/** Check whether a team with the given name exists in the registry. */
|
|
10
22
|
export declare function teamExists(name: string): Promise<boolean>;
|
|
11
|
-
//# sourceMappingURL=registry.d.ts.map
|