@phnx-labs/agents-cli 0.1.0 → 1.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -1
- package/README.md +283 -372
- package/dist/commands/alias.d.ts +11 -0
- package/dist/commands/alias.js +117 -0
- package/dist/commands/beta.d.ts +2 -0
- package/dist/commands/beta.js +53 -0
- package/dist/commands/cloud.d.ts +8 -1
- package/dist/commands/cloud.js +108 -22
- package/dist/commands/commands.d.ts +9 -1
- package/dist/commands/commands.js +24 -172
- package/dist/commands/daemon.d.ts +8 -1
- package/dist/commands/daemon.js +13 -5
- package/dist/commands/doctor.d.ts +15 -0
- package/dist/commands/doctor.js +132 -0
- package/dist/commands/drive.d.ts +8 -1
- package/dist/commands/drive.js +20 -3
- package/dist/commands/exec.d.ts +8 -1
- package/dist/commands/exec.js +96 -27
- package/dist/commands/factory.d.ts +19 -0
- package/dist/commands/factory.js +71 -0
- package/dist/commands/fork.d.ts +8 -1
- package/dist/commands/fork.js +11 -4
- package/dist/commands/hooks.d.ts +9 -1
- package/dist/commands/hooks.js +30 -182
- package/dist/commands/init.d.ts +15 -1
- package/dist/commands/init.js +168 -74
- package/dist/commands/mcp.d.ts +9 -1
- package/dist/commands/mcp.js +11 -7
- package/dist/commands/models.d.ts +8 -1
- package/dist/commands/models.js +16 -4
- package/dist/commands/packages.d.ts +8 -1
- package/dist/commands/packages.js +13 -7
- package/dist/commands/permissions.d.ts +9 -1
- package/dist/commands/permissions.js +3 -3
- package/dist/commands/plugins.d.ts +8 -1
- package/dist/commands/plugins.js +13 -2
- package/dist/commands/profiles.d.ts +9 -1
- package/dist/commands/profiles.js +56 -7
- package/dist/commands/prune.d.ts +22 -0
- package/dist/commands/prune.js +191 -0
- package/dist/commands/pty.d.ts +1 -1
- package/dist/commands/pty.js +2 -1
- package/dist/commands/pull.d.ts +8 -1
- package/dist/commands/pull.js +58 -128
- package/dist/commands/refresh-memory.d.ts +7 -1
- package/dist/commands/refresh-memory.js +7 -1
- package/dist/commands/repo.d.ts +15 -0
- package/dist/commands/repo.js +570 -0
- package/dist/commands/resource-view.d.ts +10 -3
- package/dist/commands/resource-view.js +18 -5
- package/dist/commands/routines.d.ts +8 -1
- package/dist/commands/routines.js +17 -4
- package/dist/commands/rules.d.ts +9 -1
- package/dist/commands/rules.js +16 -11
- package/dist/commands/secrets.d.ts +8 -1
- package/dist/commands/secrets.js +235 -63
- package/dist/commands/sessions-picker.d.ts +2 -1
- package/dist/commands/sessions-picker.js +88 -11
- package/dist/commands/sessions-tail.d.ts +19 -0
- package/dist/commands/sessions-tail.js +235 -0
- package/dist/commands/sessions.d.ts +2 -1
- package/dist/commands/sessions.js +188 -7
- package/dist/commands/skills.d.ts +9 -1
- package/dist/commands/skills.js +28 -178
- package/dist/commands/status.d.ts +7 -1
- package/dist/commands/status.js +7 -1
- package/dist/commands/subagents.d.ts +8 -1
- package/dist/commands/subagents.js +11 -1
- package/dist/commands/sync.d.ts +8 -1
- package/dist/commands/sync.js +8 -1
- package/dist/commands/teams-picker.d.ts +4 -1
- package/dist/commands/teams-picker.js +55 -3
- package/dist/commands/teams.d.ts +15 -1
- package/dist/commands/teams.js +323 -69
- package/dist/commands/usage.d.ts +11 -0
- package/dist/commands/usage.js +60 -0
- package/dist/commands/utils.d.ts +6 -1
- package/dist/commands/utils.js +6 -1
- package/dist/commands/versions.d.ts +8 -1
- package/dist/commands/versions.js +4 -3
- package/dist/commands/view.d.ts +47 -2
- package/dist/commands/view.js +317 -24
- package/dist/index.d.ts +7 -2
- package/dist/index.js +172 -34
- package/dist/lib/acp/client.d.ts +31 -0
- package/dist/lib/acp/client.js +117 -0
- package/dist/lib/acp/harnesses.d.ts +26 -0
- package/dist/lib/acp/harnesses.js +65 -0
- package/dist/lib/acp/run.d.ts +18 -0
- package/dist/lib/acp/run.js +39 -0
- package/dist/lib/agents.d.ts +74 -2
- package/dist/lib/agents.js +197 -21
- package/dist/lib/artifact-actions.d.ts +8 -4
- package/dist/lib/artifact-actions.js +8 -6
- package/dist/lib/auto-pull-worker.d.ts +11 -0
- package/dist/lib/auto-pull-worker.js +121 -0
- package/dist/lib/auto-pull.d.ts +31 -0
- package/dist/lib/auto-pull.js +97 -0
- package/dist/lib/beta.d.ts +23 -0
- package/dist/lib/beta.js +90 -0
- package/dist/lib/capabilities.d.ts +29 -0
- package/dist/lib/capabilities.js +74 -0
- package/dist/lib/cloud/codex.d.ts +9 -3
- package/dist/lib/cloud/codex.js +53 -13
- package/dist/lib/cloud/factory.d.ts +8 -3
- package/dist/lib/cloud/factory.js +19 -3
- package/dist/lib/cloud/registry.d.ts +10 -1
- package/dist/lib/cloud/registry.js +14 -3
- package/dist/lib/cloud/rush.d.ts +63 -3
- package/dist/lib/cloud/rush.js +273 -20
- package/dist/lib/cloud/store.d.ts +13 -1
- package/dist/lib/cloud/store.js +23 -4
- package/dist/lib/cloud/stream.d.ts +6 -1
- package/dist/lib/cloud/stream.js +95 -39
- package/dist/lib/cloud/types.d.ts +153 -8
- package/dist/lib/cloud/types.js +34 -2
- package/dist/lib/command-skills.d.ts +20 -0
- package/dist/lib/command-skills.js +142 -0
- package/dist/lib/commands.d.ts +22 -2
- package/dist/lib/commands.js +51 -11
- package/dist/lib/convert.d.ts +10 -1
- package/dist/lib/convert.js +9 -1
- package/dist/lib/daemon.d.ts +21 -1
- package/dist/lib/daemon.js +97 -4
- package/dist/lib/drive-sync.d.ts +18 -1
- package/dist/lib/drive-sync.js +57 -15
- package/dist/lib/exec.d.ts +23 -6
- package/dist/lib/exec.js +53 -17
- package/dist/lib/fs-walk.d.ts +2 -0
- package/dist/lib/fs-walk.js +40 -0
- package/dist/lib/fuzzy.d.ts +53 -0
- package/dist/lib/fuzzy.js +72 -0
- package/dist/lib/gemini-settings.d.ts +4 -0
- package/dist/lib/gemini-settings.js +33 -0
- package/dist/lib/git.d.ts +12 -2
- package/dist/lib/git.js +17 -6
- package/dist/lib/help.d.ts +20 -1
- package/dist/lib/help.js +45 -6
- package/dist/lib/hooks/match.d.ts +32 -0
- package/dist/lib/hooks/match.js +120 -0
- package/dist/lib/hooks.d.ts +17 -4
- package/dist/lib/hooks.js +119 -101
- package/dist/lib/manifest.d.ts +6 -1
- package/dist/lib/manifest.js +15 -4
- package/dist/lib/markdown.d.ts +0 -1
- package/dist/lib/markdown.js +6 -1
- package/dist/lib/mcp.d.ts +0 -1
- package/dist/lib/mcp.js +29 -33
- package/dist/lib/memory-compile.d.ts +13 -3
- package/dist/lib/memory-compile.js +31 -9
- package/dist/lib/memory.d.ts +14 -7
- package/dist/lib/memory.js +67 -38
- package/dist/lib/migrate.d.ts +8 -0
- package/dist/lib/migrate.js +85 -0
- package/dist/lib/models.d.ts +10 -4
- package/dist/lib/models.js +36 -15
- package/dist/lib/onepassword.d.ts +63 -0
- package/dist/lib/onepassword.js +186 -0
- package/dist/lib/paths.d.ts +8 -0
- package/dist/lib/paths.js +20 -0
- package/dist/lib/permissions.d.ts +24 -2
- package/dist/lib/permissions.js +117 -48
- package/dist/lib/picker.d.ts +10 -1
- package/dist/lib/picker.js +15 -1
- package/dist/lib/plugins.d.ts +7 -1
- package/dist/lib/plugins.js +10 -1
- package/dist/lib/profiles-presets.d.ts +10 -1
- package/dist/lib/profiles-presets.js +9 -1
- package/dist/lib/profiles.d.ts +35 -1
- package/dist/lib/profiles.js +36 -15
- package/dist/lib/pty-client.d.ts +1 -1
- package/dist/lib/pty-client.js +0 -1
- package/dist/lib/pty-server.d.ts +16 -2
- package/dist/lib/pty-server.js +92 -3
- package/dist/lib/registry.d.ts +23 -3
- package/dist/lib/registry.js +153 -8
- package/dist/lib/resources.d.ts +28 -1
- package/dist/lib/resources.js +79 -1
- package/dist/lib/rotate.d.ts +40 -13
- package/dist/lib/rotate.js +238 -40
- package/dist/lib/routines.d.ts +29 -1
- package/dist/lib/routines.js +32 -5
- package/dist/lib/runner.d.ts +14 -1
- package/dist/lib/runner.js +22 -3
- package/dist/lib/sandbox.d.ts +16 -1
- package/dist/lib/sandbox.js +39 -16
- package/dist/lib/scheduler.d.ts +8 -1
- package/dist/lib/scheduler.js +8 -1
- package/dist/lib/secrets/AgentsKeychain.app/Contents/CodeResources +0 -0
- package/dist/lib/secrets/AgentsKeychain.app/Contents/Info.plist +22 -0
- package/dist/lib/secrets/AgentsKeychain.app/Contents/MacOS/AgentsKeychain +0 -0
- package/dist/lib/secrets/AgentsKeychain.app/Contents/_CodeSignature/CodeResources +123 -0
- package/dist/lib/secrets/AgentsKeychain.app/Contents/embedded.provisionprofile +0 -0
- package/dist/lib/{secrets-bundles.d.ts → secrets/bundles.d.ts} +12 -2
- package/dist/lib/{secrets-bundles.js → secrets/bundles.js} +38 -17
- package/dist/lib/secrets/index.d.ts +55 -0
- package/dist/lib/secrets/index.js +211 -0
- package/dist/lib/secrets/profiles.d.ts +10 -0
- package/dist/lib/secrets/profiles.js +13 -0
- package/dist/lib/session/active.d.ts +43 -0
- package/dist/lib/session/active.js +392 -0
- package/dist/lib/session/artifacts.d.ts +12 -1
- package/dist/lib/session/artifacts.js +25 -5
- package/dist/lib/session/cloud.d.ts +30 -0
- package/dist/lib/session/cloud.js +121 -0
- package/dist/lib/session/db.d.ts +23 -2
- package/dist/lib/session/db.js +76 -12
- package/dist/lib/session/discover.d.ts +19 -4
- package/dist/lib/session/discover.js +344 -48
- package/dist/lib/session/parse.d.ts +28 -1
- package/dist/lib/session/parse.js +267 -9
- package/dist/lib/session/prompt.d.ts +9 -1
- package/dist/lib/session/prompt.js +17 -3
- package/dist/lib/session/render.d.ts +13 -1
- package/dist/lib/session/render.js +20 -1
- package/dist/lib/session/team-filter.d.ts +9 -1
- package/dist/lib/session/team-filter.js +11 -2
- package/dist/lib/session/types.d.ts +16 -2
- package/dist/lib/session/types.js +10 -2
- package/dist/lib/shims.d.ts +64 -5
- package/dist/lib/shims.js +309 -47
- package/dist/lib/skills.d.ts +27 -2
- package/dist/lib/skills.js +127 -65
- package/dist/lib/sqlite.d.ts +43 -0
- package/dist/lib/sqlite.js +94 -0
- package/dist/lib/state.d.ts +112 -27
- package/dist/lib/state.js +320 -148
- package/dist/lib/subagents.d.ts +9 -1
- package/dist/lib/subagents.js +70 -63
- package/dist/lib/sync-manifest.d.ts +81 -0
- package/dist/lib/sync-manifest.js +450 -0
- package/dist/lib/teams/agents.d.ts +103 -5
- package/dist/lib/teams/agents.js +414 -91
- package/dist/lib/teams/api.d.ts +26 -3
- package/dist/lib/teams/api.js +63 -3
- package/dist/lib/teams/debug.d.ts +6 -1
- package/dist/lib/teams/debug.js +6 -1
- package/dist/lib/teams/file_ops.d.ts +7 -1
- package/dist/lib/teams/file_ops.js +7 -1
- package/dist/lib/teams/index.d.ts +15 -0
- package/dist/lib/teams/index.js +14 -0
- package/dist/lib/teams/parsers.d.ts +4 -1
- package/dist/lib/teams/parsers.js +11 -1
- package/dist/lib/teams/persistence.d.ts +15 -1
- package/dist/lib/teams/persistence.js +102 -20
- package/dist/lib/teams/registry.d.ts +12 -1
- package/dist/lib/teams/registry.js +116 -33
- package/dist/lib/teams/summarizer.d.ts +15 -1
- package/dist/lib/teams/summarizer.js +14 -1
- package/dist/lib/teams/supervisor.d.ts +48 -0
- package/dist/lib/teams/supervisor.js +73 -0
- package/dist/lib/template.d.ts +8 -6
- package/dist/lib/template.js +8 -6
- package/dist/lib/types.d.ts +147 -8
- package/dist/lib/types.js +26 -3
- package/dist/lib/usage.d.ts +32 -1
- package/dist/lib/usage.js +70 -6
- package/dist/lib/version-duplicates.d.ts +21 -0
- package/dist/lib/version-duplicates.js +90 -0
- package/dist/lib/versions.d.ts +33 -4
- package/dist/lib/versions.js +376 -108
- package/package.json +32 -17
- package/scripts/postinstall.js +126 -30
- package/dist/commands/__tests__/sessions.test.d.ts +0 -2
- package/dist/commands/__tests__/sessions.test.d.ts.map +0 -1
- package/dist/commands/__tests__/sessions.test.js +0 -636
- package/dist/commands/__tests__/sessions.test.js.map +0 -1
- package/dist/commands/cloud.d.ts.map +0 -1
- package/dist/commands/cloud.js.map +0 -1
- package/dist/commands/commands.d.ts.map +0 -1
- package/dist/commands/commands.js.map +0 -1
- package/dist/commands/daemon.d.ts.map +0 -1
- package/dist/commands/daemon.js.map +0 -1
- package/dist/commands/drive.d.ts.map +0 -1
- package/dist/commands/drive.js.map +0 -1
- package/dist/commands/exec.d.ts.map +0 -1
- package/dist/commands/exec.js.map +0 -1
- package/dist/commands/fork.d.ts.map +0 -1
- package/dist/commands/fork.js.map +0 -1
- package/dist/commands/hooks.d.ts.map +0 -1
- package/dist/commands/hooks.js.map +0 -1
- package/dist/commands/init.d.ts.map +0 -1
- package/dist/commands/init.js.map +0 -1
- package/dist/commands/mcp.d.ts.map +0 -1
- package/dist/commands/mcp.js.map +0 -1
- package/dist/commands/models.d.ts.map +0 -1
- package/dist/commands/models.js.map +0 -1
- package/dist/commands/packages.d.ts.map +0 -1
- package/dist/commands/packages.js.map +0 -1
- package/dist/commands/permissions.d.ts.map +0 -1
- package/dist/commands/permissions.js.map +0 -1
- package/dist/commands/plugins.d.ts.map +0 -1
- package/dist/commands/plugins.js.map +0 -1
- package/dist/commands/profiles.d.ts.map +0 -1
- package/dist/commands/profiles.js.map +0 -1
- package/dist/commands/pty.d.ts.map +0 -1
- package/dist/commands/pty.js.map +0 -1
- package/dist/commands/pull.d.ts.map +0 -1
- package/dist/commands/pull.js.map +0 -1
- package/dist/commands/push.d.ts +0 -3
- package/dist/commands/push.d.ts.map +0 -1
- package/dist/commands/push.js +0 -180
- package/dist/commands/push.js.map +0 -1
- package/dist/commands/refresh-memory.d.ts.map +0 -1
- package/dist/commands/refresh-memory.js.map +0 -1
- package/dist/commands/resource-view.d.ts.map +0 -1
- package/dist/commands/resource-view.js.map +0 -1
- package/dist/commands/routines.d.ts.map +0 -1
- package/dist/commands/routines.js.map +0 -1
- package/dist/commands/rules.d.ts.map +0 -1
- package/dist/commands/rules.js.map +0 -1
- package/dist/commands/secrets.d.ts.map +0 -1
- package/dist/commands/secrets.js.map +0 -1
- package/dist/commands/sessions-picker.d.ts.map +0 -1
- package/dist/commands/sessions-picker.js.map +0 -1
- package/dist/commands/sessions.d.ts.map +0 -1
- package/dist/commands/sessions.js.map +0 -1
- package/dist/commands/skills.d.ts.map +0 -1
- package/dist/commands/skills.js.map +0 -1
- package/dist/commands/status.d.ts.map +0 -1
- package/dist/commands/status.js.map +0 -1
- package/dist/commands/subagents.d.ts.map +0 -1
- package/dist/commands/subagents.js.map +0 -1
- package/dist/commands/sync.d.ts.map +0 -1
- package/dist/commands/sync.js.map +0 -1
- package/dist/commands/teams-picker.d.ts.map +0 -1
- package/dist/commands/teams-picker.js.map +0 -1
- package/dist/commands/teams.d.ts.map +0 -1
- package/dist/commands/teams.js.map +0 -1
- package/dist/commands/utils.d.ts.map +0 -1
- package/dist/commands/utils.js.map +0 -1
- package/dist/commands/versions.d.ts.map +0 -1
- package/dist/commands/versions.js.map +0 -1
- package/dist/commands/view.d.ts.map +0 -1
- package/dist/commands/view.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/lib/__tests__/bugfixes.test.d.ts +0 -2
- package/dist/lib/__tests__/bugfixes.test.d.ts.map +0 -1
- package/dist/lib/__tests__/bugfixes.test.js +0 -192
- package/dist/lib/__tests__/bugfixes.test.js.map +0 -1
- package/dist/lib/__tests__/exec.test.d.ts +0 -2
- package/dist/lib/__tests__/exec.test.d.ts.map +0 -1
- package/dist/lib/__tests__/exec.test.js +0 -446
- package/dist/lib/__tests__/exec.test.js.map +0 -1
- package/dist/lib/__tests__/git-sync.test.d.ts +0 -2
- package/dist/lib/__tests__/git-sync.test.d.ts.map +0 -1
- package/dist/lib/__tests__/git-sync.test.js +0 -138
- package/dist/lib/__tests__/git-sync.test.js.map +0 -1
- package/dist/lib/__tests__/hooks.test.d.ts +0 -2
- package/dist/lib/__tests__/hooks.test.d.ts.map +0 -1
- package/dist/lib/__tests__/hooks.test.js +0 -203
- package/dist/lib/__tests__/hooks.test.js.map +0 -1
- package/dist/lib/__tests__/memory-compile.test.d.ts +0 -2
- package/dist/lib/__tests__/memory-compile.test.d.ts.map +0 -1
- package/dist/lib/__tests__/memory-compile.test.js +0 -95
- package/dist/lib/__tests__/memory-compile.test.js.map +0 -1
- package/dist/lib/__tests__/models.test.d.ts +0 -2
- package/dist/lib/__tests__/models.test.d.ts.map +0 -1
- package/dist/lib/__tests__/models.test.js +0 -239
- package/dist/lib/__tests__/models.test.js.map +0 -1
- package/dist/lib/__tests__/rotate.test.d.ts +0 -2
- package/dist/lib/__tests__/rotate.test.d.ts.map +0 -1
- package/dist/lib/__tests__/rotate.test.js +0 -80
- package/dist/lib/__tests__/rotate.test.js.map +0 -1
- package/dist/lib/__tests__/secrets-bundles.test.d.ts +0 -2
- package/dist/lib/__tests__/secrets-bundles.test.d.ts.map +0 -1
- package/dist/lib/__tests__/secrets-bundles.test.js +0 -104
- package/dist/lib/__tests__/secrets-bundles.test.js.map +0 -1
- package/dist/lib/__tests__/secrets.test.d.ts +0 -2
- package/dist/lib/__tests__/secrets.test.d.ts.map +0 -1
- package/dist/lib/__tests__/secrets.test.js +0 -90
- package/dist/lib/__tests__/secrets.test.js.map +0 -1
- package/dist/lib/__tests__/shims.test.d.ts +0 -2
- package/dist/lib/__tests__/shims.test.d.ts.map +0 -1
- package/dist/lib/__tests__/shims.test.js +0 -39
- package/dist/lib/__tests__/shims.test.js.map +0 -1
- package/dist/lib/__tests__/usage.test.d.ts +0 -2
- package/dist/lib/__tests__/usage.test.d.ts.map +0 -1
- package/dist/lib/__tests__/usage.test.js +0 -220
- package/dist/lib/__tests__/usage.test.js.map +0 -1
- package/dist/lib/__tests__/versions.test.d.ts +0 -2
- package/dist/lib/__tests__/versions.test.d.ts.map +0 -1
- package/dist/lib/__tests__/versions.test.js +0 -63
- package/dist/lib/__tests__/versions.test.js.map +0 -1
- package/dist/lib/agents.d.ts.map +0 -1
- package/dist/lib/agents.js.map +0 -1
- package/dist/lib/artifact-actions.d.ts.map +0 -1
- package/dist/lib/artifact-actions.js.map +0 -1
- package/dist/lib/cloud/codex.d.ts.map +0 -1
- package/dist/lib/cloud/codex.js.map +0 -1
- package/dist/lib/cloud/factory.d.ts.map +0 -1
- package/dist/lib/cloud/factory.js.map +0 -1
- package/dist/lib/cloud/registry.d.ts.map +0 -1
- package/dist/lib/cloud/registry.js.map +0 -1
- package/dist/lib/cloud/rush.d.ts.map +0 -1
- package/dist/lib/cloud/rush.js.map +0 -1
- package/dist/lib/cloud/store.d.ts.map +0 -1
- package/dist/lib/cloud/store.js.map +0 -1
- package/dist/lib/cloud/stream.d.ts.map +0 -1
- package/dist/lib/cloud/stream.js.map +0 -1
- package/dist/lib/cloud/types.d.ts.map +0 -1
- package/dist/lib/cloud/types.js.map +0 -1
- package/dist/lib/commands.d.ts.map +0 -1
- package/dist/lib/commands.js.map +0 -1
- package/dist/lib/convert.d.ts.map +0 -1
- package/dist/lib/convert.js.map +0 -1
- package/dist/lib/daemon.d.ts.map +0 -1
- package/dist/lib/daemon.js.map +0 -1
- package/dist/lib/drive-sync.d.ts.map +0 -1
- package/dist/lib/drive-sync.js.map +0 -1
- package/dist/lib/exec.d.ts.map +0 -1
- package/dist/lib/exec.js.map +0 -1
- package/dist/lib/factory.d.ts +0 -57
- package/dist/lib/factory.d.ts.map +0 -1
- package/dist/lib/factory.js +0 -110
- package/dist/lib/factory.js.map +0 -1
- package/dist/lib/git.d.ts.map +0 -1
- package/dist/lib/git.js.map +0 -1
- package/dist/lib/help.d.ts.map +0 -1
- package/dist/lib/help.js.map +0 -1
- package/dist/lib/hooks.d.ts.map +0 -1
- package/dist/lib/hooks.js.map +0 -1
- package/dist/lib/manifest.d.ts.map +0 -1
- package/dist/lib/manifest.js.map +0 -1
- package/dist/lib/markdown.d.ts.map +0 -1
- package/dist/lib/markdown.js.map +0 -1
- package/dist/lib/mcp.d.ts.map +0 -1
- package/dist/lib/mcp.js.map +0 -1
- package/dist/lib/memory-compile.d.ts.map +0 -1
- package/dist/lib/memory-compile.js.map +0 -1
- package/dist/lib/memory.d.ts.map +0 -1
- package/dist/lib/memory.js.map +0 -1
- package/dist/lib/models.d.ts.map +0 -1
- package/dist/lib/models.js.map +0 -1
- package/dist/lib/permissions.d.ts.map +0 -1
- package/dist/lib/permissions.js.map +0 -1
- package/dist/lib/picker.d.ts.map +0 -1
- package/dist/lib/picker.js.map +0 -1
- package/dist/lib/plugins.d.ts.map +0 -1
- package/dist/lib/plugins.js.map +0 -1
- package/dist/lib/profiles-keychain.d.ts +0 -3
- package/dist/lib/profiles-keychain.d.ts.map +0 -1
- package/dist/lib/profiles-keychain.js +0 -10
- package/dist/lib/profiles-keychain.js.map +0 -1
- package/dist/lib/profiles-presets.d.ts.map +0 -1
- package/dist/lib/profiles-presets.js.map +0 -1
- package/dist/lib/profiles.d.ts.map +0 -1
- package/dist/lib/profiles.js.map +0 -1
- package/dist/lib/pty-client.d.ts.map +0 -1
- package/dist/lib/pty-client.js.map +0 -1
- package/dist/lib/pty-server.d.ts.map +0 -1
- package/dist/lib/pty-server.js.map +0 -1
- package/dist/lib/registry.d.ts.map +0 -1
- package/dist/lib/registry.js.map +0 -1
- package/dist/lib/resources.d.ts.map +0 -1
- package/dist/lib/resources.js.map +0 -1
- package/dist/lib/rotate.d.ts.map +0 -1
- package/dist/lib/rotate.js.map +0 -1
- package/dist/lib/routines.d.ts.map +0 -1
- package/dist/lib/routines.js.map +0 -1
- package/dist/lib/runner.d.ts.map +0 -1
- package/dist/lib/runner.js.map +0 -1
- package/dist/lib/sandbox.d.ts.map +0 -1
- package/dist/lib/sandbox.js.map +0 -1
- package/dist/lib/scheduler.d.ts.map +0 -1
- package/dist/lib/scheduler.js.map +0 -1
- package/dist/lib/secrets-bundles.d.ts.map +0 -1
- package/dist/lib/secrets-bundles.js.map +0 -1
- package/dist/lib/secrets.d.ts +0 -27
- package/dist/lib/secrets.d.ts.map +0 -1
- package/dist/lib/secrets.js +0 -127
- package/dist/lib/secrets.js.map +0 -1
- package/dist/lib/session/__tests__/db.test.d.ts +0 -2
- package/dist/lib/session/__tests__/db.test.d.ts.map +0 -1
- package/dist/lib/session/__tests__/db.test.js +0 -54
- package/dist/lib/session/__tests__/db.test.js.map +0 -1
- package/dist/lib/session/__tests__/discover.test.d.ts +0 -2
- package/dist/lib/session/__tests__/discover.test.d.ts.map +0 -1
- package/dist/lib/session/__tests__/discover.test.js +0 -63
- package/dist/lib/session/__tests__/discover.test.js.map +0 -1
- package/dist/lib/session/__tests__/prompt.test.d.ts +0 -2
- package/dist/lib/session/__tests__/prompt.test.d.ts.map +0 -1
- package/dist/lib/session/__tests__/prompt.test.js +0 -44
- package/dist/lib/session/__tests__/prompt.test.js.map +0 -1
- package/dist/lib/session/__tests__/render.test.d.ts +0 -2
- package/dist/lib/session/__tests__/render.test.d.ts.map +0 -1
- package/dist/lib/session/__tests__/render.test.js +0 -602
- package/dist/lib/session/__tests__/render.test.js.map +0 -1
- package/dist/lib/session/artifacts.d.ts.map +0 -1
- package/dist/lib/session/artifacts.js.map +0 -1
- package/dist/lib/session/db.d.ts.map +0 -1
- package/dist/lib/session/db.js.map +0 -1
- package/dist/lib/session/discover.d.ts.map +0 -1
- package/dist/lib/session/discover.js.map +0 -1
- package/dist/lib/session/parse.d.ts.map +0 -1
- package/dist/lib/session/parse.js.map +0 -1
- package/dist/lib/session/prompt.d.ts.map +0 -1
- package/dist/lib/session/prompt.js.map +0 -1
- package/dist/lib/session/prompt.test.d.ts +0 -2
- package/dist/lib/session/prompt.test.d.ts.map +0 -1
- package/dist/lib/session/prompt.test.js +0 -57
- package/dist/lib/session/prompt.test.js.map +0 -1
- package/dist/lib/session/render.d.ts.map +0 -1
- package/dist/lib/session/render.js.map +0 -1
- package/dist/lib/session/team-filter.d.ts.map +0 -1
- package/dist/lib/session/team-filter.js.map +0 -1
- package/dist/lib/session/team-filter.test.d.ts +0 -2
- package/dist/lib/session/team-filter.test.d.ts.map +0 -1
- package/dist/lib/session/team-filter.test.js +0 -157
- package/dist/lib/session/team-filter.test.js.map +0 -1
- package/dist/lib/session/types.d.ts.map +0 -1
- package/dist/lib/session/types.js.map +0 -1
- package/dist/lib/shims.d.ts.map +0 -1
- package/dist/lib/shims.js.map +0 -1
- package/dist/lib/skills.d.ts.map +0 -1
- package/dist/lib/skills.js.map +0 -1
- package/dist/lib/state.d.ts.map +0 -1
- package/dist/lib/state.js.map +0 -1
- package/dist/lib/subagents.d.ts.map +0 -1
- package/dist/lib/subagents.js.map +0 -1
- package/dist/lib/teams/agents.d.ts.map +0 -1
- package/dist/lib/teams/agents.js.map +0 -1
- package/dist/lib/teams/api.d.ts.map +0 -1
- package/dist/lib/teams/api.js.map +0 -1
- package/dist/lib/teams/cloud.d.ts +0 -11
- package/dist/lib/teams/cloud.d.ts.map +0 -1
- package/dist/lib/teams/cloud.js +0 -169
- package/dist/lib/teams/cloud.js.map +0 -1
- package/dist/lib/teams/debug.d.ts.map +0 -1
- package/dist/lib/teams/debug.js.map +0 -1
- package/dist/lib/teams/file_ops.d.ts.map +0 -1
- package/dist/lib/teams/file_ops.js.map +0 -1
- package/dist/lib/teams/parsers.d.ts.map +0 -1
- package/dist/lib/teams/parsers.js.map +0 -1
- package/dist/lib/teams/persistence.d.ts.map +0 -1
- package/dist/lib/teams/persistence.js.map +0 -1
- package/dist/lib/teams/ralph.d.ts +0 -8
- package/dist/lib/teams/ralph.d.ts.map +0 -1
- package/dist/lib/teams/ralph.js +0 -59
- package/dist/lib/teams/ralph.js.map +0 -1
- package/dist/lib/teams/registry.d.ts.map +0 -1
- package/dist/lib/teams/registry.js.map +0 -1
- package/dist/lib/teams/summarizer.d.ts.map +0 -1
- package/dist/lib/teams/summarizer.js.map +0 -1
- package/dist/lib/template.d.ts.map +0 -1
- package/dist/lib/template.js.map +0 -1
- package/dist/lib/types.d.ts.map +0 -1
- package/dist/lib/types.js.map +0 -1
- package/dist/lib/usage.d.ts.map +0 -1
- package/dist/lib/usage.js.map +0 -1
- package/dist/lib/versions.d.ts.map +0 -1
- package/dist/lib/versions.js.map +0 -1
- package/scripts/rebuild-sqlite.sh +0 -46
|
@@ -1,38 +1,182 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cloud dispatch type definitions.
|
|
3
|
+
*
|
|
4
|
+
* Defines the provider-agnostic interface that all cloud backends (Rush, Codex,
|
|
5
|
+
* Factory) implement, plus the shared task and event types that flow through
|
|
6
|
+
* the dispatch pipeline.
|
|
7
|
+
*/
|
|
8
|
+
/** Identifier for a supported cloud dispatch backend. */
|
|
1
9
|
export type CloudProviderId = 'rush' | 'codex' | 'factory';
|
|
2
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Lifecycle state of a cloud-dispatched task.
|
|
12
|
+
*
|
|
13
|
+
* `idle` represents a long-lived session that has stopped between turns and
|
|
14
|
+
* can be resumed via `message()`. Distinct from the terminal `completed |
|
|
15
|
+
* failed | cancelled` states, which cannot transition back to `running`.
|
|
16
|
+
*/
|
|
17
|
+
export type CloudTaskStatus = 'queued' | 'allocating' | 'running' | 'idle' | 'input_required' | 'completed' | 'failed' | 'cancelled';
|
|
18
|
+
/** Snapshot of a dispatched task, stored locally and refreshed from the provider. */
|
|
3
19
|
export interface CloudTask {
|
|
4
20
|
id: string;
|
|
5
21
|
provider: CloudProviderId;
|
|
6
22
|
status: CloudTaskStatus;
|
|
7
23
|
agent?: string;
|
|
8
24
|
prompt: string;
|
|
25
|
+
/**
|
|
26
|
+
* First (or only) repo the task targets. Kept for back-compat with callers
|
|
27
|
+
* that treat one task as one repo. For multi-repo dispatches, see `repos`.
|
|
28
|
+
*/
|
|
9
29
|
repo?: string;
|
|
30
|
+
/**
|
|
31
|
+
* All repos the task targets, in dispatch order. Populated for multi-repo
|
|
32
|
+
* dispatches (Rush Cloud, and any provider that supports it). `repo`
|
|
33
|
+
* mirrors `repos[0]` when both are set.
|
|
34
|
+
*/
|
|
35
|
+
repos?: string[];
|
|
10
36
|
branch?: string;
|
|
11
37
|
prUrl?: string;
|
|
12
38
|
createdAt: string;
|
|
13
39
|
updatedAt: string;
|
|
14
40
|
summary?: string;
|
|
15
41
|
}
|
|
16
|
-
|
|
17
|
-
|
|
42
|
+
/**
|
|
43
|
+
* Single event emitted by a running cloud task.
|
|
44
|
+
*
|
|
45
|
+
* Discriminated union mirroring the local `SessionEvent` taxonomy so cloud
|
|
46
|
+
* streams can be rendered with the same UI primitives as local sessions. The
|
|
47
|
+
* `unknown` variant catches event names the provider emits that the client
|
|
48
|
+
* doesn't recognize — surfacing them rather than silently dropping is the
|
|
49
|
+
* point.
|
|
50
|
+
*/
|
|
51
|
+
export type CloudEvent = {
|
|
52
|
+
type: 'text';
|
|
53
|
+
content: string;
|
|
54
|
+
timestamp?: string;
|
|
55
|
+
} | {
|
|
56
|
+
type: 'thinking';
|
|
57
|
+
content: string;
|
|
58
|
+
timestamp?: string;
|
|
59
|
+
} | {
|
|
60
|
+
type: 'tool_use';
|
|
61
|
+
tool: string;
|
|
62
|
+
input: unknown;
|
|
63
|
+
timestamp?: string;
|
|
64
|
+
} | {
|
|
65
|
+
type: 'tool_result';
|
|
66
|
+
tool: string;
|
|
67
|
+
output: unknown;
|
|
68
|
+
timestamp?: string;
|
|
69
|
+
} | {
|
|
70
|
+
type: 'status';
|
|
71
|
+
status: CloudTaskStatus;
|
|
72
|
+
timestamp?: string;
|
|
73
|
+
} | {
|
|
74
|
+
type: 'usage';
|
|
75
|
+
model?: string;
|
|
76
|
+
inputTokens?: number;
|
|
77
|
+
outputTokens?: number;
|
|
78
|
+
timestamp?: string;
|
|
79
|
+
} | {
|
|
80
|
+
type: 'done';
|
|
81
|
+
status?: CloudTaskStatus;
|
|
82
|
+
prUrl?: string;
|
|
83
|
+
summary?: string;
|
|
84
|
+
timestamp?: string;
|
|
85
|
+
} | {
|
|
86
|
+
type: 'error';
|
|
87
|
+
message: string;
|
|
88
|
+
timestamp?: string;
|
|
89
|
+
} | {
|
|
90
|
+
type: 'unknown';
|
|
91
|
+
name: string;
|
|
18
92
|
data: string;
|
|
19
93
|
timestamp?: string;
|
|
94
|
+
};
|
|
95
|
+
/** Reference to a skill that should ride along with a cloud dispatch. */
|
|
96
|
+
export interface SkillRef {
|
|
97
|
+
id: string;
|
|
98
|
+
version?: string;
|
|
99
|
+
}
|
|
100
|
+
/** A vision attachment carried along with a prompt (base64-encoded image bytes). */
|
|
101
|
+
export interface ImageAttachment {
|
|
102
|
+
data: string;
|
|
103
|
+
mimeType: 'image/png' | 'image/jpeg' | 'image/webp';
|
|
20
104
|
}
|
|
105
|
+
/** Maximum images allowed per dispatch (matches Cursor Background Agents). */
|
|
106
|
+
export declare const MAX_IMAGES_PER_DISPATCH = 5;
|
|
107
|
+
/** Parameters for dispatching a new cloud task. */
|
|
21
108
|
export interface DispatchOptions {
|
|
22
109
|
prompt: string;
|
|
23
110
|
agent?: string;
|
|
111
|
+
/**
|
|
112
|
+
* Legacy single-repo target. Still honored: if `repos` is empty, this
|
|
113
|
+
* becomes the only repo. Providers that support multi-repo treat
|
|
114
|
+
* `repos = [repo]` and `repo` as equivalent.
|
|
115
|
+
*/
|
|
24
116
|
repo?: string;
|
|
117
|
+
/**
|
|
118
|
+
* One or more repos the dispatch targets. Repeatable on the CLI via
|
|
119
|
+
* `--repo`. Providers handle multi-repo differently:
|
|
120
|
+
* - Rush Cloud clones each into /workspace/<owner>/<name>/
|
|
121
|
+
* - Codex Cloud rejects (multi-repo requires an env that bundles them)
|
|
122
|
+
* - Factory (local) clones each into the workspace before dispatch
|
|
123
|
+
*/
|
|
124
|
+
repos?: string[];
|
|
25
125
|
branch?: string;
|
|
26
126
|
timeout?: string;
|
|
27
127
|
model?: string;
|
|
128
|
+
/**
|
|
129
|
+
* Skills to ship with the dispatch. Providers that support skills mount
|
|
130
|
+
* them in the pod's skills directory before the agent runs. Providers
|
|
131
|
+
* without skill support reject via `capabilities().skills === false`.
|
|
132
|
+
*/
|
|
133
|
+
skills?: SkillRef[];
|
|
134
|
+
/**
|
|
135
|
+
* Image attachments for vision-enabled dispatch (e.g., "fix this UI bug,
|
|
136
|
+
* here's the screenshot"). Capped at MAX_IMAGES_PER_DISPATCH.
|
|
137
|
+
*/
|
|
138
|
+
images?: ImageAttachment[];
|
|
28
139
|
/** Provider-specific options (e.g., codex env ID, factory computer name). */
|
|
29
|
-
providerOptions?: Record<string,
|
|
140
|
+
providerOptions?: Record<string, unknown>;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Collapse `repo` + `repos` into a single deduped list. Exported so callers,
|
|
144
|
+
* tests, and every provider share the same resolution — one source of truth
|
|
145
|
+
* for "which repos does this dispatch target?".
|
|
146
|
+
*/
|
|
147
|
+
export declare function resolveDispatchRepos(options: DispatchOptions): string[];
|
|
148
|
+
/**
|
|
149
|
+
* What a provider can actually do. Replaces the single-bool `supports()` so
|
|
150
|
+
* callers can ask "does this provider support cancel?" without trying and
|
|
151
|
+
* catching. The CLI gates feature-specific calls on these flags and surfaces
|
|
152
|
+
* a typed error instead of letting throws bubble.
|
|
153
|
+
*/
|
|
154
|
+
export interface ProviderCapabilities {
|
|
155
|
+
/** Configured + reachable (auth present, binary installed, etc.). */
|
|
156
|
+
available: boolean;
|
|
157
|
+
dispatch: boolean;
|
|
158
|
+
status: boolean;
|
|
159
|
+
list: boolean;
|
|
160
|
+
stream: boolean;
|
|
161
|
+
cancel: boolean;
|
|
162
|
+
message: boolean;
|
|
163
|
+
multiRepo: boolean;
|
|
164
|
+
skills: boolean;
|
|
165
|
+
images: boolean;
|
|
30
166
|
}
|
|
167
|
+
/**
|
|
168
|
+
* Contract that every cloud backend must implement.
|
|
169
|
+
*
|
|
170
|
+
* Each provider translates between the unified dispatch interface and its
|
|
171
|
+
* backend-specific API (Rush Factory Floor, Codex Cloud CLI, Droid daemon).
|
|
172
|
+
*
|
|
173
|
+
* `message()` may transition a task from `idle` back to `running`.
|
|
174
|
+
*/
|
|
31
175
|
export interface CloudProvider {
|
|
32
176
|
id: CloudProviderId;
|
|
33
177
|
name: string;
|
|
34
|
-
/**
|
|
35
|
-
|
|
178
|
+
/** Static capability map for this provider. Read before calling feature methods. */
|
|
179
|
+
capabilities(): ProviderCapabilities;
|
|
36
180
|
dispatch(options: DispatchOptions): Promise<CloudTask>;
|
|
37
181
|
status(taskId: string): Promise<CloudTask>;
|
|
38
182
|
list(filter?: {
|
|
@@ -41,9 +185,10 @@ export interface CloudProvider {
|
|
|
41
185
|
/** Stream live output. Yields events until task completes or caller breaks. */
|
|
42
186
|
stream(taskId: string): AsyncIterable<CloudEvent>;
|
|
43
187
|
cancel(taskId: string): Promise<void>;
|
|
44
|
-
/** Send a follow-up message to a finished/needs_review task. */
|
|
188
|
+
/** Send a follow-up message to a finished/idle/needs_review task. */
|
|
45
189
|
message(taskId: string, content: string): Promise<void>;
|
|
46
190
|
}
|
|
191
|
+
/** Per-provider configuration stored in the `cloud.providers` section of agents.yaml. */
|
|
47
192
|
export interface CloudProviderConfig {
|
|
48
193
|
rush?: Record<string, string>;
|
|
49
194
|
codex?: {
|
|
@@ -53,8 +198,8 @@ export interface CloudProviderConfig {
|
|
|
53
198
|
computer?: string;
|
|
54
199
|
};
|
|
55
200
|
}
|
|
201
|
+
/** Top-level `cloud` section of agents.yaml. */
|
|
56
202
|
export interface CloudConfig {
|
|
57
203
|
default_provider?: CloudProviderId;
|
|
58
204
|
providers?: CloudProviderConfig;
|
|
59
205
|
}
|
|
60
|
-
//# sourceMappingURL=types.d.ts.map
|
package/dist/lib/cloud/types.js
CHANGED
|
@@ -1,2 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Cloud dispatch type definitions.
|
|
3
|
+
*
|
|
4
|
+
* Defines the provider-agnostic interface that all cloud backends (Rush, Codex,
|
|
5
|
+
* Factory) implement, plus the shared task and event types that flow through
|
|
6
|
+
* the dispatch pipeline.
|
|
7
|
+
*/
|
|
8
|
+
/** Maximum images allowed per dispatch (matches Cursor Background Agents). */
|
|
9
|
+
export const MAX_IMAGES_PER_DISPATCH = 5;
|
|
10
|
+
/**
|
|
11
|
+
* Collapse `repo` + `repos` into a single deduped list. Exported so callers,
|
|
12
|
+
* tests, and every provider share the same resolution — one source of truth
|
|
13
|
+
* for "which repos does this dispatch target?".
|
|
14
|
+
*/
|
|
15
|
+
export function resolveDispatchRepos(options) {
|
|
16
|
+
const out = [];
|
|
17
|
+
const seen = new Set();
|
|
18
|
+
const candidates = [];
|
|
19
|
+
if (options.repos)
|
|
20
|
+
candidates.push(...options.repos);
|
|
21
|
+
if (options.repo)
|
|
22
|
+
candidates.push(options.repo);
|
|
23
|
+
for (const raw of candidates) {
|
|
24
|
+
const trimmed = typeof raw === 'string' ? raw.trim() : '';
|
|
25
|
+
if (!trimmed)
|
|
26
|
+
continue;
|
|
27
|
+
const key = trimmed.toLowerCase();
|
|
28
|
+
if (seen.has(key))
|
|
29
|
+
continue;
|
|
30
|
+
seen.add(key);
|
|
31
|
+
out.push(trimmed);
|
|
32
|
+
}
|
|
33
|
+
return out;
|
|
34
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Convert slash-command markdown files into Codex skills for Codex releases
|
|
3
|
+
* that no longer load the legacy prompts/ directory.
|
|
4
|
+
*/
|
|
5
|
+
import type { AgentId } from './types.js';
|
|
6
|
+
export declare function shouldInstallCommandAsSkill(agent: AgentId, version: string): boolean;
|
|
7
|
+
export declare function commandSkillName(commandName: string): string;
|
|
8
|
+
export declare function buildCommandSkillContent(commandName: string, sourcePath: string): string;
|
|
9
|
+
export declare function skillSourceExists(skillName: string, skillSourceDirs: Array<string | null | undefined>): boolean;
|
|
10
|
+
export declare function installCommandSkillToVersion(agentDir: string, commandName: string, sourcePath: string, skillSourceDirs?: Array<string | null | undefined>): {
|
|
11
|
+
success: boolean;
|
|
12
|
+
skipped?: boolean;
|
|
13
|
+
error?: string;
|
|
14
|
+
};
|
|
15
|
+
export declare function listCommandSkillsInVersion(agentDir: string): string[];
|
|
16
|
+
export declare function commandSkillMatches(agentDir: string, commandName: string, sourcePath: string): boolean;
|
|
17
|
+
export declare function removeCommandSkillFromVersion(agentDir: string, commandName: string): {
|
|
18
|
+
success: boolean;
|
|
19
|
+
error?: string;
|
|
20
|
+
};
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Convert slash-command markdown files into Codex skills for Codex releases
|
|
3
|
+
* that no longer load the legacy prompts/ directory.
|
|
4
|
+
*/
|
|
5
|
+
import * as fs from 'fs';
|
|
6
|
+
import * as path from 'path';
|
|
7
|
+
import * as yaml from 'yaml';
|
|
8
|
+
import { supports } from './capabilities.js';
|
|
9
|
+
import { safeJoin } from './paths.js';
|
|
10
|
+
const COMMAND_SKILL_MARKER = 'agents_command';
|
|
11
|
+
function readCommandMetadata(sourcePath) {
|
|
12
|
+
const content = fs.readFileSync(sourcePath, 'utf-8');
|
|
13
|
+
const lines = content.split('\n');
|
|
14
|
+
if (lines[0] !== '---') {
|
|
15
|
+
return { description: '', body: content };
|
|
16
|
+
}
|
|
17
|
+
const endIndex = lines.slice(1).findIndex((line) => line === '---');
|
|
18
|
+
if (endIndex < 0) {
|
|
19
|
+
return { description: '', body: content };
|
|
20
|
+
}
|
|
21
|
+
const frontmatterEnd = endIndex + 1;
|
|
22
|
+
const frontmatter = lines.slice(1, frontmatterEnd).join('\n');
|
|
23
|
+
const body = lines.slice(frontmatterEnd + 1).join('\n').trimStart();
|
|
24
|
+
try {
|
|
25
|
+
const parsed = yaml.parse(frontmatter);
|
|
26
|
+
const description = typeof parsed?.description === 'string' ? parsed.description.trim() : '';
|
|
27
|
+
return { description, body };
|
|
28
|
+
}
|
|
29
|
+
catch {
|
|
30
|
+
return { description: '', body };
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
function readSkillCommandMarker(skillMdPath) {
|
|
34
|
+
if (!fs.existsSync(skillMdPath))
|
|
35
|
+
return null;
|
|
36
|
+
const content = fs.readFileSync(skillMdPath, 'utf-8');
|
|
37
|
+
const lines = content.split('\n');
|
|
38
|
+
if (lines[0] !== '---')
|
|
39
|
+
return null;
|
|
40
|
+
const endIndex = lines.slice(1).findIndex((line) => line === '---');
|
|
41
|
+
if (endIndex < 0)
|
|
42
|
+
return null;
|
|
43
|
+
try {
|
|
44
|
+
const frontmatter = lines.slice(1, endIndex + 1).join('\n');
|
|
45
|
+
const parsed = yaml.parse(frontmatter);
|
|
46
|
+
return typeof parsed?.[COMMAND_SKILL_MARKER] === 'string' ? parsed[COMMAND_SKILL_MARKER] : null;
|
|
47
|
+
}
|
|
48
|
+
catch {
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
export function shouldInstallCommandAsSkill(agent, version) {
|
|
53
|
+
if (agent !== 'codex')
|
|
54
|
+
return false;
|
|
55
|
+
return !supports(agent, 'commands', version).ok && supports(agent, 'skills', version).ok;
|
|
56
|
+
}
|
|
57
|
+
export function commandSkillName(commandName) {
|
|
58
|
+
return commandName;
|
|
59
|
+
}
|
|
60
|
+
export function buildCommandSkillContent(commandName, sourcePath) {
|
|
61
|
+
const { description, body } = readCommandMetadata(sourcePath);
|
|
62
|
+
const skillDescription = description || `Slash command converted from /${commandName}`;
|
|
63
|
+
return [
|
|
64
|
+
'---',
|
|
65
|
+
`name: ${JSON.stringify(commandSkillName(commandName))}`,
|
|
66
|
+
`description: ${JSON.stringify(skillDescription)}`,
|
|
67
|
+
`${COMMAND_SKILL_MARKER}: ${JSON.stringify(commandName)}`,
|
|
68
|
+
'---',
|
|
69
|
+
'',
|
|
70
|
+
`# /${commandName}`,
|
|
71
|
+
'',
|
|
72
|
+
`This skill contains the behavior from the legacy \`/${commandName}\` slash command.`,
|
|
73
|
+
'When invoked with `$' + commandSkillName(commandName) + '`, treat the text after the skill name as the original command arguments.',
|
|
74
|
+
'',
|
|
75
|
+
body.trimEnd(),
|
|
76
|
+
'',
|
|
77
|
+
].join('\n');
|
|
78
|
+
}
|
|
79
|
+
export function skillSourceExists(skillName, skillSourceDirs) {
|
|
80
|
+
return skillSourceDirs.some((dir) => {
|
|
81
|
+
if (!dir)
|
|
82
|
+
return false;
|
|
83
|
+
const candidate = path.join(dir, skillName);
|
|
84
|
+
return fs.existsSync(candidate) && fs.lstatSync(candidate).isDirectory();
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
export function installCommandSkillToVersion(agentDir, commandName, sourcePath, skillSourceDirs = []) {
|
|
88
|
+
const skillName = commandSkillName(commandName);
|
|
89
|
+
if (skillSourceExists(skillName, skillSourceDirs)) {
|
|
90
|
+
return { success: false, skipped: true, error: `Skill '${skillName}' already exists` };
|
|
91
|
+
}
|
|
92
|
+
const skillsDir = safeJoin(agentDir, 'skills');
|
|
93
|
+
const skillDir = safeJoin(skillsDir, skillName);
|
|
94
|
+
try {
|
|
95
|
+
fs.rmSync(skillDir, { recursive: true, force: true });
|
|
96
|
+
fs.mkdirSync(skillDir, { recursive: true });
|
|
97
|
+
fs.writeFileSync(safeJoin(skillDir, 'SKILL.md'), buildCommandSkillContent(commandName, sourcePath), 'utf-8');
|
|
98
|
+
return { success: true };
|
|
99
|
+
}
|
|
100
|
+
catch (err) {
|
|
101
|
+
return { success: false, error: err.message };
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
export function listCommandSkillsInVersion(agentDir) {
|
|
105
|
+
const skillsDir = path.join(agentDir, 'skills');
|
|
106
|
+
if (!fs.existsSync(skillsDir))
|
|
107
|
+
return [];
|
|
108
|
+
const names = [];
|
|
109
|
+
for (const entry of fs.readdirSync(skillsDir, { withFileTypes: true })) {
|
|
110
|
+
if (!entry.isDirectory() || entry.name.startsWith('.'))
|
|
111
|
+
continue;
|
|
112
|
+
const marker = readSkillCommandMarker(path.join(skillsDir, entry.name, 'SKILL.md'));
|
|
113
|
+
if (marker)
|
|
114
|
+
names.push(marker);
|
|
115
|
+
}
|
|
116
|
+
return names.sort();
|
|
117
|
+
}
|
|
118
|
+
export function commandSkillMatches(agentDir, commandName, sourcePath) {
|
|
119
|
+
const skillMdPath = path.join(agentDir, 'skills', commandSkillName(commandName), 'SKILL.md');
|
|
120
|
+
if (!fs.existsSync(skillMdPath))
|
|
121
|
+
return false;
|
|
122
|
+
try {
|
|
123
|
+
return fs.readFileSync(skillMdPath, 'utf-8') === buildCommandSkillContent(commandName, sourcePath);
|
|
124
|
+
}
|
|
125
|
+
catch {
|
|
126
|
+
return false;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
export function removeCommandSkillFromVersion(agentDir, commandName) {
|
|
130
|
+
const skillDir = path.join(agentDir, 'skills', commandSkillName(commandName));
|
|
131
|
+
const skillMdPath = path.join(skillDir, 'SKILL.md');
|
|
132
|
+
if (readSkillCommandMarker(skillMdPath) !== commandName) {
|
|
133
|
+
return { success: true };
|
|
134
|
+
}
|
|
135
|
+
try {
|
|
136
|
+
fs.rmSync(skillDir, { recursive: true, force: true });
|
|
137
|
+
return { success: true };
|
|
138
|
+
}
|
|
139
|
+
catch (err) {
|
|
140
|
+
return { success: false, error: err.message };
|
|
141
|
+
}
|
|
142
|
+
}
|
package/dist/lib/commands.d.ts
CHANGED
|
@@ -1,14 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Slash command management -- discovery, installation, and syncing.
|
|
3
|
+
*
|
|
4
|
+
* Commands are markdown files in ~/.agents/commands/ exposed as `/command-name`
|
|
5
|
+
* shortcuts by agents. This module discovers them, converts between formats
|
|
6
|
+
* (markdown for Claude/Codex, TOML for Gemini), and installs them into
|
|
7
|
+
* agent version homes.
|
|
8
|
+
*/
|
|
1
9
|
import type { AgentId, CommandInstallation } from './types.js';
|
|
10
|
+
/** Scope of a command: user-global or project-local. */
|
|
2
11
|
export type CommandScope = 'user' | 'project';
|
|
12
|
+
/** Parsed metadata from a command file's YAML frontmatter. */
|
|
3
13
|
export interface CommandMetadata {
|
|
4
14
|
name: string;
|
|
5
15
|
description: string;
|
|
6
16
|
}
|
|
17
|
+
/** Result of validating command metadata. */
|
|
7
18
|
export interface ValidationResult {
|
|
8
19
|
valid: boolean;
|
|
9
20
|
errors: string[];
|
|
10
21
|
warnings: string[];
|
|
11
22
|
}
|
|
23
|
+
/** A command discovered in a repository's commands/ directory. */
|
|
12
24
|
export interface DiscoveredCommand {
|
|
13
25
|
name: string;
|
|
14
26
|
description: string;
|
|
@@ -16,16 +28,22 @@ export interface DiscoveredCommand {
|
|
|
16
28
|
isShared: boolean;
|
|
17
29
|
validation: ValidationResult;
|
|
18
30
|
}
|
|
31
|
+
/** A command installed in an agent's config directory. */
|
|
19
32
|
export interface InstalledCommand {
|
|
20
33
|
name: string;
|
|
21
34
|
scope: CommandScope;
|
|
22
35
|
path: string;
|
|
23
36
|
description?: string;
|
|
24
37
|
}
|
|
38
|
+
/** Parse command metadata (name, description) from YAML frontmatter or TOML headers. */
|
|
25
39
|
export declare function parseCommandMetadata(filePath: string): CommandMetadata | null;
|
|
40
|
+
/** Validate command metadata, returning errors and warnings. */
|
|
26
41
|
export declare function validateCommandMetadata(metadata: CommandMetadata | null, commandName: string): ValidationResult;
|
|
42
|
+
/** Discover all command markdown files in a repository's commands/ directory. */
|
|
27
43
|
export declare function discoverCommands(repoPath: string): DiscoveredCommand[];
|
|
44
|
+
/** Find the source path for a command in a repository. */
|
|
28
45
|
export declare function resolveCommandSource(repoPath: string, commandName: string): string | null;
|
|
46
|
+
/** Install a command into an agent's config directory, with optional format conversion. */
|
|
29
47
|
export declare function installCommand(sourcePath: string, agentId: AgentId, commandName: string, method?: 'symlink' | 'copy'): CommandInstallation & {
|
|
30
48
|
error?: string;
|
|
31
49
|
warnings?: string[];
|
|
@@ -77,7 +95,9 @@ export declare function iterCommandsCapableVersions(filter?: {
|
|
|
77
95
|
agent: AgentId;
|
|
78
96
|
version: string;
|
|
79
97
|
}>;
|
|
98
|
+
/** Remove a command from an agent's config directory. */
|
|
80
99
|
export declare function uninstallCommand(agentId: AgentId, commandName: string): boolean;
|
|
100
|
+
/** List command names installed for an agent in the active version home. */
|
|
81
101
|
export declare function listInstalledCommands(agentId: AgentId): string[];
|
|
82
102
|
/**
|
|
83
103
|
* Check if a command exists for an agent.
|
|
@@ -106,7 +126,8 @@ export declare function installCommandCentrally(sourcePath: string, commandName:
|
|
|
106
126
|
warnings?: string[];
|
|
107
127
|
};
|
|
108
128
|
/**
|
|
109
|
-
* List commands from
|
|
129
|
+
* List commands from user (~/.agents/commands/) and system (~/.agents-system/commands/) dirs.
|
|
130
|
+
* User dir takes priority; deduplication preserves first occurrence.
|
|
110
131
|
*/
|
|
111
132
|
export declare function listCentralCommands(): string[];
|
|
112
133
|
/**
|
|
@@ -118,4 +139,3 @@ export declare function getCommandInfo(name: string): {
|
|
|
118
139
|
path: string;
|
|
119
140
|
content: string;
|
|
120
141
|
} | null;
|
|
121
|
-
//# sourceMappingURL=commands.d.ts.map
|
package/dist/lib/commands.js
CHANGED
|
@@ -1,10 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Slash command management -- discovery, installation, and syncing.
|
|
3
|
+
*
|
|
4
|
+
* Commands are markdown files in ~/.agents/commands/ exposed as `/command-name`
|
|
5
|
+
* shortcuts by agents. This module discovers them, converts between formats
|
|
6
|
+
* (markdown for Claude/Codex, TOML for Gemini), and installs them into
|
|
7
|
+
* agent version homes.
|
|
8
|
+
*/
|
|
1
9
|
import * as fs from 'fs';
|
|
2
10
|
import * as path from 'path';
|
|
3
11
|
import * as yaml from 'yaml';
|
|
4
12
|
import { AGENTS, COMMANDS_CAPABLE_AGENTS, ensureCommandsDir } from './agents.js';
|
|
5
13
|
import { markdownToToml } from './convert.js';
|
|
6
|
-
import { getCommandsDir, getProjectAgentsDir } from './state.js';
|
|
14
|
+
import { getCommandsDir, getUserCommandsDir, getEnabledExtraRepos, getProjectAgentsDir, getSkillsDir } from './state.js';
|
|
7
15
|
import { getEffectiveHome, getVersionHomePath, listInstalledVersions } from './versions.js';
|
|
16
|
+
import { commandSkillMatches, installCommandSkillToVersion, listCommandSkillsInVersion, removeCommandSkillFromVersion, shouldInstallCommandAsSkill, } from './command-skills.js';
|
|
17
|
+
/** Parse command metadata (name, description) from YAML frontmatter or TOML headers. */
|
|
8
18
|
export function parseCommandMetadata(filePath) {
|
|
9
19
|
if (!fs.existsSync(filePath)) {
|
|
10
20
|
return null;
|
|
@@ -40,6 +50,7 @@ export function parseCommandMetadata(filePath) {
|
|
|
40
50
|
return null;
|
|
41
51
|
}
|
|
42
52
|
}
|
|
53
|
+
/** Validate command metadata, returning errors and warnings. */
|
|
43
54
|
export function validateCommandMetadata(metadata, commandName) {
|
|
44
55
|
const errors = [];
|
|
45
56
|
const warnings = [];
|
|
@@ -61,6 +72,7 @@ export function validateCommandMetadata(metadata, commandName) {
|
|
|
61
72
|
}
|
|
62
73
|
return { valid: errors.length === 0, errors, warnings };
|
|
63
74
|
}
|
|
75
|
+
/** Discover all command markdown files in a repository's commands/ directory. */
|
|
64
76
|
export function discoverCommands(repoPath) {
|
|
65
77
|
const commands = [];
|
|
66
78
|
const commandsDir = path.join(repoPath, 'commands');
|
|
@@ -93,6 +105,7 @@ function extractDescription(content) {
|
|
|
93
105
|
const firstLine = content.split('\n').find((l) => l.trim() && !l.startsWith('---'));
|
|
94
106
|
return firstLine?.slice(0, 80) || '';
|
|
95
107
|
}
|
|
108
|
+
/** Find the source path for a command in a repository. */
|
|
96
109
|
export function resolveCommandSource(repoPath, commandName) {
|
|
97
110
|
const commandPath = path.join(repoPath, 'commands', `${commandName}.md`);
|
|
98
111
|
if (fs.existsSync(commandPath)) {
|
|
@@ -100,6 +113,7 @@ export function resolveCommandSource(repoPath, commandName) {
|
|
|
100
113
|
}
|
|
101
114
|
return null;
|
|
102
115
|
}
|
|
116
|
+
/** Install a command into an agent's config directory, with optional format conversion. */
|
|
103
117
|
export function installCommand(sourcePath, agentId, commandName, method = 'symlink') {
|
|
104
118
|
// Validate command metadata before installation
|
|
105
119
|
const metadata = parseCommandMetadata(sourcePath);
|
|
@@ -149,6 +163,11 @@ export function getVersionCommandsDir(agent, version) {
|
|
|
149
163
|
* List command names (without extension) installed in a specific version home.
|
|
150
164
|
*/
|
|
151
165
|
export function listCommandsInVersionHome(agent, version) {
|
|
166
|
+
const versionHome = getVersionHomePath(agent, version);
|
|
167
|
+
const agentDir = path.join(versionHome, `.${agent}`);
|
|
168
|
+
if (shouldInstallCommandAsSkill(agent, version)) {
|
|
169
|
+
return listCommandSkillsInVersion(agentDir);
|
|
170
|
+
}
|
|
152
171
|
const dir = getVersionCommandsDir(agent, version);
|
|
153
172
|
if (!fs.existsSync(dir))
|
|
154
173
|
return [];
|
|
@@ -166,6 +185,11 @@ function versionCommandMatches(agent, version, commandName) {
|
|
|
166
185
|
const sourcePath = path.join(getCommandsDir(), `${commandName}.md`);
|
|
167
186
|
if (!fs.existsSync(sourcePath))
|
|
168
187
|
return false;
|
|
188
|
+
const versionHome = getVersionHomePath(agent, version);
|
|
189
|
+
const agentDir = path.join(versionHome, `.${agent}`);
|
|
190
|
+
if (shouldInstallCommandAsSkill(agent, version)) {
|
|
191
|
+
return commandSkillMatches(agentDir, commandName, sourcePath);
|
|
192
|
+
}
|
|
169
193
|
const agentConfig = AGENTS[agent];
|
|
170
194
|
const ext = agentConfig.format === 'toml' ? '.toml' : '.md';
|
|
171
195
|
const installedPath = path.join(getVersionCommandsDir(agent, version), `${commandName}${ext}`);
|
|
@@ -220,6 +244,14 @@ export function installCommandToVersion(agent, version, commandName, method = 'c
|
|
|
220
244
|
if (!fs.existsSync(sourcePath)) {
|
|
221
245
|
return { success: false, error: `Command '${commandName}' not found in central` };
|
|
222
246
|
}
|
|
247
|
+
const versionHome = getVersionHomePath(agent, version);
|
|
248
|
+
const agentDir = path.join(versionHome, `.${agent}`);
|
|
249
|
+
if (shouldInstallCommandAsSkill(agent, version)) {
|
|
250
|
+
return installCommandSkillToVersion(agentDir, commandName, sourcePath, [
|
|
251
|
+
getSkillsDir(),
|
|
252
|
+
...getEnabledExtraRepos().map((repo) => path.join(repo.dir, 'skills')),
|
|
253
|
+
]);
|
|
254
|
+
}
|
|
223
255
|
const agentConfig = AGENTS[agent];
|
|
224
256
|
const commandsDir = getVersionCommandsDir(agent, version);
|
|
225
257
|
fs.mkdirSync(commandsDir, { recursive: true });
|
|
@@ -249,6 +281,11 @@ export function installCommandToVersion(agent, version, commandName, method = 'c
|
|
|
249
281
|
* Remove a single command from a specific version home.
|
|
250
282
|
*/
|
|
251
283
|
export function removeCommandFromVersion(agent, version, commandName) {
|
|
284
|
+
const versionHome = getVersionHomePath(agent, version);
|
|
285
|
+
const agentDir = path.join(versionHome, `.${agent}`);
|
|
286
|
+
if (shouldInstallCommandAsSkill(agent, version)) {
|
|
287
|
+
return removeCommandSkillFromVersion(agentDir, commandName);
|
|
288
|
+
}
|
|
252
289
|
const ext = AGENTS[agent].format === 'toml' ? '.toml' : '.md';
|
|
253
290
|
const targetPath = path.join(getVersionCommandsDir(agent, version), `${commandName}${ext}`);
|
|
254
291
|
if (!fs.existsSync(targetPath) && !fs.lstatSync(targetPath, { throwIfNoEntry: false })) {
|
|
@@ -281,6 +318,7 @@ export function iterCommandsCapableVersions(filter) {
|
|
|
281
318
|
}
|
|
282
319
|
return pairs;
|
|
283
320
|
}
|
|
321
|
+
/** Remove a command from an agent's config directory. */
|
|
284
322
|
export function uninstallCommand(agentId, commandName) {
|
|
285
323
|
const agent = AGENTS[agentId];
|
|
286
324
|
const home = getEffectiveHome(agentId);
|
|
@@ -293,6 +331,7 @@ export function uninstallCommand(agentId, commandName) {
|
|
|
293
331
|
}
|
|
294
332
|
return false;
|
|
295
333
|
}
|
|
334
|
+
/** List command names installed for an agent in the active version home. */
|
|
296
335
|
export function listInstalledCommands(agentId) {
|
|
297
336
|
const agent = AGENTS[agentId];
|
|
298
337
|
const home = getEffectiveHome(agentId);
|
|
@@ -448,7 +487,7 @@ export function installCommandCentrally(sourcePath, commandName) {
|
|
|
448
487
|
warnings: validation.warnings,
|
|
449
488
|
};
|
|
450
489
|
}
|
|
451
|
-
const centralDir =
|
|
490
|
+
const centralDir = getUserCommandsDir();
|
|
452
491
|
if (!fs.existsSync(centralDir)) {
|
|
453
492
|
fs.mkdirSync(centralDir, { recursive: true });
|
|
454
493
|
}
|
|
@@ -466,17 +505,19 @@ export function installCommandCentrally(sourcePath, commandName) {
|
|
|
466
505
|
}
|
|
467
506
|
}
|
|
468
507
|
/**
|
|
469
|
-
* List commands from
|
|
508
|
+
* List commands from user (~/.agents/commands/) and system (~/.agents-system/commands/) dirs.
|
|
509
|
+
* User dir takes priority; deduplication preserves first occurrence.
|
|
470
510
|
*/
|
|
471
511
|
export function listCentralCommands() {
|
|
472
|
-
const
|
|
473
|
-
|
|
474
|
-
|
|
512
|
+
const seen = new Set();
|
|
513
|
+
for (const dir of [getUserCommandsDir(), getCommandsDir()]) {
|
|
514
|
+
if (!fs.existsSync(dir))
|
|
515
|
+
continue;
|
|
516
|
+
for (const f of fs.readdirSync(dir).filter((f) => f.endsWith('.md'))) {
|
|
517
|
+
seen.add(f.replace('.md', ''));
|
|
518
|
+
}
|
|
475
519
|
}
|
|
476
|
-
return
|
|
477
|
-
.readdirSync(centralDir)
|
|
478
|
-
.filter((f) => f.endsWith('.md'))
|
|
479
|
-
.map((f) => f.replace('.md', ''));
|
|
520
|
+
return Array.from(seen);
|
|
480
521
|
}
|
|
481
522
|
/**
|
|
482
523
|
* Get detailed info about a command from central storage.
|
|
@@ -496,4 +537,3 @@ export function getCommandInfo(name) {
|
|
|
496
537
|
content,
|
|
497
538
|
};
|
|
498
539
|
}
|
|
499
|
-
//# sourceMappingURL=commands.js.map
|
package/dist/lib/convert.d.ts
CHANGED
|
@@ -1,11 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Format conversion between Markdown (Claude/Codex) and TOML (Gemini) command files.
|
|
3
|
+
*
|
|
4
|
+
* Handles frontmatter parsing and bidirectional translation so that slash commands
|
|
5
|
+
* authored in one format can be synced to agents that expect the other.
|
|
6
|
+
*/
|
|
7
|
+
/** Parsed YAML frontmatter from a Markdown command file. */
|
|
1
8
|
export interface MarkdownFrontmatter {
|
|
2
9
|
description?: string;
|
|
3
10
|
[key: string]: unknown;
|
|
4
11
|
}
|
|
12
|
+
/** Extract YAML frontmatter and body from a Markdown string. Returns empty frontmatter if none found. */
|
|
5
13
|
export declare function parseMarkdownFrontmatter(content: string): {
|
|
6
14
|
frontmatter: MarkdownFrontmatter;
|
|
7
15
|
body: string;
|
|
8
16
|
};
|
|
17
|
+
/** Convert a Markdown command file to Gemini's TOML format, translating $ARGUMENTS to {{args}}. */
|
|
9
18
|
export declare function markdownToToml(skillName: string, markdown: string): string;
|
|
19
|
+
/** Convert a Gemini TOML command file back to Markdown format, translating {{args}} to $ARGUMENTS. */
|
|
10
20
|
export declare function tomlToMarkdown(toml: string): string;
|
|
11
|
-
//# sourceMappingURL=convert.d.ts.map
|