export interface ProductProjectionIssue {
    "request_id": string;
    "expected_revision": string;
    "project_digest": string;
    "resource_link_collection_digest": string;
    "resource_link_max_items": number;
    "response_byte_limit": number;
    "time_budget_ms": number;
}
export interface ProductProjection {
    "schema": "hasna.product_projection.v1";
    "id": string;
    "createdAt": string;
    "producer": {
        "kind": string;
        "id": string;
        "name"?: string;
        "provider"?: string;
        "accountId"?: string;
        "machineId"?: string;
    };
    "digest": string;
    "revision": number;
    "sourceRevision": number;
    "sourceProjectRef": {
        "kind": string;
        "id": string;
        "name"?: string;
        "uri"?: string;
        "externalId"?: string;
        "sourcePackage"?: string;
        "tags": Array<string>;
    };
    "slug": string;
    "displayName": string;
    "repositoryRef": {
        "kind": string;
        "id": string;
        "name"?: string;
        "uri"?: string;
        "externalId"?: string;
        "sourcePackage"?: string;
        "tags": Array<string>;
    };
    "workspaceRef": {
        "kind": string;
        "id": string;
        "name"?: string;
        "uri"?: string;
        "externalId"?: string;
        "sourcePackage"?: string;
        "tags": Array<string>;
    };
    "lifecycle": "draft" | "active" | "paused" | "archived";
    "ownerRefs": Array<{
        "kind": string;
        "id": string;
        "name"?: string;
        "provider"?: string;
        "accountId"?: string;
        "machineId"?: string;
    }>;
    "projectedAt": string;
    "sourceEvidenceRefs": Array<{
        "id": string;
        "kind"?: string;
        "uri"?: string;
        "sha256"?: string;
        "summary"?: string;
    }>;
}
export interface ProductProjectionReceipt {
    "schema": "projects.product_projection_receipt.v1";
    "receipt_id": string;
    "project_id": string;
    "tenant_id": string;
    "issued_revision": number;
    "issued_at": string;
    "request": ProductProjectionIssue;
    "request_digest": string;
    "subject": {
        "app": string;
        "tenant_id": string;
        "agent": string;
        "kid": string;
    };
    "policy": {
        "id": string;
        "revision": number;
        "digest": string;
        "authority": string;
    };
    "source": {
        "project": Workspace;
        "revision": string;
        "project_digest": string;
        "resource_links": Array<ProjectResourceLink>;
        "resource_link_collection_digest": string;
    };
    "projection": ProductProjection;
}
export interface Root {
    "id": string;
    "slug": string;
    "name": string;
    "base_path": string;
    "tags"?: Array<string>;
    "default_kind"?: string | null;
    "repo_visibility"?: string | null;
    "allowed_recipes"?: Array<string>;
    "allowed_agents"?: Array<string>;
    "metadata"?: Record<string, unknown>;
    "created_at"?: string;
    "updated_at"?: string;
}
export interface CreateRoot {
    "name": string;
    "base_path": string;
    "slug"?: string;
    "tags"?: Array<string>;
    "default_kind"?: string;
    "repo_visibility"?: "public" | "private";
    "github_org"?: string;
    "metadata"?: Record<string, unknown>;
}
export interface UpdateRoot {
    "name"?: string;
    "base_path"?: string;
    "slug"?: string;
    "tags"?: Array<string>;
    "default_kind"?: string;
    "repo_visibility"?: "public" | "private";
    "github_org"?: string;
    "metadata"?: Record<string, unknown>;
}
export interface Agent {
    "id": string;
    "slug": string;
    "name": string;
    "kind": "human" | "ai" | "service" | "cli";
    "provider"?: string | null;
    "model"?: string | null;
    "role"?: string | null;
    "permissions"?: Array<string>;
    "metadata"?: Record<string, unknown>;
    "created_at"?: string;
    "updated_at"?: string;
}
export interface CreateAgent {
    "name": string;
    "kind"?: "human" | "ai" | "service" | "cli";
    "slug"?: string;
    "provider"?: string;
    "model"?: string;
    "role"?: string;
    "permissions"?: Array<string>;
    "metadata"?: Record<string, unknown>;
}
export interface Recipe {
    "id": string;
    "slug": string;
    "name": string;
    "description"?: string | null;
    "kind"?: string | null;
    "version"?: number;
    "steps"?: Array<Record<string, unknown>>;
    "default_tags"?: Array<string>;
    "metadata"?: Record<string, unknown>;
    "created_at"?: string;
    "updated_at"?: string;
}
export interface CreateRecipe {
    "name": string;
    "slug"?: string;
    "description"?: string;
    "kind"?: string;
    "version"?: number;
    "steps"?: Array<Record<string, unknown>>;
    "default_tags"?: Array<string>;
    "metadata"?: Record<string, unknown>;
}
export interface Workspace {
    "id": string;
    "slug": string;
    "name": string;
    "description"?: string | null;
    "kind": string;
    "status": "active" | "archived" | "deleted";
    "root_id"?: string | null;
    "recipe_id"?: string | null;
    "canonical_machine"?: string | null;
    "primary_path"?: string | null;
    "git_remote"?: string | null;
    "s3_bucket": string | null;
    "s3_prefix": string | null;
    "tags"?: Array<string>;
    "integrations"?: Record<string, string>;
    "metadata"?: Record<string, unknown>;
    "last_opened_at": string | null;
    "created_at"?: string;
    "updated_at"?: string;
    "synced_at": string | null;
}
export interface CreateWorkspace {
    "name": string;
    "slug"?: string;
    "description"?: string;
    "kind"?: string;
    "root_id"?: string;
    "recipe_id"?: string;
    "primary_path"?: string;
    "git_remote"?: string;
    "tags"?: Array<string>;
    "integrations"?: Record<string, unknown>;
    "metadata"?: Record<string, unknown>;
    "agent_id"?: string;
}
export interface UpdateWorkspace {
    "name"?: string;
    "slug"?: string;
    "description"?: string | null;
    "kind"?: string;
    "status"?: "active" | "archived" | "deleted";
    "root_id"?: string | null;
    "recipe_id"?: string | null;
    "canonical_machine"?: string | null;
    "primary_path"?: string | null;
    "git_remote"?: string | null;
    "tags"?: Array<string>;
    "integrations"?: Record<string, unknown>;
    "metadata"?: Record<string, unknown>;
    "last_opened_at"?: string | null;
    "agent_id"?: string;
}
export interface WorkspaceEvent {
    "id": string;
    "workspace_id"?: string | null;
    "agent_id"?: string | null;
    "event_type": string;
    "source": string;
    "metadata"?: Record<string, unknown>;
    "created_at"?: string;
}
export interface WorkspaceList {
    "filter_contract"?: "projects.list.v2";
    "applied_filters"?: {
        "query_scope": "legacy" | "identity" | "discovery" | "structured" | "all";
        "tags": Array<string>;
        "exclude_evals": boolean;
        "exclude_registry_fixtures": boolean;
    };
    "workspaces": Array<Workspace>;
    "count": number;
    "total": number;
    "offset": number;
    "limit": number;
    "has_more": boolean;
    "complete": boolean;
}
export interface GuardedResponseControl {
    "response_byte_limit": number;
    "time_budget_ms": number;
    "response_bytes": number;
    "elapsed_ms": number;
    "complete": boolean;
    "truncated": boolean;
}
export interface GuardedProjectRead {
    "ok": boolean;
    "project_id": string;
    "project": Workspace;
    "current_revision": string;
    "resource_links": Array<ProjectResourceLink>;
    "resource_link_count": number;
    "resource_link_max_items": number;
    "resource_link_collection_digest": string;
    "response_control": GuardedResponseControl;
}
export interface ProjectResourceLinkLabels {
    "name"?: string;
    "channel_name"?: string;
    "path"?: string;
    "tags"?: Array<string>;
}
export interface ProjectResourceConversationsChannelLabels {
    "name"?: string;
    "channel_name": string;
    "path"?: string;
    "tags"?: Array<string>;
}
export interface ProjectResourceExternalUuidLocator {
    "kind": "external_uuid";
    "value": string;
}
export interface ProjectResourceCanonicalUriLocator {
    "kind": "canonical_uri";
    "value": string;
}
export interface ProjectResourceConversationsChannelLocator {
    "kind": "conversations_channel_id";
    "value": string;
}
export type ProjectResourceLinkLocator = ProjectResourceExternalUuidLocator | ProjectResourceCanonicalUriLocator | ProjectResourceConversationsChannelLocator;
export type ProjectResourcePortableLocator = ProjectResourceExternalUuidLocator | ProjectResourceCanonicalUriLocator;
export type ProjectResourceConversationsChannelLinkLocator = ProjectResourceExternalUuidLocator | ProjectResourceConversationsChannelLocator;
export type ProjectResourceLinkInput = {
    "authority": "todos";
    "service_instance": string;
    "source_package": "@hasna/todos";
    "target_kind": "project" | "task_list" | "plan";
    "locator": ProjectResourcePortableLocator;
    "scope": "resource" | "collection";
    "labels"?: ProjectResourceLinkLabels;
} | {
    "authority": "todos";
    "service_instance": string;
    "source_package": "@hasna/todos";
    "target_kind": "task";
    "locator": ProjectResourceExternalUuidLocator;
    "scope": "resource" | "collection";
    "labels"?: ProjectResourceLinkLabels;
} | {
    "authority": "conversations";
    "service_instance": string;
    "source_package": "@hasna/conversations";
    "target_kind": "project";
    "locator": ProjectResourcePortableLocator;
    "scope": "resource" | "collection";
    "labels"?: ProjectResourceLinkLabels;
} | {
    "authority": "conversations";
    "service_instance": string;
    "source_package": "@hasna/conversations";
    "target_kind": "channel";
    "locator": ProjectResourceConversationsChannelLinkLocator;
    "scope": "resource" | "collection";
    "labels"?: ProjectResourceConversationsChannelLabels;
} | {
    "authority": "knowledge";
    "service_instance": string;
    "source_package": "@hasna/knowledge";
    "target_kind": "collection" | "item";
    "locator": ProjectResourcePortableLocator;
    "scope": "resource" | "collection";
    "labels"?: ProjectResourceLinkLabels;
} | {
    "authority": "mementos";
    "service_instance": string;
    "source_package": "@hasna/mementos";
    "target_kind": "project" | "item";
    "locator": ProjectResourcePortableLocator;
    "scope": "resource" | "collection";
    "labels"?: ProjectResourceLinkLabels;
} | {
    "authority": "orgs";
    "service_instance": string;
    "source_package": "@hasna/orgs";
    "target_kind": "org" | "project";
    "locator": ProjectResourcePortableLocator;
    "scope": "resource" | "collection";
    "labels"?: ProjectResourceLinkLabels;
} | {
    "authority": "contacts";
    "service_instance": string;
    "source_package": "@hasna/contacts";
    "target_kind": "contact";
    "locator": ProjectResourceExternalUuidLocator;
    "scope": "resource" | "collection";
    "labels"?: ProjectResourceLinkLabels;
} | {
    "authority": "files";
    "service_instance": string;
    "source_package": "@hasna/files";
    "target_kind": "project";
    "locator": ProjectResourceCanonicalUriLocator;
    "scope": "collection";
    "labels"?: ProjectResourceLinkLabels;
};
export type ProjectResourceLink = {
    "authority": "todos";
    "service_instance": string;
    "source_package": "@hasna/todos";
    "target_kind": "project" | "task_list" | "plan";
    "locator": ProjectResourcePortableLocator;
    "scope": "resource" | "collection";
    "labels": ProjectResourceLinkLabels;
    "id": string;
    "project_id": string;
    "created_at": string;
    "updated_at": string;
} | {
    "authority": "todos";
    "service_instance": string;
    "source_package": "@hasna/todos";
    "target_kind": "task";
    "locator": ProjectResourceExternalUuidLocator;
    "scope": "resource" | "collection";
    "labels": ProjectResourceLinkLabels;
    "id": string;
    "project_id": string;
    "created_at": string;
    "updated_at": string;
} | {
    "authority": "conversations";
    "service_instance": string;
    "source_package": "@hasna/conversations";
    "target_kind": "project";
    "locator": ProjectResourcePortableLocator;
    "scope": "resource" | "collection";
    "labels": ProjectResourceLinkLabels;
    "id": string;
    "project_id": string;
    "created_at": string;
    "updated_at": string;
} | {
    "authority": "conversations";
    "service_instance": string;
    "source_package": "@hasna/conversations";
    "target_kind": "channel";
    "locator": ProjectResourceConversationsChannelLinkLocator;
    "scope": "resource" | "collection";
    "labels": ProjectResourceConversationsChannelLabels;
    "id": string;
    "project_id": string;
    "created_at": string;
    "updated_at": string;
} | {
    "authority": "knowledge";
    "service_instance": string;
    "source_package": "@hasna/knowledge";
    "target_kind": "collection" | "item";
    "locator": ProjectResourcePortableLocator;
    "scope": "resource" | "collection";
    "labels": ProjectResourceLinkLabels;
    "id": string;
    "project_id": string;
    "created_at": string;
    "updated_at": string;
} | {
    "authority": "mementos";
    "service_instance": string;
    "source_package": "@hasna/mementos";
    "target_kind": "project" | "item";
    "locator": ProjectResourcePortableLocator;
    "scope": "resource" | "collection";
    "labels": ProjectResourceLinkLabels;
    "id": string;
    "project_id": string;
    "created_at": string;
    "updated_at": string;
} | {
    "authority": "orgs";
    "service_instance": string;
    "source_package": "@hasna/orgs";
    "target_kind": "org" | "project";
    "locator": ProjectResourcePortableLocator;
    "scope": "resource" | "collection";
    "labels": ProjectResourceLinkLabels;
    "id": string;
    "project_id": string;
    "created_at": string;
    "updated_at": string;
} | {
    "authority": "contacts";
    "service_instance": string;
    "source_package": "@hasna/contacts";
    "target_kind": "contact";
    "locator": ProjectResourceExternalUuidLocator;
    "scope": "resource" | "collection";
    "labels": ProjectResourceLinkLabels;
    "id": string;
    "project_id": string;
    "created_at": string;
    "updated_at": string;
} | {
    "authority": "files";
    "service_instance": string;
    "source_package": "@hasna/files";
    "target_kind": "project";
    "locator": ProjectResourceCanonicalUriLocator;
    "scope": "collection";
    "labels": ProjectResourceLinkLabels;
    "id": string;
    "project_id": string;
    "created_at": string;
    "updated_at": string;
};
export interface ProjectResourceLinkCollectionV1 {
    "schema": "hasna.project_resource_link_collection.v1";
    "project_id": string;
    "current_revision": string;
    "links": Array<ProjectResourceLink>;
    "link_count": number;
    "max_items": number;
    "collection_digest": string;
    "complete": true;
    "truncated": false;
}
export interface ProjectResourceLinkSnapshot {
    "project": Workspace;
    "links": Array<ProjectResourceLink>;
    "collection_digest": string;
}
export interface ProjectResourceLinkRead {
    "ok": boolean;
    "project_id": string;
    "project": Workspace;
    "current_revision": string;
    "links": Array<ProjectResourceLink>;
    "link_count": number;
    "max_items": number;
    "collection_digest": string;
    "complete": boolean;
    "truncated": boolean;
    "contract": ProjectResourceLinkCollectionV1;
    "response_control": GuardedResponseControl;
}
export interface ProjectResourceLinkMutationRequest {
    "operation_id": string;
    "step_id": string;
    "mode"?: "add" | "reconcile";
    "expected_revision": string;
    "links": Array<ProjectResourceLinkInput>;
    "integrations"?: Record<string, unknown>;
    "max_items"?: number;
    "dry_run"?: boolean;
    "agent_id"?: string;
    "source"?: string;
    "command"?: string;
    "response_byte_limit": number;
    "time_budget_ms": number;
}
export interface ProjectResourceLinkMutationResult {
    "ok": boolean;
    "dry_run": boolean;
    "outcome": "accepted" | "duplicate_of_accepted" | "terminal_nonacceptance" | "planned";
    "mode": "add" | "reconcile";
    "idempotency_key": string;
    "request_digest": string;
    "precondition_digest": string;
    "project_id": string;
    "expected_revision": string;
    "current_revision": string;
    "before": ProjectResourceLinkSnapshot;
    "after": ProjectResourceLinkSnapshot | null;
    "receipt": GuardedProjectMutationReceipt | null;
    "response_control": GuardedResponseControl;
}
export interface WorkspaceLocation {
    "id": string;
    "workspace_id": string;
    "path": string;
    "machine_id": string;
    "label": string;
    "kind": string;
    "is_primary": boolean;
    "exists_at_create": boolean;
    "metadata": Record<string, unknown>;
    "created_at": string;
}
export interface AddWorkspaceLocation {
    "path": string;
    "machine_id"?: string;
    "label"?: string;
    "kind"?: string;
    "is_primary"?: boolean;
    "metadata"?: Record<string, unknown>;
}
export interface WorkspaceAgentAssignment {
    "id": string;
    "workspace_id": string;
    "agent_id": string;
    "role": string;
    "assigned_by"?: string | null;
    "metadata": Record<string, unknown>;
    "created_at": string;
    "agent"?: Agent;
}
export interface AssignWorkspaceAgent {
    "agent_id": string;
    "role"?: string;
    "assigned_by"?: string;
    "metadata"?: Record<string, unknown>;
}
export interface WorkspaceLock {
    "id": string;
    "lock_key": string;
    "workspace_id"?: string | null;
    "agent_id"?: string | null;
    "reason"?: string | null;
    "created_at": string;
    "expires_at"?: string | null;
}
export interface AcquireWorkspaceLock {
    "lock_key": string;
    "workspace_id"?: string;
    "agent_id"?: string;
    "reason"?: string;
    "ttl_seconds"?: number;
}
export interface ProjectQuarantineSnapshot {
    "project": Workspace;
    "project_digest": string;
    "resource_links": Array<ProjectResourceLink>;
    "resource_link_collection_digest": string;
    "workspace_locations": Array<WorkspaceLocation>;
    "workspace_location_collection_digest": string;
}
export interface ProjectQuarantineRead {
    "ok": boolean;
    "project_id": string;
    "current_revision": string;
    "snapshot": ProjectQuarantineSnapshot;
    "resource_link_count": number;
    "workspace_location_count": number;
    "complete": boolean;
    "truncated": boolean;
    "response_control": GuardedResponseControl;
}
export interface ProjectQuarantineRequest {
    "operation_id": string;
    "step_id": string;
    "expected_revision": string;
    "expected_project_digest": string;
    "expected_resource_link_collection_digest": string;
    "expected_resource_link_ids": Array<string>;
    "resource_link_max_items": number;
    "expected_workspace_location_collection_digest": string;
    "expected_workspace_location_ids": Array<string>;
    "workspace_location_max_items": number;
    "quarantine_name": string;
    "quarantine_slug": string;
    "dry_run"?: boolean;
    "agent_id"?: string;
    "source"?: string;
    "command"?: string;
    "response_byte_limit": number;
    "time_budget_ms": number;
}
export interface ProjectQuarantineRollbackRequest {
    "operation_id": string;
    "step_id": string;
    "accepted_receipt_id": string;
    "expected_current_revision": string;
    "resource_link_max_items": number;
    "workspace_location_max_items": number;
    "agent_id"?: string;
    "source"?: string;
    "command"?: string;
    "response_byte_limit": number;
    "time_budget_ms": number;
}
export interface ProjectQuarantineResult {
    "ok": boolean;
    "dry_run": boolean;
    "outcome": "accepted" | "duplicate_of_accepted" | "terminal_nonacceptance" | "planned";
    "idempotency_key": string;
    "request_digest": string;
    "precondition_digest": string;
    "project_id": string;
    "expected_revision": string;
    "current_revision": string;
    "before": ProjectQuarantineSnapshot;
    "after": ProjectQuarantineSnapshot | null;
    "receipt": GuardedProjectMutationReceipt | null;
    "rollback": {
        "accepted_receipt_id": string;
        "expected_current_revision": string;
    } | null;
    "response_control": GuardedResponseControl;
}
export interface ContactProjectMembershipSnapshot {
    "contact_id": string;
    "project_id": string;
    "linked": boolean;
    "version": string;
}
export interface ProjectContactLinkEvidence {
    "system": "contacts" | "projects";
    "step_id": string;
    "outcome": string;
    "receipt_id": string;
    "compensated": boolean;
}
export interface ProjectContactLinkMutationRequest {
    "operation_id": string;
    "labels"?: ProjectResourceLinkLabels;
    "max_items": number;
    "response_byte_limit": number;
    "time_budget_ms": number;
}
export interface ProjectContactLinkMutationResult {
    "ok": boolean;
    "outcome": "accepted" | "duplicate_of_accepted";
    "authority": string;
    "project_id": string;
    "contact_id": string;
    "membership": ContactProjectMembershipSnapshot;
    "project_link": ProjectResourceLink | null;
    "evidence": Array<ProjectContactLinkEvidence>;
    "response_control": GuardedResponseControl;
}
export interface ProjectContactLinkListResult {
    "ok": boolean;
    "authority": string;
    "project_id": string;
    "membership_revision": string;
    "project_revision": string;
    "contact_ids": Array<string>;
    "synchronized_contact_ids": Array<string>;
    "missing_project_link_contact_ids": Array<string>;
    "stale_project_link_contact_ids": Array<string>;
    "project_links": Array<ProjectResourceLink>;
    "response_control": GuardedResponseControl;
}
export interface ProjectResourceLinkRollbackRequest {
    "operation_id": string;
    "step_id": string;
    "accepted_receipt_id": string;
    "expected_current_revision": string;
    "max_items"?: number;
    "agent_id"?: string;
    "source"?: string;
    "command"?: string;
    "response_byte_limit": number;
    "time_budget_ms": number;
}
export interface ProjectResourceLinkProducerBinding {
    "authority_id": string;
    "tenant_id": string;
    "corpus_id": string | null;
    "capability_digest": string;
}
export interface ProjectResourceLinkProducerEvidence {
    "created_by_operation": boolean;
    "forward_receipt_id": string | null;
    "child_link_receipt_ids": Array<string>;
    "target_revision": string;
    "target_digest": string;
    "inverse_verified": boolean | null;
    "inverse_outcome": string | null;
}
export interface ProjectResourceLinkMigrationItemInput {
    "link": ProjectResourceLinkInput;
    "producer_resource_kind": string;
    "producer_binding": ProjectResourceLinkProducerBinding;
}
export interface ProjectResourceLinkMigrationItem {
    "link": ProjectResourceLinkInput;
    "link_id": string;
    "producer_resource_kind": string;
    "producer_binding": ProjectResourceLinkProducerBinding;
    "producer_evidence": ProjectResourceLinkProducerEvidence | null;
}
export type ProjectResourceLinkProjectsReferenceProof = {
    "kind": "accepted_inverse";
    "forward_receipt_id": string;
    "inverse_receipt_id": string;
    "verified_revision": string;
    "collection_digest": string;
    "link_ids_checked": Array<string>;
    "complete": true;
    "truncated": false;
    "request_digest": string;
    "precondition_digest": string;
} | {
    "kind": "no_projects_write";
    "verified_revision": string;
    "collection_digest": string;
    "link_ids_checked": Array<string>;
    "complete": true;
    "truncated": false;
    "request_digest": string;
    "precondition_digest": string;
};
export interface ProjectResourceLinkMigrationManifestV1 {
    "schema": "projects.project_resource_link_migration_manifest.v1";
    "manifest_id": string;
    "project_id": string;
    "operation_id": string;
    "step_id": string;
    "state": "planned" | "producer_applied" | "projects_applied" | "verified" | "rollback_in_progress" | "rolled_back" | "retained_target" | "failed_reconcilable";
    "expected_project_revision": string;
    "desired_collection_digest": string;
    "links": Array<ProjectResourceLinkMigrationItem>;
    "projects_forward_receipt_id": string | null;
    "projects_inverse_receipt_id": string | null;
    "projects_reference_proof": ProjectResourceLinkProjectsReferenceProof | null;
    "last_verified_projects_revision": string | null;
    "last_verified_projects_digest": string | null;
    "transition_version": number;
    "created_at": string;
    "updated_at": string;
}
export interface ProjectResourceLinkMigrationEvent {
    "event_id": string;
    "manifest_id": string;
    "transition_version": number;
    "from_state": string | null;
    "to_state": string;
    "request_digest": string;
    "precondition_digest": string;
    "evidence": Record<string, unknown>;
    "created_at": string;
}
export interface ProjectResourceLinkMigrationPlanRequest {
    "operation_id": string;
    "step_id": string;
    "expected_project_revision": string;
    "links": Array<ProjectResourceLinkMigrationItemInput>;
    "max_items"?: number;
    "response_byte_limit": number;
    "time_budget_ms": number;
}
export interface ProjectResourceLinkMigrationAdvanceRequest {
    "expected_transition_version": number;
    "next_state": "producer_applied" | "projects_applied" | "verified" | "failed_reconcilable";
    "max_items"?: number;
    "producer_evidence"?: Array<ProjectResourceLinkProducerEvidence>;
    "projects_forward_receipt_id"?: string;
    "last_verified_projects_revision"?: string;
    "last_verified_projects_digest"?: string;
    "evidence": Record<string, unknown>;
    "response_byte_limit": number;
    "time_budget_ms": number;
}
export interface ProjectResourceLinkMigrationRollbackRequest {
    "expected_transition_version": number;
    "max_items"?: number;
    "producer_outcome": "pending" | "complete" | "retained_target" | "failed_reconcilable";
    "producer_evidence"?: Array<ProjectResourceLinkProducerEvidence>;
    "evidence": Record<string, unknown>;
    "agent_id"?: string;
    "source"?: string;
    "command"?: string;
    "response_byte_limit": number;
    "time_budget_ms": number;
}
export interface ProjectResourceLinkMigrationResult {
    "ok": boolean;
    "outcome": "accepted" | "duplicate_of_accepted" | "terminal_nonacceptance";
    "manifest": ProjectResourceLinkMigrationManifestV1;
    "events": Array<ProjectResourceLinkMigrationEvent>;
    "response_control": GuardedResponseControl;
}
export interface GuardedProjectMutationReceipt {
    "receipt_id": string;
    "operation_id": string;
    "step_id": string;
    "direction": "forward" | "inverse";
    "idempotency_key": string;
    "target_id": string;
    "request_digest": string;
    "precondition_digest": string;
    "expected_revision": string;
    "outcome": "accepted" | "duplicate_of_accepted" | "terminal_nonacceptance";
    "reason": string | null;
    "result_project_id": string | null;
    "duplicate_of_receipt_id": string | null;
    "before": Record<string, unknown> | null;
    "after": Record<string, unknown> | null;
    "post_revision": string | null;
    "created_at": string;
}
export interface GuardedProjectMutationRequest {
    "operation_id": string;
    "step_id": string;
    "direction"?: "forward" | "inverse";
    "expected_revision": string;
    "patch": UpdateWorkspace;
    "dry_run"?: boolean;
    "agent_id"?: string;
    "source"?: string;
    "command"?: string;
    "response_byte_limit": number;
    "time_budget_ms": number;
}
export interface GuardedProjectMutationResult {
    "ok": boolean;
    "dry_run": boolean;
    "outcome": "accepted" | "duplicate_of_accepted" | "terminal_nonacceptance" | "planned";
    "idempotency_key": string;
    "request_digest": string;
    "precondition_digest": string;
    "project_id": string;
    "expected_revision": string;
    "current_revision": string;
    "before": Workspace;
    "after": Workspace | null;
    "receipt": GuardedProjectMutationReceipt | null;
    "response_control": GuardedResponseControl;
}
export interface GuardedProjectMutationReceiptLookup {
    "receipt": GuardedProjectMutationReceipt;
    "response_control": GuardedResponseControl;
}
export interface GuardedProjectMutationRollbackRequest {
    "operation_id": string;
    "step_id": string;
    "accepted_receipt_id": string;
    "expected_current_revision": string;
    "agent_id"?: string;
    "source"?: string;
    "command"?: string;
    "response_byte_limit": number;
    "time_budget_ms": number;
}
export interface RootList {
    "roots": Array<Root>;
    "count": number;
}
export interface AgentList {
    "agents": Array<Agent>;
    "count": number;
}
export interface RecipeList {
    "recipes": Array<Recipe>;
    "count": number;
}
export interface Machine {
    "slug": string;
    "status": string;
    "role": "mirror-hub" | "assignable" | "avoid";
}
export interface MachineList {
    "machines": Array<Machine>;
    "count": number;
}
export interface EventList {
    "events": Array<WorkspaceEvent>;
    "count": number;
}
export interface LocationList {
    "locations": Array<WorkspaceLocation>;
    "count": number;
}
export interface LocationAdded {
    "project": Workspace;
    "location": WorkspaceLocation;
}
export interface AgentAssignmentList {
    "assignments": Array<WorkspaceAgentAssignment>;
    "count": number;
}
export interface AgentAssignment {
    "assignment": WorkspaceAgentAssignment;
}
export interface LockList {
    "locks": Array<WorkspaceLock>;
    "count": number;
}
export interface LockRelease {
    "released": boolean;
}
export interface RecordEvent {
    "event_type": string;
    "source"?: string;
    "agent_id"?: string;
    "prompt"?: string;
    "command"?: string;
    "before"?: Record<string, unknown> | null;
    "after"?: Record<string, unknown> | null;
    "metadata"?: Record<string, unknown>;
}
export interface EventRecorded {
    "event": WorkspaceEvent;
}
export interface DeleteResult {
    "deleted": boolean;
    "hard"?: boolean;
    "id"?: string;
}
export interface Health {
    "status": string;
    "version": string;
}
export interface LegacyVersionResponse {
    "status": string;
    "version": string;
}
export interface Error {
    "error": string;
    "reason"?: string;
}
export interface ProjectsClientOptions {
    /** Base URL, e.g. process.env.APP_API_URL. */
    baseUrl: string;
    /** API key, e.g. process.env.APP_API_KEY. Sent as the 'x-api-key' header. */
    apiKey?: string;
    /** Custom fetch (defaults to global fetch). */
    fetch?: typeof fetch;
    /** Extra headers merged into every request. */
    headers?: Record<string, string>;
}
export declare class ApiError extends Error {
    readonly status: number;
    readonly body: unknown;
    constructor(status: number, message: string, body: unknown);
}
export declare class ProjectsClient {
    private readonly baseUrl;
    private readonly apiKey;
    private readonly fetchImpl;
    private readonly baseHeaders;
    constructor(options: ProjectsClientOptions);
    private request;
    /** Liveness probe */
    getHealth(init?: RequestInit): Promise<Health>;
    /** Readiness probe (checks DB connectivity) */
    getReady(init?: RequestInit): Promise<Health>;
    /** List agents */
    listAgents(init?: RequestInit): Promise<AgentList>;
    /** Create an agent */
    createAgent(body: CreateAgent, init?: RequestInit): Promise<Agent>;
    /** Get an agent by id or slug */
    getAgent(id: string, init?: RequestInit): Promise<Agent>;
    /** List active project mutation locks */
    listLocks(init?: RequestInit): Promise<LockList>;
    /** Acquire a project mutation lock */
    acquireLock(body: AcquireWorkspaceLock, init?: RequestInit): Promise<Lock>;
    /** Release a project mutation lock (holder-scoped by lock id; key-only DELETE is the force path) */
    releaseLock(key: string, query?: {
        "lock_id"?: string;
    }, init?: RequestInit): Promise<LockRelease>;
    /** List canonical machines in the registry */
    listMachines(init?: RequestInit): Promise<MachineList>;
    /** List projects (workspaces) */
    listProjects(query?: {
        "status"?: string;
        "kind"?: string;
        "root_id"?: string;
        "query"?: string;
        "query_scope"?: "identity" | "discovery" | "structured" | "all";
        "tag"?: string;
        "tags"?: Array<string>;
        "exclude_evals"?: boolean;
        "include_fixtures"?: boolean;
        "limit"?: number;
        "offset"?: number;
    }, init?: RequestInit): Promise<WorkspaceList>;
    /** Create a project (workspace) */
    createProject(body: CreateWorkspace, init?: RequestInit): Promise<Workspace>;
    /** Get a project by id or slug */
    getProject(id: string, init?: RequestInit): Promise<Workspace>;
    /** Delete a project (soft by default, ?hard=true for hard delete) */
    deleteProject(id: string, query?: {
        "hard"?: boolean;
    }, init?: RequestInit): Promise<DeleteResult>;
    /** Update a project */
    updateProject(id: string, body: UpdateWorkspace, init?: RequestInit): Promise<Workspace>;
    /** List a project's agent assignments */
    listProjectAgents(id: string, init?: RequestInit): Promise<AgentAssignmentList>;
    /** Assign a registered agent to a project role */
    assignProjectAgent(id: string, body: AssignWorkspaceAgent, init?: RequestInit): Promise<AgentAssignment>;
    /** Archive a project */
    archiveProject(id: string, init?: RequestInit): Promise<Workspace>;
    /** List Contacts-authoritative project memberships and compare synchronized Project resource links */
    listProjectContacts(id: string, query?: {
        "max_items": number;
        "response_byte_limit": number;
        "time_budget_ms": number;
    }, init?: RequestInit): Promise<ProjectContactLinkListResult>;
    /** Attach a Contact through Contacts-authoritative compensation-safe coordination */
    attachProjectContact(id: string, contactId: string, body: ProjectContactLinkMutationRequest, init?: RequestInit): Promise<ProjectContactLinkMutationResult>;
    /** Detach a Contact through Contacts-authoritative compensation-safe coordination */
    detachProjectContact(id: string, contactId: string, body: ProjectContactLinkMutationRequest, init?: RequestInit): Promise<ProjectContactLinkMutationResult>;
    /** Read the exact complete project, resource-link, and path-selector preimage for quarantine */
    readDuplicateProjectQuarantinePreimage(id: string, query?: {
        "resource_link_max_items": number;
        "workspace_location_max_items": number;
        "response_byte_limit": number;
        "time_budget_ms": number;
    }, init?: RequestInit): Promise<ProjectQuarantineRead>;
    /** Atomically retire duplicate selectors and links while retaining reversible provenance */
    quarantineDuplicateProject(id: string, body: ProjectQuarantineRequest, init?: RequestInit): Promise<ProjectQuarantineResult>;
    /** Restore the exact project metadata, resource links, and path selectors from the accepted receipt */
    rollbackDuplicateProjectQuarantine(id: string, body: ProjectQuarantineRollbackRequest, init?: RequestInit): Promise<ProjectQuarantineResult>;
    /** List a project's events */
    listProjectEvents(id: string, query?: {
        "limit"?: number;
    }, init?: RequestInit): Promise<EventList>;
    /** Record a custom audit event for a project */
    recordProjectEvent(id: string, body: RecordEvent, init?: RequestInit): Promise<EventRecorded>;
    /** Read one project by exact stable id with bounded complete JSON and its current mutation revision */
    guardedReadProject(id: string, query: {
        "response_byte_limit": number;
        "time_budget_ms": number;
        "resource_link_max_items"?: number;
    }, init?: RequestInit): Promise<GuardedProjectRead>;
    /** Conditionally update one exact project and return a deterministic terminal receipt */
    guardedUpdateProject(id: string, body: GuardedProjectMutationRequest, init?: RequestInit): Promise<GuardedProjectMutationResult>;
    /** Look up exactly one terminal guarded mutation receipt */
    lookupGuardedProjectMutationReceipt(id: string, query: {
        "operation_id": string;
        "step_id": string;
        "direction": "forward" | "inverse";
        "idempotency_key": string;
        "max_items": number;
        "response_byte_limit": number;
        "time_budget_ms": number;
    }, init?: RequestInit): Promise<GuardedProjectMutationReceiptLookup>;
    /** Conditionally roll back one accepted guarded mutation receipt */
    rollbackGuardedProjectMutation(id: string, body: GuardedProjectMutationRollbackRequest, init?: RequestInit): Promise<GuardedProjectMutationResult>;
    /** List a project's registered folder locations */
    listProjectLocations(id: string, init?: RequestInit): Promise<LocationList>;
    /** Register an extra folder location for a project */
    addProjectLocation(id: string, body: AddWorkspaceLocation, init?: RequestInit): Promise<LocationAdded>;
    /** Issue an immutable factual ProductProjection (server policy required) */
    issueProductProjection(id: string, body: ProductProjectionIssue, init?: RequestInit): Promise<ProductProjectionReceipt>;
    /** Read one authorized immutable ProductProjection receipt */
    readProductProjection(id: string, receiptId: string, query: {
        "response_byte_limit": number;
        "time_budget_ms": number;
    }, init?: RequestInit): Promise<ProductProjectionReceipt>;
    /** Persist a durable resource-link migration manifest before any authority write */
    planProjectResourceLinkMigration(id: string, body: ProjectResourceLinkMigrationPlanRequest, init?: RequestInit): Promise<ProjectResourceLinkMigrationResult>;
    /** Read one durable migration manifest and its complete immutable event history */
    readProjectResourceLinkMigration(id: string, manifestId: string, query: {
        "max_items": number;
        "response_byte_limit": number;
        "time_budget_ms": number;
    }, init?: RequestInit): Promise<ProjectResourceLinkMigrationResult>;
    /** CAS-advance a manifest after reconciling exact producer or Projects evidence */
    advanceProjectResourceLinkMigration(id: string, manifestId: string, body: ProjectResourceLinkMigrationAdvanceRequest, init?: RequestInit): Promise<ProjectResourceLinkMigrationResult>;
    /** Remove Projects references first, persist proof, then record producer rollback outcome */
    rollbackProjectResourceLinkMigration(id: string, manifestId: string, body: ProjectResourceLinkMigrationRollbackRequest, init?: RequestInit): Promise<ProjectResourceLinkMigrationResult>;
    /** Read the complete typed project resource-link collection under explicit bounds */
    readProjectResourceLinks(id: string, query: {
        "max_items": number;
        "response_byte_limit": number;
        "time_budget_ms": number;
    }, init?: RequestInit): Promise<ProjectResourceLinkRead>;
    /** Idempotently add typed resource links under a project revision CAS */
    addProjectResourceLinks(id: string, body: ProjectResourceLinkMutationRequest, init?: RequestInit): Promise<ProjectResourceLinkMutationResult>;
    /** Reconcile the complete typed resource-link collection under a project revision CAS */
    reconcileProjectResourceLinks(id: string, body: ProjectResourceLinkMutationRequest, init?: RequestInit): Promise<ProjectResourceLinkMutationResult>;
    /** Restore the exact pre-mutation typed resource-link collection from an accepted receipt */
    rollbackProjectResourceLinks(id: string, body: ProjectResourceLinkRollbackRequest, init?: RequestInit): Promise<ProjectResourceLinkMutationResult>;
    /** Unarchive a project */
    unarchiveProject(id: string, init?: RequestInit): Promise<Workspace>;
    /** List recipes */
    listRecipes(init?: RequestInit): Promise<RecipeList>;
    /** Create a recipe */
    createRecipe(body: CreateRecipe, init?: RequestInit): Promise<Recipe>;
    /** Get a recipe by id or slug */
    getRecipe(id: string, init?: RequestInit): Promise<Recipe>;
    /** List roots */
    listRoots(init?: RequestInit): Promise<RootList>;
    /** Create a root */
    createRoot(body: CreateRoot, init?: RequestInit): Promise<Root>;
    /** Get a root by id or slug */
    getRoot(id: string, init?: RequestInit): Promise<Root>;
    /** Delete a root */
    deleteRoot(id: string, query?: {
        "detach"?: boolean;
    }, init?: RequestInit): Promise<DeleteResult>;
    /** Update a root */
    updateRoot(id: string, body: UpdateRoot, init?: RequestInit): Promise<Root>;
    /** Service version */
    getVersion(init?: RequestInit): Promise<LegacyVersionResponse>;
}
//# sourceMappingURL=client.d.ts.map