acp-runtime
AgentThe ACP runtime is the domain service that serves the ACP API contract. It owns the host-scoped dependencies needed to runโฆ
Integration plugins in `packages/plugins/src/integrations/` own service metadata, auth method descriptors, credential schemas, and credential verification. Issue plugins in `packages/plugins/src/issues/` reference an integration by `integrationId` and own issue operations.
Integration plugins in `packages/plugins/src/integrations/` own service metadata, auth method descriptors, credential schemas, and credential verification. Issue plugins in `packages/plugins/src/issues/` reference an integration by `integrationId` and own issue operations. Pull-request plugins in `packages/plugins/src/pull-requests/` do the same for PR/MR operations. Repository plugins in `packages/plugins/src/repository/` own hosted-repository operations and host detection. GitHub follows the same plugin contracts as the other integrations.
Task creation retrieves details for providers that support issue context before enabling creation with the default context setting. Loading and errors are visible; errors offer a retry. Changing or clearing the selection discards stale query results. Enrichment preserves edited context and a removed issue mention. Turning off the default issue-context setting skips this retrieval.
`capabilities.auth` is a serializable descriptor for connection UI: form fields, OAuth, device flow, CLI import, and whether an account label is required. Executable code belongs in `behavior.auth`, which must register both:
same schema in the provider's client factory and verifier. Parsing is local validation and normalization; it does not prove that a credential is accepted by the remote API.
success, together with optional stable account identity and display metadata. Persist the returned credentials, never fall back to the submitted form values.
Three behaviors are optional:
declares an `oauth` method (sign-in through the Emdash auth server). It maps an access token issued by the server into the provider's credential shape. The server keeps the refresh token.
It returns the user code, verification URL, and lifetime, plus `complete(signal)`, which polls until the user approves and resolves with credentials for `verify`. Build it with `startDeviceAuthorizationSession` from `integrations/helpers/oauth-device.ts` (RFC 8628); every request times out after 30 seconds, and polling retries network failures and 5xx responses until the code expires.
(e.g. by device sign-in) with their refresh token. It returns replacement credentials, or `undefined` when these credentials cannot be refreshed.
Credentials that expire carry `expiresAt` (epoch milliseconds); `credentialsExpireAt` reads it.
The desktop runs the browser PKCE flow against the auth server for any integration whose descriptor declares `{ kind: 'oauth', providerId }`. Emdash accounts are created and signed into only with `EMDASH_SIGN_IN_PROVIDER` (GitHub); the auth server enforces this too. When signed in, the desktop links the provider account (`account-link/start?provider_id=...`). When signed out, it signs in with GitHub for GitHub itself; for any other provider (GitLab) it signs in with GitHub first and then links, so another provider never creates an Emdash account. The exchange returns the provider access token, its expiry, and the account identity. `IntegrationOAuthTokens` (`core/features/integrations/node/integration-oauth-tokens.ts`) maps the token with `credentialsFromOAuthToken`, verifies it with the plugin's `verify` (so an account has the same identity whichever method connected it), checks that it belongs to the account the server named, and saves it through `connectVerified` with credential source `emdash_oauth`. Reconnecting an account passes its `accountId` through sign-in or linking, so a token for another identity is not saved. GitHub and GitLab use this path; there is no per-provider adapter.
`IntegrationAccountStore.getAccount` is the only credential read path. When stored credentials expire within five minutes (`CREDENTIAL_RENEWAL_SKEW_MS`), it renews them before returning the account. The store decides when; the account's current credential source decides how. Both are reread under the account lock, because a reconnect can replace them during a read:
account's current token (`POST /api/v1/auth/electron/provider-token` with the Emdash session). The server refreshes tokens that expire within ten minutes, so it always returns a token that outlives the desktop window. Every client of an Emdash account shares that token, and GitLab revokes the previous token pair on refresh.
Renewals are serialized per account and the new credentials are written (secret only; metadata unchanged) before they are returned, because rotating refresh tokens are single-use. A failed renewal logs and returns the stored credentials with `renewalError`; the provider's 401 then fails the API call, and the connection status shows `renewalError` (for example, "Sign in to Emdash to keep GitLab connected."). A renewal the provider or server rejected (`auth_failed`, or an account no longer linked to the Emdash account) is not retried until the credentials change (for example on reconnect) or, for `emdash_oauth`, until the user signs in or out of Emdash, since another Emdash account may have the provider account linked. Other failures, including a missing or expired Emdash session, are retr
Emdash is the Open-Source Agentic Development Environment (๐งก YC W26). Run multiple coding agents in parallel. Use any provider.
The ACP runtime is the domain service that serves the ACP API contract. It owns the host-scoped dependencies needed to runโฆ
This page defines the target organization of `packages/core/src/`. Core is organized by module type so that shared domain APIsโฆ
Git is split into a transport contract and a host-scoped runtime. Renderer, desktop, and workspace-server code share the Wireโฆ
The main process is organized into domain modules under `src/main/core/`. Each domain typically has a `controller.ts` (RPCโฆ
`@emdash/core/primitives/path/api` is the source of truth for portable file identity and lexical path operations. The detailedโฆ
Validates project structure against co-location and architecture patterns defined in AGENTS.md
Deprecated placeholder. Do not use; follow root AGENTS.md and package instructions instead.
Use this agent when you need to create or update technical documentation that helps developers understand the deep patterns,โฆ
Orchestration patterns learned from experience. Review at startup and before heartbeat responses.