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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "runwork",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.2",
|
|
4
4
|
"description": "CLI for Runwork: develop, preview, and deploy Runwork apps from your local machine.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"author": "Runwork <info@runwork.ai> (https://www.runwork.ai)",
|
|
@@ -28,14 +28,14 @@
|
|
|
28
28
|
},
|
|
29
29
|
"scripts": {
|
|
30
30
|
"prebuild": "cd ../framework && bun run build && cd ../runwork-cli && mkdir -p bundled-types && cp ../framework/dist/*.d.ts bundled-types/ && cp -r ../framework/dist/shared bundled-types/shared 2>/dev/null; cp -r ../framework/dist/task-delegation bundled-types/task-delegation 2>/dev/null; bun run scripts/embed-types.ts",
|
|
31
|
-
"build": "bun run prebuild &&
|
|
31
|
+
"build": "bun run prebuild && bun run scripts/build-bundle.ts",
|
|
32
32
|
"build:binary": "bun run prebuild && bun build src/index.ts --compile --outfile dist/runwork",
|
|
33
33
|
"build:binaries": "bun run scripts/build-binaries.ts",
|
|
34
|
-
"dev": "
|
|
34
|
+
"dev": "bun run scripts/build-bundle.ts --watch",
|
|
35
35
|
"typecheck": "tsc --noEmit",
|
|
36
36
|
"test": "vitest run",
|
|
37
37
|
"test:local": "RUNWORK_TEST_LOCAL_AGENTS=1 vitest run",
|
|
38
|
-
"prepublishOnly": "bun run
|
|
38
|
+
"prepublishOnly": "bun run build",
|
|
39
39
|
"release": "npm publish && npm dist-tag add runwork@$(node -p \"require('./package.json').version\") next",
|
|
40
40
|
"release:binaries": "bun run scripts/release-binaries.ts",
|
|
41
41
|
"release:binaries:upload": "bun run scripts/release-binaries.ts --skip-build",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,250 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect } from 'vitest';
|
|
2
|
-
import { parseCurlToRequest } from '../utils/curl-parser.js';
|
|
3
|
-
describe('parseCurlToRequest', () => {
|
|
4
|
-
describe('basic requests', () => {
|
|
5
|
-
it('parses a simple GET request', async () => {
|
|
6
|
-
const result = await parseCurlToRequest("curl 'https://api.example.com/users'");
|
|
7
|
-
expect(result.method).toBe('GET');
|
|
8
|
-
expect(result.path).toBe('/users');
|
|
9
|
-
expect(result.query).toBeUndefined();
|
|
10
|
-
expect(result.body).toBeUndefined();
|
|
11
|
-
});
|
|
12
|
-
it('parses GET with query parameters', async () => {
|
|
13
|
-
const result = await parseCurlToRequest("curl 'https://api.example.com/users?limit=10&offset=20'");
|
|
14
|
-
expect(result.method).toBe('GET');
|
|
15
|
-
expect(result.path).toBe('/users');
|
|
16
|
-
expect(result.query).toBe('limit=10&offset=20');
|
|
17
|
-
});
|
|
18
|
-
it('parses explicit GET method', async () => {
|
|
19
|
-
const result = await parseCurlToRequest("curl -X GET 'https://api.example.com/data'");
|
|
20
|
-
expect(result.method).toBe('GET');
|
|
21
|
-
expect(result.path).toBe('/data');
|
|
22
|
-
});
|
|
23
|
-
it('parses URL without quotes', async () => {
|
|
24
|
-
const result = await parseCurlToRequest('curl https://api.example.com/items');
|
|
25
|
-
expect(result.method).toBe('GET');
|
|
26
|
-
expect(result.path).toBe('/items');
|
|
27
|
-
});
|
|
28
|
-
});
|
|
29
|
-
describe('HTTP methods', () => {
|
|
30
|
-
it('parses POST with -X', async () => {
|
|
31
|
-
const result = await parseCurlToRequest("curl -X POST 'https://api.example.com/users'");
|
|
32
|
-
expect(result.method).toBe('POST');
|
|
33
|
-
});
|
|
34
|
-
it('parses PUT with --request', async () => {
|
|
35
|
-
const result = await parseCurlToRequest("curl --request PUT 'https://api.example.com/users/1'");
|
|
36
|
-
expect(result.method).toBe('PUT');
|
|
37
|
-
});
|
|
38
|
-
it('parses DELETE', async () => {
|
|
39
|
-
const result = await parseCurlToRequest("curl -X DELETE 'https://api.example.com/users/1'");
|
|
40
|
-
expect(result.method).toBe('DELETE');
|
|
41
|
-
});
|
|
42
|
-
it('parses PATCH', async () => {
|
|
43
|
-
const result = await parseCurlToRequest("curl -X PATCH 'https://api.example.com/users/1'");
|
|
44
|
-
expect(result.method).toBe('PATCH');
|
|
45
|
-
});
|
|
46
|
-
it('infers POST when --data is present without -X', async () => {
|
|
47
|
-
const result = await parseCurlToRequest(`curl 'https://api.example.com/users' -d '{"name":"test"}'`);
|
|
48
|
-
expect(result.method).toBe('POST');
|
|
49
|
-
});
|
|
50
|
-
});
|
|
51
|
-
describe('headers', () => {
|
|
52
|
-
it('parses single header with -H', async () => {
|
|
53
|
-
const result = await parseCurlToRequest("curl 'https://api.example.com/users' -H 'Accept: application/json'");
|
|
54
|
-
expect(result.headers['Accept']).toBe('application/json');
|
|
55
|
-
});
|
|
56
|
-
it('parses multiple headers', async () => {
|
|
57
|
-
const result = await parseCurlToRequest("curl 'https://api.example.com/users' -H 'Accept: application/json' -H 'X-Custom: value'");
|
|
58
|
-
expect(result.headers['Accept']).toBe('application/json');
|
|
59
|
-
expect(result.headers['X-Custom']).toBe('value');
|
|
60
|
-
});
|
|
61
|
-
it('strips Authorization header', async () => {
|
|
62
|
-
const result = await parseCurlToRequest("curl 'https://api.example.com/users' -H 'Authorization: Bearer token123' -H 'Accept: application/json'");
|
|
63
|
-
expect(result.headers['Authorization']).toBeUndefined();
|
|
64
|
-
expect(result.headers['Accept']).toBe('application/json');
|
|
65
|
-
});
|
|
66
|
-
it('strips Cookie header', async () => {
|
|
67
|
-
const result = await parseCurlToRequest("curl 'https://api.example.com/users' -H 'Cookie: session=abc' -H 'Accept: application/json'");
|
|
68
|
-
expect(result.headers['Cookie']).toBeUndefined();
|
|
69
|
-
expect(result.headers['Accept']).toBe('application/json');
|
|
70
|
-
});
|
|
71
|
-
it('strips Host header', async () => {
|
|
72
|
-
const result = await parseCurlToRequest("curl 'https://api.example.com/users' -H 'Host: api.example.com'");
|
|
73
|
-
expect(result.headers['Host']).toBeUndefined();
|
|
74
|
-
});
|
|
75
|
-
it('strips User-Agent header', async () => {
|
|
76
|
-
const result = await parseCurlToRequest("curl 'https://api.example.com/users' -H 'User-Agent: Mozilla/5.0' -H 'Accept: text/html'");
|
|
77
|
-
expect(result.headers['User-Agent']).toBeUndefined();
|
|
78
|
-
expect(result.headers['Accept']).toBe('text/html');
|
|
79
|
-
});
|
|
80
|
-
it('strips Connection header', async () => {
|
|
81
|
-
const result = await parseCurlToRequest("curl 'https://api.example.com/users' -H 'Connection: keep-alive'");
|
|
82
|
-
expect(result.headers['Connection']).toBeUndefined();
|
|
83
|
-
});
|
|
84
|
-
it('preserves Content-Type header', async () => {
|
|
85
|
-
const result = await parseCurlToRequest("curl 'https://api.example.com/users' -H 'Content-Type: application/json'");
|
|
86
|
-
expect(result.headers['Content-Type']).toBe('application/json');
|
|
87
|
-
});
|
|
88
|
-
});
|
|
89
|
-
describe('request body', () => {
|
|
90
|
-
it('parses JSON body with -d', async () => {
|
|
91
|
-
const result = await parseCurlToRequest(`curl 'https://api.example.com/users' -X POST -d '{"name":"John","age":30}'`);
|
|
92
|
-
expect(result.body).toEqual({ name: 'John', age: 30 });
|
|
93
|
-
});
|
|
94
|
-
it('parses JSON body with --data', async () => {
|
|
95
|
-
const result = await parseCurlToRequest(`curl 'https://api.example.com/users' -X POST --data '{"key":"value"}'`);
|
|
96
|
-
expect(result.body).toEqual({ key: 'value' });
|
|
97
|
-
});
|
|
98
|
-
it('parses JSON body with --data-raw', async () => {
|
|
99
|
-
const result = await parseCurlToRequest(`curl 'https://api.example.com/users' -X POST --data-raw '{"items":[1,2,3]}'`);
|
|
100
|
-
expect(result.body).toEqual({ items: [1, 2, 3] });
|
|
101
|
-
});
|
|
102
|
-
it('handles form-encoded body as parsed object', async () => {
|
|
103
|
-
const result = await parseCurlToRequest(`curl 'https://api.example.com/submit' -X POST -d 'name=John&age=30'`);
|
|
104
|
-
// curlconverter parses form data into key-value pairs
|
|
105
|
-
expect(result.body).toEqual({ name: 'John', age: '30' });
|
|
106
|
-
});
|
|
107
|
-
it('parses empty body', async () => {
|
|
108
|
-
const result = await parseCurlToRequest("curl 'https://api.example.com/users' -X POST");
|
|
109
|
-
expect(result.body).toBeUndefined();
|
|
110
|
-
});
|
|
111
|
-
});
|
|
112
|
-
describe('Chrome DevTools "Copy as cURL" format', () => {
|
|
113
|
-
it('parses typical Chrome GET request', async () => {
|
|
114
|
-
const curl = `curl 'https://api.hubapi.com/crm/v3/objects/contacts?limit=10&properties=email%2Cfirstname' \\
|
|
115
|
-
-H 'accept: application/json, text/plain, */*' \\
|
|
116
|
-
-H 'accept-language: en-US,en;q=0.9' \\
|
|
117
|
-
-H 'authorization: Bearer REDACTED' \\
|
|
118
|
-
-H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)' \\
|
|
119
|
-
-H 'cookie: session=abc123'`;
|
|
120
|
-
const result = await parseCurlToRequest(curl);
|
|
121
|
-
expect(result.method).toBe('GET');
|
|
122
|
-
expect(result.path).toBe('/crm/v3/objects/contacts');
|
|
123
|
-
expect(result.query).toContain('limit=10');
|
|
124
|
-
expect(result.headers['authorization']).toBeUndefined();
|
|
125
|
-
expect(result.headers['cookie']).toBeUndefined();
|
|
126
|
-
expect(result.headers['user-agent']).toBeUndefined();
|
|
127
|
-
expect(result.headers['accept']).toBe('application/json, text/plain, */*');
|
|
128
|
-
});
|
|
129
|
-
it('parses Chrome POST with JSON body', async () => {
|
|
130
|
-
const curl = `curl 'https://api.hubapi.com/crm/v3/objects/contacts' \\
|
|
131
|
-
-H 'accept: application/json' \\
|
|
132
|
-
-H 'authorization: Bearer REDACTED' \\
|
|
133
|
-
-H 'content-type: application/json' \\
|
|
134
|
-
--data-raw '{"properties":{"email":"test@example.com","firstname":"Test"}}' \\
|
|
135
|
-
--compressed`;
|
|
136
|
-
const result = await parseCurlToRequest(curl);
|
|
137
|
-
expect(result.method).toBe('POST');
|
|
138
|
-
expect(result.path).toBe('/crm/v3/objects/contacts');
|
|
139
|
-
expect(result.body).toEqual({
|
|
140
|
-
properties: { email: 'test@example.com', firstname: 'Test' },
|
|
141
|
-
});
|
|
142
|
-
});
|
|
143
|
-
it('parses Chrome PUT request', async () => {
|
|
144
|
-
const curl = `curl 'https://api.example.com/crm/v3/objects/contacts/123' \\
|
|
145
|
-
-X 'PUT' \\
|
|
146
|
-
-H 'content-type: application/json' \\
|
|
147
|
-
--data-raw '{"properties":{"firstname":"Updated"}}'`;
|
|
148
|
-
const result = await parseCurlToRequest(curl);
|
|
149
|
-
expect(result.method).toBe('PUT');
|
|
150
|
-
expect(result.path).toBe('/crm/v3/objects/contacts/123');
|
|
151
|
-
expect(result.body).toEqual({ properties: { firstname: 'Updated' } });
|
|
152
|
-
});
|
|
153
|
-
it('parses Chrome DELETE request', async () => {
|
|
154
|
-
const curl = `curl 'https://api.example.com/crm/v3/objects/contacts/123' \\
|
|
155
|
-
-X 'DELETE' \\
|
|
156
|
-
-H 'authorization: Bearer REDACTED'`;
|
|
157
|
-
const result = await parseCurlToRequest(curl);
|
|
158
|
-
expect(result.method).toBe('DELETE');
|
|
159
|
-
expect(result.path).toBe('/crm/v3/objects/contacts/123');
|
|
160
|
-
});
|
|
161
|
-
});
|
|
162
|
-
describe('URL path extraction', () => {
|
|
163
|
-
it('extracts path from URL with port', async () => {
|
|
164
|
-
const result = await parseCurlToRequest("curl 'https://api.example.com:8443/v2/users'");
|
|
165
|
-
expect(result.path).toBe('/v2/users');
|
|
166
|
-
});
|
|
167
|
-
it('handles root path', async () => {
|
|
168
|
-
const result = await parseCurlToRequest("curl 'https://api.example.com/'");
|
|
169
|
-
expect(result.path).toBe('/');
|
|
170
|
-
});
|
|
171
|
-
it('handles deeply nested path', async () => {
|
|
172
|
-
const result = await parseCurlToRequest("curl 'https://api.example.com/v3/crm/objects/contacts/search'");
|
|
173
|
-
expect(result.path).toBe('/v3/crm/objects/contacts/search');
|
|
174
|
-
});
|
|
175
|
-
it('preserves URL-encoded characters in path', async () => {
|
|
176
|
-
const result = await parseCurlToRequest("curl 'https://api.example.com/users/john%40example.com'");
|
|
177
|
-
expect(result.path).toBe('/users/john%40example.com');
|
|
178
|
-
});
|
|
179
|
-
});
|
|
180
|
-
describe('edge cases', () => {
|
|
181
|
-
it('handles double-quoted strings', async () => {
|
|
182
|
-
const result = await parseCurlToRequest('curl "https://api.example.com/users" -H "Accept: application/json"');
|
|
183
|
-
expect(result.path).toBe('/users');
|
|
184
|
-
expect(result.headers['Accept']).toBe('application/json');
|
|
185
|
-
});
|
|
186
|
-
it('handles --compressed flag', async () => {
|
|
187
|
-
const result = await parseCurlToRequest("curl 'https://api.example.com/data' --compressed -H 'Accept-Encoding: gzip'");
|
|
188
|
-
expect(result.method).toBe('GET');
|
|
189
|
-
expect(result.path).toBe('/data');
|
|
190
|
-
});
|
|
191
|
-
it('handles -s (silent) flag', async () => {
|
|
192
|
-
const result = await parseCurlToRequest("curl -s 'https://api.example.com/health'");
|
|
193
|
-
expect(result.path).toBe('/health');
|
|
194
|
-
});
|
|
195
|
-
it('handles -L (follow redirects) flag', async () => {
|
|
196
|
-
const result = await parseCurlToRequest("curl -L 'https://api.example.com/redirect'");
|
|
197
|
-
expect(result.path).toBe('/redirect');
|
|
198
|
-
});
|
|
199
|
-
it('throws on empty/invalid input', async () => {
|
|
200
|
-
await expect(parseCurlToRequest('')).rejects.toThrow();
|
|
201
|
-
});
|
|
202
|
-
it('handles multiline curl with backslash continuations', async () => {
|
|
203
|
-
const curl = `curl \\
|
|
204
|
-
'https://api.example.com/users' \\
|
|
205
|
-
-H 'Accept: application/json' \\
|
|
206
|
-
-H 'X-Request-Id: abc-123'`;
|
|
207
|
-
const result = await parseCurlToRequest(curl);
|
|
208
|
-
expect(result.path).toBe('/users');
|
|
209
|
-
expect(result.headers['Accept']).toBe('application/json');
|
|
210
|
-
expect(result.headers['X-Request-Id']).toBe('abc-123');
|
|
211
|
-
});
|
|
212
|
-
it('handles complex JSON body with nested objects', async () => {
|
|
213
|
-
const curl = `curl 'https://api.example.com/search' -X POST -H 'Content-Type: application/json' --data-raw '{"filters":{"and":[{"property":"email","operator":"EQ","value":"test@example.com"}]},"limit":10}'`;
|
|
214
|
-
const result = await parseCurlToRequest(curl);
|
|
215
|
-
expect(result.body).toEqual({
|
|
216
|
-
filters: {
|
|
217
|
-
and: [{ property: 'email', operator: 'EQ', value: 'test@example.com' }],
|
|
218
|
-
},
|
|
219
|
-
limit: 10,
|
|
220
|
-
});
|
|
221
|
-
});
|
|
222
|
-
it('handles request with many headers (real-world Chrome copy)', async () => {
|
|
223
|
-
const curl = `curl 'https://api.stripe.com/v1/charges?limit=3' \\
|
|
224
|
-
-H 'accept: application/json' \\
|
|
225
|
-
-H 'accept-language: en-US,en;q=0.9,tr;q=0.8' \\
|
|
226
|
-
-H 'authorization: Bearer sk_test_xxx' \\
|
|
227
|
-
-H 'cache-control: no-cache' \\
|
|
228
|
-
-H 'connection: keep-alive' \\
|
|
229
|
-
-H 'cookie: __stripe_mid=abc; __stripe_sid=def' \\
|
|
230
|
-
-H 'pragma: no-cache' \\
|
|
231
|
-
-H 'sec-ch-ua: "Chromium";v="128"' \\
|
|
232
|
-
-H 'sec-fetch-dest: empty' \\
|
|
233
|
-
-H 'sec-fetch-mode: cors' \\
|
|
234
|
-
-H 'sec-fetch-site: same-origin' \\
|
|
235
|
-
-H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)'`;
|
|
236
|
-
const result = await parseCurlToRequest(curl);
|
|
237
|
-
expect(result.method).toBe('GET');
|
|
238
|
-
expect(result.path).toBe('/v1/charges');
|
|
239
|
-
expect(result.query).toBe('limit=3');
|
|
240
|
-
// Proxy-managed headers stripped
|
|
241
|
-
expect(result.headers['authorization']).toBeUndefined();
|
|
242
|
-
expect(result.headers['cookie']).toBeUndefined();
|
|
243
|
-
expect(result.headers['connection']).toBeUndefined();
|
|
244
|
-
expect(result.headers['user-agent']).toBeUndefined();
|
|
245
|
-
// App headers preserved
|
|
246
|
-
expect(result.headers['accept']).toBe('application/json');
|
|
247
|
-
expect(result.headers['cache-control']).toBe('no-cache');
|
|
248
|
-
});
|
|
249
|
-
});
|
|
250
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,280 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Integration tests for the Runwork install scripts.
|
|
3
|
-
*
|
|
4
|
-
* install.sh runs end-to-end against a local HTTP server that serves a fake
|
|
5
|
-
* release manifest and a tar.gz for the current host platform. install.ps1 is
|
|
6
|
-
* checked statically (grep of invariants) because PowerShell is not available
|
|
7
|
-
* on the Unix runners that execute this suite.
|
|
8
|
-
*
|
|
9
|
-
* Design note: install.sh uses curl to fetch from the in-process Node HTTP
|
|
10
|
-
* server, so we MUST run the child process asynchronously. Using execFileSync
|
|
11
|
-
* would block the Node event loop, preventing the HTTP server from responding
|
|
12
|
-
* to curl and deadlocking the test.
|
|
13
|
-
*/
|
|
14
|
-
import { describe, it, expect, beforeEach, afterEach } from 'vitest';
|
|
15
|
-
import { execFileSync, spawn } from 'node:child_process';
|
|
16
|
-
import { createServer } from 'node:http';
|
|
17
|
-
import { chmodSync, existsSync, lstatSync, mkdirSync, mkdtempSync, readFileSync, readlinkSync, rmSync, statSync, writeFileSync, } from 'node:fs';
|
|
18
|
-
import { tmpdir } from 'node:os';
|
|
19
|
-
import { join } from 'node:path';
|
|
20
|
-
import { fileURLToPath } from 'node:url';
|
|
21
|
-
import { createHash } from 'node:crypto';
|
|
22
|
-
const INSTALL_SH = fileURLToPath(new URL('../../install.sh', import.meta.url));
|
|
23
|
-
const INSTALL_PS1 = fileURLToPath(new URL('../../install.ps1', import.meta.url));
|
|
24
|
-
function detectHostPlatform() {
|
|
25
|
-
const osMap = { darwin: 'darwin', linux: 'linux' };
|
|
26
|
-
const archMap = { x64: 'x64', arm64: 'arm64' };
|
|
27
|
-
const os = osMap[process.platform];
|
|
28
|
-
const arch = archMap[process.arch];
|
|
29
|
-
if (!os || !arch) {
|
|
30
|
-
throw new Error(`install.sh integration test requires darwin/linux and x64/arm64; got ${process.platform}/${process.arch}`);
|
|
31
|
-
}
|
|
32
|
-
return { os, arch, platform: `${os}-${arch}` };
|
|
33
|
-
}
|
|
34
|
-
function sha256Hex(data) {
|
|
35
|
-
return createHash('sha256').update(data).digest('hex');
|
|
36
|
-
}
|
|
37
|
-
function runInstallSh(env) {
|
|
38
|
-
return new Promise((resolvePromise) => {
|
|
39
|
-
const child = spawn('sh', [INSTALL_SH], {
|
|
40
|
-
env,
|
|
41
|
-
stdio: ['ignore', 'pipe', 'pipe'],
|
|
42
|
-
});
|
|
43
|
-
let stdout = '';
|
|
44
|
-
let stderr = '';
|
|
45
|
-
child.stdout.on('data', (chunk) => {
|
|
46
|
-
stdout += chunk.toString();
|
|
47
|
-
});
|
|
48
|
-
child.stderr.on('data', (chunk) => {
|
|
49
|
-
stderr += chunk.toString();
|
|
50
|
-
});
|
|
51
|
-
child.on('error', (err) => {
|
|
52
|
-
resolvePromise({ status: -1, stdout, stderr: stderr + `\n[spawn error] ${err.message}` });
|
|
53
|
-
});
|
|
54
|
-
child.on('close', (code) => {
|
|
55
|
-
resolvePromise({ status: code ?? -1, stdout, stderr });
|
|
56
|
-
});
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
describe('install.sh (end-to-end)', () => {
|
|
60
|
-
let workDir;
|
|
61
|
-
let serverDir;
|
|
62
|
-
let server;
|
|
63
|
-
let serverUrl;
|
|
64
|
-
let platformInfo;
|
|
65
|
-
let archivePath;
|
|
66
|
-
beforeEach(async () => {
|
|
67
|
-
platformInfo = detectHostPlatform();
|
|
68
|
-
workDir = mkdtempSync(join(tmpdir(), 'runwork-install-test-'));
|
|
69
|
-
serverDir = join(workDir, 'server');
|
|
70
|
-
mkdirSync(serverDir, { recursive: true });
|
|
71
|
-
// Fake binary that prints a recognizable version string.
|
|
72
|
-
const binaryName = `runwork-${platformInfo.platform}`;
|
|
73
|
-
const binarySource = join(workDir, 'binary-source');
|
|
74
|
-
mkdirSync(binarySource, { recursive: true });
|
|
75
|
-
const binaryPath = join(binarySource, binaryName);
|
|
76
|
-
writeFileSync(binaryPath, '#!/bin/sh\necho "runwork 99.99.99 (test)"\n');
|
|
77
|
-
chmodSync(binaryPath, 0o755);
|
|
78
|
-
// Pack the binary into a tar.gz at the manifest path.
|
|
79
|
-
const archiveName = `${binaryName}.tar.gz`;
|
|
80
|
-
const releasesDir = join(serverDir, 'cli', 'releases', '99.99.99');
|
|
81
|
-
mkdirSync(releasesDir, { recursive: true });
|
|
82
|
-
archivePath = join(releasesDir, archiveName);
|
|
83
|
-
execFileSync('tar', ['-czf', archivePath, binaryName], { cwd: binarySource });
|
|
84
|
-
const sha = sha256Hex(readFileSync(archivePath));
|
|
85
|
-
// Write the manifest consumed by install.sh.
|
|
86
|
-
const manifest = {
|
|
87
|
-
name: 'runwork',
|
|
88
|
-
version: '99.99.99',
|
|
89
|
-
publishedAt: new Date().toISOString(),
|
|
90
|
-
artifacts: {
|
|
91
|
-
[platformInfo.platform]: {
|
|
92
|
-
path: `/cli/releases/99.99.99/${archiveName}`,
|
|
93
|
-
sha256: sha,
|
|
94
|
-
},
|
|
95
|
-
},
|
|
96
|
-
};
|
|
97
|
-
writeFileSync(join(serverDir, 'cli', 'latest.json'), JSON.stringify(manifest, null, 2) + '\n');
|
|
98
|
-
// Minimal static HTTP server rooted at serverDir.
|
|
99
|
-
server = createServer((req, res) => {
|
|
100
|
-
const requestPath = decodeURIComponent(req.url ?? '/').replace(/^\/+/, '');
|
|
101
|
-
const filePath = join(serverDir, requestPath);
|
|
102
|
-
if (!filePath.startsWith(serverDir) ||
|
|
103
|
-
!existsSync(filePath) ||
|
|
104
|
-
statSync(filePath).isDirectory()) {
|
|
105
|
-
res.writeHead(404, { 'Content-Type': 'text/plain' });
|
|
106
|
-
res.end('not found');
|
|
107
|
-
return;
|
|
108
|
-
}
|
|
109
|
-
const body = readFileSync(filePath);
|
|
110
|
-
res.writeHead(200, {
|
|
111
|
-
'Content-Type': 'application/octet-stream',
|
|
112
|
-
'Content-Length': body.length,
|
|
113
|
-
});
|
|
114
|
-
res.end(body);
|
|
115
|
-
});
|
|
116
|
-
await new Promise((resolvePromise) => {
|
|
117
|
-
server.listen(0, '127.0.0.1', () => {
|
|
118
|
-
const addr = server.address();
|
|
119
|
-
if (addr && typeof addr === 'object') {
|
|
120
|
-
serverUrl = `http://127.0.0.1:${addr.port}`;
|
|
121
|
-
}
|
|
122
|
-
resolvePromise();
|
|
123
|
-
});
|
|
124
|
-
});
|
|
125
|
-
});
|
|
126
|
-
afterEach(async () => {
|
|
127
|
-
await new Promise((resolvePromise) => {
|
|
128
|
-
server.close(() => resolvePromise());
|
|
129
|
-
});
|
|
130
|
-
rmSync(workDir, { recursive: true, force: true });
|
|
131
|
-
});
|
|
132
|
-
function envFor(overrides) {
|
|
133
|
-
return {
|
|
134
|
-
...process.env,
|
|
135
|
-
HOME: workDir,
|
|
136
|
-
RUNWORK_DOWNLOAD_BASE_URL: serverUrl,
|
|
137
|
-
...overrides,
|
|
138
|
-
};
|
|
139
|
-
}
|
|
140
|
-
it('installs the binary to the canonical location and symlinks it onto PATH', async () => {
|
|
141
|
-
const installDir = join(workDir, 'install');
|
|
142
|
-
const linkDir = join(workDir, 'link');
|
|
143
|
-
const result = await runInstallSh(envFor({
|
|
144
|
-
RUNWORK_INSTALL_DIR: installDir,
|
|
145
|
-
RUNWORK_BIN_LINK_DIR: linkDir,
|
|
146
|
-
}));
|
|
147
|
-
expect(result.status, `installer failed:\nstdout:\n${result.stdout}\nstderr:\n${result.stderr}`).toBe(0);
|
|
148
|
-
expect(result.stdout).toContain('99.99.99');
|
|
149
|
-
expect(result.stdout).toContain(platformInfo.platform);
|
|
150
|
-
const installedBinary = join(installDir, 'runwork');
|
|
151
|
-
expect(existsSync(installedBinary)).toBe(true);
|
|
152
|
-
expect(statSync(installedBinary).mode & 0o111).toBeGreaterThan(0);
|
|
153
|
-
const linkPath = join(linkDir, 'runwork');
|
|
154
|
-
expect(existsSync(linkPath)).toBe(true);
|
|
155
|
-
expect(lstatSync(linkPath).isSymbolicLink()).toBe(true);
|
|
156
|
-
expect(readlinkSync(linkPath)).toBe(installedBinary);
|
|
157
|
-
const versionOutput = execFileSync(installedBinary, [], { encoding: 'utf-8' });
|
|
158
|
-
expect(versionOutput).toContain('99.99.99');
|
|
159
|
-
});
|
|
160
|
-
it('defaults install location to $HOME/.runwork/bin when RUNWORK_INSTALL_DIR is unset', async () => {
|
|
161
|
-
const result = await runInstallSh(envFor({
|
|
162
|
-
RUNWORK_BIN_LINK_DIR: join(workDir, 'link'),
|
|
163
|
-
}));
|
|
164
|
-
expect(result.status, `installer failed:\nstdout:\n${result.stdout}\nstderr:\n${result.stderr}`).toBe(0);
|
|
165
|
-
const defaultBinary = join(workDir, '.runwork', 'bin', 'runwork');
|
|
166
|
-
expect(existsSync(defaultBinary)).toBe(true);
|
|
167
|
-
});
|
|
168
|
-
it('persists ~/.runwork/bin to a shell profile, idempotently, on a default install', async () => {
|
|
169
|
-
const linkDir = join(workDir, 'link');
|
|
170
|
-
const exportLine = 'export PATH="$HOME/.runwork/bin:$PATH"';
|
|
171
|
-
const marker = '# Added by Runwork CLI installer';
|
|
172
|
-
const profiles = ['.zshrc', '.bashrc', '.bash_profile', '.profile'].map((p) => join(workDir, p));
|
|
173
|
-
const read = (p) => (existsSync(p) ? readFileSync(p, 'utf-8') : '');
|
|
174
|
-
// First install with the default install dir ($HOME/.runwork/bin) triggers
|
|
175
|
-
// PATH persistence.
|
|
176
|
-
const r1 = await runInstallSh(envFor({ RUNWORK_BIN_LINK_DIR: linkDir }));
|
|
177
|
-
expect(r1.status, `installer failed:\n${r1.stdout}\n${r1.stderr}`).toBe(0);
|
|
178
|
-
const written = profiles.filter((p) => read(p).includes(exportLine));
|
|
179
|
-
expect(written.length, 'expected the export line in at least one profile').toBeGreaterThan(0);
|
|
180
|
-
expect(profiles.some((p) => read(p).includes(marker))).toBe(true);
|
|
181
|
-
// Re-running must NOT append a second time (guarded on .runwork/bin).
|
|
182
|
-
const r2 = await runInstallSh(envFor({ RUNWORK_BIN_LINK_DIR: linkDir }));
|
|
183
|
-
expect(r2.status).toBe(0);
|
|
184
|
-
for (const p of written) {
|
|
185
|
-
const occurrences = read(p).split('.runwork/bin').length - 1;
|
|
186
|
-
expect(occurrences, `profile ${p} should reference .runwork/bin exactly once`).toBe(1);
|
|
187
|
-
}
|
|
188
|
-
});
|
|
189
|
-
it('does NOT touch shell profiles when a custom RUNWORK_INSTALL_DIR is used', async () => {
|
|
190
|
-
const result = await runInstallSh(envFor({
|
|
191
|
-
RUNWORK_INSTALL_DIR: join(workDir, 'install'),
|
|
192
|
-
RUNWORK_BIN_LINK_DIR: join(workDir, 'link'),
|
|
193
|
-
}));
|
|
194
|
-
expect(result.status).toBe(0);
|
|
195
|
-
const profiles = ['.zshrc', '.bashrc', '.bash_profile', '.profile'].map((p) => join(workDir, p));
|
|
196
|
-
for (const p of profiles) {
|
|
197
|
-
if (existsSync(p))
|
|
198
|
-
expect(readFileSync(p, 'utf-8')).not.toContain('.runwork/bin');
|
|
199
|
-
}
|
|
200
|
-
});
|
|
201
|
-
it('aborts on sha256 mismatch and leaves the install directory untouched', async () => {
|
|
202
|
-
// Tamper with the archive the server is about to serve.
|
|
203
|
-
writeFileSync(archivePath, Buffer.from('tampered payload'));
|
|
204
|
-
const installDir = join(workDir, 'install');
|
|
205
|
-
const result = await runInstallSh(envFor({
|
|
206
|
-
RUNWORK_INSTALL_DIR: installDir,
|
|
207
|
-
RUNWORK_BIN_LINK_DIR: join(workDir, 'link'),
|
|
208
|
-
}));
|
|
209
|
-
expect(result.status).not.toBe(0);
|
|
210
|
-
expect(result.stderr).toContain('sha256 mismatch');
|
|
211
|
-
expect(existsSync(join(installDir, 'runwork'))).toBe(false);
|
|
212
|
-
});
|
|
213
|
-
it('reports a clear error when the manifest is unreachable', async () => {
|
|
214
|
-
rmSync(join(serverDir, 'cli', 'latest.json'));
|
|
215
|
-
const result = await runInstallSh(envFor({
|
|
216
|
-
RUNWORK_INSTALL_DIR: join(workDir, 'install'),
|
|
217
|
-
RUNWORK_BIN_LINK_DIR: join(workDir, 'link'),
|
|
218
|
-
}));
|
|
219
|
-
expect(result.status).not.toBe(0);
|
|
220
|
-
expect(result.stderr).toContain('failed to fetch release manifest');
|
|
221
|
-
});
|
|
222
|
-
it('reports a clear error when the manifest has no artifact for the host platform', async () => {
|
|
223
|
-
const fakePlatform = platformInfo.platform === 'linux-x64' ? 'linux-arm64' : 'linux-x64';
|
|
224
|
-
const manifest = {
|
|
225
|
-
name: 'runwork',
|
|
226
|
-
version: '99.99.99',
|
|
227
|
-
publishedAt: new Date().toISOString(),
|
|
228
|
-
artifacts: {
|
|
229
|
-
[fakePlatform]: {
|
|
230
|
-
path: `/cli/releases/99.99.99/runwork-${fakePlatform}.tar.gz`,
|
|
231
|
-
sha256: 'deadbeef',
|
|
232
|
-
},
|
|
233
|
-
},
|
|
234
|
-
};
|
|
235
|
-
writeFileSync(join(serverDir, 'cli', 'latest.json'), JSON.stringify(manifest, null, 2));
|
|
236
|
-
const result = await runInstallSh(envFor({
|
|
237
|
-
RUNWORK_INSTALL_DIR: join(workDir, 'install'),
|
|
238
|
-
RUNWORK_BIN_LINK_DIR: join(workDir, 'link'),
|
|
239
|
-
}));
|
|
240
|
-
expect(result.status).not.toBe(0);
|
|
241
|
-
expect(result.stderr).toContain('no artifact entry for platform');
|
|
242
|
-
});
|
|
243
|
-
});
|
|
244
|
-
describe('install.ps1 (static invariants)', () => {
|
|
245
|
-
let contents;
|
|
246
|
-
beforeEach(() => {
|
|
247
|
-
contents = readFileSync(INSTALL_PS1, 'utf-8');
|
|
248
|
-
});
|
|
249
|
-
it('exists alongside install.sh', () => {
|
|
250
|
-
expect(existsSync(INSTALL_PS1)).toBe(true);
|
|
251
|
-
});
|
|
252
|
-
it('resolves the manifest against runwork.ai/cli/latest.json by default', () => {
|
|
253
|
-
expect(contents).toContain("'https://runwork.ai'");
|
|
254
|
-
expect(contents).toContain('/cli/latest.json');
|
|
255
|
-
});
|
|
256
|
-
it('honors the RUNWORK_* env var overrides documented in the plan', () => {
|
|
257
|
-
expect(contents).toContain('RUNWORK_VERSION');
|
|
258
|
-
expect(contents).toContain('RUNWORK_INSTALL_DIR');
|
|
259
|
-
expect(contents).toContain('RUNWORK_DOWNLOAD_BASE_URL');
|
|
260
|
-
});
|
|
261
|
-
it('verifies sha256 with Get-FileHash -Algorithm SHA256', () => {
|
|
262
|
-
expect(contents).toContain('Get-FileHash');
|
|
263
|
-
expect(contents).toContain('SHA256');
|
|
264
|
-
expect(contents).toContain('sha256 mismatch');
|
|
265
|
-
});
|
|
266
|
-
it('targets the canonical Windows install location under %USERPROFILE%\\.runwork\\bin', () => {
|
|
267
|
-
expect(contents).toMatch(/\$env:USERPROFILE/);
|
|
268
|
-
expect(contents).toMatch(/['"]\.runwork\\bin['"]/);
|
|
269
|
-
});
|
|
270
|
-
it('modifies the user PATH scope only (never machine)', () => {
|
|
271
|
-
expect(contents).toContain("'User'");
|
|
272
|
-
expect(contents).not.toContain("'Machine'");
|
|
273
|
-
});
|
|
274
|
-
it('downloads release artifacts from /cli/releases/<version>/<artifact>', () => {
|
|
275
|
-
expect(contents).toMatch(/\/cli\/releases\//);
|
|
276
|
-
});
|
|
277
|
-
it('does not escalate to admin', () => {
|
|
278
|
-
expect(contents).not.toMatch(/Start-Process.*-Verb\s+RunAs/i);
|
|
279
|
-
});
|
|
280
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect, vi, beforeEach } from 'vitest';
|
|
2
|
-
vi.mock('fs');
|
|
3
|
-
vi.mock('../generated/bundled-types.js', () => ({
|
|
4
|
-
BUNDLED_TYPES: {},
|
|
5
|
-
}));
|
|
6
|
-
const mockFs = await import('fs');
|
|
7
|
-
const bundledTypesModule = await import('../generated/bundled-types.js');
|
|
8
|
-
const { populateTypes } = await import('../types-manager.js');
|
|
9
|
-
function setBundledTypes(types) {
|
|
10
|
-
Object.keys(bundledTypesModule.BUNDLED_TYPES).forEach(k => delete bundledTypesModule.BUNDLED_TYPES[k]);
|
|
11
|
-
Object.assign(bundledTypesModule.BUNDLED_TYPES, types);
|
|
12
|
-
}
|
|
13
|
-
describe('types-manager', () => {
|
|
14
|
-
beforeEach(() => {
|
|
15
|
-
vi.clearAllMocks();
|
|
16
|
-
setBundledTypes({});
|
|
17
|
-
});
|
|
18
|
-
describe('populateTypes()', () => {
|
|
19
|
-
it('creates .runwork/types directory', async () => {
|
|
20
|
-
vi.mocked(mockFs.existsSync).mockReturnValue(false);
|
|
21
|
-
const warnSpy = vi.spyOn(console, 'warn').mockImplementation(() => { });
|
|
22
|
-
await populateTypes('/project');
|
|
23
|
-
expect(mockFs.mkdirSync).toHaveBeenCalledWith('/project/.runwork/types', { recursive: true });
|
|
24
|
-
warnSpy.mockRestore();
|
|
25
|
-
});
|
|
26
|
-
it('copies from node_modules when available (Tier 1)', async () => {
|
|
27
|
-
vi.mocked(mockFs.existsSync).mockImplementation((path) => {
|
|
28
|
-
if (String(path).includes('node_modules/@runworkai/framework/dist')) {
|
|
29
|
-
return true;
|
|
30
|
-
}
|
|
31
|
-
return false;
|
|
32
|
-
});
|
|
33
|
-
vi.mocked(mockFs.readdirSync).mockReturnValue(['core-utils.d.ts', 'index.d.ts', 'README.md', 'index.js']);
|
|
34
|
-
const logSpy = vi.spyOn(console, 'log').mockImplementation(() => { });
|
|
35
|
-
await populateTypes('/project');
|
|
36
|
-
expect(mockFs.readdirSync).toHaveBeenCalledWith('/project/node_modules/@runworkai/framework/dist');
|
|
37
|
-
expect(logSpy).toHaveBeenCalledWith('Types populated from node_modules/@runworkai/framework');
|
|
38
|
-
logSpy.mockRestore();
|
|
39
|
-
});
|
|
40
|
-
it('copies only .d.ts files, not other files', async () => {
|
|
41
|
-
vi.mocked(mockFs.existsSync).mockImplementation((path) => {
|
|
42
|
-
if (String(path).includes('node_modules/@runworkai/framework/dist')) {
|
|
43
|
-
return true;
|
|
44
|
-
}
|
|
45
|
-
return false;
|
|
46
|
-
});
|
|
47
|
-
vi.mocked(mockFs.readdirSync).mockReturnValue(['types.d.ts', 'index.js', 'utils.d.ts', 'readme.md', 'config.json']);
|
|
48
|
-
const logSpy = vi.spyOn(console, 'log').mockImplementation(() => { });
|
|
49
|
-
await populateTypes('/project');
|
|
50
|
-
// Only .d.ts files should be copied
|
|
51
|
-
expect(mockFs.copyFileSync).toHaveBeenCalledTimes(2);
|
|
52
|
-
expect(mockFs.copyFileSync).toHaveBeenCalledWith('/project/node_modules/@runworkai/framework/dist/types.d.ts', '/project/.runwork/types/types.d.ts');
|
|
53
|
-
expect(mockFs.copyFileSync).toHaveBeenCalledWith('/project/node_modules/@runworkai/framework/dist/utils.d.ts', '/project/.runwork/types/utils.d.ts');
|
|
54
|
-
logSpy.mockRestore();
|
|
55
|
-
});
|
|
56
|
-
it('falls back to bundled types (Tier 3) when node_modules unavailable', async () => {
|
|
57
|
-
vi.mocked(mockFs.existsSync).mockReturnValue(false);
|
|
58
|
-
setBundledTypes({
|
|
59
|
-
'framework.d.ts': 'export type Framework = {};',
|
|
60
|
-
});
|
|
61
|
-
const logSpy = vi.spyOn(console, 'log').mockImplementation(() => { });
|
|
62
|
-
await populateTypes('/project');
|
|
63
|
-
expect(mockFs.writeFileSync).toHaveBeenCalledWith('/project/.runwork/types/framework.d.ts', 'export type Framework = {};');
|
|
64
|
-
expect(logSpy).toHaveBeenCalledWith('Types populated from bundled types');
|
|
65
|
-
logSpy.mockRestore();
|
|
66
|
-
});
|
|
67
|
-
it('warns when no types found at all', async () => {
|
|
68
|
-
vi.mocked(mockFs.existsSync).mockReturnValue(false);
|
|
69
|
-
setBundledTypes({});
|
|
70
|
-
const warnSpy = vi.spyOn(console, 'warn').mockImplementation(() => { });
|
|
71
|
-
await populateTypes('/project');
|
|
72
|
-
expect(warnSpy).toHaveBeenCalledWith('No type definitions found. Install @runworkai/framework or reinstall the CLI.');
|
|
73
|
-
warnSpy.mockRestore();
|
|
74
|
-
});
|
|
75
|
-
it('writes all bundled type entries in Tier 3 fallback', async () => {
|
|
76
|
-
vi.mocked(mockFs.existsSync).mockReturnValue(false);
|
|
77
|
-
setBundledTypes({
|
|
78
|
-
'types.d.ts': 'export type A = {};',
|
|
79
|
-
'utils.d.ts': 'export type B = {};',
|
|
80
|
-
});
|
|
81
|
-
const logSpy = vi.spyOn(console, 'log').mockImplementation(() => { });
|
|
82
|
-
await populateTypes('/project');
|
|
83
|
-
expect(mockFs.writeFileSync).toHaveBeenCalledTimes(2);
|
|
84
|
-
expect(mockFs.writeFileSync).toHaveBeenCalledWith('/project/.runwork/types/types.d.ts', 'export type A = {};');
|
|
85
|
-
expect(mockFs.writeFileSync).toHaveBeenCalledWith('/project/.runwork/types/utils.d.ts', 'export type B = {};');
|
|
86
|
-
logSpy.mockRestore();
|
|
87
|
-
});
|
|
88
|
-
});
|
|
89
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|