@codeam/shared 2.64.0 → 2.65.1

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 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
@@ -1809,6 +1880,71 @@ interface HandoffProposal {
1809
1880
  toAgentId: string;
1810
1881
  reason: string;
1811
1882
  prompt: string;
1883
+ /**
1884
+ * Autonomous mode (P2-2): the CLI accepted this proposal ITSELF instead of
1885
+ * emitting the tap-to-accept card. Mobile renders a passive timeline notice
1886
+ * for `auto: true`, never the accept card. Absent = the v1 card flow.
1887
+ */
1888
+ auto?: boolean;
1889
+ /**
1890
+ * Hops left in the chain AFTER this one (`auto` only) — the hop is already
1891
+ * spent when this is emitted, so `0` means "this is the last auto hop; any
1892
+ * further proposal falls back to the card". Mobile renders it verbatim as
1893
+ * "<n> hops left".
1894
+ */
1895
+ hopsRemaining?: number;
1896
+ }
1897
+ /** `handoff_resolved` event payload. `auto` mirrors {@link HandoffProposal}. */
1898
+ interface HandoffResolution {
1899
+ proposalId: string;
1900
+ accepted: boolean;
1901
+ auto?: boolean;
1902
+ }
1903
+ /** Relay command: read/write the session's autonomous-handoff mode. */
1904
+ declare const SQUAD_CONFIGURE_COMMAND = "squad_configure";
1905
+ /** Relay command: per-member activity for the "Squad activity" screen. */
1906
+ declare const SQUAD_STATS_COMMAND = "squad_stats";
1907
+ declare const SQUAD_HOP_BUDGET_DEFAULT = 3;
1908
+ declare const SQUAD_HOP_BUDGET_MIN = 1;
1909
+ declare const SQUAD_HOP_BUDGET_MAX = 10;
1910
+ /**
1911
+ * Clamp a caller-supplied hop budget into the supported range, falling back to
1912
+ * the default for a missing / non-finite value. The ONE place the bound lives —
1913
+ * the CLI's config mutator and its `squad_configure` handler both call it.
1914
+ */
1915
+ declare function clampHopBudget(value: unknown): number;
1916
+ /** Persisted per-session autonomous-handoff mode. Default OFF. */
1917
+ interface SquadAutoConfig {
1918
+ enabled: boolean;
1919
+ hopBudget: number;
1920
+ }
1921
+ type SquadConfigurePayload = {
1922
+ action: 'set';
1923
+ autoHandoffs: boolean;
1924
+ hopBudget?: number;
1925
+ } | {
1926
+ action: 'status';
1927
+ };
1928
+ /** Ack of {@link SQUAD_CONFIGURE_COMMAND} — the state AFTER the command. */
1929
+ interface SquadConfigureResult extends SquadAutoConfig {
1930
+ /** Hops left in the current chain (resets on every user prompt). */
1931
+ hopsRemaining: number;
1932
+ }
1933
+ interface SquadMemberActivity {
1934
+ agentId: string;
1935
+ turns: number;
1936
+ /** DISTINCT paths this member touched across its journaled turns. */
1937
+ filesTouched: number;
1938
+ }
1939
+ /** Ack of {@link SQUAD_STATS_COMMAND}. No cost attribution in v1. */
1940
+ interface SquadStatsResult {
1941
+ members: SquadMemberActivity[];
1942
+ handoffs: {
1943
+ proposed: number;
1944
+ accepted: number;
1945
+ auto: number;
1946
+ };
1947
+ sinceTurn: number;
1812
1948
  }
1813
1949
  /** Per-agent specialty blurbs for the team preamble. Copy, not routing. */
1814
1950
  declare const SQUAD_SPECIALTIES: Readonly<Partial<Record<AgentId, string>>>;
@@ -2013,4 +2149,4 @@ type UserEventName = (typeof USER_EVENTS)[keyof typeof USER_EVENTS];
2013
2149
  */
