@codeam/shared 2.65.0 → 2.65.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +72 -1
- package/dist/index.d.ts +72 -1
- package/dist/index.js +79 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +76 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -343,6 +343,77 @@ declare function headroomKindFor(agentId: string): HeadroomKind | null;
|
|
|
343
343
|
*/
|
|
344
344
|
declare function isHeadroomWrappable(agentId: string): boolean;
|
|
345
345
|
|
|
346
|
+
/**
|
|
347
|
+
* Canonical per-agent CLI **install** snippets.
|
|
348
|
+
*
|
|
349
|
+
* ─── Why this file exists ────────────────────────────────────────────────────
|
|
350
|
+
* Until now the only copy of these shell recipes lived inside the backend's
|
|
351
|
+
* codespace provisioning strategies — one `getInstallSnippet()` per
|
|
352
|
+
* `…ProvisioningStrategy` in
|
|
353
|
+
* `codeagent-mobile/apps/api-v2/src/codespaces/agent.ts`. That made them
|
|
354
|
+
* unreachable from the clients repo, so the CLI could never be tested against
|
|
355
|
+
* the REAL command a box actually runs: the `switch_agent` install path only
|
|
356
|
+
* ever saw a snippet handed to it over the wire at runtime.
|
|
357
|
+
*
|
|
358
|
+
* That gap is exactly how the **stale-PATH / half-finished-install** failure
|
|
359
|
+
* class (fleet-1, 2026-08-14) reached production: `npm install -g @openai/codex`
|
|
360
|
+
* succeeded, but the long-running CLI daemon's PATH predated the npm
|
|
361
|
+
* global-prefix bin dir, so the post-install probe reported "installed but its
|
|
362
|
+
* binary never appeared on PATH" — forever. No CI test could have caught it,
|
|
363
|
+
* because no CI test could run the real install.
|
|
364
|
+
*
|
|
365
|
+
* These strings are now **canonical HERE**. `apps/cli/__tests__/integration/
|
|
366
|
+
* agent-install.int.test.ts` runs each one for real, inside a container with a
|
|
367
|
+
* deliberately minimal (systemd-like) PATH, and then drives the REAL adapter
|
|
368
|
+
* probe from a single long-running node process.
|
|
369
|
+
*
|
|
370
|
+
* ─── api-v2 migration (deliberate follow-up, NOT done yet) ───────────────────
|
|
371
|
+
* The backend still owns its own copies. At the next `@codeam/shared` pin bump
|
|
372
|
+
* in api-v2, change exactly ONE file —
|
|
373
|
+
*
|
|
374
|
+
* codeagent-mobile/apps/api-v2/src/codespaces/agent.ts
|
|
375
|
+
*
|
|
376
|
+
* — so every `…ProvisioningStrategy.getInstallSnippet()` returns
|
|
377
|
+
* `INSTALL_SNIPPETS[<agentId>]` imported from `@codeam/shared` instead of an
|
|
378
|
+
* inline template literal. The `getAuthSnippet()` half stays in api-v2: it is
|
|
379
|
+
* credential-bearing and must never be mirrored into a package the clients
|
|
380
|
+
* bundle.
|
|
381
|
+
*
|
|
382
|
+
* ─── Invariants ──────────────────────────────────────────────────────────────
|
|
383
|
+
* • **Install ONLY.** Every credential/auth line from the backend strategies is
|
|
384
|
+
* deliberately excluded — no token, key, or secret substitution variable may
|
|
385
|
+
* ever appear here (asserted by `__tests__/agents-install-snippets.test.ts`).
|
|
386
|
+
* • **Idempotent.** Each snippet is `command -v`-guarded, so re-running it is
|
|
387
|
+
* always safe — that is what makes the `switch-agent.ts` retry-once recovery
|
|
388
|
+
* for the half-finished-bin-link class legitimate.
|
|
389
|
+
* • **Verbatim.** These are byte-for-byte ports of the api-v2 snippets. Do not
|
|
390
|
+
* "clean them up" independently — a divergence means a codespace and a
|
|
391
|
+
* self-hosted switch install different things.
|
|
392
|
+
* • `claude` is absent ON PURPOSE: its binary ships as an optional platform
|
|
393
|
+
* dependency of `@anthropic-ai/claude-agent-sdk` (installed with the CLI
|
|
394
|
+
* itself), so there is no separate install recipe to run.
|
|
395
|
+
*/
|
|
396
|
+
|
|
397
|
+
/**
|
|
398
|
+
* The canonical install recipe per agent. `Partial` because not every agent has
|
|
399
|
+
* one: `claude` ships its binary with the SDK, and `copilot` has no
|
|
400
|
+
* provisioning strategy yet.
|
|
401
|
+
*/
|
|
402
|
+
declare const INSTALL_SNIPPETS: Readonly<Partial<Record<AgentId, string>>>;
|
|
403
|
+
/**
|
|
404
|
+
* Agents whose canonical snippet actually installs something. Excludes
|
|
405
|
+
* `coderabbit` (credential-only no-op — see {@link INSTALL_SNIPPETS}).
|
|
406
|
+
*
|
|
407
|
+
* This is the list the real-install integration gate iterates.
|
|
408
|
+
*/
|
|
409
|
+
declare function installableAgentIds(): AgentId[];
|
|
410
|
+
/**
|
|
411
|
+
* True when a snippet performs no installation at all (a bare marker `echo`).
|
|
412
|
+
* Callers that need a real binary must fall back to the agent's own CLI-side
|
|
413
|
+
* installer instead of running the snippet.
|
|
414
|
+
*/
|
|
415
|
+
declare function isNoopInstallSnippet(snippet: string | undefined): boolean;
|
|
416
|
+
|
|
346
417
|
/**
|
|
347
418
|
* Agent Toolkits — integration wire types.
|
|
348
419
|
* Spec: docs/superpowers/specs/2026-07-10-agent-toolkits-integrations-design.md
|
|
@@ -2078,4 +2149,4 @@ type UserEventName = (typeof USER_EVENTS)[keyof typeof USER_EVENTS];
|
|
|
2078
2149
|
*/
|
|
2079
2150
|
declare const PREVIEW_DETECT_PROMPT: string;
|
|
2080
2151
|
|
|
2081
|
-
export { AGENT_REGISTRY, AGENT_STANDARD_BLOCK, AGENT_STANDARD_MARKER, AGENT_STANDARD_TEXT, type AgentAuth, type AgentAuthKind, type AgentId, type AgentMetadata, type AgentMode, type AgentModel, type AgentReviewFinding, type AgentReviewPlan, type AgentReviewReport, type AnswerResolvedEvent, type AwaitingAnswerEvent, type BeadsActionCommand, type BeadsActionKind, type BeadsActionPayload, type BeadsActionRequest, type BeadsActionType, type BeadsConfigureAction, type BeadsDependencyDto, type BeadsDependencyKind, type BeadsIngestPayload, type BeadsIssueDto, type BeadsIssueStatus, type BeadsMemoryDto, type BeadsProjectDto, type BeadsProvisioningPayload, type BeadsProvisioningStatus, type BeadsSnapshotDto, type BeadsStatus, type BeadsStatusState, type BeadsStatusSummary, type BlameLineWire, type BrokeredIntegrationToken, CODER_PROMPT, type ChromeStep, type ChromeToolType, type CommitEntryWire, DEFAULT_API_BASE_URL, DEFAULT_GUARDRAIL_POLICY, DEP_TO_INTEGRATION, DEV_API_BASE_URL, type DerivedCredentialSource, type EnvVar, type FileBlameEvent, type FileChangeStatus, type FileChangedEvent, type FileHistoryEvent, type FileReviewStatus, GUARDRAIL_CATEGORIES, GUARDRAIL_CATEGORY_META, GUARDRAIL_CONFIGURE_COMMAND, GUARDRAIL_DISPOSITIONS, type GuardrailCategory, type GuardrailCategoryMeta, type GuardrailDisposition, type GuardrailPolicy, HANDOFF_FENCE_TAG, HEADROOM_BACKEND_ENV, HEADROOM_EXTRAS_BY_SURFACE, HEADROOM_MODELS, HEADROOM_PIP_COMPANIONS, HEADROOM_PROXY_PORT, HEADROOM_USAGE_COMMAND, HEARTBEAT_INTERVAL_MS_DEFAULT, HOUSE_AGENT_ID, HOUSE_AGENT_NAME, HOUSE_AGENT_PROVIDER, HOUSE_AGENT_SUBTITLE, HOUSE_AGENT_VENDOR, type HandoffProposal, type HandoffResolution, type HeadroomBudgetCommand, type HeadroomBudgetPeriod, type HeadroomBudgetUsage, type HeadroomKind, type HeadroomModelSpec, type HeadroomPythonRenderOpts, type HeadroomStatus, type HeadroomStep, type HeadroomSurface, type HeadroomUsageBucket, type HeadroomUsageGranularity, type HeadroomUsageReport, type HeadroomUsageResult, type HeadroomUsageSlice, type HeadroomUsageTotals, type HunkLineType, INTEGRATION_BRANDING, INTEGRATION_REGISTRY, INTERNAL_TO_PUBLIC, type InputSuggestionChunk, type IntegrationApiKeyField, type IntegrationAuthKind, type IntegrationBranding, type IntegrationCategory, type IntegrationDefinition, type IntegrationDelivery, type IntegrationHealth, type IntegrationId, type IntegrationMcpDelivery, type IntegrationStatus, type IntegrationsManifest, type IntegrationsManifestEntry, LINKED_AGENT_IDS, type LinkedAgentId, MODEL_CONTEXT_WINDOW, MODEL_PRICING, type ModelPricing, type NormalizedMessage, OBSERVER_BRIDGE_PORT, PACK_ACTION_COMMAND, PACK_REGISTRY, PACK_START_COMMAND, PACK_STATUS_COMMAND, PACK_WORKFLOW_ARTICLE, PREVIEW_DETECT_PROMPT, PROTOCOL_VERSION, PUBLIC_TO_INTERNAL, type PackActionKind, type PackActionPayload, type PackDefinition, type PackHandoffRecord, type PackId, type PackRunState, type PackRunStatus, type PackStageDef, type PackStageState, type PackStageStatus, type PackStartPayload, type PendingReviewHunkEvent, type PendingReviewHunkLine, type PrCheck, type PrRef, type PrReviewEntry, type PrReviewVerdict, type PreviewDetection, type PreviewErrorStage, type PreviewState, type PreviewStatus, type PullRequestDetail, type PullRequestSummary, QA_PROMPT, REVIEWER_PROMPT, type RemoteCommand, type RepoStack, type RepoStackDetection, SKILL_REGISTRY, SPECIFIER_PROMPT, SQUAD_CONFIGURE_COMMAND, SQUAD_HOP_BUDGET_DEFAULT, SQUAD_HOP_BUDGET_MAX, SQUAD_HOP_BUDGET_MIN, SQUAD_SPECIALTIES, SQUAD_STATS_COMMAND, SSE_SOCKET_TIMEOUT_MS, STACK_TO_RECOMMENDED, SWITCH_AGENT_COMMAND, type SelectPrompt, type SkillDefinition, type SkillDelivery, type SkillFileDelivery, type SkillId, type SkillRail, type SkillsManifest, type SkillsManifestEntry, type SquadAutoConfig, type SquadConfigurePayload, type SquadConfigureResult, type SquadMemberActivity, type SquadRosterAgent, type SquadRosterData, type SquadStatsResult, type StartTaskPayload, type StreamingChunkEvent, type StreamingChunkKind, type SwitchAgentCommand, type SwitchAgentResult, type SwitchAgentStatus, type SwitchAgentStep, TERMINAL_AGENT_PREFIX, UNKNOWN_MODEL_PRICING, UPCOMING_INTEGRATION_IDS, USER_EVENTS, type UserEventName, clampHopBudget, classifyStack, detectedIntegrationsFromDeps, getAgent, getContextWindow, getEnabledAgents, getEnabledIntegrations, getIntegration, getIntegrationBranding, getIntegrationsByCategory, getPackDefinition, getPricing, getSkillDefinition, headroomKindFor, headroomModelPredownloadScript, headroomPipPackage, headroomSnapshotDownloadLine, internalToPublic, isGuardrailDisposition, isHeadroomWrappable, isKnownAgentId, isKnownIntegrationId, isKnownModel, isLinkedAgentId, isPackId, isSkillId, normalizeAgentId, normalizeGuardrailPolicy, publicToInternal, recommendForDeps, renderToLines, resolveApiBaseUrl, skillHasRail, toRemoteCommand, tryGetContextWindow };
|
|
2152
|
+
export { AGENT_REGISTRY, AGENT_STANDARD_BLOCK, AGENT_STANDARD_MARKER, AGENT_STANDARD_TEXT, type AgentAuth, type AgentAuthKind, type AgentId, type AgentMetadata, type AgentMode, type AgentModel, type AgentReviewFinding, type AgentReviewPlan, type AgentReviewReport, type AnswerResolvedEvent, type AwaitingAnswerEvent, type BeadsActionCommand, type BeadsActionKind, type BeadsActionPayload, type BeadsActionRequest, type BeadsActionType, type BeadsConfigureAction, type BeadsDependencyDto, type BeadsDependencyKind, type BeadsIngestPayload, type BeadsIssueDto, type BeadsIssueStatus, type BeadsMemoryDto, type BeadsProjectDto, type BeadsProvisioningPayload, type BeadsProvisioningStatus, type BeadsSnapshotDto, type BeadsStatus, type BeadsStatusState, type BeadsStatusSummary, type BlameLineWire, type BrokeredIntegrationToken, CODER_PROMPT, type ChromeStep, type ChromeToolType, type CommitEntryWire, DEFAULT_API_BASE_URL, DEFAULT_GUARDRAIL_POLICY, DEP_TO_INTEGRATION, DEV_API_BASE_URL, type DerivedCredentialSource, type EnvVar, type FileBlameEvent, type FileChangeStatus, type FileChangedEvent, type FileHistoryEvent, type FileReviewStatus, GUARDRAIL_CATEGORIES, GUARDRAIL_CATEGORY_META, GUARDRAIL_CONFIGURE_COMMAND, GUARDRAIL_DISPOSITIONS, type GuardrailCategory, type GuardrailCategoryMeta, type GuardrailDisposition, type GuardrailPolicy, HANDOFF_FENCE_TAG, HEADROOM_BACKEND_ENV, HEADROOM_EXTRAS_BY_SURFACE, HEADROOM_MODELS, HEADROOM_PIP_COMPANIONS, HEADROOM_PROXY_PORT, HEADROOM_USAGE_COMMAND, HEARTBEAT_INTERVAL_MS_DEFAULT, HOUSE_AGENT_ID, HOUSE_AGENT_NAME, HOUSE_AGENT_PROVIDER, HOUSE_AGENT_SUBTITLE, HOUSE_AGENT_VENDOR, type HandoffProposal, type HandoffResolution, type HeadroomBudgetCommand, type HeadroomBudgetPeriod, type HeadroomBudgetUsage, type HeadroomKind, type HeadroomModelSpec, type HeadroomPythonRenderOpts, type HeadroomStatus, type HeadroomStep, type HeadroomSurface, type HeadroomUsageBucket, type HeadroomUsageGranularity, type HeadroomUsageReport, type HeadroomUsageResult, type HeadroomUsageSlice, type HeadroomUsageTotals, type HunkLineType, INSTALL_SNIPPETS, INTEGRATION_BRANDING, INTEGRATION_REGISTRY, INTERNAL_TO_PUBLIC, type InputSuggestionChunk, type IntegrationApiKeyField, type IntegrationAuthKind, type IntegrationBranding, type IntegrationCategory, type IntegrationDefinition, type IntegrationDelivery, type IntegrationHealth, type IntegrationId, type IntegrationMcpDelivery, type IntegrationStatus, type IntegrationsManifest, type IntegrationsManifestEntry, LINKED_AGENT_IDS, type LinkedAgentId, MODEL_CONTEXT_WINDOW, MODEL_PRICING, type ModelPricing, type NormalizedMessage, OBSERVER_BRIDGE_PORT, PACK_ACTION_COMMAND, PACK_REGISTRY, PACK_START_COMMAND, PACK_STATUS_COMMAND, PACK_WORKFLOW_ARTICLE, PREVIEW_DETECT_PROMPT, PROTOCOL_VERSION, PUBLIC_TO_INTERNAL, type PackActionKind, type PackActionPayload, type PackDefinition, type PackHandoffRecord, type PackId, type PackRunState, type PackRunStatus, type PackStageDef, type PackStageState, type PackStageStatus, type PackStartPayload, type PendingReviewHunkEvent, type PendingReviewHunkLine, type PrCheck, type PrRef, type PrReviewEntry, type PrReviewVerdict, type PreviewDetection, type PreviewErrorStage, type PreviewState, type PreviewStatus, type PullRequestDetail, type PullRequestSummary, QA_PROMPT, REVIEWER_PROMPT, type RemoteCommand, type RepoStack, type RepoStackDetection, SKILL_REGISTRY, SPECIFIER_PROMPT, SQUAD_CONFIGURE_COMMAND, SQUAD_HOP_BUDGET_DEFAULT, SQUAD_HOP_BUDGET_MAX, SQUAD_HOP_BUDGET_MIN, SQUAD_SPECIALTIES, SQUAD_STATS_COMMAND, SSE_SOCKET_TIMEOUT_MS, STACK_TO_RECOMMENDED, SWITCH_AGENT_COMMAND, type SelectPrompt, type SkillDefinition, type SkillDelivery, type SkillFileDelivery, type SkillId, type SkillRail, type SkillsManifest, type SkillsManifestEntry, type SquadAutoConfig, type SquadConfigurePayload, type SquadConfigureResult, type SquadMemberActivity, type SquadRosterAgent, type SquadRosterData, type SquadStatsResult, type StartTaskPayload, type StreamingChunkEvent, type StreamingChunkKind, type SwitchAgentCommand, type SwitchAgentResult, type SwitchAgentStatus, type SwitchAgentStep, TERMINAL_AGENT_PREFIX, UNKNOWN_MODEL_PRICING, UPCOMING_INTEGRATION_IDS, USER_EVENTS, type UserEventName, clampHopBudget, classifyStack, detectedIntegrationsFromDeps, getAgent, getContextWindow, getEnabledAgents, getEnabledIntegrations, getIntegration, getIntegrationBranding, getIntegrationsByCategory, getPackDefinition, getPricing, getSkillDefinition, headroomKindFor, headroomModelPredownloadScript, headroomPipPackage, headroomSnapshotDownloadLine, installableAgentIds, internalToPublic, isGuardrailDisposition, isHeadroomWrappable, isKnownAgentId, isKnownIntegrationId, isKnownModel, isLinkedAgentId, isNoopInstallSnippet, isPackId, isSkillId, normalizeAgentId, normalizeGuardrailPolicy, publicToInternal, recommendForDeps, renderToLines, resolveApiBaseUrl, skillHasRail, toRemoteCommand, tryGetContextWindow };
|
package/dist/index.d.ts
CHANGED
|
@@ -343,6 +343,77 @@ declare function headroomKindFor(agentId: string): HeadroomKind | null;
|
|
|
343
343
|
*/
|
|
344
344
|
declare function isHeadroomWrappable(agentId: string): boolean;
|
|
345
345
|
|
|
346
|
+
/**
|
|
347
|
+
* Canonical per-agent CLI **install** snippets.
|
|
348
|
+
*
|
|
349
|
+
* ─── Why this file exists ────────────────────────────────────────────────────
|
|
350
|
+
* Until now the only copy of these shell recipes lived inside the backend's
|
|
351
|
+
* codespace provisioning strategies — one `getInstallSnippet()` per
|
|
352
|
+
* `…ProvisioningStrategy` in
|
|
353
|
+
* `codeagent-mobile/apps/api-v2/src/codespaces/agent.ts`. That made them
|
|
354
|
+
* unreachable from the clients repo, so the CLI could never be tested against
|
|
355
|
+
* the REAL command a box actually runs: the `switch_agent` install path only
|
|
356
|
+
* ever saw a snippet handed to it over the wire at runtime.
|
|
357
|
+
*
|
|
358
|
+
* That gap is exactly how the **stale-PATH / half-finished-install** failure
|
|
359
|
+
* class (fleet-1, 2026-08-14) reached production: `npm install -g @openai/codex`
|
|
360
|
+
* succeeded, but the long-running CLI daemon's PATH predated the npm
|
|
361
|
+
* global-prefix bin dir, so the post-install probe reported "installed but its
|
|
362
|
+
* binary never appeared on PATH" — forever. No CI test could have caught it,
|
|
363
|
+
* because no CI test could run the real install.
|
|
364
|
+
*
|
|
365
|
+
* These strings are now **canonical HERE**. `apps/cli/__tests__/integration/
|
|
366
|
+
* agent-install.int.test.ts` runs each one for real, inside a container with a
|
|
367
|
+
* deliberately minimal (systemd-like) PATH, and then drives the REAL adapter
|
|
368
|
+
* probe from a single long-running node process.
|
|
369
|
+
*
|
|
370
|
+
* ─── api-v2 migration (deliberate follow-up, NOT done yet) ───────────────────
|
|
371
|
+
* The backend still owns its own copies. At the next `@codeam/shared` pin bump
|
|
372
|
+
* in api-v2, change exactly ONE file —
|
|
373
|
+
*
|
|
374
|
+
* codeagent-mobile/apps/api-v2/src/codespaces/agent.ts
|
|
375
|
+
*
|
|
376
|
+
* — so every `…ProvisioningStrategy.getInstallSnippet()` returns
|
|
377
|
+
* `INSTALL_SNIPPETS[<agentId>]` imported from `@codeam/shared` instead of an
|
|
378
|
+
* inline template literal. The `getAuthSnippet()` half stays in api-v2: it is
|
|
379
|
+
* credential-bearing and must never be mirrored into a package the clients
|
|
380
|
+
* bundle.
|
|
381
|
+
*
|
|
382
|
+
* ─── Invariants ──────────────────────────────────────────────────────────────
|
|
383
|
+
* • **Install ONLY.** Every credential/auth line from the backend strategies is
|
|
384
|
+
* deliberately excluded — no token, key, or secret substitution variable may
|
|
385
|
+
* ever appear here (asserted by `__tests__/agents-install-snippets.test.ts`).
|
|
386
|
+
* • **Idempotent.** Each snippet is `command -v`-guarded, so re-running it is
|
|
387
|
+
* always safe — that is what makes the `switch-agent.ts` retry-once recovery
|
|
388
|
+
* for the half-finished-bin-link class legitimate.
|
|
389
|
+
* • **Verbatim.** These are byte-for-byte ports of the api-v2 snippets. Do not
|
|
390
|
+
* "clean them up" independently — a divergence means a codespace and a
|
|
391
|
+
* self-hosted switch install different things.
|
|
392
|
+
* • `claude` is absent ON PURPOSE: its binary ships as an optional platform
|
|
393
|
+
* dependency of `@anthropic-ai/claude-agent-sdk` (installed with the CLI
|
|
394
|
+
* itself), so there is no separate install recipe to run.
|
|
395
|
+
*/
|
|
396
|
+
|
|
397
|
+
/**
|
|
398
|
+
* The canonical install recipe per agent. `Partial` because not every agent has
|
|
399
|
+
* one: `claude` ships its binary with the SDK, and `copilot` has no
|
|
400
|
+
* provisioning strategy yet.
|
|
401
|
+
*/
|
|
402
|
+
declare const INSTALL_SNIPPETS: Readonly<Partial<Record<AgentId, string>>>;
|
|
403
|
+
/**
|
|
404
|
+
* Agents whose canonical snippet actually installs something. Excludes
|
|
405
|
+
* `coderabbit` (credential-only no-op — see {@link INSTALL_SNIPPETS}).
|
|
406
|
+
*
|
|
407
|
+
* This is the list the real-install integration gate iterates.
|
|
408
|
+
*/
|
|
409
|
+
declare function installableAgentIds(): AgentId[];
|
|
410
|
+
/**
|
|
411
|
+
* True when a snippet performs no installation at all (a bare marker `echo`).
|
|
412
|
+
* Callers that need a real binary must fall back to the agent's own CLI-side
|
|
413
|
+
* installer instead of running the snippet.
|
|
414
|
+
*/
|
|
415
|
+
declare function isNoopInstallSnippet(snippet: string | undefined): boolean;
|
|
416
|
+
|
|
346
417
|
/**
|
|
347
418
|
* Agent Toolkits — integration wire types.
|
|
348
419
|
* Spec: docs/superpowers/specs/2026-07-10-agent-toolkits-integrations-design.md
|
|
@@ -2078,4 +2149,4 @@ type UserEventName = (typeof USER_EVENTS)[keyof typeof USER_EVENTS];
|
|
|
2078
2149
|
*/
|
|
2079
2150
|
declare const PREVIEW_DETECT_PROMPT: string;
|
|
2080
2151
|
|
|
2081
|
-
export { AGENT_REGISTRY, AGENT_STANDARD_BLOCK, AGENT_STANDARD_MARKER, AGENT_STANDARD_TEXT, type AgentAuth, type AgentAuthKind, type AgentId, type AgentMetadata, type AgentMode, type AgentModel, type AgentReviewFinding, type AgentReviewPlan, type AgentReviewReport, type AnswerResolvedEvent, type AwaitingAnswerEvent, type BeadsActionCommand, type BeadsActionKind, type BeadsActionPayload, type BeadsActionRequest, type BeadsActionType, type BeadsConfigureAction, type BeadsDependencyDto, type BeadsDependencyKind, type BeadsIngestPayload, type BeadsIssueDto, type BeadsIssueStatus, type BeadsMemoryDto, type BeadsProjectDto, type BeadsProvisioningPayload, type BeadsProvisioningStatus, type BeadsSnapshotDto, type BeadsStatus, type BeadsStatusState, type BeadsStatusSummary, type BlameLineWire, type BrokeredIntegrationToken, CODER_PROMPT, type ChromeStep, type ChromeToolType, type CommitEntryWire, DEFAULT_API_BASE_URL, DEFAULT_GUARDRAIL_POLICY, DEP_TO_INTEGRATION, DEV_API_BASE_URL, type DerivedCredentialSource, type EnvVar, type FileBlameEvent, type FileChangeStatus, type FileChangedEvent, type FileHistoryEvent, type FileReviewStatus, GUARDRAIL_CATEGORIES, GUARDRAIL_CATEGORY_META, GUARDRAIL_CONFIGURE_COMMAND, GUARDRAIL_DISPOSITIONS, type GuardrailCategory, type GuardrailCategoryMeta, type GuardrailDisposition, type GuardrailPolicy, HANDOFF_FENCE_TAG, HEADROOM_BACKEND_ENV, HEADROOM_EXTRAS_BY_SURFACE, HEADROOM_MODELS, HEADROOM_PIP_COMPANIONS, HEADROOM_PROXY_PORT, HEADROOM_USAGE_COMMAND, HEARTBEAT_INTERVAL_MS_DEFAULT, HOUSE_AGENT_ID, HOUSE_AGENT_NAME, HOUSE_AGENT_PROVIDER, HOUSE_AGENT_SUBTITLE, HOUSE_AGENT_VENDOR, type HandoffProposal, type HandoffResolution, type HeadroomBudgetCommand, type HeadroomBudgetPeriod, type HeadroomBudgetUsage, type HeadroomKind, type HeadroomModelSpec, type HeadroomPythonRenderOpts, type HeadroomStatus, type HeadroomStep, type HeadroomSurface, type HeadroomUsageBucket, type HeadroomUsageGranularity, type HeadroomUsageReport, type HeadroomUsageResult, type HeadroomUsageSlice, type HeadroomUsageTotals, type HunkLineType, INTEGRATION_BRANDING, INTEGRATION_REGISTRY, INTERNAL_TO_PUBLIC, type InputSuggestionChunk, type IntegrationApiKeyField, type IntegrationAuthKind, type IntegrationBranding, type IntegrationCategory, type IntegrationDefinition, type IntegrationDelivery, type IntegrationHealth, type IntegrationId, type IntegrationMcpDelivery, type IntegrationStatus, type IntegrationsManifest, type IntegrationsManifestEntry, LINKED_AGENT_IDS, type LinkedAgentId, MODEL_CONTEXT_WINDOW, MODEL_PRICING, type ModelPricing, type NormalizedMessage, OBSERVER_BRIDGE_PORT, PACK_ACTION_COMMAND, PACK_REGISTRY, PACK_START_COMMAND, PACK_STATUS_COMMAND, PACK_WORKFLOW_ARTICLE, PREVIEW_DETECT_PROMPT, PROTOCOL_VERSION, PUBLIC_TO_INTERNAL, type PackActionKind, type PackActionPayload, type PackDefinition, type PackHandoffRecord, type PackId, type PackRunState, type PackRunStatus, type PackStageDef, type PackStageState, type PackStageStatus, type PackStartPayload, type PendingReviewHunkEvent, type PendingReviewHunkLine, type PrCheck, type PrRef, type PrReviewEntry, type PrReviewVerdict, type PreviewDetection, type PreviewErrorStage, type PreviewState, type PreviewStatus, type PullRequestDetail, type PullRequestSummary, QA_PROMPT, REVIEWER_PROMPT, type RemoteCommand, type RepoStack, type RepoStackDetection, SKILL_REGISTRY, SPECIFIER_PROMPT, SQUAD_CONFIGURE_COMMAND, SQUAD_HOP_BUDGET_DEFAULT, SQUAD_HOP_BUDGET_MAX, SQUAD_HOP_BUDGET_MIN, SQUAD_SPECIALTIES, SQUAD_STATS_COMMAND, SSE_SOCKET_TIMEOUT_MS, STACK_TO_RECOMMENDED, SWITCH_AGENT_COMMAND, type SelectPrompt, type SkillDefinition, type SkillDelivery, type SkillFileDelivery, type SkillId, type SkillRail, type SkillsManifest, type SkillsManifestEntry, type SquadAutoConfig, type SquadConfigurePayload, type SquadConfigureResult, type SquadMemberActivity, type SquadRosterAgent, type SquadRosterData, type SquadStatsResult, type StartTaskPayload, type StreamingChunkEvent, type StreamingChunkKind, type SwitchAgentCommand, type SwitchAgentResult, type SwitchAgentStatus, type SwitchAgentStep, TERMINAL_AGENT_PREFIX, UNKNOWN_MODEL_PRICING, UPCOMING_INTEGRATION_IDS, USER_EVENTS, type UserEventName, clampHopBudget, classifyStack, detectedIntegrationsFromDeps, getAgent, getContextWindow, getEnabledAgents, getEnabledIntegrations, getIntegration, getIntegrationBranding, getIntegrationsByCategory, getPackDefinition, getPricing, getSkillDefinition, headroomKindFor, headroomModelPredownloadScript, headroomPipPackage, headroomSnapshotDownloadLine, internalToPublic, isGuardrailDisposition, isHeadroomWrappable, isKnownAgentId, isKnownIntegrationId, isKnownModel, isLinkedAgentId, isPackId, isSkillId, normalizeAgentId, normalizeGuardrailPolicy, publicToInternal, recommendForDeps, renderToLines, resolveApiBaseUrl, skillHasRail, toRemoteCommand, tryGetContextWindow };
|
|
2152
|
+
export { AGENT_REGISTRY, AGENT_STANDARD_BLOCK, AGENT_STANDARD_MARKER, AGENT_STANDARD_TEXT, type AgentAuth, type AgentAuthKind, type AgentId, type AgentMetadata, type AgentMode, type AgentModel, type AgentReviewFinding, type AgentReviewPlan, type AgentReviewReport, type AnswerResolvedEvent, type AwaitingAnswerEvent, type BeadsActionCommand, type BeadsActionKind, type BeadsActionPayload, type BeadsActionRequest, type BeadsActionType, type BeadsConfigureAction, type BeadsDependencyDto, type BeadsDependencyKind, type BeadsIngestPayload, type BeadsIssueDto, type BeadsIssueStatus, type BeadsMemoryDto, type BeadsProjectDto, type BeadsProvisioningPayload, type BeadsProvisioningStatus, type BeadsSnapshotDto, type BeadsStatus, type BeadsStatusState, type BeadsStatusSummary, type BlameLineWire, type BrokeredIntegrationToken, CODER_PROMPT, type ChromeStep, type ChromeToolType, type CommitEntryWire, DEFAULT_API_BASE_URL, DEFAULT_GUARDRAIL_POLICY, DEP_TO_INTEGRATION, DEV_API_BASE_URL, type DerivedCredentialSource, type EnvVar, type FileBlameEvent, type FileChangeStatus, type FileChangedEvent, type FileHistoryEvent, type FileReviewStatus, GUARDRAIL_CATEGORIES, GUARDRAIL_CATEGORY_META, GUARDRAIL_CONFIGURE_COMMAND, GUARDRAIL_DISPOSITIONS, type GuardrailCategory, type GuardrailCategoryMeta, type GuardrailDisposition, type GuardrailPolicy, HANDOFF_FENCE_TAG, HEADROOM_BACKEND_ENV, HEADROOM_EXTRAS_BY_SURFACE, HEADROOM_MODELS, HEADROOM_PIP_COMPANIONS, HEADROOM_PROXY_PORT, HEADROOM_USAGE_COMMAND, HEARTBEAT_INTERVAL_MS_DEFAULT, HOUSE_AGENT_ID, HOUSE_AGENT_NAME, HOUSE_AGENT_PROVIDER, HOUSE_AGENT_SUBTITLE, HOUSE_AGENT_VENDOR, type HandoffProposal, type HandoffResolution, type HeadroomBudgetCommand, type HeadroomBudgetPeriod, type HeadroomBudgetUsage, type HeadroomKind, type HeadroomModelSpec, type HeadroomPythonRenderOpts, type HeadroomStatus, type HeadroomStep, type HeadroomSurface, type HeadroomUsageBucket, type HeadroomUsageGranularity, type HeadroomUsageReport, type HeadroomUsageResult, type HeadroomUsageSlice, type HeadroomUsageTotals, type HunkLineType, INSTALL_SNIPPETS, INTEGRATION_BRANDING, INTEGRATION_REGISTRY, INTERNAL_TO_PUBLIC, type InputSuggestionChunk, type IntegrationApiKeyField, type IntegrationAuthKind, type IntegrationBranding, type IntegrationCategory, type IntegrationDefinition, type IntegrationDelivery, type IntegrationHealth, type IntegrationId, type IntegrationMcpDelivery, type IntegrationStatus, type IntegrationsManifest, type IntegrationsManifestEntry, LINKED_AGENT_IDS, type LinkedAgentId, MODEL_CONTEXT_WINDOW, MODEL_PRICING, type ModelPricing, type NormalizedMessage, OBSERVER_BRIDGE_PORT, PACK_ACTION_COMMAND, PACK_REGISTRY, PACK_START_COMMAND, PACK_STATUS_COMMAND, PACK_WORKFLOW_ARTICLE, PREVIEW_DETECT_PROMPT, PROTOCOL_VERSION, PUBLIC_TO_INTERNAL, type PackActionKind, type PackActionPayload, type PackDefinition, type PackHandoffRecord, type PackId, type PackRunState, type PackRunStatus, type PackStageDef, type PackStageState, type PackStageStatus, type PackStartPayload, type PendingReviewHunkEvent, type PendingReviewHunkLine, type PrCheck, type PrRef, type PrReviewEntry, type PrReviewVerdict, type PreviewDetection, type PreviewErrorStage, type PreviewState, type PreviewStatus, type PullRequestDetail, type PullRequestSummary, QA_PROMPT, REVIEWER_PROMPT, type RemoteCommand, type RepoStack, type RepoStackDetection, SKILL_REGISTRY, SPECIFIER_PROMPT, SQUAD_CONFIGURE_COMMAND, SQUAD_HOP_BUDGET_DEFAULT, SQUAD_HOP_BUDGET_MAX, SQUAD_HOP_BUDGET_MIN, SQUAD_SPECIALTIES, SQUAD_STATS_COMMAND, SSE_SOCKET_TIMEOUT_MS, STACK_TO_RECOMMENDED, SWITCH_AGENT_COMMAND, type SelectPrompt, type SkillDefinition, type SkillDelivery, type SkillFileDelivery, type SkillId, type SkillRail, type SkillsManifest, type SkillsManifestEntry, type SquadAutoConfig, type SquadConfigurePayload, type SquadConfigureResult, type SquadMemberActivity, type SquadRosterAgent, type SquadRosterData, type SquadStatsResult, type StartTaskPayload, type StreamingChunkEvent, type StreamingChunkKind, type SwitchAgentCommand, type SwitchAgentResult, type SwitchAgentStatus, type SwitchAgentStep, TERMINAL_AGENT_PREFIX, UNKNOWN_MODEL_PRICING, UPCOMING_INTEGRATION_IDS, USER_EVENTS, type UserEventName, clampHopBudget, classifyStack, detectedIntegrationsFromDeps, getAgent, getContextWindow, getEnabledAgents, getEnabledIntegrations, getIntegration, getIntegrationBranding, getIntegrationsByCategory, getPackDefinition, getPricing, getSkillDefinition, headroomKindFor, headroomModelPredownloadScript, headroomPipPackage, headroomSnapshotDownloadLine, installableAgentIds, internalToPublic, isGuardrailDisposition, isHeadroomWrappable, isKnownAgentId, isKnownIntegrationId, isKnownModel, isLinkedAgentId, isNoopInstallSnippet, isPackId, isSkillId, normalizeAgentId, normalizeGuardrailPolicy, publicToInternal, recommendForDeps, renderToLines, resolveApiBaseUrl, skillHasRail, toRemoteCommand, tryGetContextWindow };
|
package/dist/index.js
CHANGED
|
@@ -46,6 +46,7 @@ __export(index_exports, {
|
|
|
46
46
|
HOUSE_AGENT_PROVIDER: () => HOUSE_AGENT_PROVIDER,
|
|
47
47
|
HOUSE_AGENT_SUBTITLE: () => HOUSE_AGENT_SUBTITLE,
|
|
48
48
|
HOUSE_AGENT_VENDOR: () => HOUSE_AGENT_VENDOR,
|
|
49
|
+
INSTALL_SNIPPETS: () => INSTALL_SNIPPETS,
|
|
49
50
|
INTEGRATION_BRANDING: () => INTEGRATION_BRANDING,
|
|
50
51
|
INTEGRATION_REGISTRY: () => INTEGRATION_REGISTRY,
|
|
51
52
|
INTERNAL_TO_PUBLIC: () => INTERNAL_TO_PUBLIC,
|
|
@@ -95,6 +96,7 @@ __export(index_exports, {
|
|
|
95
96
|
headroomModelPredownloadScript: () => headroomModelPredownloadScript,
|
|
96
97
|
headroomPipPackage: () => headroomPipPackage,
|
|
97
98
|
headroomSnapshotDownloadLine: () => headroomSnapshotDownloadLine,
|
|
99
|
+
installableAgentIds: () => installableAgentIds,
|
|
98
100
|
internalToPublic: () => internalToPublic,
|
|
99
101
|
isGuardrailDisposition: () => isGuardrailDisposition,
|
|
100
102
|
isHeadroomWrappable: () => isHeadroomWrappable,
|
|
@@ -102,6 +104,7 @@ __export(index_exports, {
|
|
|
102
104
|
isKnownIntegrationId: () => isKnownIntegrationId,
|
|
103
105
|
isKnownModel: () => isKnownModel,
|
|
104
106
|
isLinkedAgentId: () => isLinkedAgentId,
|
|
107
|
+
isNoopInstallSnippet: () => isNoopInstallSnippet,
|
|
105
108
|
isPackId: () => isPackId,
|
|
106
109
|
isSkillId: () => isSkillId,
|
|
107
110
|
normalizeAgentId: () => normalizeAgentId,
|
|
@@ -600,6 +603,79 @@ function isHeadroomWrappable(agentId) {
|
|
|
600
603
|
return headroomKindFor(agentId) !== null;
|
|
601
604
|
}
|
|
602
605
|
|
|
606
|
+
// src/agents/install-snippets.ts
|
|
607
|
+
var CODEX = `
|
|
608
|
+
if ! command -v codex >/dev/null 2>&1; then
|
|
609
|
+
npm install -g @openai/codex >/dev/null
|
|
610
|
+
fi`;
|
|
611
|
+
var GEMINI = `
|
|
612
|
+
if ! command -v gemini >/dev/null 2>&1; then
|
|
613
|
+
npm install -g @google/gemini-cli >/dev/null
|
|
614
|
+
fi`;
|
|
615
|
+
var KIMI = `
|
|
616
|
+
if ! command -v kimi >/dev/null 2>&1; then
|
|
617
|
+
curl -fsSL https://code.kimi.com/kimi-code/install.sh | bash \\
|
|
618
|
+
|| { echo '[codeam:step] kimi_install_retry' >&2; sleep 2; curl -fsSL https://code.kimi.com/kimi-code/install.sh | bash; } \\
|
|
619
|
+
|| { echo '[ERROR] Kimi Code install failed (code.kimi.com/kimi-code/install.sh)' >&2; exit 1; }
|
|
620
|
+
echo 'export PATH="$HOME/.kimi-code/bin:$PATH"' >> ~/.bashrc
|
|
621
|
+
export PATH="$HOME/.kimi-code/bin:$PATH"
|
|
622
|
+
fi
|
|
623
|
+
# Integrity guard: the installer can leave a TRUNCATED binary (SIGSEGV on run)
|
|
624
|
+
# when the ~157MB download is interrupted mid-bootstrap \u2014 the ELF ends up
|
|
625
|
+
# missing its section headers and every \`kimi\` invocation segfaults, so the ACP
|
|
626
|
+
# adapter dies. Verify \`kimi\` actually runs; re-install once if it doesn't.
|
|
627
|
+
if ! kimi --version >/dev/null 2>&1; then
|
|
628
|
+
echo '[codeam:step] kimi_binary_broken_reinstall' >&2
|
|
629
|
+
curl -fsSL https://code.kimi.com/kimi-code/install.sh | bash || true
|
|
630
|
+
export PATH="$HOME/.kimi-code/bin:$PATH"
|
|
631
|
+
fi`;
|
|
632
|
+
var CURSOR = `
|
|
633
|
+
if ! command -v cursor-agent >/dev/null 2>&1; then
|
|
634
|
+
# Retry the installer once \u2014 under the bootstrap's \`set -euo pipefail\`
|
|
635
|
+
# a single transient failure of this unguarded network pipe would
|
|
636
|
+
# otherwise abort the whole bootstrap with a bare exit 1. The
|
|
637
|
+
# \`[ERROR]\` prefix on final failure is picked up by the stderr
|
|
638
|
+
# error-detector and the captured summary.
|
|
639
|
+
curl https://cursor.com/install -fsS | bash \\
|
|
640
|
+
|| { echo '[codeam:step] cursor_install_retry' >&2; sleep 2; curl https://cursor.com/install -fsS | bash; } \\
|
|
641
|
+
|| { echo '[ERROR] cursor-agent install failed (cursor.com/install)' >&2; exit 1; }
|
|
642
|
+
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
|
|
643
|
+
export PATH="$HOME/.local/bin:$PATH"
|
|
644
|
+
fi`;
|
|
645
|
+
var OPENCODE = `
|
|
646
|
+
if ! command -v opencode >/dev/null 2>&1; then
|
|
647
|
+
curl -fsSL https://opencode.ai/install | bash \\
|
|
648
|
+
|| { echo '[codeam:step] opencode_install_retry' >&2; sleep 2; curl -fsSL https://opencode.ai/install | bash; } \\
|
|
649
|
+
|| { echo '[ERROR] opencode install failed (opencode.ai/install)' >&2; exit 1; }
|
|
650
|
+
echo 'export PATH="$HOME/.opencode/bin:$PATH"' >> ~/.bashrc
|
|
651
|
+
export PATH="$HOME/.opencode/bin:$PATH"
|
|
652
|
+
fi`;
|
|
653
|
+
var AIDER = `
|
|
654
|
+
if ! command -v aider >/dev/null 2>&1; then
|
|
655
|
+
pip install --no-cache-dir --break-system-packages aider-chat \\
|
|
656
|
+
|| { echo '[codeam:step] aider_install_retry' >&2; sleep 2; pip install --no-cache-dir --break-system-packages aider-chat; } \\
|
|
657
|
+
|| { echo '[ERROR] aider install failed (pip aider-chat)' >&2; exit 1; }
|
|
658
|
+
fi`;
|
|
659
|
+
var CODERABBIT = `echo '[codeam:step] coderabbit_reviewer_credential_only'`;
|
|
660
|
+
var INSTALL_SNIPPETS = Object.freeze({
|
|
661
|
+
codex: CODEX,
|
|
662
|
+
gemini: GEMINI,
|
|
663
|
+
kimi: KIMI,
|
|
664
|
+
cursor: CURSOR,
|
|
665
|
+
opencode: OPENCODE,
|
|
666
|
+
aider: AIDER,
|
|
667
|
+
coderabbit: CODERABBIT
|
|
668
|
+
});
|
|
669
|
+
function installableAgentIds() {
|
|
670
|
+
return Object.keys(INSTALL_SNIPPETS).filter(
|
|
671
|
+
(id) => !isNoopInstallSnippet(INSTALL_SNIPPETS[id])
|
|
672
|
+
);
|
|
673
|
+
}
|
|
674
|
+
function isNoopInstallSnippet(snippet) {
|
|
675
|
+
if (!snippet) return true;
|
|
676
|
+
return /^\s*echo\s/.test(snippet) && !/\n/.test(snippet.trim());
|
|
677
|
+
}
|
|
678
|
+
|
|
603
679
|
// src/integrations/registry.ts
|
|
604
680
|
var INTEGRATION_REGISTRY = {
|
|
605
681
|
jira: {
|
|
@@ -2956,6 +3032,7 @@ OUTPUT JSON ONLY. NO MARKDOWN. NO COMMENTARY.
|
|
|
2956
3032
|
HOUSE_AGENT_PROVIDER,
|
|
2957
3033
|
HOUSE_AGENT_SUBTITLE,
|
|
2958
3034
|
HOUSE_AGENT_VENDOR,
|
|
3035
|
+
INSTALL_SNIPPETS,
|
|
2959
3036
|
INTEGRATION_BRANDING,
|
|
2960
3037
|
INTEGRATION_REGISTRY,
|
|
2961
3038
|
INTERNAL_TO_PUBLIC,
|
|
@@ -3005,6 +3082,7 @@ OUTPUT JSON ONLY. NO MARKDOWN. NO COMMENTARY.
|
|
|
3005
3082
|
headroomModelPredownloadScript,
|
|
3006
3083
|
headroomPipPackage,
|
|
3007
3084
|
headroomSnapshotDownloadLine,
|
|
3085
|
+
installableAgentIds,
|
|
3008
3086
|
internalToPublic,
|
|
3009
3087
|
isGuardrailDisposition,
|
|
3010
3088
|
isHeadroomWrappable,
|
|
@@ -3012,6 +3090,7 @@ OUTPUT JSON ONLY. NO MARKDOWN. NO COMMENTARY.
|
|
|
3012
3090
|
isKnownIntegrationId,
|
|
3013
3091
|
isKnownModel,
|
|
3014
3092
|
isLinkedAgentId,
|
|
3093
|
+
isNoopInstallSnippet,
|
|
3015
3094
|
isPackId,
|
|
3016
3095
|
isSkillId,
|
|
3017
3096
|
normalizeAgentId,
|