WIP feat(supervisor): add service management primitives and macOS launchd support#159
Draft
aryasaatvik wants to merge 13 commits intoRhysSullivan:mainfrom
Draft
WIP feat(supervisor): add service management primitives and macOS launchd support#159aryasaatvik wants to merge 13 commits intoRhysSullivan:mainfrom
aryasaatvik wants to merge 13 commits intoRhysSullivan:mainfrom
Conversation
Add @executor/supervisor package with graceful signal-based process termination (gracefulStopPid, isPidAlive) and HTTP readiness polling (pollReadiness, isReachable). Consumed by apps/desktop and the launchd plugin.
Add @executor/plugin-launchd package exposing launchd.install, launchd.uninstall, launchd.start, launchd.stop, and launchd.status tools via the SDK plugin interface. Uses @executor/supervisor for graceful pid shutdown and readiness polling.
…tionId Replace unsafe `any` casts with proper `unknown` + type assertions, add type-safe executionId extraction, and normalize formatting.
- Normalize package.json field ordering across workspace - Collapse multi-line declarations, imports, and function calls - Standardize quotes and trailing punctuation throughout - Apply Prettier formatting to all plugin SDK packages - Reformat generated routeTree files with consistent style
# Conflicts: # .oxlintrc.jsonc # apps/cli/package.json # apps/cli/src/build.ts # apps/cli/src/main.ts # apps/cloud/package.json # apps/cloud/src/api.ts # apps/cloud/src/env.ts # apps/cloud/src/routeTree.gen.ts # apps/cloud/src/web/shell.tsx # apps/cloud/wrangler.jsonc # apps/local/package.json # package.json # packages/core/api/package.json # packages/core/api/src/handlers/secrets.ts # packages/core/api/src/handlers/sources.ts # packages/core/api/src/handlers/tools.ts # packages/core/config/src/config-store.ts # packages/core/execution/src/engine.ts # packages/core/sdk/src/promise-executor.ts # packages/core/storage-file/package.json # packages/core/storage-postgres/package.json # packages/plugins/file-secrets/package.json # packages/plugins/google-discovery/package.json # packages/plugins/google-discovery/src/api/group.ts # packages/plugins/google-discovery/src/react/EditGoogleDiscoverySource.tsx # packages/plugins/google-discovery/src/sdk/plugin.ts # packages/plugins/graphql/package.json # packages/plugins/keychain/package.json # packages/plugins/mcp/src/react/AddMcpSource.tsx # packages/plugins/onepassword/package.json # packages/plugins/openapi/package.json # packages/plugins/openapi/src/react/AddOpenApiSource.tsx # packages/react/package.json # packages/react/src/components/combobox.tsx # packages/react/src/components/sonner.tsx # packages/react/src/components/table.tsx # packages/react/src/components/tool-detail.tsx # packages/react/src/pages/source-detail.tsx # tests/presets-reachable.test.ts
Add the four underlying error variants (UnsupportedPlatform, BootstrapFailed, TeardownFailed, ServiceReadinessTimeout) folded into a SupervisorError union so the CLI and tools surface a single consistent error taxonomy regardless of OS. Add ServiceSpec, InstallResult, and ServiceStatus shared types exported from the index.
…llback Add the PlatformSupervisor Effect Context tag as the central abstraction for platform-specific service management backends. The unsupported-platform fallback layer raises UnsupportedPlatform on all methods so the CLI and MCP surface a consistent error regardless of active OS.
Add makeServiceCommand for the install/uninstall/start/stop/status subcommands built on Effect CLI. Add makeServiceToolsPlugin that exposes the five service lifecycle operations as runtime tools via the ExecutorPlugin interface. Install and start carry approval annotations.
Delete launchdPlugin(), makeServiceCommand, and ./promise subpath export. The plugin now only exports the backend implementation. Service commands and platform supervision logic are centralized in @executor/supervisor.
Inject BUILD_PLATFORM at build time via Bun.define to enable DCE folding of the platform switch in main.ts and server/executor.ts. The ternary must use BUILD_PLATFORM directly (not through an intermediate const) so Bun's DCE can eliminate the unused branch. Also add build-globals.d.ts as the TypeScript declaration file for the injected define.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
supervisor
Add @executor/supervisor package with graceful signal-based process
termination (gracefulStopPid, isPidAlive) and HTTP readiness polling
(pollReadiness, isReachable). Consumed by apps/desktop and the launchd
plugin.