import type { AgentLifecycleState } from "./agent-lifecycle.js"; import type { AgentAppearance } from "../agent-appearance.js"; import type { AiConnectionLoginIntent } from "../ai-connections.js"; import type { AgentAdapterType, PauseReason, AgentRole, AgentStatus } from "../constants.js"; import type { CompanyMembership, PrincipalPermissionGrant } from "./access.js"; import type { TrustAuthorizationPolicy, TrustPreset } from "../trust-policy.js"; import type { AgentOrgChainHealth } from "../agent-eligibility.js"; import type { AgentApiKeyScope } from "../validators/agent.js"; export interface AgentPermissions extends Record { canCreateAgents: boolean; canCreateSkills?: boolean; trustPreset?: TrustPreset; authorizationPolicy?: TrustAuthorizationPolicy; } export type AgentRuntimeConfig = Record & { aiConnection?: import("../ai-connection-router.js").AiRuntimeConnectionBinding; }; export type AgentInstructionsBundleMode = "managed" | "external"; export interface AgentInstructionsFileSummary { path: string; contentHash?: string; binary?: boolean; size: number; language: string; markdown: boolean; isEntryFile: boolean; editable: boolean; deprecated: boolean; virtual: boolean; } export interface AgentInstructionsFileDetail extends AgentInstructionsFileSummary { content: string; revision?: AgentInstructionRevision; receipt?: AgentInstructionCommitReceipt; } export interface AgentInstructionsBundle { agentId: string; companyId: string; persistence?: "agent_files"; mode: AgentInstructionsBundleMode | null; rootPath: string | null; managedRootPath: string; entryFile: string; resolvedEntryPath: string | null; editable: boolean; warnings: string[]; legacyPromptTemplateActive: boolean; legacyBootstrapPromptTemplateActive: boolean; files: AgentInstructionsFileSummary[]; } export interface AgentAccessState { canAssignTasks: boolean; taskAssignSource: "simple_default" | "explicit_grant" | "agent_creator" | "ceo_role" | "none"; membership: CompanyMembership | null; grants: PrincipalPermissionGrant[]; } export interface AgentChainOfCommandEntry { id: string; name: string; role: AgentRole; title: string | null; } export interface Agent { id: string; companyId: string; name: string; urlKey: string; role: AgentRole; title: string | null; icon: string | null; appearance?: AgentAppearance | null; avatarUrl?: string; status: AgentStatus; lifecycleState?: AgentLifecycleState; lifecycleVersion?: number; lifecycleError?: string | null; reportsTo: string | null; capabilities: string | null; adapterType: AgentAdapterType; adapterConfig: Record; runtimeConfig: AgentRuntimeConfig; defaultEnvironmentId?: string | null; budgetMonthlyCents: number; spentMonthlyCents: number; pauseReason: PauseReason | null; pausedAt: Date | null; errorReason?: string | null; permissions: AgentPermissions; lastHeartbeatAt: Date | null; metadata: Record | null; orgChainHealth?: AgentOrgChainHealth; createdAt: Date; updatedAt: Date; } export interface AgentDetail extends Agent { chainOfCommand: AgentChainOfCommandEntry[]; access: AgentAccessState; } export type ClearAgentErrorResponse = Agent; export interface AgentKeyCreated { id: string; name: string; scope: AgentApiKeyScope; token: string; createdAt: Date; } export interface AgentConfigRevision { id: string; companyId: string; agentId: string; createdByAgentId: string | null; createdByUserId: string | null; source: string; rolledBackFromRevisionId: string | null; changedKeys: string[]; beforeConfig: Record; afterConfig: Record; createdAt: Date; } export declare const ADAPTER_AUTH_SESSION_STATUSES: readonly ["starting", "waiting_for_user", "authenticated", "failed", "timed_out", "cancelled"]; export type AdapterAuthSessionStatus = (typeof ADAPTER_AUTH_SESSION_STATUSES)[number]; export declare const ADAPTER_AUTH_SESSION_INTERNAL_STATUSES: readonly ["starting", "waiting_for_user", "authenticated", "failed", "timed_out", "cancelled", "promoting", "cleanup_pending"]; export type AdapterAuthSessionInternalStatus = (typeof ADAPTER_AUTH_SESSION_INTERNAL_STATUSES)[number]; export interface AdapterAuthSessionFailure { reason: string; message: string | null; } export interface AdapterAuthSessionResponse { sessionId: string; environmentId: string; status: AdapterAuthSessionStatus; expiresAt: string | null; failure: AdapterAuthSessionFailure | null; } export interface AdapterAuthSessionPrompt { url: string; code: string; } export interface CodexAccountBindingClaim { secretId: string; companyIdentityDiffers: boolean; } export interface AdapterAuthSessionOwnerResponse extends AdapterAuthSessionResponse { aiConnection?: AiConnectionLoginIntent; prompt: AdapterAuthSessionPrompt | null; codexAccountBinding?: CodexAccountBindingClaim | null; } export interface StartAdapterAuthSessionRequest { aiConnection?: AiConnectionLoginIntent; environmentId: string; adapterType: AgentAdapterType; ttlSeconds?: number; } export declare const ADAPTER_AUTH_PANEL_MODES: readonly ["displayed_code", "submitted_browser_code"]; export type AdapterAuthPanelMode = (typeof ADAPTER_AUTH_PANEL_MODES)[number]; export declare const SETUP_TOKEN_TRANSPORT_ADVISORY_CODE: "insecure_transport"; export type SetupTokenTransportAdvisoryCode = typeof SETUP_TOKEN_TRANSPORT_ADVISORY_CODE; export interface SetupTokenTransportAdvisory { code: SetupTokenTransportAdvisoryCode; } export interface ClaudeSetupTokenSessionPrompt { authorizationUrl: string; transportAdvisory?: SetupTokenTransportAdvisory | null; } export interface ClaudeSetupTokenSessionResponse { sessionId: string; environmentId: string; status: AdapterAuthSessionStatus; expiresAt: string | null; failure: AdapterAuthSessionFailure | null; transportAdvisory?: SetupTokenTransportAdvisory | null; } export interface ClaudeSetupTokenSessionOwnerResponse extends ClaudeSetupTokenSessionResponse { aiConnection?: AiConnectionLoginIntent; panelMode: AdapterAuthPanelMode; prompt: ClaudeSetupTokenSessionPrompt | null; } export interface SubmitBrowserCodeRequest { browserCode: string; } export interface ClaudeSetupTokenCompletionResponse { storedSessionId: string; } export type AdapterEnvironmentCheckLevel = "info" | "warn" | "error"; export type AdapterEnvironmentTestStatus = "pass" | "warn" | "fail"; export interface AdapterEnvironmentCheck { code: string; level: AdapterEnvironmentCheckLevel; message: string; detail?: string | null; hint?: string | null; } export interface AdapterEnvironmentTestResult { adapterType: string; status: AdapterEnvironmentTestStatus; checks: AdapterEnvironmentCheck[]; testedAt: string; } export type AdapterAuthSignal = "present" | "absent" | "unknown"; export interface AdapterAuthSignalResponse { status: AdapterAuthSignal; } export type AgentInstructionSource = "seed" | "board" | "api" | "tool" | "cleanup" | "restore"; export interface AgentInstructionRevision { id: string; companyId: string; agentId: string; entryFile: string; contentHash: string; byteLength: number; parentRevisionId: string | null; baseRevisionId: string | null; restoredFromRevisionId: string | null; actorAgentId: string | null; actorUserId: string | null; responsibleUserId: string | null; sourceRunId: string | null; source: AgentInstructionSource; createdAt: string; } export interface AgentInstructionSnapshot { revision: AgentInstructionRevision; content: string; } export interface AgentInstructionCommitReceipt extends AgentInstructionSnapshot { changed: boolean; materialization: "current" | "pending"; } export interface AgentInstructionHistory { revisions: AgentInstructionRevision[]; nextCursor: string | null; } export interface AgentInstructionDiff { from: AgentInstructionSnapshot; to: AgentInstructionSnapshot; prefix: string; removed: string; added: string; suffix: string; } export type AgentInstructionErrorCode = "INSTRUCTION_BASE_REQUIRED" | "INSTRUCTION_REVISION_REQUIRED" | "INSTRUCTION_REVISION_CONFLICT" | "INSTRUCTION_ENTRY_CHANGED" | "INSTRUCTION_MANAGED_BUNDLE_REQUIRED" | "INSTRUCTION_IDENTITY_INVALID" | "INSTRUCTION_CONTENT_INVALID" | "INSTRUCTION_PATH_INVALID" | "RESPONSIBLE_USER_UNAVAILABLE" | "RESPONSIBLE_USER_UNAUTHORIZED"; export interface AgentInstructionErrorDetails { code: AgentInstructionErrorCode; baseRevisionId?: string | null; currentRevisionId?: string | null; entryFile?: string; reason?: string; } /** Preserved instruction edits; filesystem locations and responsible identity stay server-side. */ export interface AgentInstructionCandidate { contract?: "agent_files" | "legacy"; runId: string; entryFile: string; baseRevisionId: string | null; baseHash: string; state: "conflict" | "pending_collection" | "pending_commit" | "unavailable"; candidateHash: string | null; content: string | null; errorCode: string | null; errorMessage: string | null; createdAt: string; updatedAt: string; } /** Public cryptographic identity; private material is runtime-only. */ export interface AgentPublicIdentity { algorithm: "Ed25519"; keyId: string; publicKeyPem: string; createdAt: string; } //# sourceMappingURL=agent.d.ts.map