@swarmify/agents-cli 1.13.4 → 1.14.0
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/README.md +2 -319
- package/bin/agents.js +2 -0
- package/package.json +13 -79
- package/scripts/postinstall.js +4 -71
- package/CHANGELOG.md +0 -316
- package/LICENSE +0 -21
- package/dist/commands/__tests__/sessions-tail.test.d.ts +0 -2
- package/dist/commands/__tests__/sessions-tail.test.d.ts.map +0 -1
- package/dist/commands/__tests__/sessions-tail.test.js +0 -108
- package/dist/commands/__tests__/sessions-tail.test.js.map +0 -1
- 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 +0 -11
- package/dist/commands/cloud.d.ts.map +0 -1
- package/dist/commands/cloud.js +0 -363
- package/dist/commands/cloud.js.map +0 -1
- package/dist/commands/commands.d.ts +0 -12
- package/dist/commands/commands.d.ts.map +0 -1
- package/dist/commands/commands.js +0 -629
- package/dist/commands/commands.js.map +0 -1
- package/dist/commands/daemon.d.ts +0 -11
- package/dist/commands/daemon.d.ts.map +0 -1
- package/dist/commands/daemon.js +0 -119
- package/dist/commands/daemon.js.map +0 -1
- package/dist/commands/drive.d.ts +0 -11
- package/dist/commands/drive.d.ts.map +0 -1
- package/dist/commands/drive.js +0 -175
- package/dist/commands/drive.js.map +0 -1
- package/dist/commands/exec.d.ts +0 -11
- package/dist/commands/exec.d.ts.map +0 -1
- package/dist/commands/exec.js +0 -251
- package/dist/commands/exec.js.map +0 -1
- package/dist/commands/factory.d.ts +0 -11
- package/dist/commands/factory.d.ts.map +0 -1
- package/dist/commands/factory.js +0 -445
- package/dist/commands/factory.js.map +0 -1
- package/dist/commands/fork.d.ts +0 -11
- package/dist/commands/fork.d.ts.map +0 -1
- package/dist/commands/fork.js +0 -147
- package/dist/commands/fork.js.map +0 -1
- package/dist/commands/hooks.d.ts +0 -12
- package/dist/commands/hooks.d.ts.map +0 -1
- package/dist/commands/hooks.js +0 -690
- package/dist/commands/hooks.js.map +0 -1
- package/dist/commands/init.d.ts +0 -15
- package/dist/commands/init.d.ts.map +0 -1
- package/dist/commands/init.js +0 -137
- package/dist/commands/init.js.map +0 -1
- package/dist/commands/mcp.d.ts +0 -12
- package/dist/commands/mcp.d.ts.map +0 -1
- package/dist/commands/mcp.js +0 -583
- package/dist/commands/mcp.js.map +0 -1
- package/dist/commands/models.d.ts +0 -11
- package/dist/commands/models.d.ts.map +0 -1
- package/dist/commands/models.js +0 -170
- package/dist/commands/models.js.map +0 -1
- package/dist/commands/packages.d.ts +0 -11
- package/dist/commands/packages.d.ts.map +0 -1
- package/dist/commands/packages.js +0 -551
- package/dist/commands/packages.js.map +0 -1
- package/dist/commands/permissions.d.ts +0 -12
- package/dist/commands/permissions.d.ts.map +0 -1
- package/dist/commands/permissions.js +0 -724
- package/dist/commands/permissions.js.map +0 -1
- package/dist/commands/plugins.d.ts +0 -11
- package/dist/commands/plugins.d.ts.map +0 -1
- package/dist/commands/plugins.js +0 -393
- package/dist/commands/plugins.js.map +0 -1
- package/dist/commands/profiles.d.ts +0 -12
- package/dist/commands/profiles.d.ts.map +0 -1
- package/dist/commands/profiles.js +0 -255
- package/dist/commands/profiles.js.map +0 -1
- package/dist/commands/pty.d.ts +0 -21
- package/dist/commands/pty.d.ts.map +0 -1
- package/dist/commands/pty.js +0 -391
- package/dist/commands/pty.js.map +0 -1
- package/dist/commands/pull.d.ts +0 -11
- package/dist/commands/pull.d.ts.map +0 -1
- package/dist/commands/pull.js +0 -456
- package/dist/commands/pull.js.map +0 -1
- package/dist/commands/push.d.ts +0 -11
- package/dist/commands/push.d.ts.map +0 -1
- package/dist/commands/push.js +0 -188
- package/dist/commands/push.js.map +0 -1
- package/dist/commands/refresh-memory.d.ts +0 -16
- package/dist/commands/refresh-memory.d.ts.map +0 -1
- package/dist/commands/refresh-memory.js +0 -52
- package/dist/commands/refresh-memory.js.map +0 -1
- package/dist/commands/resource-view.d.ts +0 -39
- package/dist/commands/resource-view.d.ts.map +0 -1
- package/dist/commands/resource-view.js +0 -197
- package/dist/commands/resource-view.js.map +0 -1
- package/dist/commands/routines.d.ts +0 -11
- package/dist/commands/routines.d.ts.map +0 -1
- package/dist/commands/routines.js +0 -590
- package/dist/commands/routines.js.map +0 -1
- package/dist/commands/rules.d.ts +0 -12
- package/dist/commands/rules.d.ts.map +0 -1
- package/dist/commands/rules.js +0 -489
- package/dist/commands/rules.js.map +0 -1
- package/dist/commands/secrets.d.ts +0 -11
- package/dist/commands/secrets.d.ts.map +0 -1
- package/dist/commands/secrets.js +0 -352
- package/dist/commands/secrets.js.map +0 -1
- package/dist/commands/sessions-picker.d.ts +0 -18
- package/dist/commands/sessions-picker.d.ts.map +0 -1
- package/dist/commands/sessions-picker.js +0 -265
- package/dist/commands/sessions-picker.js.map +0 -1
- package/dist/commands/sessions-tail.d.ts +0 -20
- package/dist/commands/sessions-tail.d.ts.map +0 -1
- package/dist/commands/sessions-tail.js +0 -236
- package/dist/commands/sessions-tail.js.map +0 -1
- package/dist/commands/sessions.d.ts +0 -18
- package/dist/commands/sessions.d.ts.map +0 -1
- package/dist/commands/sessions.js +0 -1173
- package/dist/commands/sessions.js.map +0 -1
- package/dist/commands/skills.d.ts +0 -12
- package/dist/commands/skills.d.ts.map +0 -1
- package/dist/commands/skills.js +0 -717
- package/dist/commands/skills.js.map +0 -1
- package/dist/commands/status.d.ts +0 -10
- package/dist/commands/status.d.ts.map +0 -1
- package/dist/commands/status.js +0 -26
- package/dist/commands/status.js.map +0 -1
- package/dist/commands/subagents.d.ts +0 -11
- package/dist/commands/subagents.d.ts.map +0 -1
- package/dist/commands/subagents.js +0 -361
- package/dist/commands/subagents.js.map +0 -1
- package/dist/commands/sync.d.ts +0 -11
- package/dist/commands/sync.d.ts.map +0 -1
- package/dist/commands/sync.js +0 -70
- package/dist/commands/sync.js.map +0 -1
- package/dist/commands/teams-picker.d.ts +0 -18
- package/dist/commands/teams-picker.d.ts.map +0 -1
- package/dist/commands/teams-picker.js +0 -290
- package/dist/commands/teams-picker.js.map +0 -1
- package/dist/commands/teams.d.ts +0 -18
- package/dist/commands/teams.d.ts.map +0 -1
- package/dist/commands/teams.js +0 -1144
- package/dist/commands/teams.js.map +0 -1
- package/dist/commands/utils.d.ts +0 -45
- package/dist/commands/utils.d.ts.map +0 -1
- package/dist/commands/utils.js +0 -106
- package/dist/commands/utils.js.map +0 -1
- package/dist/commands/versions.d.ts +0 -11
- package/dist/commands/versions.d.ts.map +0 -1
- package/dist/commands/versions.js +0 -701
- package/dist/commands/versions.js.map +0 -1
- package/dist/commands/view.d.ts +0 -43
- package/dist/commands/view.d.ts.map +0 -1
- package/dist/commands/view.js +0 -894
- package/dist/commands/view.js.map +0 -1
- package/dist/index.d.ts +0 -9
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -496
- 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 -57
- 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 +0 -158
- package/dist/lib/agents.d.ts.map +0 -1
- package/dist/lib/agents.js +0 -1159
- package/dist/lib/agents.js.map +0 -1
- package/dist/lib/artifact-actions.d.ts +0 -27
- package/dist/lib/artifact-actions.d.ts.map +0 -1
- package/dist/lib/artifact-actions.js +0 -58
- package/dist/lib/artifact-actions.js.map +0 -1
- package/dist/lib/cloud/codex.d.ts +0 -26
- package/dist/lib/cloud/codex.d.ts.map +0 -1
- package/dist/lib/cloud/codex.js +0 -237
- package/dist/lib/cloud/codex.js.map +0 -1
- package/dist/lib/cloud/factory.d.ts +0 -32
- package/dist/lib/cloud/factory.d.ts.map +0 -1
- package/dist/lib/cloud/factory.js +0 -43
- package/dist/lib/cloud/factory.js.map +0 -1
- package/dist/lib/cloud/registry.d.ts +0 -16
- package/dist/lib/cloud/registry.d.ts.map +0 -1
- package/dist/lib/cloud/registry.js +0 -68
- package/dist/lib/cloud/registry.js.map +0 -1
- package/dist/lib/cloud/rush.d.ts +0 -37
- package/dist/lib/cloud/rush.d.ts.map +0 -1
- package/dist/lib/cloud/rush.js +0 -230
- package/dist/lib/cloud/rush.js.map +0 -1
- package/dist/lib/cloud/rush.test.d.ts +0 -2
- package/dist/lib/cloud/rush.test.d.ts.map +0 -1
- package/dist/lib/cloud/rush.test.js +0 -63
- package/dist/lib/cloud/rush.test.js.map +0 -1
- package/dist/lib/cloud/store.d.ts +0 -23
- package/dist/lib/cloud/store.d.ts.map +0 -1
- package/dist/lib/cloud/store.js +0 -116
- package/dist/lib/cloud/store.js.map +0 -1
- package/dist/lib/cloud/stream.d.ts +0 -24
- package/dist/lib/cloud/stream.d.ts.map +0 -1
- package/dist/lib/cloud/stream.js +0 -145
- package/dist/lib/cloud/stream.js.map +0 -1
- package/dist/lib/cloud/types.d.ts +0 -109
- package/dist/lib/cloud/types.d.ts.map +0 -1
- package/dist/lib/cloud/types.js +0 -33
- package/dist/lib/cloud/types.js.map +0 -1
- package/dist/lib/cloud/types.test.d.ts +0 -2
- package/dist/lib/cloud/types.test.d.ts.map +0 -1
- package/dist/lib/cloud/types.test.js +0 -41
- package/dist/lib/cloud/types.test.js.map +0 -1
- package/dist/lib/commands.d.ts +0 -141
- package/dist/lib/commands.d.ts.map +0 -1
- package/dist/lib/commands.js +0 -514
- package/dist/lib/commands.js.map +0 -1
- package/dist/lib/convert.d.ts +0 -21
- package/dist/lib/convert.d.ts.map +0 -1
- package/dist/lib/convert.js +0 -54
- package/dist/lib/convert.js.map +0 -1
- package/dist/lib/daemon.d.ts +0 -43
- package/dist/lib/daemon.d.ts.map +0 -1
- package/dist/lib/daemon.js +0 -332
- package/dist/lib/daemon.js.map +0 -1
- package/dist/lib/drive-sync.d.ts +0 -46
- package/dist/lib/drive-sync.d.ts.map +0 -1
- package/dist/lib/drive-sync.js +0 -209
- package/dist/lib/drive-sync.js.map +0 -1
- package/dist/lib/exec.d.ts +0 -101
- package/dist/lib/exec.d.ts.map +0 -1
- package/dist/lib/exec.js +0 -450
- package/dist/lib/exec.js.map +0 -1
- package/dist/lib/factory/__tests__/config.test.d.ts +0 -2
- package/dist/lib/factory/__tests__/config.test.d.ts.map +0 -1
- package/dist/lib/factory/__tests__/config.test.js +0 -128
- package/dist/lib/factory/__tests__/config.test.js.map +0 -1
- package/dist/lib/factory/config.d.ts +0 -49
- package/dist/lib/factory/config.d.ts.map +0 -1
- package/dist/lib/factory/config.js +0 -127
- package/dist/lib/factory/config.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 -107
- package/dist/lib/factory.js.map +0 -1
- package/dist/lib/git.d.ts +0 -157
- package/dist/lib/git.d.ts.map +0 -1
- package/dist/lib/git.js +0 -647
- package/dist/lib/git.js.map +0 -1
- package/dist/lib/help.d.ts +0 -10
- package/dist/lib/help.d.ts.map +0 -1
- package/dist/lib/help.js +0 -66
- package/dist/lib/help.js.map +0 -1
- package/dist/lib/hooks.d.ts +0 -125
- package/dist/lib/hooks.d.ts.map +0 -1
- package/dist/lib/hooks.js +0 -846
- package/dist/lib/hooks.js.map +0 -1
- package/dist/lib/ledger/__tests__/local.test.d.ts +0 -2
- package/dist/lib/ledger/__tests__/local.test.d.ts.map +0 -1
- package/dist/lib/ledger/__tests__/local.test.js +0 -177
- package/dist/lib/ledger/__tests__/local.test.js.map +0 -1
- package/dist/lib/ledger/__tests__/sync.test.d.ts +0 -2
- package/dist/lib/ledger/__tests__/sync.test.d.ts.map +0 -1
- package/dist/lib/ledger/__tests__/sync.test.js +0 -117
- package/dist/lib/ledger/__tests__/sync.test.js.map +0 -1
- package/dist/lib/ledger/index.d.ts +0 -18
- package/dist/lib/ledger/index.d.ts.map +0 -1
- package/dist/lib/ledger/index.js +0 -32
- package/dist/lib/ledger/index.js.map +0 -1
- package/dist/lib/ledger/local.d.ts +0 -22
- package/dist/lib/ledger/local.d.ts.map +0 -1
- package/dist/lib/ledger/local.js +0 -333
- package/dist/lib/ledger/local.js.map +0 -1
- package/dist/lib/ledger/r2.d.ts +0 -41
- package/dist/lib/ledger/r2.d.ts.map +0 -1
- package/dist/lib/ledger/r2.js +0 -335
- package/dist/lib/ledger/r2.js.map +0 -1
- package/dist/lib/ledger/sync.d.ts +0 -33
- package/dist/lib/ledger/sync.d.ts.map +0 -1
- package/dist/lib/ledger/sync.js +0 -106
- package/dist/lib/ledger/sync.js.map +0 -1
- package/dist/lib/ledger/types.d.ts +0 -100
- package/dist/lib/ledger/types.d.ts.map +0 -1
- package/dist/lib/ledger/types.js +0 -21
- package/dist/lib/ledger/types.js.map +0 -1
- package/dist/lib/manifest.d.ts +0 -14
- package/dist/lib/manifest.d.ts.map +0 -1
- package/dist/lib/manifest.js +0 -48
- package/dist/lib/manifest.js.map +0 -1
- package/dist/lib/markdown.d.ts +0 -5
- package/dist/lib/markdown.d.ts.map +0 -1
- package/dist/lib/markdown.js +0 -17
- package/dist/lib/markdown.js.map +0 -1
- package/dist/lib/mcp.d.ts +0 -64
- package/dist/lib/mcp.d.ts.map +0 -1
- package/dist/lib/mcp.js +0 -327
- package/dist/lib/mcp.js.map +0 -1
- package/dist/lib/memory-compile.d.ts +0 -65
- package/dist/lib/memory-compile.d.ts.map +0 -1
- package/dist/lib/memory-compile.js +0 -174
- package/dist/lib/memory-compile.js.map +0 -1
- package/dist/lib/memory.d.ts +0 -64
- package/dist/lib/memory.d.ts.map +0 -1
- package/dist/lib/memory.js +0 -275
- package/dist/lib/memory.js.map +0 -1
- package/dist/lib/models.d.ts +0 -98
- package/dist/lib/models.d.ts.map +0 -1
- package/dist/lib/models.js +0 -728
- package/dist/lib/models.js.map +0 -1
- package/dist/lib/permissions.d.ts +0 -227
- package/dist/lib/permissions.d.ts.map +0 -1
- package/dist/lib/permissions.js +0 -1085
- package/dist/lib/permissions.js.map +0 -1
- package/dist/lib/picker.d.ts +0 -27
- package/dist/lib/picker.d.ts.map +0 -1
- package/dist/lib/picker.js +0 -110
- package/dist/lib/picker.js.map +0 -1
- package/dist/lib/plugins.d.ts +0 -80
- package/dist/lib/plugins.d.ts.map +0 -1
- package/dist/lib/plugins.js +0 -556
- package/dist/lib/plugins.js.map +0 -1
- package/dist/lib/profiles-keychain.d.ts +0 -11
- package/dist/lib/profiles-keychain.d.ts.map +0 -1
- package/dist/lib/profiles-keychain.js +0 -14
- package/dist/lib/profiles-keychain.js.map +0 -1
- package/dist/lib/profiles-presets.d.ts +0 -25
- package/dist/lib/profiles-presets.d.ts.map +0 -1
- package/dist/lib/profiles-presets.js +0 -104
- package/dist/lib/profiles-presets.js.map +0 -1
- package/dist/lib/profiles.d.ts +0 -70
- package/dist/lib/profiles.d.ts.map +0 -1
- package/dist/lib/profiles.js +0 -145
- package/dist/lib/profiles.js.map +0 -1
- package/dist/lib/pty-client.d.ts +0 -23
- package/dist/lib/pty-client.d.ts.map +0 -1
- package/dist/lib/pty-client.js +0 -181
- package/dist/lib/pty-client.js.map +0 -1
- package/dist/lib/pty-server.d.ts +0 -21
- package/dist/lib/pty-server.d.ts.map +0 -1
- package/dist/lib/pty-server.js +0 -427
- package/dist/lib/pty-server.js.map +0 -1
- package/dist/lib/registry.d.ts +0 -45
- package/dist/lib/registry.d.ts.map +0 -1
- package/dist/lib/registry.js +0 -220
- package/dist/lib/registry.js.map +0 -1
- package/dist/lib/resources.d.ts +0 -55
- package/dist/lib/resources.d.ts.map +0 -1
- package/dist/lib/resources.js +0 -103
- package/dist/lib/resources.js.map +0 -1
- package/dist/lib/rotate.d.ts +0 -58
- package/dist/lib/rotate.d.ts.map +0 -1
- package/dist/lib/rotate.js +0 -93
- package/dist/lib/rotate.js.map +0 -1
- package/dist/lib/routines.d.ts +0 -99
- package/dist/lib/routines.d.ts.map +0 -1
- package/dist/lib/routines.js +0 -352
- package/dist/lib/routines.js.map +0 -1
- package/dist/lib/runner.d.ts +0 -26
- package/dist/lib/runner.d.ts.map +0 -1
- package/dist/lib/runner.js +0 -325
- package/dist/lib/runner.js.map +0 -1
- package/dist/lib/sandbox.d.ts +0 -26
- package/dist/lib/sandbox.d.ts.map +0 -1
- package/dist/lib/sandbox.js +0 -218
- package/dist/lib/sandbox.js.map +0 -1
- package/dist/lib/scheduler.d.ts +0 -26
- package/dist/lib/scheduler.d.ts.map +0 -1
- package/dist/lib/scheduler.js +0 -77
- package/dist/lib/scheduler.js.map +0 -1
- package/dist/lib/secrets-bundles.d.ts +0 -38
- package/dist/lib/secrets-bundles.d.ts.map +0 -1
- package/dist/lib/secrets-bundles.js +0 -176
- package/dist/lib/secrets-bundles.js.map +0 -1
- package/dist/lib/secrets.d.ts +0 -53
- package/dist/lib/secrets.d.ts.map +0 -1
- package/dist/lib/secrets.js +0 -140
- 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/active.d.ts +0 -44
- package/dist/lib/session/active.d.ts.map +0 -1
- package/dist/lib/session/active.js +0 -379
- package/dist/lib/session/active.js.map +0 -1
- package/dist/lib/session/artifacts.d.ts +0 -15
- package/dist/lib/session/artifacts.d.ts.map +0 -1
- package/dist/lib/session/artifacts.js +0 -86
- package/dist/lib/session/artifacts.js.map +0 -1
- package/dist/lib/session/db.d.ts +0 -140
- package/dist/lib/session/db.d.ts.map +0 -1
- package/dist/lib/session/db.js +0 -599
- package/dist/lib/session/db.js.map +0 -1
- package/dist/lib/session/discover.d.ts +0 -72
- package/dist/lib/session/discover.d.ts.map +0 -1
- package/dist/lib/session/discover.js +0 -1315
- package/dist/lib/session/discover.js.map +0 -1
- package/dist/lib/session/parse.d.ts +0 -34
- package/dist/lib/session/parse.d.ts.map +0 -1
- package/dist/lib/session/parse.js +0 -663
- package/dist/lib/session/parse.js.map +0 -1
- package/dist/lib/session/prompt.d.ts +0 -13
- package/dist/lib/session/prompt.d.ts.map +0 -1
- package/dist/lib/session/prompt.js +0 -79
- 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 +0 -103
- package/dist/lib/session/render.d.ts.map +0 -1
- package/dist/lib/session/render.js +0 -798
- package/dist/lib/session/render.js.map +0 -1
- package/dist/lib/session/team-filter.d.ts +0 -35
- package/dist/lib/session/team-filter.d.ts.map +0 -1
- package/dist/lib/session/team-filter.js +0 -75
- 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 +0 -84
- package/dist/lib/session/types.d.ts.map +0 -1
- package/dist/lib/session/types.js +0 -11
- package/dist/lib/session/types.js.map +0 -1
- package/dist/lib/shims.d.ts +0 -272
- package/dist/lib/shims.d.ts.map +0 -1
- package/dist/lib/shims.js +0 -1322
- package/dist/lib/shims.js.map +0 -1
- package/dist/lib/skills.d.ts +0 -142
- package/dist/lib/skills.d.ts.map +0 -1
- package/dist/lib/skills.js +0 -791
- package/dist/lib/skills.js.map +0 -1
- package/dist/lib/state.d.ts +0 -87
- package/dist/lib/state.d.ts.map +0 -1
- package/dist/lib/state.js +0 -333
- package/dist/lib/state.js.map +0 -1
- package/dist/lib/subagents.d.ts +0 -84
- package/dist/lib/subagents.d.ts.map +0 -1
- package/dist/lib/subagents.js +0 -410
- package/dist/lib/subagents.js.map +0 -1
- package/dist/lib/teams/__tests__/oracle.test.d.ts +0 -2
- package/dist/lib/teams/__tests__/oracle.test.d.ts.map +0 -1
- package/dist/lib/teams/__tests__/oracle.test.js +0 -89
- package/dist/lib/teams/__tests__/oracle.test.js.map +0 -1
- package/dist/lib/teams/__tests__/supervisor.test.d.ts +0 -2
- package/dist/lib/teams/__tests__/supervisor.test.d.ts.map +0 -1
- package/dist/lib/teams/__tests__/supervisor.test.js +0 -179
- package/dist/lib/teams/__tests__/supervisor.test.js.map +0 -1
- package/dist/lib/teams/agents.d.ts +0 -247
- package/dist/lib/teams/agents.d.ts.map +0 -1
- package/dist/lib/teams/agents.js +0 -1244
- package/dist/lib/teams/agents.js.map +0 -1
- package/dist/lib/teams/api.d.ts +0 -91
- package/dist/lib/teams/api.d.ts.map +0 -1
- package/dist/lib/teams/api.js +0 -239
- 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 +0 -8
- package/dist/lib/teams/debug.d.ts.map +0 -1
- package/dist/lib/teams/debug.js +0 -12
- package/dist/lib/teams/debug.js.map +0 -1
- package/dist/lib/teams/file_ops.d.ts +0 -13
- package/dist/lib/teams/file_ops.d.ts.map +0 -1
- package/dist/lib/teams/file_ops.js +0 -66
- package/dist/lib/teams/file_ops.js.map +0 -1
- package/dist/lib/teams/index.d.ts +0 -16
- package/dist/lib/teams/index.d.ts.map +0 -1
- package/dist/lib/teams/index.js +0 -15
- package/dist/lib/teams/index.js.map +0 -1
- package/dist/lib/teams/oracle.d.ts +0 -20
- package/dist/lib/teams/oracle.d.ts.map +0 -1
- package/dist/lib/teams/oracle.js +0 -59
- package/dist/lib/teams/oracle.js.map +0 -1
- package/dist/lib/teams/parsers.d.ts +0 -9
- package/dist/lib/teams/parsers.d.ts.map +0 -1
- package/dist/lib/teams/parsers.js +0 -837
- package/dist/lib/teams/parsers.js.map +0 -1
- package/dist/lib/teams/persistence.d.ts +0 -43
- package/dist/lib/teams/persistence.d.ts.map +0 -1
- package/dist/lib/teams/persistence.js +0 -299
- 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 +0 -18
- package/dist/lib/teams/registry.d.ts.map +0 -1
- package/dist/lib/teams/registry.js +0 -68
- package/dist/lib/teams/registry.js.map +0 -1
- package/dist/lib/teams/summarizer.d.ts +0 -73
- package/dist/lib/teams/summarizer.d.ts.map +0 -1
- package/dist/lib/teams/summarizer.js +0 -780
- package/dist/lib/teams/summarizer.js.map +0 -1
- package/dist/lib/teams/supervisor.d.ts +0 -49
- package/dist/lib/teams/supervisor.d.ts.map +0 -1
- package/dist/lib/teams/supervisor.js +0 -74
- package/dist/lib/teams/supervisor.js.map +0 -1
- package/dist/lib/template.d.ts +0 -27
- package/dist/lib/template.d.ts.map +0 -1
- package/dist/lib/template.js +0 -60
- package/dist/lib/template.js.map +0 -1
- package/dist/lib/types.d.ts +0 -331
- package/dist/lib/types.d.ts.map +0 -1
- package/dist/lib/types.js +0 -29
- package/dist/lib/types.js.map +0 -1
- package/dist/lib/usage.d.ts +0 -105
- package/dist/lib/usage.d.ts.map +0 -1
- package/dist/lib/usage.js +0 -686
- package/dist/lib/usage.js.map +0 -1
- package/dist/lib/versions.d.ts +0 -253
- package/dist/lib/versions.d.ts.map +0 -1
- package/dist/lib/versions.js +0 -1796
- package/dist/lib/versions.js.map +0 -1
- package/scripts/rebuild-sqlite.sh +0 -46
package/dist/commands/hooks.js
DELETED
|
@@ -1,690 +0,0 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
2
|
-
import ora from 'ora';
|
|
3
|
-
import * as fs from 'fs';
|
|
4
|
-
import * as os from 'os';
|
|
5
|
-
import * as path from 'path';
|
|
6
|
-
import { checkbox, confirm } from '@inquirer/prompts';
|
|
7
|
-
import { AGENTS, HOOKS_CAPABLE_AGENTS, CODEX_HOOKS_MIN_VERSION, resolveAgentName, formatAgentError, agentLabel, } from '../lib/agents.js';
|
|
8
|
-
import { cloneRepo } from '../lib/git.js';
|
|
9
|
-
import { discoverHooksFromRepo, installHooksCentrally, listCentralHooks, listInstalledHooksWithScope, removeHook, getHookInfo, parseHookManifest, diffVersionHooks, installHookToVersion, removeHookFromVersion, iterHooksCapableVersions, } from '../lib/hooks.js';
|
|
10
|
-
import { listInstalledVersions, getGlobalDefault, syncResourcesToVersion, promptAgentVersionSelection, getVersionHomePath, resolveAgentVersionTargets, compareVersions, } from '../lib/versions.js';
|
|
11
|
-
import { recordVersionResources } from '../lib/state.js';
|
|
12
|
-
import { isPromptCancelled, isInteractiveTerminal, parseCommaSeparatedList, printWithPager, requireInteractiveSelection, } from './utils.js';
|
|
13
|
-
/** Register the `agents hooks` command tree (list, add, remove, sync, prune, view). */
|
|
14
|
-
export function registerHooksCommands(program) {
|
|
15
|
-
const hooksCmd = program.command('hooks')
|
|
16
|
-
.description('Automate workflows by running shell scripts in response to agent events')
|
|
17
|
-
.addHelpText('after', `
|
|
18
|
-
Hooks are shell scripts that fire on agent events: when a session starts, when files are edited, when a task completes. Use them to trigger builds, sync logs, notify Slack, or integrate agents into existing tooling.
|
|
19
|
-
|
|
20
|
-
Examples:
|
|
21
|
-
# List registered hooks
|
|
22
|
-
agents hooks list
|
|
23
|
-
|
|
24
|
-
# Check hooks for a specific agent
|
|
25
|
-
agents hooks list claude@2.1.112
|
|
26
|
-
|
|
27
|
-
# Install hooks from GitHub
|
|
28
|
-
agents hooks add gh:team/hooks --agents claude,codex
|
|
29
|
-
|
|
30
|
-
# Interactive: pick from ~/.agents/hooks/
|
|
31
|
-
agents hooks add
|
|
32
|
-
|
|
33
|
-
# Install a specific hook by name
|
|
34
|
-
agents hooks add --names post-edit --agents claude
|
|
35
|
-
|
|
36
|
-
When to use:
|
|
37
|
-
- CI integration: hook into pre-commit events to block unsafe operations
|
|
38
|
-
- Logging: capture session transcripts with a post-session hook
|
|
39
|
-
- Notifications: ping Slack when agents complete long tasks
|
|
40
|
-
- Team workflows: sync hooks via 'agents hooks add gh:team/hooks'
|
|
41
|
-
`);
|
|
42
|
-
hooksCmd
|
|
43
|
-
.command('list [agent]')
|
|
44
|
-
.description('Show which hooks are installed and which events they respond to')
|
|
45
|
-
.option('-a, --agent <agent>', 'Filter to a specific agent (alternative to positional arg)')
|
|
46
|
-
.option('-s, --scope <scope>', 'user (global), project (repo), or all', 'all')
|
|
47
|
-
.action(async (agentArg, options) => {
|
|
48
|
-
const spinner = ora({ text: 'Loading...', isSilent: !process.stdout.isTTY }).start();
|
|
49
|
-
const cwd = process.cwd();
|
|
50
|
-
// Parse agent input - handle agent@version syntax
|
|
51
|
-
const agentInput = agentArg || options.agent;
|
|
52
|
-
let agentId = null;
|
|
53
|
-
let requestedVersion = null;
|
|
54
|
-
if (agentInput) {
|
|
55
|
-
const parts = agentInput.split('@');
|
|
56
|
-
const agentName = parts[0];
|
|
57
|
-
requestedVersion = parts[1] || null;
|
|
58
|
-
agentId = resolveAgentName(agentName);
|
|
59
|
-
if (!agentId) {
|
|
60
|
-
spinner.stop();
|
|
61
|
-
console.log(chalk.red(formatAgentError(agentName, [...HOOKS_CAPABLE_AGENTS])));
|
|
62
|
-
process.exit(1);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
// Load hook manifest for event display
|
|
66
|
-
const hookManifest = parseHookManifest();
|
|
67
|
-
// Helper: get events for a hook name from manifest
|
|
68
|
-
const getHookEvents = (hookName) => {
|
|
69
|
-
// Try exact match, then try without extension
|
|
70
|
-
for (const [, def] of Object.entries(hookManifest)) {
|
|
71
|
-
const scriptBase = def.script.replace(/\.[^.]+$/, '');
|
|
72
|
-
if (def.script === hookName || scriptBase === hookName || hookName.replace(/\.[^.]+$/, '') === scriptBase) {
|
|
73
|
-
return def.events || [];
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
return [];
|
|
77
|
-
};
|
|
78
|
-
// Helper to render hooks for a specific version
|
|
79
|
-
const renderVersionHooks = (agentId, version, isDefault, home) => {
|
|
80
|
-
const agent = AGENTS[agentId];
|
|
81
|
-
const defaultLabel = isDefault ? ' default' : '';
|
|
82
|
-
const versionStr = chalk.gray(` (${version}${defaultLabel})`);
|
|
83
|
-
if (!agent.supportsHooks) {
|
|
84
|
-
console.log(` ${chalk.bold(agentLabel(agent.id))} (${version}${defaultLabel}): ${chalk.gray('hooks not supported')}`);
|
|
85
|
-
console.log();
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
// Version gate for Codex hooks
|
|
89
|
-
if (agentId === 'codex' && compareVersions(version, CODEX_HOOKS_MIN_VERSION) < 0) {
|
|
90
|
-
console.log(` ${chalk.bold(agentLabel(agentId))}${versionStr}: ${chalk.gray(`unsupported (codex@${version} < ${CODEX_HOOKS_MIN_VERSION})`)}`);
|
|
91
|
-
console.log();
|
|
92
|
-
return;
|
|
93
|
-
}
|
|
94
|
-
const hooks = listInstalledHooksWithScope(agentId, cwd, { home }).filter((h) => options.scope === 'all' || h.scope === options.scope);
|
|
95
|
-
if (hooks.length === 0) {
|
|
96
|
-
console.log(` ${chalk.bold(agentLabel(agent.id))}${versionStr}: ${chalk.gray('none')}`);
|
|
97
|
-
}
|
|
98
|
-
else {
|
|
99
|
-
console.log(` ${chalk.bold(agentLabel(agent.id))}${versionStr}:`);
|
|
100
|
-
const userHooks = hooks.filter((h) => h.scope === 'user');
|
|
101
|
-
const projectHooks = hooks.filter((h) => h.scope === 'project');
|
|
102
|
-
if (userHooks.length > 0 && (options.scope === 'all' || options.scope === 'user')) {
|
|
103
|
-
console.log(` ${chalk.gray('User:')}`);
|
|
104
|
-
for (const hook of userHooks) {
|
|
105
|
-
const events = getHookEvents(hook.name);
|
|
106
|
-
const eventStr = events.length > 0
|
|
107
|
-
? chalk.gray(` [${events.join(', ')}]`)
|
|
108
|
-
: '';
|
|
109
|
-
console.log(` ${chalk.cyan(hook.name.padEnd(28))}${eventStr}`);
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
if (projectHooks.length > 0 && (options.scope === 'all' || options.scope === 'project')) {
|
|
113
|
-
console.log(` ${chalk.gray('Project:')}`);
|
|
114
|
-
for (const hook of projectHooks) {
|
|
115
|
-
const events = getHookEvents(hook.name);
|
|
116
|
-
const eventStr = events.length > 0
|
|
117
|
-
? chalk.gray(` [${events.join(', ')}]`)
|
|
118
|
-
: '';
|
|
119
|
-
console.log(` ${chalk.yellow(hook.name.padEnd(28))}${eventStr}`);
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
console.log();
|
|
124
|
-
};
|
|
125
|
-
spinner.stop();
|
|
126
|
-
// Single agent specified - show versions based on requestedVersion
|
|
127
|
-
if (agentId) {
|
|
128
|
-
const agent = AGENTS[agentId];
|
|
129
|
-
const installedVersions = listInstalledVersions(agentId);
|
|
130
|
-
const defaultVer = getGlobalDefault(agentId);
|
|
131
|
-
if (installedVersions.length === 0) {
|
|
132
|
-
// Not version-managed
|
|
133
|
-
console.log(chalk.bold(`Installed Hooks for ${agentLabel(agent.id)}\n`));
|
|
134
|
-
if (!agent.supportsHooks) {
|
|
135
|
-
console.log(` ${chalk.bold(agentLabel(agent.id))}: ${chalk.gray('hooks not supported')}`);
|
|
136
|
-
}
|
|
137
|
-
else {
|
|
138
|
-
const hooks = listInstalledHooksWithScope(agentId, cwd).filter((h) => options.scope === 'all' || h.scope === options.scope);
|
|
139
|
-
if (hooks.length === 0) {
|
|
140
|
-
console.log(` ${chalk.bold(agentLabel(agent.id))}: ${chalk.gray('none')}`);
|
|
141
|
-
}
|
|
142
|
-
else {
|
|
143
|
-
console.log(` ${chalk.bold(agentLabel(agent.id))}:`);
|
|
144
|
-
const userHooks = hooks.filter((h) => h.scope === 'user');
|
|
145
|
-
if (userHooks.length > 0) {
|
|
146
|
-
console.log(` ${chalk.gray('User:')}`);
|
|
147
|
-
for (const hook of userHooks) {
|
|
148
|
-
console.log(` ${chalk.cyan(hook.name.padEnd(20))}`);
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
return;
|
|
154
|
-
}
|
|
155
|
-
console.log(chalk.bold(`Installed Hooks for ${agentLabel(agent.id)}\n`));
|
|
156
|
-
let versionsToShow;
|
|
157
|
-
if (requestedVersion === 'default') {
|
|
158
|
-
if (!defaultVer) {
|
|
159
|
-
console.log(chalk.yellow(` No default version set for ${agentLabel(agent.id)}. Run: agents use ${agentId}@<version>`));
|
|
160
|
-
return;
|
|
161
|
-
}
|
|
162
|
-
versionsToShow = [defaultVer];
|
|
163
|
-
}
|
|
164
|
-
else if (requestedVersion) {
|
|
165
|
-
if (!installedVersions.includes(requestedVersion)) {
|
|
166
|
-
console.log(chalk.red(` Version ${requestedVersion} not installed for ${agentLabel(agent.id)}.`));
|
|
167
|
-
console.log(chalk.gray(` Installed versions: ${installedVersions.join(', ')}`));
|
|
168
|
-
return;
|
|
169
|
-
}
|
|
170
|
-
versionsToShow = [requestedVersion];
|
|
171
|
-
}
|
|
172
|
-
else {
|
|
173
|
-
versionsToShow = [...installedVersions].sort((a, b) => {
|
|
174
|
-
if (a === defaultVer)
|
|
175
|
-
return -1;
|
|
176
|
-
if (b === defaultVer)
|
|
177
|
-
return 1;
|
|
178
|
-
return 0;
|
|
179
|
-
});
|
|
180
|
-
}
|
|
181
|
-
for (const version of versionsToShow) {
|
|
182
|
-
const home = getVersionHomePath(agentId, version);
|
|
183
|
-
renderVersionHooks(agentId, version, version === defaultVer, home);
|
|
184
|
-
}
|
|
185
|
-
return;
|
|
186
|
-
}
|
|
187
|
-
// No agent specified - show default version for each hooks-capable agent
|
|
188
|
-
console.log(chalk.bold('Installed Hooks\n'));
|
|
189
|
-
for (const aid of HOOKS_CAPABLE_AGENTS) {
|
|
190
|
-
const agent = AGENTS[aid];
|
|
191
|
-
const installedVersions = listInstalledVersions(aid);
|
|
192
|
-
const defaultVer = getGlobalDefault(aid);
|
|
193
|
-
if (installedVersions.length > 0 && defaultVer) {
|
|
194
|
-
const home = getVersionHomePath(aid, defaultVer);
|
|
195
|
-
renderVersionHooks(aid, defaultVer, true, home);
|
|
196
|
-
}
|
|
197
|
-
else {
|
|
198
|
-
// Not version-managed or no default
|
|
199
|
-
if (!agent.supportsHooks) {
|
|
200
|
-
console.log(` ${chalk.bold(agentLabel(aid))}: ${chalk.gray('hooks not supported')}`);
|
|
201
|
-
}
|
|
202
|
-
else {
|
|
203
|
-
const hooks = listInstalledHooksWithScope(aid, cwd).filter((h) => options.scope === 'all' || h.scope === options.scope);
|
|
204
|
-
if (hooks.length === 0) {
|
|
205
|
-
console.log(` ${chalk.bold(agentLabel(aid))}: ${chalk.gray('none')}`);
|
|
206
|
-
}
|
|
207
|
-
else {
|
|
208
|
-
console.log(` ${chalk.bold(agentLabel(aid))}:`);
|
|
209
|
-
const userHooks = hooks.filter((h) => h.scope === 'user');
|
|
210
|
-
if (userHooks.length > 0) {
|
|
211
|
-
console.log(` ${chalk.gray('User:')}`);
|
|
212
|
-
for (const hook of userHooks) {
|
|
213
|
-
console.log(` ${chalk.cyan(hook.name.padEnd(20))}`);
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
console.log();
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
});
|
|
222
|
-
hooksCmd
|
|
223
|
-
.command('add [source]')
|
|
224
|
-
.description('Install hooks from a source (GitHub, local) or pick from central storage')
|
|
225
|
-
.option('-a, --agents <list>', 'Targets: claude, codex@0.116.0, or gemini@default')
|
|
226
|
-
.option('--names <list>', 'Hook names from ~/.agents/hooks/ (comma-separated)')
|
|
227
|
-
.option('-y, --yes', 'Skip all prompts')
|
|
228
|
-
.addHelpText('after', `
|
|
229
|
-
Examples:
|
|
230
|
-
# Interactive picker from ~/.agents/hooks/
|
|
231
|
-
agents hooks add
|
|
232
|
-
|
|
233
|
-
# Install specific hooks by name
|
|
234
|
-
agents hooks add --names post-edit --agents claude@2.1.112
|
|
235
|
-
|
|
236
|
-
# Clone and install from GitHub
|
|
237
|
-
agents hooks add gh:user/repo --agents claude,codex
|
|
238
|
-
|
|
239
|
-
# Add from local directory
|
|
240
|
-
agents hooks add ~/my-hooks --agents claude@default
|
|
241
|
-
`)
|
|
242
|
-
.action(async (source, options) => {
|
|
243
|
-
try {
|
|
244
|
-
let hooks;
|
|
245
|
-
if (!source) {
|
|
246
|
-
// Interactive mode: pick from central storage
|
|
247
|
-
const centralHooks = listCentralHooks();
|
|
248
|
-
if (centralHooks.length === 0) {
|
|
249
|
-
console.log(chalk.yellow('No hooks in ~/.agents/hooks/'));
|
|
250
|
-
console.log(chalk.gray('\nTo add hooks from a repo:'));
|
|
251
|
-
console.log(chalk.cyan(' agents hooks add gh:user/repo'));
|
|
252
|
-
return;
|
|
253
|
-
}
|
|
254
|
-
const availableHooks = centralHooks.map((hook) => hook.name);
|
|
255
|
-
const requestedNames = parseCommaSeparatedList(options.names);
|
|
256
|
-
if (requestedNames.length > 0) {
|
|
257
|
-
const missing = requestedNames.filter((name) => !availableHooks.includes(name));
|
|
258
|
-
if (missing.length > 0) {
|
|
259
|
-
console.log(chalk.red(`Unknown hook(s): ${missing.join(', ')}`));
|
|
260
|
-
console.log(chalk.gray(`Available: ${availableHooks.join(', ')}`));
|
|
261
|
-
process.exit(1);
|
|
262
|
-
}
|
|
263
|
-
hooks = requestedNames;
|
|
264
|
-
}
|
|
265
|
-
else {
|
|
266
|
-
if (!isInteractiveTerminal()) {
|
|
267
|
-
requireInteractiveSelection('Selecting hooks from ~/.agents/hooks/', [
|
|
268
|
-
'agents hooks add --names post-edit --agents claude',
|
|
269
|
-
'agents hooks add gh:user/repo --agents claude',
|
|
270
|
-
]);
|
|
271
|
-
}
|
|
272
|
-
const choices = centralHooks.map((hook) => ({
|
|
273
|
-
value: hook.name,
|
|
274
|
-
name: hook.name,
|
|
275
|
-
}));
|
|
276
|
-
const selected = await checkbox({
|
|
277
|
-
message: 'Select hooks to install',
|
|
278
|
-
choices: [
|
|
279
|
-
{ value: '__all__', name: chalk.bold('Select All') },
|
|
280
|
-
...choices,
|
|
281
|
-
],
|
|
282
|
-
});
|
|
283
|
-
if (selected.length === 0) {
|
|
284
|
-
console.log(chalk.gray('No hooks selected.'));
|
|
285
|
-
return;
|
|
286
|
-
}
|
|
287
|
-
hooks = selected.includes('__all__')
|
|
288
|
-
? availableHooks
|
|
289
|
-
: selected.filter((s) => s !== '__all__');
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
else {
|
|
293
|
-
// Source provided: fetch from repo or local path
|
|
294
|
-
const spinner = ora('Fetching hooks...').start();
|
|
295
|
-
const isGitRepo = source.startsWith('gh:') || source.startsWith('git:') ||
|
|
296
|
-
source.startsWith('ssh:') || source.startsWith('https://') ||
|
|
297
|
-
source.startsWith('http://');
|
|
298
|
-
let localPath;
|
|
299
|
-
if (isGitRepo) {
|
|
300
|
-
const result = await cloneRepo(source);
|
|
301
|
-
localPath = result.localPath;
|
|
302
|
-
spinner.succeed('Repository cloned');
|
|
303
|
-
}
|
|
304
|
-
else {
|
|
305
|
-
localPath = source.startsWith('~')
|
|
306
|
-
? path.join(os.homedir(), source.slice(1))
|
|
307
|
-
: path.resolve(source);
|
|
308
|
-
if (!fs.existsSync(localPath)) {
|
|
309
|
-
spinner.fail(`Path not found: ${localPath}`);
|
|
310
|
-
return;
|
|
311
|
-
}
|
|
312
|
-
spinner.succeed('Using local path');
|
|
313
|
-
}
|
|
314
|
-
hooks = discoverHooksFromRepo(localPath);
|
|
315
|
-
console.log(chalk.bold(`\nFound ${hooks.length} hook(s):`));
|
|
316
|
-
if (hooks.length === 0) {
|
|
317
|
-
console.log(chalk.yellow('No hooks found'));
|
|
318
|
-
return;
|
|
319
|
-
}
|
|
320
|
-
for (const name of hooks) {
|
|
321
|
-
console.log(` ${chalk.cyan(name)}`);
|
|
322
|
-
}
|
|
323
|
-
// Install to central storage first
|
|
324
|
-
const installSpinner = ora('Installing hooks to central storage...').start();
|
|
325
|
-
const centralResult = await installHooksCentrally(localPath);
|
|
326
|
-
if (centralResult.installed.length > 0) {
|
|
327
|
-
installSpinner.succeed(`Installed ${centralResult.installed.length} hooks to ~/.agents/hooks/`);
|
|
328
|
-
}
|
|
329
|
-
else {
|
|
330
|
-
installSpinner.info('No hooks to install');
|
|
331
|
-
}
|
|
332
|
-
if (centralResult.errors.length > 0) {
|
|
333
|
-
console.log(chalk.red('\nErrors:'));
|
|
334
|
-
for (const error of centralResult.errors) {
|
|
335
|
-
console.log(chalk.red(` ${error}`));
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
}
|
|
339
|
-
// Get agent and version selection
|
|
340
|
-
let selectedAgents;
|
|
341
|
-
let versionSelections;
|
|
342
|
-
const hooksCapableAgents = Array.from(HOOKS_CAPABLE_AGENTS);
|
|
343
|
-
if (options.agents) {
|
|
344
|
-
const result = resolveAgentVersionTargets(options.agents, hooksCapableAgents);
|
|
345
|
-
selectedAgents = result.selectedAgents;
|
|
346
|
-
versionSelections = result.versionSelections;
|
|
347
|
-
}
|
|
348
|
-
else {
|
|
349
|
-
const result = await promptAgentVersionSelection(hooksCapableAgents, {
|
|
350
|
-
skipPrompts: options.yes || !isInteractiveTerminal(),
|
|
351
|
-
});
|
|
352
|
-
selectedAgents = result.selectedAgents;
|
|
353
|
-
versionSelections = result.versionSelections;
|
|
354
|
-
}
|
|
355
|
-
if (selectedAgents.length === 0) {
|
|
356
|
-
console.log(chalk.yellow('\nNo agents selected.'));
|
|
357
|
-
return;
|
|
358
|
-
}
|
|
359
|
-
// Sync to selected versions
|
|
360
|
-
const syncSpinner = ora('Syncing to agent versions...').start();
|
|
361
|
-
let synced = 0;
|
|
362
|
-
for (const [agentId, versions] of versionSelections) {
|
|
363
|
-
for (const version of versions) {
|
|
364
|
-
syncResourcesToVersion(agentId, version);
|
|
365
|
-
recordVersionResources(agentId, version, 'hooks', hooks);
|
|
366
|
-
synced++;
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
if (synced > 0) {
|
|
370
|
-
syncSpinner.succeed(`Synced to ${synced} agent version(s)`);
|
|
371
|
-
}
|
|
372
|
-
else {
|
|
373
|
-
syncSpinner.info('No version-managed agents to sync');
|
|
374
|
-
}
|
|
375
|
-
console.log(chalk.green('\nHooks installed.'));
|
|
376
|
-
}
|
|
377
|
-
catch (err) {
|
|
378
|
-
if (isPromptCancelled(err)) {
|
|
379
|
-
console.log(chalk.gray('\nCancelled'));
|
|
380
|
-
return;
|
|
381
|
-
}
|
|
382
|
-
console.error(chalk.red('Failed to add hooks'));
|
|
383
|
-
console.error(chalk.red(err.message));
|
|
384
|
-
process.exit(1);
|
|
385
|
-
}
|
|
386
|
-
});
|
|
387
|
-
hooksCmd
|
|
388
|
-
.command('remove [name]')
|
|
389
|
-
.description('Delete a hook from agents (interactive picker if no name given)')
|
|
390
|
-
.option('-a, --agents <list>', 'Limit removal to specific agents')
|
|
391
|
-
.addHelpText('after', `
|
|
392
|
-
Examples:
|
|
393
|
-
# Remove a hook by name
|
|
394
|
-
agents hooks remove post-edit
|
|
395
|
-
|
|
396
|
-
# Interactive picker
|
|
397
|
-
agents hooks remove
|
|
398
|
-
`)
|
|
399
|
-
.action(async (name, options) => {
|
|
400
|
-
let hooksToRemove;
|
|
401
|
-
if (name) {
|
|
402
|
-
hooksToRemove = [name];
|
|
403
|
-
}
|
|
404
|
-
else {
|
|
405
|
-
// Interactive picker
|
|
406
|
-
const centralHooks = listCentralHooks();
|
|
407
|
-
if (centralHooks.length === 0) {
|
|
408
|
-
console.log(chalk.yellow('No hooks installed.'));
|
|
409
|
-
return;
|
|
410
|
-
}
|
|
411
|
-
if (!isInteractiveTerminal()) {
|
|
412
|
-
requireInteractiveSelection('Selecting hooks to remove', [
|
|
413
|
-
'agents hooks remove post-edit',
|
|
414
|
-
]);
|
|
415
|
-
}
|
|
416
|
-
try {
|
|
417
|
-
const selected = await checkbox({
|
|
418
|
-
message: 'Select hooks to remove',
|
|
419
|
-
choices: centralHooks.map((hook) => ({
|
|
420
|
-
value: hook.name,
|
|
421
|
-
name: hook.name,
|
|
422
|
-
})),
|
|
423
|
-
});
|
|
424
|
-
if (selected.length === 0) {
|
|
425
|
-
console.log(chalk.gray('No hooks selected.'));
|
|
426
|
-
return;
|
|
427
|
-
}
|
|
428
|
-
hooksToRemove = selected;
|
|
429
|
-
}
|
|
430
|
-
catch (err) {
|
|
431
|
-
if (isPromptCancelled(err)) {
|
|
432
|
-
console.log(chalk.gray('Cancelled'));
|
|
433
|
-
return;
|
|
434
|
-
}
|
|
435
|
-
throw err;
|
|
436
|
-
}
|
|
437
|
-
}
|
|
438
|
-
const agents = options?.agents
|
|
439
|
-
? options.agents.split(',')
|
|
440
|
-
: Array.from(HOOKS_CAPABLE_AGENTS);
|
|
441
|
-
for (const hookName of hooksToRemove) {
|
|
442
|
-
const result = await removeHook(hookName, agents);
|
|
443
|
-
let removed = 0;
|
|
444
|
-
for (const item of result.removed) {
|
|
445
|
-
const [, agentId] = item.split(':');
|
|
446
|
-
console.log(` ${chalk.red('-')} ${agentLabel(agentId)}: ${hookName}`);
|
|
447
|
-
removed++;
|
|
448
|
-
}
|
|
449
|
-
if (result.errors.length > 0) {
|
|
450
|
-
for (const error of result.errors) {
|
|
451
|
-
console.log(chalk.red(` ${error}`));
|
|
452
|
-
}
|
|
453
|
-
}
|
|
454
|
-
if (removed === 0) {
|
|
455
|
-
console.log(chalk.yellow(`Hook '${hookName}' not found for any agent`));
|
|
456
|
-
}
|
|
457
|
-
}
|
|
458
|
-
});
|
|
459
|
-
hooksCmd
|
|
460
|
-
.command('sync')
|
|
461
|
-
.description('Reconcile version-home hook scripts against central ~/.agents/hooks/ (add + update, never delete)')
|
|
462
|
-
.option('-a, --agent <agent>', 'Scope to a specific agent or agent@version')
|
|
463
|
-
.addHelpText('after', `
|
|
464
|
-
Examples:
|
|
465
|
-
# Sync every installed hooks-capable version
|
|
466
|
-
agents hooks sync
|
|
467
|
-
|
|
468
|
-
# Scope to one agent or version
|
|
469
|
-
agents hooks sync --agent claude
|
|
470
|
-
agents hooks sync --agent claude@2.1.113
|
|
471
|
-
|
|
472
|
-
Sync reconciles the hook script files in each version home against the central
|
|
473
|
-
source of truth in ~/.agents/hooks/. It does NOT touch settings.json
|
|
474
|
-
registrations — those point at central paths and are managed on install.
|
|
475
|
-
|
|
476
|
-
Sync is additive: to remove orphan scripts, use 'agents hooks prune'.
|
|
477
|
-
`)
|
|
478
|
-
.action(async (options) => {
|
|
479
|
-
let filter;
|
|
480
|
-
if (options.agent) {
|
|
481
|
-
const [name, version] = String(options.agent).split('@');
|
|
482
|
-
const agentId = resolveAgentName(name);
|
|
483
|
-
if (!agentId) {
|
|
484
|
-
console.log(chalk.red(formatAgentError(name, HOOKS_CAPABLE_AGENTS)));
|
|
485
|
-
process.exit(1);
|
|
486
|
-
}
|
|
487
|
-
filter = { agent: agentId, version: version || undefined };
|
|
488
|
-
}
|
|
489
|
-
const pairs = iterHooksCapableVersions(filter);
|
|
490
|
-
if (pairs.length === 0) {
|
|
491
|
-
console.log(chalk.gray('No matching installed versions.'));
|
|
492
|
-
return;
|
|
493
|
-
}
|
|
494
|
-
const diffs = pairs.map(({ agent, version }) => diffVersionHooks(agent, version));
|
|
495
|
-
const plan = diffs.filter((d) => d.toAdd.length > 0 || d.toUpdate.length > 0);
|
|
496
|
-
if (plan.length === 0) {
|
|
497
|
-
console.log(chalk.green('All version homes are up to date with central.'));
|
|
498
|
-
if (diffs.some((d) => d.orphans.length > 0)) {
|
|
499
|
-
console.log(chalk.gray('Orphan hooks present. Run \'agents hooks prune --dry-run\' to review.'));
|
|
500
|
-
}
|
|
501
|
-
return;
|
|
502
|
-
}
|
|
503
|
-
console.log(chalk.bold('Syncing hooks\n'));
|
|
504
|
-
let adds = 0, updates = 0, failures = 0;
|
|
505
|
-
for (const diff of plan) {
|
|
506
|
-
const label = `${diff.agent}@${diff.version}`;
|
|
507
|
-
if (diff.toAdd.length > 0) {
|
|
508
|
-
console.log(` ${chalk.cyan(label)} ${chalk.gray('add:')} ${diff.toAdd.join(', ')}`);
|
|
509
|
-
for (const name of diff.toAdd) {
|
|
510
|
-
const r = installHookToVersion(diff.agent, diff.version, name);
|
|
511
|
-
if (r.success)
|
|
512
|
-
adds++;
|
|
513
|
-
else {
|
|
514
|
-
failures++;
|
|
515
|
-
console.log(chalk.red(` ! ${name}: ${r.error}`));
|
|
516
|
-
}
|
|
517
|
-
}
|
|
518
|
-
}
|
|
519
|
-
if (diff.toUpdate.length > 0) {
|
|
520
|
-
console.log(` ${chalk.cyan(label)} ${chalk.gray('update:')} ${diff.toUpdate.join(', ')}`);
|
|
521
|
-
for (const name of diff.toUpdate) {
|
|
522
|
-
const r = installHookToVersion(diff.agent, diff.version, name);
|
|
523
|
-
if (r.success)
|
|
524
|
-
updates++;
|
|
525
|
-
else {
|
|
526
|
-
failures++;
|
|
527
|
-
console.log(chalk.red(` ! ${name}: ${r.error}`));
|
|
528
|
-
}
|
|
529
|
-
}
|
|
530
|
-
}
|
|
531
|
-
}
|
|
532
|
-
console.log();
|
|
533
|
-
console.log(chalk.green(`Synced: ${adds} added, ${updates} updated${failures > 0 ? chalk.red(`, ${failures} failed`) : ''}.`));
|
|
534
|
-
const totalOrphans = diffs.reduce((n, d) => n + d.orphans.length, 0);
|
|
535
|
-
if (totalOrphans > 0) {
|
|
536
|
-
console.log(chalk.gray(`${totalOrphans} orphan(s) remain. Run 'agents hooks prune --dry-run' to review.`));
|
|
537
|
-
}
|
|
538
|
-
});
|
|
539
|
-
hooksCmd
|
|
540
|
-
.command('prune')
|
|
541
|
-
.description('Remove orphan hook scripts from version homes (scripts present locally but not in central)')
|
|
542
|
-
.option('-a, --agent <agent>', 'Scope to a specific agent or agent@version')
|
|
543
|
-
.option('--dry-run', 'Show orphans without deleting')
|
|
544
|
-
.option('-y, --yes', 'Skip confirmation prompt')
|
|
545
|
-
.addHelpText('after', `
|
|
546
|
-
Examples:
|
|
547
|
-
# See what would be pruned
|
|
548
|
-
agents hooks prune --dry-run
|
|
549
|
-
|
|
550
|
-
# Prune across every installed version (prompts for confirmation)
|
|
551
|
-
agents hooks prune
|
|
552
|
-
|
|
553
|
-
# Scope to one agent or version
|
|
554
|
-
agents hooks prune --agent claude@2.1.80
|
|
555
|
-
|
|
556
|
-
# Skip confirmation (for scripts)
|
|
557
|
-
agents hooks prune -y
|
|
558
|
-
|
|
559
|
-
Prune removes hook SCRIPT FILES from version homes. It does not edit
|
|
560
|
-
settings.json registrations — those are keyed off central paths and remain
|
|
561
|
-
consistent as long as central ~/.agents/hooks/ and ~/.agents/hooks.yaml are
|
|
562
|
-
the source of truth.
|
|
563
|
-
`)
|
|
564
|
-
.action(async (options) => {
|
|
565
|
-
let filter;
|
|
566
|
-
if (options.agent) {
|
|
567
|
-
const [name, version] = String(options.agent).split('@');
|
|
568
|
-
const agentId = resolveAgentName(name);
|
|
569
|
-
if (!agentId) {
|
|
570
|
-
console.log(chalk.red(formatAgentError(name, HOOKS_CAPABLE_AGENTS)));
|
|
571
|
-
process.exit(1);
|
|
572
|
-
}
|
|
573
|
-
filter = { agent: agentId, version: version || undefined };
|
|
574
|
-
}
|
|
575
|
-
const pairs = iterHooksCapableVersions(filter);
|
|
576
|
-
const diffs = pairs
|
|
577
|
-
.map(({ agent, version }) => diffVersionHooks(agent, version))
|
|
578
|
-
.filter((d) => d.orphans.length > 0);
|
|
579
|
-
if (diffs.length === 0) {
|
|
580
|
-
console.log(chalk.green('No orphan hooks.'));
|
|
581
|
-
return;
|
|
582
|
-
}
|
|
583
|
-
const total = diffs.reduce((n, d) => n + d.orphans.length, 0);
|
|
584
|
-
console.log(chalk.bold(`Orphans (in version home, not in central)\n`));
|
|
585
|
-
for (const d of diffs) {
|
|
586
|
-
console.log(` ${chalk.cyan(`${d.agent}@${d.version}`)} ${d.orphans.join(', ')}`);
|
|
587
|
-
}
|
|
588
|
-
console.log();
|
|
589
|
-
if (options.dryRun) {
|
|
590
|
-
console.log(chalk.gray(`${total} orphan(s). Run without --dry-run to delete.`));
|
|
591
|
-
return;
|
|
592
|
-
}
|
|
593
|
-
if (!options.yes) {
|
|
594
|
-
if (!isInteractiveTerminal()) {
|
|
595
|
-
console.log(chalk.yellow('Non-interactive shell: pass -y to confirm, or --dry-run to preview.'));
|
|
596
|
-
process.exit(1);
|
|
597
|
-
}
|
|
598
|
-
let ok = false;
|
|
599
|
-
try {
|
|
600
|
-
ok = await confirm({
|
|
601
|
-
message: `Delete ${total} orphan hook${total === 1 ? '' : 's'}?`,
|
|
602
|
-
default: false,
|
|
603
|
-
});
|
|
604
|
-
}
|
|
605
|
-
catch (err) {
|
|
606
|
-
if (isPromptCancelled(err)) {
|
|
607
|
-
console.log(chalk.gray('Cancelled'));
|
|
608
|
-
return;
|
|
609
|
-
}
|
|
610
|
-
throw err;
|
|
611
|
-
}
|
|
612
|
-
if (!ok) {
|
|
613
|
-
console.log(chalk.gray('Cancelled'));
|
|
614
|
-
return;
|
|
615
|
-
}
|
|
616
|
-
}
|
|
617
|
-
let removed = 0, failures = 0;
|
|
618
|
-
for (const d of diffs) {
|
|
619
|
-
for (const name of d.orphans) {
|
|
620
|
-
const r = removeHookFromVersion(d.agent, d.version, name);
|
|
621
|
-
if (r.success)
|
|
622
|
-
removed++;
|
|
623
|
-
else {
|
|
624
|
-
failures++;
|
|
625
|
-
console.log(chalk.red(` ! ${d.agent}@${d.version} ${name}: ${r.error}`));
|
|
626
|
-
}
|
|
627
|
-
}
|
|
628
|
-
}
|
|
629
|
-
console.log(chalk.green(`Pruned ${removed} orphan(s)${failures > 0 ? chalk.red(`, ${failures} failed`) : ''}.`));
|
|
630
|
-
});
|
|
631
|
-
hooksCmd
|
|
632
|
-
.command('view [name]')
|
|
633
|
-
.description('Read the shell script content for a hook')
|
|
634
|
-
.addHelpText('after', `
|
|
635
|
-
Examples:
|
|
636
|
-
# View a specific hook
|
|
637
|
-
agents hooks view post-edit
|
|
638
|
-
|
|
639
|
-
# Interactive picker
|
|
640
|
-
agents hooks view
|
|
641
|
-
`)
|
|
642
|
-
.action(async (name) => {
|
|
643
|
-
const centralHooks = listCentralHooks();
|
|
644
|
-
if (centralHooks.length === 0) {
|
|
645
|
-
console.log(chalk.yellow('No hooks installed'));
|
|
646
|
-
return;
|
|
647
|
-
}
|
|
648
|
-
// If no name provided, show interactive select
|
|
649
|
-
if (!name) {
|
|
650
|
-
if (!isInteractiveTerminal()) {
|
|
651
|
-
requireInteractiveSelection('Selecting a hook to view', [
|
|
652
|
-
'agents hooks view post-edit',
|
|
653
|
-
]);
|
|
654
|
-
}
|
|
655
|
-
try {
|
|
656
|
-
const { select } = await import('@inquirer/prompts');
|
|
657
|
-
name = await select({
|
|
658
|
-
message: 'Select a hook to view',
|
|
659
|
-
choices: centralHooks.map((hook) => ({
|
|
660
|
-
value: hook.name,
|
|
661
|
-
name: hook.name,
|
|
662
|
-
})),
|
|
663
|
-
});
|
|
664
|
-
}
|
|
665
|
-
catch (err) {
|
|
666
|
-
if (isPromptCancelled(err)) {
|
|
667
|
-
console.log(chalk.gray('Cancelled'));
|
|
668
|
-
return;
|
|
669
|
-
}
|
|
670
|
-
throw err;
|
|
671
|
-
}
|
|
672
|
-
}
|
|
673
|
-
const hook = getHookInfo(name);
|
|
674
|
-
if (!hook) {
|
|
675
|
-
console.log(chalk.yellow(`Hook '${name}' not found`));
|
|
676
|
-
return;
|
|
677
|
-
}
|
|
678
|
-
// Build header
|
|
679
|
-
console.log(chalk.bold(`\n${hook.name}`));
|
|
680
|
-
console.log(chalk.gray(`Path: ${hook.path}\n`));
|
|
681
|
-
// Show content (hooks are usually shell scripts, not markdown - just show with syntax highlighting placeholder)
|
|
682
|
-
if (hook.content) {
|
|
683
|
-
const contentLines = hook.content.split('\n');
|
|
684
|
-
// For shell scripts, just display with line numbers
|
|
685
|
-
const output = contentLines.map((line, i) => ` ${chalk.gray(String(i + 1).padStart(3))} ${line}`).join('\n');
|
|
686
|
-
printWithPager(output, contentLines.length);
|
|
687
|
-
}
|
|
688
|
-
});
|
|
689
|
-
}
|
|
690
|
-
//# sourceMappingURL=hooks.js.map
|