runwork 0.15.1 → 0.16.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/bundled-types/task-delegation/task-delegation/types.d.ts +6 -0
- package/dist/index.js +20237 -116
- package/package.json +4 -4
- package/dist/__tests__/curl-parser.test.d.ts +0 -1
- package/dist/__tests__/curl-parser.test.js +0 -250
- package/dist/__tests__/install-scripts.test.d.ts +0 -1
- package/dist/__tests__/install-scripts.test.js +0 -280
- package/dist/__tests__/types-manager.test.d.ts +0 -1
- package/dist/__tests__/types-manager.test.js +0 -89
- package/dist/agents/__tests__/chatgpt-registry.test.d.ts +0 -1
- package/dist/agents/__tests__/chatgpt-registry.test.js +0 -61
- package/dist/agents/__tests__/claude-code-managed-block.test.d.ts +0 -1
- package/dist/agents/__tests__/claude-code-managed-block.test.js +0 -105
- package/dist/agents/__tests__/claude-code-plugin.test.d.ts +0 -1
- package/dist/agents/__tests__/claude-code-plugin.test.js +0 -47
- package/dist/agents/__tests__/claude-code-stats.test.d.ts +0 -1
- package/dist/agents/__tests__/claude-code-stats.test.js +0 -390
- package/dist/agents/__tests__/claude-desktop-memory.test.d.ts +0 -1
- package/dist/agents/__tests__/claude-desktop-memory.test.js +0 -154
- package/dist/agents/__tests__/claude-desktop-plugin-tree.test.d.ts +0 -1
- package/dist/agents/__tests__/claude-desktop-plugin-tree.test.js +0 -161
- package/dist/agents/__tests__/claude-desktop-plugin.test.d.ts +0 -1
- package/dist/agents/__tests__/claude-desktop-plugin.test.js +0 -117
- package/dist/agents/__tests__/claude-desktop-rpm.test.d.ts +0 -1
- package/dist/agents/__tests__/claude-desktop-rpm.test.js +0 -126
- package/dist/agents/__tests__/claude-desktop-stats.test.d.ts +0 -1
- package/dist/agents/__tests__/claude-desktop-stats.test.js +0 -280
- package/dist/agents/__tests__/codex-instructions.test.d.ts +0 -1
- package/dist/agents/__tests__/codex-instructions.test.js +0 -57
- package/dist/agents/__tests__/codex-minimum-permissions.test.d.ts +0 -1
- package/dist/agents/__tests__/codex-minimum-permissions.test.js +0 -82
- package/dist/agents/__tests__/codex-stats.test.d.ts +0 -1
- package/dist/agents/__tests__/codex-stats.test.js +0 -370
- package/dist/agents/__tests__/cursor-merge.test.d.ts +0 -1
- package/dist/agents/__tests__/cursor-merge.test.js +0 -66
- package/dist/agents/__tests__/cursor-stats.test.d.ts +0 -1
- package/dist/agents/__tests__/cursor-stats.test.js +0 -183
- package/dist/agents/__tests__/defaults-merge.test.d.ts +0 -1
- package/dist/agents/__tests__/defaults-merge.test.js +0 -268
- package/dist/agents/__tests__/detection.test.d.ts +0 -1
- package/dist/agents/__tests__/detection.test.js +0 -89
- package/dist/agents/__tests__/graceful-degradation.test.d.ts +0 -1
- package/dist/agents/__tests__/graceful-degradation.test.js +0 -129
- package/dist/agents/__tests__/instruction-hint.test.d.ts +0 -1
- package/dist/agents/__tests__/instruction-hint.test.js +0 -69
- package/dist/agents/__tests__/intro-skill.test.d.ts +0 -1
- package/dist/agents/__tests__/intro-skill.test.js +0 -193
- package/dist/agents/__tests__/schema-validation.test.d.ts +0 -1
- package/dist/agents/__tests__/schema-validation.test.js +0 -212
- package/dist/agents/__tests__/skill-slug.test.d.ts +0 -1
- package/dist/agents/__tests__/skill-slug.test.js +0 -77
- package/dist/agents/claude-code.d.ts +0 -59
- package/dist/agents/claude-code.js +0 -753
- package/dist/agents/claude-desktop-plugin-tree.d.ts +0 -59
- package/dist/agents/claude-desktop-plugin-tree.js +0 -143
- package/dist/agents/claude-desktop.d.ts +0 -47
- package/dist/agents/claude-desktop.js +0 -684
- package/dist/agents/cline.d.ts +0 -15
- package/dist/agents/cline.js +0 -130
- package/dist/agents/codex.d.ts +0 -44
- package/dist/agents/codex.js +0 -453
- package/dist/agents/conversation-skills.d.ts +0 -18
- package/dist/agents/conversation-skills.js +0 -229
- package/dist/agents/cursor.d.ts +0 -35
- package/dist/agents/cursor.js +0 -294
- package/dist/agents/default-config.d.ts +0 -30
- package/dist/agents/default-config.js +0 -67
- package/dist/agents/defaults-merge.d.ts +0 -87
- package/dist/agents/defaults-merge.js +0 -150
- package/dist/agents/detect.d.ts +0 -4
- package/dist/agents/detect.js +0 -67
- package/dist/agents/detection.d.ts +0 -18
- package/dist/agents/detection.js +0 -94
- package/dist/agents/gemini.d.ts +0 -15
- package/dist/agents/gemini.js +0 -122
- package/dist/agents/generic-adapter.d.ts +0 -25
- package/dist/agents/generic-adapter.js +0 -151
- package/dist/agents/intro-skill.d.ts +0 -45
- package/dist/agents/intro-skill.js +0 -447
- package/dist/agents/registry-data.d.ts +0 -192
- package/dist/agents/registry-data.js +0 -669
- package/dist/agents/registry.d.ts +0 -13
- package/dist/agents/registry.js +0 -36
- package/dist/agents/runtime-detection.d.ts +0 -82
- package/dist/agents/runtime-detection.js +0 -271
- package/dist/agents/session-start-hook.d.ts +0 -37
- package/dist/agents/session-start-hook.js +0 -159
- package/dist/agents/types.d.ts +0 -171
- package/dist/agents/types.js +0 -75
- package/dist/agents/utils/instruction-hint.d.ts +0 -21
- package/dist/agents/utils/instruction-hint.js +0 -108
- package/dist/agents/utils/json-config.d.ts +0 -19
- package/dist/agents/utils/json-config.js +0 -69
- package/dist/agents/utils/toml-config.d.ts +0 -8
- package/dist/agents/utils/toml-config.js +0 -27
- package/dist/agents/windsurf.d.ts +0 -14
- package/dist/agents/windsurf.js +0 -102
- package/dist/api/__tests__/client.test.d.ts +0 -1
- package/dist/api/__tests__/client.test.js +0 -272
- package/dist/api/client.d.ts +0 -326
- package/dist/api/client.js +0 -427
- package/dist/auth/__tests__/login-flow.test.d.ts +0 -1
- package/dist/auth/__tests__/login-flow.test.js +0 -101
- package/dist/auth/__tests__/store.test.d.ts +0 -1
- package/dist/auth/__tests__/store.test.js +0 -132
- package/dist/auth/login-flow.d.ts +0 -26
- package/dist/auth/login-flow.js +0 -137
- package/dist/auth/store.d.ts +0 -5
- package/dist/auth/store.js +0 -62
- package/dist/commands/__tests__/clone-args.test.d.ts +0 -1
- package/dist/commands/__tests__/clone-args.test.js +0 -51
- package/dist/commands/__tests__/clone-source-result.test.d.ts +0 -1
- package/dist/commands/__tests__/clone-source-result.test.js +0 -45
- package/dist/commands/__tests__/info-merge.test.d.ts +0 -1
- package/dist/commands/__tests__/info-merge.test.js +0 -55
- package/dist/commands/__tests__/mcp-entries.test.d.ts +0 -1
- package/dist/commands/__tests__/mcp-entries.test.js +0 -48
- package/dist/commands/__tests__/setup-persona.test.d.ts +0 -1
- package/dist/commands/__tests__/setup-persona.test.js +0 -31
- package/dist/commands/__tests__/setup.test.d.ts +0 -1
- package/dist/commands/__tests__/setup.test.js +0 -81
- package/dist/commands/__tests__/sync-redetect.test.d.ts +0 -1
- package/dist/commands/__tests__/sync-redetect.test.js +0 -96
- package/dist/commands/__tests__/sync-telemetry.test.d.ts +0 -1
- package/dist/commands/__tests__/sync-telemetry.test.js +0 -281
- package/dist/commands/__tests__/upgrade.test.d.ts +0 -1
- package/dist/commands/__tests__/upgrade.test.js +0 -157
- package/dist/commands/agents.d.ts +0 -2
- package/dist/commands/agents.js +0 -160
- package/dist/commands/api-keys.d.ts +0 -2
- package/dist/commands/api-keys.js +0 -95
- package/dist/commands/apps.d.ts +0 -2
- package/dist/commands/apps.js +0 -82
- package/dist/commands/build-plugin.d.ts +0 -2
- package/dist/commands/build-plugin.js +0 -135
- package/dist/commands/clone.d.ts +0 -60
- package/dist/commands/clone.js +0 -271
- package/dist/commands/components.d.ts +0 -2
- package/dist/commands/components.js +0 -43
- package/dist/commands/deploy.d.ts +0 -2
- package/dist/commands/deploy.js +0 -279
- package/dist/commands/dev.d.ts +0 -11
- package/dist/commands/dev.js +0 -1011
- package/dist/commands/doctor.d.ts +0 -2
- package/dist/commands/doctor.js +0 -230
- package/dist/commands/endpoints.d.ts +0 -2
- package/dist/commands/endpoints.js +0 -189
- package/dist/commands/entities.d.ts +0 -2
- package/dist/commands/entities.js +0 -198
- package/dist/commands/files.d.ts +0 -2
- package/dist/commands/files.js +0 -193
- package/dist/commands/inbox.d.ts +0 -11
- package/dist/commands/inbox.js +0 -60
- package/dist/commands/info.d.ts +0 -178
- package/dist/commands/info.js +0 -455
- package/dist/commands/init.d.ts +0 -21
- package/dist/commands/init.js +0 -185
- package/dist/commands/integrations.d.ts +0 -2
- package/dist/commands/integrations.js +0 -233
- package/dist/commands/login.d.ts +0 -2
- package/dist/commands/login.js +0 -44
- package/dist/commands/logout.d.ts +0 -2
- package/dist/commands/logout.js +0 -13
- package/dist/commands/logs.d.ts +0 -2
- package/dist/commands/logs.js +0 -232
- package/dist/commands/mcp-entries.d.ts +0 -13
- package/dist/commands/mcp-entries.js +0 -26
- package/dist/commands/mcp.d.ts +0 -2
- package/dist/commands/mcp.js +0 -245
- package/dist/commands/open.d.ts +0 -2
- package/dist/commands/open.js +0 -53
- package/dist/commands/resume.d.ts +0 -2
- package/dist/commands/resume.js +0 -289
- package/dist/commands/save-convo.d.ts +0 -8
- package/dist/commands/save-convo.js +0 -20
- package/dist/commands/schedules.d.ts +0 -2
- package/dist/commands/schedules.js +0 -221
- package/dist/commands/setup.d.ts +0 -27
- package/dist/commands/setup.js +0 -177
- package/dist/commands/share-convo.d.ts +0 -24
- package/dist/commands/share-convo.js +0 -167
- package/dist/commands/skills.d.ts +0 -2
- package/dist/commands/skills.js +0 -352
- package/dist/commands/sync-telemetry.d.ts +0 -33
- package/dist/commands/sync-telemetry.js +0 -186
- package/dist/commands/sync.d.ts +0 -37
- package/dist/commands/sync.js +0 -702
- package/dist/commands/uninstall.d.ts +0 -2
- package/dist/commands/uninstall.js +0 -145
- package/dist/commands/upgrade.d.ts +0 -14
- package/dist/commands/upgrade.js +0 -217
- package/dist/commands/validate.d.ts +0 -2
- package/dist/commands/validate.js +0 -89
- package/dist/commands/welcome.d.ts +0 -1
- package/dist/commands/welcome.js +0 -86
- package/dist/commands/workflows.d.ts +0 -2
- package/dist/commands/workflows.js +0 -187
- package/dist/deploy/__tests__/deploy-state.test.d.ts +0 -1
- package/dist/deploy/__tests__/deploy-state.test.js +0 -80
- package/dist/deploy/__tests__/deploy-status.test.d.ts +0 -1
- package/dist/deploy/__tests__/deploy-status.test.js +0 -41
- package/dist/deploy/__tests__/detach-args.test.d.ts +0 -1
- package/dist/deploy/__tests__/detach-args.test.js +0 -30
- package/dist/deploy/deploy-state.d.ts +0 -36
- package/dist/deploy/deploy-state.js +0 -63
- package/dist/deploy/deploy-status.d.ts +0 -21
- package/dist/deploy/deploy-status.js +0 -36
- package/dist/deploy/detach.d.ts +0 -32
- package/dist/deploy/detach.js +0 -71
- package/dist/dev/__tests__/attach.test.d.ts +0 -1
- package/dist/dev/__tests__/attach.test.js +0 -296
- package/dist/dev/__tests__/detach.test.d.ts +0 -1
- package/dist/dev/__tests__/detach.test.js +0 -404
- package/dist/dev/__tests__/preview-url-poller.test.d.ts +0 -1
- package/dist/dev/__tests__/preview-url-poller.test.js +0 -149
- package/dist/dev/__tests__/session.test.d.ts +0 -1
- package/dist/dev/__tests__/session.test.js +0 -446
- package/dist/dev/__tests__/startup-sync.test.d.ts +0 -1
- package/dist/dev/__tests__/startup-sync.test.js +0 -32
- package/dist/dev/__tests__/stop.test.d.ts +0 -1
- package/dist/dev/__tests__/stop.test.js +0 -172
- package/dist/dev/attach.d.ts +0 -120
- package/dist/dev/attach.js +0 -269
- package/dist/dev/detach.d.ts +0 -187
- package/dist/dev/detach.js +0 -292
- package/dist/dev/preview-url-poller.d.ts +0 -35
- package/dist/dev/preview-url-poller.js +0 -50
- package/dist/dev/session.d.ts +0 -175
- package/dist/dev/session.js +0 -258
- package/dist/dev/startup-sync.d.ts +0 -23
- package/dist/dev/startup-sync.js +0 -14
- package/dist/dev/stop.d.ts +0 -52
- package/dist/dev/stop.js +0 -101
- package/dist/devtools/registry-data.d.ts +0 -46
- package/dist/devtools/registry-data.js +0 -40
- package/dist/generated/bundled-types.d.ts +0 -1
- package/dist/generated/bundled-types.js +0 -46
- package/dist/generated/version.d.ts +0 -1
- package/dist/generated/version.js +0 -2
- package/dist/git/__tests__/auto-commit.test.d.ts +0 -1
- package/dist/git/__tests__/auto-commit.test.js +0 -431
- package/dist/git/__tests__/classify-sync-error.test.d.ts +0 -1
- package/dist/git/__tests__/classify-sync-error.test.js +0 -57
- package/dist/git/__tests__/credential-helper-e2e.test.d.ts +0 -21
- package/dist/git/__tests__/credential-helper-e2e.test.js +0 -195
- package/dist/git/__tests__/credentials.test.d.ts +0 -1
- package/dist/git/__tests__/credentials.test.js +0 -141
- package/dist/git/__tests__/deploy-guard.test.d.ts +0 -1
- package/dist/git/__tests__/deploy-guard.test.js +0 -61
- package/dist/git/__tests__/ensure-git-credential-helper.test.d.ts +0 -1
- package/dist/git/__tests__/ensure-git-credential-helper.test.js +0 -133
- package/dist/git/__tests__/ensure-runwork-remote.test.d.ts +0 -1
- package/dist/git/__tests__/ensure-runwork-remote.test.js +0 -109
- package/dist/git/__tests__/identity.test.d.ts +0 -1
- package/dist/git/__tests__/identity.test.js +0 -146
- package/dist/git/__tests__/manifest.test.d.ts +0 -1
- package/dist/git/__tests__/manifest.test.js +0 -446
- package/dist/git/__tests__/preflight-resolution.test.d.ts +0 -1
- package/dist/git/__tests__/preflight-resolution.test.js +0 -366
- package/dist/git/__tests__/preflight.test.d.ts +0 -1
- package/dist/git/__tests__/preflight.test.js +0 -36
- package/dist/git/__tests__/repo-config.test.d.ts +0 -1
- package/dist/git/__tests__/repo-config.test.js +0 -26
- package/dist/git/__tests__/sync.test.d.ts +0 -1
- package/dist/git/__tests__/sync.test.js +0 -405
- package/dist/git/auto-commit.d.ts +0 -35
- package/dist/git/auto-commit.js +0 -293
- package/dist/git/classify-sync-error.d.ts +0 -21
- package/dist/git/classify-sync-error.js +0 -111
- package/dist/git/credentials.d.ts +0 -75
- package/dist/git/credentials.js +0 -164
- package/dist/git/critical-files.d.ts +0 -20
- package/dist/git/critical-files.js +0 -68
- package/dist/git/deploy-guard.d.ts +0 -53
- package/dist/git/deploy-guard.js +0 -78
- package/dist/git/identity.d.ts +0 -44
- package/dist/git/identity.js +0 -133
- package/dist/git/preflight.d.ts +0 -57
- package/dist/git/preflight.js +0 -276
- package/dist/git/remote.d.ts +0 -37
- package/dist/git/remote.js +0 -75
- package/dist/git/repo-config.d.ts +0 -8
- package/dist/git/repo-config.js +0 -29
- package/dist/git/sync.d.ts +0 -15
- package/dist/git/sync.js +0 -159
- package/dist/health/__tests__/checks.test.d.ts +0 -1
- package/dist/health/__tests__/checks.test.js +0 -357
- package/dist/health/__tests__/cli-distribution-checks.test.d.ts +0 -1
- package/dist/health/__tests__/cli-distribution-checks.test.js +0 -196
- package/dist/health/__tests__/fix.test.d.ts +0 -1
- package/dist/health/__tests__/fix.test.js +0 -72
- package/dist/health/__tests__/runner-filter.test.d.ts +0 -1
- package/dist/health/__tests__/runner-filter.test.js +0 -61
- package/dist/health/checks.d.ts +0 -42
- package/dist/health/checks.js +0 -636
- package/dist/health/fix.d.ts +0 -22
- package/dist/health/fix.js +0 -62
- package/dist/health/runner.d.ts +0 -8
- package/dist/health/runner.js +0 -47
- package/dist/health/types.d.ts +0 -12
- package/dist/health/types.js +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/logs/__tests__/tailer-format.test.d.ts +0 -1
- package/dist/logs/__tests__/tailer-format.test.js +0 -43
- package/dist/logs/tailer.d.ts +0 -17
- package/dist/logs/tailer.js +0 -217
- package/dist/sync/__tests__/change-detect.test.d.ts +0 -1
- package/dist/sync/__tests__/change-detect.test.js +0 -123
- package/dist/sync/__tests__/hash.test.d.ts +0 -1
- package/dist/sync/__tests__/hash.test.js +0 -18
- package/dist/sync/change-detect.d.ts +0 -19
- package/dist/sync/change-detect.js +0 -136
- package/dist/sync/conflict-ui.d.ts +0 -5
- package/dist/sync/conflict-ui.js +0 -78
- package/dist/sync/executor.d.ts +0 -23
- package/dist/sync/executor.js +0 -102
- package/dist/sync/hash.d.ts +0 -1
- package/dist/sync/hash.js +0 -4
- package/dist/sync/types.d.ts +0 -24
- package/dist/sync/types.js +0 -1
- package/dist/template/manifest.d.ts +0 -17
- package/dist/template/manifest.js +0 -145
- package/dist/tools/types.d.ts +0 -52
- package/dist/tools/types.js +0 -8
- package/dist/types-manager.d.ts +0 -1
- package/dist/types-manager.js +0 -35
- package/dist/types.d.ts +0 -349
- package/dist/types.js +0 -1
- package/dist/ui/__tests__/banner.test.d.ts +0 -1
- package/dist/ui/__tests__/banner.test.js +0 -98
- package/dist/ui/__tests__/colors.test.d.ts +0 -1
- package/dist/ui/__tests__/colors.test.js +0 -22
- package/dist/ui/__tests__/keyboard.test.d.ts +0 -1
- package/dist/ui/__tests__/keyboard.test.js +0 -34
- package/dist/ui/__tests__/status-line.test.d.ts +0 -1
- package/dist/ui/__tests__/status-line.test.js +0 -54
- package/dist/ui/banner.d.ts +0 -29
- package/dist/ui/banner.js +0 -153
- package/dist/ui/colors.d.ts +0 -4
- package/dist/ui/colors.js +0 -7
- package/dist/ui/keyboard.d.ts +0 -12
- package/dist/ui/keyboard.js +0 -61
- package/dist/ui/status-line.d.ts +0 -6
- package/dist/ui/status-line.js +0 -53
- package/dist/utils/__tests__/format-error.test.d.ts +0 -1
- package/dist/utils/__tests__/format-error.test.js +0 -43
- package/dist/utils/__tests__/help-json.test.d.ts +0 -1
- package/dist/utils/__tests__/help-json.test.js +0 -39
- package/dist/utils/__tests__/http.test.d.ts +0 -1
- package/dist/utils/__tests__/http.test.js +0 -381
- package/dist/utils/__tests__/ignore-matcher.test.d.ts +0 -1
- package/dist/utils/__tests__/ignore-matcher.test.js +0 -205
- package/dist/utils/__tests__/output.test.d.ts +0 -1
- package/dist/utils/__tests__/output.test.js +0 -38
- package/dist/utils/__tests__/prompt.test.d.ts +0 -1
- package/dist/utils/__tests__/prompt.test.js +0 -27
- package/dist/utils/__tests__/resolve.test.d.ts +0 -1
- package/dist/utils/__tests__/resolve.test.js +0 -95
- package/dist/utils/__tests__/sqlite.test.d.ts +0 -1
- package/dist/utils/__tests__/sqlite.test.js +0 -89
- package/dist/utils/agent-guidance.d.ts +0 -47
- package/dist/utils/agent-guidance.js +0 -128
- package/dist/utils/app-info.d.ts +0 -70
- package/dist/utils/app-info.js +0 -167
- package/dist/utils/curl-parser.d.ts +0 -12
- package/dist/utils/curl-parser.js +0 -162
- package/dist/utils/data-input.d.ts +0 -1
- package/dist/utils/data-input.js +0 -38
- package/dist/utils/format-error.d.ts +0 -10
- package/dist/utils/format-error.js +0 -38
- package/dist/utils/fs.d.ts +0 -5
- package/dist/utils/fs.js +0 -23
- package/dist/utils/help-json.d.ts +0 -70
- package/dist/utils/help-json.js +0 -88
- package/dist/utils/http.d.ts +0 -46
- package/dist/utils/http.js +0 -421
- package/dist/utils/ignore-matcher.d.ts +0 -47
- package/dist/utils/ignore-matcher.js +0 -132
- package/dist/utils/output.d.ts +0 -17
- package/dist/utils/output.js +0 -27
- package/dist/utils/prompt.d.ts +0 -5
- package/dist/utils/prompt.js +0 -42
- package/dist/utils/resolve.d.ts +0 -12
- package/dist/utils/resolve.js +0 -52
- package/dist/utils/setup-state.d.ts +0 -3
- package/dist/utils/setup-state.js +0 -19
- package/dist/utils/sqlite-adapter.d.ts +0 -48
- package/dist/utils/sqlite-adapter.js +0 -147
- package/dist/utils/sqlite.d.ts +0 -14
- package/dist/utils/sqlite.js +0 -14
- package/dist/utils/subprocess.d.ts +0 -19
- package/dist/utils/subprocess.js +0 -27
- package/dist/utils/which.d.ts +0 -14
- package/dist/utils/which.js +0 -47
- package/dist/utils/zip.d.ts +0 -7
- package/dist/utils/zip.js +0 -42
- package/dist/validate/__tests__/validate.test.d.ts +0 -1
- package/dist/validate/__tests__/validate.test.js +0 -42
- package/dist/validate/freshness.d.ts +0 -28
- package/dist/validate/freshness.js +0 -48
- package/dist/validate/preview.d.ts +0 -21
- package/dist/validate/preview.js +0 -39
- package/dist/workspace/resolve.d.ts +0 -19
- package/dist/workspace/resolve.js +0 -100
package/dist/commands/mcp.js
DELETED
|
@@ -1,245 +0,0 @@
|
|
|
1
|
-
import { Command } from 'commander';
|
|
2
|
-
import { requireAuth } from '../auth/store.js';
|
|
3
|
-
import { ApiClient } from '../api/client.js';
|
|
4
|
-
import { resolveWorkspace } from '../workspace/resolve.js';
|
|
5
|
-
import { promptConfirm } from '../utils/prompt.js';
|
|
6
|
-
import { shouldOutputJson, jsonOut } from '../utils/output.js';
|
|
7
|
-
const listCommand = new Command('list')
|
|
8
|
-
.description('List workspace MCP servers')
|
|
9
|
-
.option('--workspace <id>', 'Workspace ID')
|
|
10
|
-
.action(async (opts, command) => {
|
|
11
|
-
const useJson = shouldOutputJson(command.optsWithGlobals().json);
|
|
12
|
-
const credentials = requireAuth();
|
|
13
|
-
const client = new ApiClient(credentials);
|
|
14
|
-
const { workspaceId, workspaceName } = await resolveWorkspace(client, opts);
|
|
15
|
-
try {
|
|
16
|
-
const baseUrl = credentials.baseUrl || 'https://runwork.ai';
|
|
17
|
-
const [servers, apps] = await Promise.all([
|
|
18
|
-
client.listMcpServers(workspaceId),
|
|
19
|
-
client.listApps(workspaceId).catch(() => []),
|
|
20
|
-
]);
|
|
21
|
-
// Build the workspace MCP entry
|
|
22
|
-
const workspaceMcpUrl = `${baseUrl}/api/workspaces/${workspaceId}/mcp`;
|
|
23
|
-
// Build per-app MCP entries
|
|
24
|
-
const appMcpEntries = apps.map(app => ({
|
|
25
|
-
name: app.name,
|
|
26
|
-
url: `${baseUrl}/api/workspaces/${workspaceId}/apps/${app.id}/mcp`,
|
|
27
|
-
}));
|
|
28
|
-
if (useJson) {
|
|
29
|
-
jsonOut({
|
|
30
|
-
workspace: { name: 'Workspace', url: workspaceMcpUrl },
|
|
31
|
-
apps: appMcpEntries,
|
|
32
|
-
external: servers,
|
|
33
|
-
});
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
console.log(`\nWorkspace: ${workspaceName || workspaceId}\n`);
|
|
37
|
-
// Workspace MCP
|
|
38
|
-
console.log(' Workspace MCP (all tools across apps)');
|
|
39
|
-
console.log(' ' + '-'.repeat(75));
|
|
40
|
-
console.log(` ${workspaceMcpUrl}`);
|
|
41
|
-
console.log('');
|
|
42
|
-
// App MCPs
|
|
43
|
-
if (appMcpEntries.length > 0) {
|
|
44
|
-
console.log(' App MCP Servers (per-app scope)');
|
|
45
|
-
console.log(' ' + '-'.repeat(75));
|
|
46
|
-
for (const app of appMcpEntries) {
|
|
47
|
-
console.log(` ${app.name.padEnd(20)} ${app.url}`);
|
|
48
|
-
}
|
|
49
|
-
console.log('');
|
|
50
|
-
}
|
|
51
|
-
// External MCPs
|
|
52
|
-
if (servers.length > 0) {
|
|
53
|
-
console.log(' External MCP Servers');
|
|
54
|
-
console.log(' ' + '-'.repeat(75));
|
|
55
|
-
for (const s of servers) {
|
|
56
|
-
const status = s.enabled
|
|
57
|
-
? (s.toolCount ? `connected (${s.toolCount} tools)` : 'enabled')
|
|
58
|
-
: 'disabled';
|
|
59
|
-
console.log(` ${s.name.padEnd(20)} ${s.url.padEnd(45)} ${status}`);
|
|
60
|
-
}
|
|
61
|
-
console.log('');
|
|
62
|
-
}
|
|
63
|
-
else {
|
|
64
|
-
console.log(' No external MCP servers. Add one with: runwork mcp add <name> <url>');
|
|
65
|
-
console.log('');
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
catch (err) {
|
|
69
|
-
console.error('Failed to list MCP servers:', err instanceof Error ? err.message : err);
|
|
70
|
-
process.exit(1);
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
const addCommand = new Command('add')
|
|
74
|
-
.description('Add an MCP server to workspace')
|
|
75
|
-
.argument('<name>', 'Server name')
|
|
76
|
-
.argument('<url>', 'Server URL (Streamable HTTP or SSE endpoint)')
|
|
77
|
-
.option('--transport <type>', 'Transport type: streamable-http or sse', 'streamable-http')
|
|
78
|
-
.option('--workspace <id>', 'Workspace ID')
|
|
79
|
-
.action(async (name, url, opts, command) => {
|
|
80
|
-
const useJson = shouldOutputJson(command.optsWithGlobals().json);
|
|
81
|
-
const credentials = requireAuth();
|
|
82
|
-
const client = new ApiClient(credentials);
|
|
83
|
-
const { workspaceId } = await resolveWorkspace(client, opts);
|
|
84
|
-
try {
|
|
85
|
-
new URL(url);
|
|
86
|
-
}
|
|
87
|
-
catch {
|
|
88
|
-
console.error(`Invalid URL: ${url}`);
|
|
89
|
-
process.exit(1);
|
|
90
|
-
}
|
|
91
|
-
try {
|
|
92
|
-
const server = await client.addMcpServer(workspaceId, {
|
|
93
|
-
name,
|
|
94
|
-
url,
|
|
95
|
-
transport: opts.transport,
|
|
96
|
-
});
|
|
97
|
-
if (useJson) {
|
|
98
|
-
jsonOut({ server });
|
|
99
|
-
return;
|
|
100
|
-
}
|
|
101
|
-
console.log(`Added MCP server "${name}" (${url})`);
|
|
102
|
-
console.log('Run `runwork sync` to update your local agent configs.');
|
|
103
|
-
}
|
|
104
|
-
catch (err) {
|
|
105
|
-
console.error('Failed to add MCP server:', err instanceof Error ? err.message : err);
|
|
106
|
-
process.exit(1);
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
|
-
const removeCommand = new Command('remove')
|
|
110
|
-
.description('Remove an MCP server from workspace')
|
|
111
|
-
.argument('<name>', 'Server name')
|
|
112
|
-
.option('--yes', 'Skip confirmation')
|
|
113
|
-
.option('--workspace <id>', 'Workspace ID')
|
|
114
|
-
.action(async (name, opts, command) => {
|
|
115
|
-
const useJson = shouldOutputJson(command.optsWithGlobals().json);
|
|
116
|
-
const credentials = requireAuth();
|
|
117
|
-
const client = new ApiClient(credentials);
|
|
118
|
-
const { workspaceId } = await resolveWorkspace(client, opts);
|
|
119
|
-
try {
|
|
120
|
-
const servers = await client.listMcpServers(workspaceId);
|
|
121
|
-
const match = servers.find(s => s.name === name);
|
|
122
|
-
if (!match) {
|
|
123
|
-
console.error(`MCP server "${name}" not found in workspace.`);
|
|
124
|
-
process.exit(1);
|
|
125
|
-
}
|
|
126
|
-
if (!opts.yes && !useJson) {
|
|
127
|
-
const confirmed = await promptConfirm(`Remove MCP server "${name}" (${match.url})?`);
|
|
128
|
-
if (!confirmed)
|
|
129
|
-
return;
|
|
130
|
-
}
|
|
131
|
-
await client.removeMcpServer(workspaceId, match.id);
|
|
132
|
-
if (useJson) {
|
|
133
|
-
jsonOut({ removed: true, name });
|
|
134
|
-
return;
|
|
135
|
-
}
|
|
136
|
-
console.log(`Removed MCP server "${name}".`);
|
|
137
|
-
console.log('Run `runwork sync` to update your local agent configs.');
|
|
138
|
-
}
|
|
139
|
-
catch (err) {
|
|
140
|
-
console.error('Failed to remove MCP server:', err instanceof Error ? err.message : err);
|
|
141
|
-
process.exit(1);
|
|
142
|
-
}
|
|
143
|
-
});
|
|
144
|
-
const searchCommand = new Command('search')
|
|
145
|
-
.description('Search community MCP servers from the MCP Registry')
|
|
146
|
-
.argument('<query>', 'Search query')
|
|
147
|
-
.option('--limit <n>', 'Max results (1-50)', '10')
|
|
148
|
-
.action(async (query, opts, command) => {
|
|
149
|
-
const useJson = shouldOutputJson(command.optsWithGlobals().json);
|
|
150
|
-
const credentials = requireAuth();
|
|
151
|
-
const client = new ApiClient(credentials);
|
|
152
|
-
try {
|
|
153
|
-
const results = await client.searchCommunityMcpServers(query, Number(opts.limit));
|
|
154
|
-
if (useJson) {
|
|
155
|
-
jsonOut(results);
|
|
156
|
-
return;
|
|
157
|
-
}
|
|
158
|
-
if (results.servers.length === 0) {
|
|
159
|
-
console.log(`No remote-capable MCP servers found for "${query}".`);
|
|
160
|
-
return;
|
|
161
|
-
}
|
|
162
|
-
console.log(`\n ${results.count} remote-capable server${results.count !== 1 ? 's' : ''} for "${query}"\n`);
|
|
163
|
-
console.log(` ${'Name'.padEnd(35)} ${'Type'.padEnd(18)} URL`);
|
|
164
|
-
console.log(' ' + '-'.repeat(90));
|
|
165
|
-
for (const s of results.servers) {
|
|
166
|
-
const name = s.title || s.name.split('/').pop() || s.name;
|
|
167
|
-
const remote = s.remotes[0];
|
|
168
|
-
const transport = remote ? remote.type : 'N/A';
|
|
169
|
-
const url = remote ? truncateUrl(remote.url, 40) : 'N/A';
|
|
170
|
-
console.log(` ${name.padEnd(35)} ${transport.padEnd(18)} ${url}`);
|
|
171
|
-
}
|
|
172
|
-
console.log(`\n Connect with: runwork mcp install <name>`);
|
|
173
|
-
console.log('');
|
|
174
|
-
}
|
|
175
|
-
catch (err) {
|
|
176
|
-
console.error('Search failed:', err instanceof Error ? err.message : err);
|
|
177
|
-
process.exit(1);
|
|
178
|
-
}
|
|
179
|
-
});
|
|
180
|
-
const installCommand = new Command('install')
|
|
181
|
-
.description('Install a community MCP server from the MCP Registry into your workspace')
|
|
182
|
-
.argument('<query>', 'Server name or search query')
|
|
183
|
-
.option('--workspace <id>', 'Workspace ID')
|
|
184
|
-
.action(async (query, opts, command) => {
|
|
185
|
-
const useJson = shouldOutputJson(command.optsWithGlobals().json);
|
|
186
|
-
const credentials = requireAuth();
|
|
187
|
-
const client = new ApiClient(credentials);
|
|
188
|
-
const { workspaceId } = await resolveWorkspace(client, opts);
|
|
189
|
-
try {
|
|
190
|
-
const results = await client.searchCommunityMcpServers(query, 5);
|
|
191
|
-
if (results.servers.length === 0) {
|
|
192
|
-
console.error(`No remote-capable MCP servers found for "${query}".`);
|
|
193
|
-
process.exit(1);
|
|
194
|
-
}
|
|
195
|
-
// Pick best match (first result)
|
|
196
|
-
const server = results.servers[0];
|
|
197
|
-
const remote = server.remotes[0];
|
|
198
|
-
if (!remote) {
|
|
199
|
-
console.error(`Server "${server.name}" has no remote endpoint.`);
|
|
200
|
-
process.exit(1);
|
|
201
|
-
}
|
|
202
|
-
if (remote.url.includes('{') && remote.url.includes('}')) {
|
|
203
|
-
console.error(`Server "${server.name}" requires configuration variables in its URL.`);
|
|
204
|
-
console.error(`URL template: ${remote.url}`);
|
|
205
|
-
console.error('Use `runwork mcp add <name> <url>` to add it manually with the correct URL.');
|
|
206
|
-
process.exit(1);
|
|
207
|
-
}
|
|
208
|
-
const displayName = server.title || server.name.split('/').pop() || server.name;
|
|
209
|
-
if (!opts.yes && !useJson) {
|
|
210
|
-
console.log(`\n Found: ${displayName}`);
|
|
211
|
-
console.log(` URL: ${remote.url}`);
|
|
212
|
-
console.log(` Type: ${remote.type}\n`);
|
|
213
|
-
const confirmed = await promptConfirm(`Connect "${displayName}" to your workspace?`);
|
|
214
|
-
if (!confirmed)
|
|
215
|
-
return;
|
|
216
|
-
}
|
|
217
|
-
const added = await client.addMcpServer(workspaceId, {
|
|
218
|
-
name: displayName,
|
|
219
|
-
url: remote.url,
|
|
220
|
-
transport: remote.type,
|
|
221
|
-
});
|
|
222
|
-
if (useJson) {
|
|
223
|
-
jsonOut({ server: added, source: server.name });
|
|
224
|
-
return;
|
|
225
|
-
}
|
|
226
|
-
console.log(`Connected "${displayName}" (${remote.url})`);
|
|
227
|
-
console.log('Run `runwork sync` to update your local agent configs.');
|
|
228
|
-
}
|
|
229
|
-
catch (err) {
|
|
230
|
-
console.error('Install failed:', err instanceof Error ? err.message : err);
|
|
231
|
-
process.exit(1);
|
|
232
|
-
}
|
|
233
|
-
});
|
|
234
|
-
function truncateUrl(url, max) {
|
|
235
|
-
if (url.length <= max)
|
|
236
|
-
return url;
|
|
237
|
-
return url.slice(0, max - 3) + '...';
|
|
238
|
-
}
|
|
239
|
-
export const mcpCommand = new Command('mcp')
|
|
240
|
-
.description('Manage workspace MCP servers')
|
|
241
|
-
.addCommand(listCommand)
|
|
242
|
-
.addCommand(addCommand)
|
|
243
|
-
.addCommand(removeCommand)
|
|
244
|
-
.addCommand(searchCommand)
|
|
245
|
-
.addCommand(installCommand);
|
package/dist/commands/open.d.ts
DELETED
package/dist/commands/open.js
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { Command } from 'commander';
|
|
2
|
-
import { readFileSync, existsSync } from 'fs';
|
|
3
|
-
import { requireAuth } from '../auth/store.js';
|
|
4
|
-
import { ApiClient } from '../api/client.js';
|
|
5
|
-
import { cyan } from '../ui/colors.js';
|
|
6
|
-
import { shouldOutputJson, jsonOut } from '../utils/output.js';
|
|
7
|
-
export const openCommand = new Command('open')
|
|
8
|
-
.description('Open app preview or dashboard in browser')
|
|
9
|
-
.argument('[target]', 'What to open: preview (default), dashboard', 'preview')
|
|
10
|
-
.action(async (target, _opts, command) => {
|
|
11
|
-
const useJson = shouldOutputJson(command.optsWithGlobals().json);
|
|
12
|
-
if (!existsSync('.runwork.json')) {
|
|
13
|
-
console.error('No .runwork.json found. Run `runwork init` first.');
|
|
14
|
-
process.exit(1);
|
|
15
|
-
}
|
|
16
|
-
const config = JSON.parse(readFileSync('.runwork.json', 'utf-8'));
|
|
17
|
-
const creds = requireAuth();
|
|
18
|
-
const client = new ApiClient(creds);
|
|
19
|
-
const open = await import('open');
|
|
20
|
-
switch (target) {
|
|
21
|
-
case 'preview': {
|
|
22
|
-
let previewUrl;
|
|
23
|
-
try {
|
|
24
|
-
const status = await client.getDevStatus(config.appId);
|
|
25
|
-
previewUrl = status.previewUrl;
|
|
26
|
-
}
|
|
27
|
-
catch {
|
|
28
|
-
const session = await client.startDevSession(config.appId);
|
|
29
|
-
previewUrl = session.previewUrl;
|
|
30
|
-
}
|
|
31
|
-
if (useJson) {
|
|
32
|
-
jsonOut({ target: 'preview', url: previewUrl });
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
console.log(`Opening preview: ${cyan(previewUrl)}`);
|
|
36
|
-
await open.default(previewUrl);
|
|
37
|
-
break;
|
|
38
|
-
}
|
|
39
|
-
case 'dashboard': {
|
|
40
|
-
const url = `${creds.baseUrl}/apps/${config.appId}`;
|
|
41
|
-
if (useJson) {
|
|
42
|
-
jsonOut({ target: 'dashboard', url });
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
console.log(`Opening dashboard: ${cyan(url)}`);
|
|
46
|
-
await open.default(url);
|
|
47
|
-
break;
|
|
48
|
-
}
|
|
49
|
-
default:
|
|
50
|
-
console.error(`Unknown target: ${target}. Use "preview" or "dashboard".`);
|
|
51
|
-
process.exit(1);
|
|
52
|
-
}
|
|
53
|
-
});
|
package/dist/commands/resume.js
DELETED
|
@@ -1,289 +0,0 @@
|
|
|
1
|
-
import { Command } from 'commander';
|
|
2
|
-
import { writeFileSync, mkdirSync, realpathSync } from 'fs';
|
|
3
|
-
import { homedir } from 'os';
|
|
4
|
-
import { join } from 'path';
|
|
5
|
-
import { spawn } from 'child_process';
|
|
6
|
-
import { requireAuth } from '../auth/store.js';
|
|
7
|
-
import { ApiClient } from '../api/client.js';
|
|
8
|
-
import { resolveWorkspace } from '../workspace/resolve.js';
|
|
9
|
-
import { shouldOutputJson, jsonOut } from '../utils/output.js';
|
|
10
|
-
import { getAgent } from '../agents/registry-data.js';
|
|
11
|
-
import { detectCurrentAgent } from '../agents/runtime-detection.js';
|
|
12
|
-
import { whichBinary } from '../utils/which.js';
|
|
13
|
-
/**
|
|
14
|
-
* Mirror of Claude Code's cwd encoding rule: replace every non-alphanumeric
|
|
15
|
-
* character with '-'. The canonical (realpath-resolved) cwd is encoded so
|
|
16
|
-
* /tmp/foo on macOS encodes the same as /private/tmp/foo (which is how
|
|
17
|
-
* Claude Code itself resolves the cwd).
|
|
18
|
-
*/
|
|
19
|
-
function encodeClaudeCodeCwd(cwd) {
|
|
20
|
-
let canonical;
|
|
21
|
-
try {
|
|
22
|
-
canonical = realpathSync(cwd);
|
|
23
|
-
}
|
|
24
|
-
catch {
|
|
25
|
-
canonical = cwd;
|
|
26
|
-
}
|
|
27
|
-
return canonical.replace(/[^a-zA-Z0-9]/g, '-');
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Extract the original Claude Code session UUID from the first event of a
|
|
31
|
-
* JSONL bundle. Claude Code's `--resume <uuid>` expects this UUID; the
|
|
32
|
-
* filename on disk must match `<uuid>.jsonl`.
|
|
33
|
-
*/
|
|
34
|
-
function extractClaudeCodeUuid(jsonlContent) {
|
|
35
|
-
const firstLine = jsonlContent.split('\n').find(l => l.trim().length > 0);
|
|
36
|
-
if (!firstLine)
|
|
37
|
-
return null;
|
|
38
|
-
try {
|
|
39
|
-
const event = JSON.parse(firstLine);
|
|
40
|
-
return event.sessionId ?? null;
|
|
41
|
-
}
|
|
42
|
-
catch {
|
|
43
|
-
return null;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Extract the original Codex thread UUID from the first event of a rollout
|
|
48
|
-
* file. `codex resume <UUID>` accepts this id; the file's filename embeds it.
|
|
49
|
-
*/
|
|
50
|
-
function extractCodexUuid(rolloutContent) {
|
|
51
|
-
const firstLine = rolloutContent.split('\n').find(l => l.trim().length > 0);
|
|
52
|
-
if (!firstLine)
|
|
53
|
-
return null;
|
|
54
|
-
try {
|
|
55
|
-
const event = JSON.parse(firstLine);
|
|
56
|
-
return event.payload?.id ?? null;
|
|
57
|
-
}
|
|
58
|
-
catch {
|
|
59
|
-
return null;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
function placeClaudeJsonl(uuid, content, recipientCwd) {
|
|
63
|
-
const encoded = encodeClaudeCodeCwd(recipientCwd);
|
|
64
|
-
const projectDir = join(homedir(), '.claude', 'projects', encoded);
|
|
65
|
-
mkdirSync(projectDir, { recursive: true });
|
|
66
|
-
const placedAt = join(projectDir, `${uuid}.jsonl`);
|
|
67
|
-
writeFileSync(placedAt, content);
|
|
68
|
-
return { placedAt, runFromCwd: recipientCwd };
|
|
69
|
-
}
|
|
70
|
-
function placeCodexRollout(uuid, content) {
|
|
71
|
-
const now = new Date();
|
|
72
|
-
const yyyy = String(now.getUTCFullYear());
|
|
73
|
-
const mm = String(now.getUTCMonth() + 1).padStart(2, '0');
|
|
74
|
-
const dd = String(now.getUTCDate()).padStart(2, '0');
|
|
75
|
-
const dir = join(homedir(), '.codex', 'sessions', yyyy, mm, dd);
|
|
76
|
-
mkdirSync(dir, { recursive: true });
|
|
77
|
-
// Filename pattern Codex itself uses: rollout-YYYY-MM-DDThh-mm-ss-<uuid>.jsonl
|
|
78
|
-
const ts = now.toISOString().replace(/\.\d+Z$/, '').replace(/:/g, '-');
|
|
79
|
-
const placedAt = join(dir, `rollout-${ts}-${uuid}.jsonl`);
|
|
80
|
-
writeFileSync(placedAt, content);
|
|
81
|
-
return { placedAt };
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* Pick the target agent based on flag overrides, the share's sourceAgent,
|
|
85
|
-
* and what's installed locally.
|
|
86
|
-
*/
|
|
87
|
-
function pickTargetAgent(opts, sourceAgent) {
|
|
88
|
-
if (opts.agent) {
|
|
89
|
-
return getAgent(opts.agent) ?? null;
|
|
90
|
-
}
|
|
91
|
-
// Prefer the same agent the sender used, if installed
|
|
92
|
-
const source = getAgent(sourceAgent);
|
|
93
|
-
if (source && isAgentInstalled(source)) {
|
|
94
|
-
return source;
|
|
95
|
-
}
|
|
96
|
-
// Fall back to the sender's agent registry entry even if not detectably installed
|
|
97
|
-
// (the user may have it; better to print accurate instructions than abort)
|
|
98
|
-
return source ?? null;
|
|
99
|
-
}
|
|
100
|
-
function isAgentInstalled(agent) {
|
|
101
|
-
// Lightweight check: just look for the launch binary on PATH.
|
|
102
|
-
// More comprehensive detection lives in agents/detection.ts but requires
|
|
103
|
-
// async resolution; this synchronous check is good enough for resume.
|
|
104
|
-
if (agent.launch?.cli) {
|
|
105
|
-
return !!whichBinary(agent.launch.cli);
|
|
106
|
-
}
|
|
107
|
-
return false;
|
|
108
|
-
}
|
|
109
|
-
export const resumeCommand = new Command('resume')
|
|
110
|
-
.description('Resume a shared conversation locally in your agent of choice')
|
|
111
|
-
.argument('<share-id>', 'The share ID (sc_*) returned by share-convo or save-convo')
|
|
112
|
-
.option('--agent <slug>', 'Override target agent (e.g. claude-code, codex)')
|
|
113
|
-
.option('--into <path>', 'Override target cwd (defaults to current $PWD)')
|
|
114
|
-
.option('--dry-run', 'Print the resume command instead of executing it')
|
|
115
|
-
.option('--pick', 'Show interactive picker (requires TTY) - not yet implemented')
|
|
116
|
-
.option('--workspace <id>', 'Workspace ID')
|
|
117
|
-
.action(async (shareId, opts, command) => {
|
|
118
|
-
const useJson = shouldOutputJson(command.optsWithGlobals().json);
|
|
119
|
-
const credentials = requireAuth();
|
|
120
|
-
const client = new ApiClient(credentials);
|
|
121
|
-
const { workspaceId } = await resolveWorkspace(client, { workspace: opts.workspace });
|
|
122
|
-
let share;
|
|
123
|
-
try {
|
|
124
|
-
const { share: raw } = await client.getSharedConversation(workspaceId, shareId);
|
|
125
|
-
share = raw;
|
|
126
|
-
}
|
|
127
|
-
catch (err) {
|
|
128
|
-
console.error(`Failed to fetch share ${shareId}: ${err instanceof Error ? err.message : err}`);
|
|
129
|
-
process.exit(1);
|
|
130
|
-
}
|
|
131
|
-
// If --agent not provided, detect what the user is currently in - that's
|
|
132
|
-
// often the best default ("share to me, resume in same agent")
|
|
133
|
-
if (!opts.agent) {
|
|
134
|
-
const detected = detectCurrentAgent();
|
|
135
|
-
if (detected) {
|
|
136
|
-
opts.agent = detected.slug;
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
const target = pickTargetAgent(opts, share.sourceAgent);
|
|
140
|
-
if (!target) {
|
|
141
|
-
console.error(`No target agent could be determined. Pass --agent <slug> or install the source agent (${share.sourceAgent}).`);
|
|
142
|
-
process.exit(1);
|
|
143
|
-
}
|
|
144
|
-
const cap = target.resumeCapability;
|
|
145
|
-
// Tier 3 fallback: no native resume - print a paste-prompt
|
|
146
|
-
if (!cap || cap.mode === 'unsupported' || !cap.nativeBundleFormat) {
|
|
147
|
-
const promptText = buildPastePrompt(shareId, share.title);
|
|
148
|
-
if (useJson) {
|
|
149
|
-
jsonOut({ mode: 'paste-prompt', shareId, prompt: promptText });
|
|
150
|
-
return;
|
|
151
|
-
}
|
|
152
|
-
console.log(`\n${target.name} does not support native resume. Paste this prompt into your agent:\n`);
|
|
153
|
-
console.log('---');
|
|
154
|
-
console.log(promptText);
|
|
155
|
-
console.log('---\n');
|
|
156
|
-
return;
|
|
157
|
-
}
|
|
158
|
-
// Need a matching native bundle on the share
|
|
159
|
-
const hasNative = (share.bundles ?? []).some(b => b.format === cap.nativeBundleFormat);
|
|
160
|
-
if (!hasNative) {
|
|
161
|
-
console.error(`This share has no ${cap.nativeBundleFormat} bundle (sourceAgent was ${share.sourceAgent}). ` +
|
|
162
|
-
`Falling back to paste-prompt.`);
|
|
163
|
-
const promptText = buildPastePrompt(shareId, share.title);
|
|
164
|
-
console.log('\n---');
|
|
165
|
-
console.log(promptText);
|
|
166
|
-
console.log('---\n');
|
|
167
|
-
return;
|
|
168
|
-
}
|
|
169
|
-
// Download the native bundle content
|
|
170
|
-
const bundle = await client.downloadSharedConversationBundle(workspaceId, shareId, cap.nativeBundleFormat);
|
|
171
|
-
// Extract the ORIGINAL session UUID from the bundle content - that's
|
|
172
|
-
// what the native resume command expects, not our share ID.
|
|
173
|
-
let nativeUuid;
|
|
174
|
-
if (cap.nativeBundleFormat === 'claude-jsonl') {
|
|
175
|
-
nativeUuid = extractClaudeCodeUuid(bundle.content);
|
|
176
|
-
}
|
|
177
|
-
else if (cap.nativeBundleFormat === 'codex-rollout') {
|
|
178
|
-
nativeUuid = extractCodexUuid(bundle.content);
|
|
179
|
-
}
|
|
180
|
-
else {
|
|
181
|
-
console.error(`No UUID extraction strategy for native bundle format ${cap.nativeBundleFormat}`);
|
|
182
|
-
process.exit(1);
|
|
183
|
-
}
|
|
184
|
-
if (!nativeUuid) {
|
|
185
|
-
console.error(`Could not extract native session UUID from ${cap.nativeBundleFormat} bundle. ` +
|
|
186
|
-
`The bundle may be malformed.`);
|
|
187
|
-
process.exit(1);
|
|
188
|
-
}
|
|
189
|
-
// Place the file per-agent using the original UUID
|
|
190
|
-
let placement;
|
|
191
|
-
const recipientCwd = opts.into ?? process.cwd();
|
|
192
|
-
if (cap.nativeBundleFormat === 'claude-jsonl') {
|
|
193
|
-
placement = placeClaudeJsonl(nativeUuid, bundle.content, recipientCwd);
|
|
194
|
-
}
|
|
195
|
-
else if (cap.nativeBundleFormat === 'codex-rollout') {
|
|
196
|
-
placement = placeCodexRollout(nativeUuid, bundle.content);
|
|
197
|
-
}
|
|
198
|
-
else {
|
|
199
|
-
console.error(`No placement strategy for native bundle format ${cap.nativeBundleFormat}`);
|
|
200
|
-
process.exit(1);
|
|
201
|
-
}
|
|
202
|
-
// Tell the server we resumed it (best-effort)
|
|
203
|
-
client.markSharedConversationResumed(workspaceId, shareId).catch(() => {
|
|
204
|
-
// Non-fatal; the user is already up and resuming
|
|
205
|
-
});
|
|
206
|
-
if (cap.mode === 'file-drop-only') {
|
|
207
|
-
const result = {
|
|
208
|
-
mode: 'file-drop-only',
|
|
209
|
-
agent: target.slug,
|
|
210
|
-
placedAt: placement.placedAt,
|
|
211
|
-
hint: cap.manualOpenHint ?? `Open ${target.name} to find this session in your history.`,
|
|
212
|
-
};
|
|
213
|
-
if (useJson) {
|
|
214
|
-
jsonOut(result);
|
|
215
|
-
return;
|
|
216
|
-
}
|
|
217
|
-
console.log(`\nBundle placed at: ${placement.placedAt}`);
|
|
218
|
-
console.log(`${result.hint}\n`);
|
|
219
|
-
return;
|
|
220
|
-
}
|
|
221
|
-
if (cap.mode === 'cli-resume') {
|
|
222
|
-
// Substitute {uuid} in the resume command template with the original
|
|
223
|
-
// session UUID we extracted from the bundle content.
|
|
224
|
-
const cmd = (cap.cliResumeCommand ?? '').replace(/\{uuid\}/g, nativeUuid);
|
|
225
|
-
// If we're running inside the SAME agent we'd resume into (very common
|
|
226
|
-
// when an LLM in claude-code invokes `runwork resume` to pick up a
|
|
227
|
-
// saved claude-code conversation), exec'ing `claude --resume <uuid>`
|
|
228
|
-
// from inside that session is broken: the child claude process can't
|
|
229
|
-
// attach to the parent's TTY and the resume hits agent-specific edge
|
|
230
|
-
// cases ("No deferred tool marker found in the resumed session..."
|
|
231
|
-
// for Claude Code). Detect this and degrade to print-the-command mode
|
|
232
|
-
// so the user can copy/paste into a fresh terminal -- AND tell the
|
|
233
|
-
// caller agent that the in-session continuation path is via the
|
|
234
|
-
// `get_shared_conversation` MCP tool, which inlines the transcript.
|
|
235
|
-
const detected = detectCurrentAgent();
|
|
236
|
-
const insideSameAgent = detected && detected.slug === target.slug;
|
|
237
|
-
const shouldPrintOnly = opts.dryRun || insideSameAgent;
|
|
238
|
-
if (shouldPrintOnly) {
|
|
239
|
-
const fullCmd = placement.runFromCwd
|
|
240
|
-
? `cd "${placement.runFromCwd}" && ${cmd}`
|
|
241
|
-
: cmd;
|
|
242
|
-
const result = {
|
|
243
|
-
mode: 'cli-resume',
|
|
244
|
-
agent: target.slug,
|
|
245
|
-
placedAt: placement.placedAt,
|
|
246
|
-
command: fullCmd,
|
|
247
|
-
insideSameAgent: !!insideSameAgent,
|
|
248
|
-
};
|
|
249
|
-
if (useJson) {
|
|
250
|
-
jsonOut(result);
|
|
251
|
-
return;
|
|
252
|
-
}
|
|
253
|
-
console.log(`\nBundle placed at: ${placement.placedAt}`);
|
|
254
|
-
if (insideSameAgent) {
|
|
255
|
-
console.log(`\nYou are already inside ${target.name}, so I can't auto-launch a new session in this terminal.`);
|
|
256
|
-
console.log(`To resume natively, exit this session and run in a fresh terminal:`);
|
|
257
|
-
console.log(` ${fullCmd}`);
|
|
258
|
-
console.log(`\nOr ask the assistant to continue the conversation in THIS session by ` +
|
|
259
|
-
`fetching the transcript via the Runwork MCP \`get_shared_conversation\` tool ` +
|
|
260
|
-
`(share ID: ${shareId}).`);
|
|
261
|
-
}
|
|
262
|
-
else {
|
|
263
|
-
console.log(`Run: ${fullCmd}\n`);
|
|
264
|
-
}
|
|
265
|
-
return;
|
|
266
|
-
}
|
|
267
|
-
// Exec the resume command (fresh-shell case)
|
|
268
|
-
const parts = cmd.split(' ');
|
|
269
|
-
const child = spawn(parts[0], parts.slice(1), {
|
|
270
|
-
cwd: placement.runFromCwd ?? recipientCwd,
|
|
271
|
-
stdio: 'inherit',
|
|
272
|
-
});
|
|
273
|
-
child.on('exit', (code) => {
|
|
274
|
-
process.exit(code ?? 0);
|
|
275
|
-
});
|
|
276
|
-
return;
|
|
277
|
-
}
|
|
278
|
-
console.error(`Unexpected resumeCapability.mode: ${cap.mode}`);
|
|
279
|
-
process.exit(1);
|
|
280
|
-
});
|
|
281
|
-
function buildPastePrompt(shareId, title) {
|
|
282
|
-
return `Continue the conversation that a teammate shared with me. The share ID is ${shareId} (title: "${title}").
|
|
283
|
-
|
|
284
|
-
PREFERRED: if the \`runwork\` CLI is installed locally, run:
|
|
285
|
-
runwork resume ${shareId}
|
|
286
|
-
That auto-detects your active agent and resumes natively if possible.
|
|
287
|
-
|
|
288
|
-
FALLBACK: use the Runwork MCP tool \`get_shared_conversation\` with this share ID to fetch the full transcript, then continue from where the conversation left off.`;
|
|
289
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Command } from 'commander';
|
|
2
|
-
/**
|
|
3
|
-
* `runwork save-convo` - personal checkpoint of the current AI conversation.
|
|
4
|
-
*
|
|
5
|
-
* Thin alias over `share-convo` with isPersonal=true. The recipient is always
|
|
6
|
-
* the sender; no notifications are sent. Same capture mechanics otherwise.
|
|
7
|
-
*/
|
|
8
|
-
export declare const saveConvoCommand: Command;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { Command } from 'commander';
|
|
2
|
-
import { runShareConvo } from './share-convo.js';
|
|
3
|
-
/**
|
|
4
|
-
* `runwork save-convo` - personal checkpoint of the current AI conversation.
|
|
5
|
-
*
|
|
6
|
-
* Thin alias over `share-convo` with isPersonal=true. The recipient is always
|
|
7
|
-
* the sender; no notifications are sent. Same capture mechanics otherwise.
|
|
8
|
-
*/
|
|
9
|
-
export const saveConvoCommand = new Command('save-convo')
|
|
10
|
-
.description('Save the current AI conversation as a personal checkpoint')
|
|
11
|
-
.option('--transcript-file <path>', 'Path to the LLM-emitted markdown transcript (required)')
|
|
12
|
-
.option('--native-file <path>', 'Path to the native session file (optional; auto-detected from env vars)')
|
|
13
|
-
.option('--source-agent <slug>', 'Override host-agent detection')
|
|
14
|
-
.option('--title <string>', 'Short title for the conversation (required)')
|
|
15
|
-
.option('--note <string>', 'Optional note to your future self')
|
|
16
|
-
.option('--ttl-days <n>', 'Days until expiration (1-30, default 7)')
|
|
17
|
-
.option('--metadata-json <json>', 'Inline JSON object with workMode, openQuestions, etc.')
|
|
18
|
-
.option('--metadata-file <path>', 'Path to a JSON file with metadata fields')
|
|
19
|
-
.option('--workspace <id>', 'Workspace ID')
|
|
20
|
-
.action((opts, command) => runShareConvo({ ...opts, personal: true }, command, true));
|