2014
2150
  declare const PREVIEW_DETECT_PROMPT: string;
2015
2151
 
2016
- 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 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_SPECIALTIES, 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 SquadRosterAgent, type SquadRosterData, 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, 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
@@ -1809,6 +1880,71 @@ interface HandoffProposal {
1809
1880
  toAgentId: string;
1810
1881
  reason: string;
1811
1882
  prompt: string;
1883
+ /**
1884
+ * Autonomous mode (P2-2): the CLI accepted this proposal ITSELF instead of
1885
+ * emitting the tap-to-accept card. Mobile renders a passive timeline notice
1886
+ * for `auto: true`, never the accept card. Absent = the v1 card flow.
1887
+ */
1888
+ auto?: boolean;
1889
+ /**
1890
+ * Hops left in the chain AFTER this one (`auto` only) — the hop is already
1891
+ * spent when this is emitted, so `0` means "this is the last auto hop; any
1892
+ * further proposal falls back to the card". Mobile renders it verbatim as
1893
+ * "<n> hops left".
1894
+ */
1895
+ hopsRemaining?: number;
1896
+ }
1897
+ /** `handoff_resolved` event payload. `auto` mirrors {@link HandoffProposal}. */
1898
+ interface HandoffResolution {
1899
+ proposalId: string;
1900
+ accepted: boolean;
1901
+ auto?: boolean;
1902
+ }
1903
+ /** Relay command: read/write the session's autonomous-handoff mode. */
1904
+ declare const SQUAD_CONFIGURE_COMMAND = "squad_configure";
1905
+ /** Relay command: per-member activity for the "Squad activity" screen. */
1906
+ declare const SQUAD_STATS_COMMAND = "squad_stats";
1907
+ declare const SQUAD_HOP_BUDGET_DEFAULT = 3;
1908
+ declare const SQUAD_HOP_BUDGET_MIN = 1;
1909
+ declare const SQUAD_HOP_BUDGET_MAX = 10;
1910
+ /**
1911
+ * Clamp a caller-supplied hop budget into the supported range, falling back to
1912
+ * the default for a missing / non-finite value. The ONE place the bound lives —
1913
+ * the CLI's config mutator and its `squad_configure` handler both call it.
1914
+ */
1915
+ declare function clampHopBudget(value: unknown): number;
1916
+ /** Persisted per-session autonomous-handoff mode. Default OFF. */
1917
+ interface SquadAutoConfig {
1918
+ enabled: boolean;
1919
+ hopBudget: number;
1920
+ }
1921
+ type SquadConfigurePayload = {
1922
+ action: 'set';
1923
+ autoHandoffs: boolean;
1924
+ hopBudget?: number;
1925
+ } | {
1926
+ action: 'status';
1927
+ };
1928
+ /** Ack of {@link SQUAD_CONFIGURE_COMMAND} — the state AFTER the command. */
1929
+ interface SquadConfigureResult extends SquadAutoConfig {
1930
+ /** Hops left in the current chain (resets on every user prompt). */
1931
+ hopsRemaining: number;
1932
+ }
1933
+ interface SquadMemberActivity {
1934
+ agentId: string;
1935
+ turns: number;
1936
+ /** DISTINCT paths this member touched across its journaled turns. */
1937
+ filesTouched: number;
1938
+ }
1939
+ /** Ack of {@link SQUAD_STATS_COMMAND}. No cost attribution in v1. */
1940
+ interface SquadStatsResult {
1941
+ members: SquadMemberActivity[];
1942
+ handoffs: {
1943
+ proposed: number;
1944
+ accepted: number;
1945
+ auto: number;
1946
+ };
1947
+ sinceTurn: number;
1812
1948
  }
1813
1949
  /** Per-agent specialty blurbs for the team preamble. Copy, not routing. */
1814
1950
  declare const SQUAD_SPECIALTIES: Readonly<Partial<Record<AgentId, string>>>;
