@codeam/shared 2.63.1 → 2.65.0

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
@@ -1774,6 +1774,110 @@ interface SwitchAgentResult {
1774
1774
  error?: string;
1775
1775
  }
1776
1776
 
1777
+ /**
1778
+ * Agent Squad wire types — @-mention routing, roster, and agent-proposed
1779
+ * handoffs. Canonical owner (api-v2 + mobile consume the published npm
1780
+ * package; the cm-repo packages/shared mirror re-exports).
1781
+ * Spec: docs/superpowers/specs/2026-08-13-agent-squad-mentions-handoffs-design.md
1782
+ */
1783
+
1784
+ /** start_task payload — makes the previously-dead agentId field a real wire contract. */
1785
+ interface StartTaskPayload {
1786
+ prompt?: string;
1787
+ files?: Array<{
1788
+ filename: string;
1789
+ base64?: string;
1790
+ mimeType?: string;
1791
+ }>;
1792
+ /** Internal runtime id. Present + ≠ active agent → the runner swaps before running. */
1793
+ agentId?: string;
1794
+ }
1795
+ interface SquadRosterAgent {
1796
+ agentId: string;
1797
+ displayName: string;
1798
+ }
1799
+ /** Response data of POST /api/plugin/agents/roster. */
1800
+ interface SquadRosterData {
1801
+ agents: SquadRosterAgent[];
1802
+ handoffsEnabled: boolean;
1803
+ }
1804
+ /** The fence tag the active agent uses to propose a handoff (PRO). */
1805
+ declare const HANDOFF_FENCE_TAG = "codeam-handoff";
1806
+ interface HandoffProposal {
1807
+ proposalId: string;
1808
+ fromAgentId: string;
1809
+ toAgentId: string;
1810
+ reason: string;
1811
+ prompt: string;
1812
+ /**
1813
+ * Autonomous mode (P2-2): the CLI accepted this proposal ITSELF instead of
1814
+ * emitting the tap-to-accept card. Mobile renders a passive timeline notice
1815
+ * for `auto: true`, never the accept card. Absent = the v1 card flow.
1816
+ */
1817
+ auto?: boolean;
1818
+ /**
1819
+ * Hops left in the chain AFTER this one (`auto` only) — the hop is already
1820
+ * spent when this is emitted, so `0` means "this is the last auto hop; any
1821
+ * further proposal falls back to the card". Mobile renders it verbatim as
1822
+ * "<n> hops left".
1823
+ */
1824
+ hopsRemaining?: number;
1825
+ }
1826
+ /** `handoff_resolved` event payload. `auto` mirrors {@link HandoffProposal}. */
1827
+ interface HandoffResolution {
1828
+ proposalId: string;
1829
+ accepted: boolean;
1830
+ auto?: boolean;
1831
+ }
1832
+ /** Relay command: read/write the session's autonomous-handoff mode. */
1833
+ declare const SQUAD_CONFIGURE_COMMAND = "squad_configure";
1834
+ /** Relay command: per-member activity for the "Squad activity" screen. */
1835
+ declare const SQUAD_STATS_COMMAND = "squad_stats";
1836
+ declare const SQUAD_HOP_BUDGET_DEFAULT = 3;
1837
+ declare const SQUAD_HOP_BUDGET_MIN = 1;
1838
+ declare const SQUAD_HOP_BUDGET_MAX = 10;
1839
+ /**
1840
+ * Clamp a caller-supplied hop budget into the supported range, falling back to
1841
+ * the default for a missing / non-finite value. The ONE place the bound lives —
1842
+ * the CLI's config mutator and its `squad_configure` handler both call it.
1843
+ */
1844
+ declare function clampHopBudget(value: unknown): number;
1845
+ /** Persisted per-session autonomous-handoff mode. Default OFF. */
1846
+ interface SquadAutoConfig {
1847
+ enabled: boolean;
1848
+ hopBudget: number;
1849
+ }
1850
+ type SquadConfigurePayload = {
1851
+ action: 'set';
1852
+ autoHandoffs: boolean;
1853
+ hopBudget?: number;
1854
+ } | {
1855
+ action: 'status';
1856
+ };
1857
+ /** Ack of {@link SQUAD_CONFIGURE_COMMAND} — the state AFTER the command. */
1858
+ interface SquadConfigureResult extends SquadAutoConfig {
1859
+ /** Hops left in the current chain (resets on every user prompt). */
1860
+ hopsRemaining: number;
1861
+ }
1862
+ interface SquadMemberActivity {
1863
+ agentId: string;
1864
+ turns: number;
1865
+ /** DISTINCT paths this member touched across its journaled turns. */
1866
+ filesTouched: number;
1867
+ }
1868
+ /** Ack of {@link SQUAD_STATS_COMMAND}. No cost attribution in v1. */
1869
+ interface SquadStatsResult {
1870
+ members: SquadMemberActivity[];
1871
+ handoffs: {
1872
+ proposed: number;
1873
+ accepted: number;
1874
+ auto: number;
1875
+ };
1876
+ sinceTurn: number;
1877
+ }
1878
+ /** Per-agent specialty blurbs for the team preamble. Copy, not routing. */
1879
+ declare const SQUAD_SPECIALTIES: Readonly<Partial<Record<AgentId, string>>>;
1880
+
1777
1881
  /**
1778
1882
  * Headroom provisioning manifest — the SINGLE source of truth for what a
1779
1883
  * Headroom install consists of, rendered by every provisioning surface:
@@ -1946,6 +2050,8 @@ declare const USER_EVENTS: {
1946
2050
  readonly CODERABBIT_REVIEW: "coderabbit_review";
1947
2051
  readonly SWITCH_AGENT_PROGRESS: "switch_agent_progress";
1948
2052
  readonly SWITCH_AGENT_STATUS: "switch_agent_status";
2053
+ readonly HANDOFF_PROPOSED: "handoff_proposed";
2054
+ readonly HANDOFF_RESOLVED: "handoff_resolved";
1949
2055
  readonly VCS_AGENT_REVIEW_COMPLETE: "vcs_agent_review_complete";
1950
2056
  /** PR-review launch progress toast — the "Review with an agent" flow shows a
1951
2057
  * toast when the review runs server-side (Inngest). Mobile-only surface,
@@ -1972,4 +2078,4 @@ type UserEventName = (typeof USER_EVENTS)[keyof typeof USER_EVENTS];
1972
2078
  */
