import type { GovernanceAttachmentBrokerControllerSnapshot } from './attachment-broker-controller.js'; import type { GovernanceCapabilityGrant, GovernanceServiceCredential } from './capability-grant.js'; import { type AppendGovernanceObservationResult, type GovernanceCommandExecution, type GovernanceCommandReceipt, type GovernanceEventStore, type StoredGovernanceObservation } from './event-store.js'; import { type GovernanceEvidenceCandidateLedgerEntry } from './evidence-candidate.js'; import { GOVERNANCE_SERVICE_PROTOCOL_VERSION, type GovernanceServiceClientContext, type GovernanceServiceRequest } from './service-protocol.js'; import type { GovernanceCommand, GovernanceDecisionContext, GovernanceEvent, TaskAggregate } from './task-aggregate.js'; import type { RecordWorkspaceSnapshotResult } from './workspace-snapshot-fence.js'; export type { GovernanceServiceCapability, GovernanceServiceClientContext, GovernanceServiceRequest, } from './service-protocol.js'; export { GOVERNANCE_SERVICE_CAPABILITIES, GOVERNANCE_SERVICE_PROTOCOL_VERSION, } from './service-protocol.js'; type GovernanceServiceResult = { readonly type: 'health'; readonly projectId: string; readonly protocolVersion: typeof GOVERNANCE_SERVICE_PROTOCOL_VERSION; readonly status: 'ready'; } | { readonly type: 'task'; readonly task: TaskAggregate | null; } | { readonly type: 'events'; readonly events: readonly GovernanceEvent[]; } | { readonly type: 'receipt'; readonly receipt: GovernanceCommandReceipt | null; } | { readonly type: 'observations'; readonly observations: readonly StoredGovernanceObservation[]; readonly nextAfterSequence: number | null; } | { readonly type: 'evidence_candidates'; readonly taskId: string; readonly candidates: readonly GovernanceEvidenceCandidateLedgerEntry[]; readonly nextAfterSequence: number | null; } | { readonly type: 'command_result'; readonly execution: GovernanceCommandExecution; } | { readonly type: 'observation_result'; readonly result: AppendGovernanceObservationResult; } | { readonly type: 'workspace_snapshot_recorded'; readonly result: RecordWorkspaceSnapshotResult; } | { readonly type: 'capability_grant_issued'; readonly grant: GovernanceCapabilityGrant; readonly credential: GovernanceServiceCredential; } | { readonly type: 'runtime_attachment_claimed'; readonly control: { readonly grant: GovernanceCapabilityGrant; readonly credential: GovernanceServiceCredential; }; readonly model: { readonly grant: GovernanceCapabilityGrant; readonly credential: GovernanceServiceCredential; }; } | { readonly type: 'runtime_attachment_released'; readonly controlGrantId: string; readonly modelGrantId: string; } | { readonly type: 'own_capability_grant'; readonly grant: GovernanceCapabilityGrant; } | { readonly type: 'daemon_status'; readonly projectId: string; readonly pid: number; readonly instanceId: string; readonly startedAt: string; readonly attachmentBroker?: GovernanceAttachmentBrokerControllerSnapshot | undefined; } | { readonly type: 'daemon_shutdown_accepted'; readonly instanceId: string; readonly requestedBy: string; readonly reason: string; } | { readonly type: 'capability_grants'; readonly grants: readonly GovernanceCapabilityGrant[]; readonly nextCursor?: string | undefined; } | { readonly type: 'capability_grant_revoked'; readonly grantId: string; readonly revoked: boolean; } | { readonly type: 'capability_grant_rotated'; readonly previousGrantId: string; readonly grant: GovernanceCapabilityGrant; readonly credential: GovernanceServiceCredential; }; type GovernanceServiceErrorCode = 'unsupported_protocol' | 'invalid_request' | 'authentication_failed' | 'permission_denied' | 'identity_mismatch' | 'project_mismatch' | 'store_failure' | 'request_in_progress'; export type GovernanceServiceResponse = { readonly ok: true; readonly requestId: string; readonly result: GovernanceServiceResult; } | { readonly ok: false; readonly requestId: string; readonly error: { readonly code: GovernanceServiceErrorCode; readonly message: string; readonly details?: readonly { readonly code: string; readonly path: string; readonly message: string; }[] | undefined; }; }; export type GovernanceDecisionContextProvider = (command: GovernanceCommand) => GovernanceDecisionContext; export declare class GovernanceProjectService { readonly projectId: string; private readonly store; /** Trusted policy adapter owned by the future daemon, never selected by request payloads. */ private readonly resolveDecisionContext; constructor(projectId: string, store: GovernanceEventStore, /** Trusted policy adapter owned by the future daemon, never selected by request payloads. */ resolveDecisionContext?: GovernanceDecisionContextProvider); handleUnknown(input: unknown, client: GovernanceServiceClientContext): GovernanceServiceResponse; handle(request: GovernanceServiceRequest, client: GovernanceServiceClientContext): GovernanceServiceResponse; close(): void; private handleAuthorized; /** * Shared body for both observation reads. Fetches one row past the page so * the presence of a further page is known without a second query — the same * convention `read_evidence_candidates` uses. */ private observationPage; private commandBelongsToProject; } //# sourceMappingURL=project-service.d.ts.map