import { C as CloudAgent, c as CloudEnvironment, d as CloudVault, al as SessionEvent, an as SessionEventType } from './dto-CIYO4YQw.js'; import { P as ProviderFileInfo } from './file-Cj5-Vx27.js'; type ProviderName = string; interface ProjectConfig { version: string; providers: Record; defaults?: DefaultsConfig; environments?: Record; tunnels?: Record; vaults?: Record; memory_stores?: Record; skills?: Record; files?: Record; identities?: Record; agents?: Record; channels?: Record; deployments?: Record; } interface DefaultsConfig { provider?: string; /** Logical name of the default declared Identity used by identity-aware resources and runtimes. */ identity?: string; } type IdentityDecl = ManagedIdentityDecl | ExternalIdentityDecl; interface ManagedIdentityDecl { provider?: ProviderName; external_id: string; name?: string; enabled?: boolean; metadata?: Record; identity_id?: never; } interface ExternalIdentityDecl { provider?: ProviderName; /** Pre-existing provider Identity id. External references are never mutated or deleted. */ identity_id: string; external_id?: never; name?: never; enabled?: never; metadata?: never; } interface EnvironmentDecl { name?: string; description?: string; provider?: ProviderName; /** Pre-existing provider environment id. When set, OpenCMA treats the environment as an external reference and will not create/update/delete it remotely. */ environment_id?: string; config: EnvironmentConfig; metadata?: Record; } interface EnvironmentConfig { type: "cloud" | "self_hosted"; networking?: NetworkingConfig; packages?: PackagesConfig; /** Shell script executed by supported providers while preparing a sandbox. */ setup_script?: string; } interface TunnelDecl { name?: string; description?: string; /** Pre-existing Qoder tunnel id (e.g. tnl_00xxxx). Tunnels are allocated by Qoder BYOC admin and referenced, not created. */ tunnel_id: string; metadata?: Record; } interface NetworkingConfig { type: "unrestricted" | "limited"; allow_mcp_servers?: boolean; allow_package_managers?: boolean; allowed_hosts?: string[]; } interface PackagesConfig { apt?: string[]; pip?: string[]; npm?: string[]; cargo?: string[]; gem?: string[]; go?: string[]; } interface VaultDecl { display_name: string; provider?: ProviderName; credentials: CredentialDecl[]; metadata?: Record; } type CredentialType = "static_bearer" | "environment_variable"; interface CredentialNetworking { /** Legacy policy type; Bailian requests use allowed_hosts instead. */ type?: "unrestricted" | "limited"; allowed_hosts?: string[]; } interface CredentialInjectionLocation { header?: boolean; body?: boolean; } interface CredentialDecl { name: string; type: CredentialType; metadata?: Record; mcp_server_url?: string; access_token?: string; protocol?: "sse" | "streamable_http"; secret_name?: string; secret_value?: string; networking?: CredentialNetworking; injection_location?: CredentialInjectionLocation; } interface MemoryStoreDecl { name?: string; description: string; provider?: ProviderName; metadata?: Record; /** Initialize entries only on creation by default; sync explicitly keeps declared paths managed. */ entries_mode?: "initialize" | "sync"; entries?: MemoryEntryDecl[]; } interface MemoryEntryDecl { key: string; content: string; } interface SkillDecl { name?: string; source: string; description?: string; version?: string; origin?: "custom" | "official"; provider?: ProviderName; } interface FileDecl { source: string; /** Local label only; declarative uploads preserve the source file's basename. */ name?: string; purpose?: string; provider?: ProviderName; } interface ModelWithSpeed { id: string; speed?: "standard" | "fast"; } type ModelSpec = string | ModelWithSpeed; interface AgentDecl { name?: string; description?: string; model: string | Record; instructions: string; environment?: string; tunnel?: string; provider?: ProviderName; tools?: AgentToolsDecl; mcp_servers?: McpServerDecl[]; skills?: AgentSkillDecl[]; vault?: string; memory_stores?: string[]; /** String refs are inherited by Qoder Forward Templates; object refs mount Files into Sessions. */ files?: Array; /** Desired display metadata for Qoder Forward's system-managed writable Store. */ default_memory_store?: DefaultMemoryStoreDecl; /** Resources mounted into every managed session created for this agent. */ resources?: SessionResourceDecl[]; multiagent?: MultiagentDecl; metadata?: Record; /** Qoder runtime environment variables. Forward delivery stores these as Template defaults. */ environment_variables?: Record; /** Provider-side tools the Agent Harness operates itself. Qoder Forward delivery only. */ managed_tool_config?: ManagedToolConfigDecl; /** Provider-specific remote materialization. Omitted means the existing managed Agent resource. */ delivery?: Record; } interface AgentFileMountDecl { /** Logical key under the top-level files section. */ file: string; /** Provider sandbox path. Bailian paths live under /mnt. */ mount_path: string; } interface DefaultMemoryStoreDecl { name: string; description?: string; /** Permanently delete the system-managed Store during destroy. Defaults to false. */ delete_on_destroy?: boolean; } interface ManagedToolConfigDecl { /** Replaces the provider's enabled managed-tool set; an empty array disables all of them. */ enabled_tools: string[]; } interface AgentDeliveryDecl { type: "managed" | "forward"; } interface ChannelDecl { provider?: ProviderName; /** Logical Agent name. The provider adapter resolves its materialized remote resource. Required for `fixed` mode; ignored for `pairing` mode. */ agent?: string; /** Logical Identity name. Falls back to defaults.identity. Required for `fixed` mode; ignored for `pairing` mode. */ identity?: string; type: string; name?: string; /** Identity resolution mode. `fixed` binds the channel to one Identity/Template; `pairing` creates a transport-only channel used by Schedules/Sinks. Defaults to `fixed`. */ mode?: "fixed" | "pairing"; enabled?: boolean; credentials?: Record; options?: Record; } type AgentSkillDecl = string | AgentSkillRefDecl; interface AgentSkillRefDecl { type: "official" | "custom"; skill_id: string; version?: string; } interface AgentToolsDecl { builtin: string[]; /** Permission inherited by every enabled builtin without an explicit override. */ default_permission?: "allow" | "ask"; mcp?: AgentMcpToolkitDecl[]; permissions?: Record; } interface AgentMcpToolkitDecl { type: "mcp_toolkit"; mcp_server_name: string; default_config?: { enabled: boolean; }; /** Per-tool overrides; omitted or empty uses default_config for every tool. */ configs?: Array<{ name: string; enabled: boolean; }>; } interface McpServerDecl { name: string; type?: "url" | "http" | "official"; url?: string; } interface MultiagentDecl { type: "coordinator"; agents: MultiagentMemberDecl[]; } /** A project logical name, an external Managed Agent id, or Bailian's native Self member. */ type MultiagentMemberDecl = string | { agent_id: string; } | { type: "self"; }; interface DeploymentDecl { name?: string; agent: string; agent_version?: number; environment?: string; tunnel?: string; vaults?: string[]; memory_stores?: string[]; resources?: DeploymentResourceDecl[]; initial_events: InitialEventDecl[]; schedule?: ScheduleDecl; description?: string; provider?: ProviderName; metadata?: Record; /** Variables copied into Deployment sessions: Bailian string maps or Qoder's existing string format. */ environment_variables?: string | Record; } type DeploymentResourceDecl = DeploymentFileResource | DeploymentMemoryStoreResource | DeploymentGithubRepoResource; /** Provider-neutral resources that can be attached directly when a session is created. */ interface SessionGithubRepoResourceDecl extends Omit { /** Required for private repositories; interpolate this value from an environment variable. */ authorization_token: string; } type SessionResourceDecl = SessionGithubRepoResourceDecl | SessionMemoryStoreResourceDecl; interface SessionMemoryStoreResourceDecl { type: "memory_store"; /** Logical key in the project's memory_stores group. */ memory_store: string; access?: "read_write" | "read_only"; instructions?: string; } interface DeploymentFileResource { type: "file"; file_id?: string; source?: string; mount_path?: string; } type DeploymentMemoryStoreResource = SessionMemoryStoreResourceDecl; interface DeploymentGithubRepoResource { type: "github_repository"; url: string; checkout?: { branch?: string; commit?: string; }; mount_path?: string; authorization_token?: string; } type InitialEventDecl = InitialUserMessage | InitialSystemMessage | InitialDefineOutcome; interface InitialUserMessage { type: "user.message"; content: string; } interface InitialSystemMessage { type: "system.message"; content: string; } interface InitialDefineOutcome { type: "user.define_outcome"; description?: string; rubric?: string; rubric_file?: string; max_iterations?: number; } interface ScheduleDecl { expression: string; timezone: string; } /** * A ProjectConfig where all file references (instructions, memory entries) * have been resolved to their inline content. */ interface ResolvedProjectConfig extends ProjectConfig { _resolved: true; } interface SessionFileResource { file_id: string; mount_path: string; } interface SessionGithubRepositoryResource { type: "github_repository"; url: string; checkout?: { branch?: string; commit?: string; }; mount_path?: string; authorization_token: string; } interface SessionMemoryStoreResource { type: "memory_store"; memory_store_id: string; access?: "read_write" | "read_only"; instructions?: string; } type SessionResource = SessionGithubRepositoryResource | SessionMemoryStoreResource; /** Provider response resource, including server-assigned sandbox mount paths. */ interface SessionResourceInfo extends Record { /** Provider-assigned resource id (`sesrsc_…`); required to unmount a runtime-mounted resource. */ id?: string; type: string; mount_path?: string; memory_store_id?: string; access?: "read_write" | "read_only"; instructions?: string; file_id?: string; } interface CommonSessionBindings { /** Uploaded files to mount in the session sandbox. */ files?: SessionFileResource[]; /** Provider-neutral resources to mount when the session is created. */ resources?: SessionResource[]; title?: string; metadata?: Record; /** Provider-neutral representation; supported providers map it to their Session API's wire shape. */ environment_variables?: Record; } interface ManagedSessionBindings extends CommonSessionBindings { /** Omitted for backward compatibility; omitted always means managed. */ delivery?: "managed"; agent_id: string; agent_version?: number; /** Cloud sandbox id. Every provider runs sessions inside an environment. */ environment_id: string; /** Qoder BYOC tunnel id. Required to reach internal MCP servers from the sandbox. */ tunnel_id?: string; vault_ids: string[]; memory_store_ids: string[]; } interface ForwardSessionBindings extends CommonSessionBindings { delivery: "forward"; /** Qoder Forward Template selected from the applied Agent materialization. */ template_id: string; /** Existing business Identity supplied by the session caller; omitted uses the provider's default Identity. */ identity_id?: string; } type SessionBindings = ManagedSessionBindings | ForwardSessionBindings; interface ProviderSessionInfo { id: string; agent_id: string; environment_id: string; tunnel_id?: string; status: string; title?: string; /** Session sandbox environment variables echoed by supported providers. */ environment_variables?: Record; vault_ids: string[]; memory_store_ids: string[]; resources?: SessionResourceInfo[]; created_at: string; updated_at: string; attributes: Record; } interface SessionFilter { agent_id?: string; statuses?: string[]; created_at_gte?: string; created_at_lte?: string; limit?: number; page?: string; } interface SessionListResult { sessions: ProviderSessionInfo[]; has_more: boolean; next_page?: string; } interface ProviderSkillInfo { id: string; name: string; description?: string; source: "custom" | "official"; status: "checking" | "active" | "rejected" | "deleted"; latest_version?: string; created_at?: string; updated_at?: string; attributes?: Record; } interface CursorPage { data: T[]; has_more: boolean; next_page?: string; } interface CursorListOptions { limit?: number; page?: string; } interface AgentListOptions extends CursorListOptions { include_archived?: boolean; } type AgentVersionListOptions = CursorListOptions; type AgentPage = CursorPage; interface EnvironmentListOptions extends CursorListOptions { include_archived?: boolean; } type EnvironmentPage = CursorPage; interface VaultListOptions extends CursorListOptions { include_archived?: boolean; } type VaultPage = CursorPage; interface VaultCredentialInfo { id: string; display_name: string; auth_type: string; secret_name?: string; mcp_server_url?: string; networking_type?: string; networking?: CredentialNetworking; injection_location?: CredentialInjectionLocation; metadata?: Record; } interface SkillListOptions extends CursorListOptions { source?: "custom" | "official"; } interface SkillVersionInfo { id?: string; skill_id: string; type: string; name?: string; description?: string; version: string; status?: string; created_at?: string; updated_at?: string; additional_properties?: Record; attributes: Record; } type SkillVersionListOptions = CursorListOptions; type SkillVersionPage = CursorPage; interface SkillDownloadInfo { skill_id: string; version: string; file_url: string; } type SkillPage = CursorPage; interface FileListOptions extends CursorListOptions { scope_id?: string; } type FilePage = CursorPage; interface SessionUpdateInput { title?: string; metadata?: Record; } /** One resource to mount into a RUNNING session (provider session-resources API). */ interface SessionResourceMountInput { type: "file"; file_id: string; /** Sandbox path inside the session, e.g. `/mnt/session/uploads/report.csv`. */ mount_path: string; } type SessionResourceListOptions = CursorListOptions; type SessionResourcePage = CursorPage; /** Raw AgentStudio message/event input. Provider adapters preserve the wire shape. */ type SessionEventInput = Record; interface SessionEventSendResult { event_ids: string[]; attributes: Record; } interface DeploymentRunInfo { id: string; deployment_id?: string; session_id?: string | null; status?: string; error?: { type?: string; message?: string; }; created_at?: string; updated_at?: string; attributes: Record; } type DeploymentRunPage = CursorPage; type ManagedAgentOperationAuth = "api_key" | "none"; interface ManagedAgentOperationCapability { supported: boolean; auth: ManagedAgentOperationAuth | null; reason?: string; } interface ManagedAgentProviderCapabilities { provider: string; operations: Record; } interface ProviderSessionEvent { /** Opt-in cumulative contract snapshot. raw remains the actual triggering provider frame. */ snapshot?: SessionEvent; type: SessionEventType; raw_type: string; /** Stable per-event id when the provider supplies one; used to de-dupe history replay vs. live stream. */ id?: string; role?: string; content?: string; tool_name?: string; tool_input?: string; status?: string; stop_reason?: string; /** Provider thread reference; snapshot metadata.thread_id retains actual event ownership. */ session_thread_id?: string; /** * A file the agent delivered to the provider's Files API (qoder DeliverArtifacts / * bailian download_file). Structured so the webui can show a download card without * scraping tool-result free text. Populated by the provider mapper; surfaced onto the * contract event as `metadata.artifact` by the shared sanitizer. */ artifact?: { file_id: string; filename?: string; content_type?: string; size?: number; }; raw: Record; } type SessionEventFormat = "legacy" | "snapshot"; interface EventListOptions { /** Bailian structured event conversion; defaults to legacy. */ event_format?: SessionEventFormat; signal?: AbortSignal; limit?: number; after_id?: string; order?: string; page_token?: string; /** Legacy alias for page_token used by some provider adapters. */ page?: string; types?: string[]; created_at_gt?: string; created_at_gte?: string; created_at_lt?: string; created_at_lte?: string; } interface EventStreamOptions { after_id?: string; /** Bailian only. Nonempty event_deltas selects snapshot unless explicitly conflicting. */ event_format?: SessionEventFormat; event_deltas?: ("message" | "reasoning")[]; signal?: AbortSignal; /** Called once per successful connection, before the first business event. */ onReady?: () => void; /** Bailian snapshot mode only; defaults to false. Never resends a user message. */ reconnect?: boolean; /** Snapshot mode default: 30 seconds. */ connectTimeoutMs?: number; /** Snapshot mode default: 180 seconds; comments and heartbeats count as activity. */ idleTimeoutMs?: number; } interface ProviderSessionEventList { events: ProviderSessionEvent[]; has_more: boolean; next_page?: string; } /** A child Agent execution within a Session; the main thread is not a resource in this list. */ interface SessionThread { id: string; type: "session_thread"; session_id: string; parent_thread_id: string; agent: { id: string; version?: number; name?: string; }; /** Provider status, currently running, idle, or terminated. Unknown future values are preserved. */ status: string; created_at: string; updated_at: string; archived_at?: string | null; agent_name?: string; } interface SessionThreadListOptions extends CursorListOptions { signal?: AbortSignal; } type SessionThreadPage = CursorPage; export type { SessionListResult as $, AgentVersionListOptions as A, EventListOptions as B, SessionFilter as C, DeploymentRunInfo as D, EnvironmentListOptions as E, FileListOptions as F, EventStreamOptions as G, ProviderSessionEvent as H, SessionBindings as I, SessionGithubRepositoryResource as J, SessionThreadListOptions as K, SessionThreadPage as L, ManagedAgentProviderCapabilities as M, CredentialDecl as N, CredentialInjectionLocation as O, ProjectConfig as P, CredentialNetworking as Q, ResolvedProjectConfig as R, SessionResourceInfo as S, CursorListOptions as T, CursorPage as U, VaultListOptions as V, DeploymentDecl as W, ManagedAgentOperationAuth as X, ManagedAgentOperationCapability as Y, MemoryStoreDecl as Z, SessionEventFormat as _, ProviderSessionInfo as a, SessionMemoryStoreResource as a0, SessionMemoryStoreResourceDecl as a1, SessionThread as a2, VaultCredentialInfo as a3, MultiagentMemberDecl as a4, DefaultMemoryStoreDecl as a5, IdentityDecl as a6, ChannelDecl as a7, ProviderSkillInfo as b, SkillDownloadInfo as c, SkillVersionInfo as d, AgentPage as e, AgentListOptions as f, DeploymentRunPage as g, EnvironmentPage as h, FilePage as i, SessionResourceListOptions as j, SessionResourcePage as k, SkillVersionListOptions as l, SkillVersionPage as m, SkillListOptions as n, SkillPage as o, VaultPage as p, SessionResourceMountInput as q, SessionEventInput as r, SessionEventSendResult as s, SessionUpdateInput as t, AgentDecl as u, SkillDecl as v, EnvironmentDecl as w, VaultDecl as x, SessionResourceDecl as y, ProviderSessionEventList as z };