Full Code of RhysSullivan/executor for AI

main 0309aa49e526 cached
459 files
13.6 MB
3.6M tokens
1167 symbols
1 requests
Copy disabled (too large) Download .txt
Showing preview only (14,375K chars total). Download the full file to get everything.
Repository: RhysSullivan/executor
Branch: main
Commit: 0309aa49e526
Files: 459
Total size: 13.6 MB

Directory structure:
gitextract_p4l6ztj_/

├── .changeset/
│   ├── README.md
│   ├── config.json
│   ├── eleven-towns-brush.md
│   ├── fiery-pianos-argue.md
│   ├── nice-bananas-hammer.md
│   ├── pre.json
│   ├── rude-shrimps-teach.md
│   └── two-vans-attend.md
├── .executor/
│   └── executor.jsonc
├── .github/
│   └── workflows/
│       ├── publish-executor-package.yml
│       └── release.yml
├── .gitignore
├── .oxlintrc.jsonc
├── ARCHITECTURE.md
├── PLAN.md
├── README.md
├── TRACING.md
├── apps/
│   ├── docs/
│   │   ├── CHANGELOG.md
│   │   ├── developer/
│   │   │   ├── adapters-and-formats.mdx
│   │   │   ├── cli.mdx
│   │   │   ├── codemode.mdx
│   │   │   ├── core-model.mdx
│   │   │   ├── credentials-and-auth.mdx
│   │   │   ├── extending-executor.mdx
│   │   │   ├── import-fidelity.mdx
│   │   │   ├── mcp.mdx
│   │   │   ├── overview.mdx
│   │   │   ├── persistence-and-migrations.mdx
│   │   │   └── tool-catalog-and-execution.mdx
│   │   ├── docs.json
│   │   ├── introduction.mdx
│   │   └── package.json
│   ├── executor/
│   │   ├── CHANGELOG.md
│   │   ├── bin/
│   │   │   └── executor
│   │   ├── package.json
│   │   ├── src/
│   │   │   ├── cli/
│   │   │   │   ├── dev.ts
│   │   │   │   ├── interaction-handling.test.ts
│   │   │   │   ├── interaction-handling.ts
│   │   │   │   ├── main.ts
│   │   │   │   ├── pending-interaction-output.test.ts
│   │   │   │   ├── pending-interaction-output.ts
│   │   │   │   └── runtime-paths.ts
│   │   │   ├── distribution/
│   │   │   │   ├── artifact.ts
│   │   │   │   ├── distribution.test.ts
│   │   │   │   ├── harness.ts
│   │   │   │   ├── metadata.ts
│   │   │   │   └── publish.ts
│   │   │   ├── effect-errors.ts
│   │   │   └── server/
│   │   │       ├── server.real-ingestion.test.ts
│   │   │       └── server.test.ts
│   │   └── tsconfig.json
│   └── web/
│       ├── CHANGELOG.md
│       ├── package.json
│       ├── src/
│       │   ├── components/
│       │   │   ├── code-block.tsx
│       │   │   ├── document-panel.tsx
│       │   │   ├── icons.tsx
│       │   │   ├── loadable.tsx
│       │   │   ├── local-mcp-install-card.tsx
│       │   │   ├── markdown.tsx
│       │   │   ├── shell.tsx
│       │   │   ├── source-favicon.tsx
│       │   │   ├── source-not-found-state.tsx
│       │   │   ├── source-recovery-state.tsx
│       │   │   └── ui/
│       │   │       ├── badge.tsx
│       │   │       └── button.tsx
│       │   ├── dev.ts
│       │   ├── frontend.tsx
│       │   ├── globals.css
│       │   ├── index.html
│       │   ├── lib/
│       │   │   ├── schema-display.ts
│       │   │   ├── shiki.ts
│       │   │   ├── source-favicon.ts
│       │   │   └── utils.ts
│       │   ├── main.tsx
│       │   ├── server.ts
│       │   └── views/
│       │       ├── add-source.tsx
│       │       ├── home.tsx
│       │       ├── json-form.ts
│       │       ├── mcp-transport-state.ts
│       │       ├── secrets.tsx
│       │       ├── source-detail.tsx
│       │       ├── source-editor.tsx
│       │       └── source-templates.ts
│       ├── tsconfig.json
│       └── vite.config.ts
├── compose.tracing.yaml
├── examples/
│   ├── mcp-elicitation-demo/
│   │   ├── CHANGELOG.md
│   │   ├── package.json
│   │   ├── src/
│   │   │   ├── index.ts
│   │   │   ├── main.ts
│   │   │   └── server.ts
│   │   └── tsconfig.json
│   └── serve-skills-via-mcp/
│       ├── CHANGELOG.md
│       ├── README.md
│       ├── package.json
│       ├── skills/
│       │   ├── postgres-incident-triage/
│       │   │   ├── SKILL.md
│       │   │   ├── references/
│       │   │   │   └── error-codes.md
│       │   │   └── scripts/
│       │   │       └── blocked-session-query.sql
│       │   └── release-notes-writer/
│       │       ├── SKILL.md
│       │       ├── assets/
│       │       │   └── release-template.md
│       │       ├── references/
│       │       │   └── style-guide.md
│       │       └── scripts/
│       │           └── validate-headings.ts
│       ├── src/
│       │   ├── catalog.ts
│       │   ├── index.ts
│       │   ├── main.ts
│       │   ├── server.ts
│       │   └── smoke.ts
│       └── tsconfig.json
├── knip.json
├── opencode.json
├── package.json
├── packages/
│   ├── auth/
│   │   ├── mcp-oauth/
│   │   │   ├── package.json
│   │   │   ├── src/
│   │   │   │   ├── effect-errors.ts
│   │   │   │   └── index.ts
│   │   │   └── tsconfig.json
│   │   └── oauth2/
│   │       ├── package.json
│   │       ├── src/
│   │       │   └── index.ts
│   │       └── tsconfig.json
│   ├── clients/
│   │   └── react/
│   │       ├── CHANGELOG.md
│   │       ├── package.json
│   │       ├── src/
│   │       │   ├── index.test.tsx
│   │       │   └── index.ts
│   │       ├── tsconfig.json
│   │       └── vitest.config.ts
│   ├── dev/
│   │   └── kitchen-sink/
│   │       ├── CHANGELOG.md
│   │       ├── package.json
│   │       ├── src/
│   │       │   ├── effect-errors.ts
│   │       │   ├── index.ts
│   │       │   ├── kitchen-sink.test.ts
│   │       │   ├── playground.ts
│   │       │   └── source-runtime.test.ts
│   │       ├── tsconfig.json
│   │       └── vitest.config.ts
│   ├── hosts/
│   │   ├── ai-sdk/
│   │   │   ├── CHANGELOG.md
│   │   │   ├── package.json
│   │   │   ├── src/
│   │   │   │   ├── ai.ts
│   │   │   │   ├── effect-errors.ts
│   │   │   │   ├── example-codemode-inproc.ts
│   │   │   │   ├── example-dynamic.ts
│   │   │   │   ├── example-static.ts
│   │   │   │   ├── example.ts
│   │   │   │   └── index.ts
│   │   │   └── tsconfig.json
│   │   └── mcp/
│   │       ├── CHANGELOG.md
│   │       ├── package.json
│   │       ├── src/
│   │       │   ├── index.ts
│   │       │   ├── paused-result.test.ts
│   │       │   └── paused-result.ts
│   │       └── tsconfig.json
│   ├── kernel/
│   │   ├── core/
│   │   │   ├── CHANGELOG.md
│   │   │   ├── package.json
│   │   │   ├── src/
│   │   │   │   ├── discovery.ts
│   │   │   │   ├── effect-errors.ts
│   │   │   │   ├── http-request-placements.ts
│   │   │   │   ├── index.test.ts
│   │   │   │   ├── index.ts
│   │   │   │   ├── isomorphic-hash.ts
│   │   │   │   ├── json-schema.ts
│   │   │   │   ├── schema-types.test.ts
│   │   │   │   ├── schema-types.ts
│   │   │   │   ├── system-tools.ts
│   │   │   │   ├── tool-map.ts
│   │   │   │   └── types.ts
│   │   │   ├── tsconfig.json
│   │   │   └── vitest.config.ts
│   │   ├── ir/
│   │   │   ├── README.md
│   │   │   ├── package.json
│   │   │   ├── src/
│   │   │   │   ├── catalog.test.ts
│   │   │   │   ├── catalog.ts
│   │   │   │   ├── ids.ts
│   │   │   │   ├── index.ts
│   │   │   │   └── model.ts
│   │   │   └── tsconfig.json
│   │   ├── runtime-deno-subprocess/
│   │   │   ├── CHANGELOG.md
│   │   │   ├── package.json
│   │   │   ├── src/
│   │   │   │   ├── deno-subprocess-worker.mjs
│   │   │   │   ├── deno-worker-process.ts
│   │   │   │   ├── index.test.ts
│   │   │   │   └── index.ts
│   │   │   ├── tsconfig.json
│   │   │   └── vitest.config.ts
│   │   ├── runtime-quickjs/
│   │   │   ├── CHANGELOG.md
│   │   │   ├── package.json
│   │   │   ├── src/
│   │   │   │   ├── index.test.ts
│   │   │   │   └── index.ts
│   │   │   └── tsconfig.json
│   │   └── runtime-ses/
│   │       ├── CHANGELOG.md
│   │       ├── package.json
│   │       ├── src/
│   │       │   ├── index.ts
│   │       │   └── sandbox-worker.mjs
│   │       └── tsconfig.json
│   ├── platform/
│   │   ├── control-plane/
│   │   │   ├── CHANGELOG.md
│   │   │   ├── package.json
│   │   │   ├── src/
│   │   │   │   ├── api/
│   │   │   │   │   ├── api.ts
│   │   │   │   │   ├── errors.ts
│   │   │   │   │   ├── executions/
│   │   │   │   │   │   ├── api.ts
│   │   │   │   │   │   └── http.ts
│   │   │   │   │   ├── http.ts
│   │   │   │   │   ├── index.ts
│   │   │   │   │   ├── local/
│   │   │   │   │   │   ├── api.ts
│   │   │   │   │   │   └── http.ts
│   │   │   │   │   ├── local-context.ts
│   │   │   │   │   ├── oauth/
│   │   │   │   │   │   ├── api.ts
│   │   │   │   │   │   └── http.ts
│   │   │   │   │   ├── payload-schemas.test.ts
│   │   │   │   │   ├── policies/
│   │   │   │   │   │   ├── api.ts
│   │   │   │   │   │   └── http.ts
│   │   │   │   │   ├── sources/
│   │   │   │   │   │   ├── api.ts
│   │   │   │   │   │   └── http.ts
│   │   │   │   │   └── string-schemas.ts
│   │   │   │   ├── client.ts
│   │   │   │   ├── index.ts
│   │   │   │   ├── runtime/
│   │   │   │   │   ├── __fixtures__/
│   │   │   │   │   │   ├── README.md
│   │   │   │   │   │   └── v1.2.3-google-calendar-workspace/
│   │   │   │   │   │       ├── .executor/
│   │   │   │   │   │       │   ├── artifacts/
│   │   │   │   │   │       │   │   └── sources/
│   │   │   │   │   │       │   │       ├── google-calendar/
│   │   │   │   │   │       │   │       │   └── documents/
│   │   │   │   │   │       │   │       │       └── doc_3c24a6731267de91.txt
│   │   │   │   │   │       │   │       └── google-calendar.json
│   │   │   │   │   │       │   ├── executor.jsonc
│   │   │   │   │   │       │   └── state/
│   │   │   │   │   │       │       └── workspace-state.json
│   │   │   │   │   │       └── fixture.json
│   │   │   │   │   ├── auth/
│   │   │   │   │   │   ├── auth-artifacts.ts
│   │   │   │   │   │   ├── auth-leases.ts
│   │   │   │   │   │   ├── mcp-auth-provider.ts
│   │   │   │   │   │   ├── mcp-oauth.ts
│   │   │   │   │   │   ├── oauth-loopback.test.ts
│   │   │   │   │   │   ├── oauth-loopback.ts
│   │   │   │   │   │   ├── oauth2-pkce.ts
│   │   │   │   │   │   ├── provider-grant-lifecycle.ts
│   │   │   │   │   │   ├── source-auth-material.test.ts
│   │   │   │   │   │   └── source-auth-material.ts
│   │   │   │   │   ├── catalog/
│   │   │   │   │   │   ├── catalog-typescript.ts
│   │   │   │   │   │   ├── prettier-format.ts
│   │   │   │   │   │   ├── schema-type-signature.ts
│   │   │   │   │   │   └── source/
│   │   │   │   │   │       ├── reconcile.ts
│   │   │   │   │   │       ├── runtime.test.ts
│   │   │   │   │   │       ├── runtime.ts
│   │   │   │   │   │       ├── snapshot.test.ts
│   │   │   │   │   │       ├── sync.ts
│   │   │   │   │   │       ├── type-declarations.test.ts
│   │   │   │   │   │       └── type-declarations.ts
│   │   │   │   │   ├── control-plane-runtime.test.ts
│   │   │   │   │   ├── effect-errors.ts
│   │   │   │   │   ├── execution/
│   │   │   │   │   │   ├── http.test.ts
│   │   │   │   │   │   ├── ir-execution.ts
│   │   │   │   │   │   ├── live.test.ts
│   │   │   │   │   │   ├── live.ts
│   │   │   │   │   │   ├── mcp-resume.test.ts
│   │   │   │   │   │   ├── runtime-config.test.ts
│   │   │   │   │   │   ├── runtime.ts
│   │   │   │   │   │   ├── service.ts
│   │   │   │   │   │   ├── state.ts
│   │   │   │   │   │   ├── test-http-client.ts
│   │   │   │   │   │   └── workspace/
│   │   │   │   │   │       ├── authorization.ts
│   │   │   │   │   │       ├── environment.ts
│   │   │   │   │   │       ├── local.ts
│   │   │   │   │   │       ├── source-catalog.ts
│   │   │   │   │   │       └── tool-invoker.ts
│   │   │   │   │   ├── fixtures/
│   │   │   │   │   │   ├── google-sheets-discovery.json
│   │   │   │   │   │   ├── linear-introspection.json
│   │   │   │   │   │   ├── neon-openapi.json
│   │   │   │   │   │   └── vercel-openapi.json
│   │   │   │   │   ├── index.ts
│   │   │   │   │   ├── local/
│   │   │   │   │   │   ├── capture-release-workspace-fixture.ts
│   │   │   │   │   │   ├── config-secrets.ts
│   │   │   │   │   │   ├── config.test.ts
│   │   │   │   │   │   ├── config.ts
│   │   │   │   │   │   ├── control-plane-store.test.ts
│   │   │   │   │   │   ├── control-plane-store.ts
│   │   │   │   │   │   ├── errors.ts
│   │   │   │   │   │   ├── installation.test.ts
│   │   │   │   │   │   ├── installation.ts
│   │   │   │   │   │   ├── operations.ts
│   │   │   │   │   │   ├── release-upgrade-fixtures.ts
│   │   │   │   │   │   ├── runtime-context.ts
│   │   │   │   │   │   ├── secret-material-providers.ts
│   │   │   │   │   │   ├── source-artifacts.test.ts
│   │   │   │   │   │   ├── source-artifacts.ts
│   │   │   │   │   │   ├── storage.ts
│   │   │   │   │   │   ├── tools.ts
│   │   │   │   │   │   ├── workspace-state.ts
│   │   │   │   │   │   └── workspace-sync.ts
│   │   │   │   │   ├── policy/
│   │   │   │   │   │   ├── invocation-policy-engine.test.ts
│   │   │   │   │   │   ├── invocation-policy-engine.ts
│   │   │   │   │   │   ├── operation-errors.ts
│   │   │   │   │   │   ├── operations-shared.ts
│   │   │   │   │   │   └── policies-operations.ts
│   │   │   │   │   ├── sources/
│   │   │   │   │   │   ├── catalog-sync-result.ts
│   │   │   │   │   │   ├── executor-tools.ts
│   │   │   │   │   │   ├── graphql-tools.test.ts
│   │   │   │   │   │   ├── graphql-tools.ts
│   │   │   │   │   │   ├── slug.ts
│   │   │   │   │   │   ├── source-adapter-fixture-matrix.test.ts
│   │   │   │   │   │   ├── source-adapters/
│   │   │   │   │   │   │   ├── google-discovery.test.ts
│   │   │   │   │   │   │   ├── google-discovery.ts
│   │   │   │   │   │   │   ├── graphql.test.ts
│   │   │   │   │   │   │   ├── graphql.ts
│   │   │   │   │   │   │   ├── index.ts
│   │   │   │   │   │   │   ├── internal.ts
│   │   │   │   │   │   │   ├── mcp.test.ts
│   │   │   │   │   │   │   ├── mcp.ts
│   │   │   │   │   │   │   ├── openapi.ts
│   │   │   │   │   │   │   ├── shared.ts
│   │   │   │   │   │   │   └── types.ts
│   │   │   │   │   │   ├── source-auth-service.ts
│   │   │   │   │   │   ├── source-credential-interactions.ts
│   │   │   │   │   │   ├── source-definitions.test.ts
│   │   │   │   │   │   ├── source-definitions.ts
│   │   │   │   │   │   ├── source-discovery.test.ts
│   │   │   │   │   │   ├── source-discovery.ts
│   │   │   │   │   │   ├── source-inspection.test.ts
│   │   │   │   │   │   ├── source-inspection.ts
│   │   │   │   │   │   ├── source-names.ts
│   │   │   │   │   │   ├── source-store/
│   │   │   │   │   │   │   ├── auth.ts
│   │   │   │   │   │   │   ├── config.ts
│   │   │   │   │   │   │   ├── deps.ts
│   │   │   │   │   │   │   ├── lifecycle.ts
│   │   │   │   │   │   │   └── records.ts
│   │   │   │   │   │   ├── source-store.test.ts
│   │   │   │   │   │   ├── source-store.ts
│   │   │   │   │   │   └── sources-operations.ts
│   │   │   │   │   └── store.ts
│   │   │   │   └── schema/
│   │   │   │       ├── common.ts
│   │   │   │       ├── enums.ts
│   │   │   │       ├── ids.ts
│   │   │   │       ├── index.ts
│   │   │   │       ├── models/
│   │   │   │       │   ├── auth/
│   │   │   │       │   │   ├── account.ts
│   │   │   │       │   │   ├── index.ts
│   │   │   │       │   │   └── principal.ts
│   │   │   │       │   ├── auth-artifact.ts
│   │   │   │       │   ├── auth-lease.ts
│   │   │   │       │   ├── code-migration.ts
│   │   │   │       │   ├── credential.ts
│   │   │   │       │   ├── execution.ts
│   │   │   │       │   ├── local-config.ts
│   │   │   │       │   ├── local-installation.ts
│   │   │   │       │   ├── policy.ts
│   │   │   │       │   ├── provider-auth-grant.ts
│   │   │   │       │   ├── secret-material.ts
│   │   │   │       │   ├── source-auth-session.ts
│   │   │   │       │   ├── source-catalog.ts
│   │   │   │       │   ├── source-discovery.ts
│   │   │   │       │   ├── source-inspection.ts
│   │   │   │       │   ├── source-oauth-client.ts
│   │   │   │       │   ├── source.ts
│   │   │   │       │   └── workspace-oauth-client.ts
│   │   │   │       └── schema.test.ts
│   │   │   ├── tsconfig.json
│   │   │   └── vitest.config.ts
│   │   └── server/
│   │       ├── CHANGELOG.md
│   │       ├── package.json
│   │       ├── src/
│   │       │   ├── config.ts
│   │       │   ├── effect-errors.ts
│   │       │   ├── env.test.ts
│   │       │   ├── env.ts
│   │       │   ├── index.ts
│   │       │   └── tracing.ts
│   │       └── tsconfig.json
│   └── sources/
│       ├── builtins/
│       │   ├── package.json
│       │   ├── src/
│       │   │   └── index.ts
│       │   └── tsconfig.json
│       ├── core/
│       │   ├── package.json
│       │   ├── src/
│       │   │   ├── catalog-fragment.ts
│       │   │   ├── catalog-json-schema.ts
│       │   │   ├── catalog-shared.ts
│       │   │   ├── catalog-sync-result.ts
│       │   │   ├── catalog-types.ts
│       │   │   ├── catalog.ts
│       │   │   ├── composition.ts
│       │   │   ├── discovery-models.ts
│       │   │   ├── discovery.ts
│       │   │   ├── effect-errors.ts
│       │   │   ├── index.ts
│       │   │   ├── registry.ts
│       │   │   ├── shared.ts
│       │   │   ├── source-models.ts
│       │   │   └── types.ts
│       │   └── tsconfig.json
│       ├── google-discovery/
│       │   ├── CHANGELOG.md
│       │   ├── package.json
│       │   ├── src/
│       │   │   ├── adapter.test.ts
│       │   │   ├── adapter.ts
│       │   │   ├── catalog.ts
│       │   │   ├── discovery.ts
│       │   │   ├── document.ts
│       │   │   ├── index.ts
│       │   │   ├── local-config.ts
│       │   │   ├── tools.test.ts
│       │   │   ├── tools.ts
│       │   │   └── types.ts
│       │   └── tsconfig.json
│       ├── graphql/
│       │   ├── package.json
│       │   ├── src/
│       │   │   ├── adapter.ts
│       │   │   ├── catalog.ts
│       │   │   ├── discovery.ts
│       │   │   ├── graphql-tools.ts
│       │   │   ├── index.ts
│       │   │   ├── local-config.ts
│       │   │   └── provider-data.ts
│       │   └── tsconfig.json
│       ├── mcp/
│       │   ├── CHANGELOG.md
│       │   ├── package.json
│       │   ├── src/
│       │   │   ├── adapter.ts
│       │   │   ├── catalog.ts
│       │   │   ├── connection-pool.ts
│       │   │   ├── connection.ts
│       │   │   ├── discovery.ts
│       │   │   ├── elicitation-bridge.ts
│       │   │   ├── elicitation-form.test.ts
│       │   │   ├── elicitation.url.test.ts
│       │   │   ├── index.ts
│       │   │   ├── local-config.ts
│       │   │   ├── manifest.ts
│       │   │   ├── tools.test.ts
│       │   │   └── tools.ts
│       │   ├── tsconfig.json
│       │   └── vitest.config.ts
│       └── openapi/
│           ├── CHANGELOG.md
│           ├── openapi-extractor-rs/
│           │   ├── .gitignore
│           │   ├── Cargo.toml
│           │   ├── build-wasm.sh
│           │   └── src/
│           │       ├── lib.rs
│           │       └── main.rs
│           ├── package.json
│           ├── src/
│           │   ├── adapter.ts
│           │   ├── catalog.ts
│           │   ├── definitions.ts
│           │   ├── discovery.ts
│           │   ├── document.test.ts
│           │   ├── document.ts
│           │   ├── extraction.real-specs.test.ts
│           │   ├── extraction.ts
│           │   ├── extractor-wasm.ts
│           │   ├── http-serialization.ts
│           │   ├── index.ts
│           │   ├── local-config.ts
│           │   ├── openapi-extractor-wasm/
│           │   │   ├── openapi_extractor.d.ts
│           │   │   ├── openapi_extractor.js
│           │   │   ├── openapi_extractor_bg.wasm
│           │   │   └── openapi_extractor_bg.wasm.d.ts
│           │   ├── real-spec-coverage.test.ts
│           │   ├── schema-refs.ts
│           │   ├── tool-presentation.test.ts
│           │   ├── tool-presentation.ts
│           │   ├── tools.test.ts
│           │   ├── tools.ts
│           │   └── types.ts
│           ├── tsconfig.json
│           └── vitest.config.ts
├── skills-lock.json
├── tools/
│   └── oxlint/
│       ├── README.md
│       ├── plugin.mjs
│       ├── rules/
│       │   ├── no-async-effect-vitest-tests.mjs
│       │   ├── no-cross-workspace-relative-imports.mjs
│       │   ├── no-direct-effect-tag-read.mjs
│       │   ├── no-effect-run-in-effect-vitest-tests.mjs
│       │   ├── no-node-fs-with-effect-imports.mjs
│       │   ├── no-raw-effect-fail-errors.mjs
│       │   ├── no-workspace-src-imports.mjs
│       │   └── no-yield-effect-fail.mjs
│       └── workspace-utils.mjs
└── turbo.json

================================================
FILE CONTENTS
================================================

================================================
FILE: .changeset/README.md
================================================
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets).

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md).


================================================
FILE: .changeset/config.json
================================================
{
  "$schema": "https://unpkg.com/@changesets/config@3.1.3/schema.json",
  "changelog": "@changesets/cli/changelog",
  "commit": false,
  "fixed": [],
  "linked": [],
  "access": "public",
  "baseBranch": "main",
  "updateInternalDependencies": "patch",
  "ignore": []
}


================================================
FILE: .changeset/eleven-towns-brush.md
================================================
---
"executor": patch
---

Auto migrate sources on startup


================================================
FILE: .changeset/fiery-pianos-argue.md
================================================
---
"executor": patch
---

Move execution to adapters rather than IR model


================================================
FILE: .changeset/nice-bananas-hammer.md
================================================
---
"executor": patch
---

Fix legacy format parsing


================================================
FILE: .changeset/pre.json
================================================
{
  "mode": "pre",
  "tag": "beta",
  "initialVersions": {
    "@executor/docs": "0.0.0",
    "executor": "1.2.3",
    "@executor/mcp-elicitation-demo": "0.0.0",
    "@executor/web": "0.0.0",
    "@executor/serve-skills-via-mcp-demo": "0.0.0",
    "@executor/auth-mcp-oauth": "0.0.0",
    "@executor/auth-oauth2": "0.0.0",
    "@executor/react": "0.0.0",
    "@executor/kitchen-sink": "0.0.0",
    "@executor/ai-sdk-adapter": "0.0.0",
    "@executor/executor-mcp": "0.0.0",
    "@executor/codemode-core": "0.0.0",
    "@executor/ir": "0.0.0",
    "@executor/runtime-deno-subprocess": "0.0.0",
    "@executor/runtime-quickjs": "0.0.0",
    "@executor/runtime-ses": "0.0.0",
    "@executor/control-plane": "0.0.0",
    "@executor/server": "0.0.0",
    "@executor/source-builtins": "0.0.0",
    "@executor/source-core": "0.0.0",
    "@executor/source-google-discovery": "0.0.0",
    "@executor/source-graphql": "0.0.0",
    "@executor/source-mcp": "0.0.0",
    "@executor/source-openapi": "0.0.0"
  },
  "changesets": [
    "eleven-towns-brush",
    "fiery-pianos-argue",
    "nice-bananas-hammer",
    "rude-shrimps-teach",
    "two-vans-attend"
  ]
}


================================================
FILE: .changeset/rude-shrimps-teach.md
================================================
---
"executor": patch
---

Fix Google Discovery tool execution for sources stored with discovery document endpoints


================================================
FILE: .changeset/two-vans-attend.md
================================================
---
"executor": patch
---

Fix build


================================================
FILE: .executor/executor.jsonc
================================================
{
  "sources": {
    "vercel": {
      "kind": "openapi",
      "name": "Vercel API",
      "connection": {
        "endpoint": "https://api.vercel.com/"
      },
      "binding": {
        "specUrl": "https://openapi.vercel.sh/",
        "defaultHeaders": null
      }
    }
  }
}


================================================
FILE: .github/workflows/publish-executor-package.yml
================================================
name: Publish Executor
run-name: "${{ format('publish executor {0}', github.event_name == 'workflow_dispatch' && inputs.tag || github.ref_name) }}"

on:
  push:
    tags:
      - "v*"
  workflow_dispatch:
    inputs:
      tag:
        description: Git tag to publish
        required: true
        type: string

permissions:
  contents: write
  id-token: write

concurrency:
  group: publish-executor-package-${{ github.ref }}
  cancel-in-progress: false

jobs:
  publish:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v4
        with:
          fetch-depth: 0
          ref: ${{ github.event_name == 'workflow_dispatch' && format('refs/tags/{0}', inputs.tag) || github.ref }}

      - name: Setup Bun
        uses: oven-sh/setup-bun@v2

      - name: Setup Node
        uses: actions/setup-node@v4
        with:
          node-version: 24
          registry-url: https://registry.npmjs.org

      - name: Update npm for trusted publishing
        run: |
          npm install -g npm@latest
          npm --version

      - name: Install dependencies
        run: bun install --frozen-lockfile

      - name: Run executor checks
        run: |
          bun run --cwd apps/executor typecheck
          bun run --cwd apps/executor test

      - name: Publish package and create release
        env:
          GH_TOKEN: ${{ github.token }}
          NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
          RELEASE_TAG: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref_name }}
        run: |
          export GITHUB_REF_TYPE=tag
          export GITHUB_REF_NAME="$RELEASE_TAG"
          export GITHUB_REF="refs/tags/$RELEASE_TAG"
          if [ -n "${NPM_TOKEN:-}" ]; then
            export NODE_AUTH_TOKEN="$NPM_TOKEN"
          fi
          bun run --cwd apps/executor release:publish


================================================
FILE: .github/workflows/release.yml
================================================
name: Release
run-name: "prepare release"

on:
  push:
    branches:
      - main

permissions:
  actions: write
  contents: write
  id-token: write
  pull-requests: write

concurrency:
  group: release-${{ github.ref }}
  cancel-in-progress: false

jobs:
  release:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v4
        with:
          fetch-depth: 0

      - name: Setup Bun
        uses: oven-sh/setup-bun@v2

      - name: Setup Node
        uses: actions/setup-node@v4
        with:
          node-version: 24

      - name: Install dependencies
        run: bun install --frozen-lockfile

      - name: Create or update release pull request
        id: changesets
        uses: changesets/action@v1
        with:
          version: bun run changeset:version
          commit: Version Packages
          title: Version Packages
          createGithubReleases: false
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

      - name: Detect release version change
        if: steps.changesets.outputs.hasChangesets == 'false'
        id: detect_release
        run: |
          before="${{ github.event.before }}"
          if [ "$before" = "0000000000000000000000000000000000000000" ]; then
            before="$(git rev-list --max-count=1 HEAD^ 2>/dev/null || true)"
          fi

          version="$(node -e "console.log(JSON.parse(require('fs').readFileSync('apps/executor/package.json', 'utf8')).version)")"
          if [ -n "$before" ] && git cat-file -e "$before:apps/executor/package.json" 2>/dev/null; then
            previous_version="$(git show "$before:apps/executor/package.json" | node -e "let data = ''; process.stdin.setEncoding('utf8'); process.stdin.on('data', (chunk) => { data += chunk; }); process.stdin.on('end', () => { console.log(JSON.parse(data).version ?? ''); });")"
          else
            previous_version=""
          fi

          if [ -n "$previous_version" ] && [ "$previous_version" != "$version" ]; then
            echo "changed=true" >> "$GITHUB_OUTPUT"
          else
            echo "changed=false" >> "$GITHUB_OUTPUT"
          fi

          echo "version=$version" >> "$GITHUB_OUTPUT"

      - name: Create and push release tag
        if: steps.changesets.outputs.hasChangesets == 'false' && steps.detect_release.outputs.changed == 'true'
        run: |
          tag="v${{ steps.detect_release.outputs.version }}"
          if git ls-remote --exit-code --tags origin "refs/tags/$tag" >/dev/null 2>&1; then
            echo "Tag $tag already exists."
            exit 0
          fi

          git config user.name "github-actions[bot]"
          git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
          git tag "$tag"
          git push origin "$tag"

      - name: Trigger publish workflow
        if: steps.changesets.outputs.hasChangesets == 'false' && steps.detect_release.outputs.changed == 'true'
        env:
          GH_TOKEN: ${{ github.token }}
        run: |
          tag="v${{ steps.detect_release.outputs.version }}"
          gh workflow run publish-executor-package.yml --ref "$tag" -f tag="$tag"


================================================
FILE: .gitignore
================================================
# Environment variables
.env
.env.*
!.env.example
.env*.local

# Vercel
.vercel

# Next.js
.next/

# Turbo
.turbo/
.turbo-prune-check/

# Executor
.executor-v2/
.executor/*
!.executor/executor.json
!.executor/executor.jsonc
.executor/artifacts/
.executor/state/
.executor/types/

# Cloudflare Workers local state
**/.wrangler/
**/.dev.vars

# Dependencies
**/node_modules/

# TypeScript build info
*.tsbuildinfo

# Output / build artifacts
out
dist
*.tgz

# Rust / Cargo build artifacts
**/target/
tools/openapi-extractor-rs/pkg-*/

# Code coverage
coverage
*.lcov

# Logs
logs
*.log
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Caches
.eslintcache
.cache

# IntelliJ based IDEs
.idea

# Finder (macOS)
.DS_Store

# Convex local backend state
convex_local_backend.sqlite3
convex_local_storage/

# Local OpenAPI sources service state
sources/data/*.sqlite
sources/data/*.sqlite-shm
sources/data/*.sqlite-wal

# Composio toolkit scrape outputs
sources/composio-scrape/data/

# Dev runner PID file
.dev.pids

# Misc
*.har
.chat-links.json
.reference/
personal-notes/
.tmp/
executor/.env.executor-push
ignored/

================================================
FILE: .oxlintrc.jsonc
================================================
{
  "$schema": "./node_modules/oxlint/configuration_schema.json",

  // Keep the built-in default plugin set explicit so monorepo lint behavior
  // does not drift when oxlint changes its defaults.
  "plugins": ["typescript", "oxc", "unicorn"],

  "categories": {
    "correctness": "warn",
  },

  "ignorePatterns": [
    "**/node_modules/**",
    "**/.turbo/**",
    "**/dist/**",
    "**/coverage/**",
    "**/.next/**",
    "**/.mint/**",
  ],

  "settings": {
    "executorMonorepo": {
      "packageScopes": ["@executor/"],
    },
  },

  "jsPlugins": [
    {
      "name": "executor-monorepo",
      "specifier": "./tools/oxlint/plugin.mjs",
    },
  ],

  "rules": {
    // This repo uses Effect.gen heavily. The underlying generator syntax is an
    // implementation detail, so "no yield" is not a useful signal here.
    "require-yield": "off",

    "no-unused-vars": "warn",

    // Monorepo-specific rules.
    "executor-monorepo/no-async-effect-vitest-tests": "error",
    "executor-monorepo/no-cross-workspace-relative-imports": "error",
    "executor-monorepo/no-direct-effect-tag-read": "error",
    "executor-monorepo/no-effect-run-in-effect-vitest-tests": "error",
    "executor-monorepo/no-node-fs-with-effect-imports": "error",
    "executor-monorepo/no-raw-effect-fail-errors": "error",
    "executor-monorepo/no-yield-effect-fail": "error",
    "executor-monorepo/no-workspace-src-imports": "warn",
  },

  "overrides": [
    {
      // JSON Schema conditionals legitimately use a `then` key.
      "files": [
        "packages/platform/control-plane/src/runtime/catalog/source/runtime.ts",
      ],
      "rules": {
        "unicorn/no-thenable": "off",
      },
    },
    {
      // This stack-integrity check intentionally prefers invariant failures in cleanup.
      "files": ["packages/sources/core/src/catalog-json-schema.ts"],
      "rules": {
        "no-unsafe-finally": "off",
      },
    },
    {
      // Generated wasm glue is vendored into the repo and not hand-maintained.
      "files": [
        "packages/sources/openapi/src/openapi-extractor-wasm/openapi_extractor.js",
      ],
      "rules": {
        "no-unused-vars": "off",
      },
    },
  ],
}


================================================
FILE: ARCHITECTURE.md
================================================
# Architecture

This document explains the active v3 architecture at a high level.

If `README.md` answers "what is this product and how do I use it?", this file answers "what are the major moving parts and how do they fit together?"

## One-line view

`executor` is a local daemonized control plane that turns connected sources into a workspace tool catalog and then runs TypeScript against that catalog, pausing for user interaction whenever a tool or auth flow needs it.

## System shape

```text
                +-----------------------+
                |   CLI / executor      |
                |  apps/executor        |
                +-----------+-----------+
                            |
                            | HTTP
                            v
+-------------+   +---------+---------+   +----------------+
| Browser UI  |-->| local server      |<--| MCP clients    |
| apps/web    |   | packages/platform |   | via /mcp       |
|             |   | /server           |   |                |
+-------------+   +---------+---------+   +----------------+
                            |
                            | provides runtime layer
                            v
                  +---------+---------+
                  | control plane      |
                  | packages/platform/ |
                  | control-plane      |
                  +----+-----+----+----+
                       |     |    |
         persistence --+     |    +-- source auth / discovery / inspection
                             |
                             +-- execution environment resolver
                             |
                             +-- live execution manager
                             v
                  +---------+---------+
                  | QuickJS sandboxed  |
                  | executor runtime   |
                  | packages/kernel/   |
                  | runtime-quickjs    |
                  | default executor   |
                  +--------------------+
```

## Design goals reflected in the code

The current architecture optimizes for a few specific ideas:

- local-first operation with one daemon instead of many disconnected tools
- one shared runtime for CLI, browser UI, and MCP access
- schema-rich tool usage instead of raw HTTP from prompts
- reusable source connections that become workspace-scoped tools
- human-in-the-loop execution that can pause and resume cleanly
- adapters for multiple source kinds without hardwiring product logic to one protocol

## Major components

### `apps/executor`: installed CLI and daemon manager

This is the main user entrypoint.

Responsibilities:

- exposes commands such as `up`, `down`, `status`, `doctor`, `call`, and `resume`
- ensures the local daemon is running before execution
- submits TypeScript executions to the local control plane
- handles paused interaction flows, including opening browser URLs when needed
- includes a few dev-only seed helpers for demo sources

Conceptually, the CLI is not the business logic. It is a thin user-facing shell over the local runtime.

### `packages/platform/server`: one local process for API, MCP, and UI

This package hosts the actual local server.

Responsibilities:

- creates the control-plane runtime
- mounts the control-plane HTTP API at `/v1`
- mounts the `executor` MCP endpoint at `/mcp`
- serves the web UI assets for normal browser routes
- writes PID metadata for daemon lifecycle management

This is an important architectural choice: the API and UI are served by the same local process, so the product behaves like one install rather than a pile of separate services.

### `packages/platform/control-plane`: product core

This is the center of the system.

It contains the runtime layer, persistence integration, and the business logic for:

- local installation bootstrap
- accounts, organizations, and workspaces
- source discovery and connection
- source auth and credential flows
- source inspection and tool indexing
- secret and credential handling
- execution creation, resumption, and state tracking
- policy-aware tool invocation

If you want to understand the behavior of the product, this is the most important package.

### `packages/kernel/runtime-quickjs`: default code execution runtime

This package provides the TypeScript execution environment used by the local product.

At a high level it receives:

- an executor implementation
- a tool catalog
- a tool invoker

and runs user-authored code against that environment.

The default runtime executes code inside a QuickJS WebAssembly sandbox so tool calls stay proxied through the control plane.

The workspace can override that in `.executor/executor.jsonc` with `runtime: "quickjs" | "ses" | "deno"`.

### Adapter packages

Several packages exist to turn external systems into callable tools:

- `packages/kernel/core`: shared tool abstractions, discovery, schemas, and system tools
- `packages/sources/mcp`: MCP tool loading and invocation
- `packages/sources/openapi`: OpenAPI extraction, manifests, and tool generation
- `packages/hosts/mcp`: exposes the local runtime itself as an MCP server
- `packages/clients/react`: React hooks and client state wrappers for the local UI

These packages are what let the control plane treat multiple source kinds as one logical tool catalog.

## Runtime model

### Local installation bootstrap

On first startup, the control plane provisions a local installation automatically.

That bootstrap creates:

- one local account
- one personal organization
- one default workspace
- one local installation record that points at them

This means the product can work out of the box as a local single-user system without requiring an external identity or tenant setup step.

### Single daemon, shared state

All main entrypoints talk to the same local daemon:

- CLI commands call the local HTTP API
- the web app calls the same local HTTP API
- MCP hosts talk to the `/mcp` handler exposed by that same process

Because of that, these surfaces share:

- the same workspace
- the same connected sources
- the same secrets and credentials
- the same execution history and interaction state

## Persistence model

The persistence layer is local-file-backed.

Default behavior:

- workspace config and state are stored in local files

Optional behavior:

- future cloud backends can plug in behind Effect service boundaries

At a high level, the local control plane stores these domains:

- installation identity: local installation identity for the workspace
- source state: sources, auth sessions, source credential bindings
- tool model: tool artifacts and related metadata extracted from sources
- secret state: credentials and secret materials
- execution state: executions and execution interactions
- governance state: policies

This is why `executor` can reconnect sources once, inspect them later, and run multiple executions over time without rebuilding everything from scratch on every prompt.

## Source lifecycle

The source lifecycle is one of the defining architectural paths in the system.

### 1. Discovery

The Add Source flow starts with URL discovery.

The discovery service probes a URL and tries, in order, to determine whether it looks like:

- an OpenAPI source
- a GraphQL source
- an MCP source
- or an unknown endpoint

Discovery also produces metadata such as:

- inferred source kind
- confidence level
- probable auth style
- optional spec URL
- warnings
- potential namespace and transport hints

### 2. Connection and auth

Once a source is identified, the auth service drives the connection flow.

Depending on the source, that may involve:

- connecting immediately with no auth
- asking for a bearer token or other credential material
- creating an OAuth session and handing the user into a browser flow
- persisting auth bindings back to the source

The important architecture point is that source connection is not just a CRUD write. It is a runtime workflow that can branch into interactive auth.

### 3. Tool indexing

After a source is connected, `executor` materializes a workspace-visible tool model.

The exact extraction path depends on the source kind:

- OpenAPI sources are transformed from the OpenAPI document into tool manifests and typed operations
- GraphQL sources are introspected into callable query and mutation tools
- MCP sources are represented through persisted tool artifacts and runtime invocation metadata

This indexed representation is what powers search, inspection, and execution without re-parsing everything in the UI.

### 4. Inspection

The source inspection service reconstructs a rich inspection bundle for the UI.

That bundle includes:

- source metadata
- namespace and pipeline kind
- tool summaries
- tool detail payloads
- raw document text when available
- manifest and definitions JSON when available

The UI uses this to show both a tree view of tools and a search-oriented discovery view.

## Execution architecture

Execution is the other defining path in the system.

### 1. Create execution

An execution begins when the CLI, API, or MCP bridge submits TypeScript code.

The control plane creates an execution record with status such as:

- `pending`
- `running`
- `waiting_for_interaction`
- `completed`
- `failed`

### 2. Resolve the workspace execution environment

Before code runs, the runtime builds the execution environment for the current workspace.

That environment combines:

- built-in system tools from `codemode-core`
- `executor` internal tools such as `executor.sources.add`
- persisted tools generated from connected OpenAPI, GraphQL, and MCP sources

The resolver returns three things:

- the SES code executor
- the workspace tool catalog
- the tool invoker that actually dispatches calls

This resolver is the composition point where the whole product becomes one callable tool surface.

### 3. Run TypeScript

The code then runs inside the local SES sandbox runtime.

The intended calling pattern is:

1. discover a tool by intent
2. inspect its schema if needed
3. call the selected `tools.*` path

The runtime is deliberately opinionated here: the product is built around tool calls, not ad hoc `fetch` requests from user code.

### 4. Invoke tools through the control plane

When code calls a tool, the control plane decides how to handle it.

Possible paths include:

- built-in system tool invocation
- internal `executor` tool invocation
- OpenAPI tool invocation with resolved auth headers
- GraphQL tool invocation with resolved auth headers
- MCP tool invocation through the MCP connector

This is also the point where policy checks and source auth resolution happen.

### 5. Persist results and surface interactions

The execution service updates persistent execution state as the run progresses.

If a tool call or auth flow needs user interaction, the live execution manager:

- creates an execution interaction record
- marks the execution as `waiting_for_interaction`
- stores enough payload to resume later
- waits for a structured elicitation response

Once the response arrives, the manager moves the execution back to `running` and the code continues.

## Human interaction model

A major architectural feature of `executor` is that interactions are first-class runtime state.

This is handled by the live execution manager and the execution interaction tables.

That gives the product a clean pause/resume loop instead of forcing every host to improvise its own half-finished approval flow.

Interaction types include:

- URL-based flows, such as opening a secure credential page or OAuth URL
- form-like elicitation where a host can provide a structured response

This same idea is used both for direct CLI execution and for the MCP-facing `execute` and `resume` tools.

## API and MCP surfaces

### HTTP API

The control-plane HTTP API is mounted under `/v1`.

Major groups include:

- local installation and secret management
- OAuth
- organizations and memberships
- workspaces
- sources
- policies
- executions

The web UI is a client of this API.

### MCP bridge

`packages/hosts/mcp` exposes the local runtime as an MCP server.

The bridge registers two main tools:

- `execute`: run TypeScript against the local runtime
- `resume`: continue a paused execution

When the MCP host supports managed elicitation, the bridge can drive the interaction loop directly through MCP instead of requiring the caller to implement custom resume handling.

## Frontend architecture

The web app lives in `apps/web` and is a React app built with Vite.

At a high level:

- routes are managed with TanStack Router
- data access is wrapped by `@executor/react`
- the UI is focused on sources, source inspection, and secrets
- production assets are served by the local server
- development runs Vite separately while still embedding the same backend behavior

The frontend is intentionally thin. It is mostly a presentation layer over the control-plane API.

## Why the architecture is shaped this way

The system is trying to solve a specific product problem:

- give agents a better way to use tools than pasting giant manifests into prompts
- keep auth, credentials, and user interactions in a durable runtime
- let many protocols look like one workspace tool surface
- make CLI, UI, and MCP hosts all operate on the same local state

That is why the architecture keeps converging on the same central idea:

`executor` is not just a CLI and not just an MCP server. It is a local runtime that owns source connection, tool indexing, execution, and interaction state.

## Current boundaries

A few practical boundaries are worth calling out:

- the active implementation is local-first and single-daemon
- the current web app is React/Vite, not the older architectures mentioned in planning notes
- `legacy/` and `legacy2/` are historical context, not the active runtime
- policy infrastructure exists in the core, but the central product loop today is source connection plus execution

## Read next

- `README.md` for the product view and usage guidance
- `apps/executor/src/cli/main.ts` for the CLI surface
- `packages/platform/server/src/index.ts` for how the local server is assembled
- `packages/platform/control-plane/src/runtime/` for the core runtime flows


================================================
FILE: PLAN.md
================================================
Executor:

Project goal: Build an execution environment for agents to interact with APIs, MCPs, GraphQL, and other services via writing TypeScript.

The way things work today is if people want to interact with services, they either add an mcp or they call it through a cli. for mcp servers when someone adds it to their agent, it blows up the context window of tokens. the agent isn't able to call it in an efficient way and it adds a lot of bloat so people have ended up using clis instead.

the problem with the cli is people run things in dangerously allowable permissions. along with that you don't have typing and information about what clis are installed, what they can do, et cetera. by creating this typescript code execution environment we're able to handle both those problems. you can read the article code mode to understand deeper the benefits of this approach.

the basic premise is that you give the agent the ability to search over what can be called from typescript and write code to call it. it can see the typings properly through typescript.

let's look at some examples.

let's say the agent wants to list the github issues for a repository. the agent call is executed through an mcp call and it parses typescript code from that. that typescript code will basically just be

`tools.discover` and then the query which is github issues list.

so `tools.discover("github issues list")`

that then returns the callable paths and then the agent writes another line of code. that is await tools.github.issues.list. that executes in a sandbox and it calls a proxy object which makes a fetch to run the call and then that runs that call in the secure environment. that call completes and the results are given to the sandbox and the sandbox resumes.

another instance is the case where a tool needs some form of user action. the example that i will give is approvals and if it's a create issue for example, the agent would write `await tools.github.issues.create`. that would then call the proxy object. the proxy object would trigger the interaction and then once the user approves that interaction it resumes.

a note on the interaction model: i believe we want to model this off of mcp elicitation which you can see the spec for in references. the reason we want to model it off of mcp elicitation is that for apis for example that will just be a standard approve/deny model but for something like this since we support calling mcp servers those mcp servers could actually try and elicit input for the user.

So let's talk about interaction model a little bit. Executor is going to be configurable through Executor, and so you would be able to add a source, for example, by just prompting: "Hey, please add Axiom as a source." What it would do is it would call tools.executor.AddSource, which calls the MCP server. That MCP server matches kind of the web flow where there's information or an action you need to elicit from the user. What that information action looks like is in the OAUTH flow. It's: they have to go sign in somewhere; there's some callback that happens, and then something's created for that. It's details on that, but we get them onto a web page in the browser to sign in. A similar thing would be if a source required an API key. It's the same concept if you open up a web page to securely input that.

Current state:

We are on v3 of this codebase which is a completely fresh start, the original codebase is in legacy/, the v2 is in legacy2/.

Architecture I like:

Database:
Local-file-backed control plane for local use, with room for future hosted backends

Server:

- API
  The web dashboard calls the API via effect-atom.

- MCP
  Executor is configurable via executor. A user can enter the prompt "Please add the https://mcp.notion.com/mcp to my workspace"

We use MCP here instead of the API as the user has to perform actions in many cases. An example of this is OAuthing to an MCP server or opening a page to set a secret in. This prevents the secrets from being pasted over a chat

Doing MCP here w/ MCP elicitation allows us to not give special treatment to the executor app while also giving a nice UX

Ideally the MCP server shares a lot of logic between API

Clients:

- Web client
  Cloud product hosted at executor.sh, local one just on localhost
  This is a next.js app, so we will actually host the api/ in a route handler on it however it's important we implement the API in a standalone package and it just exposes a standard web request / response handler
- CLI
  Connects to either the cloud api endpoint

Standalone:

- SDK
  Allows for people to use everything we've built in their own apps, including ingesting API specs / MCPs for calling

Runtimes:

- Deno
- In process
- Cloudflare worker runtime

Other:

- Avoid hardcoding strings in the core libraries, prefer programming to interfaces, this is because it allows people to build custom adapters without having to modify the core
- Aim for composability of adapters. For example, the cloud product may eventually store secrets in a hosted backend while still supporting BYO 1Password. This does not need to be implemented today but is worth noting.
- This is a fresh start so we can make whatever changes we need.

Rough architecture is: Turborepo monorepo, effect-vitest for testing, bun for package manager / running apps (but we leverage Effect wherever possible rather than bun's apis i.e for the server), Next.js for web app

References:
https://blog.cloudflare.com/code-mode/ - concept we are implementing
https://mcp.axiom.co/mcp - MCP server that requires auth
https://modelcontextprotocol.io/specification/draft/client/elicitation - How we are going to be handling interactions from the user
legacy/ original implementation
legacy2


================================================
FILE: README.md
================================================
# executor


https://github.com/user-attachments/assets/11225f83-e848-42ba-99b2-a993bcc88dad


`executor` is a local-first execution environment for AI agents.

It gives an agent a TypeScript runtime, a discoverable tool catalog, and a single local place to connect external systems such as MCP servers, OpenAPI APIs, and GraphQL APIs. Instead of pasting large MCP manifests into every chat or giving an agent broad shell access, you run code inside `executor` and let it call typed `tools.*` functions.

## Community

Join the Discord community: https://discord.gg/eF29HBHwM6

At runtime, `executor` behaves like one local product:

- a CLI for starting the runtime and executing code
- a local API server
- a local web UI for connecting sources, inspecting tools, and managing secrets
- an MCP endpoint for hosts that want to drive `executor` through MCP

The current codebase lives in `apps/` and `packages/`. Older experiments stay in `legacy/` and `legacy2/`.

## Attribution

- [Crystian](https://www.linkedin.com/in/crystian/) provided the npm package name `executor`.
- The `codemode` concept in this project is inspired by Cloudflare's [Code Mode announcement](https://blog.cloudflare.com/code-mode/).

## Why this exists

`executor` is built around a simple idea: agents should work against a structured tool environment instead of guessing at raw HTTP calls, carrying huge MCP definitions in context, or running arbitrary local commands with broad permissions.

In practice that means:

- sources are connected once and turned into a reusable workspace tool catalog
- the agent discovers tools by intent, inspects schemas, and then calls typed functions
- secrets and OAuth flows stay in the local runtime and web UI instead of being pasted into chat
- human interaction can pause an execution and resume it cleanly

## Mental model

Think of `executor` as a local control plane for agent tool use.

1. You start a local `executor` daemon.
2. You connect sources such as an MCP server, an OpenAPI document, or a GraphQL endpoint.
3. `executor` indexes those sources into a workspace tool catalog.
4. An agent runs TypeScript against that catalog through `executor call` or through the MCP bridge.
5. If a tool needs credentials or user input, execution pauses, opens a local flow, and then resumes.

## What it does today

### Connect external tool sources

`executor` currently supports these source types:

- `mcp`: remote MCP servers, including transport selection for streamable HTTP or SSE
- `openapi`: REST APIs described by an OpenAPI document
- `graphql`: GraphQL endpoints that can be introspected into callable tools

The add-source flow can:

- probe a URL and infer what kind of source it is
- infer likely authentication requirements
- prompt for credentials when discovery or connection needs them
- start OAuth when a source requires it
- persist the source and its indexed tool metadata in the local workspace

The web app also includes templates for common providers so you can start from real examples instead of filling every field by hand.

### Run agent code against tools

The main CLI workflow is `executor call`.

The runtime expects the agent to use the built-in discovery workflow:

```ts
const matches = await tools.discover({ query: "github issues", limit: 5 });
const path = matches.bestPath;
const detail = await tools.describe.tool({ path, includeSchemas: true });

return await tools.github.issues.list({
  owner: "vercel",
  repo: "next.js",
});
```

A few important rules shape the execution model:

- write TypeScript, not raw shell pipelines
- use `tools.*`, not direct `fetch`
- discover first when the exact tool path is not known
- inspect schemas before calling complex tools

### Handle credentials and user interaction

When a source or tool needs human input, `executor` can pause the execution and create an interaction record.

That interaction may ask you to:

- open a secure local credential page
- complete an OAuth flow in the browser
- respond to a structured elicitation from a tool host
- resume a paused execution from the CLI

This is the core human-in-the-loop behavior that lets `executor` keep secrets and approvals outside the agent's raw context.

### Inspect the connected tool model

The web UI is not just a setup surface. It is also where you can inspect what `executor` learned from a source.

For each source you can:

- browse its tool tree
- search for tools by intent
- inspect input and output schemas
- view generated manifests, definitions, and raw source documents when available
- edit source settings and authentication details

## Quick start

If you want to use this a package distribution, install it via npm:

```bash
npm install -g executor
executor up
```

Then either tell your agent to use the CLI or to open the web UI and copy the MCP CLI install command.

Then you can run the CLI as `executor`.

If you are working from this repository locally, the easiest path is:

```bash
bun install
bun dev
```

That starts the local runtime. The default base URL is:

```text
http://127.0.0.1:8788
```

From there:

1. Open the web UI in your browser.
2. Add a source from `/sources/add`.
3. If needed, store credentials in `/secrets`.
4. Run TypeScript with `bun run executor call ...`.

If you are using a packaged distribution, the command name is simply `executor` instead of `bun run executor`.

## Core CLI commands

```bash
executor up
executor down
executor status --json
executor doctor --json
executor call --file script.ts
executor resume --execution-id exec_123
```

`executor call` accepts code in three ways:

- inline as a positional argument
- from `--file`
- from standard input with `--stdin`

Examples:

```bash
executor call 'const matches = await tools.discover({ query: "repo details", limit: 1 }); return matches;'
executor call --file script.ts
cat script.ts | executor call --stdin
executor call --no-open --file script.ts
```

If an execution pauses, resume it with:

```bash
executor resume --execution-id exec_123
```

## Adding a source

There are two main ways to add a source.

### In the web UI

Use the Add Source flow to:

- paste a URL
- run discovery
- review the inferred kind, namespace, transport, and auth
- connect the source
- complete credential or OAuth setup if required

This is the easiest path for most users.

### From inside an execution

The runtime also exposes `tools.executor.sources.add(...)`, which lets an agent add a source from code.

Examples:

```ts
return await tools.executor.sources.add({
  endpoint: "https://example.com/mcp",
  name: "Example",
  namespace: "example",
});
```

```ts
return await tools.executor.sources.add({
  kind: "openapi",
  endpoint: "https://api.github.com",
  specUrl:
    "https://raw.githubusercontent.com/github/rest-api-description/main/descriptions/api.github.com/api.github.com.json",
  name: "GitHub",
  namespace: "github",
});
```

For HTTP-style sources, `executor` can drive the credential flow for you.

## How execution works

At a high level, every execution follows the same loop:

1. `executor` resolves the current local installation and workspace.
2. It builds a tool catalog from built-in tools plus all connected workspace sources.
3. It runs your TypeScript inside the configured sandbox runtime. QuickJS is the default, and `.executor/executor.jsonc` can set `"runtime": "quickjs" | "ses" | "deno"`.
4. Tool calls are dispatched through `executor` rather than directly from your code.
5. If a tool needs interaction, the run pauses and records a pending interaction.
6. Once the interaction is resolved, the execution continues and eventually completes or fails.

Example:

```jsonc
{
  "runtime": "ses",
  "sources": {}
}
```

This gives you a stable surface for agent automation:

- the agent sees a coherent catalog
- connected sources become reusable namespace-based tools
- auth stays attached to sources and secret material
- the runtime can track execution state instead of losing it inside a one-shot prompt

## Web UI overview

The React web app is served from the same local server as the API.

Main screens:

- `/`: list connected sources in the current local workspace
- `/sources/add`: discover and connect new sources
- `/sources/:sourceId`: inspect tools, search tools, and browse source artifacts
- `/sources/:sourceId/edit`: edit source settings and auth
- `/secrets`: create, update, and delete locally stored secrets

The UI uses the same control-plane API as the CLI, so both surfaces are operating on the same local runtime state.

## Local-first runtime behavior

By default `executor` runs as a single local daemon process.

It serves:

- `/v1` for the local control-plane API
- `/mcp` for the `executor` MCP endpoint
- the web UI for normal browser routes

Default network location:

- host: `127.0.0.1`
- port: `8788`

Default data locations are OS-aware:

- Linux data: `~/.local/share/executor`
- Linux runtime state: `~/.local/state/executor/run`
- macOS: `~/Library/Application Support/Executor`
- Windows: `%LOCALAPPDATA%\Executor`

The server also maintains local PID and log files in its runtime directory.

## Persistence and data

`executor` persists the local control plane to local files.

Persisted concepts include:

- local installation identity
- connected sources
- indexed tool artifacts and related metadata
- credentials and secret material bindings
- source auth sessions
- execution and interaction state
- executions and execution interactions
- policies

On first start, `executor` provisions a local account, a personal organization, and a default workspace automatically.

## Security and trust model

`executor` is designed to narrow how agents interact with external systems.

Compared with direct shell or raw API usage, the model is intentionally more structured:

- tool calls are routed through a controlled runtime
- secrets are stored separately from prompt text
- OAuth and credential capture happen through local flows
- executions can pause for interaction instead of guessing or failing silently
- source auth and tool metadata live with the workspace rather than inside each prompt

This does not make the system magically risk-free, but it gives the runtime places to enforce policy, collect approvals, and keep sensitive material out of the agent's immediate context.

## Repository layout

If you are exploring the repo, these are the directories that matter most:

- `apps/executor`: packaged CLI entrypoint and daemon lifecycle commands
- `apps/web`: local React web UI
- `packages/platform/server`: local HTTP server that serves API, MCP, and UI
- `packages/platform/control-plane`: source management, secrets, persistence, execution, and inspection
- `packages/kernel/runtime-deno-subprocess`: optional Deno subprocess runtime for TypeScript execution
- `packages/kernel/runtime-quickjs`: default QuickJS sandbox runtime for TypeScript execution
- `packages/kernel/runtime-ses`: optional SES sandbox runtime for TypeScript execution
- `packages/hosts/mcp`: MCP bridge for `execute` and `resume`
- `packages/kernel/core` plus `packages/sources/*`: core tool abstractions and first-party source integrations

## Releasing

- Add a changeset in any PR that should release: `bun run changeset`.
- Merge that PR to `main`. `.github/workflows/release.yml` opens or updates a `Version Packages` release PR for version bumps and changelog updates.
- Merge the `Version Packages` PR. The release workflow pushes the matching git tag and dispatches `.github/workflows/publish-executor-package.yml`, which publishes to npm and creates the GitHub release.
- Do not edit `apps/executor/package.json` by hand for normal releases. Changesets owns the version.
- For a beta train, enter prerelease mode with `bun run release:beta:start`, commit `.changeset/pre.json`, and merge it. Release PRs will then use `-beta.x` versions until you exit with `bun run release:beta:stop`.
- `bun run --cwd apps/executor release:publish` remains the publish implementation used by CI.
- To build and pack the publish artifact locally without publishing, run `bun run --cwd apps/executor release:publish:dry-run`.
- `.github/workflows/publish-executor-package.yml` can also be run manually with a tag input if a publish needs to be retried for an already-created version tag.
- One-time npm setup: either configure npm trusted publishing for `RhysSullivan/executor` with the workflow file `.github/workflows/publish-executor-package.yml`, or add a GitHub Actions secret named `NPM_TOKEN` that can publish the `executor` package.
- Stable releases use a normal semver like `1.2.3` and publish to npm under `latest`.
- Beta releases use a prerelease semver like `1.3.0-beta.1` and publish to npm under `beta`.
- When a release should become an upgrade test fixture, capture a real workspace snapshot with `bun run fixture:release:capture -- ...` and commit it under [`packages/platform/control-plane/src/runtime/__fixtures__`](./packages/platform/control-plane/src/runtime/__fixtures__/README.md).

## Project status

This repository is explicitly on its third major architecture iteration.

- `apps/` and `packages/` are the active implementation
- `legacy/` is the original codebase
- `legacy2/` is the second generation

If you want the system view instead of the product view, read [`ARCHITECTURE.md`](./ARCHITECTURE.md).


================================================
FILE: TRACING.md
================================================
# Local Tracing

Start Jaeger locally:

```bash
bun run trace:up
```

Run the web/server dev process with tracing enabled:

```bash
EXECUTOR_TRACE_ENABLED=1 \
EXECUTOR_TRACE_SERVICE_NAME=executor-local \
EXECUTOR_TRACE_OTLP_ENDPOINT=http://127.0.0.1:4317 \
bun run dev
```

Then open Jaeger:

- UI: `http://127.0.0.1:16686/search?service=executor-local`

You can also query traces over HTTP:

```bash
curl "http://127.0.0.1:16686/api/traces?service=executor-local&limit=20"
```

Useful operations to search for:

- `source.connect.http`
- `source.catalog.sync`
- `graphql.syncCatalog`
- `graphql.introspection.fetch`
- `graphql.manifest.extract`
- `graphql.definitions.compile`
- `graphql.operations.build`
- `graphql.snapshot.build`

Stop Jaeger:

```bash
bun run trace:down
```


================================================
FILE: apps/docs/CHANGELOG.md
================================================
# @executor/docs

## null


================================================
FILE: apps/docs/developer/adapters-and-formats.mdx
================================================
---
title: "Adapters And Formats"
description: "How executor supports multiple integration types without hardwiring the core to one protocol."
---

Adapters are the main extensibility boundary in executor.

They let executor support multiple integration styles without turning the control plane into a long chain of provider-specific branches.

## What an adapter does

An adapter owns the format-specific or protocol-specific behavior for a source.

That includes:

- connect payload shape
- binding config serialization and decoding
- source validation
- source config extraction
- materialization
- manifest parsing
- operation description
- invocation

The control plane owns the generic lifecycle around that.

## Why adapters exist

Executor needs to support integrations that do not all look the same at the source boundary:

- OpenAPI specs
- GraphQL APIs
- MCP servers
- future Google Discovery imports
- future Postman collections
- future snippet bundles

If the core storage model were shaped around one of those directly, every new integration type would cause another redesign.

Adapters prevent that.

## Adapter vs format

It is important not to confuse the adapter with the import format.

Examples:

- OpenAPI and GraphQL are different adapters even though both import HTTP-shaped API descriptions
- MCP is its own adapter because it has distinct session, discovery, and resume semantics

This lets executor share a thin catalog model without pretending every source has the same runtime behavior.

## What gets stored

Adapters do **not** get to invent arbitrary top-level storage models.

They compile into the same canonical layers:

- recipe
- revision
- raw documents
- schema bundles
- operations

That means the control plane can stay generic while adapters remain flexible.

## Why binding config is adapter-owned

Adapter-owned binding config is one of the most important anti-churn decisions in the codebase.

Instead of adding more and more provider columns to the source model, the adapter carries its own binding payload and version.

That makes it much cheaper to evolve formats without reopening the core schema for every field addition.

## Why provider-specific detail still exists

Executor does still store some provider-shaped detail in operation metadata and bundle/document kinds.

That is intentional, but the direction is:

- keep the generic IR thin
- keep provider-specific detail in adapter code or typed provider metadata

The goal is not to erase differences between formats. The goal is to stop those differences from dominating the core architecture.

For the current fidelity tradeoffs and known lossy areas across adapters, see [Import Fidelity](/developer/import-fidelity).

## What a good new adapter should do

A good new adapter should:

- compile into the canonical recipe/revision/operation model
- use adapter-owned binding config
- avoid requiring new generic tables or provider columns unless truly necessary
- expose stable tool paths and search text
- make auth needs explicit through the existing auth slot model

If an integration needs a new primitive outside the source/tool model entirely, that is a sign it may not belong as just another adapter.


================================================
FILE: apps/docs/developer/cli.mdx
================================================
---
title: "CLI"
description: "How the executor CLI fits into the system and why it stays thin."
---

The CLI lives in `apps/executor`.

Its job is to be the installed user-facing shell around the local daemon, not the place where product logic is implemented.

## Responsibilities

The CLI is responsible for:

- starting and stopping the local daemon
- checking daemon health and installation state
- submitting executions
- resuming paused interactions
- packaging and distribution concerns for the installed binary

## What it should not own

The CLI should not own:

- source persistence rules
- auth workflows
- tool discovery
- execution state machines
- tool invocation behavior

Those belong in the control plane.

## Why this boundary matters

This split is intentional.

It means the browser UI, CLI, and local MCP entrypoint all talk to the same product core instead of each carrying their own business logic. That keeps behavior consistent across entrypoints and avoids reimplementing source, credential, and execution rules in multiple places.

## How it talks to the rest of the system

At a high level, the CLI:

1. ensures the local daemon is available
2. calls the local HTTP API exposed by `packages/platform/server`
3. hands off real work to `packages/platform/control-plane`

That makes the CLI a stable shell over a shared local runtime rather than a second product core.

## Why this is flexible

Because the CLI is thin, new product capabilities usually do not require redesigning the CLI architecture.

Most new work lands in:

- control-plane runtime logic
- source adapters
- codemode packages
- server/API surfaces

The CLI mostly needs new commands or command wiring on top of those primitives.


================================================
FILE: apps/docs/developer/codemode.mdx
================================================
---
title: "Code Mode"
description: "The shared tool abstractions and adapter packages that connect sources to execution."
---

The codemode packages are the bridge between imported integrations and executable tools.

They provide the shared tool abstractions that both the control plane and runtime can depend on.

## Core role

The codemode layer is where executor turns "some external thing" into a discoverable and invokable tool surface.

That is why it exists as a separate layer instead of being buried directly inside each product surface.

## Main packages

### `packages/kernel/core`

This package holds the common tool model:

- tool definitions
- tool catalogs
- tool invokers
- discovery helpers
- schema-aware tool contracts
- shared system-tool concepts

This is the main abstraction boundary that other layers build on.

### `packages/sources/openapi`

This package handles OpenAPI-specific extraction and tool generation.

Its job is to understand OpenAPI and compile it into the shared codemode tool model, not to own workspace persistence or auth lifecycle.

### `packages/sources/mcp`

This package handles MCP-specific tool discovery and invocation behavior and adapts remote MCP tools into the same shared tool model.

## Why this layer exists

Without the codemode layer, the control plane would have to understand every source format and execution detail directly.

Instead, executor keeps the core model broad and pushes format-specific transformation logic into focused packages.

That is what makes the system extensible:

- new adapters can target the same internal tool model
- the runtime can execute against one logical tool surface
- the same abstractions can be reused outside the control plane, including SDK-style consumers

## How it fits with the control plane

The control plane owns:

- bindings
- credentials
- revisions and materialization
- tool indexing
- policy and invocation lifecycle

The codemode layer owns:

- how external formats become tools
- how those tools are described
- how format-specific invocation helpers are implemented

That boundary is what keeps the architecture adapter-based instead of turning the control plane into one large protocol-specific switch statement.


================================================
FILE: apps/docs/developer/core-model.mdx
================================================
---
title: "Core Model"
description: "The main data and runtime concepts in executor today."
---

The most important thing to understand about executor is that it does **not** model the system as one flat `source` row.

The current model has a few separate concepts that each exist for a different reason.

## The primary concepts

### Source binding

A source is the workspace-local installation record.

It answers:

- what is this integration called in this workspace?
- is it enabled?
- what namespace should its tools use?
- what install-local config does it have?

This is why a source carries local concerns like name, namespace, enabled state, binding config, and status.

### Recipe

A recipe is the shareable integration identity.

It answers:

- what integration definition is this?
- what adapter produced it?
- what broad catalog kind does it belong to?

A recipe is meant to converge across workspaces when the underlying integration definition is the same.

### Revision / materialization

A recipe revision is the compiled result of an import.

It answers:

- what source config produced this compiled shape?
- what manifest, documents, schema bundles, and operations belong to it?

This is the durable execution artifact layer.

### Operation IR

Operations are the canonical callable tool index.

They answer:

- what tools exist?
- how should they be searched and described?
- how does invocation find the right persisted operation quickly?

The operation layer exists because raw upstream documents are not a good direct query surface for search, policy, and invocation lookup.

### Credential

Credentials are private auth bindings.

They answer:

- who can authenticate for this binding?
- for which slot?
- using what auth kind and secret refs?

Credentials are actor-scoped by default because two users in the same workspace may connect different identities to the same source.

## Why the split matters

This split fixes a few old problems:

- shareable definition is no longer confused with workspace-local installation
- auth is no longer implicitly one-token-per-source
- materialized tool content is no longer stored directly under one workspace source
- provider-specific import details do not need to become universal top-level columns

## Binding config

Source-specific connection config now lives in adapter-owned binding payloads:

- `bindingVersion`
- `binding`

That means the core model does not need built-in fields forever for every provider-specific connection knob.

Examples:

- OpenAPI binding can carry `specUrl` and `defaultHeaders`
- MCP binding can carry `transport`, `queryParams`, and `headers`
- internal bindings can be empty

The adapter owns serialization, decoding, defaults, and validation for that payload.

## Catalog kinds vs adapters

Executor separates broad catalog kinds from adapter keys.

Catalog kinds:

- `imported`
- `internal`

Adapters are more specific:

- `openapi`
- `graphql`
- `mcp`
- `google_discovery`
- future `postman_collection`
- future `snippet_bundle`

The important distinction is that execution now belongs to adapters. The shared catalog stays broad and stable, while connect/auth/invoke behavior is described through adapter strategies instead of one top-level runtime family enum.

## Why this is the right shape

The current model is designed so that new support usually means:

- add or evolve an adapter
- compile into the same recipe/revision/operation layers

and not:

- redesign how source persistence fundamentally works

That is the main goal of the current architecture.


================================================
FILE: apps/docs/developer/credentials-and-auth.mdx
================================================
---
title: "Credentials And Auth"
description: "How executor models auth, interactive flows, and actor-scoped credential ownership."
---

Auth in executor is not treated as a side detail on the source row.

It is modeled as its own layer because auth has different ownership and lifecycle semantics from source bindings and recipe materialization.

## Auth ownership

Credentials are scoped to:

- workspace
- source binding
- actor
- slot

This is important because different users in the same workspace may connect different identities to the same source.

## Auth slots

Executor distinguishes where auth is used.

Important current slots:

- `runtime`
- `import`

Why this matters:

- some integrations use the same auth for both
- some need auth only to fetch or generate the materialization
- some may eventually need setup/bootstrap-specific auth

This is why source auth is more than a single token field.

## Static credentials

The common case today is still static auth backed by secret references.

Examples:

- bearer token
- OAuth access token
- OAuth refresh token

The control plane stores secret refs, not raw secret values inline on the source or credential rows.

## Interactive auth sessions

Interactive auth, such as OAuth flows, is modeled separately from stored credentials.

That separation exists because:

- a pending auth flow has state and lifecycle of its own
- it may be tied to an interaction or execution
- it is not the same thing as a resolved credential

This is why executor has auth sessions and credentials as separate concepts.

## Shareable config vs private state

Project config under `.executor/executor.jsonc` is intended to stay portable and committable.

Private auth state does not belong in the workspace tree:

- actor-scoped credentials
- OAuth sessions
- refresh leases
- secret material

That state lives in the local control-plane store under the user's home-scoped executor state instead of the project `.executor/state` directory.

## Why actor scope matters

The old one-token-per-source assumption does not hold once:

- multiple users share a workspace
- each user connects their own Google account, GitHub account, or other external identity

Actor-scoped ownership is the durable fix for that.

## The next auth primitive

One important extension area is dynamic credentials.

Static secret refs are not always enough for integrations that:

- derive short-lived auth by calling login or refresh endpoints
- need app-specific runtime headers
- require token renewal logic

The likely next auth-layer primitive is an auth provider or auth material resolver:

- configured with secret refs and stable inputs
- produces runtime auth material on demand
- caches it with expiry metadata

That is broader than sources and should be reusable by future source adapters, tool providers, and code bundles.

## Why auth is separated from recipes

Recipes are shareable integration definitions.
Credentials are private installation-specific state.

That separation is important both for correctness and for shareability:

- a recipe can be portable
- a source binding can be local
- credentials stay private

This is the main reason auth is not modeled as part of the shareable recipe layer.


================================================
FILE: apps/docs/developer/extending-executor.mdx
================================================
---
title: "Extending Executor"
description: "How to add new source support without breaking the current architecture."
---

The best way to extend executor is to respect the current boundaries instead of stretching the core model.

## First question: is it really a source?

Not every new integration should be modeled as a source.

Use the source model when the thing is:

- a persistent external system
- with install-local configuration
- with auth state
- that materializes into callable tools

If the new thing is really:

- a local tool library
- a package bundle
- a browser automation runtime

then it may need a different top-level primitive instead of being shoved into the source model.

## If it is a source, add an adapter

The happy path for a new integration is:

1. define the adapter key, catalog kind, and strategies
2. define the connect and binding config shape
3. materialize into documents, schema bundles, and operations
4. implement invocation
5. add tests against the canonical model

The adapter should absorb provider-specific logic so the core does not have to.

## What a new adapter should not do

Avoid these patterns:

- adding new provider-specific columns to generic tables because one adapter wants them
- storing expanded presentation output as canonical truth
- bypassing the operation layer and invoking directly from raw documents
- treating auth as provider-specific ad hoc fields on the source row

Those are the patterns that lead back to churn.

## The standard for a good extension

A good new adapter should make the core system feel boring.

That means:

- persistence still looks like recipe/revision/operations
- auth still flows through the same credential/session primitives
- discovery and inspection still work through the same catalog ideas
- execution still delegates through the same tool and adapter boundaries

If a new adapter needs deep new behavior in all of those places, that is usually a sign it may be a new primitive, not just a new adapter.

## What feels like the next natural extensions

The current architecture is well-suited to future additions like:

- Google Discovery imports
- Postman collection imports
- snippet bundles
- richer auth material providers

Those should mostly be adapter and auth-layer work, not another persistence redesign.

## Why this is the best setup

The current setup is not trying to be abstract for its own sake.
It is trying to keep the codebase in a state where:

- core concepts stay stable
- new support lands as extensions
- source support does not require philosophy rewrites every few weeks

That is the real reason the system is shaped around adapters, recipes, revisions, operations, and actor-scoped credentials.


================================================
FILE: apps/docs/developer/import-fidelity.mdx
================================================
---
title: "Import Fidelity"
description: "What executor preserves, normalizes, and currently loses when importing external formats."
---

Executor should normalize syntax, not meaning.

That means the import pipeline can simplify surface differences between OpenAPI, GraphQL, Google Discovery, and MCP, but it should not silently erase semantics that change execution, trust, or user understanding.

The practical shape is:

- keep the raw source document or manifest
- keep adapter-native metadata that does not fit the common model cleanly
- promote execution-relevant semantics into first-class IR

## The fidelity buckets

This audit uses four buckets:

- `Raw source`: the original imported document or manifest
- `Adapter/native`: typed provider data or native blobs attached during import
- `IR`: first-class catalog symbols and capability metadata
- `UI today`: what current inspection surfaces directly

Current inspection is still narrow. It mostly shows projected schemas plus `tool.executable.native[0]`, not all preserved native blobs or capability-native metadata.

## OpenAPI

| Source detail | Raw source | Adapter/native | IR | UI today | Notes |
| --- | --- | --- | --- | --- | --- |
| Operation auth requirements and security schemes | Yes | No | No | No | Operation `security` is not promoted; imported capabilities currently use `auth: none`. |
| Exact response variants, status codes, and headers | Yes | Partial | No | Partial | Import chooses one preferred response, then projects one synthetic `2XX` response set. |
| Parameter serialization (`style`, `explode`, `allowReserved`, content-based params) | Yes | Mostly no | No | No | The IR can model these, but the OpenAPI importer currently only takes parameter `schema`. |
| Multiple request and response media types | Yes | Partial | Partial | Partial | Import picks a preferred content entry for typing; response docs keep content types only for the chosen response. |
| `servers` defaults | Yes | No | No | No | The IR can represent scope server defaults, but OpenAPI import does not populate them. |
| Rich schema semantics beyond the importer subset | Yes | Partial | Partial | Partial | Unsupported JSON Schema shapes fall back to `unknown` plus native preservation. |

## GraphQL

| Source detail | Raw source | Adapter/native | IR | UI today | Notes |
| --- | --- | --- | --- | --- | --- |
| Subscription root fields as tools | Yes | Partial | No | No | The manifest records `subscriptionTypeName`, but tool generation only materializes query and mutation fields. |
| Full field result shapes for generated field tools | Yes | Partial | Partial | Partial | Field-tool outputs are heuristic projections, not full result types. |
| Union and deep nested selections | Yes | Partial | Partial | Partial | Unions degrade to `__typename`; nested selection stops after depth 2 in generated field tools. |
| Arbitrary caller-selected field projections | Yes | Partial | No | No | Generated field tools are compiled with fixed selections; the raw `request` tool is the escape hatch. |
| Deprecation reasons | Yes | Partial | Partial | No | GraphQL schemas emit `deprecated: true` plus `x-deprecationReason`, but the generic schema importer only keeps `deprecated` as first-class shape metadata. |

GraphQL is a special case: the main loss is not the raw source being discarded, but the generated field-tool projection being intentionally narrower than the schema. That tradeoff is reasonable for discoverability, but only if the system continues to preserve and expose the raw request path.

## Google Discovery

| Source detail | Raw source | Adapter/native | IR | UI today | Notes |
| --- | --- | --- | --- | --- | --- |
| OAuth scope descriptions | Yes | Partial | No | No | Document-level scope descriptions are extracted, but the IR security scheme rewrites scopes to `{ scope: scope }`. |
| Rich media upload metadata | Yes | Partial | Partial | Partial | Upload support is collapsed to booleans such as `supportsMediaUpload` and `supportsMediaDownload`. |
| Service-level metadata (`title`, `description`, `batchPath`, `documentationLink`) | Yes | Partial | No | No | The extracted manifest has these fields, but per-operation provider data does not carry them into the catalog. |
| Parameter descriptions, repeated-ness, enums, defaults | Yes | Yes | Mostly yes | Mostly yes | This area is comparatively good. |
| Request and response schemas | Yes | Yes | Yes | Yes | Core schema structure is preserved reasonably well. |

Google Discovery is less lossy than OpenAPI on request and response typing, but it still loses useful service metadata and the human meaning attached to OAuth scopes.

## MCP

| Source detail | Raw source | Adapter/native | IR | UI today | Notes |
| --- | --- | --- | --- | --- | --- |
| Non-tool MCP resources such as prompts or resources | No | No | No | No | The adapter only discovers `listTools()`. Anything outside the tool list never enters import. |
| Extra tool metadata beyond `name`, `description`, `inputSchema` or `parameters`, and `outputSchema` | Partial | Partial | No | No | The manifest schema keeps only a narrow subset of listed tool fields. |
| Tool-level safety or effect hints, if present | Partial | No | No | No | Imported MCP operations are currently hardcoded to `effect: action`. |
| Tool input and output schemas | Yes | Yes | Yes | Yes | This is the strongest part of the current MCP import. |
| Server-level metadata outside the tool list | No | No | No | No | The stored MCP "document" is a synthesized tool manifest, not a richer upstream server description. |

MCP is the most structurally lossy adapter today because the discovery step itself only imports tools and already narrows their metadata aggressively.

## Cross-cutting UI caveat

Even when data is preserved natively, the current inspection UI often does not show it directly.

Today inspection primarily exposes:

- projected call and result schemas
- capability summary text
- the first executable native blob

That means "preserved in native data" and "visible to a user" are still different states.

## What should be first-class in IR

These semantics are worth promoting into the common model because they affect execution or trust:

- auth and security requirements described by the source format
- response and status variants
- HTTP parameter serialization
- upload, download, and streaming traits
- GraphQL selection and subscription semantics
- source-provided safety or idempotency hints

By contrast, many provider-specific labels, service metadata fields, and raw source extras are fine to keep in adapter-native metadata as long as they remain inspectable.

## Recommended priority order

### P0

- OpenAPI auth and security requirements
- OpenAPI response variants and status distinctions
- Google Discovery scope descriptions
- MCP discovery breadth: decide whether executor intends to import only tools or broader MCP surface area

### P1

- OpenAPI parameter serialization
- GraphQL subscription modeling
- GraphQL field-tool projection metadata so the fixed-selection behavior is explicit
- Google Discovery service metadata surfacing
- MCP tool metadata preservation beyond the current narrow manifest

### P2

- Better UI fallback to native/provider metadata
- Richer diagnostics for intentionally lossy normalization
- A fixture-backed audit matrix test per adapter

## The IR boundary

The right boundary is:

- `raw source` remains the source of truth
- `adapter-native metadata` keeps source-specific details close to their format
- `IR` stays unified, but it must be lossless for downstream semantics

If executor keeps that line clear, a standardized representation is a strength.

If executor lets semantically important details live only in hidden native blobs, the standardized representation becomes misleading.


================================================
FILE: apps/docs/developer/mcp.mdx
================================================
---
title: "MCP"
description: "How executor uses MCP both as an adapter and as an external interface."
---

MCP shows up in executor in two different ways.

## 1. Executor can connect to MCP servers

This is the source side of MCP.

When a user connects an MCP endpoint, executor treats it as an adapter with MCP-specific connection, discovery, and invocation behavior. The control plane persists the binding and credential state, while MCP-specific execution behavior lives behind the adapter and codemode layers.

This is why MCP is modeled as its own adapter instead of being flattened into a generic HTTP execution model.

## 2. Executor can expose itself as an MCP server

This is the outward-facing side of MCP.

`packages/hosts/mcp` and the `/mcp` route in `packages/platform/server` let external MCP clients talk to the local executor runtime.

That means external MCP hosts can:

- discover executor tools
- trigger executions
- resume paused interactions
- work against the same local workspace state as the CLI and browser UI

## Why the distinction matters

These two roles are related, but they are not the same thing:

- inbound MCP means executor is acting as a client to a remote MCP server
- outbound MCP means executor is acting as a server for external MCP clients

Keeping that distinction clear avoids collapsing very different responsibilities into one vague "MCP integration" concept.

## Where the logic lives

Broadly:

- control plane owns workspace state, bindings, credentials, and execution lifecycle
- `packages/sources/mcp` owns MCP tool loading and invocation helpers
- `packages/hosts/mcp` owns the local MCP server surface
- `packages/platform/server` mounts the `/mcp` handler

## Why MCP stays flexible in this model

Because MCP keeps its own adapter/runtime behavior, executor can support protocol-specific features such as sessions, elicitation, and resume without bending the generic imported-tool model to fit them.

That is the main reason MCP is a first-class category in the architecture.


================================================
FILE: apps/docs/developer/overview.mdx
================================================
---
title: "Control Plane Overview"
description: "How the control plane is structured today and how the major pieces fit together."
---

Executor is built around one central idea:

- turn connected systems into a durable, discoverable tool catalog
- run TypeScript against that catalog inside a controlled runtime
- keep connection state, auth, execution, and inspection in one local control plane

## One-line architecture

Executor is a local control plane that:

1. stores connected integrations as sources
2. materializes those sources into callable tools
3. exposes those tools to the runtime, the UI, and MCP clients
4. resolves auth and policy at invocation time

## Major packages

### `apps/executor`

The CLI and daemon manager.

Responsibilities:

- start and stop the local daemon
- submit executions
- resume paused interactions
- seed and inspect sources in development flows

### `packages/platform/server`

The local server shell around the control plane.

Responsibilities:

- mount the HTTP API at `/v1`
- mount the local MCP server at `/mcp`
- serve the web UI

### `packages/platform/control-plane`

The product core.

Responsibilities:

- source connection and lifecycle
- auth and credential state
- persistence
- tool discovery and inspection
- execution management
- policy-aware invocation

### Runtime and codemode packages

These packages provide the execution and tool abstractions:

- `packages/kernel/runtime-ses`
- `packages/kernel/core`
- `packages/sources/openapi`
- `packages/sources/mcp`
- `packages/clients/react`

## The mental model

The current architecture is easiest to understand if you think of it as an adapter-based compiler pipeline:

- adapters ingest external formats and protocols
- the control plane stores a canonical internal representation
- the runtime executes against that representation

That is why executor has strong internal concepts like:

- source bindings
- recipes and revisions
- materialized operations
- schema bundles
- actor-scoped credentials

Those are not UI concepts. They are the durable internal model that lets executor support multiple integration styles without rewriting the core every time.

## What is intentionally centralized

Executor intentionally centralizes a few things that many products split across multiple services:

- local identity and workspace bootstrap
- source connection state
- secret material references
- tool inspection data
- execution history
- interaction/resume state

This is why the UI, CLI, and local MCP entrypoint can all behave like one system instead of separate tools bolted together.

## Why the architecture is shaped this way

The current implementation optimizes for:

- local-first operation
- strong schema-aware tool usage
- reusable connected integrations
- minimal provider-specific logic in the control plane core
- extensibility through adapters instead of one-off execution paths

The rest of the developer docs explain how those goals show up in the current model.


================================================
FILE: apps/docs/developer/persistence-and-migrations.mdx
================================================
---
title: "Persistence And Migrations"
description: "How executor stores source state today and how migration logic is intended to work."
---

Executor persistence is designed around durable runtime state, not just CRUD storage.

That means the database stores:

- installation and workspace identity
- source bindings
- recipes and revisions
- raw documents
- schema bundles
- operations
- credentials and auth sessions
- executions and interactions

## Why the storage is layered

The storage model is layered because these concerns have different reuse and ownership semantics.

Examples:

- raw documents are provenance
- revisions are compiled materializations
- operations are the hot-path query surface
- source bindings are workspace-local
- credentials are private and actor-scoped

Trying to collapse those into one table or one document shape causes churn quickly.

## What is normalized vs serialized

Executor intentionally uses both relational columns and serialized JSON.

Normalized:

- ownership
- ids and references
- search and lookup fields
- status and visibility
- auth/session ownership

Serialized:

- adapter-owned binding config
- source config blobs
- provider metadata
- some session payloads

This is deliberate.
The rule is to normalize what the core system queries and enforces, and serialize what belongs to adapter-specific contracts.

## Migrations philosophy

The intended migration model is:

- SQL migrations move structural schema into the new shape
- one-shot code migrations repair or rebuild data that SQL cannot derive sanely
- steady-state runtime paths should not carry compatibility branches forever

That last point matters.
Compatibility logic belongs in upgrade code, not in normal reads and writes.

## What is still acceptable in migration code

One-shot rebuilds are still acceptable when:

- the old data shape is structurally valid but not yet in the best compiled form
- the rebuild can be derived from already-stored documents
- the logic is ledgered and run once

What is not acceptable:

- provider-specific legacy fallbacks in steady-state runtime logic
- carrying old columns indefinitely because one path still reads them

## Why this supports extensibility

This persistence shape is meant to let new integrations land in one of two ways:

- add a new adapter that compiles into the same source model
- add a genuinely new top-level primitive if the thing is not really a source

That is how executor avoids turning every new integration into another schema redesign.


================================================
FILE: apps/docs/developer/tool-catalog-and-execution.mdx
================================================
---
title: "Tool Catalog And Execution"
description: "How source materialization becomes callable tools and how invocation works."
---

Executor turns connected integrations into a workspace tool catalog.

That catalog is the thing the runtime actually executes against.

The execution sandbox is selected from `.executor/executor.jsonc`:

```jsonc
{
  "runtime": "quickjs"
}
```

Supported values are `quickjs` (default), `ses`, and `deno`.

## How tools are produced

At a high level:

1. an adapter materializes a source
2. the materialization writes documents, schema bundles, and operations
3. the control plane loads those persisted operations into a workspace tool index
4. the runtime invokes one tool at a time through the control plane

This means executor does not rebuild every integration from scratch on every execution.

## Why operations exist as a separate layer

The operation layer exists to support:

- search
- inspection
- policy
- fast tool lookup
- tool description without loading huge raw documents every time

Raw upstream documents are still kept, but they are not the best hot-path query surface.

## Schema transport

Executor uses compact operation-root schemas plus shared schema bundles.

This is better than storing expanded per-tool schema blobs because it avoids:

- massive duplicate schema payloads
- slow formatting and rendering
- treating presentation output as canonical storage

The result is:

- smaller payloads
- more reusable schema graphs
- cleaner tool detail responses

## Tool catalog shape

The tool catalog is built from:

- persisted source tools
- built-in executor tools

That lets executor present one unified discovery and invocation surface even though the underlying tools come from different places.

## Invocation flow

At a high level, invocation works like this:

1. resolve the persisted operation by tool path
2. run policy and approval checks
3. resolve auth material for the correct slot
4. load the manifest and schema bundle needed for the call
5. delegate actual invocation to the adapter

This is the key point:

- the control plane orchestrates
- the adapter performs the protocol-specific call

## Why this is flexible

This architecture is flexible because it keeps a stable middle:

- the runtime only needs tools and invokers
- the control plane only needs the canonical operation and auth model
- adapters can vary widely at the source boundary without changing the runtime contract

That is what makes it possible to add more source types without constantly rewriting execution logic.


================================================
FILE: apps/docs/docs.json
================================================
{
  "$schema": "https://mintlify.com/docs.json",
  "theme": "mint",
  "name": "Executor",
  "description": "A local-first execution environment for AI agents.",
  "colors": {
    "primary": "#0D9373",
    "light": "#07C983",
    "dark": "#0D9373"
  },
  "navigation": {
    "tabs": [
      {
        "tab": "Product",
        "groups": [
          {
            "group": "Introduction",
            "pages": [
              "introduction"
            ]
          }
        ]
      },
      {
        "tab": "Developer",
        "groups": [
          {
            "group": "Control Plane",
            "pages": [
              "developer/overview",
              "developer/core-model",
              "developer/adapters-and-formats",
              "developer/credentials-and-auth",
              "developer/tool-catalog-and-execution",
              "developer/persistence-and-migrations",
              "developer/extending-executor"
            ]
          },
          {
            "group": "CLI",
            "pages": [
              "developer/cli"
            ]
          },
          {
            "group": "MCP",
            "pages": [
              "developer/mcp"
            ]
          },
          {
            "group": "Code Mode",
            "pages": [
              "developer/codemode"
            ]
          }
        ]
      }
    ]
  },
  "footer": {
    "socials": {
      "github": "https://github.com/anomalyco/executor",
      "discord": "https://discord.gg/eF29HBHwM6"
    }
  }
}


================================================
FILE: apps/docs/introduction.mdx
================================================
---
title: "Introduction"
description: "A local-first execution environment for AI agents."
---

`executor` is a local-first execution environment for AI agents. It gives an agent a TypeScript runtime, a discoverable tool catalog, and a single local place to connect external systems such as MCP servers, OpenAPI APIs, and GraphQL APIs.

This docs site is split into two documentation surfaces:

- product-facing docs for how to install and use executor
- developer-facing docs for how executor is built and how to extend it

The product-facing section will come later. The current docs start with the developer-facing architecture and implementation model.

If you are trying to understand the current system shape, start with:

- [Control Plane](/developer/overview)
- [CLI](/developer/cli)
- [MCP](/developer/mcp)
- [Code Mode](/developer/codemode)


================================================
FILE: apps/docs/package.json
================================================
{
  "name": "@executor/docs",
  "private": true,
  "type": "module",
  "scripts": {
    "dev": "bunx --bun mint dev --no-open --port 3337",
    "typecheck": "echo 'No typecheck for @executor/docs'",
    "validate": "bunx --bun mint validate"
  },
  "version": "0.0.0"
}


================================================
FILE: apps/executor/CHANGELOG.md
================================================
# executor

## 1.2.4-beta.4

### Patch Changes

- ec5e3a3: Fix Google Discovery tool execution for sources stored with discovery document endpoints

## 1.2.4-beta.3

### Patch Changes

- dc94998: Auto migrate sources on startup

## 1.2.4-beta.2

### Patch Changes

- f0a3802: Fix legacy format parsing

## 1.2.4-beta.1

### Patch Changes

- 5869ddb: Fix build

## 1.2.4-beta.0

### Patch Changes

- 74185a9: Move execution to adapters rather than IR model

## 1.2.3

### Patch Changes

- eda1217: Always request maximal scope for Google Apis

## 1.2.2

### Patch Changes

- 661ed29: Support selecting runtime

## 1.2.1

### Patch Changes

- 329cc41: fix migration
- 86d4d4d: package the PGlite runtime assets in the published CLI bundle

## 1.2.0

### Minor Changes

- 7574535: add multiple sources at same time

### Patch Changes

- a2ada62: Google workspace support, folder based config
  - @executor/codemode-core@null
  - @executor/control-plane@null
  - @executor/executor-mcp@null
  - @executor/server@null

## 1.2.0-beta.7

### Minor Changes

- 7574535: add multiple sources at same time

## 1.1.10-beta.6

### Patch Changes

- a2ada62: Google workspace support, folder based config


================================================
FILE: apps/executor/bin/executor
================================================
#!/usr/bin/env bash
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
exec bun "$SCRIPT_DIR/../src/cli/main.ts" "$@"


================================================
FILE: apps/executor/package.json
================================================
{
  "name": "executor",
  "version": "1.2.4-beta.4",
  "description": "Local AI executor with a CLI, local API server, and web UI.",
  "keywords": [
    "executor",
    "ai",
    "agent",
    "cli",
    "automation",
    "local-first"
  ],
  "homepage": "https://github.com/RhysSullivan/executor",
  "bugs": {
    "url": "https://github.com/RhysSullivan/executor/issues"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/RhysSullivan/executor.git"
  },
  "license": "MIT",
  "private": true,
  "type": "module",
  "bin": {
    "executor": "bin/executor"
  },
  "scripts": {
    "typecheck": "bunx tsc --noEmit -p tsconfig.json",
    "test": "vitest run",
    "test:watch": "vitest",
    "start": "bun src/cli/main.ts",
    "release:publish:dry-run": "bun src/distribution/publish.ts --dry-run",
    "release:publish": "bun src/distribution/publish.ts"
  },
  "dependencies": {
    "@effect/cli": "catalog:",
    "@effect/platform": "catalog:",
    "@effect/platform-node": "catalog:",
    "@executor/codemode-core": "workspace:*",
    "@executor/control-plane": "workspace:*",
    "@executor/executor-mcp": "workspace:*",
    "@executor/server": "workspace:*",
    "effect": "catalog:"
  },
  "devDependencies": {
    "@executor/mcp-elicitation-demo": "workspace:*",
    "@executor/runtime-ses": "workspace:*",
    "@effect/vitest": "catalog:",
    "@modelcontextprotocol/sdk": "^1.26.0",
    "@types/node": "catalog:",
    "bun-types": "catalog:",
    "vitest": "catalog:",
    "zod": "catalog:"
  }
}


================================================
FILE: apps/executor/src/cli/dev.ts
================================================
import {
  type ControlPlaneClient,
  WorkspaceIdSchema,
} from "@executor/control-plane";
import * as Effect from "effect/Effect";

const readBindingString = (binding: Record<string, unknown>, key: string): string | null =>
  typeof binding[key] === "string" ? String(binding[key]) : null;

type SeedDemoMcpSourceInput = {
  client: ControlPlaneClient;
  workspaceId: string;
  endpoint: string;
  name: string;
  namespace: string;
};

type SeedDemoMcpSourceResult =
  | {
      action: "noop";
      sourceId: string;
      workspaceId: string;
      endpoint: string;
    }
  | {
      action: "updated" | "created";
      sourceId: string;
      workspaceId: string;
      endpoint: string;
    };

type SeedGithubOpenApiSourceInput = {
  client: ControlPlaneClient;
  workspaceId: string;
  endpoint: string;
  specUrl: string;
  name: string;
  namespace: string;
  credentialEnvVar?: string;
};

export const seedDemoMcpSourceInWorkspace = (
  input: SeedDemoMcpSourceInput,
): Effect.Effect<SeedDemoMcpSourceResult, unknown, never> =>
  Effect.gen(function* () {
    const workspaceId = WorkspaceIdSchema.make(input.workspaceId);

    const existing = yield* input.client.sources.list({
      path: {
        workspaceId,
      },
    });

    const existingByName = existing.find(
      (source) => source.kind === "mcp" && source.name === input.name,
    );

    const expected = {
      endpoint: input.endpoint,
      namespace: input.namespace,
      transport: "streamable-http" as const,
    };

    if (
      existingByName !== undefined
      && existingByName.endpoint === expected.endpoint
      && existingByName.namespace === expected.namespace
      && readBindingString(existingByName.binding, "transport") === expected.transport
      && existingByName.auth.kind === "none"
    ) {
      return {
        action: "noop",
        sourceId: existingByName.id,
        workspaceId: input.workspaceId,
        endpoint: existingByName.endpoint,
      };
    }

    if (existingByName !== undefined) {
      const updated = yield* input.client.sources.update({
        path: {
          workspaceId,
          sourceId: existingByName.id,
        },
        payload: {
          endpoint: input.endpoint,
          status: "connected",
          enabled: true,
          namespace: input.namespace,
          binding: {
            transport: "streamable-http",
            queryParams: null,
            headers: null,
          },
          auth: {
            kind: "none",
          },
        },
      });

      return {
        action: "updated",
        sourceId: updated.id,
        workspaceId: input.workspaceId,
        endpoint: updated.endpoint,
      };
    }

    const created = yield* input.client.sources.create({
      path: {
        workspaceId,
      },
      payload: {
        name: input.name,
        kind: "mcp",
        endpoint: input.endpoint,
        status: "connected",
        enabled: true,
        namespace: input.namespace,
        binding: {
          transport: "streamable-http",
          queryParams: null,
          headers: null,
        },
        auth: {
          kind: "none",
        },
      },
    });

    return {
      action: "created",
      sourceId: created.id,
      workspaceId: input.workspaceId,
      endpoint: created.endpoint,
    };
  });

export const seedGithubOpenApiSourceInWorkspace = (
  input: SeedGithubOpenApiSourceInput,
): Effect.Effect<SeedDemoMcpSourceResult, unknown, never> =>
  Effect.gen(function* () {
    const workspaceId = WorkspaceIdSchema.make(input.workspaceId);

    const existing = yield* input.client.sources.list({
      path: {
        workspaceId,
      },
    });

    const existingByName = existing.find(
      (source) => source.kind === "openapi" && source.name === input.name,
    );

    const auth = {
      kind: "bearer" as const,
      headerName: "Authorization",
      prefix: "Bearer ",
      token: {
        providerId: "env",
        handle: input.credentialEnvVar ?? "GITHUB_TOKEN",
      },
    };

    if (
      existingByName !== undefined
      && existingByName.endpoint === input.endpoint
      && existingByName.namespace === input.namespace
      && readBindingString(existingByName.binding, "specUrl") === input.specUrl
      && JSON.stringify(existingByName.binding.defaultHeaders ?? null) === JSON.stringify(null)
      && JSON.stringify(existingByName.auth) === JSON.stringify(auth)
    ) {
      return {
        action: "noop",
        sourceId: existingByName.id,
        workspaceId: input.workspaceId,
        endpoint: existingByName.endpoint,
      };
    }

    if (existingByName !== undefined) {
      const updated = yield* input.client.sources.update({
        path: {
          workspaceId,
          sourceId: existingByName.id,
        },
        payload: {
          endpoint: input.endpoint,
          status: "connected",
          enabled: true,
          namespace: input.namespace,
          binding: {
            specUrl: input.specUrl,
            defaultHeaders: null,
          },
          auth,
        },
      });

      return {
        action: "updated",
        sourceId: updated.id,
        workspaceId: input.workspaceId,
        endpoint: updated.endpoint,
      };
    }

    const created = yield* input.client.sources.create({
      path: {
        workspaceId,
      },
      payload: {
        name: input.name,
        kind: "openapi",
        endpoint: input.endpoint,
        status: "connected",
        enabled: true,
        namespace: input.namespace,
        binding: {
          specUrl: input.specUrl,
          defaultHeaders: null,
        },
        auth,
      },
    });

    return {
      action: "created",
      sourceId: created.id,
      workspaceId: input.workspaceId,
      endpoint: created.endpoint,
    };
  });


================================================
FILE: apps/executor/src/cli/interaction-handling.test.ts
================================================
import { describe, expect, it } from "@effect/vitest";

import { decideInteractionHandling } from "./interaction-handling";

describe("interaction-handling", () => {
  it("keeps URL interactions distinct even when the terminal is non-interactive", () => {
    expect(decideInteractionHandling({
      parsed: {
        mode: "url",
        message: "Connect Axiom",
        url: "https://mcp.axiom.co/authorize",
      },
      isInteractiveTerminal: false,
    })).toBe("url_paused");
  });

  it("waits on URL interactions in an interactive terminal", () => {
    expect(decideInteractionHandling({
      parsed: {
        mode: "url",
        message: "Connect Axiom",
        url: "https://mcp.axiom.co/authorize",
      },
      isInteractiveTerminal: true,
    })).toBe("url_interactive");
  });

  it("falls back to form pause handling for non-interactive prompts", () => {
    expect(decideInteractionHandling({
      parsed: {
        mode: "form",
        message: "Approve tool call",
      },
      isInteractiveTerminal: false,
    })).toBe("form_paused");
  });
});


================================================
FILE: apps/executor/src/cli/interaction-handling.ts
================================================
import type { ParsedInteractionPayload } from "./pending-interaction-output";

export type InteractionHandling =
  | "url_interactive"
  | "url_paused"
  | "form_interactive"
  | "form_paused";

export const decideInteractionHandling = (input: {
  parsed: ParsedInteractionPayload | null;
  isInteractiveTerminal: boolean;
}): InteractionHandling => {
  if (input.parsed?.mode === "url") {
    return input.isInteractiveTerminal ? "url_interactive" : "url_paused";
  }

  return input.isInteractiveTerminal ? "form_interactive" : "form_paused";
};


================================================
FILE: apps/executor/src/cli/main.ts
================================================
import { spawn } from "node:child_process";
import { createRequire } from "node:module";
import { dirname } from "node:path";
import { createInterface } from "node:readline/promises";
import { FileSystem } from "@effect/platform";
import { Args, Command, Options } from "@effect/cli";
import {
  NodeFileSystem,
  NodePath,
  NodeRuntime,
} from "@effect/platform-node";
import {
  EXECUTOR_SOURCES_ADD_HELP_LINES,
  ExecutionIdSchema,
  RuntimeExecutionResolverService,
  createControlPlaneClient,
  createControlPlaneRuntime,
  type ControlPlaneClient,
  type ExecutionEnvelope,
  type ExecutionInteraction,
  type ControlPlaneRuntime,
} from "@executor/control-plane";
import type { ToolCatalog } from "@executor/codemode-core";

import * as Effect from "effect/Effect";
import * as Schema from "effect/Schema";
import * as Option from "effect/Option";
import * as Cause from "effect/Cause";

import {
  DEFAULT_SERVER_BASE_URL,
  DEFAULT_SERVER_HOST,
  DEFAULT_LOCAL_DATA_DIR,
  DEFAULT_SERVER_LOG_FILE,
  DEFAULT_SERVER_PID_FILE,
  DEFAULT_SERVER_PORT,
  SERVER_POLL_INTERVAL_MS,
  SERVER_START_TIMEOUT_MS,
  runLocalExecutorServer,
} from "@executor/server";
import {
  seedDemoMcpSourceInWorkspace,
  seedGithubOpenApiSourceInWorkspace,
} from "./dev";
import {
  resolveRuntimeWebAssetsDir,
  resolveSelfCommand,
} from "./runtime-paths";
import {
  buildPausedExecutionOutput,
  parseInteractionPayload,
} from "./pending-interaction-output";
import { decideInteractionHandling } from "./interaction-handling";
import {
  executorAppEffectError,
  type LocalServerReachabilityTimeoutError,
  localServerReachabilityTimeoutError,
} from "../effect-errors";

const toError = (cause: unknown): Error =>
  cause instanceof Error ? cause : new Error(String(cause));

const sleep = (ms: number) =>
  Effect.promise(() => new Promise<void>((resolve) => setTimeout(resolve, ms)));

const openUrlInBrowser = (url: string): Effect.Effect<void, never, never> =>
  Effect.sync(() => {
    const cmd =
      process.platform === "darwin"
        ? ["open", url]
        : process.platform === "win32"
          ? ["cmd", "/c", "start", "", url]
          : ["xdg-open", url];

    try {
      const child = spawn(cmd[0]!, cmd.slice(1), {
        detached: true,
        stdio: "ignore",
      });
      child.on("error", () => undefined);
      child.unref();
    } catch {
      // Best-effort browser launch only; always leave the URL in stdout.
    }
  }).pipe(Effect.catchAll(() => Effect.void));

const promptLine = (prompt: string): Effect.Effect<string, Error, never> =>
  Effect.tryPromise({
    try: async () => {
      const rl = createInterface({
        input: process.stdin,
        output: process.stdout,
      });

      try {
        return await rl.question(prompt);
      } finally {
        rl.close();
      }
    },
    catch: toError,
  });

const readStdin = (): Effect.Effect<string, Error, never> =>
  Effect.tryPromise({
    try: async () => {
      let contents = "";
      process.stdin.setEncoding("utf8");
      for await (const chunk of process.stdin) {
        contents += chunk;
      }
      return contents;
    },
    catch: toError,
  });

const readCode = (input: {
  code?: string;
  file?: string;
  stdin?: boolean;
}): Effect.Effect<string, Error, FileSystem.FileSystem> =>
  Effect.gen(function* () {
    if (input.code && input.code.trim().length > 0) {
      return input.code;
    }

    if (input.file && input.file.trim().length > 0) {
      const fs = yield* FileSystem.FileSystem;
      const contents = yield* fs.readFileString(input.file!, "utf8").pipe(
        Effect.mapError(toError),
      );
      if (contents.trim().length > 0) {
        return contents;
      }
    }

    const shouldReadStdin = input.stdin === true || !process.stdin.isTTY;
    if (shouldReadStdin) {
      const contents = yield* readStdin();
      if (contents.trim().length > 0) {
        return contents;
      }
    }

    return yield* executorAppEffectError("cli/main", "Provide code as a positional argument, use --file, or pipe code over stdin.");
  });

const getBootstrapClient = (baseUrl: string = DEFAULT_SERVER_BASE_URL) =>
  createControlPlaneClient({ baseUrl });

const decodeExecutionId = Schema.decodeUnknown(ExecutionIdSchema);
const require = createRequire(import.meta.url);
const CLI_NAME = "executor";
const CLI_VERSION = (() => {
  const candidatePaths = [
    "../package.json",
    "../../package.json",
  ];

  for (const candidatePath of candidatePaths) {
    try {
      const metadata = require(candidatePath) as { version?: string };
      if (metadata.version && metadata.version.trim().length > 0) {
        return metadata.version;
      }
    } catch {
      // Fall through to the default version below.
    }
  }

  return "0.0.0-local";
})();
const HELP_TOKENS = ["--help", "-h", "help"] as const;

const isHelpToken = (value: string | undefined): boolean =>
  value !== undefined && HELP_TOKENS.includes(value as (typeof HELP_TOKENS)[number]);

const normalizeCliArgs = (rawArgs: readonly string[]): string[] => {
  return rawArgs[0] === "run"
    ? ["call", ...rawArgs.slice(1)]
    : [...rawArgs];
};

const getCliArgs = (): string[] => normalizeCliArgs(process.argv.slice(2));

const toEffectCliArgv = (args: readonly string[]): string[] => [
  process.execPath || CLI_NAME,
  CLI_NAME,
  ...args,
];

const buildWorkflowText = (namespaces: readonly string[] = []): string =>
  [
    "Execute TypeScript in sandbox; call tools via discovery workflow.",
    ...(namespaces.length > 0
      ? [
          "Available namespaces:",
          ...namespaces.map((namespace) => `- ${namespace}`),
        ]
      : []),
    "Workflow:",
    '1) const matches = await tools.discover({ query: "<intent>", limit: 12 });',
    "2) const details = await tools.describe.tool({ path, includeSchemas: true });",
    "3) Call selected tools.<path>(input).",
    '4) To connect a source, call tools.executor.sources.add(...) for MCP, OpenAPI, or GraphQL APIs.',
    ...EXECUTOR_SOURCES_ADD_HELP_LINES,
    "5) If execution pauses for interaction, resume it with `executor resume --execution-id ...`.",
    "Do not use fetch; use tools.* only.",
  ].join("\n");

const DEFAULT_RUN_WORKFLOW = buildWorkflowText();

const indentBlock = (value: string, prefix: string = "  "): string =>
  value
    .split("\n")
    .map((line) => (line.length > 0 ? `${prefix}${line}` : ""))
    .join("\n");

const formatCauseMessage = (cause: Cause.Cause<unknown>): string => {
  const failure = Option.getOrUndefined(Cause.failureOption(cause));
  if (failure instanceof Error && failure.message.length > 0) {
    return failure.message;
  }
  if (typeof failure === "string" && failure.length > 0) {
    return failure;
  }

  const defect = Option.getOrUndefined(Cause.dieOption(cause));
  if (defect instanceof Error && defect.message.length > 0) {
    return defect.message;
  }
  if (typeof defect === "string" && defect.length > 0) {
    return defect;
  }

  return Cause.pretty(cause).split("\n").find((line) => line.trim().length > 0) ?? "unknown error";
};

const formatCatalogUnavailableMessage = (cause: Cause.Cause<unknown>): string => {
  const message = formatCauseMessage(cause);
  return message === "Error: An error has occurred"
    ? "Current workspace catalog unavailable."
    : `Current workspace catalog unavailable: ${message}`;
};

const closeRuntime = (runtime: ControlPlaneRuntime) =>
  Effect.tryPromise({
    try: () => runtime.close(),
    catch: toError,
  }).pipe(Effect.catchAll(() => Effect.void));

const buildRunWorkflowText = (
  catalog?: ToolCatalog,
): Effect.Effect<string, Error, never> => {
  if (!catalog) {
    return Effect.succeed(DEFAULT_RUN_WORKFLOW);
  }

  return catalog.listNamespaces({ limit: 200 }).pipe(
    Effect.map((namespaces) =>
      buildWorkflowText(
        namespaces.length > 0
          ? namespaces.map((namespace) => namespace.displayName ?? namespace.namespace)
          : ["none discovered yet"],
      )
    ),
    Effect.mapError(toError),
  );
};

const loadRunWorkflowText = (): Effect.Effect<string, Error, never> =>
  Effect.acquireUseRelease(
    createControlPlaneRuntime({
      localDataDir: DEFAULT_LOCAL_DATA_DIR,
    }).pipe(Effect.mapError(toError)),
    (runtime) =>
      Effect.gen(function* () {
        const environment = yield* Effect.gen(function* () {
          const resolveExecutionEnvironment = yield* RuntimeExecutionResolverService;
          return yield* resolveExecutionEnvironment({
            workspaceId: runtime.localInstallation.workspaceId,
            accountId: runtime.localInstallation.accountId,
            executionId: ExecutionIdSchema.make("exec_help"),
          });
        }).pipe(
          Effect.provide(runtime.runtimeLayer),
          Effect.mapError(toError),
        );

        return yield* buildRunWorkflowText(environment.catalog);
      }),
    closeRuntime,
  ).pipe(
    Effect.catchAllCause((cause) =>
      Effect.succeed(
        [
          DEFAULT_RUN_WORKFLOW,
          "",
          formatCatalogUnavailableMessage(cause),
        ].join("\n"),
      )
    ),
  );

const printRootHelp = (workflow: string) =>
  Effect.sync(() => {
    console.log([
      `${CLI_NAME} ${CLI_VERSION}`,
      "",
      "USAGE",
      "",
      "  executor call [code] [--file text] [--stdin] [--base-url text] [--no-open]",
      "  executor resume --execution-id text [--base-url text] [--no-open]",
      "",
      "CALL WORKFLOW",
      "",
      indentBlock(workflow),
      "",
      "COMMANDS",
      "",
      "  call",
      "    Execute code against the local executor server.",
      "  resume",
      "    Resume a paused execution.",
      "",
      "TIP",
      "",
      "  Run `executor call --help` for more examples.",
    ].join("\n"));
  });

const printCallHelp = (workflow: string) =>
  Effect.sync(() => {
    console.log([
      "executor call",
      "",
      "USAGE",
      "",
      "  executor call [code] [--file text] [--stdin] [--base-url text] [--no-open]",
      "",
      "DESCRIPTION",
      "",
      "  Execute code against the local executor server.",
      "",
      "WORKFLOW",
      "",
      indentBlock(workflow),
      "",
      "OPTIONS",
      "",
      "  [code]",
      "    Inline code to execute.",
      "  --file text",
      "    Read code from a file.",
      "  --stdin",
      "    Read code from stdin.",
      "  --base-url text",
      "    Override the executor server base URL.",
      "  --no-open",
      "    Print interaction URLs without opening a browser.",
      "",
      "EXAMPLES",
      "",
      '  executor call \'const matches = await tools.discover({ query: "github issues", limit: 5 }); return matches;\'',
      '  executor call \'const matches = await tools.discover({ query: "repo details", limit: 1 }); const path = matches.bestPath; return await tools.describe.tool({ path, includeSchemas: true });\'',
      '  executor call \'return await tools.executor.sources.add({ endpoint: "https://example.com/mcp", name: "Example", namespace: "example" });\'',
      '  executor call \'return await tools.executor.sources.add({ kind: "openapi", endpoint: "https://api.github.com", specUrl: "https://raw.githubusercontent.com/github/rest-api-description/main/descriptions/api.github.com/api.github.com.json", name: "GitHub", namespace: "github" });\'',
      "  cat script.ts | executor call --stdin",
      "  executor call --file script.ts",
      "  executor call --no-open --file script.ts",
      "  executor resume --execution-id exec_123",
    ].join("\n"));
  });

const helpOverride = (): Effect.Effect<void, Error, never> | null => {
  const args = getCliArgs();

  if (args.length === 0 || (args.length === 1 && isHelpToken(args[0]))) {
    return loadRunWorkflowText().pipe(Effect.flatMap(printRootHelp));
  }

  if (args[0] === "call" && args.length === 2 && isHelpToken(args[1])) {
    return loadRunWorkflowText().pipe(Effect.flatMap(printCallHelp));
  }

  return null;
};

const getLocalAuthedClient = (baseUrl: string = DEFAULT_SERVER_BASE_URL) =>
  Effect.gen(function* () {
    const bootstrapClient = yield* getBootstrapClient(baseUrl);
    const installation = yield* bootstrapClient.local.installation({});
    const client = yield* createControlPlaneClient({
      baseUrl,
      accountId: installation.accountId,
    });

    return {
      installation,
      client,
    } as const;
  });

const isServerReachable = (baseUrl: string) =>
  getBootstrapClient(baseUrl).pipe(
    Effect.flatMap((client) => client.local.installation({})),
    Effect.as(true),
    Effect.catchAll(() => Effect.succeed(false)),
  );

const getDefaultServerOptions = (port: number = DEFAULT_SERVER_PORT) => {
  const assetsDir = resolveRuntimeWebAssetsDir();

  return {
    host: DEFAULT_SERVER_HOST,
    port,
    localDataDir: DEFAULT_LOCAL_DATA_DIR,
    pidFile: DEFAULT_SERVER_PID_FILE,
    ui: assetsDir ? { assetsDir } : undefined,
  };
};

const startServerInBackground = (port: number) =>
  Effect.scoped(
    Effect.gen(function* () {
      const fs = yield* FileSystem.FileSystem;
      const command = resolveSelfCommand(["__local-server", "--port", String(port)]);
      yield* fs.makeDirectory(dirname(DEFAULT_SERVER_LOG_FILE), {
        recursive: true,
      }).pipe(Effect.mapError(toError));
      const logHandle = yield* fs.open(DEFAULT_SERVER_LOG_FILE, {
        flag: "a",
      }).pipe(Effect.mapError(toError));

      yield* Effect.try({
        try: () => {
          const fd = Number(logHandle.fd);
          const child = spawn(command[0]!, command.slice(1), {
            detached: true,
            stdio: ["ignore", fd, fd],
          });
          child.unref();
        },
        catch: toError,
      });
    }),
  );

type LocalServerPidRecord = {
  pid?: number;
  port?: number;
  host?: string;
  baseUrl?: string;
  startedAt?: number;
  logFile?: string;
};

const readPidRecord = (): Effect.Effect<
  LocalServerPidRecord | null,
  never,
  FileSystem.FileSystem
> =>
  Effect.gen(function* () {
    const fs = yield* FileSystem.FileSystem;
    const contents = yield* fs.readFileString(DEFAULT_SERVER_PID_FILE, "utf8").pipe(
      Effect.catchAll(() => Effect.succeed<string | null>(null)),
    );
    if (contents === null) {
      return null;
    }

    return JSON.parse(contents) as LocalServerPidRecord;
  }).pipe(Effect.catchAll(() => Effect.succeed(null)));

const isPidRunning = (pid: number): boolean => {
  try {
    process.kill(pid, 0);
    return true;
  } catch (error) {
    return error instanceof Error && "code" in error && error.code === "EPERM";
  }
};


const readServerLogTail = (
  logFile: string = DEFAULT_SERVER_LOG_FILE,
  maxLines: number = 40,
  maxChars: number = 6000,
): Effect.Effect<string | null, never, FileSystem.FileSystem> =>
  Effect.gen(function* () {
    const fs = yield* FileSystem.FileSystem;
    const contents = yield* fs.readFileString(logFile, "utf8").pipe(
      Effect.catchAll(() => Effect.succeed<string | null>(null)),
    );

    if (contents === null) {
      return null;
    }

    const lines = contents.split(/\r?\n/u).filter((line) => line.length > 0);
    const tail = lines.slice(-maxLines).join("\n");
    return tail.length > maxChars ? tail.slice(-maxChars) : tail;
  });

const failReachabilityTimeout = (input: {
  baseUrl: string;
  expected: boolean;
  logFile?: string;
}): Effect.Effect<never, LocalServerReachabilityTimeoutError, FileSystem.FileSystem> =>
  Effect.gen(function* () {
    const logFile = input.logFile ?? DEFAULT_SERVER_LOG_FILE;
    const logTail = yield* readServerLogTail(logFile);

    return yield* localServerReachabilityTimeoutError({
      baseUrl: input.baseUrl,
      expected: input.expected,
      logFile,
      logTail,
    });
  });

const waitForReachability = (baseUrl: string, expected: boolean) =>
  Effect.gen(function* () {
    const startedAt = Date.now();
    while (Date.now() - startedAt < SERVER_START_TIMEOUT_MS) {
      const reachable = yield* isServerReachable(baseUrl);
      if (reachable === expected) {
        return;
      }
      yield* sleep(SERVER_POLL_INTERVAL_MS);
    }

    return yield* failReachabilityTimeout({ baseUrl, expected });
  });

type LocalServerStatus = {
  baseUrl: string;
  reachable: boolean;
  pidFile: string;
  pid: number | null;
  pidRunning: boolean;
  logFile: string;
  localDataDir: string;
  webAssetsDir: string | null;
  installation: {
    accountId: string;
    workspaceId: string;
  } | null;
  denoVersion: string | null;
};

const renderDenoSandboxDetail = (denoVersion: string | null): string =>
  denoVersion !== null
    ? `deno ${denoVersion}`
    : "deno not found (run `executor sandbox` to install)";

const getServerStatus = (
  baseUrl: string,
): Effect.Effect<LocalServerStatus, Error, FileSystem.FileSystem> =>
  Effect.gen(function* () {
    const pidRecord = yield* readPidRecord();
    const reachable = yield* isServerReachable(baseUrl);
    const installation = reachable
      ? yield* getBootstrapClient(baseUrl).pipe(
          Effect.flatMap((client) => client.local.installation({})),
          Effect.catchAll(() => Effect.succeed(null)),
        )
      : null;

    const pid = typeof pidRecord?.pid === "number" ? pidRecord.pid : null;
    const pidRunning = pid !== null ? isPidRunning(pid) : false;
    const logFile = pidRecord?.logFile ?? DEFAULT_SERVER_LOG_FILE;
    const denoVersion = yield* getDenoVersion();

    return {
      baseUrl,
      reachable,
      pidFile: DEFAULT_SERVER_PID_FILE,
      pid,
      pidRunning,
      logFile,
      localDataDir: DEFAULT_LOCAL_DATA_DIR,
      webAssetsDir: resolveRuntimeWebAssetsDir(),
      installation,
      denoVersion,
    } satisfies LocalServerStatus;
  });

const renderStatus = (status: LocalServerStatus): string =>
  [
    `baseUrl: ${status.baseUrl}`,
    `reachable: ${status.reachable ? "yes" : "no"}`,
    `pid: ${status.pid ?? "none"}`,
    `pidRunning: ${status.pidRunning ? "yes" : "no"}`,
    `pidFile: ${status.pidFile}`,
    `logFile: ${status.logFile}`,
    `localDataDir: ${status.localDataDir}`,
    `webAssetsDir: ${status.webAssetsDir ?? "missing"}`,
    `workspaceId: ${status.installation?.workspaceId ?? "unavailable"}`,
    `denoSandbox: ${renderDenoSandboxDetail(status.denoVersion)}`,
  ].join("\n");

const getDoctorReport = (baseUrl: string) =>
  getServerStatus(baseUrl).pipe(
    Effect.map((status) => {
      const checks = {
        serverReachable: {
          ok: status.reachable,
          detail: status.reachable ? `reachable at ${status.baseUrl}` : `not reachable at ${status.baseUrl}`,
        },
        pidFile: {
          ok: status.pid !== null,
          detail: status.pid !== null ? `pid ${status.pid}` : `missing pid file at ${status.pidFile}`,
        },
        process: {
          ok: status.pidRunning,
          detail: status.pidRunning ? `pid ${status.pid}` : "no live daemon process recorded",
        },
        database: {
          ok: status.localDataDir.length > 0,
          detail: status.localDataDir,
        },
        webAssets: {
          ok: status.webAssetsDir !== null,
          detail: status.webAssetsDir ?? "missing bundled web assets",
        },
        installation: {
          ok: status.installation !== null,
          detail: status.installation
            ? `workspace ${status.installation.workspaceId}`
            : "local installation unavailable",
        },
        denoSandbox: {
          ok: status.denoVersion !== null,
          detail: renderDenoSandboxDetail(status.denoVersion),
        },
      } as const;

      return {
        ok: Object.values(checks).every((check) => check.ok),
        status,
        checks,
      };
    }),
  );

const printJson = (value: unknown) =>
  Effect.sync(() => {
    console.log(JSON.stringify(value, null, 2));
  });

const printText = (value: string) =>
  Effect.sync(() => {
    console.log(value);
  });

const stopServer = (baseUrl: string) =>
  Effect.gen(function* () {
    const fs = yield* FileSystem.FileSystem;
    const removePidFile = fs.remove(DEFAULT_SERVER_PID_FILE, {
      force: true,
    }).pipe(Effect.ignore);
    const pidRecord = yield* readPidRecord();
    const pid = typeof pidRecord?.pid === "number" ? pidRecord.pid : null;

    if (pid === null) {
      yield* removePidFile;
      return false;
    }

    if (!isPidRunning(pid)) {
      yield* removePidFile;
      return false;
    }


    yield* Effect.sync(() => {
      process.kill(pid, "SIGTERM");
    });

    yield* waitForReachability(baseUrl, false).pipe(
      Effect.catchAll(() =>
        removePidFile.pipe(
          Effect.ignore,
          Effect.zipRight(Effect.fail(executorAppEffectError("cli/main", `Timed out stopping local executor server pid ${pid}`))),
        ),
      ),
    );

    return true;
  });

const ensureServer = (baseUrl: string = DEFAULT_SERVER_BASE_URL) =>
  Effect.gen(function* () {
    const reachable = yield* isServerReachable(baseUrl);
    if (reachable) {
      return;
    }

    const url = new URL(baseUrl);
    const port = Number(url.port || DEFAULT_SERVER_PORT);
    yield* startServerInBackground(port);

    yield* waitForReachability(baseUrl, true);
  });



const isRecord = (value: unknown): value is Record<string, unknown> =>
  typeof value === "object" && value !== null && !Array.isArray(value);

type PromptField = {
  name: string;
  label: string;
  description?: string;
  type: string;
  required: boolean;
  enumValues?: readonly unknown[];
};

const getPromptFields = (requestedSchema: Record<string, unknown> | undefined): PromptField[] => {
  if (!requestedSchema || !isRecord(requestedSchema.properties)) {
    return [];
  }

  const required = new Set(
    Array.isArray(requestedSchema.required)
      ? requestedSchema.required.filter((value): value is string => typeof value === "string")
      : [],
  );

  return Object.entries(requestedSchema.properties).flatMap(([name, property]) => {
    if (!isRecord(property)) {
      return [];
    }

    return [{
      name,
      label:
        typeof property.title === "string" && property.title.trim().length > 0
          ? property.title.trim()
          : name,
      description:
        typeof property.description === "string" && property.description.trim().length > 0
          ? property.description.trim()
          : undefined,
      type: typeof property.type === "string" ? property.type : "string",
      required: required.has(name),
      enumValues: Array.isArray(property.enum) ? property.enum : undefined,
    }];
  });
};

const parsePromptValue = (field: PromptField, raw: string):
  | { ok: true; value: unknown }
  | { ok: false; message: string } => {
  if (field.enumValues && field.enumValues.length > 0) {
    const normalized = field.enumValues.map((value) => String(value));
    if (!normalized.includes(raw)) {
      return {
        ok: false,
        message: `Enter one of: ${normalized.join(", ")}`,
      };
    }
  }

  if (field.type === "boolean") {
    const normalized = raw.trim().toLowerCase();
    if (["y", "yes", "true"].includes(normalized)) {
      return { ok: true, value: true };
    }
    if (["n", "no", "false"].includes(normalized)) {
      return { ok: true, value: false };
    }
    return { ok: false, message: "Enter yes or no" };
  }

  if (field.type === "number" || field.type === "integer") {
    const value = Number(raw);
    if (!Number.isFinite(value)) {
      return { ok: false, message: "Enter a number" };
    }
    if (field.type === "integer" && !Number.isInteger(value)) {
      return { ok: false, message: "Enter an integer" };
    }
    return { ok: true, value };
  }

  if (field.type === "object" || field.type === "array") {
    try {
      return { ok: true, value: JSON.parse(raw) };
    } catch {
      return { ok: false, message: "Enter valid JSON" };
    }
  }

  return { ok: true, value: raw };
};

const promptStructuredInteraction = (parsed: {
  message: string;
  requestedSchema?: Record<string, unknown>;
}) =>
  Effect.gen(function* () {
    const fields = getPromptFields(parsed.requestedSchema);
    if (fields.length === 0) {
      return null as Record<string, unknown> | null;
    }

    yield* Effect.sync(() => {
      process.stdout.write(`${parsed.message}\n`);
    });

    const content: Record<string, unknown> = {};
    for (const field of fields) {
      if (field.description) {
        yield* Effect.sync(() => {
          process.stdout.write(`${field.description}\n`);
        });
      }

      while (true) {
        const raw = yield* promptLine(
          `${field.label}${field.required ? "" : " (optional)"}: `,
        );
        const trimmed = raw.trim();
        if (trimmed.length === 0) {
          if (field.required) {
            return null;
          }
          break;
        }

        const parsedValue = parsePromptValue(field, trimmed);
        if (parsedValue.ok) {
          content[field.name] = parsedValue.value;
          break;
        }

        yield* Effect.sync(() => {
          process.stdout.write(`${parsedValue.message}\n`);
        });
      }
    }

    return content;
  });

const printUrlInteraction = (input: {
  message: string;
  url: string | null;
  shouldOpen: boolean;
}) =>
  Effect.gen(function* () {
    yield* Effect.sync(() => {
      process.stdout.write(`${input.message}\n${input.url ?? ""}\n`);
    });

    if (input.shouldOpen && input.url) {
      yield* openUrlInBrowser(input.url);
    }
  });

const executionInteractionMode = (): "live_form" | "detach" =>
  process.stdin.isTTY && process.stdout.isTTY ? "live_form" : "detach";

const promptInteraction = (input: {
  interaction: ExecutionInteraction;
  shouldOpenUrls: boolean;
}) =>
  Effect.gen(function* () {
    const parsed = parseInteractionPayload(input.interaction);

    if (!process.stdin.isTTY || !process.stdout.isTTY || parsed === null) {
      return null;
    }

    if (parsed.mode === "url") {
      yield* printUrlInteraction({
        message: parsed.message,
        url: parsed.url ?? null,
        shouldOpen: input.shouldOpenUrls,
      });
      return null;
    }

    const structured = yield* promptStructuredInteraction(parsed);
    if (structured !== null) {
      return JSON.stringify({
        action: "accept",
        content: structured,
      });
    }

    const line = yield* promptLine(`${parsed.message} [y/N] `);
    const normalized = line.trim().toLowerCase();
    if (normalized.length === 0) {
      return null;
    }
    if (normalized !== "y" && normalized !== "yes" && normalized !== "n" && normalized !== "no") {
      return null;
    }
    const accepted = normalized === "y" || normalized === "yes";

    return JSON.stringify({
      action: accepted ? "accept" : "decline",
      content: {
        approve: accepted,
      },
    });
  });

const waitForExecutionProgress = (input: {
  client: ControlPlaneClient;
  workspaceId: ExecutionEnvelope["execution"]["workspaceId"];
  executionId: ExecutionEnvelope["execution"]["id"];
  pendingInteractionId: ExecutionInteraction["id"];
}) =>
  Effect.gen(function* () {
    while (true) {
      yield* sleep(SERVER_POLL_INTERVAL_MS);

      const next = yield* input.client.executions.get({
        path: {
          workspaceId: input.workspaceId,
          executionId: input.executionId,
        },
      });

      if (
        next.execution.status !== "waiting_for_interaction"
        || next.pendingInteraction === null
        || next.pendingInteraction.id !== input.pendingInteractionId
      ) {
        return next;
      }
    }
  });

const printExecution = (envelope: ExecutionEnvelope) =>
  Effect.sync(() => {
    const execution = envelope.execution;
    if (execution.status === "completed") {
      if (execution.resultJson) {
        console.log(execution.resultJson);
      } else {
        console.log("completed");
      }
      return;
    }

    if (execution.status === "failed") {
      console.error(execution.errorText ?? "Execution failed");
      process.exitCode = 1;
      return;
    }
    if (execution.status === "waiting_for_interaction" && envelope.pendingInteraction !== null) {
      return;
    }


    console.log(JSON.stringify({
      id: execution.id,
      status: execution.status,
    }));
  });

const seedDemoMcpSource = (input: {
  baseUrl: string;
  endpoint: string;
  name: string;
  namespace: string;
}) =>
  Effect.gen(function* () {
    yield* ensureServer(input.baseUrl);
    const { installation, client } = yield* getLocalAuthedClient(input.baseUrl);
    const result = yield* seedDemoMcpSourceInWorkspace({
      client,
      workspaceId: installation.workspaceId,
      endpoint: input.endpoint,
      name: input.name,
      namespace: input.namespace,
    });

    yield* Effect.sync(() => {
      console.log(JSON.stringify(result));
    });
  });

const seedGithubOpenApiSource = (input: {
  baseUrl: string;
  endpoint: string;
  specUrl: string;
  name: string;
  namespace: string;
  credentialEnvVar?: string;
}) =>
  Effect.gen(function* () {
    yield* ensureServer(input.baseUrl);
    const { installation, client } = yield* getLocalAuthedClient(input.baseUrl);
    const result = yield* seedGithubOpenApiSourceInWorkspace({
      client,
      workspaceId: installation.workspaceId,
      endpoint: input.endpoint,
      specUrl: input.specUrl,
      name: input.name,
      namespace: input.namespace,
      credentialEnvVar: input.credentialEnvVar,
    });

    yield* Effect.sync(() => {
      console.log(JSON.stringify(result));
    });
  });

const driveExecution = (input: {
  client: ControlPlaneClient;
  workspaceId: ExecutionEnvelope["execution"]["workspaceId"];
  envelope: ExecutionEnvelope;
  baseUrl: string;
  shouldOpenUrls: boolean;
}) =>
  Effect.gen(function* () {
    let current = input.envelope;

    while (current.execution.status === "waiting_for_interaction") {
      const pending = current.pendingInteraction;

      if (pending === null) {
        return current;
      }

      const parsed = parseInteractionPayload(pending);
      const handling = decideInteractionHandling({
        parsed,
        isInteractiveTerminal: process.stdin.isTTY && process.stdout.isTTY,
      });

      if (handling === "url_interactive" && parsed?.mode === "url") {
        yield* printUrlInteraction({
          message: parsed.message,
          url: parsed.url ?? null,
          shouldOpen: input.shouldOpenUrls,
        });

        current = yield* waitForExecutionProgress({
          client: input.client,
          workspaceId: input.workspaceId,
          executionId: current.execution.id,
          pendingInteractionId: pending.id,
        });
        continue;
      }

      if (handling === "url_paused") {
        if (input.shouldOpenUrls && parsed?.mode === "url" && parsed.url) {
          yield* openUrlInBrowser(parsed.url);
        }

        const paused = buildPausedExecutionOutput({
          executionId: current.execution.id,
          interaction: pending,
          baseUrl: input.baseUrl,
          shouldOpenUrls: input.shouldOpenUrls,
          cliName: CLI_NAME,
        });
        yield* Effect.sync(() => {
          console.log(JSON.stringify(paused));
          process.exitCode = 20;
        });
        return current;
      }

      if (handling === "form_paused") {
        const paused = buildPausedExecutionOutput({
          executionId: current.execution.id,
          interaction: pending,
          baseUrl: input.baseUrl,
          shouldOpenUrls: input.shouldOpenUrls,
          cliName: CLI_NAME,
        });
        yield* Effect.sync(() => {
          console.log(JSON.stringify(paused));
          process.exitCode = 20;
        });
        return current;
      }

      const responseJson = yield* promptInteraction({
        interaction: pending,
        shouldOpenUrls: input.shouldOpenUrls,
      });
      if (responseJson === null) {
        const paused = buildPausedExecutionOutput({
          executionId: current.execution.id,
          interaction: pending,
          baseUrl: input.baseUrl,
          shouldOpenUrls: input.shouldOpenUrls,
          cliName: CLI_NAME,
        });
        yield* Effect.sync(() => {
          console.log(JSON.stringify(paused));
          process.exitCode = 20;
        });
        return current;
      }

      current = yield* input.client.executions.resume({
        path: {
          workspaceId: input.workspaceId,
          executionId: current.execution.id,
        },
        payload: {
          responseJson,
          interactionMode: executionInteractionMode(),
        },
      });
    }

    return current;
  });

const serverStartCommand = Command.make(
  "start",
  {
    port: Options.integer("port").pipe(Options.withDefault(DEFAULT_SERVER_PORT)),
  },
  ({ port }) => runLocalExecutorServer(getDefaultServerOptions(port)),
).pipe(Command.withDescription("Start the local executor server"));

const serverCommand = Command.make("server").pipe(
  Command.withSubcommands([serverStartCommand] as const),
  Command.withDescription("Local server commands"),
);

const upCommand = Command.make(
  "up",
  {
    baseUrl: Options.text("base-url").pipe(Options.withDefault(DEFAULT_SERVER_BASE_URL)),
  },
  ({ baseUrl }) =>
    ensureServer(baseUrl).pipe(
      Effect.zipRight(getServerStatus(baseUrl)),
      Effect.flatMap((status) => printText(renderStatus(status))),
    ),
).pipe(Command.withDescription("Ensure the local executor server is running"));

const downCommand = Command.make(
  "down",
  {
    baseUrl: Options.text("base-url").pipe(Options.withDefault(DEFAULT_SERVER_BASE_URL)),
  },
  ({ baseUrl }) =>
    stopServer(baseUrl).pipe(
      Effect.flatMap((stopped) =>
        printText(stopped ? "Stopped local executor server." : "Local executor server is not running."),
      ),
    ),
).pipe(Command.withDescription("Stop the local executor server"));

const statusCommand = Command.make(
  "status",
  {
    baseUrl: Options.text("base-url").pipe(Options.withDefault(DEFAULT_SERVER_BASE_URL)),
    json: Options.boolean("json").pipe(Options.withDefault(false)),
  },
  ({ baseUrl, json }) =>
    getServerStatus(baseUrl).pipe(
      Effect.flatMap((status) => json ? printJson(status) : printText(renderStatus(status))),
    ),
).pipe(Command.withDescription("Show local executor server status"));

const doctorCommand = Command.make(
  "doctor",
  {
    baseUrl: Options.text("base-url").pipe(Options.withDefault(DEFAULT_SERVER_BASE_URL)),
    json: Options.boolean("json").pipe(Options.withDefault(false)),
  },
  ({ baseUrl, json }) =>
    getDoctorReport(baseUrl).pipe(
      Effect.flatMap((report) => json
        ? printJson(report)
        : printText([
            `ok: ${report.ok ? "yes" : "no"}`,
            ...Object.entries(report.checks).map(([name, check]) => `${name}: ${check.ok ? "ok" : "fail"} - ${check.detail}`),
          ].join("\n"))),
    ),
).pipe(Command.withDescription("Check local executor install and daemon health"));

const getDenoVersion = (): Effect.Effect<string | null, never, FileSystem.FileSystem> =>
  Effect.gen(function* () {
    const fs = yield* FileSystem.FileSystem;
    const configuredDenoExecutable = process.env.DENO_BIN?.trim();
    const bundledDenoExecutable = process.env.HOME?.trim()
      ? `${process.env.HOME.trim()}/.deno/bin/deno`
      : null;
    const bundledDenoExists = bundledDenoExecutable === null
      ? false
      : yield* fs.exists(bundledDenoExecutable).pipe(
          Effect.catchAll(() => Effect.succeed(false)),
        );
    const denoExecutable = configuredDenoExecutable
      || (bundledDenoExists ? bundledDenoExecutable : null)
      || "deno";

    return yield* Effect.tryPromise({
      try: () =>
        new Promise<string | null>((resolveVersion) => {
          const child = spawn(denoExecutable, ["--version"], {
            stdio: ["ignore", "pipe", "ignore"],
            timeout: 5000,
          });

          let stdout = "";
          child.stdout?.setEncoding("utf8");
          child.stdout?.on("data", (chunk: string) => {
            stdout += chunk;
          });

          child.once("error", () => resolveVersion(null));
          child.once("close", (code) => {
            if (code !== 0) {
              resolveVersion(null);
              return;
            }

            const match = /deno\s+(\S+)/i.exec(stdout);
            resolveVersion(match ? match[1] : null);
          });
        }),
      catch: () => null,
    }).pipe(Effect.catchAll(() => Effect.succeed(null)));
  }).pipe(Effect.catchAll(() => Effect.succeed(null)));

const sandboxCommand = Command.make(
  "sandbox",
  {},
  () =>
    Effect.gen(function* () {
      const version = yield* getDenoVersion();

      if (version !== null) {
        yield* printText(`Deno sandbox is ready (deno ${version}).`);
        return;
      }

      yield* printText(
        [
          "Deno is not installed.",
          "",
          "The executor sandbox requires Deno to run code in a secure, isolated subprocess.",
          "",
          "Install Deno:",
          "  curl -fsSL https://deno.land/install.sh | sh",
          "",
          "Or see: https://docs.deno.com/runtime/getting_started/installation/",
        ].join("\n"),
      );

      process.exitCode = 1;
    }),
).pipe(Command.withDescription("Check whether the Deno sandbox runtime is available"));


const callCommand = Command.make(
  "call",
  {
    code: Args.text({ name: "code" }).pipe(
      Args.withDescription("Inline code to execute."),
      Args.optional,
    ),
    file: Options.text("file").pipe(Options.optional),
    stdin: Options.boolean("stdin").pipe(Options.withDefault(false)),
    baseUrl: Options.text("base-url").pipe(Options.withDefault(DEFAULT_SERVER_BASE_URL)),
    noOpen: Options.boolean("no-open").pipe(Options.withDefault(false)),
  },
  ({ code, file, stdin, baseUrl, noOpen }) =>
    Effect.gen(function* () {
      const resolvedCode = yield* readCode({
        code: Option.getOrUndefined(code),
        file: Option.getOrUndefined(file),
        stdin,
      });

      yield* ensureServer(baseUrl);
      const { installation, client } = yield* getLocalAuthedClient(baseUrl);
      const created = yield* client.executions.create({
        path: {
          workspaceId: installation.workspaceId,
        },
        payload: {
          code: resolvedCode,
          interactionMode: executionInteractionMode(),
        },
      });

      const settled = yield* driveExecution({
        client,
        workspaceId: installation.workspaceId,
        envelope: created,
        baseUrl,
        shouldOpenUrls: !noOpen,
      });

      yield* printExecution(settled);
    }),
).pipe(Command.withDescription("Execute code against the local executor server"));

const resumeCommand = Command.make(
  "resume",
  {
    executionId: Options.text("execution-id"),
    baseUrl: Options.text("base-url").pipe(Options.withDefault(DEFAULT_SERVER_BASE_URL)),
    noOpen: Options.boolean("no-open").pipe(Options.withDefault(false)),
  },
  ({ executionId, baseUrl, noOpen }) =>
    Effect.gen(function* () {
      yield* ensureServer(baseUrl);
      const { installation, client } = yield* getLocalAuthedClient(baseUrl);
      const decodedExecutionId = yield* decodeExecutionId(executionId).pipe(
        Effect.mapError((cause) => toError(cause)),
      );
      const execution = yield* client.executions.get({
        path: {
          workspaceId: installation.workspaceId,
          executionId: decodedExecutionId,
        },
      });

      const settled = yield* driveExecution({
        client,
        workspaceId: installation.workspaceId,
        envelope: execution,
        baseUrl,
        shouldOpenUrls: !noOpen,
      });

      yield* printExecution(settled);
    }),
).pipe(Command.withDescription("Resume a paused execution"));

const devSeedMcpDemoCommand = Command.make(
  "seed-mcp-demo",
  {
    baseUrl: Options.text("base-url").pipe(Options.withDefault(DEFAULT_SERVER_BASE_URL)),
    endpoint: Options.text("endpoint").pipe(
      Options.withDefault("http://127.0.0.1:58506/mcp"),
    ),
    name: Options.text("name").pipe(Options.withDefault("Demo")),
    namespace: Options.text("namespace").pipe(Options.withDefault("demo")),
  },
  ({ baseUrl, endpoint, name, namespace }) =>
    seedDemoMcpSource({
      baseUrl,
      endpoint,
      name,
      namespace,
    }),
).pipe(
  Command.withDescription(
    "Seed the localhost MCP elicitation demo source into the default workspace",
  ),
);

const devSeedGithubCommand = Command.make(
  "seed-github",
  {
    baseUrl: Options.text("base-url").pipe(Options.withDefault(DEFAULT_SERVER_BASE_URL)),
    endpoint: Options.text("endpoint").pipe(
      Options.withDefault("https://api.github.com"),
    ),
    specUrl: Options.text("spec-url").pipe(
      Options.withDefault(
        "https://raw.githubusercontent.com/github/rest-api-description/main/descriptions/api.github.com/api.github.com.json",
      ),
    ),
    name: Options.text("name").pipe(Options.withDefault("GitHub")),
    namespace: Options.text("namespace").pipe(Options.withDefault("github")),
    credentialEnvVar: Options.text("credential-env-var").pipe(
      Options.withDefault("GITHUB_TOKEN"),
    ),
  },
  ({ baseUrl, endpoint, specUrl, name, namespace, credentialEnvVar }) =>
    seedGithubOpenApiSource({
      baseUrl,
      endpoint,
      specUrl,
      name,
      namespace,
      credentialEnvVar,
    }),
).pipe(
  Command.withDescription(
    "Seed a GitHub OpenAPI source into the default workspace",
  ),
);

const devCommand = Command.make("dev").pipe(
  Command.withSubcommands([devSeedMcpDemoCommand, devSeedGithubCommand] as const),
  Command.withDescription("Development helpers"),
);

const root = Command.make("executor").pipe(
  Command.withSubcommands([
    serverCommand,
    upCommand,
    downCommand,
    statusCommand,
    doctorCommand,
    sandboxCommand,
    callCommand,
    resumeCommand,
    devCommand,
  ] as const),
  Command.withDescription("Executor local CLI"),
);

const runCli = Command.run(root, {
  name: CLI_NAME,
  version: CLI_VERSION,
  executable: CLI_NAME,
});

const hiddenServer = (): Effect.Effect<void, Error, never> | null => {
  const args = getCliArgs();
  if (args[0] !== "__local-server") {
    return null;
  }

  const portFlagIndex = args.findIndex((arg) => arg === "--port");
  const port = portFlagIndex >= 0 ? Number(args[portFlagIndex + 1]) : DEFAULT_SERVER_PORT;

  return runLocalExecutorServer({
    ...getDefaultServerOptions(
      Number.isInteger(port) && port > 0 ? port : DEFAULT_SERVER_PORT,
    ),
  });
};

const program = (hiddenServer()
  ?? helpOverride()
  ?? runCli(toEffectCliArgv(getCliArgs())).pipe(Effect.mapError(toError)))
  .pipe(Effect.provide(NodeFileSystem.layer))
  .pipe(Effect.provide(NodePath.layer))
  .pipe(
    Effect.catchAllCause((cause) =>
      Effect.sync(() => {
        console.error(Cause.pretty(cause));
        process.exitCode = 1;
      }),
    ),
  );

// Effect CLI's environment does not fully narrow at the process boundary.
NodeRuntime.runMain(program as Effect.Effect<void, never, never>);


================================================
FILE: apps/executor/src/cli/pending-interaction-output.test.ts
================================================
import { describe, expect, it } from "@effect/vitest";
import type { ExecutionInteraction } from "@executor/control-plane";

import {
  buildPausedExecutionOutput,
  parseInteractionPayload,
} from "./pending-interaction-output";

const makeInteraction = (patch: Partial<ExecutionInteraction> = {}): ExecutionInteraction => ({
  id: "exec_123:tool_execution_gate:call_1" as never,
  executionId: "exec_123" as never,
  status: "pending",
  kind: "form",
  purpose: "tool_execution_gate",
  payloadJson: JSON.stringify({
    elicitation: {
      mode: "form",
      message: "Allow DELETE /v2/domains/{domain}/records/{recordId}?",
      requestedSchema: {
        type: "object",
        properties: {
          approve: {
            type: "boolean",
            description: "Whether to approve the tool call",
          },
        },
        required: ["approve"],
        additionalProperties: false,
      },
    },
  }),
  responseJson: null,
  responsePrivateJson: null,
  createdAt: 1,
  updatedAt: 1,
  ...patch,
});

describe("pending-interaction-output", () => {
  it("parses requested schema from interaction payload", () => {
    const parsed = parseInteractionPayload(makeInteraction());

    expect(parsed).not.toBeNull();
    expect(parsed?.mode).toBe("form");
    expect(parsed?.requestedSchema).toEqual({
      type: "object",
      properties: {
        approve: {
          type: "boolean",
          description: "Whether to approve the tool call",
        },
      },
      required: ["approve"],
      additionalProperties: false,
    });
  });

  it("builds a structured paused execution instruction with full resume command", () => {
    const output = buildPausedExecutionOutput({
      executionId: "exec_123",
      interaction: makeInteraction(),
      baseUrl: "http://127.0.0.1:8788",
      shouldOpenUrls: false,
    });

    expect(output.resumeCommand).toBe(
      "executor resume --execution-id exec_123 --base-url http://127.0.0.1:8788 --no-open",
    );
    expect(output.interaction.requestedSchema).toEqual({
      type: "object",
      properties: {
        approve: {
          type: "boolean",
          description: "Whether to approve the tool call",
        },
      },
      required: ["approve"],
      additionalProperties: false,
    });
    expect(output.instruction).toContain("requires approval");
    expect(output.instruction).toContain("Allow DELETE /v2/domains/{domain}/records/{recordId}?");
    expect(output.instruction).toContain(output.resumeCommand);
    expect(output.instruction).toContain("interaction.requestedSchema");
  });

  it("describes URL interactions with the next command to run", () => {
    const output = buildPausedExecutionOutput({
      executionId: "exec_456",
      interaction: makeInteraction({
        id: "exec_456:source_connect_oauth2:call_1" as never,
        executionId: "exec_456" as never,
        kind: "url",
        purpose: "source_connect_oauth2",
        payloadJson: JSON.stringify({
          elicitation: {
            mode: "url",
            message: "Finish connecting Vercel",
            url: "https://vercel.com/oauth/start",
          },
        }),
      }),
      baseUrl: "http://127.0.0.1:8788",
      shouldOpenUrls: true,
    });

    expect(output.interaction.mode).toBe("url");
    expect(output.interaction.url).toBe("https://vercel.com/oauth/start");
    expect(output.instruction).toContain("https://vercel.com/oauth/start");
    expect(output.instruction).toContain(
      "executor resume --execution-id exec_456 --base-url http://127.0.0.1:8788",
    );
  });
});


================================================
FILE: apps/executor/src/cli/pending-interaction-output.ts
================================================
import type { ExecutionInteraction } from "@executor/control-plane";

const isRecord = (value: unknown): value is Record<string, unknown> =>
  typeof value === "object" && value !== null && !Array.isArray(value);

export type ParsedInteractionPayload = {
  message: string;
  mode: "form" | "url";
  url?: string;
  requestedSchema?: Record<string, unknown>;
};

export const parseInteractionPayload = (
  interaction: ExecutionInteraction,
): ParsedInteractionPayload | null => {
  try {
    const parsed = JSON.parse(interaction.payloadJson) as {
      elicitation?: {
        message?: string;
        mode?: "form" | "url";
        url?: string;
        requestedSchema?: Record<string, unknown>;
      };
    };

    if (!parsed.elicitation || typeof parsed.elicitation.message !== "string") {
      return null;
    }

    return {
      message: parsed.elicitation.message,
      mode: parsed.elicitation.mode === "url" ? "url" : "form",
      url: parsed.elicitation.url,
      requestedSchema:
        isRecord(parsed.elicitation.requestedSchema)
          ? parsed.elicitation.requestedSchema
          : undefined,
    };
  } catch {
    return null;
  }
};

const shellEscape = (value: string): string => {
  if (/^[A-Za-z0-9_./:=+-]+$/.test(value)) {
    return value;
  }

  return `'${value.replace(/'/g, `'"'"'`)}'`;
};

const renderCommand = (argv: readonly string[]): string => argv.map(shellEscape).join(" ");

const describePauseReason = (interaction: ExecutionInteraction): string => {
  switch (interaction.purpose) {
    case "tool_execution_gate":
      return "this tool call requires approval before executor can continue";
    case "source_connect_oauth2":
      return "executor needs browser authentication to finish connecting the source";
    case "source_connect_secret":
      return "executor needs credentials to finish connecting the source";
    default:
      return "executor needs additional input before it can continue";
  }
};

const buildInstruction = (input: {
  interaction: ExecutionInteraction;
  parsed: ParsedInteractionPayload | null;
  resumeCommand: string;
}): string => {
  const reason = describePauseReason(input.interaction);
  const prompt = input.parsed?.message ?? "Interaction required";

  if (input.parsed?.mode === "url") {
    const url = input.parsed.url?.trim();
    return url && url.length > 0
      ? `Execution paused because ${reason}. Open ${url} and complete the requested flow for "${prompt}", then run ${input.resumeCommand} to continue if it does not resume automatically.`
      : `Execution paused because ${reason}. Run ${input.resumeCommand} to continue and complete the requested flow for "${prompt}".`;
  }

  if (input.parsed?.requestedSchema) {
    return `Execution paused because ${reason}. The interaction prompt is "${prompt}". Run ${input.resumeCommand} in an interactive terminal and respond with input matching interaction.requestedSchema.`;
  }

  return `Execution paused because ${reason}. The interaction prompt is "${prompt}". Run ${input.resumeCommand} in an interactive terminal to continue.`;
};

export const buildPausedExecutionOutput = (input: {
  executionId: string;
  interaction: ExecutionInteraction;
  baseUrl: string;
  shouldOpenUrls: boolean;
  cliName?: string;
}) => {
  const cliName = input.cliName ?? "executor";
  const argv = [cliName, "resume", "--execution-id", input.executionId, "--base-url", input.baseUrl];
  if (!input.shouldOpenUrls) {
    argv.push("--no-open");
  }

  const command = renderCommand(argv);
  const parsed = parseInteractionPayload(input.interaction);

  return {
    id: input.executionId,
    status: "waiting_for_interaction" as const,
    interactionId: input.interaction.id,
    message: parsed?.message ?? "Interaction required",
    resumeCommand: command,
    interaction: {
      id: input.interaction.id,
      purpose: input.interaction.purpose,
      mode: parsed?.mode ?? (input.interaction.kind === "url" ? "url" : "form"),
      message: parsed?.message ?? "Interaction required",
      url: parsed?.url ?? null,
      requestedSchema: parsed?.requestedSchema ?? null,
    },
    resume: {
      command,
      argv,
    },
    instruction: buildInstruction({
      interaction: input.interaction,
      parsed,
      resumeCommand: command,
    }),
  };
};


================================================
FILE: apps/executor/src/cli/runtime-paths.ts
================================================
import { existsSync } from "node:fs";
import { dirname, extname, resolve } from "node:path";
import { fileURLToPath } from "node:url";

import {
  EXECUTOR_WEB_ASSETS_DIR_ENV,
} from "@executor/server";

const sourceDir = dirname(fileURLToPath(import.meta.url));

const trim = (value: string | undefined): string | undefined => {
  const candidate = value?.trim();
  return candidate && candidate.length > 0 ? candidate : undefined;
};

const resolveIfExists = (value: string | undefined): string | null => {
  const candidate = trim(value);
  if (!candidate) {
    return null;
  }

  const resolved = resolve(candidate);
  return existsSync(resolved) ? resolved : null;
};

const getSourceEntrypoint = (): string | null => {
  const candidate = trim(process.argv[1]);
  if (!candidate) {
    return null;
  }

  const resolved = resolve(candidate);
  const extension = extname(resolved).toLowerCase();
  return [".ts", ".tsx", ".js", ".mjs", ".cjs"].includes(extension)
    ? resolved
    : null;
};

const resolveBundledNodeLauncher = (): string | null => {
  const candidate = resolve(sourceDir, "executor.js");
  return existsSync(candidate) ? candidate : null;
};


const resolveRuntimeResourcesRoot = (): string | null => {
  const compiledCandidate = resolve(dirname(process.execPath), "../resources");
  if (existsSync(compiledCandidate)) {
    return compiledCandidate;
  }

  const bundledCandidateFromModule = resolve(sourceDir, "../resources");
  if (existsSync(bundledCandidateFromModule)) {
    return bundledCandidateFromModule;
  }

  const sourceEntrypoint = getSourceEntrypoint();
  if (sourceEntrypoint) {
    const bundledCandidate = resolve(dirname(sourceEntrypoint), "../resources");
    if (existsSync(bundledCandidate)) {
      return bundledCandidate;
    }
  }

  return null;
};

export const resolveSelfCommand = (args: readonly string[]): readonly string[] => {
  const bundledLauncher = resolveBundledNodeLauncher();
  if (bundledLauncher !== null) {
    return [process.execPath, bundledLauncher, ...args];
  }

  const sourceEntrypoint = getSourceEntrypoint();
  return sourceEntrypoint === null
    ? [process.execPath, ...args]
    : [process.execPath, sourceEntrypoint, ...args];
};

export const resolveRuntimeWebAssetsDir = (): string | null => {
  const explicit = resolveIfExists(process.env[EXECUTOR_WEB_ASSETS_DIR_ENV]);
  if (explicit) {
    return explicit;
  }

  const resourcesRoot = resolveRuntimeResourcesRoot();
  const bundled = resourcesRoot
    ? resolveIfExists(resolve(resourcesRoot, "web"))
    : null;
  if (bundled) {
    return bundled;
  }

  return resolveIfExists(resolve(sourceDir, "../../../web/dist"));
};


================================================
FILE: apps/executor/src/distribution/artifact.ts
================================================
import { spawn } from "node:child_process";
import { existsSync } from "node:fs";
import { chmod, cp, mkdir, rm, writeFile } from "node:fs/promises";
import { createRequire } from "node:module";
import { dirname, join, resolve } from "node:path";

import { readDistributionPackageMetadata, repoRoot } from "./metadata";

const defaultOutputDir = resolve(repoRoot, "apps/executor/dist/npm");


export type BuildDistributionPackageOptions = {
  outputDir?: string;
  packageName?: string;
  packageVersion?: string;
  buildWeb?: boolean;
};

export type DistributionPackageArtifact = {
  packageDir: string;
  launcherPath: string;
  bundlePath: string;
  resourcesDir: string;
};

type CommandInput = {
  command: string;
  args: ReadonlyArray<string>;
  cwd: string;
};

const runCommand = async (input: CommandInput): Promise<void> => {
  const child = spawn(input.command, [...input.args], {
    cwd: input.cwd,
    env: process.env,
    stdio: ["ignore", "pipe", "pipe"],
  });

  let stdout = "";
  let stderr = "";

  child.stdout?.setEncoding("utf8");
  child.stdout?.on("data", (chunk) => {
    stdout += chunk;
  });

  child.stderr?.setEncoding("utf8");
  child.stderr?.on("data", (chunk) => {
    stderr += chunk;
  });

  const exitCode = await new Promise<number>((resolveExitCode, reject) => {
    child.once("error", reject);
    child.once("close", (code) => {
      resolveExitCode(code ?? -1);
    });
  });

  if (exitCode === 0) {
    return;
  }

  throw new Error(
    [
      `${input.command} ${input.args.join(" ")} exited with code ${exitCode}`,
      stdout.trim().length > 0 ? `stdout:\n${stdout.trim()}` : null,
      stderr.trim().length > 0 ? `stderr:\n${stderr.trim()}` : null,
    ]
      .filter((part) => part !== null)
      .join("\n\n"),
  );
};

const resolveQuickJsWasmPath = (): string => {
  const requireFromQuickJsRuntime = createRequire(
    join(repoRoot, "packages/kernel/runtime-quickjs/package.json"),
  );
  const quickJsPackagePath = requireFromQuickJsRuntime.resolve(
    "quickjs-emscripten/package.json",
  );
  const wasmPath = resolve(
    dirname(quickJsPackagePath),
    "../@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.wasm",
  );

  if (!existsSync(wasmPath)) {
    throw new Error(`Unable to locate QuickJS wasm asset at ${wasmPath}`);
  }

  return wasmPath;
};


const createPackageJson = (input: {
  packageName: string;
  packageVersion: string;
  description: string;
  keywords: ReadonlyArray<string>;
  homepage?: string;
  bugs?: {
    url?: string;
  };
  repository?: {
    type?: string;
    url?: string;
  };
  license?: string;
}) => {
  const packageJson = {
    name: input.packageName,
    version: input.packageVersion,
    description: input.description,
    keywords: input.keywords,
    homepage: input.homepage,
    bugs: input.bugs,
    repository: input.repository,
    license: input.license ?? "MIT",
    type: "module",
    private: false,
    bin: {
      executor: "bin/executor.js",
    },
    files: [
      "bin",
      "resources",
      "README.md",
      "package.json",
    ],
    engines: {
      node: ">=20",
    },
  };

  return JSON.stringify(packageJson, null, 2) + "\n";
};

const createLauncherSource = () => [
  "#!/usr/bin/env node",
  'import "./executor.mjs";',
  "",
].join("\n");

export const buildDistributionPackage = async (
  options: BuildDistributionPackageOptions = {},
): Promise<DistributionPackageArtifact> => {
  const defaults = await readDistributionPackageMetadata();
  const packageDir = resolve(options.outputDir ?? defaultOutputDir);
  const binDir = join(packageDir, "bin");
  const resourcesDir = join(packageDir, "resources");
  const webDir = join(resourcesDir, "web");
  const bundlePath = join(binDir, "executor.mjs");
  const launcherPath = join(binDir, "executor.js");
  const quickJsWasmPath = resolveQuickJsWasmPath();

  const webDistDir = join(repoRoot, "apps/web/dist");
  const readmePath = join(repoRoot, "README.md");
  const packageName = options.packageName ?? defaults.name;
  const packageVersion = options.packageVersion ?? defaults.version;
  await rm(packageDir, { recursive: true, force: true });
  await mkdir(binDir, { recursive: true });
  await mkdir(resourcesDir, { recursive: true });

  if ((options.buildWeb ?? true) || !existsSync(webDistDir)) {
    await runCommand({
      command: "bun",
      args: ["run", "build"],
      cwd: join(repoRoot, "apps/web"),
    });
  }

  if (!existsSync(webDistDir)) {
    throw new Error(`Missing built web assets at ${webDistDir}`);
  }

  await runCommand({
    command: "bun",
    args: [
      "build",
      "./apps/executor/src/cli/main.ts",
      "--target",
      "node",
      "--outfile",
      bundlePath,
    ],
    cwd: repoRoot,
  });

  await cp(webDistDir, webDir, { recursive: true });
  await cp(quickJsWasmPath, join(binDir, "emscripten-module.wasm"));

  await mkdir(join(binDir, "openapi-extractor-wasm"), { recursive: true });
  await cp(
    join(repoRoot, "packages/sources/openapi/src/openapi-extractor-wasm/openapi_extractor_bg.wasm"),
    join(binDir, "openapi-extractor-wasm/openapi_extractor_bg.wasm"),
  );
  await cp(
    join(repoRoot, "packages/kernel/runtime-deno-subprocess/src/deno-subprocess-worker.mjs"),
    join(binDir, "deno-subprocess-worker.mjs"),
  );
  await runCommand({
    command: "bun",
    args: [
      "build",
      "./packages/kernel/runtime-ses/src/sandbox-worker.mjs",
      "--target",
      "node",
      "--outfile",
      join(binDir, "sandbox-worker.mjs"),
    ],
    cwd: repoRoot,
  });
  await writeFile(join(packageDir, "package.json"), createPackageJson({
    packageName,
    packageVersion,
    description: defaults.description,
    keywords: defaults.keywords,
    homepage: defaults.homepage,
    bugs: defaults.bugs,
    repository: defaults.repository,
    license: defaults.license,
  }));
  await cp(readmePath, join(packageDir, "README.md"));
  await writeFile(launcherPath, createLauncherSource());
  await chmod(launcherPath, 0o755);

  return {
    packageDir,
    launcherPath,
    bundlePath,
    resourcesDir,
  };
};


================================================
FILE: apps/executor/src/distribution/distribution.test.ts
================================================
import { describe, expect, it } from "@effect/vitest";
import * as Effect from "effect/Effect";

import {
  DistributionHarness,
  LocalDistributionHarnessLive,
} from "./harness";

describe("distribution flow", () => {
  const verifyInstallFlow = <R>(
    runCommand: (
      args: ReadonlyArray<string>,
      options?: {
        readonly okExitCodes?: ReadonlyArray<number>;
      },
    ) => Effect.Effect<{ stdout: string; stderr: string }, Error, R>,
  ) =>
    Effect.gen(function* () {
      const harness = yield* DistributionHarness;

      yield* harness.writeProjectConfig(`{
  "runtime": "ses",
  // local workspace config
  "sources": {},
}
`);

      const initialDoctor = yield* runCommand([
        "doctor",
        "--json",
        "--base-url",
        harness.baseUrl,
      ]);
      const initialDoctorJson = JSON.parse(initialDoctor.stdout) as {
        ok: boolean;
        checks: Record<string, { ok: boolean }>;
      };
      expect(initialDoctorJson.ok).toBe(false);
      expect(initialDoctorJson.checks.webAssets?.ok).toBe(true);
      expect(initialDoctorJson.checks.database?.ok).toBe(true);

      yield* runCommand(["up", "--base-url", harness.baseUrl]);

      const statusResult = yield* runCommand([
        "status",
        "--json",
        "--base-url",
        harness.baseUrl,
      ]);
      const status = JSON.parse(statusResult.stdout) as {
        reachable: boolean;
        pidRunning: boolean;
        installation: { workspaceId: string; accountId: string } | null;
      };

      expect(status.reachable).toBe(true);
      expect(status.pidRunning).toBe(true);
      expect(status.installation).not.toBeNull();

      const html = yield* harness.fetchText("/");
      expect(html.status).toBe(200);
      expect(html.contentType).toContain("text/html");
      expect(html.body).toContain("<div id=\"root\"></div>");

      const installationResponse = yield* harness.fetchText("/v1/local/installation");
      expect(installationResponse.status).toBe(200);
      const installation = JSON.parse(installationResponse.body) as {
        workspaceId: string;
        accountId: string;
      };

      const sesCall = yield* runCommand(
        [
          "call",
          'await fetch("https://example.com"); return 1;',
          "--base-url",
          harness.baseUrl,
        ],
        { okExitCodes: [1] },
      );
      expect(sesCall.stderr).toContain("fetch is disabled in SES executor");

      yield* runCommand(["down", "--base-url", harness.baseUrl]);
      yield* runCommand(["up", "--base-url", harness.baseUrl]);

      const installationAfterRestartResponse = yield* harness.fetchText("/v1/local/installation");
      expect(installationAfterRestartResponse.status).toBe(200);
      const installationAfterRestart = JSON.parse(
        installationAfterRestartResponse.body,
      ) as {
        workspaceId: string;
        accountId: string;
      };

      expect(installationAfterRestart.workspaceId).toBe(installation.workspaceId);
      expect(installationAfterRestart.accountId).toBe(installation.accountId);

      yield* runCommand(["down", "--base-url", harness.baseUrl]);
    });

  it.live("boots a staged package artifact in a fresh home", () =>
    verifyInstallFlow((args, options) =>
      Effect.flatMap(DistributionHarness, (harness) => harness.run(args, options))
    )
      .pipe(Effect.provide(LocalDistributionHarnessLive)), 240_000);

  it.live("boots an npm-installed package in a fresh home", () =>
    verifyInstallFlow((args, options) =>
      Effect.flatMap(DistributionHarness, (harness) => harness.runInstalled(args, options))
    ).pipe(Effect.provide(LocalDistributionHarnessLive)), 240_000);
});


================================================
FILE: apps/executor/src/distribution/harness.ts
================================================
import { spawn } from "node:child_process";
import { createServer } from "node:net";
import { tmpdir } from "node:os";
import { dirname, join } from "node:path";

import { FileSystem } from "@effect/platform";
import { NodeFileSystem } from "@effect/platform-node";
import * as Context from "effect/Context";
import * as Effect from "effect/Effect";
import * as Layer from "effect/Layer";

import { buildDistributionPackage } from "./artifact";
import { executorAppEffectError } from "../effect-errors";

const toError = (cause: unknown): Error =>
  cause instanceof Error ? cause : new Error(String(cause));

type CommandResult = {
  readonly stdout: string;
  readonly stderr: string;
  readonly exitCode: number;
};

export class DistributionHarness extends Context.Tag(
  "@executor/apps/executor/distribution/DistributionHarness",
)<
  DistributionHarness,
  {
    readonly packageDir: string;
    readonly launcherPath: string;
    readonly tarballPath: string;
    readonly executorHome: string;
    readonly baseUrl: string;
    readonly writeProjectConfig: (
      contents: string,
    ) => Effect.Effect<void, Error, never>;
    readonly run: (
      args: ReadonlyArray<string>,
      options?: {
        readonly okExitCodes?: ReadonlyArray<number>;
      },
    ) => Effect.Effect<CommandResult, Error, never>;
    readonly runInstalled: (
      args: ReadonlyArray<string>,
      options?: {
        readonly okExitCodes?: ReadonlyArray<number>;
      },
    ) => Effect.Effect<CommandResult, Error, never>;
    readonly fetchText: (
      pathname: string,
    ) => Effect.Effect<{
      readonly status: number;
      readonly body: string;
      readonly contentType: string | null;
    }, Error, never>;
  }
>() {}

const runCommand = (input: {
  readonly command: string;
  readonly args: ReadonlyArray<string>;
  readonly cwd: string;
  readonly env?: NodeJS.ProcessEnv;
  readonly okExitCodes?: ReadonlyArray<number>;
}): Effect.Effect<CommandResult, Error, never> =>
  Effect.async((resume) => {
    const child = spawn(input.command, [...input.args], {
      cwd: input.cwd,
      env: input.env,
      stdio: ["ignore", "pipe", "pipe"],
    });

    let stdout = "";
    let stderr = "";

    child.stdout?.setEncoding("utf8");
    child.stdout?.on("data", (chunk) => {
      stdout += chunk;
    });

    child.stderr?.setEncoding("utf8");
    child.stderr?.on("data", (chunk) => {
      stderr += chunk;
    });

    child.once("error", (error) => {
      resume(Effect.fail(error));
    });

    child.once("close", (code) => {
      const exitCode = code ?? -1;
      const result = {
        stdout: stdout.trim(),
        stderr: stderr.trim(),
        exitCode,
      } satisfies CommandResult;
      const okExitCodes = input.okExitCodes ?? [0];

      if (okExitCodes.includes(exitCode)) {
        resume(Effect.succeed(result));
        return;
      }

      resume(Effect.fail(executorAppEffectError("distribution/harness", 
        [
          `${input.command} ${input.args.join(" ")} exited with code ${exitCode}`,
          stdout.length > 0 ? `stdout:\n${stdout.trim()}` : null,
          stderr.length > 0 ? `stderr:\n${stderr.trim()}` : null,
        ].filter((part) => part !== null).join("\n\n"),
      )));
    });

    return Effect.sync(() => {
      child.kill("SIGTERM");
    });
  });

const allocatePort = (): Effect.Effect<number, Error, never> =>
  Effect.tryPromise({
    try: async () => {
      return await new Promise<number>((resolvePort, reject) => {
        const server = createServer();
        server.once("error", reject);
        server.listen(0, "127.0.0.1", () => {
          const address = server.address();
          if (!address || typeof address === "string") {
            server.close(() => reject(new Error("Failed to allocate test port")));
            return;
          }

          server.close((error) => {
            if (error) {
              reject(error);
              return;
            }

            resolvePort(address.port);
          });
        });
      });
    },
    catch: (cause) => cause instanceof Error ? cause : new Error(String(cause)),
  });

const buildPackage = (packageDir: string) =>
  Effect.tryPromise({
    try: () => buildDistributionPackage({
      outputDir: packageDir,
      buildWeb: false,
    }),
    catch: (cause) => cause instanceof Error ? cause : new Error(String(cause)),
  });

const packPackage = (packageDir: string, outputDir: string) =>
  runCommand({
    command: "npm",
    args: ["pack", packageDir],
    cwd: outputDir,
  }).pipe(
    Effect.flatMap((result) => {
      const tarballName = result.stdout
        .split(/\s+/)
        .map((part) => part.trim())
        .filter((part) => part.length > 0)
        .at(-1);

      if (!tarballName) {
        return Effect.fail(
          executorAppEffectError("distribution/harness", `Unable to determine tarball name from npm pack output: ${result.stdout}`),
        );
      }

      return Effect.succeed(join(outputDir, tarballName));
    }),
  );

export const LocalDistributionHarnessLive = Layer.scoped(
  DistributionHarness,
  Effect.gen(function* () {
    const fs = yield* FileSystem.FileSystem;
    const tempRoot = yield* Effect.acquireRelease(
      fs.makeTempDirectory({
        directory: tmpdir(),
        prefix: "executor-distribution-",
      }).pipe(Effect.mapError(toError)),
      (path) =>
        fs.remove(path, { recursive: true, force: true }).pipe(
          Effect.mapError(toError),
          Effect.orDie,
        ),
    );

    const packageDir = join(tempRoot, "package");
    const prefixDir = join(tempRoot, "prefix");
    const homeDir = join(tempRoot, "home");
    const executorHome = join(homeDir, ".executor");
    const stagedWorkspaceRoot = packageDir;
    const installedWorkspaceRoot = tempRoot;
    const baseUrl = `http://127.0.0.1:${yield* allocatePort()}`;

    yield* Effect.all([
      fs.makeDirectory(prefixDir, { recursive: true }),
      fs.makeDirectory(homeDir, { recursive: true }),
      fs.makeDirectory(executorHome, { recursive: true }),
    ]).pipe(Effect.mapError(toError));

    const artifact = yield* buildPackage(packageDir);
    const tarballPath = yield* packPackage(packageDir, tempRoot);


    const env = {
      ...process.env,
      HOME: homeDir,
      EXECUTOR_HOME: executorHome,
    } satisfies NodeJS.ProcessEnv;

    const installedEnv = {
      ...env,
      NPM_CONFIG_PREFIX: prefixDir,
      PATH: `${join(prefixDir, "bin")}:${process.env.PATH ?? ""}`,
    } satisfies NodeJS.ProcessEnv;

    yield* runCommand({
      command: "npm",
      args: ["install", "-g", tarballPath],
      cwd: tempRoot,
      env: installedEnv,
    });

    const run = (
      args: ReadonlyArray<string>,
      options?: { readonly okExitCodes?: ReadonlyArray<number> },
    ) =>
      runCommand({
        command: "node",
        args: [artifact.launcherPath, ...args],
        cwd: dirname(artifact.launcherPath),
        env,
        okExitCodes: options?.okExitCodes,
      });

    const runInstalled = (
      args: ReadonlyArray<string>,
      options?: { readonly okExitCodes?: ReadonlyArray<number> },
    ) =>
      runCommand({
        command: "executor",
        args,
        cwd: tempRoot,
        env: installedEnv,
        okExitCodes: options?.okExitCodes,
      });

    const fetchText = (pathname: string) =>
      Effect.tryPromise({
        try: async () => {
          const response = await fetch(new URL(pathname, baseUrl));
          return {
            status: response.status,
            body: await response.text(),
            contentType: response.headers.get("content-type"),
          };
        },
        catch: (cause) => cause instanceof Error ? cause : new Error(String(cause)),
      });

    const writeProjectConfig = (contents: string) =>
      Effect.forEach(
        [stagedWorkspaceRoot, installedWorkspaceRoot],
        (workspaceRoot) =>
          Effect.gen(function* () {
            const configDir = join(workspaceRoot, ".executor");
            yield* fs.makeDirectory(configDir, { recursive: true }).pipe(
              Effect.mapError(toError),
            );
            yield* fs.writeFileString(
              join(configDir, "executor.jsonc"),
              contents,
            ).pipe(Effect.mapError(toError));
          }),
        { discard: true },
      );

    return DistributionHarness.of({
      packageDir,
      launcherPath: artifact.launcherPath,
      tarballPath,
      executorHome,
      baseUrl,
      writeProjectConfig,
      run,
      runInstalled,
      fetchText,
    });
  }).pipe(Effect.provide(NodeFileSystem.layer)),
);


================================================
FILE: apps/executor/src/distribution/metadata.ts
================================================
import { readFile } from "node:fs/promises";
import { dirname, resolve } from "node:path";
import { fileURLToPath } from "node:url";

export const repoRoot = resolve(dirname(fileURLToPath(import.meta.url)), "../../../..");
const packageMetadataPath = resolve(repoRoot, "apps/executor/package.json");

export type DistributionPackageMetadata = {
  name: string;
  version: string;
  description: string;
  keywords: ReadonlyArray<string>;
  homepage?: string;
  bugs?: {
    url?: string;
  };
  repository?: {
    type?: string;
    url?: string;
  };
  license?: string;
};

export const readDistributionPackageMetadata = async (): Promise<DistributionPackageMetadata> => {
  const contents = await readFile(packageMetadataPath, "utf8");
  const metadata = JSON.parse(contents) as Partial<DistributionPackageMetadata>;

  return {
    name: metadata.name ?? "executor",
    version: metadata.version ?? "0.0.0-local",
    description: metadata.description ?? "Local AI executor with a CLI, local API server, and web UI.",
    keywords: Array.isArray(metadata.keywords) ? metadata.keywords.filter((value): value is string => typeof value === "string") : ["executor", "ai", "agent", "cli"],
    homepage: metadata.homepage,
    bugs: metadata.bugs,
    repository: metadata.repository,
    license: metadata.license ?? "MIT",
  };
};


================================================
FILE: apps/executor/src/distribution/publish.ts
================================================
import { spawn } from "node:child_process";
import { mkdir, rm } from "node:fs/promises";
import { join, resolve } from "node:path";

import { buildDistributionPackage } from "./artifact";
import { readDistributionPackageMetadata, repoRoot } from "./metadata";

const defaultReleaseDir = resolve(repoRoot, "apps/executor/dist/release");
const semverPattern =
  /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[A-Za-z-][0-9A-Za-z-]*)(?:\.(?:0|[1-9]\d*|\d*[A-Za-z-][0-9A-Za-z-]*))*))?(?:\+([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?$/;

type PublishCliOptions = {
  dryRun: boolean;
};

type CommandInput = {
  command: string;
  args: ReadonlyArray<string>;
  cwd: string;
};

type CommandOutput = {
  stdout: string;
  stderr: string;
};

type PackResult = {
  filename?: string;
};

const parseArgs = (argv: ReadonlyArray<string>): PublishCliOptions => {
  const options: PublishCliOptions = {
    dryRun: false,
  };

  for (const arg of argv) {
    if (arg === "--dry-run") {
      options.dryRun = true;
      continue;
    }

    throw new Error(`Unknown argument: ${arg}`);
  }

  return options;
};

const runCommand = async (input: CommandInput): Promise<CommandOutput> => {
  const child = spawn(input.command, [...input.args], {
    cwd: input.cwd,
    env: process.env,
    stdio: ["ignore", "pipe", "pipe"],
  });

  let stdout = "";
  let stderr = "";

  child.stdout?.setEncoding("utf8");
  child.stdout?.on("data", (chunk) => {
    stdout += chunk;
  });

  child.stderr?.setEncoding("utf8");
  child.stderr?.on("data", (chunk) => {
    stderr += chunk;
  });

  const exitCode = await new Promise<number>((resolveExitCode, reject) => {
    child.once("error", reject);
    child.once("close", (code) => {
      resolveExitCode(code ?? -1);
    });
  });

  if (exitCode !== 0) {
    throw new Error(
      [
        `${input.command} ${input.args.join(" ")} exited with code ${exitCode}`,
        stdout.trim().length > 0 ? `stdout:\n${stdout.trim()}` : null,
        stderr.trim().length > 0 ? `stderr:\n${stderr.trim()}` : null,
      ]
        .filter((part) => part !== null)
        .join("\n\n"),
    );
  }

  return {
    stdout: stdout.trim(),
    stderr: stderr.trim(),
  };
};

const resolveTagFromEnvironment = (): string | undefined => {
  const refName = process.env.GITHUB_REF_NAME?.trim();
  if (process.env.GITHUB_REF_TYPE === "tag" && refName) {
    return refName;
  }

  const ref = process.env.GITHUB_REF?.trim();
  if (ref?.startsWith("refs/tags/")) {
    return ref.slice("refs/tags/".length);
  }

  return undefined;
};

const resolveGitHubRepository = (): string => {
  const repository = process.env.GH_REPO?.trim() || process.env.GITHUB_REPOSITORY?.trim();
  if (!repository) {
    throw new Error("Set GH_REPO or GITHUB_REPOSITORY before creating a GitHub release.");
  }

  return repository;
};

const validateVersion = (version: string): void => {
  if (!semverPattern.test(version)) {
    throw new Error(`apps/executor/package.json version is not valid semver: ${version}`);
  }
};

const resolveChannel = (version: string): "latest" | "beta" =>
  version.includes("-") ? "beta" : "latest";

const packDistributionPackage = async (releaseDir: string): Promise<string> => {
  const output = await runCommand({
    command: "npm",
    args: ["pack", "./apps/executor/dist/npm", "--pack-destination", releaseDir, "--json"],
    cwd: repoRoot,
  });
  const [result] = JSON.parse(output.stdout) as ReadonlyArray<PackResult>;
  const filename = result?.filename;

  if (!filename) {
    throw new Error(`npm pack did not report an output filename. stdout:\n${output.stdout}`);
  }

  return join(releaseDir, filename);
};

const publishDistributionPackage = async (channel: "latest" | "beta"): Promise<void> => {
  const args = ["publish", "./dist/npm", "--access", "public", "--tag", channel];
  if (process.env.GITHUB_ACTIONS === "true") {
    args.push("--provenance");
  }

  await runCommand({
    command: "npm",
    args,
    cwd: resolve(repoRoot, "apps/executor"),
  });
};

const createGitHubRelease = async (input: {
  tag: string;
  channel: "latest" | "beta";
  assetPath: string;
}): Promise<void> => {
  if (!process.env.GH_TOKEN?.trim()) {
    throw new Error("GH_TOKEN is required to create a GitHub release.");
  }

  const args = [
    "release",
    "create",
    input.tag,
    input.assetPath,
    "--repo",
    resolveGitHubRepository(),
    "--title",
    input.tag,
    "--generate-notes",
    "--verify-tag",
  ];

  if (input.channel === "beta") {
    args.push("--prerelease");
  } else {
    args.push("--latest");
  }

  await runCommand({
    command: "gh",
    args,
    cwd: repoRoot,
  });
};

const main = async () => {
  const options = parseArgs(process.argv.slice(2));
  const metadata = await readDistributionPackageMetadata();
  const version = metadata.version;
  const tag = `v${version}`;
  const refTag = resolveTagFromEnvironment();

  validateVersion(version);

  if (refTag && refTag !== tag) {
    throw new Error(`GitHub tag ${refTag} does not match apps/executor/package.json version ${version}`);
  }

  const channel = resolveChannel(version);
  await rm(defaultReleaseDir, { recursive: true, force: true });
  await mkdir(defaultReleaseDir, { recursive: true });

  await buildDistributionPackage();
  const archivePath = await packDistributionPackage(defaultReleaseDir);

  process.stdout.write(`Prepared executor@${version} for ${channel}\n`);
  process.stdout.write(`${archivePath}\n`);

  if (options.dryRun) {
    return;
  }

  await publishDistributionPackage(channel);
  await createGitHubRelease({
    tag,
    channel,
    assetPath: archivePath,
  });
};

await main();


================================================
FILE: apps/executor/src/effect-errors.ts
================================================
import * as Data from "effect/Data";

export class ExecutorAppEffectError extends Data.TaggedError(
  "ExecutorAppEffectError",
)<{
  readonly module: string;
  readonly message: string;
}> {}

export const executorAppEffectError = (
  module: string,
  message: string,
) => new ExecutorAppEffectError({ module, message });

export class LocalServerReachabilityTimeoutError extends Data.TaggedError(
  "LocalServerReachabilityTimeoutError",
)<{
  readonly baseUrl: string;
  readonly action: "start" | "shutdown";
  readonly logFile: string;
  readonly logTail: string | null;
  readonly message: string;
}> {}

export const localServerReachabilityTimeoutError = (input: {
  baseUrl: string;
  expected: boolean;
  logFile: string;
  logTail: string | null;
}) =>
  new LocalServerReachabilityTimeoutError({
    baseUrl: input.baseUrl,
    action: input.expected ? "start" : "shutdown",
    logFile: input.logFile,
    logTail: input.logTail,
    message:
      input.logTail === null
        ? `Timed out waiting for local executor server ${input.expected ? "start" : "shutdown"} at ${input.baseUrl}\n\nDaemon log: ${input.logFile}`
        : `Timed out waiting for local executor server ${input.expected ? "start" : "shutdown"} at ${input.baseUrl}\n\nRecent daemon log (${input.logFile}):\n${input.logTail}`,
  });


================================================
FILE: apps/executor/src/server/server.real-ingestion.test.ts
================================================
import { FileSystem } from "@effect/platform";
import { NodeFileSystem } from "@effect/platform-node";
import { describe, expect, it } from "@effect/vitest";
import * as Effect from "effect/Effect";

import {
  createControlPlaneClient,
  type SourceDiscoveryKind,
} from "@executor/control-plane";
import { createLocalExecutorServer } from "@executor/server";

const REAL_VERCEL_SPEC_URL = "https://openapi.vercel.sh";
const REAL_VERCEL_API_ENDPOINT = "https://api.vercel.com";
const REAL_LINEAR_GRAPHQL_ENDPOINT = "https://api.linear.app/graphql";
const REAL_DEEPWIKI_MCP_ENDPOINT = "https://mcp.deepwiki.com/mcp";

const makeTempWorkspaceRoot = () =>
  FileSystem.FileSystem.pipe(
    Effect.flatMap((fs) => fs.makeTempDirectory({ prefix: "executor-real-ingestion-" })),
    Effect.provide(NodeFileSystem.layer),
  );

const createIsolatedLocalExecutorServer = () =>
  Effect.gen(function* () {
    const workspaceRoot = yield* makeTempWorkspaceRoot();
    return yield* createLocalExecutorServer({
      port: 0,
      localDataDir: ":memory:",
      workspaceRoot,
    });
  });

const createApiClientHarness = () =>
  Effect.gen(function* () {
    const server = yield* createIsolatedLocalExecutorServer();
    const bootstrapClient = yield* createControlPlaneClient({
      baseUrl: server.baseUrl,
    });
    const installation = yield* bootstrapClient.local.installation({});
    const client = yield* createControlPlaneClient({
      baseUrl: server.baseUrl,
      accountId: installation.accountId,
    });

    return {
      installation,
      client,
    };
  });

const canonicalUrl = (value: string): string =>
  new URL(value).toString();

const expectDiscoveredKind = <T extends { detectedKind: SourceDiscoveryKind }>(
  result: T,
  expectedKind: SourceDiscoveryKind,
) => {
  expect(result.detectedKind).toBe(expectedKind);
};

describe("local-executor-server real ingestion", () => {
  it.live("discovers and ingests the real Vercel OpenAPI source through the API client", () =>
    Effect.scoped(Effect.gen(function* () {
      const { installation, client } = yield* createApiClientHarness();

      const discovered = yield* client.sources.discover({
        payload: {
          url: REAL_VERCEL_SPEC_URL,
        },
      });

      expectDiscoveredKind(discovered, "openapi");
      expect(canonicalUrl(discovered.endpoint)).toBe(canonicalUrl(REAL_VERCEL_API_ENDPOINT));
      expect(canonicalUrl(discovered.specUrl ?? "")).toBe(canonicalUrl(REAL_VERCEL_SPEC_URL));

      const connected = yield* client.sources.connect({
        path: {
          workspaceId: installation.workspaceId,
        },
        payload: {
          kind: "openapi",
          name: "Vercel",
          namespace: "vercel",
          endpoint: REAL_VERCEL_API_ENDPOINT,
          specUrl: REAL_VERCEL_SPEC_URL,
          auth: {
            kind: "none",
          },
        },
      });

      expect(connected.kind).toBe("connected");
      if (connected.kind !== "connected") {
        throw new Error(`Expected connected result, received ${connected.kind}`);
      }

      const inspection = yield* client.sources.inspection({
        path: {
          workspaceId: installation.workspaceId,
          sourceId: connected.source.id,
        },
      });

      expect(inspection.namespace).toBe("vercel");
      expect(inspection.toolCount).toBeGreaterThan(250);

      const discoveredTools = yield* client.sources.inspectionDiscover({
        path: {
          workspaceId: installation.workspaceId,
          sourceId: connected.source.id,
        },
        payload: {
          query: "list user events",
          limit: 5,
        },
      });

      expect(discoveredTools.bestPath).toBeTruthy();
      expect(discoveredTools.total).toBeGreaterThan(0);
    })),
    15_000,
  );

  it.live("discovers and ingests the real Linear GraphQL source through the API client", () =>
    Effect.scoped(Effect.gen(function* () {
      const { installation, client } = yield* createApiClientHarness();

      const discovered = yield* client.sources.discover({
        payload: {
          url: REAL_LINEAR_GRAPHQL_ENDPOINT,
        },
      });

      expectDiscoveredKind(discovered, "graphql");
      expect(canonicalUrl(discovered.endpoint)).toBe(canonicalUrl(REAL_LINEAR_GRAPHQL_ENDPOINT));
      expect(discovered.specUrl).toBeNull();

      const connected = yield* client.sources.connect({
        path: {
          workspaceId: installation.workspaceId,
        },
        payload: {
          kind: "graphql",
          name: "Linear",
          namespace: "linear",
          endpoint: REAL_LINEAR_GRAPHQL_ENDPOINT,
          auth: {
            kind: "none",
          },
        },
      });

      expect(connected.kind).toBe("connected");
      if (connected.kind !== "connected") {
        throw new Error(`Expected connected result, received ${connected.kind}`);
      }
      expect(connected.source.status).toBe("connected");
      expect(connected.source.namespace).toBe("linear");

      const storedSource = yield* client.sources.get({
        path: {
          workspaceId: installation.workspaceId,
          sourceId: connected.source.id,
        },
      });

      expect(storedSource.kind).toBe("graphql");
      expect(storedSource.status).toBe("connected");
      expect(storedSource.endpoint).toBe(REAL_LINEAR_GRAPHQL_ENDPOINT);
    })),
    15_000,
  );

  it.live("discovers and ingests a real public MCP source through the API client", () =>
    Effect.scoped(Effect.gen(function* () {
      const { installation, client } = yield* createApiClientHarness();

      const discovered = yield* client.sources.discover({
        payload: {
          url: REAL_DEEPWIKI_MCP_ENDPOINT,
        },
      });

      expectDiscoveredKind(discovered, "mcp");
      expect(canonicalUrl(discovered.endpoint)).toBe(canonicalUrl(REAL_DEEPWIKI_MCP_ENDPOINT));

      const connected = yield* client.sources.connect({
        path: {
          workspaceId: installation.workspaceId,
        },
        payload: {
          kind: "mcp",
          name: "DeepWiki",
          namespace: "deepwiki",
          endpoint: REAL_DEEPWIKI_MCP_ENDPOINT,
        },
      });

      expect(connected.kind).toBe("connected");
      if (connected.kind !== "connected") {
        throw new Error(`Expected connected result, received ${connected.kind}`);
      }

      const inspection = yield* client.sources.inspection({
        path: {
          workspaceId: installation.workspaceId,
          sourceId: connected.source.id,
        },
      });

      expect(inspection.namespace).toBe("deepwiki");
      expect(inspection.toolCount).toBeGreaterThan(0);

      const discoveredTools = yield* client.sources.inspectionDiscover({
        path: {
          workspaceId: installation.workspaceId,
          sourceId: connected.source.id,
        },
        payload: {
          query: "repository",
          limit: 5,
        },
      });

      expect(discoveredTools.bestPath).toBeTruthy();
      expect(discoveredTools.total).toBeGreaterThan(0);
    })),
    15_000,
  );
});


================================================
FILE: apps/executor/src/server/server.test.ts
================================================
import { createServer, type IncomingMessage, type ServerResponse } from "node:http";
import { randomUUID } from "node:crypto";

import {
  HttpApi,
  HttpApiEndpoint,
  HttpApiGroup,
  HttpApiSchema,
  OpenApi,
  FileSystem,
} from "@effect/platform";
import { NodeFileSystem } from "@effect/platform-node";
import { describe, expect, it } from "@effect/vitest";
import { assertTrue } from "@effect/vitest/utils";
import * as Effect from "effect/Effect";
import * as Schema from "effect/Schema";

import { startMcpElicitationDemoServer } from "@executor/mcp-elicitation-demo";
import { makeToolInvokerFromTools, toTool } from "@executor/codemode-core";
import {
  createControlPlaneClient,
  controlPlaneOpenApiSpec,
  buildLocalSourceArtifact,
  catalogSyncResultFromMcpManifest,
  deriveLocalInstallation,
  type ResolveExecutionEnvironment,
  resolveLocalWorkspaceContext,
  SourceIdSchema,
  writeLocalSourceArtifact,
  writeProjectLocalExecutorConfig,
} from "@executor/control-plane";
import { makeSesExecutor } from "@executor/runtime-ses";
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
import { createMcpExpressApp } from "@modelcontextprotocol/sdk/server/express.js";
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
import { ElicitRequestSchema } from "@modelcontextprotocol/sdk/types.js";

import {
  seedDemoMcpSourceInWorkspace,
  seedGithubOpenApiSourceInWorkspace,
} from "../cli/dev";
import { createLocalExecutorServer } from "@executor/server";

const executionResolver: ResolveExecutionEnvironment = () =>
  Effect.succeed({
    executor: makeSesExecutor(),
    toolInvoker: makeToolInvokerFromTools({
      tools: {
        "math.add": {
          description: "Add two numbers",
          inputSchema: Schema.standardSchemaV1(
            Schema.Struct({
              a: Schema.optional(Schema.Number),
              b: Schema.optional(Schema.Number),
            }),
          ),
          execute: ({ a, b }) => ({ sum: (a ?? 0) + (b ?? 0) }),
        },
      },
    }),
  });

const makeTempWorkspaceRoot = () =>
  FileSystem.FileSystem.pipe(
    Effect.flatMap((fs) => fs.makeTempDirectoryScoped({ prefix: "executor-server-test-" })),
    Effect.provide(NodeFileSystem.layer),
  );

const createIsolatedLocalExecutorServer = (
  options: Parameters<typeof createLocalExecutorServer>[0] = {},
) =>
  Effect.gen(function* () {
    const workspaceRoot = yield* makeTempWorkspaceRoot();
    const server = yield* createLocalExecutorServer({
      ...options,
      workspaceRoot,
    });
    return {
      ...server,
      workspaceRoot,
    };
  });

const writeConfiguredLocalMcpSource = (input: {
  workspaceRoot: string;
  sourceId: string;
  endpoint: string;
  name?: string;
  namespace?: string;
}) =>
  Effect.gen(function* () {
    const sourceId = SourceIdSchema.make(input.sourceId);
    const context = yield* resolveLocalWorkspaceContext({
      workspaceRoot: input.workspaceRoot,
    });
    const installation = deriveLocalInstallation(context);

    yield* writeProjectLocalExecutorConfig({
      context,
      config: {
        sources: {
          [input.sourceId]: {
            kind: "mcp",
            name: input.name ?? "Demo",
            namespace: input.namespace ?? input.sourceId,
            connection: {
              endpoint: input.endpoint,
            },
            binding: {
              transport: "streamable-http",
            },
          },
        },
      },
    });

    const source = {
      id: sourceId,
      workspaceId: installation.workspaceId,
      name: input.name ?? "Demo",
      kind: "mcp" as const,
      endpoint: input.endpoint,
      status: "connected" as const,
      enabled: true,
      namespace: input.namespace ?? input.sourceId,
      bindingVersion: 1,
      binding: {
        transport: "streamable-http",
        queryParams: null,
        headers: null,
      },
      importAuthPolicy: "reuse_runtime" as const,
      importAuth: { kind: "none" as const },
      auth: { kind: "none" as const },
      sourceHash: null,
      lastError: null,
      createdAt: Date.now(),
      updatedAt: Date.now(),
    };

    const syncResult = catalogSyncResultFromMcpManifest({
      source,
      endpoint: input.endpoint,
      manifest: {
        version: 2,
        server: null,
        tools: [{
          toolId: "gated_echo",
          toolName: "gated_echo",
          description: "Asks for approval before echoing a value",
          inputSchema: {
            type: "object",
            properties: {
              value: {
                type: "string",
              },
            },
            required: ["value"],
            additionalProperties: false,
          },
        }],
      },
    });

    yield* writeLocalSourceArtifact({
      context,
      sourceId,
      artifact: buildLocalSourceArtifact({
        source,
        syncResult,
      }),
    });
  }).pipe(Effect.provide(NodeFileSystem.layer));

const makeServer = createIsolatedLocalExecutorServer({
  port: 0,
  localDataDir: ":memory:",
  executionResolver,
});

const createApiClientHarness = () =>
  Effect.gen(function* () {
    const server = yield* createIsolatedLocalExecutorServer({
      port: 0,
      localDataDir: ":memory:",
    });
    const bootstrapClient = yield* createControlPlaneClient({
      baseUrl: server.baseUrl,
    });
    const installation = yield* bootstrapClient.local.installation({});
    const client = yield* createControlPlaneClient({
      baseUrl: server.baseUrl,
      accountId: installation.accountId,
    });

    return {
      server,
      bootstrapClient,
      installation,
      client,
    };
  });

const gatedExecutionResolver: ResolveExecutionEnvironment = ({ onElicitation }) =>
  Effect.succeed({
    executor: makeSesExecutor(),
    toolInvoker: makeToolInvokerFromTools({
      tools: {
        "demo.gated_echo": toTool({
          tool: {
            description: "Asks for approval before echoing a value",
            inputSchema: Schema.standardSchemaV1(
              Schema.Struct({
                value: Schema.String,
                approve: Schema.optional(Schema.Boolean),
              }),
            ),
            execute: ({ value, approve }: { value: string; approve?: boolean }) =>
              approve === true ? `approved:${value}` : `denied:${value}`,
          },
          metadata: {
            sourceKey: "demo",
            elicitation: {
              mode: "form",
              message: "Approve gated echo?",
              requestedSchema: {
                type: "object",
                properties: {
                  approve: {
                    type: "boolean",
                    title: "Approve",
                  },
                },
                required: ["approve"],
              },
            },
          },
        }),
      },
      onElicitation,
    }),
  });

type ExecutorMcpClient = {
  client: Client;
  close: () => Promise<void>;
};

type ElicitationHandler = NonNullable<Parameters<Client["setRequestHandler"]>[1]>;

const makeExecutorMcpClient = (input: {
  baseUrl: string;
  capabilities?: Record<string, unknown>;
  onElicitation?: ElicitationHandler;
}) =>
  Effect.acquireRelease(
    Effect.promise<ExecutorMcpClient>(async () => {
      const client = new Client(
        { name: "executor-mcp-test-client", version: "1.0.0" },
        { capabilities: input.capabilities ?? {} },
      );
      if (input.onElicitation) {
        client.setRequestHandler(ElicitRequestSchema, input.onElicitation);
      }

      const transport = new StreamableHTTPClientTransport(new URL(`${input.baseUrl}/mcp`));
      await client.connect(transport);

      return {
        client,
        close: async () => {
          await client.close();
        },
      };
    }),
    ({ close }) => Effect.promise(() => close()).pipe(Effect.orDie),
  );

const ownerParam = HttpApiSchema.param("owner", Schema.String);
const repoParam = HttpApiSchema.param("repo", Schema.String);

class ExecutorDemoReposApi extends HttpApiGroup.make("repos")
  .add(
    HttpApiEndpoint.get("getRepo")`/repos/${ownerParam}/${repoParam}`
      .addSuccess(
        Schema.Struct({
          full_name: Schema.String,
          private: Schema.Boolean,
        }),
      ),
  )
{}

class ExecutorDemoApi extends HttpApi.make("executorDemo").add(ExecutorDemoReposApi) {}

const executorDemoOpenApiSpec = OpenApi.fromApi(ExecutorDemoApi);

const startOpenApiDemoServer = async () => {
  const seenAuthHeaders: Array<string | null> = [];

  const handler = (req: IncomingMessage, res: ServerResponse) => {
    if (req.url === "/openapi.json") {
      res.statusCode = 200;
      res.setHeader("content-type", "application/json");
      res.end(JSON.stringify(executorDemoOpenApiSpec));
      return;
    }

    const match = req.url?.match(/^\/repos\/([^/]+)\/([^/]+)$/);
    if (req.method === "GET" && match) {
      seenAuthHeaders.push(
        typeof req.headers.authorization === "string" ? req.headers.authorization : null,
      );
      res.statusCode = 200;
      res.setHeader("content-type", "application/json");
      res.end(
        JSON.stringify({
          full_name: `${decodeURIComponent(match[1] ?? "")}/${decodeURIComponent(match[2] ?? "")}`,
          private: false,
        }),
      );
      return;
    }

    res.statusCode = 404;
    res.end("not found");
  };

  const server = createServer(handler);
  await new Promise<void>((resolve, reject) => {
    server.once("error", reject);
    server.listen(0, "127.0.0.1", () => resolve());
  });
  const address = server.address();
  if (!address || typeof address === "string") {
    throw new Error("Failed to bind OpenAPI demo server");
  }

  return {
    baseUrl: `http://127.0.0.1:${address.port}`,
    specUrl: `http://127.0.0.1:${address.port}/openapi.json`,
    seenAuthHeaders,
    close: () =>
      new Promise<void>((resolve, reject) => {
        server.close((error) => (error ? reject(error) : resolve()));
      }),
  };
};

const startMutatingOpenApiDemoServer = async () => {
  const createdBodies: Array<Record<string, unknown>> = [];
  const openApiDocument = JSON.stringify({
    openapi: "3.0.3",
    info: {
      title: "Executor DNS Demo API",
      version: "1.0.0",
    },
    paths: {
      "/records": {
        post: {
          operationId: "records.createRecord",
          tags: ["records"],
          summary: "Create a DNS record",
          requestBody: {
            required: true,
            content: {
              "application/json": {
                schema: {
                  type: "object",
                  properties: {
                    type: { type: "string" },
                    name: { type: "string" },
                    value: { type: "string" },
                  },
                  required: ["type", "value"],
                },
              },
            },
          },
          responses: {
            200: {
              description: "ok",
            },
          },
        },
      },
    },
  });

  const handler = (req: IncomingMessage, res: ServerResponse) => {
    if (req.url === "/openapi.json") {
      res.statusCode = 200;
      res.setHeader("content-type", "application/json");
      res.end(openApiDocument);
      return;
    }

    if (req.method === "POST" && req.url === "/records") {
      const chunks: Array<Buffer> = [];
      req.on("data", (chunk) => {
        chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
      });
      req.on("end", () => {
        const raw = Buffer.concat(chunks).toString("utf8");
        const parsed = JSON.parse(raw) as Record<string, unknown>;
        createdBodies.push(parsed);
        res.statusCode = 200;
        res.setHeader("content-type", "application/json");
        res.end(JSON.stringify({
          ok: true,
          id: `rec_${createdBodies.length}`,
          record: parsed,
        }));
      });
      return;
    }

    res.statusCode = 404;
    res.end("not found");
  };

  const server = createServer(handler);
  await new Promise<void>((resolve, reject) => {
    server.once("error", reject);
    server.listen(0, "127.0.0.1", () => resolve());
  });
  const address = server.address();
  if (!address || typeof address === "string") {
    throw new Error("Failed to bind mutating OpenAPI demo server");
  }

  return {
   
Download .txt
gitextract_p4l6ztj_/

├── .changeset/
│   ├── README.md
│   ├── config.json
│   ├── eleven-towns-brush.md
│   ├── fiery-pianos-argue.md
│   ├── nice-bananas-hammer.md
│   ├── pre.json
│   ├── rude-shrimps-teach.md
│   └── two-vans-attend.md
├── .executor/
│   └── executor.jsonc
├── .github/
│   └── workflows/
│       ├── publish-executor-package.yml
│       └── release.yml
├── .gitignore
├── .oxlintrc.jsonc
├── ARCHITECTURE.md
├── PLAN.md
├── README.md
├── TRACING.md
├── apps/
│   ├── docs/
│   │   ├── CHANGELOG.md
│   │   ├── developer/
│   │   │   ├── adapters-and-formats.mdx
│   │   │   ├── cli.mdx
│   │   │   ├── codemode.mdx
│   │   │   ├── core-model.mdx
│   │   │   ├── credentials-and-auth.mdx
│   │   │   ├── extending-executor.mdx
│   │   │   ├── import-fidelity.mdx
│   │   │   ├── mcp.mdx
│   │   │   ├── overview.mdx
│   │   │   ├── persistence-and-migrations.mdx
│   │   │   └── tool-catalog-and-execution.mdx
│   │   ├── docs.json
│   │   ├── introduction.mdx
│   │   └── package.json
│   ├── executor/
│   │   ├── CHANGELOG.md
│   │   ├── bin/
│   │   │   └── executor
│   │   ├── package.json
│   │   ├── src/
│   │   │   ├── cli/
│   │   │   │   ├── dev.ts
│   │   │   │   ├── interaction-handling.test.ts
│   │   │   │   ├── interaction-handling.ts
│   │   │   │   ├── main.ts
│   │   │   │   ├── pending-interaction-output.test.ts
│   │   │   │   ├── pending-interaction-output.ts
│   │   │   │   └── runtime-paths.ts
│   │   │   ├── distribution/
│   │   │   │   ├── artifact.ts
│   │   │   │   ├── distribution.test.ts
│   │   │   │   ├── harness.ts
│   │   │   │   ├── metadata.ts
│   │   │   │   └── publish.ts
│   │   │   ├── effect-errors.ts
│   │   │   └── server/
│   │   │       ├── server.real-ingestion.test.ts
│   │   │       └── server.test.ts
│   │   └── tsconfig.json
│   └── web/
│       ├── CHANGELOG.md
│       ├── package.json
│       ├── src/
│       │   ├── components/
│       │   │   ├── code-block.tsx
│       │   │   ├── document-panel.tsx
│       │   │   ├── icons.tsx
│       │   │   ├── loadable.tsx
│       │   │   ├── local-mcp-install-card.tsx
│       │   │   ├── markdown.tsx
│       │   │   ├── shell.tsx
│       │   │   ├── source-favicon.tsx
│       │   │   ├── source-not-found-state.tsx
│       │   │   ├── source-recovery-state.tsx
│       │   │   └── ui/
│       │   │       ├── badge.tsx
│       │   │       └── button.tsx
│       │   ├── dev.ts
│       │   ├── frontend.tsx
│       │   ├── globals.css
│       │   ├── index.html
│       │   ├── lib/
│       │   │   ├── schema-display.ts
│       │   │   ├── shiki.ts
│       │   │   ├── source-favicon.ts
│       │   │   └── utils.ts
│       │   ├── main.tsx
│       │   ├── server.ts
│       │   └── views/
│       │       ├── add-source.tsx
│       │       ├── home.tsx
│       │       ├── json-form.ts
│       │       ├── mcp-transport-state.ts
│       │       ├── secrets.tsx
│       │       ├── source-detail.tsx
│       │       ├── source-editor.tsx
│       │       └── source-templates.ts
│       ├── tsconfig.json
│       └── vite.config.ts
├── compose.tracing.yaml
├── examples/
│   ├── mcp-elicitation-demo/
│   │   ├── CHANGELOG.md
│   │   ├── package.json
│   │   ├── src/
│   │   │   ├── index.ts
│   │   │   ├── main.ts
│   │   │   └── server.ts
│   │   └── tsconfig.json
│   └── serve-skills-via-mcp/
│       ├── CHANGELOG.md
│       ├── README.md
│       ├── package.json
│       ├── skills/
│       │   ├── postgres-incident-triage/
│       │   │   ├── SKILL.md
│       │   │   ├── references/
│       │   │   │   └── error-codes.md
│       │   │   └── scripts/
│       │   │       └── blocked-session-query.sql
│       │   └── release-notes-writer/
│       │       ├── SKILL.md
│       │       ├── assets/
│       │       │   └── release-template.md
│       │       ├── references/
│       │       │   └── style-guide.md
│       │       └── scripts/
│       │           └── validate-headings.ts
│       ├── src/
│       │   ├── catalog.ts
│       │   ├── index.ts
│       │   ├── main.ts
│       │   ├── server.ts
│       │   └── smoke.ts
│       └── tsconfig.json
├── knip.json
├── opencode.json
├── package.json
├── packages/
│   ├── auth/
│   │   ├── mcp-oauth/
│   │   │   ├── package.json
│   │   │   ├── src/
│   │   │   │   ├── effect-errors.ts
│   │   │   │   └── index.ts
│   │   │   └── tsconfig.json
│   │   └── oauth2/
│   │       ├── package.json
│   │       ├── src/
│   │       │   └── index.ts
│   │       └── tsconfig.json
│   ├── clients/
│   │   └── react/
│   │       ├── CHANGELOG.md
│   │       ├── package.json
│   │       ├── src/
│   │       │   ├── index.test.tsx
│   │       │   └── index.ts
│   │       ├── tsconfig.json
│   │       └── vitest.config.ts
│   ├── dev/
│   │   └── kitchen-sink/
│   │       ├── CHANGELOG.md
│   │       ├── package.json
│   │       ├── src/
│   │       │   ├── effect-errors.ts
│   │       │   ├── index.ts
│   │       │   ├── kitchen-sink.test.ts
│   │       │   ├── playground.ts
│   │       │   └── source-runtime.test.ts
│   │       ├── tsconfig.json
│   │       └── vitest.config.ts
│   ├── hosts/
│   │   ├── ai-sdk/
│   │   │   ├── CHANGELOG.md
│   │   │   ├── package.json
│   │   │   ├── src/
│   │   │   │   ├── ai.ts
│   │   │   │   ├── effect-errors.ts
│   │   │   │   ├── example-codemode-inproc.ts
│   │   │   │   ├── example-dynamic.ts
│   │   │   │   ├── example-static.ts
│   │   │   │   ├── example.ts
│   │   │   │   └── index.ts
│   │   │   └── tsconfig.json
│   │   └── mcp/
│   │       ├── CHANGELOG.md
│   │       ├── package.json
│   │       ├── src/
│   │       │   ├── index.ts
│   │       │   ├── paused-result.test.ts
│   │       │   └── paused-result.ts
│   │       └── tsconfig.json
│   ├── kernel/
│   │   ├── core/
│   │   │   ├── CHANGELOG.md
│   │   │   ├── package.json
│   │   │   ├── src/
│   │   │   │   ├── discovery.ts
│   │   │   │   ├── effect-errors.ts
│   │   │   │   ├── http-request-placements.ts
│   │   │   │   ├── index.test.ts
│   │   │   │   ├── index.ts
│   │   │   │   ├── isomorphic-hash.ts
│   │   │   │   ├── json-schema.ts
│   │   │   │   ├── schema-types.test.ts
│   │   │   │   ├── schema-types.ts
│   │   │   │   ├── system-tools.ts
│   │   │   │   ├── tool-map.ts
│   │   │   │   └── types.ts
│   │   │   ├── tsconfig.json
│   │   │   └── vitest.config.ts
│   │   ├── ir/
│   │   │   ├── README.md
│   │   │   ├── package.json
│   │   │   ├── src/
│   │   │   │   ├── catalog.test.ts
│   │   │   │   ├── catalog.ts
│   │   │   │   ├── ids.ts
│   │   │   │   ├── index.ts
│   │   │   │   └── model.ts
│   │   │   └── tsconfig.json
│   │   ├── runtime-deno-subprocess/
│   │   │   ├── CHANGELOG.md
│   │   │   ├── package.json
│   │   │   ├── src/
│   │   │   │   ├── deno-subprocess-worker.mjs
│   │   │   │   ├── deno-worker-process.ts
│   │   │   │   ├── index.test.ts
│   │   │   │   └── index.ts
│   │   │   ├── tsconfig.json
│   │   │   └── vitest.config.ts
│   │   ├── runtime-quickjs/
│   │   │   ├── CHANGELOG.md
│   │   │   ├── package.json
│   │   │   ├── src/
│   │   │   │   ├── index.test.ts
│   │   │   │   └── index.ts
│   │   │   └── tsconfig.json
│   │   └── runtime-ses/
│   │       ├── CHANGELOG.md
│   │       ├── package.json
│   │       ├── src/
│   │       │   ├── index.ts
│   │       │   └── sandbox-worker.mjs
│   │       └── tsconfig.json
│   ├── platform/
│   │   ├── control-plane/
│   │   │   ├── CHANGELOG.md
│   │   │   ├── package.json
│   │   │   ├── src/
│   │   │   │   ├── api/
│   │   │   │   │   ├── api.ts
│   │   │   │   │   ├── errors.ts
│   │   │   │   │   ├── executions/
│   │   │   │   │   │   ├── api.ts
│   │   │   │   │   │   └── http.ts
│   │   │   │   │   ├── http.ts
│   │   │   │   │   ├── index.ts
│   │   │   │   │   ├── local/
│   │   │   │   │   │   ├── api.ts
│   │   │   │   │   │   └── http.ts
│   │   │   │   │   ├── local-context.ts
│   │   │   │   │   ├── oauth/
│   │   │   │   │   │   ├── api.ts
│   │   │   │   │   │   └── http.ts
│   │   │   │   │   ├── payload-schemas.test.ts
│   │   │   │   │   ├── policies/
│   │   │   │   │   │   ├── api.ts
│   │   │   │   │   │   └── http.ts
│   │   │   │   │   ├── sources/
│   │   │   │   │   │   ├── api.ts
│   │   │   │   │   │   └── http.ts
│   │   │   │   │   └── string-schemas.ts
│   │   │   │   ├── client.ts
│   │   │   │   ├── index.ts
│   │   │   │   ├── runtime/
│   │   │   │   │   ├── __fixtures__/
│   │   │   │   │   │   ├── README.md
│   │   │   │   │   │   └── v1.2.3-google-calendar-workspace/
│   │   │   │   │   │       ├── .executor/
│   │   │   │   │   │       │   ├── artifacts/
│   │   │   │   │   │       │   │   └── sources/
│   │   │   │   │   │       │   │       ├── google-calendar/
│   │   │   │   │   │       │   │       │   └── documents/
│   │   │   │   │   │       │   │       │       └── doc_3c24a6731267de91.txt
│   │   │   │   │   │       │   │       └── google-calendar.json
│   │   │   │   │   │       │   ├── executor.jsonc
│   │   │   │   │   │       │   └── state/
│   │   │   │   │   │       │       └── workspace-state.json
│   │   │   │   │   │       └── fixture.json
│   │   │   │   │   ├── auth/
│   │   │   │   │   │   ├── auth-artifacts.ts
│   │   │   │   │   │   ├── auth-leases.ts
│   │   │   │   │   │   ├── mcp-auth-provider.ts
│   │   │   │   │   │   ├── mcp-oauth.ts
│   │   │   │   │   │   ├── oauth-loopback.test.ts
│   │   │   │   │   │   ├── oauth-loopback.ts
│   │   │   │   │   │   ├── oauth2-pkce.ts
│   │   │   │   │   │   ├── provider-grant-lifecycle.ts
│   │   │   │   │   │   ├── source-auth-material.test.ts
│   │   │   │   │   │   └── source-auth-material.ts
│   │   │   │   │   ├── catalog/
│   │   │   │   │   │   ├── catalog-typescript.ts
│   │   │   │   │   │   ├── prettier-format.ts
│   │   │   │   │   │   ├── schema-type-signature.ts
│   │   │   │   │   │   └── source/
│   │   │   │   │   │       ├── reconcile.ts
│   │   │   │   │   │       ├── runtime.test.ts
│   │   │   │   │   │       ├── runtime.ts
│   │   │   │   │   │       ├── snapshot.test.ts
│   │   │   │   │   │       ├── sync.ts
│   │   │   │   │   │       ├── type-declarations.test.ts
│   │   │   │   │   │       └── type-declarations.ts
│   │   │   │   │   ├── control-plane-runtime.test.ts
│   │   │   │   │   ├── effect-errors.ts
│   │   │   │   │   ├── execution/
│   │   │   │   │   │   ├── http.test.ts
│   │   │   │   │   │   ├── ir-execution.ts
│   │   │   │   │   │   ├── live.test.ts
│   │   │   │   │   │   ├── live.ts
│   │   │   │   │   │   ├── mcp-resume.test.ts
│   │   │   │   │   │   ├── runtime-config.test.ts
│   │   │   │   │   │   ├── runtime.ts
│   │   │   │   │   │   ├── service.ts
│   │   │   │   │   │   ├── state.ts
│   │   │   │   │   │   ├── test-http-client.ts
│   │   │   │   │   │   └── workspace/
│   │   │   │   │   │       ├── authorization.ts
│   │   │   │   │   │       ├── environment.ts
│   │   │   │   │   │       ├── local.ts
│   │   │   │   │   │       ├── source-catalog.ts
│   │   │   │   │   │       └── tool-invoker.ts
│   │   │   │   │   ├── fixtures/
│   │   │   │   │   │   ├── google-sheets-discovery.json
│   │   │   │   │   │   ├── linear-introspection.json
│   │   │   │   │   │   ├── neon-openapi.json
│   │   │   │   │   │   └── vercel-openapi.json
│   │   │   │   │   ├── index.ts
│   │   │   │   │   ├── local/
│   │   │   │   │   │   ├── capture-release-workspace-fixture.ts
│   │   │   │   │   │   ├── config-secrets.ts
│   │   │   │   │   │   ├── config.test.ts
│   │   │   │   │   │   ├── config.ts
│   │   │   │   │   │   ├── control-plane-store.test.ts
│   │   │   │   │   │   ├── control-plane-store.ts
│   │   │   │   │   │   ├── errors.ts
│   │   │   │   │   │   ├── installation.test.ts
│   │   │   │   │   │   ├── installation.ts
│   │   │   │   │   │   ├── operations.ts
│   │   │   │   │   │   ├── release-upgrade-fixtures.ts
│   │   │   │   │   │   ├── runtime-context.ts
│   │   │   │   │   │   ├── secret-material-providers.ts
│   │   │   │   │   │   ├── source-artifacts.test.ts
│   │   │   │   │   │   ├── source-artifacts.ts
│   │   │   │   │   │   ├── storage.ts
│   │   │   │   │   │   ├── tools.ts
│   │   │   │   │   │   ├── workspace-state.ts
│   │   │   │   │   │   └── workspace-sync.ts
│   │   │   │   │   ├── policy/
│   │   │   │   │   │   ├── invocation-policy-engine.test.ts
│   │   │   │   │   │   ├── invocation-policy-engine.ts
│   │   │   │   │   │   ├── operation-errors.ts
│   │   │   │   │   │   ├── operations-shared.ts
│   │   │   │   │   │   └── policies-operations.ts
│   │   │   │   │   ├── sources/
│   │   │   │   │   │   ├── catalog-sync-result.ts
│   │   │   │   │   │   ├── executor-tools.ts
│   │   │   │   │   │   ├── graphql-tools.test.ts
│   │   │   │   │   │   ├── graphql-tools.ts
│   │   │   │   │   │   ├── slug.ts
│   │   │   │   │   │   ├── source-adapter-fixture-matrix.test.ts
│   │   │   │   │   │   ├── source-adapters/
│   │   │   │   │   │   │   ├── google-discovery.test.ts
│   │   │   │   │   │   │   ├── google-discovery.ts
│   │   │   │   │   │   │   ├── graphql.test.ts
│   │   │   │   │   │   │   ├── graphql.ts
│   │   │   │   │   │   │   ├── index.ts
│   │   │   │   │   │   │   ├── internal.ts
│   │   │   │   │   │   │   ├── mcp.test.ts
│   │   │   │   │   │   │   ├── mcp.ts
│   │   │   │   │   │   │   ├── openapi.ts
│   │   │   │   │   │   │   ├── shared.ts
│   │   │   │   │   │   │   └── types.ts
│   │   │   │   │   │   ├── source-auth-service.ts
│   │   │   │   │   │   ├── source-credential-interactions.ts
│   │   │   │   │   │   ├── source-definitions.test.ts
│   │   │   │   │   │   ├── source-definitions.ts
│   │   │   │   │   │   ├── source-discovery.test.ts
│   │   │   │   │   │   ├── source-discovery.ts
│   │   │   │   │   │   ├── source-inspection.test.ts
│   │   │   │   │   │   ├── source-inspection.ts
│   │   │   │   │   │   ├── source-names.ts
│   │   │   │   │   │   ├── source-store/
│   │   │   │   │   │   │   ├── auth.ts
│   │   │   │   │   │   │   ├── config.ts
│   │   │   │   │   │   │   ├── deps.ts
│   │   │   │   │   │   │   ├── lifecycle.ts
│   │   │   │   │   │   │   └── records.ts
│   │   │   │   │   │   ├── source-store.test.ts
│   │   │   │   │   │   ├── source-store.ts
│   │   │   │   │   │   └── sources-operations.ts
│   │   │   │   │   └── store.ts
│   │   │   │   └── schema/
│   │   │   │       ├── common.ts
│   │   │   │       ├── enums.ts
│   │   │   │       ├── ids.ts
│   │   │   │       ├── index.ts
│   │   │   │       ├── models/
│   │   │   │       │   ├── auth/
│   │   │   │       │   │   ├── account.ts
│   │   │   │       │   │   ├── index.ts
│   │   │   │       │   │   └── principal.ts
│   │   │   │       │   ├── auth-artifact.ts
│   │   │   │       │   ├── auth-lease.ts
│   │   │   │       │   ├── code-migration.ts
│   │   │   │       │   ├── credential.ts
│   │   │   │       │   ├── execution.ts
│   │   │   │       │   ├── local-config.ts
│   │   │   │       │   ├── local-installation.ts
│   │   │   │       │   ├── policy.ts
│   │   │   │       │   ├── provider-auth-grant.ts
│   │   │   │       │   ├── secret-material.ts
│   │   │   │       │   ├── source-auth-session.ts
│   │   │   │       │   ├── source-catalog.ts
│   │   │   │       │   ├── source-discovery.ts
│   │   │   │       │   ├── source-inspection.ts
│   │   │   │       │   ├── source-oauth-client.ts
│   │   │   │       │   ├── source.ts
│   │   │   │       │   └── workspace-oauth-client.ts
│   │   │   │       └── schema.test.ts
│   │   │   ├── tsconfig.json
│   │   │   └── vitest.config.ts
│   │   └── server/
│   │       ├── CHANGELOG.md
│   │       ├── package.json
│   │       ├── src/
│   │       │   ├── config.ts
│   │       │   ├── effect-errors.ts
│   │       │   ├── env.test.ts
│   │       │   ├── env.ts
│   │       │   ├── index.ts
│   │       │   └── tracing.ts
│   │       └── tsconfig.json
│   └── sources/
│       ├── builtins/
│       │   ├── package.json
│       │   ├── src/
│       │   │   └── index.ts
│       │   └── tsconfig.json
│       ├── core/
│       │   ├── package.json
│       │   ├── src/
│       │   │   ├── catalog-fragment.ts
│       │   │   ├── catalog-json-schema.ts
│       │   │   ├── catalog-shared.ts
│       │   │   ├── catalog-sync-result.ts
│       │   │   ├── catalog-types.ts
│       │   │   ├── catalog.ts
│       │   │   ├── composition.ts
│       │   │   ├── discovery-models.ts
│       │   │   ├── discovery.ts
│       │   │   ├── effect-errors.ts
│       │   │   ├── index.ts
│       │   │   ├── registry.ts
│       │   │   ├── shared.ts
│       │   │   ├── source-models.ts
│       │   │   └── types.ts
│       │   └── tsconfig.json
│       ├── google-discovery/
│       │   ├── CHANGELOG.md
│       │   ├── package.json
│       │   ├── src/
│       │   │   ├── adapter.test.ts
│       │   │   ├── adapter.ts
│       │   │   ├── catalog.ts
│       │   │   ├── discovery.ts
│       │   │   ├── document.ts
│       │   │   ├── index.ts
│       │   │   ├── local-config.ts
│       │   │   ├── tools.test.ts
│       │   │   ├── tools.ts
│       │   │   └── types.ts
│       │   └── tsconfig.json
│       ├── graphql/
│       │   ├── package.json
│       │   ├── src/
│       │   │   ├── adapter.ts
│       │   │   ├── catalog.ts
│       │   │   ├── discovery.ts
│       │   │   ├── graphql-tools.ts
│       │   │   ├── index.ts
│       │   │   ├── local-config.ts
│       │   │   └── provider-data.ts
│       │   └── tsconfig.json
│       ├── mcp/
│       │   ├── CHANGELOG.md
│       │   ├── package.json
│       │   ├── src/
│       │   │   ├── adapter.ts
│       │   │   ├── catalog.ts
│       │   │   ├── connection-pool.ts
│       │   │   ├── connection.ts
│       │   │   ├── discovery.ts
│       │   │   ├── elicitation-bridge.ts
│       │   │   ├── elicitation-form.test.ts
│       │   │   ├── elicitation.url.test.ts
│       │   │   ├── index.ts
│       │   │   ├── local-config.ts
│       │   │   ├── manifest.ts
│       │   │   ├── tools.test.ts
│       │   │   └── tools.ts
│       │   ├── tsconfig.json
│       │   └── vitest.config.ts
│       └── openapi/
│           ├── CHANGELOG.md
│           ├── openapi-extractor-rs/
│           │   ├── .gitignore
│           │   ├── Cargo.toml
│           │   ├── build-wasm.sh
│           │   └── src/
│           │       ├── lib.rs
│           │       └── main.rs
│           ├── package.json
│           ├── src/
│           │   ├── adapter.ts
│           │   ├── catalog.ts
│           │   ├── definitions.ts
│           │   ├── discovery.ts
│           │   ├── document.test.ts
│           │   ├── document.ts
│           │   ├── extraction.real-specs.test.ts
│           │   ├── extraction.ts
│           │   ├── extractor-wasm.ts
│           │   ├── http-serialization.ts
│           │   ├── index.ts
│           │   ├── local-config.ts
│           │   ├── openapi-extractor-wasm/
│           │   │   ├── openapi_extractor.d.ts
│           │   │   ├── openapi_extractor.js
│           │   │   ├── openapi_extractor_bg.wasm
│           │   │   └── openapi_extractor_bg.wasm.d.ts
│           │   ├── real-spec-coverage.test.ts
│           │   ├── schema-refs.ts
│           │   ├── tool-presentation.test.ts
│           │   ├── tool-presentation.ts
│           │   ├── tools.test.ts
│           │   ├── tools.ts
│           │   └── types.ts
│           ├── tsconfig.json
│           └── vitest.config.ts
├── skills-lock.json
├── tools/
│   └── oxlint/
│       ├── README.md
│       ├── plugin.mjs
│       ├── rules/
│       │   ├── no-async-effect-vitest-tests.mjs
│       │   ├── no-cross-workspace-relative-imports.mjs
│       │   ├── no-direct-effect-tag-read.mjs
│       │   ├── no-effect-run-in-effect-vitest-tests.mjs
│       │   ├── no-node-fs-with-effect-imports.mjs
│       │   ├── no-raw-effect-fail-errors.mjs
│       │   ├── no-workspace-src-imports.mjs
│       │   └── no-yield-effect-fail.mjs
│       └── workspace-utils.mjs
└── turbo.json
Download .txt
SYMBOL INDEX (1167 symbols across 214 files)

FILE: apps/executor/src/cli/dev.ts
  type SeedDemoMcpSourceInput (line 10) | type SeedDemoMcpSourceInput = {
  type SeedDemoMcpSourceResult (line 18) | type SeedDemoMcpSourceResult =
  type SeedGithubOpenApiSourceInput (line 32) | type SeedGithubOpenApiSourceInput = {

FILE: apps/executor/src/cli/interaction-handling.ts
  type InteractionHandling (line 3) | type InteractionHandling =

FILE: apps/executor/src/cli/main.ts
  constant CLI_NAME (line 153) | const CLI_NAME = "executor";
  constant CLI_VERSION (line 154) | const CLI_VERSION = (() => {
  constant HELP_TOKENS (line 173) | const HELP_TOKENS = ["--help", "-h", "help"] as const;
  constant DEFAULT_RUN_WORKFLOW (line 211) | const DEFAULT_RUN_WORKFLOW = buildWorkflowText();
  type LocalServerPidRecord (line 449) | type LocalServerPidRecord = {
  type LocalServerStatus (line 536) | type LocalServerStatus = {
  type PromptField (line 712) | type PromptField = {

FILE: apps/executor/src/cli/pending-interaction-output.ts
  type ParsedInteractionPayload (line 6) | type ParsedInteractionPayload = {

FILE: apps/executor/src/distribution/artifact.ts
  type BuildDistributionPackageOptions (line 12) | type BuildDistributionPackageOptions = {
  type DistributionPackageArtifact (line 19) | type DistributionPackageArtifact = {
  type CommandInput (line 26) | type CommandInput = {

FILE: apps/executor/src/distribution/harness.ts
  type CommandResult (line 18) | type CommandResult = {
  class DistributionHarness (line 24) | class DistributionHarness extends Context.Tag(

FILE: apps/executor/src/distribution/metadata.ts
  type DistributionPackageMetadata (line 8) | type DistributionPackageMetadata = {

FILE: apps/executor/src/distribution/publish.ts
  type PublishCliOptions (line 12) | type PublishCliOptions = {
  type CommandInput (line 16) | type CommandInput = {
  type CommandOutput (line 22) | type CommandOutput = {
  type PackResult (line 27) | type PackResult = {

FILE: apps/executor/src/effect-errors.ts
  class ExecutorAppEffectError (line 3) | class ExecutorAppEffectError extends Data.TaggedError(
  class LocalServerReachabilityTimeoutError (line 15) | class LocalServerReachabilityTimeoutError extends Data.TaggedError(

FILE: apps/executor/src/server/server.real-ingestion.test.ts
  constant REAL_VERCEL_SPEC_URL (line 12) | const REAL_VERCEL_SPEC_URL = "https://openapi.vercel.sh";
  constant REAL_VERCEL_API_ENDPOINT (line 13) | const REAL_VERCEL_API_ENDPOINT = "https://api.vercel.com";
  constant REAL_LINEAR_GRAPHQL_ENDPOINT (line 14) | const REAL_LINEAR_GRAPHQL_ENDPOINT = "https://api.linear.app/graphql";
  constant REAL_DEEPWIKI_MCP_ENDPOINT (line 15) | const REAL_DEEPWIKI_MCP_ENDPOINT = "https://mcp.deepwiki.com/mcp";

FILE: apps/executor/src/server/server.test.ts
  type ExecutorMcpClient (line 246) | type ExecutorMcpClient = {
  type ElicitationHandler (line 251) | type ElicitationHandler = NonNullable<Parameters<Client["setRequestHandl...
  class ExecutorDemoReposApi (line 284) | class ExecutorDemoReposApi extends HttpApiGroup.make("repos")
  class ExecutorDemoApi (line 296) | class ExecutorDemoApi extends HttpApi.make("executorDemo").add(ExecutorD...
  constant DEMO_OAUTH_ACCESS_TOKEN (line 445) | const DEMO_OAUTH_ACCESS_TOKEN = "demo-access-token";
  constant DEMO_OAUTH_REFRESH_TOKEN (line 446) | const DEMO_OAUTH_REFRESH_TOKEN = "demo-refresh-token";

FILE: apps/web/src/components/code-block.tsx
  function cacheKey (line 9) | function cacheKey(code: string, lang: string) {
  function detectLanguage (line 13) | function detectLanguage(code: string, hint?: string): string {
  function CodeBlock (line 22) | function CodeBlock(props: {

FILE: apps/web/src/components/document-panel.tsx
  function DocumentPanel (line 4) | function DocumentPanel(props: {

FILE: apps/web/src/components/icons.tsx
  type IconProps (line 4) | type IconProps = SVGProps<SVGSVGElement> & { className?: string };
  function IconSources (line 6) | function IconSources({ className, ...props }: IconProps) {
  function IconTool (line 17) | function IconTool({ className, ...props }: IconProps) {
  function IconSearch (line 25) | function IconSearch({ className, ...props }: IconProps) {
  function IconChevron (line 34) | function IconChevron({ className, ...props }: IconProps) {
  function IconFolder (line 42) | function IconFolder({ className, ...props }: IconProps) {
  function IconDocument (line 50) | function IconDocument({ className, ...props }: IconProps) {
  function IconDiscover (line 59) | function IconDiscover({ className, ...props }: IconProps) {
  function IconCopy (line 68) | function IconCopy({ className, ...props }: IconProps) {
  function IconCheck (line 77) | function IconCheck({ className, ...props }: IconProps) {
  function IconClose (line 85) | function IconClose({ className, ...props }: IconProps) {
  function IconEmpty (line 93) | function IconEmpty({ className, ...props }: IconProps) {
  function IconSpinner (line 102) | function IconSpinner({ className, ...props }: IconProps) {
  function IconInfo (line 111) | function IconInfo({ className, ...props }: IconProps) {
  function IconPlus (line 121) | function IconPlus({ className, ...props }: IconProps) {
  function IconPencil (line 129) | function IconPencil({ className, ...props }: IconProps) {
  function IconTrash (line 138) | function IconTrash({ className, ...props }: IconProps) {
  function IconArrowLeft (line 146) | function IconArrowLeft({ className, ...props }: IconProps) {

FILE: apps/web/src/components/loadable.tsx
  function LoadableBlock (line 5) | function LoadableBlock<T>(props: {
  function EmptyState (line 34) | function EmptyState(props: {

FILE: apps/web/src/components/local-mcp-install-card.tsx
  function LocalMcpInstallCard (line 4) | function LocalMcpInstallCard(props: {

FILE: apps/web/src/components/markdown.tsx
  constant PROSE_CLASSES (line 6) | const PROSE_CLASSES = [
  function Markdown (line 43) | function Markdown(props: { children: string; className?: string }) {

FILE: apps/web/src/components/shell.tsx
  type AppMetaEnv (line 19) | type AppMetaEnv = {
  type UpdateChannel (line 28) | type UpdateChannel = "latest" | "beta";
  type ParsedVersion (line 30) | type ParsedVersion = {
  function useLatestVersion (line 136) | function useLatestVersion(currentVersion: string) {
  function UpdateCard (line 163) | function UpdateCard(props: { latestVersion: string; channel: UpdateChann...
  function AppShell (line 211) | function AppShell() {
  function SourceItem (line 299) | function SourceItem(props: {
  function NavItem (line 336) | function NavItem(props: { to: string; label: string; active: boolean }) {

FILE: apps/web/src/components/source-favicon.tsx
  type SourceKind (line 6) | type SourceKind = Source["kind"] | string;
  function SourceFavicon (line 8) | function SourceFavicon({
  function DefaultSourceIcon (line 49) | function DefaultSourceIcon({

FILE: apps/web/src/components/source-not-found-state.tsx
  function SourceNotFoundState (line 6) | function SourceNotFoundState() {

FILE: apps/web/src/components/source-recovery-state.tsx
  function SourceRecoveryState (line 8) | function SourceRecoveryState(props: {

FILE: apps/web/src/components/ui/badge.tsx
  type BadgeProps (line 27) | type BadgeProps = HTMLAttributes<HTMLSpanElement> & VariantProps<typeof ...
  function Badge (line 29) | function Badge({ className, variant, ...props }: BadgeProps) {
  function MethodBadge (line 33) | function MethodBadge({ method }: { method: string }) {

FILE: apps/web/src/components/ui/button.tsx
  type ButtonProps (line 30) | type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & VariantProp...
  function Button (line 32) | function Button({ className, variant, size, ...props }: ButtonProps) {

FILE: apps/web/src/dev.ts
  constant MAX_LOGGED_ERROR_BODY_LENGTH (line 19) | const MAX_LOGGED_ERROR_BODY_LENGTH = 4_000;
  constant EXECUTOR_WEB_DEV_LOCAL_DATA_DIR_ENV (line 20) | const EXECUTOR_WEB_DEV_LOCAL_DATA_DIR_ENV = "EXECUTOR_WEB_DEV_LOCAL_DATA...
  constant DEFAULT_WEB_DEV_LOCAL_DATA_DIR (line 21) | const DEFAULT_WEB_DEV_LOCAL_DATA_DIR = join(
  method fetch (line 89) | async fetch(request: Request) {

FILE: apps/web/src/frontend.tsx
  class BrowserBuffer (line 3) | class BrowserBuffer extends Uint8Array {}

FILE: apps/web/src/lib/schema-display.ts
  type JsonRecord (line 1) | type JsonRecord = Record<string, unknown>;

FILE: apps/web/src/lib/shiki.ts
  constant SUPPORTED_LANGS (line 16) | const SUPPORTED_LANGS = [
  type SupportedLang (line 50) | type SupportedLang = (typeof SUPPORTED_LANGS)[number];
  constant LANG_ALIASES (line 52) | const LANG_ALIASES: Record<string, SupportedLang> = {
  constant LANG_LOADERS (line 71) | const LANG_LOADERS: Record<SupportedLang, () => LanguageInput> = {
  function resolveLang (line 110) | function resolveLang(lang: string): SupportedLang | null {
  function isSupportedLang (line 117) | function isSupportedLang(lang: string): boolean {
  function getHighlighter (line 128) | async function getHighlighter(): Promise<HighlighterCore> {
  function codeToHtml (line 150) | async function codeToHtml(
  constant THEME (line 164) | const THEME = "vitesse-dark" as ThemeInput;
  function createLimitedCodePlugin (line 174) | function createLimitedCodePlugin(): CodeHighlighterPlugin {

FILE: apps/web/src/lib/source-favicon.ts
  constant RAW_HOSTS (line 3) | const RAW_HOSTS = new Set([
  constant GOOGLE_SERVICE_ICONS (line 14) | const GOOGLE_SERVICE_ICONS: Record<string, string> = {

FILE: apps/web/src/lib/utils.ts
  function cn (line 4) | function cn(...inputs: ReadonlyArray<ClassValue>): string {

FILE: apps/web/src/main.tsx
  type SourceRouteSearch (line 24) | type SourceRouteSearch = {
  function SourceDetailPageWrapper (line 85) | function SourceDetailPageWrapper() {
  function EditSourcePageWrapper (line 99) | function EditSourcePageWrapper() {
  type Register (line 116) | interface Register {
  function App (line 125) | function App() {

FILE: apps/web/src/views/add-source.tsx
  type FlowPhase (line 61) | type FlowPhase =
  type ProbeAuthKind (line 70) | type ProbeAuthKind = "none" | "bearer" | "basic" | "headers";
  type ProbeAuthState (line 72) | type ProbeAuthState = {
  type ConnectFormBase (line 82) | type ConnectFormBase = {
  type ConnectFormState (line 102) | type ConnectFormState = ConnectFormBase & McpTransportFields;
  type OAuthRequiredInfo (line 104) | type OAuthRequiredInfo = {
  type BatchOAuthRequiredInfo (line 110) | type BatchOAuthRequiredInfo = {
  constant SOURCE_OAUTH_POPUP_RESULT_TIMEOUT_MS (line 147) | const SOURCE_OAUTH_POPUP_RESULT_TIMEOUT_MS = 2 * 60_000;
  constant SOURCE_OAUTH_POPUP_RESULT_STORAGE_KEY_PREFIX (line 148) | const SOURCE_OAUTH_POPUP_RESULT_STORAGE_KEY_PREFIX = "executor:oauth-res...
  type SourceOAuthPopupMessage (line 569) | type SourceOAuthPopupMessage =
  function AddSourcePage (line 728) | function AddSourcePage() {
  function Section (line 2158) | function Section(props: {
  function Field (line 2178) | function Field(props: {
  function TextInput (line 2193) | function TextInput(props: {
  function SelectInput (line 2214) | function SelectInput(props: {
  function CodeEditor (line 2234) | function CodeEditor(props: {
  function StatusBanner (line 2250) | function StatusBanner(props: {
  constant CREATE_NEW_VALUE (line 2311) | const CREATE_NEW_VALUE = "__create_new__";
  constant INLINE_TOKEN_VALUE (line 2312) | const INLINE_TOKEN_VALUE = "__inline_token__";
  function SecretOrTokenInput (line 2314) | function SecretOrTokenInput(props: {

FILE: apps/web/src/views/home.tsx
  function HomePage (line 10) | function HomePage() {
  function SourceCard (line 71) | function SourceCard({ source }: { source: Source }) {

FILE: apps/web/src/views/mcp-transport-state.ts
  type McpRemoteTransportValue (line 1) | type McpRemoteTransportValue = "" | "auto" | "streamable-http" | "sse";
  type McpTransportValue (line 3) | type McpTransportValue = McpRemoteTransportValue | "stdio";
  type McpRemoteTransportFields (line 5) | type McpRemoteTransportFields = {
  type McpStdioTransportFields (line 11) | type McpStdioTransportFields = {
  type McpTransportFields (line 19) | type McpTransportFields =

FILE: apps/web/src/views/secrets.tsx
  function SecretsPage (line 33) | function SecretsPage() {
  function EmptyState (line 113) | function EmptyState(props: { onAdd: () => void }) {
  function CreateSecretForm (line 137) | function CreateSecretForm(props: {
  function SecretRow (line 252) | function SecretRow(props: {
  function EditSecretForm (line 371) | function EditSecretForm(props: { secret: SecretListItem; onClose: () => ...
  function FieldLabel (line 456) | function FieldLabel(props: { label: string; children: ReactNode }) {
  function KeyIcon (line 465) | function KeyIcon(props: { className?: string }) {

FILE: apps/web/src/views/source-detail.tsx
  type SourceRouteSearch (line 41) | type SourceRouteSearch = {
  type SourceDetailPageState (line 65) | type SourceDetailPageState =
  function SourceDetailPage (line 203) | function SourceDetailPage(props: {
  function ModelView (line 416) | function ModelView(props: {
  type ToolTreeNode (line 530) | type ToolTreeNode = {
  function buildToolTree (line 536) | function buildToolTree(tools: SourceInspection["tools"]): ToolTreeNode {
  function ToolTree (line 552) | function ToolTree(props: {
  function ToolTreeNodeView (line 581) | function ToolTreeNodeView(props: {
  function countToolLeaves (line 709) | function countToolLeaves(node: ToolTreeNode): number {
  function ToolListItem (line 721) | function ToolListItem(props: {
  function ToolDetailPanel (line 769) | function ToolDetailPanel(props: { detail: SourceInspectionToolDetail }) {
  function DiscoveryView (line 945) | function DiscoveryView(props: {
  function CopyButton (line 1062) | function CopyButton(props: {
  function highlightMatch (line 1080) | function highlightMatch(text: string, search: string) {

FILE: apps/web/src/views/source-editor.tsx
  type StatusBannerState (line 51) | type StatusBannerState = {
  type SourceOAuthPopupMessage (line 56) | type SourceOAuthPopupMessage =
  constant SOURCE_OAUTH_POPUP_RESULT_TIMEOUT_MS (line 70) | const SOURCE_OAUTH_POPUP_RESULT_TIMEOUT_MS = 2 * 60_000;
  constant SOURCE_OAUTH_POPUP_RESULT_STORAGE_KEY_PREFIX (line 71) | const SOURCE_OAUTH_POPUP_RESULT_STORAGE_KEY_PREFIX = "executor:oauth-res...
  type SourceFormBase (line 77) | type SourceFormBase = {
  type SourceFormState (line 102) | type SourceFormState = SourceFormBase & McpTransportFields;
  function NewSourcePage (line 722) | function NewSourcePage() {
  function EditSourcePage (line 726) | function EditSourcePage(props: { sourceId: string }) {
  function SourceEditor (line 751) | function SourceEditor(props: { mode: "create" | "edit"; source?: Source ...
  function Section (line 1581) | function Section(props: {
  function Field (line 1601) | function Field(props: {
  function TextInput (line 1616) | function TextInput(props: {
  function SelectInput (line 1635) | function SelectInput(props: {
  function CodeEditor (line 1657) | function CodeEditor(props: {
  function ToggleButton (line 1673) | function ToggleButton(props: {
  function StatusBanner (line 1699) | function StatusBanner(props: { state: StatusBannerState; className?: str...
  constant CREATE_NEW_VALUE (line 1718) | const CREATE_NEW_VALUE = "__create_new__";
  function SecretPicker (line 1720) | function SecretPicker(props: {

FILE: apps/web/src/views/source-templates.ts
  type SourceTemplateBase (line 1) | type SourceTemplateBase = {
  type McpSourceTemplate (line 12) | type McpSourceTemplate = SourceTemplateBase & {
  type OpenApiSourceTemplate (line 22) | type OpenApiSourceTemplate = SourceTemplateBase & {
  type GoogleDiscoverySourceTemplate (line 27) | type GoogleDiscoverySourceTemplate = SourceTemplateBase & {
  type GraphqlSourceTemplate (line 34) | type GraphqlSourceTemplate = SourceTemplateBase & {
  type SourceTemplate (line 38) | type SourceTemplate =

FILE: apps/web/vite.config.ts
  type ExecutorPackageMetadata (line 7) | type ExecutorPackageMetadata = {

FILE: examples/mcp-elicitation-demo/src/server.ts
  type McpElicitationDemoServer (line 8) | type McpElicitationDemoServer = {

FILE: examples/serve-skills-via-mcp/src/catalog.ts
  type SkillFrontmatter (line 5) | type SkillFrontmatter = {
  type DistributedSkillFile (line 13) | type DistributedSkillFile = {
  type SkillManifest (line 21) | type SkillManifest = {
  type DistributedSkillBundle (line 32) | type DistributedSkillBundle = {

FILE: examples/serve-skills-via-mcp/src/server.ts
  type ServeSkillsViaMcpDemoServer (line 19) | type ServeSkillsViaMcpDemoServer = {

FILE: packages/auth/mcp-oauth/src/effect-errors.ts
  class McpOAuthEffectError (line 3) | class McpOAuthEffectError extends Data.TaggedError(

FILE: packages/auth/mcp-oauth/src/index.ts
  type JsonValue (line 13) | type JsonValue =
  type JsonObject (line 21) | type JsonObject = {
  type McpOAuthStartResult (line 41) | type McpOAuthStartResult = {
  type McpOAuthSession (line 51) | type McpOAuthSession = {
  type McpOAuthExchangeResult (line 62) | type McpOAuthExchangeResult = {
  method redirectUrl (line 85) | get redirectUrl() {
  method clientMetadata (line 88) | get clientMetadata() {
  method redirectUrl (line 164) | get redirectUrl() {
  method clientMetadata (line 167) | get clientMetadata() {

FILE: packages/auth/oauth2/src/index.ts
  type OAuth2TokenResponse (line 5) | type OAuth2TokenResponse = {
  type OAuth2ClientAuthenticationMethod (line 13) | type OAuth2ClientAuthenticationMethod =

FILE: packages/clients/react/src/index.test.tsx
  type DelayRule (line 58) | type DelayRule = {
  type RunningServer (line 64) | type RunningServer = {
  type ApiServer (line 69) | type ApiServer = RunningServer & {
  type HookHarness (line 73) | type HookHarness<T> = {
  type CreateHarnessState (line 78) | type CreateHarnessState = {
  type SourceHarnessState (line 83) | type SourceHarnessState = {
  type OpenApiSpecServer (line 214) | type OpenApiSpecServer = RunningServer & {
  function requestJson (line 297) | async function requestJson<T>(input: {
  function renderExecutorHarness (line 389) | async function renderExecutorHarness<T>(useValue: () => T): Promise<Hook...
  function waitForValue (line 441) | async function waitForValue<T>(
  function isReady (line 462) | function isReady<T>(
  function getReadyData (line 468) | function getReadyData<T>(loadable: Loadable<T>): T {

FILE: packages/clients/react/src/index.ts
  constant DEFAULT_EXECUTOR_API_BASE_URL (line 40) | const DEFAULT_EXECUTOR_API_BASE_URL = "http://127.0.0.1:8788";
  constant PLACEHOLDER_WORKSPACE_ID (line 41) | const PLACEHOLDER_WORKSPACE_ID = "ws_placeholder" as Source["workspaceId"];
  constant PLACEHOLDER_ACCOUNT_ID (line 42) | const PLACEHOLDER_ACCOUNT_ID = "acc_placeholder";
  constant PLACEHOLDER_SOURCE_ID (line 43) | const PLACEHOLDER_SOURCE_ID = "src_placeholder" as Source["id"];
  type SourceMutationState (line 45) | type SourceMutationState<T> = {
  type SourceRemoveResult (line 51) | type SourceRemoveResult = {
  type AtomKeyPart (line 55) | type AtomKeyPart = string | number | boolean | null | undefined;
  type SourcesKeyParts (line 57) | type SourcesKeyParts = readonly [boolean, Source["workspaceId"], string];
  type SourceKeyParts (line 58) | type SourceKeyParts = readonly [boolean, Source["workspaceId"], string, ...
  type SourceToolDetailKeyParts (line 59) | type SourceToolDetailKeyParts = readonly [
  type SourceDiscoveryKeyParts (line 66) | type SourceDiscoveryKeyParts = readonly [
  type WorkspaceOauthClientsKeyParts (line 74) | type WorkspaceOauthClientsKeyParts = readonly [
  type InvalidationTarget (line 81) | type InvalidationTarget = {
  type ActiveQueryCollections (line 87) | type ActiveQueryCollections = {
  type ExecutorQueryContextValue (line 96) | type ExecutorQueryContextValue = {
  type MutationExecutionContext (line 102) | type MutationExecutionContext = {
  type OptimisticMutationResult (line 109) | type OptimisticMutationResult<T> =
  type MutationOptions (line 117) | type MutationOptions<TInput, TOutput, TOptimistic = never> = {
  type InternalNode (line 130) | type InternalNode<A> = {
  type Loadable (line 422) | type Loadable<T> =
  type WorkspaceContext (line 427) | type WorkspaceContext = {
  type SecretMutationState (line 842) | type SecretMutationState<T> = {

FILE: packages/dev/kitchen-sink/src/effect-errors.ts
  class KitchenSinkEffectError (line 3) | class KitchenSinkEffectError extends Data.TaggedError(

FILE: packages/dev/kitchen-sink/src/source-runtime.test.ts
  type StoredToolArtifactRecord (line 61) | type StoredToolArtifactRecord = {
  type SourceCallContext (line 98) | type SourceCallContext = {
  type SecretMaterialProvider (line 107) | interface SecretMaterialProvider {
  type SecretMaterialRegistry (line 114) | interface SecretMaterialRegistry {
  type ProviderInvoker (line 120) | interface ProviderInvoker {
  type WorkspaceScopedSourceStore (line 130) | type WorkspaceScopedSourceStore = {
  type WorkspaceScopedToolStore (line 140) | type WorkspaceScopedToolStore = {
  method registerSource (line 181) | async registerSource({ workspaceId, source }) {
  method getById (line 184) | async getById({ sourceId }) {
  method indexArtifacts (line 211) | async indexArtifacts({ workspaceId, artifacts }) {
  method listNamespaces (line 217) | async listNamespaces({ workspaceId, limit = 200 }) {
  method list (line 234) | async list({ workspaceId, namespace, query, limit = 200 }) {
  method getByPath (line 242) | async getByPath({ workspaceId, path }) {
  method get (line 256) | async get({ handle }) {
  method get (line 272) | async get({ ref }) {
  method invoke (line 321) | async invoke({ source, artifact, args, runtime, context }) {
  class GeneratedReposApi (line 607) | class GeneratedReposApi extends HttpApiGroup.make("repos")
  class GeneratedApi (line 613) | class GeneratedApi extends HttpApi.make("generated").add(GeneratedReposA...
  type OpenApiTestServer (line 617) | type OpenApiTestServer = {

FILE: packages/hosts/ai-sdk/src/effect-errors.ts
  class AiSdkEffectError (line 3) | class AiSdkEffectError extends Data.TaggedError(

FILE: packages/hosts/ai-sdk/src/example-dynamic.ts
  method listNamespaces (line 12) | listNamespaces({ limit }) {
  method listTools (line 18) | listTools({ namespace }) {
  method getToolByPath (line 29) | getToolByPath({ path }) {
  method searchTools (line 38) | searchTools({ limit }) {

FILE: packages/hosts/ai-sdk/src/index.ts
  type AiSdkToolMap (line 17) | type AiSdkToolMap = ToolSet;
  type CodeToolInput (line 23) | type CodeToolInput = z.infer<typeof CodeToolInputSchema>;
  function createToolsFromAiSdkTools (line 25) | function createToolsFromAiSdkTools(input: {
  function createCodeTool (line 35) | function createCodeTool(input: {

FILE: packages/hosts/mcp/src/index.ts
  type ResumePayload (line 41) | type ResumePayload = {
  type ResumeResponseInput (line 45) | type ResumeResponseInput = {
  type ExecutorMcpToolResult (line 50) | type ExecutorMcpToolResult = {
  type ExecutorMcpRequestHandler (line 56) | type ExecutorMcpRequestHandler = {
  type CatalogLike (line 123) | type CatalogLike = {

FILE: packages/hosts/mcp/src/paused-result.ts
  type ParsedInteractionPayload (line 6) | type ParsedInteractionPayload = {

FILE: packages/kernel/core/src/discovery.ts
  function createToolCatalogFromTools (line 176) | function createToolCatalogFromTools(input: {
  function createToolCatalogFromEntries (line 192) | function createToolCatalogFromEntries(input: {
  function mergeToolCatalogs (line 264) | function mergeToolCatalogs(input: {
  function createStaticDiscoveryFromTools (line 328) | function createStaticDiscoveryFromTools(input: {
  function createToolCatalogDiscovery (line 346) | function createToolCatalogDiscovery(input: {
  function createDiscoveryPrimitivesFromToolCatalog (line 364) | function createDiscoveryPrimitivesFromToolCatalog(input: {
  function buildStaticExecuteDescription (line 455) | function buildStaticExecuteDescription(input: {
  function buildDynamicExecuteDescription (line 466) | function buildDynamicExecuteDescription(input: {

FILE: packages/kernel/core/src/effect-errors.ts
  class KernelCoreEffectError (line 3) | class KernelCoreEffectError extends Data.TaggedError(

FILE: packages/kernel/core/src/http-request-placements.ts
  type HttpRequestPlacements (line 1) | type HttpRequestPlacements = {

FILE: packages/kernel/core/src/schema-types.ts
  type JsonSchemaRecord (line 1) | type JsonSchemaRecord = Record<string, unknown>;
  type TypeSignatureRenderOptions (line 3) | type TypeSignatureRenderOptions = {
  constant VALID_IDENTIFIER_PATTERN (line 24) | const VALID_IDENTIFIER_PATTERN = /^[A-Za-z_$][A-Za-z0-9_$]*$/;

FILE: packages/kernel/core/src/system-tools.ts
  type CreateSystemToolMapInput (line 77) | type CreateSystemToolMapInput = {
  type MergeToolMapsOptions (line 202) | type MergeToolMapsOptions = {

FILE: packages/kernel/core/src/tool-map.ts
  type ResolvedTool (line 27) | type ResolvedTool = {
  class ToolInteractionPendingError (line 152) | class ToolInteractionPendingError extends Data.TaggedError(
  class ToolInteractionDeniedError (line 160) | class ToolInteractionDeniedError extends Data.TaggedError(
  function wrapTool (line 324) | function wrapTool(input: {
  function createToolsFromRecord (line 366) | function createToolsFromRecord(input: {
  function toolDescriptorsFromTools (line 410) | function toolDescriptorsFromTools(input: {

FILE: packages/kernel/core/src/types.ts
  type ToolPath (line 5) | type ToolPath = string & { readonly __toolPath: unique symbol };
  type StandardSchema (line 7) | type StandardSchema<Input = unknown, Output = unknown> =
  type ElicitationFormRequest (line 10) | type ElicitationFormRequest = {
  type ElicitationUrlRequest (line 16) | type ElicitationUrlRequest = {
  type ElicitationRequest (line 23) | type ElicitationRequest =
  type ElicitationAction (line 27) | type ElicitationAction = "accept" | "decline" | "cancel";
  type ElicitationResponse (line 29) | type ElicitationResponse = {
  type ToolInvocationContext (line 34) | type ToolInvocationContext = {
  type ToolInteractionRequest (line 42) | type ToolInteractionRequest = {
  type ToolInteractionDecision (line 51) | type ToolInteractionDecision =
  type ToolElicitationRequest (line 60) | type ToolElicitationRequest = {
  type OnToolInteraction (line 70) | type OnToolInteraction = (
  type OnElicitation (line 74) | type OnElicitation = (
  type ToolContract (line 78) | type ToolContract = {
  type ToolMetadata (line 96) | type ToolMetadata = {
  type ToolExecutionContext (line 105) | type ToolExecutionContext = {
  type ExecutableTool (line 113) | type ExecutableTool = {
  type ToolDefinition (line 132) | type ToolDefinition = {
  type ToolInput (line 137) | type ToolInput = ExecutableTool | ToolDefinition;
  type ToolMap (line 139) | type ToolMap = Record<string, ToolInput>;
  type ToolDescriptor (line 141) | type ToolDescriptor = {
  type ToolNamespace (line 165) | type ToolNamespace = {
  type SearchHit (line 177) | type SearchHit = {
  type ToolCatalogEntry (line 182) | type ToolCatalogEntry = {
  type ToolCatalog (line 189) | interface ToolCatalog {
  type CatalogPrimitive (line 213) | type CatalogPrimitive = {
  type DescribePrimitive (line 229) | type DescribePrimitive = {
  type DiscoverPrimitive (line 236) | type DiscoverPrimitive = (input: {
  type DiscoveryPrimitives (line 253) | type DiscoveryPrimitives = {
  type ExecuteResult (line 259) | type ExecuteResult = {
  type ToolInvocationInput (line 265) | type ToolInvocationInput = {
  type ToolInvoker (line 271) | interface ToolInvoker {
  type CodeExecutor (line 275) | interface CodeExecutor {
  type CodeToolOutput (line 282) | type CodeToolOutput = {

FILE: packages/kernel/ir/src/catalog.ts
  type ToolDescriptor (line 40) | interface ToolDescriptor {
  type ToolSearchDoc (line 59) | interface ToolSearchDoc {
  type CapabilitySummaryView (line 70) | interface CapabilitySummaryView {
  type SymbolShallowView (line 83) | interface SymbolShallowView {
  type SymbolExpandedView (line 91) | interface SymbolExpandedView {
  type ProjectedCatalog (line 97) | interface ProjectedCatalog {
  type CatalogInvariantViolation (line 104) | interface CatalogInvariantViolation {
  type DecodeCatalogError (line 124) | type DecodeCatalogError = Error;
  type CatalogSnapshotV1 (line 126) | type CatalogSnapshotV1 = {
  type RankedResponseVariantEntry (line 449) | type RankedResponseVariantEntry = {

FILE: packages/kernel/ir/src/ids.ts
  type DocumentId (line 25) | type DocumentId = typeof DocumentIdSchema.Type;
  type ResourceId (line 26) | type ResourceId = typeof ResourceIdSchema.Type;
  type ScopeId (line 27) | type ScopeId = typeof ScopeIdSchema.Type;
  type CapabilityId (line 28) | type CapabilityId = typeof CapabilityIdSchema.Type;
  type ExecutableId (line 29) | type ExecutableId = typeof ExecutableIdSchema.Type;
  type ResponseSetId (line 30) | type ResponseSetId = typeof ResponseSetIdSchema.Type;
  type DiagnosticId (line 31) | type DiagnosticId = typeof DiagnosticIdSchema.Type;
  type ShapeSymbolId (line 33) | type ShapeSymbolId = typeof ShapeSymbolIdSchema.Type;
  type ParameterSymbolId (line 34) | type ParameterSymbolId = typeof ParameterSymbolIdSchema.Type;
  type RequestBodySymbolId (line 35) | type RequestBodySymbolId = typeof RequestBodySymbolIdSchema.Type;
  type ResponseSymbolId (line 36) | type ResponseSymbolId = typeof ResponseSymbolIdSchema.Type;
  type HeaderSymbolId (line 37) | type HeaderSymbolId = typeof HeaderSymbolIdSchema.Type;
  type ExampleSymbolId (line 38) | type ExampleSymbolId = typeof ExampleSymbolIdSchema.Type;
  type SecuritySchemeSymbolId (line 39) | type SecuritySchemeSymbolId = typeof SecuritySchemeSymbolIdSchema.Type;
  type SymbolId (line 41) | type SymbolId =

FILE: packages/kernel/ir/src/model.ts
  type AuthRequirement (line 551) | type AuthRequirement =
  type SourceKind (line 846) | type SourceKind = typeof SourceKindSchema.Type;
  type ScopeKind (line 847) | type ScopeKind = typeof ScopeKindSchema.Type;
  type EffectKind (line 848) | type EffectKind = typeof EffectKindSchema.Type;
  type ParameterLocation (line 849) | type ParameterLocation = typeof ParameterLocationSchema.Type;
  type ResponseTrait (line 850) | type ResponseTrait = typeof ResponseTraitSchema.Type;
  type SecuritySchemeType (line 851) | type SecuritySchemeType = typeof SecuritySchemeTypeSchema.Type;
  type PaginationHintKind (line 852) | type PaginationHintKind = typeof PaginationHintKindSchema.Type;
  type DiagnosticCode (line 853) | type DiagnosticCode = typeof DiagnosticCodeSchema.Type;
  type DiagnosticLevel (line 854) | type DiagnosticLevel = typeof DiagnosticLevelSchema.Type;
  type DocumentationBlock (line 856) | type DocumentationBlock = typeof DocumentationBlockSchema.Type;
  type ProvenanceRef (line 857) | type ProvenanceRef = typeof ProvenanceRefSchema.Type;
  type NativeBlob (line 858) | type NativeBlob = typeof NativeBlobSchema.Type;
  type EntityBase (line 859) | type EntityBase = typeof EntityBaseSchema.Type;
  type ImportMetadata (line 860) | type ImportMetadata = typeof ImportMetadataSchema.Type;
  type SourceDocument (line 861) | type SourceDocument = typeof SourceDocumentSchema.Type;
  type FieldSpec (line 862) | type FieldSpec = typeof FieldSpecSchema.Type;
  type DiscriminatorSpec (line 863) | type DiscriminatorSpec = typeof DiscriminatorSpecSchema.Type;
  type ScalarShape (line 864) | type ScalarShape = typeof ScalarShapeSchema.Type;
  type UnknownShape (line 865) | type UnknownShape = typeof UnknownShapeSchema.Type;
  type ConstShape (line 866) | type ConstShape = typeof ConstShapeSchema.Type;
  type EnumShape (line 867) | type EnumShape = typeof EnumShapeSchema.Type;
  type ObjectShape (line 868) | type ObjectShape = typeof ObjectShapeSchema.Type;
  type ArrayShape (line 869) | type ArrayShape = typeof ArrayShapeSchema.Type;
  type TupleShape (line 870) | type TupleShape = typeof TupleShapeSchema.Type;
  type MapShape (line 871) | type MapShape = typeof MapShapeSchema.Type;
  type AllOfShape (line 872) | type AllOfShape = typeof AllOfShapeSchema.Type;
  type AnyOfShape (line 873) | type AnyOfShape = typeof AnyOfShapeSchema.Type;
  type OneOfShape (line 874) | type OneOfShape = typeof OneOfShapeSchema.Type;
  type NullableShape (line 875) | type NullableShape = typeof NullableShapeSchema.Type;
  type RefShape (line 876) | type RefShape = typeof RefShapeSchema.Type;
  type NotShape (line 877) | type NotShape = typeof NotShapeSchema.Type;
  type ConditionalShape (line 878) | type ConditionalShape = typeof ConditionalShapeSchema.Type;
  type GraphQLInterfaceShape (line 879) | type GraphQLInterfaceShape = typeof GraphQLInterfaceShapeSchema.Type;
  type GraphQLUnionShape (line 880) | type GraphQLUnionShape = typeof GraphQLUnionShapeSchema.Type;
  type ShapeNode (line 881) | type ShapeNode = typeof ShapeNodeSchema.Type;
  type AnchorTarget (line 882) | type AnchorTarget = typeof AnchorTargetSchema.Type;
  type SchemaResource (line 883) | type SchemaResource = typeof SchemaResourceSchema.Type;
  type RequestPlacementHint (line 884) | type RequestPlacementHint = typeof RequestPlacementHintSchema.Type;
  type OAuthFlow (line 885) | type OAuthFlow = typeof OAuthFlowSchema.Type;
  type SecurityPlacement (line 886) | type SecurityPlacement = typeof SecurityPlacementSchema.Type;
  type SecuritySchemeSymbol (line 887) | type SecuritySchemeSymbol = typeof SecuritySchemeSymbolSchema.Type;
  type EncodingSpec (line 888) | type EncodingSpec = typeof EncodingSpecSchema.Type;
  type ContentSpec (line 889) | type ContentSpec = typeof ContentSpecSchema.Type;
  type ShapeSymbol (line 890) | type ShapeSymbol = typeof ShapeSymbolSchema.Type;
  type ParameterSymbol (line 891) | type ParameterSymbol = typeof ParameterSymbolSchema.Type;
  type HeaderSymbol (line 892) | type HeaderSymbol = typeof HeaderSymbolSchema.Type;
  type RequestBodySymbol (line 893) | type RequestBodySymbol = typeof RequestBodySymbolSchema.Type;
  type ResponseSymbol (line 894) | type ResponseSymbol = typeof ResponseSymbolSchema.Type;
  type ExampleSymbol (line 895) | type ExampleSymbol = typeof ExampleSymbolSchema.Type;
  type Symbol (line 896) | type Symbol =
  type ServerSpec (line 904) | type ServerSpec = typeof ServerSpecSchema.Type;
  type ScopeDefaults (line 905) | type ScopeDefaults = typeof ScopeDefaultsSchema.Type;
  type Scope (line 906) | type Scope = typeof ScopeSchema.Type;
  type InteractionSpec (line 907) | type InteractionSpec = typeof InteractionSpecSchema.Type;
  type Capability (line 908) | type Capability = typeof CapabilitySchema.Type;
  type ExecutableDisplay (line 909) | type ExecutableDisplay = typeof ExecutableDisplaySchema.Type;
  type ExecutableProjection (line 910) | type ExecutableProjection = typeof ExecutableProjectionSchema.Type;
  type Executable (line 911) | type Executable = typeof ExecutableSchema.Type;
  type PaginationHint (line 912) | type PaginationHint = typeof PaginationHintSchema.Type;
  type StatusMatch (line 913) | type StatusMatch = typeof StatusMatchSchema.Type;
  type ResponseVariant (line 914) | type ResponseVariant = typeof ResponseVariantSchema.Type;
  type ResponseSet (line 915) | type ResponseSet = typeof ResponseSetSchema.Type;
  type ImportDiagnostic (line 916) | type ImportDiagnostic = typeof ImportDiagnosticSchema.Type;
  type CatalogV1 (line 917) | type CatalogV1 = typeof CatalogV1Schema.Type;
  type CatalogFragmentV1 (line 918) | type CatalogFragmentV1 = typeof CatalogFragmentV1Schema.Type;
  type CatalogSnapshotV1 (line 919) | type CatalogSnapshotV1 = typeof CatalogSnapshotV1Schema.Type;

FILE: packages/kernel/runtime-deno-subprocess/src/deno-subprocess-worker.mjs
  constant IPC_PREFIX (line 7) | const IPC_PREFIX = "@@executor-ipc@@";
  method get (line 45) | get(_target, prop) {
  method apply (line 50) | apply(_target, _thisArg, args) {

FILE: packages/kernel/runtime-deno-subprocess/src/deno-worker-process.ts
  type DenoPermissions (line 3) | type DenoPermissions = {
  type SpawnDenoWorkerProcessInput (line 18) | type SpawnDenoWorkerProcessInput = {
  type DenoWorkerProcessCallbacks (line 24) | type DenoWorkerProcessCallbacks = {
  type DenoWorkerProcess (line 31) | type DenoWorkerProcess = {

FILE: packages/kernel/runtime-deno-subprocess/src/index.ts
  type DenoSubprocessExecutorOptions (line 18) | type DenoSubprocessExecutorOptions = {
  constant IPC_PREFIX (line 27) | const IPC_PREFIX = "@@executor-ipc@@";
  constant DEFAULT_TIMEOUT_MS (line 28) | const DEFAULT_TIMEOUT_MS = 5 * 60_000;
  type HostStartMessage (line 34) | type HostStartMessage = {
  type HostToolResultMessage (line 39) | type HostToolResultMessage = {
  type HostToWorkerMessage (line 47) | type HostToWorkerMessage = HostStartMessage | HostToolResultMessage;
  type WorkerToolCallMessage (line 49) | type WorkerToolCallMessage = {
  type WorkerCompletedMessage (line 56) | type WorkerCompletedMessage = {
  type WorkerFailedMessage (line 62) | type WorkerFailedMessage = {
  type WorkerToHostMessage (line 68) | type WorkerToHostMessage =

FILE: packages/kernel/runtime-quickjs/src/index.ts
  type QuickJsExecutorOptions (line 16) | type QuickJsExecutorOptions = {
  constant DEFAULT_TIMEOUT_MS (line 22) | const DEFAULT_TIMEOUT_MS = 5 * 60_000;
  constant EXECUTION_FILENAME (line 23) | const EXECUTION_FILENAME = "executor-quickjs-runtime.js";

FILE: packages/kernel/runtime-ses/src/index.ts
  type SesExecutorOptions (line 11) | type SesExecutorOptions = {
  constant DEFAULT_TIMEOUT_MS (line 16) | const DEFAULT_TIMEOUT_MS = 5 * 60_000;
  constant DEFAULT_EVALUATION_ID (line 17) | const DEFAULT_EVALUATION_ID = "evaluation";
  constant WORKER_PATH (line 18) | const WORKER_PATH = fileURLToPath(new URL("./sandbox-worker.mjs", import...
  type ReadyMessage (line 20) | type ReadyMessage = {
  type ToolCallMessage (line 24) | type ToolCallMessage = {
  type ResultMessage (line 31) | type ResultMessage = {
  type WorkerMessage (line 39) | type WorkerMessage = ReadyMessage | ToolCallMessage | ResultMessage;
  type EvaluateMessage (line 41) | type EvaluateMessage = {
  type ToolResponseMessage (line 48) | type ToolResponseMessage = {

FILE: packages/kernel/runtime-ses/src/sandbox-worker.mjs
  method get (line 67) | get(_target, prop) {
  method apply (line 74) | apply(_target, _thisArg, args) {

FILE: packages/platform/control-plane/src/api/api.ts
  class ControlPlaneApi (line 9) | class ControlPlaneApi extends HttpApi.make("controlPlane")

FILE: packages/platform/control-plane/src/api/errors.ts
  class ControlPlaneBadRequestError (line 4) | class ControlPlaneBadRequestError extends Schema.TaggedError<ControlPlan...
  class ControlPlaneUnauthorizedError (line 14) | class ControlPlaneUnauthorizedError extends Schema.TaggedError<ControlPl...
  class ControlPlaneForbiddenError (line 24) | class ControlPlaneForbiddenError extends Schema.TaggedError<ControlPlane...
  class ControlPlaneNotFoundError (line 34) | class ControlPlaneNotFoundError extends Schema.TaggedError<ControlPlaneN...
  class ControlPlaneStorageError (line 44) | class ControlPlaneStorageError extends Schema.TaggedError<ControlPlaneSt...

FILE: packages/platform/control-plane/src/api/executions/api.ts
  type CreateExecutionPayload (line 23) | type CreateExecutionPayload = typeof CreateExecutionPayloadSchema.Type;
  type ResumeExecutionPayload (line 30) | type ResumeExecutionPayload = typeof ResumeExecutionPayloadSchema.Type;
  class ExecutionsApi (line 35) | class ExecutionsApi extends HttpApiGroup.make("executions")

FILE: packages/platform/control-plane/src/api/http.ts
  type ControlPlaneApiRuntimeContext (line 19) | type ControlPlaneApiRuntimeContext = Layer.Layer.Context<typeof ControlP...
  type BuiltControlPlaneApiLayer (line 21) | type BuiltControlPlaneApiLayer = Layer.Layer<

FILE: packages/platform/control-plane/src/api/local/api.ts
  type SecretProvider (line 23) | type SecretProvider = typeof SecretProviderSchema.Type;
  type InstanceConfig (line 24) | type InstanceConfig = typeof InstanceConfigSchema.Type;
  type SecretLinkedSource (line 33) | type SecretLinkedSource = typeof SecretLinkedSourceSchema.Type;
  type SecretListItem (line 45) | type SecretListItem = typeof SecretListItemSchema.Type;
  type CreateSecretPayload (line 54) | type CreateSecretPayload = typeof CreateSecretPayloadSchema.Type;
  type CreateSecretResult (line 65) | type CreateSecretResult = typeof CreateSecretResultSchema.Type;
  type UpdateSecretPayload (line 72) | type UpdateSecretPayload = typeof UpdateSecretPayloadSchema.Type;
  type UpdateSecretResult (line 83) | type UpdateSecretResult = typeof UpdateSecretResultSchema.Type;
  type DeleteSecretResult (line 89) | type DeleteSecretResult = typeof DeleteSecretResultSchema.Type;
  class LocalApi (line 93) | class LocalApi extends HttpApiGroup.make("local")

FILE: packages/platform/control-plane/src/api/local/http.ts
  constant SECRET_STORE_PROVIDER_ENV (line 38) | const SECRET_STORE_PROVIDER_ENV = "EXECUTOR_SECRET_STORE_PROVIDER";

FILE: packages/platform/control-plane/src/api/oauth/api.ts
  type StartSourceOAuthPayload (line 34) | type StartSourceOAuthPayload = typeof StartSourceOAuthPayloadSchema.Type;
  type StartSourceOAuthResult (line 41) | type StartSourceOAuthResult = typeof StartSourceOAuthResultSchema.Type;
  type CompleteSourceOAuthResult (line 56) | type CompleteSourceOAuthResult = typeof CompleteSourceOAuthResultSchema....
  type SourceOAuthPopupResult (line 77) | type SourceOAuthPopupResult = typeof SourceOAuthPopupResultSchema.Type;
  class OAuthApi (line 86) | class OAuthApi extends HttpApiGroup.make("oauth")

FILE: packages/platform/control-plane/src/api/oauth/http.ts
  constant OAUTH_RESULT_STORAGE_KEY_PREFIX (line 24) | const OAUTH_RESULT_STORAGE_KEY_PREFIX = "executor:oauth-result:";

FILE: packages/platform/control-plane/src/api/policies/api.ts
  type CreatePolicyPayload (line 30) | type CreatePolicyPayload = typeof CreatePolicyPayloadSchema.Type;
  type UpdatePolicyPayload (line 34) | type UpdatePolicyPayload = typeof UpdatePolicyPayloadSchema.Type;
  class PoliciesApi (line 39) | class PoliciesApi extends HttpApiGroup.make("policies")

FILE: packages/platform/control-plane/src/api/sources/api.ts
  type CreateSourcePayload (line 65) | type CreateSourcePayload = typeof CreateSourcePayloadSchema.Type;
  type CreateWorkspaceOauthClientPayload (line 66) | type CreateWorkspaceOauthClientPayload =
  type UpdateSourcePayload (line 83) | type UpdateSourcePayload = typeof UpdateSourcePayloadSchema.Type;
  type DiscoverSourcePayload (line 153) | type DiscoverSourcePayload = typeof DiscoverSourcePayloadSchema.Type;
  type ConnectSourceResult (line 173) | type ConnectSourceResult = typeof ConnectSourceResultSchema.Type;
  type ConnectSourceBatchPayload (line 174) | type ConnectSourceBatchPayload = typeof ConnectSourceBatchPayloadSchema....
  type ConnectSourceBatchResult (line 175) | type ConnectSourceBatchResult = typeof ConnectSourceBatchResultSchema.Type;
  class SourcesApi (line 192) | class SourcesApi extends HttpApiGroup.make("sources")

FILE: packages/platform/control-plane/src/api/sources/http.ts
  constant SOURCE_OAUTH_RESULT_STORAGE_KEY_PREFIX (line 105) | const SOURCE_OAUTH_RESULT_STORAGE_KEY_PREFIX = "executor:oauth-result:";

FILE: packages/platform/control-plane/src/client.ts
  type ControlPlaneClient (line 17) | type ControlPlaneClient = Effect.Effect.Success<

FILE: packages/platform/control-plane/src/runtime/auth/auth-artifacts.ts
  type ResolvedSourceAuthMaterial (line 41) | type ResolvedSourceAuthMaterial = {

FILE: packages/platform/control-plane/src/runtime/auth/auth-leases.ts
  constant LEASE_REFRESH_SKEW_MS (line 32) | const LEASE_REFRESH_SKEW_MS = 60_000;

FILE: packages/platform/control-plane/src/runtime/auth/mcp-auth-provider.ts
  method redirectUrl (line 140) | get redirectUrl() {
  method clientMetadata (line 144) | get clientMetadata() {

FILE: packages/platform/control-plane/src/runtime/auth/oauth-loopback.ts
  constant DEFAULT_LOOPBACK_TIMEOUT_MS (line 5) | const DEFAULT_LOOPBACK_TIMEOUT_MS = 10 * 60_000;
  type OauthLoopbackRedirectServer (line 7) | type OauthLoopbackRedirectServer = {

FILE: packages/platform/control-plane/src/runtime/auth/source-auth-material.ts
  type RuntimeSourceAuthMaterialShape (line 45) | type RuntimeSourceAuthMaterialShape = {
  class RuntimeSourceAuthMaterialService (line 54) | class RuntimeSourceAuthMaterialService extends Context.Tag(

FILE: packages/platform/control-plane/src/runtime/catalog/catalog-typescript.ts
  type CatalogTypeRoot (line 12) | type CatalogTypeRoot = {
  type TypeRenderOptions (line 17) | type TypeRenderOptions = {
  type RenderShape (line 22) | type RenderShape = (shapeId: ShapeSymbolId, options?: TypeRenderOptions)...
  type SignatureInfo (line 24) | type SignatureInfo = {
  type ObjectLikeNode (line 29) | type ObjectLikeNode = Extract<ShapeNode, { type: "object" }> | Extract<S...
  type RenderableObjectNode (line 31) | type RenderableObjectNode = {
  type UnionVariantObject (line 38) | type UnionVariantObject = {
  type DiscriminatorCandidate (line 43) | type DiscriminatorCandidate = {
  type CatalogTypeProjector (line 48) | type CatalogTypeProjector = {
  constant VALID_IDENTIFIER_PATTERN (line 54) | const VALID_IDENTIFIER_PATTERN = /^[A-Za-z_$][A-Za-z0-9_$]*$/;
  constant TYPE_ALIAS_REFERENCE_PATTERN (line 55) | const TYPE_ALIAS_REFERENCE_PATTERN = /^[A-Za-z_$][A-Za-z0-9_$]*$/;

FILE: packages/platform/control-plane/src/runtime/catalog/prettier-format.ts
  type PrettierParser (line 6) | type PrettierParser = "json" | "typescript" | "typescript-module";
  function formatCacheKey (line 12) | function formatCacheKey(code: string, parser: PrettierParser): string {
  function formatWithPrettier (line 16) | async function formatWithPrettier(

FILE: packages/platform/control-plane/src/runtime/catalog/schema-type-signature.ts
  type JsonSchemaRecord (line 3) | type JsonSchemaRecord = Record<string, unknown>;

FILE: packages/platform/control-plane/src/runtime/catalog/source/runtime.ts
  type CatalogImportMetadata (line 55) | type CatalogImportMetadata = CatalogSnapshotV1["import"];
  type ProjectedToolDescriptor (line 57) | type ProjectedToolDescriptor = ProjectedCatalog["toolDescriptors"][keyof...
  type LoadedSourceCatalog (line 59) | type LoadedSourceCatalog = {
  type LoadedSourceCatalogTool (line 70) | type LoadedSourceCatalogTool = {
  type LoadedSourceCatalogToolIndexEntry (line 87) | type LoadedSourceCatalogToolIndexEntry = Omit<
  type LoadedSourceCatalogToolContractSide (line 92) | type LoadedSourceCatalogToolContractSide = {
  type LoadedSourceCatalogToolContract (line 100) | type LoadedSourceCatalogToolContract = {
  type RuntimeSourceCatalogStoreShape (line 664) | type RuntimeSourceCatalogStoreShape = {
  type RuntimeSourceCatalogStore (line 687) | type RuntimeSourceCatalogStore = RuntimeSourceCatalogStoreShape;
  class RuntimeSourceCatalogStoreService (line 689) | class RuntimeSourceCatalogStoreService extends Context.Tag(
  type RuntimeSourceCatalogStoreDeps (line 693) | type RuntimeSourceCatalogStoreDeps = {
  type SourceCatalogRuntimeServices (line 699) | type SourceCatalogRuntimeServices =

FILE: packages/platform/control-plane/src/runtime/catalog/source/sync.ts
  type RuntimeSourceCatalogSyncDeps (line 45) | type RuntimeSourceCatalogSyncDeps = {
  type SourceCatalogSyncServices (line 53) | type SourceCatalogSyncServices =
  type RuntimeSourceCatalogSyncShape (line 60) | type RuntimeSourceCatalogSyncShape = {
  class RuntimeSourceCatalogSyncService (line 71) | class RuntimeSourceCatalogSyncService extends Context.Tag(

FILE: packages/platform/control-plane/src/runtime/catalog/source/type-declarations.ts
  type SourceDeclarationEntry (line 24) | type SourceDeclarationEntry = {
  type ToolMethodNode (line 29) | type ToolMethodNode = {
  type SourceDeclarationModel (line 36) | type SourceDeclarationModel = {
  type ToolTreeNode (line 41) | type ToolTreeNode = {
  type SourceDeclarationStub (line 46) | type SourceDeclarationStub = {
  constant GENERATED_TYPES_DIRECTORY (line 50) | const GENERATED_TYPES_DIRECTORY = "types";
  constant GENERATED_SOURCE_TYPES_DIRECTORY (line 51) | const GENERATED_SOURCE_TYPES_DIRECTORY = "sources";
  constant BACKGROUND_DECLARATION_REFRESH_DELAY (line 364) | const BACKGROUND_DECLARATION_REFRESH_DELAY = "1500 millis";

FILE: packages/platform/control-plane/src/runtime/control-plane-runtime.test.ts
  type OpenApiSpecServer (line 69) | type OpenApiSpecServer = {
  type GoogleWorkspaceTestServer (line 75) | type GoogleWorkspaceTestServer = {

FILE: packages/platform/control-plane/src/runtime/effect-errors.ts
  class RuntimeEffectError (line 3) | class RuntimeEffectError extends Data.TaggedError(

FILE: packages/platform/control-plane/src/runtime/execution/live.ts
  type VisibleExecutionState (line 18) | type VisibleExecutionState =
  type LiveRunEntry (line 24) | type LiveRunEntry = {
  type LiveExecutionManagerShape (line 32) | type LiveExecutionManagerShape = {
  constant SENSITIVE_INTERACTION_CONTENT_KEYS (line 68) | const SENSITIVE_INTERACTION_CONTENT_KEYS = new Set([
  type LiveExecutionManager (line 267) | type LiveExecutionManager = ReturnType<typeof createLiveExecutionManager>;
  class LiveExecutionManagerService (line 269) | class LiveExecutionManagerService extends Context.Tag(

FILE: packages/platform/control-plane/src/runtime/execution/mcp-resume.test.ts
  type McpFormServer (line 28) | type McpFormServer = {

FILE: packages/platform/control-plane/src/runtime/execution/runtime.ts
  constant DEFAULT_EXECUTION_RUNTIME (line 7) | const DEFAULT_EXECUTION_RUNTIME: LocalExecutorRuntime = "quickjs";

FILE: packages/platform/control-plane/src/runtime/execution/service.ts
  type InteractionMode (line 60) | type InteractionMode = NonNullable<CreateExecutionPayload["interactionMo...
  constant EXECUTION_SUSPENDED_SENTINEL (line 62) | const EXECUTION_SUSPENDED_SENTINEL = "__EXECUTION_SUSPENDED__";
  constant DEFAULT_INTERACTION_MODE (line 64) | const DEFAULT_INTERACTION_MODE: InteractionMode = "detach";
  class ExecutionSuspendedError (line 169) | class ExecutionSuspendedError extends Data.TaggedError(

FILE: packages/platform/control-plane/src/runtime/execution/state.ts
  type ExecutionEnvironment (line 11) | type ExecutionEnvironment = {
  type ResolveExecutionEnvironment (line 17) | type ResolveExecutionEnvironment = (input: {
  class ResumeUnsupportedError (line 24) | class ResumeUnsupportedError extends Data.TaggedError(

FILE: packages/platform/control-plane/src/runtime/execution/test-http-client.ts
  type ControlPlaneClient (line 31) | type ControlPlaneClient = Effect.Effect.Success<

FILE: packages/platform/control-plane/src/runtime/execution/workspace/authorization.ts
  type WorkspaceToolElicitation (line 65) | type WorkspaceToolElicitation = Parameters<

FILE: packages/platform/control-plane/src/runtime/execution/workspace/environment.ts
  class RuntimeExecutionResolverService (line 98) | class RuntimeExecutionResolverService extends Context.Tag(

FILE: packages/platform/control-plane/src/runtime/execution/workspace/source-catalog.ts
  constant LOW_SIGNAL_QUERY_TOKENS (line 30) | const LOW_SIGNAL_QUERY_TOKENS = new Set([

FILE: packages/platform/control-plane/src/runtime/index.ts
  type RuntimeControlPlaneOptions (line 71) | type RuntimeControlPlaneOptions = {
  type RuntimeControlPlaneLayer (line 94) | type RuntimeControlPlaneLayer = Layer.Layer<
  type ControlPlaneRuntime (line 187) | type ControlPlaneRuntime = {
  type CreateControlPlaneRuntimeOptions (line 195) | type CreateControlPlaneRuntimeOptions = RuntimeControlPlaneOptions;

FILE: packages/platform/control-plane/src/runtime/local/capture-release-workspace-fixture.ts
  class CaptureReleaseWorkspaceFixtureError (line 23) | class CaptureReleaseWorkspaceFixtureError extends Data.TaggedError(
  type CaptureReleaseWorkspaceFixtureArgs (line 29) | type CaptureReleaseWorkspaceFixtureArgs = {

FILE: packages/platform/control-plane/src/runtime/local/config-secrets.ts
  constant CONFIG_SECRET_PROVIDER_PREFIX (line 1) | const CONFIG_SECRET_PROVIDER_PREFIX = "config:";

FILE: packages/platform/control-plane/src/runtime/local/config.ts
  constant PROJECT_CONFIG_BASENAME (line 27) | const PROJECT_CONFIG_BASENAME = "executor.jsonc";
  constant PROJECT_CONFIG_DIRECTORY (line 28) | const PROJECT_CONFIG_DIRECTORY = ".executor";
  constant EXECUTOR_CONFIG_DIR_ENV (line 29) | const EXECUTOR_CONFIG_DIR_ENV = "EXECUTOR_CONFIG_DIR";
  constant EXECUTOR_STATE_DIR_ENV (line 30) | const EXECUTOR_STATE_DIR_ENV = "EXECUTOR_STATE_DIR";
  type ResolvedLocalWorkspaceContext (line 320) | type ResolvedLocalWorkspaceContext = {
  type LoadedLocalExecutorConfig (line 332) | type LoadedLocalExecutorConfig = {

FILE: packages/platform/control-plane/src/runtime/local/control-plane-store.ts
  constant LOCAL_CONTROL_PLANE_STATE_VERSION (line 39) | const LOCAL_CONTROL_PLANE_STATE_VERSION = 1 as const;
  constant LOCAL_CONTROL_PLANE_STATE_BASENAME (line 40) | const LOCAL_CONTROL_PLANE_STATE_BASENAME = "control-plane-state.json";
  type LocalControlPlaneState (line 56) | type LocalControlPlaneState = typeof LocalControlPlaneStateSchema.Type;
  type LocalControlPlanePersistence (line 58) | type LocalControlPlanePersistence = {
  type StateMutationResult (line 356) | type StateMutationResult<A> = {
  type LocalControlPlaneStore (line 1214) | type LocalControlPlaneStore = ReturnType<typeof createLocalControlPlaneS...

FILE: packages/platform/control-plane/src/runtime/local/errors.ts
  class LocalFileSystemError (line 6) | class LocalFileSystemError extends Data.TaggedError(
  class LocalExecutorConfigDecodeError (line 15) | class LocalExecutorConfigDecodeError extends Data.TaggedError(
  class LocalWorkspaceStateDecodeError (line 23) | class LocalWorkspaceStateDecodeError extends Data.TaggedError(
  class LocalSourceArtifactDecodeError (line 31) | class LocalSourceArtifactDecodeError extends Data.TaggedError(
  class LocalToolTranspileError (line 39) | class LocalToolTranspileError extends Data.TaggedError(
  class LocalToolImportError (line 47) | class LocalToolImportError extends Data.TaggedError(
  class LocalToolDefinitionError (line 55) | class LocalToolDefinitionError extends Data.TaggedError(
  class LocalToolPathConflictError (line 63) | class LocalToolPathConflictError extends Data.TaggedError(
  class RuntimeLocalWorkspaceUnavailableError (line 72) | class RuntimeLocalWorkspaceUnavailableError extends Data.TaggedError(
  class RuntimeLocalWorkspaceMismatchError (line 78) | class RuntimeLocalWorkspaceMismatchError extends Data.TaggedError(
  class LocalConfiguredSourceNotFoundError (line 86) | class LocalConfiguredSourceNotFoundError extends Data.TaggedError(
  class LocalSourceArtifactMissingError (line 93) | class LocalSourceArtifactMissingError extends Data.TaggedError(
  class LocalUnsupportedSourceKindError (line 100) | class LocalUnsupportedSourceKindError extends Data.TaggedError(

FILE: packages/platform/control-plane/src/runtime/local/installation.ts
  constant LOCAL_ACCOUNT_ID (line 12) | const LOCAL_ACCOUNT_ID = AccountIdSchema.make("acc_local_default");

FILE: packages/platform/control-plane/src/runtime/local/operations.ts
  type SourceCredentialInteraction (line 36) | type SourceCredentialInteraction = {

FILE: packages/platform/control-plane/src/runtime/local/release-upgrade-fixtures.ts
  type ReleaseWorkspaceFixtureManifest (line 23) | type ReleaseWorkspaceFixtureManifest =
  type ReleaseWorkspaceFixture (line 26) | type ReleaseWorkspaceFixture = ReleaseWorkspaceFixtureManifest & {

FILE: packages/platform/control-plane/src/runtime/local/runtime-context.ts
  type RuntimeLocalWorkspaceState (line 16) | type RuntimeLocalWorkspaceState = {
  class RuntimeLocalWorkspaceService (line 25) | class RuntimeLocalWorkspaceService extends Context.Tag(

FILE: packages/platform/control-plane/src/runtime/local/secret-material-providers.ts
  constant ENV_SECRET_PROVIDER_ID (line 27) | const ENV_SECRET_PROVIDER_ID = "env";
  constant PARAMS_SECRET_PROVIDER_ID (line 28) | const PARAMS_SECRET_PROVIDER_ID = "params";
  constant KEYCHAIN_SECRET_PROVIDER_ID (line 29) | const KEYCHAIN_SECRET_PROVIDER_ID = "keychain";
  constant LOCAL_SECRET_PROVIDER_ID (line 30) | const LOCAL_SECRET_PROVIDER_ID = "local";
  type SecretStoreProviderId (line 35) | type SecretStoreProviderId =
  type SecretMaterialResolveContext (line 39) | type SecretMaterialResolveContext = {
  type ResolveSecretMaterial (line 43) | type ResolveSecretMaterial = (input: {
  type StoreSecretMaterial (line 48) | type StoreSecretMaterial = (input: {
  type DeleteSecretMaterial (line 54) | type DeleteSecretMaterial = (
  type UpdateSecretMaterial (line 58) | type UpdateSecretMaterial = (input: {
  class SecretMaterialResolverService (line 71) | class SecretMaterialResolverService extends Context.Tag(
  class SecretMaterialStorerService (line 75) | class SecretMaterialStorerService extends Context.Tag(
  class SecretMaterialDeleterService (line 79) | class SecretMaterialDeleterService extends Context.Tag(
  class SecretMaterialUpdaterService (line 83) | class SecretMaterialUpdaterService extends Context.Tag(
  type SecretMaterialProviderRuntime (line 87) | type SecretMaterialProviderRuntime = {
  type SecretMaterialProvider (line 96) | type SecretMaterialProvider = {
  type SecretMaterialProviderRegistry (line 127) | type SecretMaterialProviderRegistry = ReadonlyMap<string, SecretMaterial...
  type SpawnResult (line 129) | type SpawnResult = {
  constant DEFAULT_KEYCHAIN_SERVICE_NAME (line 135) | const DEFAULT_KEYCHAIN_SERVICE_NAME = "executor";
  constant KEYCHAIN_COMMAND_TIMEOUT_MS (line 136) | const KEYCHAIN_COMMAND_TIMEOUT_MS = 5_000;
  constant DANGEROUSLY_ALLOW_ENV_SECRETS_ENV (line 137) | const DANGEROUSLY_ALLOW_ENV_SECRETS_ENV = "DANGEROUSLY_ALLOW_ENV_SECRETS";
  constant SECRET_STORE_PROVIDER_ENV (line 138) | const SECRET_STORE_PROVIDER_ENV = "EXECUTOR_SECRET_STORE_PROVIDER";
  constant KEYCHAIN_SERVICE_NAME_ENV (line 139) | const KEYCHAIN_SERVICE_NAME_ENV = "EXECUTOR_KEYCHAIN_SERVICE_NAME";
  type SecretMaterialSummary (line 141) | type SecretMaterialSummary = {

FILE: packages/platform/control-plane/src/runtime/local/source-artifacts.ts
  constant LEGACY_LOCAL_SOURCE_ARTIFACT_VERSION (line 37) | const LEGACY_LOCAL_SOURCE_ARTIFACT_VERSION = 3 as const;
  constant LOCAL_SOURCE_ARTIFACT_VERSION (line 38) | const LOCAL_SOURCE_ARTIFACT_VERSION = 4 as const;
  type LocalSourceArtifact (line 58) | type LocalSourceArtifact = typeof LocalSourceArtifactSchema.Type;
  type LegacyLocalSourceArtifact (line 59) | type LegacyLocalSourceArtifact = typeof LegacyLocalSourceArtifactSchema....
  type ReadableLegacyLocalSourceArtifact (line 79) | type ReadableLegacyLocalSourceArtifact =
  type ReadableLocalSourceArtifact (line 81) | type ReadableLocalSourceArtifact =

FILE: packages/platform/control-plane/src/runtime/local/storage.ts
  type InstallationStoreShape (line 38) | type InstallationStoreShape = {
  class InstallationStore (line 47) | class InstallationStore extends Context.Tag(
  type WorkspaceConfigStoreShape (line 51) | type WorkspaceConfigStoreShape = {
  class WorkspaceConfigStore (line 62) | class WorkspaceConfigStore extends Context.Tag(
  type WorkspaceStateStoreShape (line 66) | type WorkspaceStateStoreShape = {
  class WorkspaceStateStore (line 76) | class WorkspaceStateStore extends Context.Tag(
  type SourceArtifactStoreShape (line 80) | type SourceArtifactStoreShape = {
  class SourceArtifactStore (line 100) | class SourceArtifactStore extends Context.Tag(
  type LocalStorageServices (line 104) | type LocalStorageServices =
  type WorkspaceStorageServices (line 110) | type WorkspaceStorageServices =

FILE: packages/platform/control-plane/src/runtime/local/tools.ts
  constant SUPPORTED_LOCAL_TOOL_EXTENSIONS (line 33) | const SUPPORTED_LOCAL_TOOL_EXTENSIONS = new Set([".ts", ".js", ".mjs"]);
  constant LOCAL_TOOLS_DIRECTORY (line 34) | const LOCAL_TOOLS_DIRECTORY = "tools";
  constant LOCAL_TOOLS_ARTIFACT_DIRECTORY (line 35) | const LOCAL_TOOLS_ARTIFACT_DIRECTORY = "local-tools";
  constant LOCAL_TOOLS_SOURCE_KEY_PREFIX (line 36) | const LOCAL_TOOLS_SOURCE_KEY_PREFIX = "local.tool";
  constant LOCAL_TOOL_SEGMENT_PATTERN (line 37) | const LOCAL_TOOL_SEGMENT_PATTERN = /^[A-Za-z0-9_-]+$/;
  type Awaitable (line 39) | type Awaitable<T> = T | Promise<T>;
  type ParsedStandardSchema (line 41) | type ParsedStandardSchema<TSchema extends StandardSchema<any, any>> =
  type LocalTool (line 44) | type LocalTool<
  type LocalToolWithMetadata (line 63) | type LocalToolWithMetadata<
  type LocalToolRuntime (line 82) | type LocalToolRuntime = {
  type LocalToolRuntimeLoaderShape (line 655) | type LocalToolRuntimeLoaderShape = {
  class LocalToolRuntimeLoaderService (line 669) | class LocalToolRuntimeLoaderService extends Context.Tag(

FILE: packages/platform/control-plane/src/runtime/local/workspace-state.ts
  constant WORKSPACE_STATE_BASENAME (line 19) | const WORKSPACE_STATE_BASENAME = "workspace-state.json";
  type LocalWorkspaceSourceState (line 47) | type LocalWorkspaceSourceState = typeof LocalWorkspaceSourceStateSchema....
  type LocalWorkspacePolicyState (line 48) | type LocalWorkspacePolicyState = typeof LocalWorkspacePolicyStateSchema....
  type LocalWorkspaceState (line 49) | type LocalWorkspaceState = typeof LocalWorkspaceStateSchema.Type;

FILE: packages/platform/control-plane/src/runtime/policy/invocation-policy-engine.ts
  type InvocationOperationKind (line 6) | type InvocationOperationKind =
  type InvocationDescriptor (line 13) | type InvocationDescriptor = {
  type InvocationPolicyContext (line 24) | type InvocationPolicyContext = {
  type InvocationAuthorizationDecision (line 28) | type InvocationAuthorizationDecision = {

FILE: packages/platform/control-plane/src/runtime/policy/operation-errors.ts
  type OperationErrors (line 8) | type OperationErrors<TOperation extends string = string> = {
  type OperationErrorsLike (line 33) | type OperationErrorsLike = OperationErrors | string;

FILE: packages/platform/control-plane/src/runtime/policy/operations-shared.ts
  type Mutable (line 11) | type Mutable<T> = { -readonly [K in keyof T]: T[K] };

FILE: packages/platform/control-plane/src/runtime/sources/executor-tools.ts
  constant EXECUTOR_SOURCES_ADD_INPUT_HINT (line 79) | const EXECUTOR_SOURCES_ADD_INPUT_HINT = deriveSchemaTypeSignature(
  constant EXECUTOR_SOURCES_ADD_OUTPUT_SIGNATURE (line 84) | const EXECUTOR_SOURCES_ADD_OUTPUT_SIGNATURE = deriveSchemaTypeSignature(
  constant EXECUTOR_SOURCES_ADD_INPUT_SCHEMA (line 89) | const EXECUTOR_SOURCES_ADD_INPUT_SCHEMA = deriveSchemaJson(
  constant EXECUTOR_SOURCES_ADD_OUTPUT_SCHEMA (line 93) | const EXECUTOR_SOURCES_ADD_OUTPUT_SCHEMA = deriveSchemaJson(
  constant EXECUTOR_SOURCES_ADD_HELP_LINES (line 97) | const EXECUTOR_SOURCES_ADD_HELP_LINES = [
  type ExecutorSourcesAddToolArgs (line 131) | type ExecutorSourcesAddToolArgs =
  type ExecutorGoogleDiscoveryToolArgs (line 138) | type ExecutorGoogleDiscoveryToolArgs = Omit<
  type ExecutorOpenApiToolArgs (line 143) | type ExecutorOpenApiToolArgs = Omit<
  type ExecutorGraphqlToolArgs (line 148) | type ExecutorGraphqlToolArgs = Omit<
  type ExecutorCredentialPromptArgs (line 153) | type ExecutorCredentialPromptArgs = {

FILE: packages/platform/control-plane/src/runtime/sources/graphql-tools.test.ts
  type CapturedRequest (line 7) | type CapturedRequest = {

FILE: packages/platform/control-plane/src/runtime/sources/source-adapter-fixture-matrix.test.ts
  constant FIXTURE_WORKSPACE_ID (line 60) | const FIXTURE_WORKSPACE_ID = WorkspaceIdSchema.make("ws_source_fixture_m...
  class BinaryExecutionReportsApi (line 318) | class BinaryExecutionReportsApi extends HttpApiGroup.make("reports").add(
  class BinaryExecutionApi (line 326) | class BinaryExecutionApi extends HttpApi.make("binaryExecution").add(

FILE: packages/platform/control-plane/src/runtime/sources/source-adapters/index.ts
  type ConnectSourcePayload (line 26) | type ConnectSourcePayload = typeof ConnectSourcePayloadSchema.Type;
  type ExecutorAddSourceInput (line 35) | type ExecutorAddSourceInput = typeof ExecutorAddSourceInputSchema.Type;

FILE: packages/platform/control-plane/src/runtime/sources/source-adapters/internal.ts
  constant INTERNAL_BINDING_CONFIG_VERSION (line 17) | const INTERNAL_BINDING_CONFIG_VERSION = 1;

FILE: packages/platform/control-plane/src/runtime/sources/source-adapters/mcp.test.ts
  type RealMcpServer (line 35) | type RealMcpServer = {
  constant STDIO_TEST_SERVER_SCRIPT (line 537) | const STDIO_TEST_SERVER_SCRIPT = `
  method redirectUrl (line 566) | get redirectUrl() {
  method clientMetadata (line 569) | get clientMetadata() {

FILE: packages/platform/control-plane/src/runtime/sources/source-auth-service.ts
  function normalizeEndpoint (line 226) | function normalizeEndpoint(endpoint: string): string {
  type ExecutorSourceAddResult (line 525) | type ExecutorSourceAddResult =
  type ExecutorHttpSourceAuthInput (line 542) | type ExecutorHttpSourceAuthInput =
  type ExecutorAddSourceInput (line 563) | type ExecutorAddSourceInput =
  type ExecutorCredentialManagedSourceInput (line 627) | type ExecutorCredentialManagedSourceInput = Extract<
  type ExecutorHttpEndpointSourceInput (line 632) | type ExecutorHttpEndpointSourceInput = Extract<
  type ExecutorMcpSourceInput (line 637) | type ExecutorMcpSourceInput = Exclude<
  type ConnectMcpSourceInput (line 642) | type ConnectMcpSourceInput = {
  type ConnectGoogleDiscoveryBatchInput (line 660) | type ConnectGoogleDiscoveryBatchInput = {
  type ConnectGoogleDiscoveryBatchResult (line 677) | type ConnectGoogleDiscoveryBatchResult = {
  type CreateWorkspaceOauthClientInput (line 689) | type CreateWorkspaceOauthClientInput = {
  type McpSourceConnectResult (line 696) | type McpSourceConnectResult = Extract<ExecutorSourceAddResult, {
  type SourceOAuthProviderInput (line 700) | type SourceOAuthProviderInput = {
  type StartSourceOAuthSessionInput (line 708) | type StartSourceOAuthSessionInput = {
  type StartSourceOAuthSessionResult (line 738) | type StartSourceOAuthSessionResult = {
  type CompleteSourceOAuthSessionResult (line 743) | type CompleteSourceOAuthSessionResult = {
  type CompleteSourceCredentialSetupResult (line 748) | type CompleteSourceCredentialSetupResult = {
  type CompleteProviderOauthCallbackResult (line 753) | type CompleteProviderOauthCallbackResult = {
  type ResolvedSourceOauthClient (line 926) | type ResolvedSourceOauthClient = {
  type ResolvedWorkspaceOauthClient (line 933) | type ResolvedWorkspaceOauthClient = ResolvedSourceOauthClient & {
  type RuntimeProviderAuthTarget (line 938) | type RuntimeProviderAuthTarget = {
  type RuntimeProviderAuthResult (line 944) | type RuntimeProviderAuthResult =
  type RuntimeSourceAuthServiceShape (line 2749) | type RuntimeSourceAuthServiceShape = {
  type RuntimeSourceAuthDependencies (line 2816) | type RuntimeSourceAuthDependencies = {
  type ProvideLocalWorkspace (line 2827) | type ProvideLocalWorkspace = <A, E, R>(
  type RuntimeSourceConnectionServiceShape (line 2831) | type RuntimeSourceConnectionServiceShape = Pick<
  type RuntimeSourceOAuthSessionServiceShape (line 2843) | type RuntimeSourceOAuthSessionServiceShape = Pick<
  type RuntimeSourceAuthService (line 3683) | type RuntimeSourceAuthService = RuntimeSourceAuthServiceShape;
  class RuntimeSourceAuthServiceTag (line 3685) | class RuntimeSourceAuthServiceTag extends Context.Tag(
  type ExecutorAddSourceResult (line 3734) | type ExecutorAddSourceResult = typeof ExecutorAddSourceResultSchema.Type;

FILE: packages/platform/control-plane/src/runtime/sources/source-credential-interactions.ts
  type SourceCredentialSelectionContent (line 14) | type SourceCredentialSelectionContent =

FILE: packages/platform/control-plane/src/runtime/sources/source-definitions.test.ts
  type McpRemoteBindingInput (line 36) | type McpRemoteBindingInput = {
  type McpStdioBindingInput (line 46) | type McpStdioBindingInput = {

FILE: packages/platform/control-plane/src/runtime/sources/source-definitions.ts
  type SourceCatalogSourceConfig (line 46) | type SourceCatalogSourceConfig = Record<string, unknown>;

FILE: packages/platform/control-plane/src/runtime/sources/source-discovery.test.ts
  type TestServer (line 12) | type TestServer = {

FILE: packages/platform/control-plane/src/runtime/sources/source-discovery.ts
  type DiscoverableSourceAdapter (line 14) | type DiscoverableSourceAdapter = SourceAdapter & {

FILE: packages/platform/control-plane/src/runtime/sources/source-store.ts
  type RuntimeSourceStoreShape (line 35) | type RuntimeSourceStoreShape = {
  type RuntimeSourceStore (line 59) | type RuntimeSourceStore = RuntimeSourceStoreShape;
  class RuntimeSourceStoreService (line 126) | class RuntimeSourceStoreService extends Context.Tag(

FILE: packages/platform/control-plane/src/runtime/sources/source-store/deps.ts
  type RuntimeSourceStoreDeps (line 33) | type RuntimeSourceStoreDeps = {
  type ResolvedSourceStoreWorkspace (line 41) | type ResolvedSourceStoreWorkspace = {

FILE: packages/platform/control-plane/src/runtime/store.ts
  type SecretMaterialSummary (line 17) | type SecretMaterialSummary = {
  type ControlPlaneStoreShape (line 26) | type ControlPlaneStoreShape = {
  class ControlPlaneStore (line 227) | class ControlPlaneStore extends Context.Tag(

FILE: packages/platform/control-plane/src/schema/common.ts
  type TimestampMs (line 5) | type TimestampMs = typeof TimestampMsSchema.Type;

FILE: packages/platform/control-plane/src/schema/ids.ts
  type AccountId (line 41) | type AccountId = typeof AccountIdSchema.Type;
  type WorkspaceId (line 42) | type WorkspaceId = typeof WorkspaceIdSchema.Type;
  type SourceId (line 43) | type SourceId = typeof SourceIdSchema.Type;
  type SourceCatalogId (line 44) | type SourceCatalogId = typeof SourceCatalogIdSchema.Type;
  type SourceCatalogRevisionId (line 45) | type SourceCatalogRevisionId = typeof SourceCatalogRevisionIdSchema.Type;
  type SourceAuthSessionId (line 46) | type SourceAuthSessionId = typeof SourceAuthSessionIdSchema.Type;
  type AuthArtifactId (line 47) | type AuthArtifactId = typeof AuthArtifactIdSchema.Type;
  type AuthLeaseId (line 48) | type AuthLeaseId = typeof AuthLeaseIdSchema.Type;
  type CredentialId (line 49) | type CredentialId = typeof CredentialIdSchema.Type;
  type WorkspaceSourceOauthClientId (line 50) | type WorkspaceSourceOauthClientId = typeof WorkspaceSourceOauthClientIdS...
  type WorkspaceOauthClientId (line 51) | type WorkspaceOauthClientId = typeof WorkspaceOauthClientIdSchema.Type;
  type ProviderAuthGrantId (line 52) | type ProviderAuthGrantId = typeof ProviderAuthGrantIdSchema.Type;
  type SecretMaterialId (line 53) | type SecretMaterialId = typeof SecretMaterialIdSchema.Type;
  type PolicyId (line 54) | type PolicyId = typeof PolicyIdSchema.Type;
  type ExecutionId (line 55) | type ExecutionId = typeof ExecutionIdSchema.Type;
  type ExecutionInteractionId (line 56) | type ExecutionInteractionId = typeof ExecutionInteractionIdSchema.Type;
  type ExecutionStepId (line 57) | type ExecutionStepId = typeof ExecutionStepIdSchema.Type;

FILE: packages/platform/control-plane/src/schema/models/auth-artifact.ts
  type SecretRef (line 221) | type SecretRef = typeof SecretRefSchema.Type;
  type AuthArtifactSlot (line 222) | type AuthArtifactSlot = typeof AuthArtifactSlotSchema.Type;
  type CredentialSlot (line 223) | type CredentialSlot = typeof CredentialSlotSchema.Type;
  type AuthArtifactKind (line 224) | type AuthArtifactKind = typeof AuthArtifactKindSchema.Type;
  type AuthGrantSet (line 225) | type AuthGrantSet = typeof AuthGrantSetSchema.Type;
  type RequestPlacementPart (line 226) | type RequestPlacementPart = typeof RequestPlacementPartSchema.Type;
  type RequestPlacementTemplate (line 227) | type RequestPlacementTemplate = typeof RequestPlacementTemplateSchema.Type;
  type RequestPlacement (line 228) | type RequestPlacement = typeof RequestPlacementSchema.Type;
  type OAuth2ClientAuthenticationMethod (line 229) | type OAuth2ClientAuthenticationMethod =
  type BuiltInAuthArtifactKind (line 231) | type BuiltInAuthArtifactKind = typeof BuiltInAuthArtifactKindSchema.Type;
  type StaticBearerAuthArtifactConfig (line 232) | type StaticBearerAuthArtifactConfig = typeof StaticBearerAuthArtifactCon...
  type StaticOAuth2AuthArtifactConfig (line 233) | type StaticOAuth2AuthArtifactConfig = typeof StaticOAuth2AuthArtifactCon...
  type StaticPlacementsAuthArtifactConfig (line 234) | type StaticPlacementsAuthArtifactConfig = typeof StaticPlacementsAuthArt...
  type RefreshableOAuth2AuthorizedUserAuthArtifactConfig (line 235) | type RefreshableOAuth2AuthorizedUserAuthArtifactConfig =
  type ProviderGrantRefAuthArtifactConfig (line 237) | type ProviderGrantRefAuthArtifactConfig =
  type McpOAuthAuthArtifactConfig (line 239) | type McpOAuthAuthArtifactConfig = typeof McpOAuthAuthArtifactConfigSchem...
  type AuthArtifact (line 240) | type AuthArtifact = typeof AuthArtifactSchema.Type;
  type DecodedBuiltInAuthArtifactConfig (line 242) | type DecodedBuiltInAuthArtifactConfig =

FILE: packages/platform/control-plane/src/schema/models/auth-lease.ts
  type AuthLease (line 33) | type AuthLease = typeof AuthLeaseSchema.Type;

FILE: packages/platform/control-plane/src/schema/models/auth/account.ts
  type Account (line 29) | type Account = typeof AccountSchema.Type;

FILE: packages/platform/control-plane/src/schema/models/auth/principal.ts
  type PrincipalProvider (line 19) | type PrincipalProvider = typeof PrincipalProviderSchema.Type;
  type Principal (line 20) | type Principal = typeof PrincipalSchema.Type;

FILE: packages/platform/control-plane/src/schema/models/code-migration.ts
  type StoredCodeMigrationRecord (line 10) | type StoredCodeMigrationRecord =

FILE: packages/platform/control-plane/src/schema/models/execution.ts
  type ExecutionStatus (line 125) | type ExecutionStatus = typeof ExecutionStatusSchema.Type;
  type Execution (line 126) | type Execution = typeof ExecutionSchema.Type;
  type ExecutionInteractionStatus (line 127) | type ExecutionInteractionStatus = typeof ExecutionInteractionStatusSchem...
  type ExecutionInteraction (line 128) | type ExecutionInteraction = typeof ExecutionInteractionSchema.Type;
  type ExecutionEnvelope (line 129) | type ExecutionEnvelope = typeof ExecutionEnvelopeSchema.Type;
  type ExecutionStepKind (line 130) | type ExecutionStepKind = typeof ExecutionStepKindSchema.Type;
  type ExecutionStepStatus (line 131) | type ExecutionStepStatus = typeof ExecutionStepStatusSchema.Type;
  type ExecutionStep (line 132) | type ExecutionStep = typeof ExecutionStepSchema.Type;

FILE: packages/platform/control-plane/src/schema/models/local-config.ts
  type SchemaTypeOf (line 71) | type SchemaTypeOf<TSchema> = TSchema extends { readonly Type: infer T } ...
  type LocalConfigSourceEntryBase (line 72) | type LocalConfigSourceEntryBase = typeof LocalConfigSourceEntryBaseSchem...
  type LocalConfigSourceFromAdapter (line 74) | type LocalConfigSourceFromAdapter<
  type LocalConfigSource (line 87) | type LocalConfigSource = LocalConfigSourceFromAdapter<
  type LocalConfigSecretProviderSource (line 159) | type LocalConfigSecretProviderSource =
  type LocalConfigSecretProvider (line 161) | type LocalConfigSecretProvider =
  type LocalConfigExplicitSecretRef (line 163) | type LocalConfigExplicitSecretRef =
  type LocalConfigSecretInput (line 165) | type LocalConfigSecretInput = typeof LocalConfigSecretInputSchema.Type;
  type LocalConfigPolicy (line 166) | type LocalConfigPolicy = typeof LocalConfigPolicySchema.Type;
  type LocalConfigSecrets (line 167) | type LocalConfigSecrets = typeof LocalConfigSecretsSchema.Type;
  type LocalExecutorRuntime (line 168) | type LocalExecutorRuntime = typeof LocalExecutorRuntimeSchema.Type;
  type LocalExecutorConfig (line 169) | type LocalExecutorConfig = typeof LocalExecutorConfigSchema.Type;

FILE: packages/platform/control-plane/src/schema/models/local-installation.ts
  type LocalInstallation (line 16) | type LocalInstallation = typeof LocalInstallationSchema.Type;

FILE: packages/platform/control-plane/src/schema/models/policy.ts
  type LocalWorkspacePolicyEffect (line 25) | type LocalWorkspacePolicyEffect = typeof LocalWorkspacePolicyEffectSchem...
  type LocalWorkspacePolicyApprovalMode (line 26) | type LocalWorkspacePolicyApprovalMode =
  type LocalWorkspacePolicy (line 28) | type LocalWorkspacePolicy = typeof LocalWorkspacePolicySchema.Type;

FILE: packages/platform/control-plane/src/schema/models/provider-auth-grant.ts
  type ProviderAuthGrant (line 34) | type ProviderAuthGrant = typeof ProviderAuthGrantSchema.Type;

FILE: packages/platform/control-plane/src/schema/models/secret-material.ts
  type SecretMaterialPurpose (line 24) | type SecretMaterialPurpose = typeof SecretMaterialPurposeSchema.Type;
  type SecretMaterial (line 25) | type SecretMaterial = typeof SecretMaterialSchema.Type;

FILE: packages/platform/control-plane/src/schema/models/source-auth-session.ts
  type JsonValue (line 28) | type JsonValue =
  type JsonObject (line 36) | type JsonObject = {
  type SourceAuthSessionProviderKind (line 148) | type SourceAuthSessionProviderKind = typeof SourceAuthSessionProviderKin...
  type SourceAuthSessionStatus (line 149) | type SourceAuthSessionStatus = typeof SourceAuthSessionStatusSchema.Type;
  type McpSourceAuthSessionData (line 150) | type McpSourceAuthSessionData = typeof McpSourceAuthSessionDataSchema.Type;
  type OAuth2PkceSourceAuthSessionData (line 151) | type OAuth2PkceSourceAuthSessionData =
  type ProviderOauthTargetSource (line 153) | type ProviderOauthTargetSource = typeof ProviderOauthTargetSourceSchema....
  type ProviderOauthBatchSourceAuthSessionData (line 154) | type ProviderOauthBatchSourceAuthSessionData =
  type SourceAuthSession (line 156) | type SourceAuthSession = typeof SourceAuthSessionSchema.Type;

FILE: packages/platform/control-plane/src/schema/models/source-catalog.ts
  type SourceCatalogKind (line 48) | type SourceCatalogKind = typeof SourceCatalogKindSchema.Type;
  type SourceCatalogAdapterKey (line 49) | type SourceCatalogAdapterKey = typeof SourceCatalogAdapterKeySchema.Type;
  type SourceCatalogVisibility (line 50) | type SourceCatalogVisibility = typeof SourceCatalogVisibilitySchema.Type;
  type StoredSourceCatalogRecord (line 51) | type StoredSourceCatalogRecord = typeof StoredSourceCatalogRecordSchema....
  type StoredSourceCatalogRevisionRecord (line 52) | type StoredSourceCatalogRevisionRecord = typeof StoredSourceCatalogRevis...

FILE: packages/platform/control-plane/src/schema/models/source-inspection.ts
  type SourceInspectionPipelineKind (line 117) | type SourceInspectionPipelineKind =
  type SourceInspectionToolSummary (line 119) | type SourceInspectionToolSummary =
  type SourceInspectionFactItem (line 121) | type SourceInspectionFactItem =
  type SourceInspectionFactsSection (line 123) | type SourceInspectionFactsSection =
  type SourceInspectionMarkdownSection (line 125) | type SourceInspectionMarkdownSection =
  type SourceInspectionCodeSection (line 127) | type SourceInspectionCodeSection =
  type SourceInspectionSection (line 129) | type SourceInspectionSection =
  type SourceInspectionToolListItem (line 131) | type SourceInspectionToolListItem =
  type SourceInspectionToolContractSide (line 133) | type SourceInspectionToolContractSide =
  type SourceInspectionToolContract (line 135) | type SourceInspectionToolContract =
  type SourceInspection (line 137) | type SourceInspection = typeof SourceInspectionSchema.Type;
  type SourceInspectionToolDetail (line 138) | type SourceInspectionToolDetail =
  type SourceInspectionDiscoverPayload (line 140) | type SourceInspectionDiscoverPayload =
  type SourceInspectionDiscoverResultItem (line 142) | type SourceInspectionDiscoverResultItem =
  type SourceInspectionDiscoverResult (line 144) | type SourceInspectionDiscoverResult =

FILE: packages/platform/control-plane/src/schema/models/source-oauth-client.ts
  type WorkspaceSourceOauthClient (line 39) | type WorkspaceSourceOauthClient = typeof WorkspaceSourceOauthClientSchem...
  type WorkspaceSourceOauthClientRedirectMode (line 40) | type WorkspaceSourceOauthClientRedirectMode =
  type WorkspaceSourceOauthClientMetadata (line 42) | type WorkspaceSourceOauthClientMetadata =
  type SourceOauthClientInput (line 44) | type SourceOauthClientInput = typeof SourceOauthClientInputSchema.Type;

FILE: packages/platform/control-plane/src/schema/models/source.ts
  type SourceKind (line 193) | type SourceKind = typeof SourceKindSchema.Type;
  type SourceStatus (line 194) | type SourceStatus = typeof SourceStatusSchema.Type;
  type SourceTransport (line 195) | type SourceTransport = typeof SourceTransportSchema.Type;
  type SourceImportAuthPolicy (line 196) | type SourceImportAuthPolicy = typeof SourceImportAuthPolicySchema.Type;
  type SourceAuth (line 197) | type SourceAuth = typeof SourceAuthSchema.Type;
  type SourceBinding (line 198) | type SourceBinding = typeof SourceBindingSchema.Type;
  type StoredSourceRecord (line 199) | type StoredSourceRecord = typeof StoredSourceRecordSchema.Type;
  type StringMap (line 200) | type StringMap = typeof StringMapSchema.Type;
  type Source (line 201) | type Source = typeof SourceSchema.Type;

FILE: packages/platform/control-plane/src/schema/models/workspace-oauth-client.ts
  type WorkspaceOauthClient (line 22) | type WorkspaceOauthClient = typeof WorkspaceOauthClientSchema.Type;

FILE: packages/platform/server/src/config.ts
  constant EXECUTOR_HOME_ENV (line 8) | const EXECUTOR_HOME_ENV = "EXECUTOR_HOME";
  constant EXECUTOR_DATA_DIR_ENV (line 9) | const EXECUTOR_DATA_DIR_ENV = "EXECUTOR_DATA_DIR";
  constant EXECUTOR_LOCAL_DATA_DIR_ENV (line 10) | const EXECUTOR_LOCAL_DATA_DIR_ENV = "EXECUTOR_LOCAL_DATA_DIR";
  constant EXECUTOR_SERVER_PID_FILE_ENV (line 11) | const EXECUTOR_SERVER_PID_FILE_ENV = "EXECUTOR_SERVER_PID_FILE";
  constant EXECUTOR_SERVER_LOG_FILE_ENV (line 12) | const EXECUTOR_SERVER_LOG_FILE_ENV = "EXECUTOR_SERVER_LOG_FILE";
  constant EXECUTOR_WEB_ASSETS_DIR_ENV (line 13) | const EXECUTOR_WEB_ASSETS_DIR_ENV = "EXECUTOR_WEB_ASSETS_DIR";
  constant EXECUTOR_TRACE_ENABLED_ENV (line 14) | const EXECUTOR_TRACE_ENABLED_ENV = "EXECUTOR_TRACE_ENABLED";
  constant EXECUTOR_TRACE_OTLP_ENDPOINT_ENV (line 15) | const EXECUTOR_TRACE_OTLP_ENDPOINT_ENV = "EXECUTOR_TRACE_OTLP_ENDPOINT";
  constant EXECUTOR_TRACE_OTLP_HTTP_ENDPOINT_ENV (line 16) | const EXECUTOR_TRACE_OTLP_HTTP_ENDPOINT_ENV = "EXECUTOR_TRACE_OTLP_HTTP_...
  constant EXECUTOR_TRACE_SERVICE_NAME_ENV (line 17) | const EXECUTOR_TRACE_SERVICE_NAME_ENV = "EXECUTOR_TRACE_SERVICE_NAME";
  constant EXECUTOR_TRACE_QUERY_BASE_URL_ENV (line 18) | const EXECUTOR_TRACE_QUERY_BASE_URL_ENV = "EXECUTOR_TRACE_QUERY_BASE_URL";
  constant DEFAULT_SERVER_PORT (line 35) | const DEFAULT_SERVER_PORT = 8788;
  constant DEFAULT_SERVER_HOST (line 36) | const DEFAULT_SERVER_HOST = "127.0.0.1";
  constant DEFAULT_SERVER_BASE_URL (line 37) | const DEFAULT_SERVER_BASE_URL = `http://${DEFAULT_SERVER_HOST}:${DEFAULT...
  constant DEFAULT_EXECUTOR_HOME (line 38) | const DEFAULT_EXECUTOR_HOME =
  constant DEFAULT_EXECUTOR_DATA_DIR (line 41) | const DEFAULT_EXECUTOR_DATA_DIR =
  constant DEFAULT_EXECUTOR_RUN_DIR (line 44) | const DEFAULT_EXECUTOR_RUN_DIR = explicitExecutorHome
  constant DEFAULT_LOCAL_DATA_DIR (line 50) | const DEFAULT_LOCAL_DATA_DIR =
  constant DEFAULT_SERVER_PID_FILE (line 54) | const DEFAULT_SERVER_PID_FILE =
  constant DEFAULT_SERVER_LOG_FILE (line 57) | const DEFAULT_SERVER_LOG_FILE =
  constant SERVER_START_TIMEOUT_MS (line 61) | const SERVER_START_TIMEOUT_MS = 5_000;
  constant SERVER_POLL_INTERVAL_MS (line 62) | const SERVER_POLL_INTERVAL_MS = 100;

FILE: packages/platform/server/src/effect-errors.ts
  class PlatformServerEffectError (line 3) | class PlatformServerEffectError extends Data.TaggedError(

FILE: packages/platform/server/src/env.ts
  type LoadMonorepoRootEnvOptions (line 4) | type LoadMonorepoRootEnvOptions = {

FILE: packages/platform/server/src/index.ts
  type StaticUiOptions (line 65) | type StaticUiOptions = {
  type LocalExecutorServer (line 70) | type LocalExecutorServer = {
  type StartLocalExecutorServerOptions (line 77) | type StartLocalExecutorServerOptions = {
  type LocalExecutorRequestHandler (line 88) | type LocalExecutorRequestHandler = {
  type ControlPlaneWebHandler (line 95) | type ControlPlaneWebHandler = ReturnType<typeof HttpApiBuilder.toWebHand...
  type ExecutorMcpHandler (line 96) | type ExecutorMcpHandler = ReturnType<typeof createExecutorMcpRequestHand...

FILE: packages/platform/server/src/tracing.ts
  constant DEFAULT_TRACE_OTLP_ENDPOINT (line 14) | const DEFAULT_TRACE_OTLP_ENDPOINT = "http://127.0.0.1:4317";
  constant DEFAULT_TRACE_QUERY_BASE_URL (line 15) | const DEFAULT_TRACE_QUERY_BASE_URL = "http://127.0.0.1:16686";
  constant DEFAULT_TRACE_SERVICE_NAME (line 16) | const DEFAULT_TRACE_SERVICE_NAME = "executor-local";
  type LocalTracingRuntime (line 18) | type LocalTracingRuntime = {

FILE: packages/sources/core/src/catalog-sync-result.ts
  type SourceCatalogSyncResult (line 11) | type SourceCatalogSyncResult = {

FILE: packages/sources/core/src/catalog-types.ts
  type CatalogSourceDocumentInput (line 8) | type CatalogSourceDocumentInput = {
  type BaseCatalogOperationInput (line 15) | type BaseCatalogOperationInput = {
  type CatalogFragmentBuilder (line 24) | type CatalogFragmentBuilder = {
  type JsonSchemaImporter (line 36) | type JsonSchemaImporter = {
  type CatalogFragmentBuildContext (line 45) | type CatalogFragmentBuildContext = {
  constant EXECUTABLE_BINDING_VERSION (line 52) | const EXECUTABLE_BINDING_VERSION = 1;

FILE: packages/sources/core/src/composition.ts
  type SchemaTypeOf (line 6) | type SchemaTypeOf<TSchema> = TSchema extends { readonly Type: infer T } ...
  type AdapterUnion (line 7) | type AdapterUnion<TAdapters extends readonly SourceAdapter[]> = TAdapter...
  type ConnectPayloadSchema (line 8) | type ConnectPayloadSchema<TAdapters extends readonly SourceAdapter[]> =
  type ExecutorAddInputSchema (line 10) | type ExecutorAddInputSchema<TAdapters extends readonly SourceAdapter[]> =
  type ConnectableSourceAdapter (line 13) | type ConnectableSourceAdapter<TAdapter extends SourceAdapter = SourceAda...
  type ExecutorAddableSourceAdapter (line 17) | type ExecutorAddableSourceAdapter<TAdapter extends SourceAdapter = Sourc...
  type LocalConfigurableSourceAdapter (line 21) | type LocalConfigurableSourceAdapter<TAdapter extends SourceAdapter = Sou...
  type SourceAdapterComposition (line 88) | type SourceAdapterComposition = ReturnType<typeof createSourceAdapterCom...

FILE: packages/sources/core/src/discovery-models.ts
  type SourceDiscoveryKind (line 85) | type SourceDiscoveryKind = typeof SourceDiscoveryKindSchema.Type;
  type SourceDiscoveryConfidence (line 86) | type SourceDiscoveryConfidence = typeof SourceDiscoveryConfidenceSchema....
  type SourceDiscoveryAuthKind (line 87) | type SourceDiscoveryAuthKind = typeof SourceDiscoveryAuthKindSchema.Type;
  type SourceDiscoveryAuthParameterLocation (line 88) | type SourceDiscoveryAuthParameterLocation =
  type SourceProbeAuth (line 90) | type SourceProbeAuth = typeof SourceProbeAuthSchema.Type;
  type SourceAuthInference (line 91) | type SourceAuthInference = typeof SourceAuthInferenceSchema.Type;
  type SourceDiscoveryResult (line 92) | type SourceDiscoveryResult = typeof SourceDiscoveryResultSchema.Type;

FILE: packages/sources/core/src/discovery.ts
  constant SOURCE_DISCOVERY_TIMEOUT_MS (line 9) | const SOURCE_DISCOVERY_TIMEOUT_MS = 5_000;
  type HttpProbeResponse (line 11) | type HttpProbeResponse = {
  type SourceDiscoveryProbeInput (line 17) | type SourceDiscoveryProbeInput = {

FILE: packages/sources/core/src/effect-errors.ts
  class SourceCoreEffectError (line 3) | class SourceCoreEffectError extends Data.TaggedError(

FILE: packages/sources/core/src/registry.ts
  type SourceAdapterRegistry (line 44) | type SourceAdapterRegistry = ReturnType<typeof createSourceAdapterRegist...

FILE: packages/sources/core/src/shared.ts
  class SourceCredentialRequiredError (line 97) | class SourceCredentialRequiredError extends Data.TaggedError(
    method constructor (line 103) | constructor(

FILE: packages/sources/core/src/source-models.ts
  type JsonValue (line 45) | type JsonValue =
  type JsonObject (line 53) | type JsonObject = {
  type SecretRef (line 175) | type SecretRef = typeof SecretRefSchema.Type;
  type CredentialSlot (line 176) | type CredentialSlot = typeof CredentialSlotSchema.Type;
  type SourceCatalogKind (line 177) | type SourceCatalogKind = typeof SourceCatalogKindSchema.Type;
  type SourceKind (line 178) | type SourceKind = typeof SourceKindSchema.Type;
  type SourceStatus (line 179) | type SourceStatus = typeof SourceStatusSchema.Type;
  type SourceTransport (line 180) | type SourceTransport = typeof SourceTransportSchema.Type;
  type SourceImportAuthPolicy (line 181) | type SourceImportAuthPolicy = typeof SourceImportAuthPolicySchema.Type;
  type StringMap (line 182) | type StringMap = typeof StringMapSchema.Type;
  type StringArray (line 183) | type StringArray = typeof StringArraySchema.Type;
  type SourceAuth (line 184) | type SourceAuth = typeof SourceAuthSchema.Type;
  type SourceBinding (line 185) | type SourceBinding = typeof SourceBindingSchema.Type;
  type Source (line 186) | type Source = typeof SourceSchema.Type;
  type StoredSourceRecord (line 187) | type StoredSourceRecord = typeof StoredSourceRecordSchema.Type;
  type WorkspaceSourceOauthClientRedirectMode (line 188) | type WorkspaceSourceOauthClientRedirectMode =
  type SourceOauthClientInput (line 190) | type SourceOauthClientInput = typeof SourceOauthClientInputSchema.Type;

FILE: packages/sources/core/src/types.ts
  type RequestPlacement (line 27) | type RequestPlacement =
  type ResolvedSourceAuthMaterial (line 49) | type ResolvedSourceAuthMaterial = {
  type SecretMaterialResolveContext (line 60) | type SecretMaterialResolveContext = {
  type ResolveSecretMaterial (line 64) | type ResolveSecretMaterial = (input: {
  type SourceAdapterConnectStrategy (line 69) | type SourceAdapterConnectStrategy = "direct" | "interactive" | "none";
  type SourceAdapterCredentialStrategy (line 71) | type SourceAdapterCredentialStrategy =
  type SourceAdapterInputSchema (line 76) | type SourceAdapterInputSchema = Schema.Schema<any, any, never>;
  type SourceBindingState (line 78) | type SourceBindingState = {
  type StoredSourceBindingConfig (line 90) | type StoredSourceBindingConfig = Pick<SourceBinding, "version" | "payloa...
  type SourceAdapterSyncInput (line 92) | type SourceAdapterSyncInput = {
  type SourceAdapterOauth2SetupConfig (line 102) | type SourceAdapterOauth2SetupConfig = {
  type SourceAdapterInvokeResult (line 113) | type SourceAdapterInvokeResult = {
  type SourceAdapterInvokeInput (line 120) | type SourceAdapterInvokeInput = {
  type SourceAdapterDiscoveryInput (line 132) | type SourceAdapterDiscoveryInput = {
  type SourceAdapter (line 137) | type SourceAdapter = {

FILE: packages/sources/google-discovery/src/adapter.ts
  type GoogleDiscoveryBindingConfig (line 94) | type GoogleDiscoveryBindingConfig =
  constant GOOGLE_DISCOVERY_BINDING_CONFIG_VERSION (line 97) | const GOOGLE_DISCOVERY_BINDING_CONFIG_VERSION = 1;

FILE: packages/sources/google-discovery/src/catalog.ts
  type GoogleDiscoveryCatalogOperationInput (line 44) | type GoogleDiscoveryCatalogOperationInput = BaseCatalogOperationInput & {

FILE: packages/sources/google-discovery/src/document.ts
  type JsonObject (line 12) | type JsonObject = Record<string, unknown>;
  type DiscoveryParameter (line 14) | type DiscoveryParameter = {
  type DiscoverySchema (line 26) | type DiscoverySchema = {
  type DiscoveryMethod (line 40) | type DiscoveryMethod = {
  type DiscoveryResource (line 54) | type DiscoveryResource = {
  type DiscoveryDocument (line 59) | type DiscoveryDocument = {

FILE: packages/sources/google-discovery/src/tools.ts
  type CreateGoogleDiscoveryToolFromDefinitionInput (line 358) | type CreateGoogleDiscoveryToolFromDefinitionInput = {
  type GoogleDiscoveryToolPresentation (line 375) | type GoogleDiscoveryToolPresentation = {

FILE: packages/sources/google-discovery/src/types.ts
  constant GOOGLE_DISCOVERY_HTTP_METHODS (line 3) | const GOOGLE_DISCOVERY_HTTP_METHODS = [
  type GoogleDiscoveryHttpMethod (line 113) | type GoogleDiscoveryHttpMethod = typeof GoogleDiscoveryHttpMethodSchema....
  type GoogleDiscoveryParameterLocation (line 114) | type GoogleDiscoveryParameterLocation =
  type GoogleDiscoveryMethodParameter (line 116) | type GoogleDiscoveryMethodParameter =
  type GoogleDiscoveryInvocationPayload (line 118) | type GoogleDiscoveryInvocationPayload =
  type GoogleDiscoveryToolProviderData (line 120) | type GoogleDiscoveryToolProviderData =
  type GoogleDiscoveryManifestMethod (line 122) | type GoogleDiscoveryManifestMethod =
  type GoogleDiscoverySchemaRefTable (line 124) | type GoogleDiscoverySchemaRefTable =
  type GoogleDiscoveryToolManifest (line 126) | type GoogleDiscoveryToolManifest =
  type GoogleDiscoveryToolDefinition (line 129) | type GoogleDiscoveryToolDefinition = GoogleDiscoveryManifestMethod;

FILE: packages/sources/graphql/src/adapter.ts
  type GraphqlBindingConfig (line 72) | type GraphqlBindingConfig = typeof GraphqlBindingConfigSchema.Type;
  constant GRAPHQL_BINDING_CONFIG_VERSION (line 78) | const GRAPHQL_BINDING_CONFIG_VERSION = 1;
  constant GRAPHQL_INTROSPECTION_TIMEOUT_MS (line 79) | const GRAPHQL_INTROSPECTION_TIMEOUT_MS = 15_000;

FILE: packages/sources/graphql/src/catalog.ts
  type GraphqlCatalogOperationInput (line 37) | type GraphqlCatalogOperationInput = BaseCatalogOperationInput & {

FILE: packages/sources/graphql/src/graphql-tools.ts
  type JsonSchema (line 47) | type JsonSchema = Record<string, unknown>;
  type GraphqlSchemaRefTable (line 48) | type GraphqlSchemaRefTable = Record<string, string>;
  type GraphqlOperationType (line 50) | type GraphqlOperationType = "query" | "mutation";
  constant GRAPHQL_PRESENTATION_TYPE_MAX_LENGTH (line 52) | const GRAPHQL_PRESENTATION_TYPE_MAX_LENGTH = 320;
  type GraphqlManifestToolBase (line 54) | type GraphqlManifestToolBase = {
  type GraphqlRequestToolManifestEntry (line 64) | type GraphqlRequestToolManifestEntry = GraphqlManifestToolBase & {
  type GraphqlFieldToolManifestEntry (line 68) | type GraphqlFieldToolManifestEntry = GraphqlManifestToolBase & {
  type GraphqlToolManifestEntry (line 79) | type GraphqlToolManifestEntry =
  type GraphqlToolManifest (line 83) | type GraphqlToolManifest = {
  type GraphqlToolDefinition (line 93) | type GraphqlToolDefinition = {
  type GraphqlToolPresentation (line 107) | type GraphqlToolPresentation = {
  type GraphqlToolPresentationResolver (line 116) | type GraphqlToolPresentationResolver = {
  type SelectedGraphqlOutput (line 120) | type SelectedGraphqlOutput = {
  type GraphqlHttpInvocation (line 125) | type GraphqlHttpInvocation = {
  constant BLOCKED_RESPONSE_HEADER_NAMES (line 137) | const BLOCKED_RESPONSE_HEADER_NAMES = new Set([
  constant PREFERRED_LEAF_FIELD_NAMES (line 151) | const PREFERRED_LEAF_FIELD_NAMES = [
  constant PREFERRED_NESTED_FIELD_NAMES (line 165) | const PREFERRED_NESTED_FIELD_NAMES = [
  constant GRAPHQL_REQUEST_INPUT_SCHEMA (line 339) | const GRAPHQL_REQUEST_INPUT_SCHEMA = {
  constant GRAPHQL_REQUEST_OUTPUT_SCHEMA (line 367) | const GRAPHQL_REQUEST_OUTPUT_SCHEMA = {
  constant GRAPHQL_INTROSPECTION_QUERY (line 385) | const GRAPHQL_INTROSPECTION_QUERY = getIntrospectionQuery({
  constant GRAPHQL_SCHEMA_REF_PREFIX (line 458) | const GRAPHQL_SCHEMA_REF_PREFIX = "#/$defs/graphql";
  type GraphqlFieldToolDraft (line 1012) | type GraphqlFieldToolDraft = Omit<GraphqlFieldToolManifestEntry, "toolId...
  method resolve (line 1260) | resolve(definition) {

FILE: packages/sources/graphql/src/provider-data.ts
  type GraphqlToolKind (line 23) | type GraphqlToolKind = typeof GraphqlToolKindSchema.Type;
  type GraphqlOperationType (line 24) | type GraphqlOperationType = typeof GraphqlOperationTypeSchema.Type;
  type GraphqlToolProviderData (line 25) | type GraphqlToolProviderData = typeof GraphqlToolProviderDataSchema.Type;

FILE: packages/sources/mcp/src/adapter.ts
  type McpBindingConfig (line 119) | type McpBindingConfig = typeof McpBindingConfigSchema.Type;
  type McpExecutableBinding (line 145) | type McpExecutableBinding = typeof McpExecutableBindingSchema.Type;
  constant MCP_BINDING_CONFIG_VERSION (line 147) | const MCP_BINDING_CONFIG_VERSION = 1;

FILE: packages/sources/mcp/src/catalog.ts
  type McpCatalogOperationInput (line 41) | type McpCatalogOperationInput = BaseCatalogOperationInput & {

FILE: packages/sources/mcp/src/connection-pool.ts
  class McpConnectionPoolError (line 8) | class McpConnectionPoolError extends Data.TaggedError("McpConnectionPool...
  type PoolEntry (line 14) | type PoolEntry = {

FILE: packages/sources/mcp/src/connection.ts
  type McpTransportPreference (line 10) | type McpTransportPreference = "auto" | "streamable-http" | "sse" | "stdio";
  type CreateSdkMcpConnectorInput (line 12) | type CreateSdkMcpConnectorInput = {
  class McpConnectionError (line 26) | class McpConnectionError extends Data.TaggedError("McpConnectionError")<{
  type FetchInput (line 71) | type FetchInput = Parameters<typeof fetch>[0];
  type FetchInit (line 72) | type FetchInit = Parameters<typeof fetch>[1];
  type DynamicImport (line 107) | type DynamicImport = <TModule>(specifier: string) => Promise<TModule>;

FILE: packages/sources/mcp/src/elicitation-bridge.ts
  type McpClientWithElicitationHandler (line 79) | type McpClientWithElicitationHandler = {

FILE: packages/sources/mcp/src/elicitation-form.test.ts
  type McpTestPair (line 16) | type McpTestPair = {

FILE: packages/sources/mcp/src/elicitation.url.test.ts
  type UrlMcpServer (line 17) | type UrlMcpServer = {

FILE: packages/sources/mcp/src/manifest.ts
  type McpToolAnnotations (line 6) | type McpToolAnnotations = {
  type McpToolExecution (line 14) | type McpToolExecution = {
  type McpServerInfo (line 18) | type McpServerInfo = {
  type McpServerCapabilities (line 27) | type McpServerCapabilities = {
  type McpServerMetadata (line 48) | type McpServerMetadata = {
  type McpListToolsMetadata (line 56) | type McpListToolsMetadata = {
  type McpToolManifestEntry (line 62) | type McpToolManifestEntry = {
  type McpToolManifest (line 77) | type McpToolManifest = {

FILE: packages/sources/mcp/src/tools.test.ts
  type RealMcpServer (line 47) | type RealMcpServer = {

FILE: packages/sources/mcp/src/tools.ts
  type McpClientLike (line 40) | type McpClientLike = {
  type McpConnection (line 51) | type McpConnection = {
  type McpConnector (line 56) | type McpConnector = Effect.Effect<McpConnection, unknown, never>;
  type McpDiscoveryElicitationContext (line 58) | type McpDiscoveryElicitationContext = {
  type McpDiscoveryStage (line 67) | type McpDiscoveryStage = "connect" | "list_tools" | "call_tool";
  class McpToolsError (line 69) | class McpToolsError extends Data.TaggedError("McpToolsError")<{
  constant EXECUTION_SUSPENDED_SENTINEL (line 75) | const EXECUTION_SUSPENDED_SENTINEL = "__EXECUTION_SUSPENDED__";

FILE: packages/sources/openapi/openapi-extractor-rs/src/lib.rs
  constant OPEN_API_HTTP_METHODS (line 10) | const OPEN_API_HTTP_METHODS: [&str; 8] = [
  constant OPEN_API_PARAMETER_LOCATIONS (line 21) | const OPEN_API_PARAMETER_LOCATIONS: [&str; 4] = ["path", "query", "heade...
  type OpenApiToolParameter (line 24) | struct OpenApiToolParameter {
  type OpenApiToolRequestBody (line 32) | struct OpenApiToolRequestBody {
  type OpenApiInvocationPayload (line 39) | struct OpenApiInvocationPayload {
  type DiscoveryTypingPayload (line 48) | struct DiscoveryTypingPayload {
  type OpenApiExample (line 59) | struct OpenApiExample {
  type OpenApiParameterDocumentation (line 69) | struct OpenApiParameterDocumentation {
  type OpenApiRequestBodyDocumentation (line 81) | struct OpenApiRequestBodyDocumentation {
  type OpenApiResponseDocumentation (line 90) | struct OpenApiResponseDocumentation {
  type OpenApiToolDocumentation (line 101) | struct OpenApiToolDocumentation {
  type OpenApiExtractedTool (line 115) | struct OpenApiExtractedTool {
  type OpenApiToolManifest (line 134) | struct OpenApiToolManifest {
  function extract_manifest_json (line 142) | pub fn extract_manifest_json(
  function extract_manifest_json_wasm (line 159) | pub fn extract_manifest_json_wasm(
  function parse_openapi_document (line 167) | fn parse_openapi_document(input: &str) -> Result<Value, String> {
  function as_object (line 180) | fn as_object(value: &Value) -> Option<&Map<String, Value>> {
  function as_trimmed_string (line 184) | fn as_trimmed_string(value: Option<&Value>) -> Option<String> {
  function response_status_rank (line 193) | fn response_status_rank(status_code: &str) -> i32 {
  function to_stable_value (line 208) | fn to_stable_value(value: &Value) -> Value {
  function hash_unknown (line 250) | fn hash_unknown(value: &Value) -> Result<String, String> {
  function encode_stable_json (line 259) | fn encode_stable_json(value: &Value) -> Result<String, String> {
  function to_extracted_tool_parameter_from_record (line 263) | fn to_extracted_tool_parameter_from_record(record: &Map<String, Value>) ...
  function to_extracted_tool_parameter (line 284) | fn to_extracted_tool_parameter(root: &Value, value: &Value) -> Option<Op...
  function merge_parameters (line 289) | fn merge_parameters(root: &Value, path_item: &Map<String, Value>, operat...
  function extract_request_body (line 302) | fn extract_request_body(root: &Value, operation: &Map<String, Value>) ->...
  function build_invocation_metadata (line 312) | fn build_invocation_metadata(
  function collect_ref_keys (line 327) | fn collect_ref_keys(value: &Value, refs: &mut BTreeSet<String>) {
  function resolve_json_pointer (line 349) | fn resolve_json_pointer<'a>(root: &'a Value, pointer: &str) -> Option<&'...
  function resolve_local_reference_value (line 364) | fn resolve_local_reference_value(
  function resolve_local_reference_object (line 402) | fn resolve_local_reference_object(root: &Value, value: &Value) -> Option...
  function collect_parameter_record_by_key (line 406) | fn collect_parameter_record_by_key(
  function resolve_request_body_record (line 440) | fn resolve_request_body_record(root: &Value, operation: &Map<String, Val...
  function collect_content_types (line 444) | fn collect_content_types(content: Option<&Map<String, Value>>) -> Vec<St...
  function pick_content_entry (line 452) | fn pick_content_entry(content: Option<&Value>) -> Option<(String, Map<St...
  function pick_example_values (line 478) | fn pick_example_values(value: &Value, label: Option<String>, media_type:...
  function extract_examples_from_schema (line 515) | fn extract_examples_from_schema(schema: Option<&Value>) -> Result<Vec<Op...
  function extract_examples_from_media_type (line 523) | fn extract_examples_from_media_type(
  function pick_preferred_response_record (line 547) | fn pick_preferred_response_record(
  function pick_schema_from_content (line 573) | fn pick_schema_from_content(content: Option<&Value>) -> Option<Value> {
  function extract_request_body_schema (line 583) | fn extract_request_body_schema(root: &Value, operation: &Map<String, Val...
  function extract_response_schema (line 588) | fn extract_response_schema(root: &Value, operation: &Map<String, Value>)...
  function collect_parameter_schema_by_key (line 593) | fn collect_parameter_schema_by_key(
  function build_input_schema (line 611) | fn build_input_schema(
  function build_tool_typing (line 664) | fn build_tool_typing(
  function build_parameter_documentation (line 703) | fn build_parameter_documentation(
  function build_request_body_documentation (line 738) | fn build_request_body_documentation(
  function build_response_documentation (line 758) | fn build_response_documentation(
  function build_tool_documentation (line 782) | fn build_tool_documentation(
  function build_ref_hint_table (line 807) | fn build_ref_hint_table(open_api_spec: &Value, initial_ref_keys: &[Strin...
  function normalize_path_for_tool_id (line 843) | fn normalize_path_for_tool_id(path_value: &str) -> String {
  function build_operation_id (line 871) | fn build_operation_id(operation: &Map<String, Value>) -> Option<String> {
  function build_tags (line 875) | fn build_tags(operation: &Map<String, Value>) -> Vec<String> {
  function build_tool_id (line 891) | fn build_tool_id(method: &str, path_value: &str, operation: &Map<String,...
  function build_tool_name (line 899) | fn build_tool_name(method: &str, path_value: &str, operation: &Map<Strin...
  function build_tool_description (line 911) | fn build_tool_description(operation: &Map<String, Value>) -> Option<Stri...
  function ensure_unique_tool_ids (line 915) | fn ensure_unique_tool_ids(source_name: &str, tools: &[OpenApiExtractedTo...
  function extract_openapi_manifest (line 931) | fn extract_openapi_manifest(source_name: &str, openapi_spec: &Value) -> ...

FILE: packages/sources/openapi/openapi-extractor-rs/src/main.rs
  type Cli (line 8) | struct Cli {
  function main (line 19) | fn main() {
  function run (line 26) | fn run() -> Result<(), String> {
  function read_input_text (line 48) | fn read_input_text(input: &str) -> Result<String, String> {

FILE: packages/sources/openapi/src/adapter.ts
  type OpenApiBindingConfig (line 89) | type OpenApiBindingConfig = {
  constant OPENAPI_BINDING_CONFIG_VERSION (line 94) | const OPENAPI_BINDING_CONFIG_VERSION = 1;
  type OpenApiToolArgs (line 194) | type OpenApiToolArgs = Record<string, unknown>;
  type OpenApiToolParameter (line 195) | type OpenApiToolParameter =

FILE: packages/sources/openapi/src/catalog.ts
  type OpenApiCatalogOperationInput (line 52) | type OpenApiCatalogOperationInput = BaseCatalogOperationInput & {

FILE: packages/sources/openapi/src/definitions.ts
  constant VERSION_SEGMENT_REGEX (line 17) | const VERSION_SEGMENT_REGEX = /^v\d+(?:[._-]\d+)?$/i;
  constant IGNORED_PATH_SEGMENTS (line 18) | const IGNORED_PATH_SEGMENTS = new Set(["api"]);
  type OpenApiToolDefinition (line 157) | type OpenApiToolDefinition = typeof OpenApiToolDefinitionSchema.Type;
  type MutableOpenApiToolDefinition (line 159) | type MutableOpenApiToolDefinition = {

FILE: packages/sources/openapi/src/discovery.ts
  type OpenApiSecurityCandidate (line 22) | type OpenApiSecurityCandidate = {

FILE: packages/sources/openapi/src/extraction.real-specs.test.ts
  constant VERCEL_OPENAPI_SPEC_URL (line 9) | const VERCEL_OPENAPI_SPEC_URL = "https://openapi.vercel.sh/";
  type ParsedInputSchema (line 24) | type ParsedInputSchema = {

FILE: packages/sources/openapi/src/extraction.ts
  type OpenApiExtractionStage (line 20) | type OpenApiExtractionStage = "validate" | "extract";
  class OpenApiExtractionError (line 22) | class OpenApiExtractionError extends Data.TaggedError("OpenApiExtraction...

FILE: packages/sources/openapi/src/http-serialization.ts
  type OpenApiSerializableLocation (line 1) | type OpenApiSerializableLocation = "path" | "query" | "header" | "cookie";
  type OpenApiSerializableContent (line 3) | type OpenApiSerializableContent = {
  type OpenApiSerializableParameter (line 7) | type OpenApiSerializableParameter = {
  type OpenApiSerializableRequestBody (line 16) | type OpenApiSerializableRequestBody = {
  type HttpBodyDecodingMode (line 21) | type HttpBodyDecodingMode = "json" | "text" | "bytes";
  type SerializedOpenApiRequestBody (line 23) | type SerializedOpenApiRequestBody = {
  type SerializedOpenApiQueryEntry (line 28) | type SerializedOpenApiQueryEntry = {
  type SerializedOpenApiParameterValue (line 34) | type SerializedOpenApiParameterValue =

FILE: packages/sources/openapi/src/openapi-extractor-wasm/openapi_extractor.d.ts
  type InitInput (line 6) | type InitInput = RequestInfo | URL | Response | BufferSource | WebAssemb...
  type InitOutput (line 8) | interface InitOutput {
  type SyncInitInput (line 19) | type SyncInitInput = BufferSource | WebAssembly.Module;

FILE: packages/sources/openapi/src/openapi-extractor-wasm/openapi_extractor.js
  function extract_manifest_json_wasm (line 8) | function extract_manifest_json_wasm(source_name, openapi_document_text) {
  function __wbg_get_imports (line 31) | function __wbg_get_imports() {
  function getStringFromWasm0 (line 55) | function getStringFromWasm0(ptr, len) {
  function getUint8ArrayMemory0 (line 61) | function getUint8ArrayMemory0() {
  function passStringToWasm0 (line 68) | function passStringToWasm0(arg, malloc, realloc) {
  function takeFromExternrefTable0 (line 105) | function takeFromExternrefTable0(idx) {
  constant MAX_SAFARI_DECODE_BYTES (line 113) | const MAX_SAFARI_DECODE_BYTES = 2146435072;
  function decodeText (line 115) | function decodeText(ptr, len) {
  constant WASM_VECTOR_LEN (line 138) | let WASM_VECTOR_LEN = 0;
  function __wbg_finalize_init (line 141) | function __wbg_finalize_init(instance, module) {
  function __wbg_load (line 149) | async function __wbg_load(module, imports) {
  function initSync (line 184) | function initSync(module) {
  function __wbg_init (line 204) | async function __wbg_init(module_or_path) {

FILE: packages/sources/openapi/src/schema-refs.ts
  type JsonObject (line 1) | type JsonObject = Record<string, unknown>;
  type RefHintValue (line 2) | type RefHintValue = string | JsonObject;
  type DiscoveryTypingLike (line 4) | type DiscoveryTypingLike = {

FILE: packages/sources/openapi/src/tool-presentation.ts
  type OpenApiToolPresentation (line 299) | type OpenApiToolPresentation = {

FILE: packages/sources/openapi/src/tools.test.ts
  type TestServer (line 27) | type TestServer = {
  type BinaryTestServer (line 39) | type BinaryTestServer = {
  type EffectServerHandler (line 44) | type EffectServerHandler = {
  class GeneratedReposApi (line 277) | class GeneratedReposApi extends HttpApiGroup.make("repos")
  class GeneratedApi (line 297) | class GeneratedApi extends HttpApi.make("generated").add(GeneratedReposA...
  class GeneratedBinaryReportsApi (line 303) | class GeneratedBinaryReportsApi extends HttpApiGroup.make("reports")
  class GeneratedBinaryApi (line 309) | class GeneratedBinaryApi extends HttpApi.make("generatedBinary")

FILE: packages/sources/openapi/src/tools.ts
  type OpenApiToolArgs (line 45) | type OpenApiToolArgs = Record<string, unknown>;
  type OpenApiToolParameter (line 46) | type OpenApiToolParameter = OpenApiInvocationPayload["parameters"][number];
  class OpenApiToolInvocationError (line 48) | class OpenApiToolInvocationError extends Data.TaggedError(
  type CreateOpenApiToolsFromManifestInput (line 294) | type CreateOpenApiToolsFromManifestInput = {
  type CreateOpenApiToolFromDefinitionInput (line 440) | type CreateOpenApiToolFromDefinitionInput = {

FILE: packages/sources/openapi/src/types.ts
  type OpenApiJsonPrimitive (line 5) | type OpenApiJsonPrimitive = string | number | boolean | null;
  type OpenApiJsonValue (line 7) | type OpenApiJsonValue =
  type OpenApiJsonObject (line 12) | type OpenApiJsonObject = {
  type OpenApiSpecInput (line 16) | type OpenApiSpecInput = string | OpenAPISpec | OpenApiJsonObject;
  constant OPEN_API_HTTP_METHODS (line 18) | const OPEN_API_HTTP_METHODS = [
  constant OPEN_API_PARAMETER_LOCATIONS (line 29) | const OPEN_API_PARAMETER_LOCATIONS = [
  type OpenApiSecurityRequirement (line 157) | type OpenApiSecurityRequirement =
  type OpenApiHttpMethod (line 284) | type OpenApiHttpMethod = typeof OpenApiHttpMethodSchema.Type;
  type OpenApiParameterLocation (line 285) | type OpenApiParameterLocation = typeof OpenApiParameterLocationSchema.Type;
  type OpenApiToolParameter (line 286) | type OpenApiToolParameter = typeof OpenApiToolParameterSchema.Type;
  type OpenApiMediaContent (line 287) | type OpenApiMediaContent = typeof OpenApiMediaContentSchema.Type;
  type OpenApiHeader (line 288) | type OpenApiHeader = typeof OpenApiHeaderSchema.Type;
  type OpenApiToolRequestBody (line 289) | type OpenApiToolRequestBody = typeof OpenApiToolRequestBodySchema.Type;
  type OpenApiServer (line 290) | type OpenApiServer = typeof OpenApiServerSchema.Type;
  type OpenApiInvocationPayload (line 291) | type OpenApiInvocationPayload = typeof OpenApiInvocationPayloadSchema.Type;
  type DiscoveryTypingPayload (line 292) | type DiscoveryTypingPayload = typeof DiscoveryTypingPayloadSchema.Type;
  type OpenApiRefHintValue (line 293) | type OpenApiRefHintValue = typeof OpenApiRefHintValueSchema.Type;
  type OpenApiRefHintTable (line 294) | type OpenApiRefHintTable = typeof OpenApiRefHintTableSchema.Type;
  type OpenApiExample (line 295) | type OpenApiExample = typeof OpenApiExampleSchema.Type;
  type OpenApiParameterDocumentation (line 296) | type OpenApiParameterDocumentation = typeof OpenApiParameterDocumentatio...
  type OpenApiRequestBodyDocumentation (line 297) | type OpenApiRequestBodyDocumentation = typeof OpenApiRequestBodyDocument...
  type OpenApiResponseDocumentation (line 298) | type OpenApiResponseDocumentation = typeof OpenApiResponseDocumentationS...
  type OpenApiResponseVariant (line 299) | type OpenApiResponseVariant = typeof OpenApiResponseVariantSchema.Type;
  type OpenApiToolDocumentation (line 300) | type OpenApiToolDocumentation = typeof OpenApiToolDocumentationSchema.Type;
  type OpenApiOAuthFlow (line 301) | type OpenApiOAuthFlow = typeof OpenApiOAuthFlowSchema.Type;
  type OpenApiSecuritySchemeType (line 302) | type OpenApiSecuritySchemeType = typeof OpenApiSecuritySchemeTypeSchema....
  type OpenApiSecurityScheme (line 303) | type OpenApiSecurityScheme = typeof OpenApiSecuritySchemeSchema.Type;
  type OpenApiToolProviderData (line 304) | type OpenApiToolProviderData = typeof OpenApiToolProviderDataSchema.Type;
  type OpenApiExtractedTool (line 305) | type OpenApiExtractedTool = typeof OpenApiExtractedToolSchema.Type;
  type OpenApiToolManifest (line 306) | type OpenApiToolManifest = typeof OpenApiToolManifestSchema.Type;

FILE: tools/oxlint/rules/no-async-effect-vitest-tests.mjs
  method create (line 53) | create(context) {

FILE: tools/oxlint/rules/no-cross-workspace-relative-imports.mjs
  method create (line 25) | create(context) {

FILE: tools/oxlint/rules/no-direct-effect-tag-read.mjs
  method create (line 32) | create(context) {

FILE: tools/oxlint/rules/no-effect-run-in-effect-vitest-tests.mjs
  method create (line 80) | create(context) {

FILE: tools/oxlint/rules/no-node-fs-with-effect-imports.mjs
  method create (line 29) | create(context) {

FILE: tools/oxlint/rules/no-raw-effect-fail-errors.mjs
  constant BUILTIN_ERROR_NAMES (line 3) | const BUILTIN_ERROR_NAMES = new Set([
  method create (line 67) | create(context) {

FILE: tools/oxlint/rules/no-workspace-src-imports.mjs
  method create (line 29) | create(context) {

FILE: tools/oxlint/rules/no-yield-effect-fail.mjs
  method create (line 42) | create(context) {

FILE: tools/oxlint/workspace-utils.mjs
  constant DEFAULT_PACKAGE_SCOPES (line 6) | const DEFAULT_PACKAGE_SCOPES = ["@executor/"];
  method ImportDeclaration (line 97) | ImportDeclaration(node) {
  method ExportAllDeclaration (line 100) | ExportAllDeclaration(node) {
  method ExportNamedDeclaration (line 105) | ExportNamedDeclaration(node) {
  method ImportExpression (line 110) | ImportExpression(node) {
  method CallExpression (line 113) | CallExpression(node) {
Copy disabled (too large) Download .json
Condensed preview — 459 files, each showing path, character count, and a content snippet. Download the .json file for the full structured content (15,351K chars).
[
  {
    "path": ".changeset/README.md",
    "chars": 512,
    "preview": "# Changesets\n\nHello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that wo"
  },
  {
    "path": ".changeset/config.json",
    "chars": 271,
    "preview": "{\n  \"$schema\": \"https://unpkg.com/@changesets/config@3.1.3/schema.json\",\n  \"changelog\": \"@changesets/cli/changelog\",\n  \""
  },
  {
    "path": ".changeset/eleven-towns-brush.md",
    "chars": 59,
    "preview": "---\n\"executor\": patch\n---\n\nAuto migrate sources on startup\n"
  },
  {
    "path": ".changeset/fiery-pianos-argue.md",
    "chars": 75,
    "preview": "---\n\"executor\": patch\n---\n\nMove execution to adapters rather than IR model\n"
  },
  {
    "path": ".changeset/nice-bananas-hammer.md",
    "chars": 53,
    "preview": "---\n\"executor\": patch\n---\n\nFix legacy format parsing\n"
  },
  {
    "path": ".changeset/pre.json",
    "chars": 1150,
    "preview": "{\n  \"mode\": \"pre\",\n  \"tag\": \"beta\",\n  \"initialVersions\": {\n    \"@executor/docs\": \"0.0.0\",\n    \"executor\": \"1.2.3\",\n    \""
  },
  {
    "path": ".changeset/rude-shrimps-teach.md",
    "chars": 116,
    "preview": "---\n\"executor\": patch\n---\n\nFix Google Discovery tool execution for sources stored with discovery document endpoints\n"
  },
  {
    "path": ".changeset/two-vans-attend.md",
    "chars": 37,
    "preview": "---\n\"executor\": patch\n---\n\nFix build\n"
  },
  {
    "path": ".executor/executor.jsonc",
    "chars": 282,
    "preview": "{\n  \"sources\": {\n    \"vercel\": {\n      \"kind\": \"openapi\",\n      \"name\": \"Vercel API\",\n      \"connection\": {\n        \"end"
  },
  {
    "path": ".github/workflows/publish-executor-package.yml",
    "chars": 1847,
    "preview": "name: Publish Executor\nrun-name: \"${{ format('publish executor {0}', github.event_name == 'workflow_dispatch' && inputs."
  },
  {
    "path": ".github/workflows/release.yml",
    "chars": 3163,
    "preview": "name: Release\nrun-name: \"prepare release\"\n\non:\n  push:\n    branches:\n      - main\n\npermissions:\n  actions: write\n  conte"
  },
  {
    "path": ".gitignore",
    "chars": 1104,
    "preview": "# Environment variables\n.env\n.env.*\n!.env.example\n.env*.local\n\n# Vercel\n.vercel\n\n# Next.js\n.next/\n\n# Turbo\n.turbo/\n.turb"
  },
  {
    "path": ".oxlintrc.jsonc",
    "chars": 2196,
    "preview": "{\n  \"$schema\": \"./node_modules/oxlint/configuration_schema.json\",\n\n  // Keep the built-in default plugin set explicit so"
  },
  {
    "path": "ARCHITECTURE.md",
    "chars": 14237,
    "preview": "# Architecture\n\nThis document explains the active v3 architecture at a high level.\n\nIf `README.md` answers \"what is this"
  },
  {
    "path": "PLAN.md",
    "chars": 5758,
    "preview": "Executor:\n\nProject goal: Build an execution environment for agents to interact with APIs, MCPs, GraphQL, and other servi"
  },
  {
    "path": "README.md",
    "chars": 13363,
    "preview": "# executor\n\n\nhttps://github.com/user-attachments/assets/11225f83-e848-42ba-99b2-a993bcc88dad\n\n\n`executor` is a local-fir"
  },
  {
    "path": "TRACING.md",
    "chars": 780,
    "preview": "# Local Tracing\n\nStart Jaeger locally:\n\n```bash\nbun run trace:up\n```\n\nRun the web/server dev process with tracing enable"
  },
  {
    "path": "apps/docs/CHANGELOG.md",
    "chars": 26,
    "preview": "# @executor/docs\n\n## null\n"
  },
  {
    "path": "apps/docs/developer/adapters-and-formats.mdx",
    "chars": 3215,
    "preview": "---\ntitle: \"Adapters And Formats\"\ndescription: \"How executor supports multiple integration types without hardwiring the "
  },
  {
    "path": "apps/docs/developer/cli.mdx",
    "chars": 1724,
    "preview": "---\ntitle: \"CLI\"\ndescription: \"How the executor CLI fits into the system and why it stays thin.\"\n---\n\nThe CLI lives in `"
  },
  {
    "path": "apps/docs/developer/codemode.mdx",
    "chars": 2231,
    "preview": "---\ntitle: \"Code Mode\"\ndescription: \"The shared tool abstractions and adapter packages that connect sources to execution"
  },
  {
    "path": "apps/docs/developer/core-model.mdx",
    "chars": 3569,
    "preview": "---\ntitle: \"Core Model\"\ndescription: \"The main data and runtime concepts in executor today.\"\n---\n\nThe most important thi"
  },
  {
    "path": "apps/docs/developer/credentials-and-auth.mdx",
    "chars": 3241,
    "preview": "---\ntitle: \"Credentials And Auth\"\ndescription: \"How executor models auth, interactive flows, and actor-scoped credential"
  },
  {
    "path": "apps/docs/developer/extending-executor.mdx",
    "chars": 2725,
    "preview": "---\ntitle: \"Extending Executor\"\ndescription: \"How to add new source support without breaking the current architecture.\"\n"
  },
  {
    "path": "apps/docs/developer/import-fidelity.mdx",
    "chars": 7847,
    "preview": "---\ntitle: \"Import Fidelity\"\ndescription: \"What executor preserves, normalizes, and currently loses when importing exter"
  },
  {
    "path": "apps/docs/developer/mcp.mdx",
    "chars": 2033,
    "preview": "---\ntitle: \"MCP\"\ndescription: \"How executor uses MCP both as an adapter and as an external interface.\"\n---\n\nMCP shows up"
  },
  {
    "path": "apps/docs/developer/overview.mdx",
    "chars": 2995,
    "preview": "---\ntitle: \"Control Plane Overview\"\ndescription: \"How the control plane is structured today and how the major pieces fit"
  },
  {
    "path": "apps/docs/developer/persistence-and-migrations.mdx",
    "chars": 2530,
    "preview": "---\ntitle: \"Persistence And Migrations\"\ndescription: \"How executor stores source state today and how migration logic is "
  },
  {
    "path": "apps/docs/developer/tool-catalog-and-execution.mdx",
    "chars": 2564,
    "preview": "---\ntitle: \"Tool Catalog And Execution\"\ndescription: \"How source materialization becomes callable tools and how invocati"
  },
  {
    "path": "apps/docs/docs.json",
    "chars": 1511,
    "preview": "{\n  \"$schema\": \"https://mintlify.com/docs.json\",\n  \"theme\": \"mint\",\n  \"name\": \"Executor\",\n  \"description\": \"A local-firs"
  },
  {
    "path": "apps/docs/introduction.mdx",
    "chars": 852,
    "preview": "---\ntitle: \"Introduction\"\ndescription: \"A local-first execution environment for AI agents.\"\n---\n\n`executor` is a local-f"
  },
  {
    "path": "apps/docs/package.json",
    "chars": 270,
    "preview": "{\n  \"name\": \"@executor/docs\",\n  \"private\": true,\n  \"type\": \"module\",\n  \"scripts\": {\n    \"dev\": \"bunx --bun mint dev --no"
  },
  {
    "path": "apps/executor/CHANGELOG.md",
    "chars": 1190,
    "preview": "# executor\n\n## 1.2.4-beta.4\n\n### Patch Changes\n\n- ec5e3a3: Fix Google Discovery tool execution for sources stored with d"
  },
  {
    "path": "apps/executor/bin/executor",
    "chars": 129,
    "preview": "#!/usr/bin/env bash\nset -euo pipefail\nSCRIPT_DIR=\"$(cd \"$(dirname \"$0\")\" && pwd)\"\nexec bun \"$SCRIPT_DIR/../src/cli/main."
  },
  {
    "path": "apps/executor/package.json",
    "chars": 1530,
    "preview": "{\n  \"name\": \"executor\",\n  \"version\": \"1.2.4-beta.4\",\n  \"description\": \"Local AI executor with a CLI, local API server, a"
  },
  {
    "path": "apps/executor/src/cli/dev.ts",
    "chars": 5830,
    "preview": "import {\n  type ControlPlaneClient,\n  WorkspaceIdSchema,\n} from \"@executor/control-plane\";\nimport * as Effect from \"effe"
  },
  {
    "path": "apps/executor/src/cli/interaction-handling.test.ts",
    "chars": 1080,
    "preview": "import { describe, expect, it } from \"@effect/vitest\";\n\nimport { decideInteractionHandling } from \"./interaction-handlin"
  },
  {
    "path": "apps/executor/src/cli/interaction-handling.ts",
    "chars": 548,
    "preview": "import type { ParsedInteractionPayload } from \"./pending-interaction-output\";\n\nexport type InteractionHandling =\n  | \"ur"
  },
  {
    "path": "apps/executor/src/cli/main.ts",
    "chars": 43298,
    "preview": "import { spawn } from \"node:child_process\";\nimport { createRequire } from \"node:module\";\nimport { dirname } from \"node:p"
  },
  {
    "path": "apps/executor/src/cli/pending-interaction-output.test.ts",
    "chars": 3590,
    "preview": "import { describe, expect, it } from \"@effect/vitest\";\nimport type { ExecutionInteraction } from \"@executor/control-plan"
  },
  {
    "path": "apps/executor/src/cli/pending-interaction-output.ts",
    "chars": 4318,
    "preview": "import type { ExecutionInteraction } from \"@executor/control-plane\";\n\nconst isRecord = (value: unknown): value is Record"
  },
  {
    "path": "apps/executor/src/cli/runtime-paths.ts",
    "chars": 2671,
    "preview": "import { existsSync } from \"node:fs\";\nimport { dirname, extname, resolve } from \"node:path\";\nimport { fileURLToPath } fr"
  },
  {
    "path": "apps/executor/src/distribution/artifact.ts",
    "chars": 6115,
    "preview": "import { spawn } from \"node:child_process\";\nimport { existsSync } from \"node:fs\";\nimport { chmod, cp, mkdir, rm, writeFi"
  },
  {
    "path": "apps/executor/src/distribution/distribution.test.ts",
    "chars": 3705,
    "preview": "import { describe, expect, it } from \"@effect/vitest\";\nimport * as Effect from \"effect/Effect\";\n\nimport {\n  Distribution"
  },
  {
    "path": "apps/executor/src/distribution/harness.ts",
    "chars": 8667,
    "preview": "import { spawn } from \"node:child_process\";\nimport { createServer } from \"node:net\";\nimport { tmpdir } from \"node:os\";\ni"
  },
  {
    "path": "apps/executor/src/distribution/metadata.ts",
    "chars": 1333,
    "preview": "import { readFile } from \"node:fs/promises\";\nimport { dirname, resolve } from \"node:path\";\nimport { fileURLToPath } from"
  },
  {
    "path": "apps/executor/src/distribution/publish.ts",
    "chars": 5689,
    "preview": "import { spawn } from \"node:child_process\";\nimport { mkdir, rm } from \"node:fs/promises\";\nimport { join, resolve } from "
  },
  {
    "path": "apps/executor/src/effect-errors.ts",
    "chars": 1318,
    "preview": "import * as Data from \"effect/Data\";\n\nexport class ExecutorAppEffectError extends Data.TaggedError(\n  \"ExecutorAppEffect"
  },
  {
    "path": "apps/executor/src/server/server.real-ingestion.test.ts",
    "chars": 7095,
    "preview": "import { FileSystem } from \"@effect/platform\";\nimport { NodeFileSystem } from \"@effect/platform-node\";\nimport { describe"
  },
  {
    "path": "apps/executor/src/server/server.test.ts",
    "chars": 57886,
    "preview": "import { createServer, type IncomingMessage, type ServerResponse } from \"node:http\";\nimport { randomUUID } from \"node:cr"
  },
  {
    "path": "apps/executor/tsconfig.json",
    "chars": 297,
    "preview": "{\n  \"compilerOptions\": {\n    \"target\": \"ES2022\",\n    \"module\": \"ESNext\",\n    \"moduleResolution\": \"Bundler\",\n    \"strict\""
  },
  {
    "path": "apps/web/CHANGELOG.md",
    "chars": 92,
    "preview": "# @executor/web\n\n## null\n\n### Patch Changes\n\n- @executor/react@null\n- @executor/server@null\n"
  },
  {
    "path": "apps/web/package.json",
    "chars": 1142,
    "preview": "{\n  \"name\": \"@executor/web\",\n  \"private\": true,\n  \"type\": \"module\",\n  \"scripts\": {\n    \"dev\": \"bunx --bun vite dev\",\n   "
  },
  {
    "path": "apps/web/src/components/code-block.tsx",
    "chars": 2785,
    "preview": "import { useEffect, useState, useRef, useCallback } from \"react\";\nimport { codeToHtml, resolveLang } from \"../lib/shiki\""
  },
  {
    "path": "apps/web/src/components/document-panel.tsx",
    "chars": 838,
    "preview": "import { cn } from \"../lib/utils\";\nimport { CodeBlock } from \"./code-block\";\n\nexport function DocumentPanel(props: {\n  t"
  },
  {
    "path": "apps/web/src/components/icons.tsx",
    "chars": 6294,
    "preview": "import type { SVGProps } from \"react\";\nimport { cn } from \"../lib/utils\";\n\ntype IconProps = SVGProps<SVGSVGElement> & { "
  },
  {
    "path": "apps/web/src/components/loadable.tsx",
    "chars": 1539,
    "preview": "import type { ReactNode } from \"react\";\nimport type { Loadable } from \"@executor/react\";\nimport { IconSpinner, IconEmpty"
  },
  {
    "path": "apps/web/src/components/local-mcp-install-card.tsx",
    "chars": 1210,
    "preview": "import { useEffect, useMemo, useState } from \"react\";\nimport { CodeBlock } from \"./code-block\";\n\nexport function LocalMc"
  },
  {
    "path": "apps/web/src/components/markdown.tsx",
    "chars": 2524,
    "preview": "import { Streamdown } from \"streamdown\";\nimport { createLimitedCodePlugin } from \"../lib/shiki\";\n\nconst codePlugin = cre"
  },
  {
    "path": "apps/web/src/components/shell.tsx",
    "chars": 11509,
    "preview": "import { Link, Outlet, useMatchRoute } from \"@tanstack/react-router\";\nimport { useCallback, useEffect, useState } from \""
  },
  {
    "path": "apps/web/src/components/source-favicon.tsx",
    "chars": 3677,
    "preview": "import { useMemo, useState } from \"react\";\nimport type { Source } from \"@executor/react\";\nimport { getGoogleProductIconU"
  },
  {
    "path": "apps/web/src/components/source-not-found-state.tsx",
    "chars": 1381,
    "preview": "import { Link } from \"@tanstack/react-router\";\n\nimport { IconEmpty } from \"./icons\";\nimport { cn } from \"../lib/utils\";\n"
  },
  {
    "path": "apps/web/src/components/source-recovery-state.tsx",
    "chars": 1947,
    "preview": "import type { Source } from \"@executor/react\";\n\nimport { cn } from \"../lib/utils\";\nimport { Button } from \"./ui/button\";"
  },
  {
    "path": "apps/web/src/components/ui/badge.tsx",
    "chars": 1692,
    "preview": "import type { HTMLAttributes } from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport {"
  },
  {
    "path": "apps/web/src/components/ui/button.tsx",
    "chars": 1461,
    "preview": "import type { ButtonHTMLAttributes } from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nim"
  },
  {
    "path": "apps/web/src/dev.ts",
    "chars": 3705,
    "preview": "/**\n * Dev entry point for @hono/vite-dev-server.\n *\n * Exports `{ fetch }` so Vite can forward API requests to the exec"
  },
  {
    "path": "apps/web/src/frontend.tsx",
    "chars": 421,
    "preview": "import { createRoot } from \"react-dom/client\";\n\nclass BrowserBuffer extends Uint8Array {}\n\nconst browserGlobal = globalT"
  },
  {
    "path": "apps/web/src/globals.css",
    "chars": 4906,
    "preview": "@import \"tailwindcss\";\n@import \"tw-animate-css\";\n\n@source \"../../node_modules/streamdown/dist/*.js\";\n\n@custom-variant da"
  },
  {
    "path": "apps/web/src/index.html",
    "chars": 1031,
    "preview": "<!doctype html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"UTF-8\" />\n    <meta name=\"viewport\" content=\"width=device-w"
  },
  {
    "path": "apps/web/src/lib/schema-display.ts",
    "chars": 3005,
    "preview": "type JsonRecord = Record<string, unknown>;\n\nconst asRecord = (value: unknown): JsonRecord =>\n  typeof value === \"object\""
  },
  {
    "path": "apps/web/src/lib/shiki.ts",
    "chars": 6187,
    "preview": "import {\n  createHighlighterCore,\n  type HighlighterCore,\n  type LanguageInput,\n} from \"shiki/core\";\nimport { createJava"
  },
  {
    "path": "apps/web/src/lib/source-favicon.ts",
    "chars": 4380,
    "preview": "import { parse as parseDomain } from \"tldts\";\n\nconst RAW_HOSTS = new Set([\n  \"raw.githubusercontent.com\",\n  \"cdn.jsdeliv"
  },
  {
    "path": "apps/web/src/lib/utils.ts",
    "chars": 190,
    "preview": "import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: R"
  },
  {
    "path": "apps/web/src/main.tsx",
    "chars": 3621,
    "preview": "import * as React from \"react\";\nimport {\n  RouterProvider,\n  createRootRoute,\n  createRoute,\n  createRouter,\n  useNaviga"
  },
  {
    "path": "apps/web/src/server.ts",
    "chars": 360,
    "preview": "/**\n * Production server. Serves the API + Vite-built static assets.\n *\n * In development, use `bun run dev` which start"
  },
  {
    "path": "apps/web/src/views/add-source.tsx",
    "chars": 91636,
    "preview": "import { useEffect, useState, type ReactNode } from \"react\";\nimport { Link, useNavigate } from \"@tanstack/react-router\";"
  },
  {
    "path": "apps/web/src/views/home.tsx",
    "chars": 3766,
    "preview": "import { Link } from \"@tanstack/react-router\";\nimport { useSources, type Source } from \"@executor/react\";\nimport { Loada"
  },
  {
    "path": "apps/web/src/views/json-form.ts",
    "chars": 1617,
    "preview": "import * as Either from \"effect/Either\";\nimport * as ParseResult from \"effect/ParseResult\";\nimport * as Schema from \"eff"
  },
  {
    "path": "apps/web/src/views/mcp-transport-state.ts",
    "chars": 1594,
    "preview": "export type McpRemoteTransportValue = \"\" | \"auto\" | \"streamable-http\" | \"sse\";\n\nexport type McpTransportValue = McpRemot"
  },
  {
    "path": "apps/web/src/views/secrets.tsx",
    "chars": 17356,
    "preview": "import { useEffect, useState, type ReactNode } from \"react\";\nimport { Link } from \"@tanstack/react-router\";\nimport {\n  t"
  },
  {
    "path": "apps/web/src/views/source-detail.tsx",
    "chars": 40713,
    "preview": "import { useState, useEffect, useCallback, useRef, useMemo } from \"react\";\nimport { Link } from \"@tanstack/react-router\""
  },
  {
    "path": "apps/web/src/views/source-editor.tsx",
    "chars": 63981,
    "preview": "import { useEffect, useState, type ReactNode } from \"react\";\nimport { Link, useNavigate } from \"@tanstack/react-router\";"
  },
  {
    "path": "apps/web/src/views/source-templates.ts",
    "chars": 10954,
    "preview": "type SourceTemplateBase = {\n  id: string;\n  name: string;\n  summary: string;\n  endpoint?: string;\n  namespace?: string;\n"
  },
  {
    "path": "apps/web/tsconfig.json",
    "chars": 335,
    "preview": "{\n  \"compilerOptions\": {\n    \"target\": \"ES2022\",\n    \"module\": \"ESNext\",\n    \"moduleResolution\": \"Bundler\",\n    \"strict\""
  },
  {
    "path": "apps/web/vite.config.ts",
    "chars": 1480,
    "preview": "import { readFileSync } from \"node:fs\";\nimport { defineConfig } from \"vite\";\nimport react from \"@vitejs/plugin-react\";\ni"
  },
  {
    "path": "compose.tracing.yaml",
    "chars": 190,
    "preview": "services:\n  jaeger:\n    image: jaegertracing/all-in-one:1.65.0\n    ports:\n      - \"16686:16686\"\n      - \"4317:4317\"\n    "
  },
  {
    "path": "examples/mcp-elicitation-demo/CHANGELOG.md",
    "chars": 42,
    "preview": "# @executor/mcp-elicitation-demo\n\n## null\n"
  },
  {
    "path": "examples/mcp-elicitation-demo/package.json",
    "chars": 438,
    "preview": "{\n  \"name\": \"@executor/mcp-elicitation-demo\",\n  \"private\": true,\n  \"type\": \"module\",\n  \"exports\": {\n    \".\": \"./src/inde"
  },
  {
    "path": "examples/mcp-elicitation-demo/src/index.ts",
    "chars": 94,
    "preview": "export {\n  startMcpElicitationDemoServer,\n  type McpElicitationDemoServer,\n} from \"./server\";\n"
  },
  {
    "path": "examples/mcp-elicitation-demo/src/main.ts",
    "chars": 500,
    "preview": "import { startMcpElicitationDemoServer } from \"./server\";\n\nconst host = process.env.HOST ?? \"127.0.0.1\";\nconst port = pr"
  },
  {
    "path": "examples/mcp-elicitation-demo/src/server.ts",
    "chars": 6266,
    "preview": "import { randomUUID } from \"node:crypto\";\n\nimport { createMcpExpressApp } from \"@modelcontextprotocol/sdk/server/express"
  },
  {
    "path": "examples/mcp-elicitation-demo/tsconfig.json",
    "chars": 276,
    "preview": "{\n  \"compilerOptions\": {\n    \"target\": \"ES2022\",\n    \"module\": \"ESNext\",\n    \"moduleResolution\": \"Bundler\",\n    \"strict\""
  },
  {
    "path": "examples/serve-skills-via-mcp/CHANGELOG.md",
    "chars": 47,
    "preview": "# @executor/serve-skills-via-mcp-demo\n\n## null\n"
  },
  {
    "path": "examples/serve-skills-via-mcp/README.md",
    "chars": 1045,
    "preview": "# Serve Skills Via MCP\n\nThis demo shows one practical way to distribute [Agent Skills](https://agentskills.io)\nover MCP "
  },
  {
    "path": "examples/serve-skills-via-mcp/package.json",
    "chars": 453,
    "preview": "{\n  \"name\": \"@executor/serve-skills-via-mcp-demo\",\n  \"private\": true,\n  \"type\": \"module\",\n  \"exports\": {\n    \".\": \"./src"
  },
  {
    "path": "examples/serve-skills-via-mcp/skills/postgres-incident-triage/SKILL.md",
    "chars": 1095,
    "preview": "---\nname: postgres-incident-triage\ndescription: Triage production PostgreSQL incidents involving lock contention, slow q"
  },
  {
    "path": "examples/serve-skills-via-mcp/skills/postgres-incident-triage/references/error-codes.md",
    "chars": 325,
    "preview": "# Common PostgreSQL Incident Signals\n\n- `55P03` often points to lock contention or explicit lock timeouts.\n- `53300` ind"
  },
  {
    "path": "examples/serve-skills-via-mcp/skills/postgres-incident-triage/scripts/blocked-session-query.sql",
    "chars": 1180,
    "preview": "select\n  blocked.pid as blocked_pid,\n  blocked.query as blocked_query,\n  blocking.pid as blocking_pid,\n  blocking.query "
  },
  {
    "path": "examples/serve-skills-via-mcp/skills/release-notes-writer/SKILL.md",
    "chars": 1102,
    "preview": "---\nname: release-notes-writer\ndescription: Draft product release notes from commits, changelogs, and issue summaries. U"
  },
  {
    "path": "examples/serve-skills-via-mcp/skills/release-notes-writer/assets/release-template.md",
    "chars": 231,
    "preview": "# [Release Name]\n\n## Overview\n[Two to four sentences describing the release in user language.]\n\n## New\n- [New capability"
  },
  {
    "path": "examples/serve-skills-via-mcp/skills/release-notes-writer/references/style-guide.md",
    "chars": 380,
    "preview": "# Release Notes Style Guide\n\n- Write for product users first, operators second, engineers last.\n- Lead with outcomes: fa"
  },
  {
    "path": "examples/serve-skills-via-mcp/skills/release-notes-writer/scripts/validate-headings.ts",
    "chars": 180,
    "preview": "const requiredHeadings = [\n  \"## Overview\",\n  \"## New\",\n  \"## Improved\",\n  \"## Fixed\",\n];\n\nfor (const heading of require"
  },
  {
    "path": "examples/serve-skills-via-mcp/src/catalog.ts",
    "chars": 7206,
    "preview": "import { readdir, readFile, stat } from \"node:fs/promises\";\nimport { extname, join, posix, relative } from \"node:path\";\n"
  },
  {
    "path": "examples/serve-skills-via-mcp/src/index.ts",
    "chars": 100,
    "preview": "export {\n  startServeSkillsViaMcpDemoServer,\n  type ServeSkillsViaMcpDemoServer,\n} from \"./server\";\n"
  },
  {
    "path": "examples/serve-skills-via-mcp/src/main.ts",
    "chars": 506,
    "preview": "import { startServeSkillsViaMcpDemoServer } from \"./server\";\n\nconst host = process.env.HOST ?? \"127.0.0.1\";\nconst port ="
  },
  {
    "path": "examples/serve-skills-via-mcp/src/server.ts",
    "chars": 10131,
    "preview": "import { randomUUID } from \"node:crypto\";\nimport type { Server as HttpServer } from \"node:http\";\n\nimport { createMcpExpr"
  },
  {
    "path": "examples/serve-skills-via-mcp/src/smoke.ts",
    "chars": 2688,
    "preview": "import { Client } from \"@modelcontextprotocol/sdk/client/index.js\";\nimport { StreamableHTTPClientTransport } from \"@mode"
  },
  {
    "path": "examples/serve-skills-via-mcp/tsconfig.json",
    "chars": 276,
    "preview": "{\n  \"compilerOptions\": {\n    \"target\": \"ES2022\",\n    \"module\": \"ESNext\",\n    \"moduleResolution\": \"Bundler\",\n    \"strict\""
  },
  {
    "path": "knip.json",
    "chars": 960,
    "preview": "{\n  \"$schema\": \"https://unpkg.com/knip@5/schema.json\",\n  \"exclude\": [\n    \"duplicates\"\n  ],\n  \"ignoreIssues\": {\n    \"pac"
  },
  {
    "path": "opencode.json",
    "chars": 178,
    "preview": "{\n  \"$schema\": \"https://opencode.ai/config.json\",\n  \"mcp\": {\n    \"executor\": {\n      \"type\": \"remote\",\n      \"url\": \"htt"
  },
  {
    "path": "package.json",
    "chars": 1544,
    "preview": "{\n  \"name\": \"executor\",\n  \"private\": true,\n  \"type\": \"module\",\n  \"packageManager\": \"bun@1.2.22\",\n  \"workspaces\": [\n    \""
  },
  {
    "path": "packages/auth/mcp-oauth/package.json",
    "chars": 431,
    "preview": "{\n  \"name\": \"@executor/auth-mcp-oauth\",\n  \"private\": true,\n  \"type\": \"module\",\n  \"exports\": {\n    \".\": \"./src/index.ts\"\n"
  },
  {
    "path": "packages/auth/mcp-oauth/src/effect-errors.ts",
    "chars": 313,
    "preview": "import * as Data from \"effect/Data\";\n\nexport class McpOAuthEffectError extends Data.TaggedError(\n  \"McpOAuthEffectError\""
  },
  {
    "path": "packages/auth/mcp-oauth/src/index.ts",
    "chars": 7061,
    "preview": "import {\n  auth,\n  type OAuthClientProvider,\n  type OAuthDiscoveryState,\n} from \"@modelcontextprotocol/sdk/client/auth.j"
  },
  {
    "path": "packages/auth/mcp-oauth/tsconfig.json",
    "chars": 340,
    "preview": "{\n  \"compilerOptions\": {\n    \"target\": \"ES2022\",\n    \"module\": \"ESNext\",\n    \"moduleResolution\": \"Bundler\",\n    \"strict\""
  },
  {
    "path": "packages/auth/oauth2/package.json",
    "chars": 384,
    "preview": "{\n  \"name\": \"@executor/auth-oauth2\",\n  \"private\": true,\n  \"type\": \"module\",\n  \"exports\": {\n    \".\": \"./src/index.ts\"\n  }"
  },
  {
    "path": "packages/auth/oauth2/src/index.ts",
    "chars": 5594,
    "preview": "import { createHash, randomBytes } from \"node:crypto\";\n\nimport * as Effect from \"effect/Effect\";\n\nexport type OAuth2Toke"
  },
  {
    "path": "packages/auth/oauth2/tsconfig.json",
    "chars": 340,
    "preview": "{\n  \"compilerOptions\": {\n    \"target\": \"ES2022\",\n    \"module\": \"ESNext\",\n    \"moduleResolution\": \"Bundler\",\n    \"strict\""
  },
  {
    "path": "packages/clients/react/CHANGELOG.md",
    "chars": 78,
    "preview": "# @executor/react\n\n## null\n\n### Patch Changes\n\n- @executor/control-plane@null\n"
  },
  {
    "path": "packages/clients/react/package.json",
    "chars": 874,
    "preview": "{\n  \"name\": \"@executor/react\",\n  \"private\": true,\n  \"type\": \"module\",\n  \"exports\": {\n    \".\": \"./src/index.ts\"\n  },\n  \"s"
  },
  {
    "path": "packages/clients/react/src/index.test.tsx",
    "chars": 20915,
    "preview": "import { createServer } from \"node:http\";\n\nimport { FileSystem, HttpApiBuilder, HttpServer } from \"@effect/platform\";\nim"
  },
  {
    "path": "packages/clients/react/src/index.ts",
    "chars": 41875,
    "preview": "import { Atom, Result } from \"@effect-atom/atom\";\nimport type * as Registry from \"@effect-atom/atom/Registry\";\nimport { "
  },
  {
    "path": "packages/clients/react/tsconfig.json",
    "chars": 319,
    "preview": "{\n  \"compilerOptions\": {\n    \"target\": \"ES2022\",\n    \"module\": \"ESNext\",\n    \"moduleResolution\": \"Bundler\",\n    \"strict\""
  },
  {
    "path": "packages/clients/react/vitest.config.ts",
    "chars": 177,
    "preview": "import { defineConfig } from \"vitest/config\";\n\nexport default defineConfig({\n  test: {\n    environment: \"node\",\n    incl"
  },
  {
    "path": "packages/dev/kitchen-sink/CHANGELOG.md",
    "chars": 209,
    "preview": "# @executor/kitchen-sink\n\n## null\n\n### Patch Changes\n\n- @executor/ai-sdk-adapter@null\n- @executor/codemode-core@null\n- @"
  },
  {
    "path": "packages/dev/kitchen-sink/package.json",
    "chars": 732,
    "preview": "{\n  \"name\": \"@executor/kitchen-sink\",\n  \"private\": true,\n  \"type\": \"module\",\n  \"scripts\": {\n    \"typecheck\": \"bunx tsc -"
  },
  {
    "path": "packages/dev/kitchen-sink/src/effect-errors.ts",
    "chars": 325,
    "preview": "import * as Data from \"effect/Data\";\n\nexport class KitchenSinkEffectError extends Data.TaggedError(\n  \"KitchenSinkEffect"
  },
  {
    "path": "packages/dev/kitchen-sink/src/index.ts",
    "chars": 10,
    "preview": "export {}\n"
  },
  {
    "path": "packages/dev/kitchen-sink/src/kitchen-sink.test.ts",
    "chars": 3877,
    "preview": "import { describe, expect, it } from \"@effect/vitest\";\nimport * as Effect from \"effect/Effect\";\nimport * as Schema from "
  },
  {
    "path": "packages/dev/kitchen-sink/src/playground.ts",
    "chars": 1325,
    "preview": "import * as Effect from \"effect/Effect\";\nimport * as Schema from \"effect/Schema\";\n\nimport {\n  makeToolInvokerFromTools,\n"
  },
  {
    "path": "packages/dev/kitchen-sink/src/source-runtime.test.ts",
    "chars": 26076,
    "preview": "import { createServer } from \"node:http\";\n\nimport {\n  HttpApi,\n  HttpApiEndpoint,\n  HttpApiGroup,\n  HttpApiSchema,\n  Ope"
  },
  {
    "path": "packages/dev/kitchen-sink/tsconfig.json",
    "chars": 275,
    "preview": "{\n  \"compilerOptions\": {\n    \"target\": \"ES2022\",\n    \"module\": \"ESNext\",\n    \"moduleResolution\": \"Bundler\",\n    \"strict\""
  },
  {
    "path": "packages/dev/kitchen-sink/vitest.config.ts",
    "chars": 131,
    "preview": "import { defineConfig } from \"vitest/config\";\n\nexport default defineConfig({\n  test: {\n    include: [\"src/**/*.test.ts\"]"
  },
  {
    "path": "packages/hosts/ai-sdk/CHANGELOG.md",
    "chars": 116,
    "preview": "# @executor/ai-sdk-adapter\n\n## null\n\n### Patch Changes\n\n- @executor/codemode-core@null\n- @executor/runtime-ses@null\n"
  },
  {
    "path": "packages/hosts/ai-sdk/package.json",
    "chars": 729,
    "preview": "{\n  \"name\": \"@executor/ai-sdk-adapter\",\n  \"private\": true,\n  \"type\": \"module\",\n  \"exports\": {\n    \".\": \"./src/index.ts\","
  },
  {
    "path": "packages/hosts/ai-sdk/src/ai.ts",
    "chars": 140,
    "preview": "export {\n  CodeToolInputSchema,\n  createCodeTool,\n  createToolsFromAiSdkTools,\n  type AiSdkToolMap,\n  type CodeToolInput"
  },
  {
    "path": "packages/hosts/ai-sdk/src/effect-errors.ts",
    "chars": 301,
    "preview": "import * as Data from \"effect/Data\";\n\nexport class AiSdkEffectError extends Data.TaggedError(\n  \"AiSdkEffectError\",\n)<{\n"
  },
  {
    "path": "packages/hosts/ai-sdk/src/example-codemode-inproc.ts",
    "chars": 1334,
    "preview": "import { tool } from \"ai\";\nimport * as Effect from \"effect/Effect\";\nimport { z } from \"zod\";\n\nimport { makeToolInvokerFr"
  },
  {
    "path": "packages/hosts/ai-sdk/src/example-dynamic.ts",
    "chars": 1469,
    "preview": "import * as Effect from \"effect/Effect\";\n\nimport {\n  type ToolCatalog,\n  type ToolPath,\n  createToolCatalogDiscovery,\n} "
  },
  {
    "path": "packages/hosts/ai-sdk/src/example-static.ts",
    "chars": 1053,
    "preview": "import { tool } from \"ai\";\nimport { z } from \"zod\";\n\nimport { createStaticDiscoveryFromTools } from \"@executor/codemode-"
  },
  {
    "path": "packages/hosts/ai-sdk/src/example.ts",
    "chars": 167,
    "preview": "export { staticDemo } from \"./example-static\";\nexport { dynamicDemo } from \"./example-dynamic\";\nexport { codemode, runCo"
  },
  {
    "path": "packages/hosts/ai-sdk/src/index.ts",
    "chars": 1795,
    "preview": "import { tool } from \"ai\";\nimport type { ToolSet } from \"ai\";\nimport * as Effect from \"effect/Effect\";\nimport { z } from"
  },
  {
    "path": "packages/hosts/ai-sdk/tsconfig.json",
    "chars": 276,
    "preview": "{\n  \"compilerOptions\": {\n    \"target\": \"ES2022\",\n    \"module\": \"ESNext\",\n    \"moduleResolution\": \"Bundler\",\n    \"strict\""
  },
  {
    "path": "packages/hosts/mcp/CHANGELOG.md",
    "chars": 85,
    "preview": "# @executor/executor-mcp\n\n## null\n\n### Patch Changes\n\n- @executor/control-plane@null\n"
  },
  {
    "path": "packages/hosts/mcp/package.json",
    "chars": 602,
    "preview": "{\n  \"name\": \"@executor/executor-mcp\",\n  \"private\": true,\n  \"type\": \"module\",\n  \"exports\": {\n    \".\": \"./src/index.ts\"\n  "
  },
  {
    "path": "packages/hosts/mcp/src/index.ts",
    "chars": 17814,
    "preview": "import type {\n  ExecutionEnvelope,\n  ControlPlaneRuntime,\n} from \"@executor/control-plane\";\nimport {\n  EXECUTOR_SOURCES_"
  },
  {
    "path": "packages/hosts/mcp/src/paused-result.test.ts",
    "chars": 3031,
    "preview": "import { describe, expect, it } from \"@effect/vitest\";\nimport type { ExecutionEnvelope, ExecutionInteraction } from \"@ex"
  },
  {
    "path": "packages/hosts/mcp/src/paused-result.ts",
    "chars": 3044,
    "preview": "import type {\n  ExecutionEnvelope,\n  ExecutionInteraction,\n} from \"@executor/control-plane\";\n\nexport type ParsedInteract"
  },
  {
    "path": "packages/hosts/mcp/tsconfig.json",
    "chars": 282,
    "preview": "{\n  \"compilerOptions\": {\n    \"target\": \"ES2022\",\n    \"module\": \"ESNext\",\n    \"moduleResolution\": \"Bundler\",\n    \"strict\""
  },
  {
    "path": "packages/kernel/core/CHANGELOG.md",
    "chars": 35,
    "preview": "# @executor/codemode-core\n\n## null\n"
  },
  {
    "path": "packages/kernel/core/package.json",
    "chars": 533,
    "preview": "{\n  \"name\": \"@executor/codemode-core\",\n  \"private\": true,\n  \"type\": \"module\",\n  \"exports\": {\n    \".\": \"./src/index.ts\"\n "
  },
  {
    "path": "packages/kernel/core/src/discovery.ts",
    "chars": 13268,
    "preview": "import * as Effect from \"effect/Effect\";\n\nimport { toolDescriptorsFromTools } from \"./tool-map\";\nimport type {\n  Catalog"
  },
  {
    "path": "packages/kernel/core/src/effect-errors.ts",
    "chars": 321,
    "preview": "import * as Data from \"effect/Data\";\n\nexport class KernelCoreEffectError extends Data.TaggedError(\n  \"KernelCoreEffectEr"
  },
  {
    "path": "packages/kernel/core/src/http-request-placements.ts",
    "chars": 4337,
    "preview": "export type HttpRequestPlacements = {\n  headers?: Readonly<Record<string, string>>;\n  queryParams?: Readonly<Record<stri"
  },
  {
    "path": "packages/kernel/core/src/index.test.ts",
    "chars": 18550,
    "preview": "import { describe, expect, it } from \"@effect/vitest\";\nimport { assertInstanceOf, assertNone, assertTrue } from \"@effect"
  },
  {
    "path": "packages/kernel/core/src/index.ts",
    "chars": 255,
    "preview": "export * from \"./types\";\nexport * from \"./json-schema\";\nexport * from \"./schema-types\";\nexport * from \"./tool-map\";\nexpo"
  },
  {
    "path": "packages/kernel/core/src/isomorphic-hash.ts",
    "chars": 5006,
    "preview": "/**\n * Isomorphic SHA-256 implementation that works in both Node.js and the browser.\n *\n * Avoids importing `node:crypto"
  },
  {
    "path": "packages/kernel/core/src/json-schema.ts",
    "chars": 1937,
    "preview": "import type { ErrorObject } from \"ajv\";\nimport Ajv2020 from \"ajv/dist/2020\";\n\nimport type { StandardSchema } from \"./typ"
  },
  {
    "path": "packages/kernel/core/src/schema-types.test.ts",
    "chars": 2341,
    "preview": "import { describe, expect, it } from \"@effect/vitest\";\n\nimport { typeSignatureFromSchema } from \"./schema-types\";\n\ndescr"
  },
  {
    "path": "packages/kernel/core/src/schema-types.ts",
    "chars": 6573,
    "preview": "type JsonSchemaRecord = Record<string, unknown>;\n\nexport type TypeSignatureRenderOptions = {\n  maxLength?: number;\n  max"
  },
  {
    "path": "packages/kernel/core/src/system-tools.ts",
    "chars": 5991,
    "preview": "import * as Effect from \"effect/Effect\";\nimport * as Schema from \"effect/Schema\";\n\nimport { createDiscoveryPrimitivesFro"
  },
  {
    "path": "packages/kernel/core/src/tool-map.ts",
    "chars": 15131,
    "preview": "import type { StandardSchemaV1 } from \"@standard-schema/spec\";\nimport * as Data from \"effect/Data\";\nimport * as Effect f"
  },
  {
    "path": "packages/kernel/core/src/types.ts",
    "chars": 6622,
    "preview": "import type { StandardSchemaV1 } from \"@standard-schema/spec\";\nimport type * as Effect from \"effect/Effect\";\nimport * as"
  },
  {
    "path": "packages/kernel/core/tsconfig.json",
    "chars": 276,
    "preview": "{\n  \"compilerOptions\": {\n    \"target\": \"ES2022\",\n    \"module\": \"ESNext\",\n    \"moduleResolution\": \"Bundler\",\n    \"strict\""
  },
  {
    "path": "packages/kernel/core/vitest.config.ts",
    "chars": 131,
    "preview": "import { defineConfig } from \"vitest/config\";\n\nexport default defineConfig({\n  test: {\n    include: [\"src/**/*.test.ts\"]"
  },
  {
    "path": "packages/kernel/ir/README.md",
    "chars": 824,
    "preview": "# IR v1\n\n`@executor/ir` is the greenfield semantic center for imported sources.\n\n## Boundary\n\n- `CatalogSnapshotV1` is t"
  },
  {
    "path": "packages/kernel/ir/package.json",
    "chars": 606,
    "preview": "{\n  \"name\": \"@executor/ir\",\n  \"private\": true,\n  \"type\": \"module\",\n  \"exports\": {\n    \".\": \"./src/index.ts\",\n    \"./cata"
  },
  {
    "path": "packages/kernel/ir/src/catalog.test.ts",
    "chars": 27163,
    "preview": "import { describe, expect, it } from \"@effect/vitest\";\n\nimport {\n  createCatalogSnapshotV1,\n  createEmptyCatalogV1,\n  de"
  },
  {
    "path": "packages/kernel/ir/src/catalog.ts",
    "chars": 41966,
    "preview": "import { sha256Hex } from \"@executor/codemode-core\";\nimport * as ParseResult from \"effect/ParseResult\";\nimport { Schema "
  },
  {
    "path": "packages/kernel/ir/src/ids.ts",
    "chars": 2560,
    "preview": "import { Schema } from \"effect\";\n\nexport const DocumentIdSchema = Schema.String.pipe(Schema.brand(\"DocumentId\"));\nexport"
  },
  {
    "path": "packages/kernel/ir/src/index.ts",
    "chars": 75,
    "preview": "export * from \"./ids\";\nexport * from \"./model\";\nexport * from \"./catalog\";\n"
  },
  {
    "path": "packages/kernel/ir/src/model.ts",
    "chars": 26560,
    "preview": "import { Schema } from \"effect\";\n\nimport {\n  CapabilityIdSchema,\n  DiagnosticIdSchema,\n  DocumentIdSchema,\n  ExecutableI"
  },
  {
    "path": "packages/kernel/ir/tsconfig.json",
    "chars": 276,
    "preview": "{\n  \"compilerOptions\": {\n    \"target\": \"ES2022\",\n    \"module\": \"ESNext\",\n    \"moduleResolution\": \"Bundler\",\n    \"strict\""
  },
  {
    "path": "packages/kernel/runtime-deno-subprocess/CHANGELOG.md",
    "chars": 96,
    "preview": "# @executor/runtime-deno-subprocess\n\n## null\n\n### Patch Changes\n\n- @executor/codemode-core@null\n"
  },
  {
    "path": "packages/kernel/runtime-deno-subprocess/package.json",
    "chars": 528,
    "preview": "{\n  \"name\": \"@executor/runtime-deno-subprocess\",\n  \"private\": true,\n  \"type\": \"module\",\n  \"exports\": {\n    \".\": \"./src/i"
  },
  {
    "path": "packages/kernel/runtime-deno-subprocess/src/deno-subprocess-worker.mjs",
    "chars": 4430,
    "preview": "// @ts-nocheck\n// This script runs inside the Deno subprocess.\n// It communicates with the host process via line-delimit"
  },
  {
    "path": "packages/kernel/runtime-deno-subprocess/src/deno-worker-process.ts",
    "chars": 4246,
    "preview": "import { spawn } from \"node:child_process\";\n\nexport type DenoPermissions = {\n  /** Allow network access. Pass `true` for"
  },
  {
    "path": "packages/kernel/runtime-deno-subprocess/src/index.test.ts",
    "chars": 6819,
    "preview": "import { describe, expect, it } from \"@effect/vitest\";\nimport * as Effect from \"effect/Effect\";\nimport * as Schema from "
  },
  {
    "path": "packages/kernel/runtime-deno-subprocess/src/index.ts",
    "chars": 10214,
    "preview": "import { spawnSync } from \"node:child_process\";\nimport { fileURLToPath } from \"node:url\";\n\nimport type {\n  CodeExecutor,"
  },
  {
    "path": "packages/kernel/runtime-deno-subprocess/tsconfig.json",
    "chars": 276,
    "preview": "{\n  \"compilerOptions\": {\n    \"target\": \"ES2022\",\n    \"module\": \"ESNext\",\n    \"moduleResolution\": \"Bundler\",\n    \"strict\""
  },
  {
    "path": "packages/kernel/runtime-deno-subprocess/vitest.config.ts",
    "chars": 156,
    "preview": "import { defineConfig } from \"vitest/config\";\n\nexport default defineConfig({\n  test: {\n    include: [\"src/**/*.test.ts\"]"
  },
  {
    "path": "packages/kernel/runtime-quickjs/CHANGELOG.md",
    "chars": 88,
    "preview": "# @executor/runtime-quickjs\n\n## null\n\n### Patch Changes\n\n- @executor/codemode-core@null\n"
  },
  {
    "path": "packages/kernel/runtime-quickjs/package.json",
    "chars": 557,
    "preview": "{\n  \"name\": \"@executor/runtime-quickjs\",\n  \"private\": true,\n  \"type\": \"module\",\n  \"exports\": {\n    \".\": \"./src/index.ts\""
  },
  {
    "path": "packages/kernel/runtime-quickjs/src/index.test.ts",
    "chars": 5479,
    "preview": "import { describe, expect, it } from \"@effect/vitest\";\nimport * as Effect from \"effect/Effect\";\nimport * as Schema from "
  },
  {
    "path": "packages/kernel/runtime-quickjs/src/index.ts",
    "chars": 12080,
    "preview": "import type {\n  CodeExecutor,\n  ExecuteResult,\n  ToolInvoker,\n} from \"@executor/codemode-core\";\nimport * as Effect from "
  },
  {
    "path": "packages/kernel/runtime-quickjs/tsconfig.json",
    "chars": 276,
    "preview": "{\n  \"compilerOptions\": {\n    \"target\": \"ES2022\",\n    \"module\": \"ESNext\",\n    \"moduleResolution\": \"Bundler\",\n    \"strict\""
  },
  {
    "path": "packages/kernel/runtime-ses/CHANGELOG.md",
    "chars": 84,
    "preview": "# @executor/runtime-ses\n\n## null\n\n### Patch Changes\n\n- @executor/codemode-core@null\n"
  },
  {
    "path": "packages/kernel/runtime-ses/package.json",
    "chars": 424,
    "preview": "{\n  \"name\": \"@executor/runtime-ses\",\n  \"private\": true,\n  \"type\": \"module\",\n  \"exports\": {\n    \".\": \"./src/index.ts\"\n  }"
  },
  {
    "path": "packages/kernel/runtime-ses/src/index.ts",
    "chars": 5654,
    "preview": "import { fork, type ChildProcess } from \"node:child_process\";\nimport { fileURLToPath } from \"node:url\";\n\nimport type {\n "
  },
  {
    "path": "packages/kernel/runtime-ses/src/sandbox-worker.mjs",
    "chars": 4626,
    "preview": "import \"ses\";\n\nlockdown({\n  errorTaming: \"unsafe\",\n  overrideTaming: \"moderate\",\n  consoleTaming: \"unsafe\",\n  stackFilte"
  },
  {
    "path": "packages/kernel/runtime-ses/tsconfig.json",
    "chars": 276,
    "preview": "{\n  \"compilerOptions\": {\n    \"target\": \"ES2022\",\n    \"module\": \"ESNext\",\n    \"moduleResolution\": \"Bundler\",\n    \"strict\""
  },
  {
    "path": "packages/platform/control-plane/CHANGELOG.md",
    "chars": 290,
    "preview": "# @executor/control-plane\n\n## null\n\n### Patch Changes\n\n- @executor/codemode-core@null\n- @executor/source-google-discover"
  },
  {
    "path": "packages/platform/control-plane/package.json",
    "chars": 1707,
    "preview": "{\n  \"name\": \"@executor/control-plane\",\n  \"private\": true,\n  \"type\": \"module\",\n  \"exports\": {\n    \".\": \"./src/index.ts\",\n"
  },
  {
    "path": "packages/platform/control-plane/src/api/api.ts",
    "chars": 715,
    "preview": "import { HttpApi, OpenApi } from \"@effect/platform\";\n\nimport { ExecutionsApi } from \"./executions/api\";\nimport { LocalAp"
  },
  {
    "path": "packages/platform/control-plane/src/api/errors.ts",
    "chars": 1479,
    "preview": "import { HttpApiSchema } from \"@effect/platform\";\nimport * as Schema from \"effect/Schema\";\n\nexport class ControlPlaneBad"
  },
  {
    "path": "packages/platform/control-plane/src/api/executions/api.ts",
    "chars": 2461,
    "preview": "import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema } from \"@effect/platform\";\nimport {\n  ExecutionIdSchema,\n  Executi"
  },
  {
    "path": "packages/platform/control-plane/src/api/executions/http.ts",
    "chars": 1609,
    "preview": "import { HttpApiBuilder } from \"@effect/platform\";\nimport * as Effect from \"effect/Effect\";\nimport {\n  createExecution,\n"
  },
  {
    "path": "packages/platform/control-plane/src/api/http.ts",
    "chars": 1175,
    "preview": "import { HttpApiBuilder } from \"@effect/platform\";\nimport * as Layer from \"effect/Layer\";\n\nimport { ControlPlaneApi } fr"
  },
  {
    "path": "packages/platform/control-plane/src/api/index.ts",
    "chars": 1803,
    "preview": "export {\n  ControlPlaneApi,\n  controlPlaneOpenApiSpec,\n} from \"./api\";\n\nexport type { LocalInstallation } from \"#schema\""
  },
  {
    "path": "packages/platform/control-plane/src/api/local/api.ts",
    "chars": 4151,
    "preview": "import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema } from \"@effect/platform\";\nimport { LocalInstallationSchema, Secre"
  }
]

// ... and 259 more files (download for full content)

About this extraction

This page contains the full source code of the RhysSullivan/executor GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 459 files (13.6 MB), approximately 3.6M tokens, and a symbol index with 1167 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!