{"version":3,"file":"types.mjs","names":["pkg.version"],"sources":["../../package.json","../../src/types.ts"],"sourcesContent":["","import pkg from \"../package.json\" with { type: \"json\" };\n\nexport const version: string = pkg.version;\n\nexport type HarnessId =\n  | \"antigravity\"\n  | \"codex\"\n  | \"gemini\"\n  | \"grok\"\n  | \"claude\"\n  | \"opencode\"\n  | \"cursor\"\n  | \"freebuff\"\n  | \"github-copilot\"\n  | \"mastracode\"\n  | \"omp\"\n  | \"pi\"\n  | \"prime-agent\";\nexport type EvidenceLevel = \"official\" | \"community\" | \"inferred\";\nexport type Platform = \"linux\" | \"darwin\" | \"win32\";\n\nexport interface PathCandidate {\n  path: string;\n  scope: \"user\" | \"project\" | \"system\" | \"data\";\n  level: EvidenceLevel;\n  platforms?: Platform[];\n  note?: string;\n}\n\n/** The path lists of a harness descriptor, as named in {@link ResolvedPaths}. */\nexport type PathCategory =\n  | \"config\"\n  | \"sessions\"\n  | \"instructions\"\n  | \"skills\"\n  | \"commands\"\n  | \"promptTemplates\"\n  | \"hooks\"\n  | \"temp\";\n\n/**\n * An environment variable the harness reads to move one of its roots. `path`\n * is the default root, used while the variable is unset or empty.\n */\nexport interface EnvOverride extends PathCandidate {\n  variable: string;\n  /** Categories with entries under this root, which move with it. */\n  relocates: PathCategory[];\n}\n\n/** The user-scope skills directory that skill synchronization links to the source. */\nexport interface SkillsSyncTarget extends PathCandidate {\n  scope: \"user\";\n}\n\n/** One stable user-scope destination used by prompt template synchronization. */\nexport interface PromptTemplateSyncTarget extends PathCandidate {\n  scope: \"user\";\n  format: \"markdown\" | \"gemini-toml\";\n}\n\nexport interface StorageDescriptor {\n  format: string;\n  level: EvidenceLevel;\n  note?: string;\n}\n\nexport interface HarnessCapabilities {\n  mcp: boolean;\n  vision: boolean;\n  /** Audio reaches the model without conversion or MCP. */\n  audio: boolean;\n  /** Video reaches the model without conversion or MCP. */\n  video: boolean;\n  tools: boolean;\n  streaming: boolean;\n}\n\n/** How to run one prompt through the harness non-interactively. */\nexport interface HarnessInvocation {\n  /** Binary to spawn; defaults to the harness's first `binaries` entry. */\n  binary?: string;\n  /** Full agent argument template; every \"{prompt}\" is replaced with the prompt text. */\n  args: string[];\n  /** Structured full agent argument template. */\n  jsonArgs?: string[];\n  /** Advisor argument template without tools; absent when the CLI cannot disable tools. */\n  noToolsArgs?: string[];\n  /** Structured advisor argument template without tools. */\n  noToolsJsonArgs?: string[];\n  /** Agent argument template whose native sandbox enforces read-only tool access. */\n  readOnlyArgs?: string[];\n  /** Structured agent argument template with read-only tool access. */\n  readOnlyJsonArgs?: string[];\n  /** Lowest CLI version whose read-only enforcement was verified; older or unknown versions reject read-only runs. */\n  readOnlyMinVersion?: string;\n  /** Per platform, whether read-only child processes reach the network; unlisted is unchecked. */\n  readOnlyNetwork?: Partial<Record<Platform, boolean>>;\n  /** Arguments appended when a model is selected; every \"{model}\" is replaced. */\n  modelArgs?: string[];\n  /** Arguments appended when a reasoning effort is selected; every \"{effort}\" is replaced. */\n  effortArgs?: string[];\n  /**\n   * Arguments appended to a plain text run so a CLI that holds its answer until\n   * the end reports it as events instead; `invoke` folds them back into that text,\n   * so a stopped run keeps what the model had already written.\n   */\n  streamArgs?: string[];\n  level: EvidenceLevel;\n  note?: string;\n}\n\n/** Invocation modes a harness supports without fallback or prompt-only restrictions. */\nexport interface HarnessInvocationModes {\n  advisor: boolean;\n  advisorStructured: boolean;\n  readOnly: boolean;\n  readOnlyStructured: boolean;\n  agent: boolean;\n  agentStructured: boolean;\n}\n\n/** How to ask one harness CLI for the models currently available to it. */\nexport interface HarnessModelListing {\n  /** Arguments used when no search filter is supplied. */\n  args: string[];\n  /**\n   * Optional argument template for a native search filter; every \"{search}\" is replaced.\n   * Without it, a search runs `args` and keeps the ids containing the filter, ignoring case.\n   */\n  searchArgs?: string[];\n  level: EvidenceLevel;\n  note?: string;\n}\n\n/** One model normalized from a harness's native model-listing output. */\nexport interface AvailableModel {\n  provider: string;\n  id: string;\n  /** Display name, where the adapter reads one from the listing; Codex so far. */\n  name?: string;\n  /** Absent when the native listing prints only ids, like Grok's. */\n  contextWindow?: number;\n  maxOutputTokens?: number;\n  thinking?: boolean;\n  images?: boolean;\n  /** Set on the model the harness picks when no model is given, when the listing marks one. */\n  default?: boolean;\n}\n\n/** Options for querying the models available to one harness. */\nexport interface ListModelsOptions {\n  search?: string;\n  cwd?: string;\n  env?: Record<string, string>;\n  /** Milliseconds before cleanup starts. Unset or 0 disables the deadline. */\n  timeoutMs?: number;\n  /** Cancel with the same process cleanup as a timeout. */\n  signal?: AbortSignal;\n}\n\nexport interface InvokeOptions {\n  cwd?: string;\n  env?: Record<string, string>;\n  /** Harness-native model id or selector. */\n  model?: string;\n  /** Reasoning effort in the harness's own words (`low`, `high`, `max`), passed through as is. */\n  effort?: string;\n  /** Enable the spawned harness's tools; defaults to advisor without tools mode. */\n  tools?: boolean;\n  /** Require native enforcement of read-only tool access. Implies `tools: true` when `tools` is omitted; `tools: false` rejects the run. */\n  readOnly?: boolean;\n  /** Milliseconds before cleanup starts. Unset or 0 disables the deadline. */\n  timeoutMs?: number;\n  /** Cancel with the same process cleanup as a timeout. */\n  signal?: AbortSignal;\n  /** Use the harness's structured (JSON) output mode instead of plain text. */\n  structured?: boolean;\n}\n\nexport interface InvokeResult {\n  command: string;\n  args: string[];\n  stdout: string;\n  stderr: string;\n  /** Process exit code; null when terminated by a signal, timeout, or cancellation. */\n  exitCode: number | null;\n  timedOut: boolean;\n  /** True when caller cancellation wins over the deadline or completion. */\n  aborted: boolean;\n  /** Milliseconds without output on either stream before a deadline or cancellation stopped the process. */\n  idleMs?: number;\n  /** Set when an advisor wrote a tool call as text. Nothing ran it, so its output is made up. */\n  toolCallsAsText?: true;\n}\n\n/** Result of one native model-listing command. */\nexport interface ListModelsResult extends InvokeResult {\n  /** Empty on a successful no-match response or when the command itself failed. */\n  models: AvailableModel[];\n}\n\n/** Normalized MCP server entry, shared across every harness dialect. */\nexport interface McpServerConfig {\n  name: string;\n  transport: \"stdio\" | \"http\" | \"sse\";\n  command?: string;\n  args?: string[];\n  /**\n   * Environment for stdio servers. A value that is exactly \"${NAME}\" refers to\n   * the variable NAME of the harness environment: dialects with native\n   * references keep it, the others resolve it when the entry is written.\n   */\n  env?: Record<string, string>;\n  url?: string;\n  headers?: Record<string, string>;\n  /** Present only when the harness tracks an on/off state per server. */\n  enabled?: boolean;\n}\n\n/** How one harness config file stores its MCP servers. */\nexport interface McpConfigFile extends PathCandidate {\n  format: \"json\" | \"toml\";\n  /** Object path to the server map inside the file, e.g. [\"mcpServers\"]. */\n  key: string[];\n  /**\n   * Shape of individual entries; \"standard\" is the {command, args, env, url}\n   * family, \"prime\" is that family with env values as {\"env\": \"NAME\"} references,\n   * \"mastracode\" is that family read by its keys alone, type ignored, and \"pi\"\n   * is that family without sse that keeps the entry fields it doesn't manage.\n   */\n  dialect: \"standard\" | \"antigravity\" | \"mastracode\" | \"opencode\" | \"pi\" | \"prime\" | \"vscode\";\n}\n\nexport interface HarnessDetection {\n  /** Environment variables that indicate running inside this agent. */\n  envVars: string[];\n  /** Project-level files or directories whose presence indicates this agent. */\n  projectMarkers: string[];\n}\n\nexport interface ResolveOptions {\n  homeDir?: string;\n  projectRoot?: string;\n  platform?: Platform;\n  /** Replaces `os.tmpdir()` as the value of `${TMPDIR}`. */\n  tempDir?: string;\n}\n\nexport interface ResolvedPaths {\n  config: PathCandidate[];\n  sessions: PathCandidate[];\n  instructions: PathCandidate[];\n  skills: PathCandidate[];\n  skillsSyncTarget: SkillsSyncTarget | null;\n  commands: PathCandidate[];\n  promptTemplates: PathCandidate[];\n  promptTemplateSyncTarget: PromptTemplateSyncTarget | null;\n  hooks: PathCandidate[];\n  /** Temp roots, moved by a set `temp` override from {@link EnvOverride}. */\n  temp: PathCandidate[];\n}\n"],"mappings":";;ACEA,MAAa,UAAkBA"}