import type { OrgXClient } from "../../api.js"; import type { Entity } from "../../types.js"; export type MissionControlNodeType = "initiative" | "workstream" | "milestone" | "task"; export interface MissionControlAssignedAgent { id: string; name: string; domain: string | null; } export interface MissionControlNode { id: string; type: MissionControlNodeType; title: string; status: string; parentId: string | null; initiativeId: string | null; workstreamId: string | null; milestoneId: string | null; priorityNum: number; priorityLabel: string | null; dependencyIds: string[]; dueDate: string | null; etaEndAt: string | null; expectedDurationHours: number; expectedBudgetUsd: number; assignedAgents: MissionControlAssignedAgent[]; behaviorConfigId?: string | null; behaviorConfigVersion?: string | null; behaviorConfigHash?: string | null; behaviorPolicySource?: string | null; behaviorContext?: string | null; behaviorRequiresApproval?: boolean | null; behaviorApprovalStatus?: string | null; behaviorApprovalDecisionId?: string | null; behaviorAutomationLevel?: "auto" | "supervised" | "manual" | null; sliceScopePreference?: "adaptive" | "task" | "milestone" | "workstream" | null; maxSliceTasks?: number | null; maxParallelAgents?: number | null; dependencyMode?: "strict" | "relaxed" | null; updatedAt: string | null; } export interface MissionControlEdge { from: string; to: string; kind: "depends_on"; } export interface MissionControlCycleDiagnostics { detected: boolean; cycleEdgeCount: number; removedEdges: Array<{ from: string; to: string; }>; affectedNodes: Array<{ nodeId: string; nodeType: MissionControlNodeType; removedDependencyIds: string[]; remainingDependencyIds: string[]; }>; } export type SliceScope = "task" | "milestone" | "workstream"; export type SliceScopePreference = "adaptive" | SliceScope; export interface MissionControlExecutionPolicy { domain: string; requiredSkills: string[]; profile?: string | null; sliceScopePreference?: SliceScopePreference | null; maxSliceTasks?: number | null; maxParallelAgents?: number | null; dependencyMode?: "strict" | "relaxed" | null; } export declare const SLICE_SCOPE_MAX_TASKS: Record; export declare const SLICE_SCOPE_TIMEOUT_MULTIPLIER: Record; export declare const ORGX_SKILL_BY_DOMAIN: Record; export declare function safeErrorMessage(err: unknown): string; interface BudgetEnvBounds { min?: number; max?: number; } export declare function readBudgetEnvNumber(name: string, fallback: number, bounds?: BudgetEnvBounds): number; export declare const DEFAULT_TOKEN_BUDGET_ASSUMPTIONS: { tokensPerHour: number; inputShare: number; cachedInputShare: number; contingencyMultiplier: number; roundingStepUsd: number; }; export declare function pickStringArray(record: Record, keys: string[]): string[]; export declare function dedupeStrings(items: string[]): string[]; export declare function isTodoStatus(status: string): boolean; export declare function isPausedStatus(status: string): boolean; export declare function isBlockedStatus(status: string): boolean; export declare function isInProgressStatus(status: string): boolean; export declare function deriveInitiativeLifecycleStatus(currentStatus: string, childStatuses: string[]): string; export declare function isDispatchableWorkstreamStatus(status: string): boolean; export declare function normalizeMissionControlStatus(status: string | null | undefined): string; export declare function isDoneStatus(status: string): boolean; export declare function listEntitiesSafe(client: OrgXClient, type: MissionControlNodeType, filters: Record): Promise<{ items: Entity[]; warning: string | null; }>; export declare function buildMissionControlGraph(client: OrgXClient, initiativeId: string, options?: { initiativeEntity?: Entity | null; }): Promise<{ initiative: { id: string; title: string; status: string; summary: string | null; assignedAgents: MissionControlAssignedAgent[]; }; nodes: MissionControlNode[]; edges: MissionControlEdge[]; recentTodos: string[]; degraded: string[]; cycleDiagnostics?: MissionControlCycleDiagnostics; }>; export declare function normalizeEntityMutationPayload(payload: Record): Record; export declare function resolveAutoAssignments(input: { client: OrgXClient; entityId: string; entityType: string; initiativeId: string | null; title: string; summary: string | null; }): Promise<{ ok: boolean; assignment_source: "orchestrator" | "fallback" | "manual"; assigned_agents: MissionControlAssignedAgent[]; warnings: string[]; updated_entity?: Entity; }>; export declare function normalizeExecutionDomain(value: string | null | undefined): string | null; export declare function inferExecutionDomainFromText(...values: Array): string; export declare function selectSliceTasksByScope(input: { scope: SliceScope; workstreamId: string; milestoneId?: string | null; recentTodos: string[]; nodeById: Map; includeVerification: boolean; }): { tasks: MissionControlNode[]; milestoneIds: string[]; }; export declare function evaluateScopeCompletion(input: { scope: SliceScope; milestoneIds: string[]; workstreamId: string; nodeById: Map; }): { scopeComplete: boolean; remainingTasks: number; }; export declare function deriveExecutionPolicy(taskNode: MissionControlNode, workstreamNode: MissionControlNode | null): MissionControlExecutionPolicy; export declare function deriveBehaviorConfigContext(taskNode: MissionControlNode, workstreamNode: MissionControlNode | null): { configId: string | null; version: string | null; hash: string | null; policySource: string | null; context: string | null; requiresApproval: boolean; approvalStatus: string | null; approvalDecisionId: string | null; }; export declare function deriveBehaviorAutomationLevel(taskNode: MissionControlNode, workstreamNode: MissionControlNode | null): "auto" | "supervised" | "manual"; export declare function detectBehaviorConfigDrift(input: { taskNode: MissionControlNode; workstreamNode: MissionControlNode | null; behaviorConfig: { configId: string | null; version: string | null; hash: string | null; policySource: string | null; context: string | null; }; behaviorAutomationLevel: "auto" | "supervised" | "manual"; }): { fields: Array<"config_id" | "version" | "hash" | "policy_source" | "context" | "automation_level">; declared: { configId: string | null; version: string | null; hash: string | null; policySource: string | null; context: string | null; automationLevel: "auto" | "supervised" | "manual" | null; }; runtime: { configId: string | null; version: string | null; hash: string | null; policySource: string | null; context: string | null; automationLevel: "auto" | "supervised" | "manual"; }; } | null; export declare function spawnGuardIsRateLimited(result: unknown): boolean; export declare function summarizeSpawnGuardBlockReason(result: unknown): string; export {};