1973
2079
  declare const PREVIEW_DETECT_PROMPT: string;
1974
2080
 
1975
- 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, 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 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, 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 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 };
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 };
package/dist/index.d.ts CHANGED
@@ -1774,6 +1774,110 @@ interface SwitchAgentResult {
1774
1774
  error?: string;
1775
1775
  }
1776
1776
 
1777
+ /**
1778
+ * Agent Squad wire types — @-mention routing, roster, and agent-proposed
1779
+ * handoffs. Canonical owner (api-v2 + mobile consume the published npm
1780
+ * package; the cm-repo packages/shared mirror re-exports).
1781
+ * Spec: docs/superpowers/specs/2026-08-13-agent-squad-mentions-handoffs-design.md
1782
+ */
1783
+
1784
+ /** start_task payload — makes the previously-dead agentId field a real wire contract. */
1785
+ interface StartTaskPayload {
1786
+ prompt?: string;
1787
+ files?: Array<{
1788
+ filename: string;
1789
+ base64?: string;
1790
+ mimeType?: string;
1791
+ }>;
1792
+ /** Internal runtime id. Present + ≠ active agent → the runner swaps before running. */
1793
+ agentId?: string;
1794
+ }
1795
+ interface SquadRosterAgent {
1796
+ agentId: string;
1797
+ displayName: string;
1798
+ }
1799
+ /** Response data of POST /api/plugin/agents/roster. */
1800
+ interface SquadRosterData {
1801
+ agents: SquadRosterAgent[];
1802
+ handoffsEnabled: boolean;
1803
+ }
1804
+ /** The fence tag the active agent uses to propose a handoff (PRO). */
1805
+ declare const HANDOFF_FENCE_TAG = "codeam-handoff";
1806
+ interface HandoffProposal {
1807
+ proposalId: string;
1808
+ fromAgentId: string;
1809
+ toAgentId: string;
1810
+ reason: string;
1811
+ prompt: string;
1812
+ /**
1813
+ * Autonomous mode (P2-2): the CLI accepted this proposal ITSELF instead of
1814
+ * emitting the tap-to-accept card. Mobile renders a passive timeline notice
1815
+ * for `auto: true`, never the accept card. Absent = the v1 card flow.
1816
+ */
1817
+ auto?: boolean;
1818
+ /**
1819
+ * Hops left in the chain AFTER this one (`auto` only) — the hop is already
1820
+ * spent when this is emitted, so `0` means "this is the last auto hop; any
1821
+ * further proposal falls back to the card". Mobile renders it verbatim as
1822
+ * "<n> hops left".
1823
+ */
1824
+ hopsRemaining?: number;
1825
+ }
1826
+ /** `handoff_resolved` event payload. `auto` mirrors {@link HandoffProposal}. */
1827
+ interface HandoffResolution {
1828
+ proposalId: string;
1829
+ accepted: boolean;
1830
+ auto?: boolean;
1831
+ }
1832
+ /** Relay command: read/write the session's autonomous-handoff mode. */
1833
+ declare const SQUAD_CONFIGURE_COMMAND = "squad_configure";
1834
+ /** Relay command: per-member activity for the "Squad activity" screen. */
1835
+ declare const SQUAD_STATS_COMMAND = "squad_stats";
1836
+ declare const SQUAD_HOP_BUDGET_DEFAULT = 3;
1837
+ declare const SQUAD_HOP_BUDGET_MIN = 1;
1838
+ declare const SQUAD_HOP_BUDGET_MAX = 10;
1839
+ /**
1840
+ * Clamp a caller-supplied hop budget into the supported range, falling back to
1841
+ * the default for a missing / non-finite value. The ONE place the bound lives —
1842
+ * the CLI's config mutator and its `squad_configure` handler both call it.
1843
+ */
1844
+ declare function clampHopBudget(value: unknown): number;
1845
+ /** Persisted per-session autonomous-handoff mode. Default OFF. */
1846
+ interface SquadAutoConfig {
1847
+ enabled: boolean;
1848
+ hopBudget: number;
1849
+ }
1850
+ type SquadConfigurePayload = {
1851
+ action: 'set';
1852
+ autoHandoffs: boolean;
1853
+ hopBudget?: number;
1854
+ } | {
1855
+ action: 'status';
1856
+ };
1857
+ /** Ack of {@link SQUAD_CONFIGURE_COMMAND} — the state AFTER the command. */
1858
+ interface SquadConfigureResult extends SquadAutoConfig {
1859
+ /** Hops left in the current chain (resets on every user prompt). */
1860
+ hopsRemaining: number;
1861
+ }
1862
+ interface SquadMemberActivity {
1863
+ agentId: string;
1864
+ turns: number;
1865
+ /** DISTINCT paths this member touched across its journaled turns. */
1866
+ filesTouched: number;
1867
+ }
1868
+ /** Ack of {@link SQUAD_STATS_COMMAND}. No cost attribution in v1. */
1869
+ interface SquadStatsResult {
1870
+ members: SquadMemberActivity[];
1871
+ handoffs: {
1872
+ proposed: number;
1873
+ accepted: number;
1874
+ auto: number;
1875
+ };
1876
+ sinceTurn: number;
1877
+ }
1878
+ /** Per-agent specialty blurbs for the team preamble. Copy, not routing. */
1879
+ declare const SQUAD_SPECIALTIES: Readonly<Partial<Record<AgentId, string>>>;
1880
+
1777
1881
  /**
1778
1882
  * Headroom provisioning manifest — the SINGLE source of truth for what a
1779
1883
  * Headroom install consists of, rendered by every provisioning surface:
@@ -1946,6 +2050,8 @@ declare const USER_EVENTS: {
1946
2050
  readonly CODERABBIT_REVIEW: "coderabbit_review";
1947
2051
  readonly SWITCH_AGENT_PROGRESS: "switch_agent_progress";
1948
2052
  readonly SWITCH_AGENT_STATUS: "switch_agent_status";
2053
+ readonly HANDOFF_PROPOSED: "handoff_proposed";
2054
+ readonly HANDOFF_RESOLVED: "handoff_resolved";
1949
2055
  readonly VCS_AGENT_REVIEW_COMPLETE: "vcs_agent_review_complete";
1950
2056
  /** PR-review launch progress toast — the "Review with an agent" flow shows a
1951
2057
  * toast when the review runs server-side (Inngest). Mobile-only surface,
@@ -1972,4 +2078,4 @@ type UserEventName = (typeof USER_EVENTS)[keyof typeof USER_EVENTS];
1972
2078
  */
