runwork 0.15.0 → 0.15.2
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/dist/index.js +19272 -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 -97
- 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 -53
- package/dist/agents/claude-code.js +0 -754
- 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 -48
- package/dist/agents/cursor.js +0 -324
- 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 -72
- package/dist/agents/defaults-merge.js +0 -131
- 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
|
@@ -1,233 +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 { shouldOutputJson, jsonOut } from '../utils/output.js';
|
|
6
|
-
import { resolveWorkspace } from '../workspace/resolve.js';
|
|
7
|
-
import { parseCurlToRequest } from '../utils/curl-parser.js';
|
|
8
|
-
const searchCommand = new Command('search')
|
|
9
|
-
.description('Search available integrations from the platform catalog')
|
|
10
|
-
.argument('<query>', 'Search query (e.g., "google drive", "hubspot", "slack")')
|
|
11
|
-
.option('--limit <n>', 'Maximum results to show', '20')
|
|
12
|
-
.option('--workspace <id>', 'Workspace ID (enables team usage info)')
|
|
13
|
-
.action(async (query, opts, command) => {
|
|
14
|
-
const useJson = shouldOutputJson(command.optsWithGlobals().json);
|
|
15
|
-
const credentials = requireAuth();
|
|
16
|
-
const client = new ApiClient(credentials);
|
|
17
|
-
const limit = parseInt(opts.limit, 10);
|
|
18
|
-
try {
|
|
19
|
-
// Resolve workspace for enriched search results (connectedByUser, usedByTeammates)
|
|
20
|
-
let workspaceId;
|
|
21
|
-
try {
|
|
22
|
-
const resolved = await resolveWorkspace(client, opts);
|
|
23
|
-
workspaceId = resolved.workspaceId;
|
|
24
|
-
}
|
|
25
|
-
catch {
|
|
26
|
-
// Workspace not available, search without enrichment
|
|
27
|
-
}
|
|
28
|
-
const { results } = await client.searchIntegrations(query, limit, workspaceId);
|
|
29
|
-
if (useJson) {
|
|
30
|
-
const items = results.map(({ provider: _p, ...rest }) => rest);
|
|
31
|
-
jsonOut({ results: items });
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
if (results.length === 0) {
|
|
35
|
-
console.log(`No integrations found for "${query}".`);
|
|
36
|
-
console.log('Try broader terms (e.g., "calendar" instead of "google calendar").');
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
console.log(`Found ${results.length} integration(s) for "${query}":\n`);
|
|
40
|
-
for (const r of results) {
|
|
41
|
-
const tags = [];
|
|
42
|
-
if (r.connectedByUser)
|
|
43
|
-
tags.push('[connected]');
|
|
44
|
-
else if (r.usedByTeammates)
|
|
45
|
-
tags.push('[used by teammates]');
|
|
46
|
-
const tagStr = tags.length > 0 ? ` ${tags.join(' ')}` : '';
|
|
47
|
-
console.log(` ${r.id} - ${r.name} (${r.provider})${tagStr}`);
|
|
48
|
-
if (r.docs) {
|
|
49
|
-
console.log(` Base URL: ${r.docs.baseUrl}`);
|
|
50
|
-
console.log(` Path format: ${r.docs.pathFormat}`);
|
|
51
|
-
if (r.docs.examples && r.docs.examples.length > 0) {
|
|
52
|
-
console.log(` Endpoints:`);
|
|
53
|
-
for (const example of r.docs.examples) {
|
|
54
|
-
console.log(` ${example}`);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
if (r.docs.notes && r.docs.notes.length > 0) {
|
|
58
|
-
for (const note of r.docs.notes) {
|
|
59
|
-
console.log(` Note: ${note}`);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
if (r.docs.requiredSetup) {
|
|
63
|
-
console.log(` Setup: ${r.docs.requiredSetup}`);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
console.log('');
|
|
67
|
-
}
|
|
68
|
-
console.log('\nUsage: Add the integration ID to APP_INTEGRATION_REQUIREMENTS in worker/integration-requirements.ts');
|
|
69
|
-
}
|
|
70
|
-
catch (err) {
|
|
71
|
-
console.error('Failed to search integrations:', err instanceof Error ? err.message : err);
|
|
72
|
-
process.exit(1);
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
const listCommand = new Command('list')
|
|
76
|
-
.description('List connected workspace integrations')
|
|
77
|
-
.option('--workspace <id>', 'Workspace ID')
|
|
78
|
-
.action(async (opts, command) => {
|
|
79
|
-
const useJson = shouldOutputJson(command.optsWithGlobals().json);
|
|
80
|
-
const credentials = requireAuth();
|
|
81
|
-
const client = new ApiClient(credentials);
|
|
82
|
-
const { workspaceId } = await resolveWorkspace(client, opts);
|
|
83
|
-
try {
|
|
84
|
-
const integrations = await client.listConnectedIntegrations(workspaceId);
|
|
85
|
-
const teamUsage = await client.getTeamIntegrationUsage(workspaceId);
|
|
86
|
-
if (useJson) {
|
|
87
|
-
const items = integrations.map(i => ({
|
|
88
|
-
id: i.canonicalId || i.integrationId,
|
|
89
|
-
status: i.status || 'connected',
|
|
90
|
-
createdAt: i.createdAt || null,
|
|
91
|
-
}));
|
|
92
|
-
const teamItems = teamUsage
|
|
93
|
-
.filter(t => !t.connectedByMe && t.userCount > 0)
|
|
94
|
-
.map(t => ({
|
|
95
|
-
canonicalId: t.canonicalId,
|
|
96
|
-
userCount: t.userCount,
|
|
97
|
-
users: t.users.map(u => u.name),
|
|
98
|
-
}));
|
|
99
|
-
jsonOut({ items, teamUsage: teamItems });
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
|
-
if (integrations.length === 0) {
|
|
103
|
-
console.log('No integrations connected in this workspace.');
|
|
104
|
-
console.log('Connect integrations at https://runwork.ai/workspace-settings');
|
|
105
|
-
}
|
|
106
|
-
else {
|
|
107
|
-
console.log(`Connected integrations (${integrations.length}):\n`);
|
|
108
|
-
for (const i of integrations) {
|
|
109
|
-
const id = i.canonicalId || i.integrationId;
|
|
110
|
-
const status = i.status || 'connected';
|
|
111
|
-
const date = i.createdAt ? ` (since ${new Date(i.createdAt).toLocaleDateString()})` : '';
|
|
112
|
-
console.log(` ${id} - ${i.provider}${date} [${status}]`);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
const teamOnly = teamUsage.filter(t => !t.connectedByMe && t.userCount > 0);
|
|
116
|
-
if (teamOnly.length > 0) {
|
|
117
|
-
console.log(`\nUsed by your team (${teamOnly.length} more):\n`);
|
|
118
|
-
for (const t of teamOnly) {
|
|
119
|
-
const names = t.users.map(u => u.name);
|
|
120
|
-
const display = names.length <= 3
|
|
121
|
-
? names.join(', ')
|
|
122
|
-
: `${names.slice(0, 2).join(', ')}, and ${names.length - 2} other${names.length - 2 !== 1 ? 's' : ''}`;
|
|
123
|
-
console.log(` ${t.canonicalId} - Used by ${display}`);
|
|
124
|
-
}
|
|
125
|
-
console.log(`\n Connect at https://runwork.ai/workspace-settings?section=integrations`);
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
catch (err) {
|
|
129
|
-
console.error('Failed to list integrations:', err instanceof Error ? err.message : err);
|
|
130
|
-
process.exit(1);
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
-
const callCommand = new Command('call')
|
|
134
|
-
.description('Make a proxy call to a connected integration')
|
|
135
|
-
.argument('<integration>', 'Integration name (e.g., hubspot, slack)')
|
|
136
|
-
.argument('[method]', 'HTTP method (GET, POST, PUT, DELETE)')
|
|
137
|
-
.argument('[path]', 'API path (e.g., /crm/v3/contacts)')
|
|
138
|
-
.option('--workspace <id>', 'Workspace ID')
|
|
139
|
-
.option('--body <json>', 'Request body JSON')
|
|
140
|
-
.option('--header <header>', 'Request header (repeatable)', (val, prev) => [...prev, val], [])
|
|
141
|
-
.option('--query <query>', 'Query string (e.g., limit=10&offset=0)')
|
|
142
|
-
.option('--curl <command>', 'Parse a curl command (paste from Chrome DevTools "Copy as cURL")')
|
|
143
|
-
.option('--curl-file <file>', 'Read curl command from a file')
|
|
144
|
-
.action(async (integration, method, path, opts, command) => {
|
|
145
|
-
const useJson = shouldOutputJson(command.optsWithGlobals().json);
|
|
146
|
-
const credentials = requireAuth();
|
|
147
|
-
const client = new ApiClient(credentials);
|
|
148
|
-
const { workspaceId } = await resolveWorkspace(client, opts);
|
|
149
|
-
let finalMethod;
|
|
150
|
-
let finalPath;
|
|
151
|
-
const headers = {};
|
|
152
|
-
let body;
|
|
153
|
-
let query = opts.query;
|
|
154
|
-
// Mode 1: --curl or --curl-file
|
|
155
|
-
if (opts.curl || opts.curlFile) {
|
|
156
|
-
let curlStr = opts.curl;
|
|
157
|
-
if (opts.curlFile) {
|
|
158
|
-
const filePath = opts.curlFile;
|
|
159
|
-
if (!existsSync(filePath)) {
|
|
160
|
-
console.error(`File not found: ${filePath}`);
|
|
161
|
-
process.exit(1);
|
|
162
|
-
}
|
|
163
|
-
curlStr = readFileSync(filePath, 'utf-8');
|
|
164
|
-
}
|
|
165
|
-
try {
|
|
166
|
-
const result = await parseCurlToRequest(curlStr);
|
|
167
|
-
finalMethod = result.method;
|
|
168
|
-
finalPath = result.path;
|
|
169
|
-
if (result.query)
|
|
170
|
-
query = query || result.query;
|
|
171
|
-
Object.assign(headers, result.headers);
|
|
172
|
-
body = result.body;
|
|
173
|
-
}
|
|
174
|
-
catch (err) {
|
|
175
|
-
console.error('Failed to parse curl command:', err instanceof Error ? err.message : err);
|
|
176
|
-
process.exit(1);
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
// Mode 2: explicit method + path args
|
|
180
|
-
else if (method && path) {
|
|
181
|
-
finalMethod = method.toUpperCase();
|
|
182
|
-
finalPath = path;
|
|
183
|
-
// Parse headers from repeatable --header flags
|
|
184
|
-
for (const h of (opts.header || [])) {
|
|
185
|
-
const [key, ...rest] = h.split(':');
|
|
186
|
-
headers[key.trim()] = rest.join(':').trim();
|
|
187
|
-
}
|
|
188
|
-
// Parse body
|
|
189
|
-
if (opts.body) {
|
|
190
|
-
try {
|
|
191
|
-
body = JSON.parse(opts.body);
|
|
192
|
-
}
|
|
193
|
-
catch {
|
|
194
|
-
console.error('Invalid JSON in --body');
|
|
195
|
-
process.exit(1);
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
else {
|
|
200
|
-
console.error('Usage: runwork integrations call <integration> <method> <path>');
|
|
201
|
-
console.error(' or: runwork integrations call <integration> --curl "curl ..."');
|
|
202
|
-
process.exit(1);
|
|
203
|
-
}
|
|
204
|
-
try {
|
|
205
|
-
// Find the integration's database row ID from connected integrations
|
|
206
|
-
const integrations = await client.listConnectedIntegrations(workspaceId);
|
|
207
|
-
const match = integrations.find(i => (i.canonicalId || i.integrationId) === integration || i.provider === integration);
|
|
208
|
-
if (!match) {
|
|
209
|
-
console.error(`Integration "${integration}" not found. Run "runwork integrations list" to see connected integrations.`);
|
|
210
|
-
process.exit(1);
|
|
211
|
-
}
|
|
212
|
-
const result = await client.callIntegrationProxy(match.integrationId, finalMethod, finalPath, { body, headers: Object.keys(headers).length > 0 ? headers : undefined, query });
|
|
213
|
-
if (useJson) {
|
|
214
|
-
jsonOut(result);
|
|
215
|
-
return;
|
|
216
|
-
}
|
|
217
|
-
if (typeof result === 'string') {
|
|
218
|
-
console.log(result);
|
|
219
|
-
}
|
|
220
|
-
else {
|
|
221
|
-
console.log(JSON.stringify(result, null, 2));
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
catch (err) {
|
|
225
|
-
console.error('Failed to call integration:', err instanceof Error ? err.message : err);
|
|
226
|
-
process.exit(1);
|
|
227
|
-
}
|
|
228
|
-
});
|
|
229
|
-
export const integrationsCommand = new Command('integrations')
|
|
230
|
-
.description('Search and manage workspace integrations')
|
|
231
|
-
.addCommand(searchCommand)
|
|
232
|
-
.addCommand(listCommand)
|
|
233
|
-
.addCommand(callCommand);
|
package/dist/commands/login.d.ts
DELETED
package/dist/commands/login.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { Command } from 'commander';
|
|
2
|
-
import { performLogin, performLoginNoOpen, performLoginFromUrl, performLoginWithApiKey, } from '../auth/login-flow.js';
|
|
3
|
-
import { bold, cyan } from '../ui/colors.js';
|
|
4
|
-
export const loginCommand = new Command('login')
|
|
5
|
-
.description('Authenticate with Runwork platform')
|
|
6
|
-
.argument('[url]', 'Login URL from a previous --no-open session')
|
|
7
|
-
.option('--base-url <url>', 'Platform URL', 'https://runwork.ai')
|
|
8
|
-
.option('--no-open', 'Print login URL without opening browser (polls for completion)')
|
|
9
|
-
.option('--print-only', 'With --no-open: print URL and exit without polling')
|
|
10
|
-
.option('--api-key <key>', 'Authenticate directly with an API key (for CI)')
|
|
11
|
-
.action(async (url, options) => {
|
|
12
|
-
if (!options)
|
|
13
|
-
return;
|
|
14
|
-
// Mode 1: Direct API key auth
|
|
15
|
-
if (options.apiKey) {
|
|
16
|
-
await performLoginWithApiKey(options.apiKey, options.baseUrl);
|
|
17
|
-
return;
|
|
18
|
-
}
|
|
19
|
-
// Mode 2: Resume from a previously printed URL
|
|
20
|
-
if (url) {
|
|
21
|
-
await performLoginFromUrl(url);
|
|
22
|
-
printNextSteps();
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
// Mode 3: No-open (print URL, optionally poll)
|
|
26
|
-
if (!options.open) {
|
|
27
|
-
const result = await performLoginNoOpen(options.baseUrl, options.printOnly);
|
|
28
|
-
if (result)
|
|
29
|
-
printNextSteps();
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
// Mode 4: Default browser flow
|
|
33
|
-
await performLogin(options.baseUrl);
|
|
34
|
-
printNextSteps();
|
|
35
|
-
});
|
|
36
|
-
function printNextSteps() {
|
|
37
|
-
console.log('');
|
|
38
|
-
console.log(bold('What next?'));
|
|
39
|
-
console.log('');
|
|
40
|
-
console.log(` ${cyan('runwork init')} Create a new app`);
|
|
41
|
-
console.log(` ${cyan('runwork clone')} Clone an existing app`);
|
|
42
|
-
console.log(` ${cyan('runwork dev')} Start developing (inside an app directory)`);
|
|
43
|
-
console.log('');
|
|
44
|
-
}
|
package/dist/commands/logout.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Command } from 'commander';
|
|
2
|
-
import { clearCredentials, getCredentials } from '../auth/store.js';
|
|
3
|
-
import { removeGitCredentials } from '../git/credentials.js';
|
|
4
|
-
export const logoutCommand = new Command('logout')
|
|
5
|
-
.description('Remove stored Runwork credentials')
|
|
6
|
-
.action(async () => {
|
|
7
|
-
const creds = getCredentials();
|
|
8
|
-
if (creds) {
|
|
9
|
-
await removeGitCredentials(creds.baseUrl);
|
|
10
|
-
}
|
|
11
|
-
clearCredentials();
|
|
12
|
-
console.log('Logged out.');
|
|
13
|
-
});
|
package/dist/commands/logs.d.ts
DELETED
package/dist/commands/logs.js
DELETED
|
@@ -1,232 +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 { shouldOutputJson, jsonLine } from '../utils/output.js';
|
|
6
|
-
function readConfig() {
|
|
7
|
-
if (!existsSync('.runwork.json')) {
|
|
8
|
-
console.error('No .runwork.json found. Run `runwork init` first.');
|
|
9
|
-
process.exit(1);
|
|
10
|
-
}
|
|
11
|
-
return JSON.parse(readFileSync('.runwork.json', 'utf-8'));
|
|
12
|
-
}
|
|
13
|
-
function formatEvent(event) {
|
|
14
|
-
const time = new Date(event.timestamp).toLocaleTimeString();
|
|
15
|
-
const label = `[${event.source}/${event.type}]`;
|
|
16
|
-
const message = event.summary || event.content;
|
|
17
|
-
return `${time} ${label} ${message}`;
|
|
18
|
-
}
|
|
19
|
-
export const logsCommand = new Command('logs')
|
|
20
|
-
.description('View app logs and events')
|
|
21
|
-
.option('--production', 'Show production runtime logs')
|
|
22
|
-
.option('--events', 'Show app activity/events')
|
|
23
|
-
.option('--all', 'Show both runtime logs and events')
|
|
24
|
-
.option('--follow', 'Poll for new logs every 3s (TTY only; ignored when piped or with --json)')
|
|
25
|
-
.option('--once', 'Fetch once and exit, even if --follow is set (forced in non-TTY/agent contexts)')
|
|
26
|
-
.option('--limit <n>', 'Number of log entries to show', '25')
|
|
27
|
-
.option('--level <level>', 'Filter by log level (production only)')
|
|
28
|
-
.option('--search <text>', 'Search log content (production only)')
|
|
29
|
-
.option('--type <type>', 'Filter by event type (events only)')
|
|
30
|
-
.action(async (opts, command) => {
|
|
31
|
-
const useJson = shouldOutputJson(command.optsWithGlobals().json);
|
|
32
|
-
// Follow mode blocks forever (until SIGINT/SIGTERM), which deadlocks
|
|
33
|
-
// non-interactive callers: piped shells, CI, and AI agents never send
|
|
34
|
-
// those signals and hang waiting for the command to exit. Only follow
|
|
35
|
-
// when explicitly requested AND stdout is an interactive TTY AND we are
|
|
36
|
-
// not emitting JSON. `--once` forces single-shot even on a TTY.
|
|
37
|
-
const shouldFollow = Boolean(opts.follow) && !opts.once && !useJson && Boolean(process.stdout.isTTY);
|
|
38
|
-
const config = readConfig();
|
|
39
|
-
const creds = requireAuth();
|
|
40
|
-
const client = new ApiClient(creds);
|
|
41
|
-
const appId = config.appId;
|
|
42
|
-
const limit = parseInt(opts.limit, 10);
|
|
43
|
-
// --all means "show preview logs + events together"
|
|
44
|
-
// --production must be explicitly set for production logs
|
|
45
|
-
const showPreview = opts.all || (!opts.production && !opts.events);
|
|
46
|
-
const showProduction = opts.production || false;
|
|
47
|
-
const showEvents = opts.events || opts.all || false;
|
|
48
|
-
const showRuntime = showPreview || showProduction;
|
|
49
|
-
// Incremental cursor state for --follow mode preview logs
|
|
50
|
-
let lastStdoutLength = 0;
|
|
51
|
-
let lastStderrLength = 0;
|
|
52
|
-
let isFirstPoll = true;
|
|
53
|
-
const fetchAndPrint = async () => {
|
|
54
|
-
if (showRuntime) {
|
|
55
|
-
if (showProduction) {
|
|
56
|
-
try {
|
|
57
|
-
const { logs, pagination } = await client.getProductionLogs(appId, {
|
|
58
|
-
limit,
|
|
59
|
-
level: opts.level,
|
|
60
|
-
search: opts.search,
|
|
61
|
-
});
|
|
62
|
-
if (useJson) {
|
|
63
|
-
for (const entry of logs) {
|
|
64
|
-
jsonLine(entry);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
else {
|
|
68
|
-
if (logs.length === 0) {
|
|
69
|
-
console.log('No production logs found.');
|
|
70
|
-
}
|
|
71
|
-
else {
|
|
72
|
-
for (const entry of logs) {
|
|
73
|
-
console.log(JSON.stringify(entry));
|
|
74
|
-
}
|
|
75
|
-
if (pagination?.hasMore) {
|
|
76
|
-
console.log(`... ${pagination.total ? `${pagination.total} total entries` : 'more entries available'}`);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
catch (err) {
|
|
82
|
-
console.error('Failed to fetch production logs:', err.message);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
if (showPreview) {
|
|
86
|
-
// Preview logs (default)
|
|
87
|
-
try {
|
|
88
|
-
const { stdout, stderr } = await client.getPreviewLogs(appId);
|
|
89
|
-
if (shouldFollow && !isFirstPoll) {
|
|
90
|
-
// Incremental mode: only print new content since last poll
|
|
91
|
-
// Reset detection: if buffer was truncated (sandbox restart), reset cursor
|
|
92
|
-
if (stdout && stdout.length < lastStdoutLength) {
|
|
93
|
-
lastStdoutLength = 0;
|
|
94
|
-
}
|
|
95
|
-
if (stderr && stderr.length < lastStderrLength) {
|
|
96
|
-
lastStderrLength = 0;
|
|
97
|
-
}
|
|
98
|
-
if (stdout && stdout.length > lastStdoutLength) {
|
|
99
|
-
const newContent = stdout.slice(lastStdoutLength);
|
|
100
|
-
if (useJson) {
|
|
101
|
-
for (const line of newContent.split('\n')) {
|
|
102
|
-
if (line) {
|
|
103
|
-
jsonLine({ type: 'runtime', message: line, timestamp: new Date().toISOString() });
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
else {
|
|
108
|
-
process.stdout.write(newContent);
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
if (stderr && stderr.length > lastStderrLength) {
|
|
112
|
-
const newContent = stderr.slice(lastStderrLength);
|
|
113
|
-
if (useJson) {
|
|
114
|
-
for (const line of newContent.split('\n')) {
|
|
115
|
-
if (line) {
|
|
116
|
-
jsonLine({ type: 'error', message: line, timestamp: new Date().toISOString() });
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
else {
|
|
121
|
-
process.stderr.write(newContent);
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
lastStdoutLength = stdout ? stdout.length : 0;
|
|
125
|
-
lastStderrLength = stderr ? stderr.length : 0;
|
|
126
|
-
}
|
|
127
|
-
else {
|
|
128
|
-
// First poll or non-follow: print everything
|
|
129
|
-
if (useJson) {
|
|
130
|
-
if (stdout) {
|
|
131
|
-
for (const line of stdout.split('\n')) {
|
|
132
|
-
if (line) {
|
|
133
|
-
jsonLine({ type: 'runtime', message: line, timestamp: new Date().toISOString() });
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
if (stderr) {
|
|
138
|
-
for (const line of stderr.split('\n')) {
|
|
139
|
-
if (line) {
|
|
140
|
-
jsonLine({ type: 'error', message: line, timestamp: new Date().toISOString() });
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
else {
|
|
146
|
-
if (stdout) {
|
|
147
|
-
console.log(stdout);
|
|
148
|
-
}
|
|
149
|
-
if (stderr) {
|
|
150
|
-
console.error(stderr);
|
|
151
|
-
}
|
|
152
|
-
if (!stdout && !stderr) {
|
|
153
|
-
console.log('No preview logs available.');
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
// Initialize cursors for subsequent follow polls
|
|
157
|
-
lastStdoutLength = stdout ? stdout.length : 0;
|
|
158
|
-
lastStderrLength = stderr ? stderr.length : 0;
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
catch (err) {
|
|
162
|
-
console.error('Failed to fetch preview logs:', err.message);
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
if (showEvents) {
|
|
167
|
-
if (!useJson && showRuntime && isFirstPoll) {
|
|
168
|
-
console.log('\n--- Events ---\n');
|
|
169
|
-
}
|
|
170
|
-
try {
|
|
171
|
-
const { events, totalCount, hasMore } = await client.getAppEvents(appId, {
|
|
172
|
-
limit,
|
|
173
|
-
type: opts.type,
|
|
174
|
-
});
|
|
175
|
-
if (useJson) {
|
|
176
|
-
for (const event of events) {
|
|
177
|
-
jsonLine({
|
|
178
|
-
type: 'event',
|
|
179
|
-
eventType: event.type,
|
|
180
|
-
source: event.source,
|
|
181
|
-
detail: event.summary || event.content,
|
|
182
|
-
metadata: event.metadata || {},
|
|
183
|
-
timestamp: event.timestamp,
|
|
184
|
-
});
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
else {
|
|
188
|
-
if (events.length === 0 && isFirstPoll) {
|
|
189
|
-
console.log('No events found.');
|
|
190
|
-
}
|
|
191
|
-
else {
|
|
192
|
-
for (const event of events) {
|
|
193
|
-
console.log(formatEvent(event));
|
|
194
|
-
}
|
|
195
|
-
if (hasMore && isFirstPoll) {
|
|
196
|
-
console.log(`... ${totalCount} total events`);
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
catch (err) {
|
|
202
|
-
console.error('Failed to fetch events:', err.message);
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
isFirstPoll = false;
|
|
206
|
-
};
|
|
207
|
-
await fetchAndPrint();
|
|
208
|
-
if (shouldFollow) {
|
|
209
|
-
let stopped = false;
|
|
210
|
-
let timer;
|
|
211
|
-
const scheduleNext = () => {
|
|
212
|
-
if (!stopped) {
|
|
213
|
-
timer = setTimeout(async () => {
|
|
214
|
-
await fetchAndPrint();
|
|
215
|
-
scheduleNext();
|
|
216
|
-
}, 3000);
|
|
217
|
-
}
|
|
218
|
-
};
|
|
219
|
-
scheduleNext();
|
|
220
|
-
const cleanup = () => {
|
|
221
|
-
stopped = true;
|
|
222
|
-
if (timer) {
|
|
223
|
-
clearTimeout(timer);
|
|
224
|
-
}
|
|
225
|
-
process.exit(0);
|
|
226
|
-
};
|
|
227
|
-
process.on('SIGINT', cleanup);
|
|
228
|
-
process.on('SIGTERM', cleanup);
|
|
229
|
-
// Keep alive
|
|
230
|
-
await new Promise(() => { });
|
|
231
|
-
}
|
|
232
|
-
});
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { McpServerConfig } from '../types.js';
|
|
2
|
-
import type { McpServerEntry } from '../agents/types.js';
|
|
3
|
-
/**
|
|
4
|
-
* Build local-agent MCP entries for external (third-party) servers added to the
|
|
5
|
-
* workspace. Auth handling by `authType`:
|
|
6
|
-
* - 'header': inject the user's resolved per-server headers (decrypted server-side).
|
|
7
|
-
* - 'oauth': emit no auth header so the local agent runs its own browser flow.
|
|
8
|
-
* - 'none'/unset: no auth header.
|
|
9
|
-
*
|
|
10
|
-
* Critically, external entries never receive the Runwork platform API key. That key
|
|
11
|
-
* belongs only on the Runwork workspace-tools entry, which is added separately.
|
|
12
|
-
*/
|
|
13
|
-
export declare function buildExternalMcpEntries(mcpServers: McpServerConfig[], resolvedCredentials: Record<string, Record<string, string>>): McpServerEntry[];
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { RUNWORK_MCP_PREFIX } from '../agents/types.js';
|
|
2
|
-
/**
|
|
3
|
-
* Build local-agent MCP entries for external (third-party) servers added to the
|
|
4
|
-
* workspace. Auth handling by `authType`:
|
|
5
|
-
* - 'header': inject the user's resolved per-server headers (decrypted server-side).
|
|
6
|
-
* - 'oauth': emit no auth header so the local agent runs its own browser flow.
|
|
7
|
-
* - 'none'/unset: no auth header.
|
|
8
|
-
*
|
|
9
|
-
* Critically, external entries never receive the Runwork platform API key. That key
|
|
10
|
-
* belongs only on the Runwork workspace-tools entry, which is added separately.
|
|
11
|
-
*/
|
|
12
|
-
export function buildExternalMcpEntries(mcpServers, resolvedCredentials) {
|
|
13
|
-
return mcpServers
|
|
14
|
-
.filter(s => s.enabled)
|
|
15
|
-
.map(s => {
|
|
16
|
-
const resolved = s.authType === 'header' ? resolvedCredentials[s.id] : undefined;
|
|
17
|
-
const headers = resolved && Object.keys(resolved).length > 0 ? resolved : undefined;
|
|
18
|
-
return {
|
|
19
|
-
name: `${RUNWORK_MCP_PREFIX}${s.name}`,
|
|
20
|
-
url: s.url,
|
|
21
|
-
transport: s.transport,
|
|
22
|
-
...(headers ? { headers } : {}),
|
|
23
|
-
description: `Runwork MCP server: ${s.name}. Provides tools for interacting with this workspace resource.`,
|
|
24
|
-
};
|
|
25
|
-
});
|
|
26
|
-
}
|
package/dist/commands/mcp.d.ts
DELETED