/** * Subagent subject module: declared/resolved/actual payloads, scanner * composition (canonical-extensions + agent-dir × subagent-rendering agents), * and projections via the shared helper. * * Activation comes from the declared `enabled` flag, mirroring skills and * commands. Single-file subagent surfaces (e.g., `roo`'s `.roomodes`) emit * one occurrence per file path; the file itself is the materialization. */ import * as Effect from "effect/Effect"; import * as Option from "effect/Option"; import type { AgentId } from "../../../agents/types.js"; import { type ExtensionName } from "../../../extensions/common.js"; import type { Lockfile, SubagentLockEntry } from "../../../lockfile/schema.js"; import type { Settings, SubagentEntry } from "../../../settings/schema.js"; import type { Diagnostics } from "../diagnostics.js"; import type { LockfileReadError, SettingsReadError } from "../errors.js"; import type { AgentDirOccurrence, CanonicalExtensionOccurrence } from "../scanners/types.js"; import type { ActivationState, ExtensionKey, InstallationOrigin, InstalledPackRef, Scope } from "../types.js"; export type SubagentDetectionOrigin = { readonly _tag: "canonical-axm-subagent"; } | { readonly _tag: "external-axm-subagent"; } | { readonly _tag: "agent-subagent-dir"; readonly agentId: AgentId; }; export interface DeclaredSubagent { readonly name: ExtensionName; readonly entry: SubagentEntry; } export type DeclaredSubagents = ReadonlyArray; export interface ResolvedSubagent { readonly name: ExtensionName; readonly lockEntry: SubagentLockEntry; } export type ResolvedSubagents = ReadonlyArray; export interface ActualSubagent { readonly key: ExtensionKey<"subagent">; readonly origin: SubagentDetectionOrigin; readonly contentRoot: string; readonly sourcePath: string | null; readonly packageRoot: string | null; } export type ActualSubagents = ReadonlyArray; export interface SubagentPackMember { readonly name: ExtensionName; readonly providingPack: InstalledPackRef; } export interface InstalledSubagent { readonly key: ExtensionKey<"subagent">; readonly installationOrigin: InstallationOrigin; readonly activation: ActivationState; readonly resolved: Option.Option; readonly actual: ReadonlyArray; readonly providingPacks: ReadonlyArray; } export interface UnmanagedSubagent { readonly key: ExtensionKey<"subagent">; readonly actual: ActualSubagent; } export interface SubagentScopedLoaders { readonly settings: Effect.Effect, SettingsReadError>; readonly lockfile: Effect.Effect, LockfileReadError>; } export interface SubagentScanners { readonly canonical: Effect.Effect>; readonly agentDir: Effect.Effect>; } export interface InstalledPackForSubagents { readonly ref: InstalledPackRef; readonly subagents: ReadonlyArray; } export interface SubagentExtensionsApiDeps { readonly scope: Scope; readonly loaders: SubagentScopedLoaders; readonly scanners: SubagentScanners; readonly installedPacks: Effect.Effect, SettingsReadError | LockfileReadError>; readonly diagnostics: Diagnostics; } export interface SubagentExtensionsApi { readonly declared: Effect.Effect, SettingsReadError>; readonly resolved: Effect.Effect, LockfileReadError>; readonly actual: Effect.Effect; readonly installed: Effect.Effect, SettingsReadError | LockfileReadError>; readonly byName: (name: string) => Effect.Effect, SettingsReadError | LockfileReadError>; readonly declaredByName: (name: string) => Effect.Effect, SettingsReadError>; readonly active: Effect.Effect, SettingsReadError | LockfileReadError>; readonly unmanaged: Effect.Effect, SettingsReadError | LockfileReadError>; } /** * Build the subagent subject API. Returns an `Effect` because the projection * cell is wrapped in `Effect.cached` so the four derived cells share one * in-flight execution per scope, mirroring `state.ts`. */ export declare const makeSubagentExtensionsApi: (deps: SubagentExtensionsApiDeps) => Effect.Effect; //# sourceMappingURL=subagent.d.ts.map