1973
2079
  declare const PREVIEW_DETECT_PROMPT: string;
1974
2080
 
1975
- 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, 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 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, 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 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 };
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 };
package/dist/index.js CHANGED
@@ -33,6 +33,7 @@ __export(index_exports, {
33
33
  GUARDRAIL_CATEGORY_META: () => GUARDRAIL_CATEGORY_META,
34
34
  GUARDRAIL_CONFIGURE_COMMAND: () => GUARDRAIL_CONFIGURE_COMMAND,
35
35
  GUARDRAIL_DISPOSITIONS: () => GUARDRAIL_DISPOSITIONS,
36
+ HANDOFF_FENCE_TAG: () => HANDOFF_FENCE_TAG,
36
37
  HEADROOM_BACKEND_ENV: () => HEADROOM_BACKEND_ENV,
37
38
  HEADROOM_EXTRAS_BY_SURFACE: () => HEADROOM_EXTRAS_BY_SURFACE,
38
39
  HEADROOM_MODELS: () => HEADROOM_MODELS,
@@ -64,6 +65,12 @@ __export(index_exports, {
64
65
  REVIEWER_PROMPT: () => REVIEWER_PROMPT,
65
66
  SKILL_REGISTRY: () => SKILL_REGISTRY,
66
67
  SPECIFIER_PROMPT: () => SPECIFIER_PROMPT,
68
+ SQUAD_CONFIGURE_COMMAND: () => SQUAD_CONFIGURE_COMMAND,
69
+ SQUAD_HOP_BUDGET_DEFAULT: () => SQUAD_HOP_BUDGET_DEFAULT,
70
+ SQUAD_HOP_BUDGET_MAX: () => SQUAD_HOP_BUDGET_MAX,
71
+ SQUAD_HOP_BUDGET_MIN: () => SQUAD_HOP_BUDGET_MIN,
72
+ SQUAD_SPECIALTIES: () => SQUAD_SPECIALTIES,
73
+ SQUAD_STATS_COMMAND: () => SQUAD_STATS_COMMAND,
67
74
  SSE_SOCKET_TIMEOUT_MS: () => SSE_SOCKET_TIMEOUT_MS,
68
75
  STACK_TO_RECOMMENDED: () => STACK_TO_RECOMMENDED,
69
76
  SWITCH_AGENT_COMMAND: () => SWITCH_AGENT_COMMAND,
@@ -71,6 +78,7 @@ __export(index_exports, {
71
78
  UNKNOWN_MODEL_PRICING: () => UNKNOWN_MODEL_PRICING,
72
79
  UPCOMING_INTEGRATION_IDS: () => UPCOMING_INTEGRATION_IDS,
73
80
  USER_EVENTS: () => USER_EVENTS,
81
+ clampHopBudget: () => clampHopBudget,
74
82
  classifyStack: () => classifyStack,
75
83
  detectedIntegrationsFromDeps: () => detectedIntegrationsFromDeps,
76
84
  getAgent: () => getAgent,
@@ -2700,6 +2708,26 @@ var HEADROOM_USAGE_COMMAND = "headroom_usage";
2700
2708
  // src/types/agent-switch.ts
2701
2709
  var SWITCH_AGENT_COMMAND = "switch_agent";
2702
2710
 
2711
+ // src/types/agent-squad.ts
2712
+ var HANDOFF_FENCE_TAG = "codeam-handoff";
2713
+ var SQUAD_CONFIGURE_COMMAND = "squad_configure";
2714
+ var SQUAD_STATS_COMMAND = "squad_stats";
2715
+ var SQUAD_HOP_BUDGET_DEFAULT = 3;
2716
+ var SQUAD_HOP_BUDGET_MIN = 1;
2717
+ var SQUAD_HOP_BUDGET_MAX = 10;
2718
+ function clampHopBudget(value) {
2719
+ if (typeof value !== "number" || !Number.isFinite(value)) return SQUAD_HOP_BUDGET_DEFAULT;
2720
+ return Math.min(SQUAD_HOP_BUDGET_MAX, Math.max(SQUAD_HOP_BUDGET_MIN, Math.round(value)));
2721
+ }
2722
+ var SQUAD_SPECIALTIES = {
2723
+ claude: "deep reasoning, refactors, and multi-step architecture work",
2724
+ codex: "fast, focused implementation and test fixing",
2725
+ cursor: "multi-file edits and codebase-wide changes",
2726
+ gemini: "large-context analysis across big files and logs",
2727
+ kimi: "long-context code reading and summarization",
2728
+ opencode: "general implementation tasks"
2729
+ };
2730
+
2703
2731
  // src/headroom/manifest.ts
2704
2732
  var HEADROOM_PROXY_PORT = 8787;
2705
2733
  var HEADROOM_BACKEND_ENV = {
@@ -2835,6 +2863,9 @@ var USER_EVENTS = {
2835
2863
  // the backend re-publishes them on the per-user SSE bus (mirrored in repo A).
2836
2864
  SWITCH_AGENT_PROGRESS: "switch_agent_progress",
2837
2865
  SWITCH_AGENT_STATUS: "switch_agent_status",
2866
+ // Agent Squad — the CLI posts these to /api/agent-switch/events; PRO-gated.
2867
+ HANDOFF_PROPOSED: "handoff_proposed",
2868
+ HANDOFF_RESOLVED: "handoff_resolved",
2838
2869
  // VCS / PR Command Center — the backend publishes this after an agent finishes
2839
2870
  // reviewing a PR (verdict + comment count + findings), driving the mobile
2840
2871
  // completion screen + push. Mirrored in repo A's app-shared events.ts.
@@ -2912,6 +2943,7 @@ OUTPUT JSON ONLY. NO MARKDOWN. NO COMMENTARY.
2912
2943
  GUARDRAIL_CATEGORY_META,
2913
2944
  GUARDRAIL_CONFIGURE_COMMAND,
2914
2945
  GUARDRAIL_DISPOSITIONS,
2946
+ HANDOFF_FENCE_TAG,
2915
2947
  HEADROOM_BACKEND_ENV,
2916
2948
  HEADROOM_EXTRAS_BY_SURFACE,
2917
2949
  HEADROOM_MODELS,
@@ -2943,6 +2975,12 @@ OUTPUT JSON ONLY. NO MARKDOWN. NO COMMENTARY.
2943
2975
  REVIEWER_PROMPT,
2944
2976
  SKILL_REGISTRY,
2945
2977
  SPECIFIER_PROMPT,
2978
+ SQUAD_CONFIGURE_COMMAND,
2979
+ SQUAD_HOP_BUDGET_DEFAULT,
2980
+ SQUAD_HOP_BUDGET_MAX,
2981
+ SQUAD_HOP_BUDGET_MIN,
2982
+ SQUAD_SPECIALTIES,
2983
+ SQUAD_STATS_COMMAND,
2946
2984
  SSE_SOCKET_TIMEOUT_MS,
2947
2985
  STACK_TO_RECOMMENDED,
2948
2986
  SWITCH_AGENT_COMMAND,
@@ -2950,6 +2988,7 @@ OUTPUT JSON ONLY. NO MARKDOWN. NO COMMENTARY.
2950
2988
  UNKNOWN_MODEL_PRICING,
2951
2989
  UPCOMING_INTEGRATION_IDS,
2952
2990
  USER_EVENTS,
2991
+ clampHopBudget,
2953
2992
  classifyStack,
2954
2993
  detectedIntegrationsFromDeps,
2955
2994
  getAgent,