@@ -2013,4 +2149,4 @@ type UserEventName = (typeof USER_EVENTS)[keyof typeof USER_EVENTS];
2013
2149
  */
2014
2150
  declare const PREVIEW_DETECT_PROMPT: string;
2015
2151
 
2016
- 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 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_SPECIALTIES, 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 SquadRosterAgent, type SquadRosterData, 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, 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,
@@ -65,7 +66,12 @@ __export(index_exports, {
65
66
  REVIEWER_PROMPT: () => REVIEWER_PROMPT,
66
67
  SKILL_REGISTRY: () => SKILL_REGISTRY,
67
68
  SPECIFIER_PROMPT: () => SPECIFIER_PROMPT,
69
+ SQUAD_CONFIGURE_COMMAND: () => SQUAD_CONFIGURE_COMMAND,
70
+ SQUAD_HOP_BUDGET_DEFAULT: () => SQUAD_HOP_BUDGET_DEFAULT,
71
+ SQUAD_HOP_BUDGET_MAX: () => SQUAD_HOP_BUDGET_MAX,
72
+ SQUAD_HOP_BUDGET_MIN: () => SQUAD_HOP_BUDGET_MIN,
68
73
  SQUAD_SPECIALTIES: () => SQUAD_SPECIALTIES,
74
+ SQUAD_STATS_COMMAND: () => SQUAD_STATS_COMMAND,
69
75
  SSE_SOCKET_TIMEOUT_MS: () => SSE_SOCKET_TIMEOUT_MS,
70
76
  STACK_TO_RECOMMENDED: () => STACK_TO_RECOMMENDED,
71
77
  SWITCH_AGENT_COMMAND: () => SWITCH_AGENT_COMMAND,
@@ -73,6 +79,7 @@ __export(index_exports, {
73
79
  UNKNOWN_MODEL_PRICING: () => UNKNOWN_MODEL_PRICING,
74
80
  UPCOMING_INTEGRATION_IDS: () => UPCOMING_INTEGRATION_IDS,
75
81
  USER_EVENTS: () => USER_EVENTS,
82
+ clampHopBudget: () => clampHopBudget,
76
83
  classifyStack: () => classifyStack,
77
84
  detectedIntegrationsFromDeps: () => detectedIntegrationsFromDeps,
78
85
  getAgent: () => getAgent,
@@ -89,6 +96,7 @@ __export(index_exports, {
89
96
  headroomModelPredownloadScript: () => headroomModelPredownloadScript,
90
97
  headroomPipPackage: () => headroomPipPackage,
91
98
  headroomSnapshotDownloadLine: () => headroomSnapshotDownloadLine,
99
+ installableAgentIds: () => installableAgentIds,
92
100
  internalToPublic: () => internalToPublic,
93
101
  isGuardrailDisposition: () => isGuardrailDisposition,
94
102
  isHeadroomWrappable: () => isHeadroomWrappable,
@@ -96,6 +104,7 @@ __export(index_exports, {
96
104
  isKnownIntegrationId: () => isKnownIntegrationId,
97
105
  isKnownModel: () => isKnownModel,
98
106
  isLinkedAgentId: () => isLinkedAgentId,
107
+ isNoopInstallSnippet: () => isNoopInstallSnippet,
99
108
  isPackId: () => isPackId,
100
109
  isSkillId: () => isSkillId,
101
110
  normalizeAgentId: () => normalizeAgentId,
@@ -594,6 +603,79 @@ function isHeadroomWrappable(agentId) {
594
603
  return headroomKindFor(agentId) !== null;
595
604
  }
596
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
+
597
679
  // src/integrations/registry.ts
598
680
  var INTEGRATION_REGISTRY = {
599
681
  jira: {
@@ -2704,6 +2786,15 @@ var SWITCH_AGENT_COMMAND = "switch_agent";
2704
2786
 
2705
2787
  // src/types/agent-squad.ts
2706
2788
  var HANDOFF_FENCE_TAG = "codeam-handoff";
2789
+ var SQUAD_CONFIGURE_COMMAND = "squad_configure";
2790
+ var SQUAD_STATS_COMMAND = "squad_stats";
2791
+ var SQUAD_HOP_BUDGET_DEFAULT = 3;
2792
+ var SQUAD_HOP_BUDGET_MIN = 1;
2793
+ var SQUAD_HOP_BUDGET_MAX = 10;
2794
+ function clampHopBudget(value) {
2795
+ if (typeof value !== "number" || !Number.isFinite(value)) return SQUAD_HOP_BUDGET_DEFAULT;
2796
+ return Math.min(SQUAD_HOP_BUDGET_MAX, Math.max(SQUAD_HOP_BUDGET_MIN, Math.round(value)));
2797
+ }
2707
2798
  var SQUAD_SPECIALTIES = {
2708
2799
  claude: "deep reasoning, refactors, and multi-step architecture work",
2709
2800
  codex: "fast, focused implementation and test fixing",
@@ -2941,6 +3032,7 @@ OUTPUT JSON ONLY. NO MARKDOWN. NO COMMENTARY.
2941
3032
  HOUSE_AGENT_PROVIDER,
2942
3033
  HOUSE_AGENT_SUBTITLE,
2943
3034
  HOUSE_AGENT_VENDOR,
3035
+ INSTALL_SNIPPETS,
2944
3036
  INTEGRATION_BRANDING,
2945
3037
  INTEGRATION_REGISTRY,
2946
3038
  INTERNAL_TO_PUBLIC,
@@ -2960,7 +3052,12 @@ OUTPUT JSON ONLY. NO MARKDOWN. NO COMMENTARY.
2960
3052
  REVIEWER_PROMPT,
2961
3053
  SKILL_REGISTRY,
2962
3054
  SPECIFIER_PROMPT,
3055
+ SQUAD_CONFIGURE_COMMAND,
3056
+ SQUAD_HOP_BUDGET_DEFAULT,
3057
+ SQUAD_HOP_BUDGET_MAX,
3058
+ SQUAD_HOP_BUDGET_MIN,
2963
3059
  SQUAD_SPECIALTIES,
3060
+ SQUAD_STATS_COMMAND,
2964
3061
  SSE_SOCKET_TIMEOUT_MS,
2965
3062
  STACK_TO_RECOMMENDED,
2966
3063
  SWITCH_AGENT_COMMAND,
@@ -2968,6 +3065,7 @@ OUTPUT JSON ONLY. NO MARKDOWN. NO COMMENTARY.
2968
3065
  UNKNOWN_MODEL_PRICING,
2969
3066
  UPCOMING_INTEGRATION_IDS,
2970
3067
  USER_EVENTS,
3068
+ clampHopBudget,
2971
3069
  classifyStack,
2972
3070
  detectedIntegrationsFromDeps,
2973
3071
  getAgent,
@@ -2984,6 +3082,7 @@ OUTPUT JSON ONLY. NO MARKDOWN. NO COMMENTARY.
2984
3082
  headroomModelPredownloadScript,
2985
3083
  headroomPipPackage,
2986
3084
  headroomSnapshotDownloadLine,
3085
+ installableAgentIds,
2987
3086
  internalToPublic,
2988
3087
  isGuardrailDisposition,
2989
3088
  isHeadroomWrappable,
@@ -2991,6 +3090,7 @@ OUTPUT JSON ONLY. NO MARKDOWN. NO COMMENTARY.
2991
3090
  isKnownIntegrationId,
2992
3091
  isKnownModel,
2993
3092
  isLinkedAgentId,
3093
+ isNoopInstallSnippet,
2994
3094
  isPackId,
2995
3095
  isSkillId,
2996
3096
  normalizeAgentId,