import { type CanonicalValue, type StoreValidationResult, type BossBindingEpoch, type BrokerRevision, type ControllerGeneration, type ParticipantBindingEpoch, type SubscriberBindingEpoch, type WorkerGeneration, type TransitionVersion, type BrokerGeneration, type JournalGeneration, type SchedulerGeneration, type RecipientTransferGeneration, type DeliveryClaimGeneration, type TriggerGeneration, type WatchdogGeneration } from "./canonical.ts"; import { INTERCOM_BASE_PROTOCOL_VERSION } from "./boss-semantic-binding-constants.ts"; export declare const BOSS_RUN_FEATURE: "boss-run-v1"; export declare const BOSS_RUN_FEATURE_VERSION: 1; export declare const BOSS_CONTROL_ENVELOPE_VERSION: 1; /** * This corpus is deliberately separate from remote-access-v1 policy vectors. * Changing it changes only the negotiated Boss feature hash. */ export declare const BOSS_RUN_FEATURE_SEMANTICS_CORPUS: { readonly feature: "boss-run-v1"; readonly version: 1; readonly baseProtocolVersion: 4; readonly controlEnvelopeVersion: 1; readonly bindingAuthority: "broker"; readonly unknownMetadata: "reject"; readonly downgradeToLocalPublic: "forbidden"; readonly participantEpochs: "independent"; readonly bossBindingEpoch: "independent"; readonly crossRunCommunication: "deny"; readonly controllerDeliveryRunIdentity: "embedded_and_top_level_boss_run_id_present_and_equal"; readonly legacyRemoteAccessSemantics: "unchanged"; readonly deliveryClaimReleaseProof: "drained_barrier_bound_to_claim_generation_session_epoch_named_pi_opencode_paths_and_not_before_attempt"; readonly recordReceiptIngress: "persisted_claim_chronology_and_result_invariants"; readonly initialAuthorityBindPriorEpoch: 0; readonly laterAuthorityTransitionPriorEpoch: "positive"; readonly bossPolicySemanticsVersion: 1; readonly bossPolicySemanticsHash: string; readonly featureRoutingVectorVersion: 1; readonly featureRoutingSemanticsHash: string; readonly participantStateVectorSchemaVersion: 1; readonly participantStateVectorsHash: "0da19269f0c2befd9b22b8d146d6bd30450f3f0d64598148fd9317f36a5fc920"; readonly participantStateTransitionVectorSchemaVersion: 1; readonly participantStateTransitionVectorsHash: "143fb362364d0742df565e8a02f778a493007e799c429cec8468f38e6520c86a"; readonly supervisionVectorSchemaVersion: 1; readonly supervisionVectorsHash: "6795156a761aa7fa404c06657e7ca3438a99b1a7e4d2919308379a5448e14b33"; readonly fullWorkerStoreMigrationVectorVersion: 2; readonly fullWorkerStoreMigrationVectorsHash: "dfc3680c3b085a0a7a53266abe309d5710a181b7831d2582998dd38e76dca2bf"; }; export declare const BOSS_RUN_FEATURE_SEMANTICS_HASH: string; export interface BossRunFeatureContract { feature: typeof BOSS_RUN_FEATURE; version: typeof BOSS_RUN_FEATURE_VERSION; baseProtocolVersion: typeof INTERCOM_BASE_PROTOCOL_VERSION; semanticsHash: string; controlEnvelopeVersion: typeof BOSS_CONTROL_ENVELOPE_VERSION; } export declare const BOSS_RUN_FEATURE_CONTRACT: BossRunFeatureContract; /** Hash of the exact protocol negotiation tuple, distinct from policy semantics. */ export declare const BOSS_RUN_PROTOCOL_FEATURE_CONTRACT_HASH: string; export declare const BOSS_CAPABILITY_FEATURE_CONTRACT_VERSION: 1; export declare const BOSS_CAPABILITY_FEATURE_DIGEST: string; export declare function parseBossRunFeatureContract(value: unknown): BossRunFeatureContract; export declare const BOSS_PARTICIPANT_ROLES: readonly ["boss", "manager", "adversary", "scout", "worker", "council"]; export type BossParticipantRole = (typeof BOSS_PARTICIPANT_ROLES)[number]; export declare const BOSS_COMMUNICATION_PROFILES: readonly ["boss", "manager", "adversary", "scout", "worker", "council"]; export type BossCommunicationProfile = BossParticipantRole; export declare const BOSS_RUN_AUTHORITY_IDENTITY_VERSION: "boss.run-authority.v1"; export interface BossRunAuthorityIdentity { version: typeof BOSS_RUN_AUTHORITY_IDENTITY_VERSION; controllerPrincipalId: string; bossRunId: string; controllerGeneration: ControllerGeneration; authorityTransitionRevision: BrokerRevision; activeBossSessionId?: string; bossBindingEpoch: BossBindingEpoch; } export declare function parseBossRunAuthorityIdentity(value: unknown): BossRunAuthorityIdentity; export declare const BOSS_PARTICIPANT_BINDING_VERSION: "boss.participant-binding.v1"; export declare const BOSS_BINDING_STATES: readonly ["active", "revoked", "replaced"]; export type BossBindingState = (typeof BOSS_BINDING_STATES)[number]; export interface BossParticipantBinding { version: typeof BOSS_PARTICIPANT_BINDING_VERSION; bossRunId: string; participantId: string; role: BossParticipantRole; communicationProfile: BossCommunicationProfile; bindingEpoch: ParticipantBindingEpoch; sessionId: string; brokerGeneration: BrokerGeneration; brokerBootInstance: string; state: BossBindingState; assignedManagerParticipantId?: string; authorityTransitionId: string; } export declare function parseBossParticipantBinding(value: unknown): BossParticipantBinding; export declare const BOSS_PARTICIPANT_CREDENTIAL_VERSION: "boss.participant-credential.v1"; export declare const BOSS_CREDENTIAL_KINDS: readonly ["enrollment", "reconnect"]; export type BossCredentialKind = (typeof BOSS_CREDENTIAL_KINDS)[number]; export interface BossParticipantCredentialEnvelope { version: typeof BOSS_PARTICIPANT_CREDENTIAL_VERSION; namespace: typeof BOSS_RUN_FEATURE; credentialKind: BossCredentialKind; credentialId: string; credential: string; bossRunId: string; participantId: string; role: BossParticipantRole; communicationProfile: BossCommunicationProfile; bindingEpoch: ParticipantBindingEpoch; issuedAt: string; expiresAt: string; nonce: string; } export declare function credentialDigest(envelope: BossParticipantCredentialEnvelope): string; export declare function parseBossParticipantCredentialEnvelope(value: unknown): BossParticipantCredentialEnvelope; export declare const BOSS_CREDENTIAL_DIGEST_RECORD_VERSION: "boss.credential-digest.v1"; export declare const BOSS_CREDENTIAL_STATES: readonly ["issued", "consumed", "revoked", "expired"]; export type BossCredentialState = (typeof BOSS_CREDENTIAL_STATES)[number]; export interface BossCredentialDigestRecord { version: typeof BOSS_CREDENTIAL_DIGEST_RECORD_VERSION; namespace: typeof BOSS_RUN_FEATURE; credentialKind: BossCredentialKind; credentialId: string; digest: string; bossRunId: string; participantId: string; role: BossParticipantRole; bindingEpoch: ParticipantBindingEpoch; nonce: string; issuedAt: string; expiresAt: string; state: BossCredentialState; consumedAt?: string; revokedAt?: string; auditEventId: string; } export declare function parseBossCredentialDigestRecord(value: unknown): BossCredentialDigestRecord; export interface BossCredentialUseContext { now: string; credentialKind: BossCredentialKind; bossRunId: string; participantId: string; role: BossParticipantRole; bindingEpoch: ParticipantBindingEpoch; nonce: string; } export type BossCredentialDenialCode = "DIGEST_MISMATCH" | "NOT_YET_VALID" | "EXPIRED" | "ALREADY_CONSUMED" | "REVOKED" | "RUN_SUBSTITUTION" | "PARTICIPANT_SUBSTITUTION" | "ROLE_SUBSTITUTION" | "EPOCH_MISMATCH" | "NONCE_MISMATCH" | "KIND_MISMATCH" | "REGISTRY_MISMATCH"; export type BossCredentialUseDecision = { accepted: true; credentialId: string; auditEventId: string; } | { accepted: false; code: BossCredentialDenialCode; auditEventId: string; }; /** Pure broker-side credential decision. Callers persist consumption and its audit event atomically. */ export declare function authorizeBossCredentialUse(envelopeValue: unknown, recordValue: unknown, contextValue: unknown): BossCredentialUseDecision; export declare const BOSS_CREDENTIAL_AUDIT_EVENT_VERSION: "boss.credential-audit-event.v1"; export declare const BOSS_CREDENTIAL_AUDIT_OPERATIONS: readonly ["issue", "consume", "reconnect", "deny", "revoke", "rotate"]; export interface BossCredentialAuditEvent { version: typeof BOSS_CREDENTIAL_AUDIT_EVENT_VERSION; eventId: string; credentialId: string; credentialKind: BossCredentialKind; bossRunId: string; participantId: string; presentedBindingEpoch: ParticipantBindingEpoch; operation: (typeof BOSS_CREDENTIAL_AUDIT_OPERATIONS)[number]; outcome: "accepted" | BossCredentialDenialCode; nonceDigest: string; authorityTransitionId?: string; occurredAt: string; } export declare function parseBossCredentialAuditEvent(value: unknown): BossCredentialAuditEvent; export declare const AUTHORITY_TRANSITION_VERSION: "boss.authority-transition.v1"; export declare const AUTHORITY_EVENT_VERSION: "boss.authority-event.v1"; export declare const AUTHORITY_REQUEST_VERSION: "boss.authority-request.v1"; export declare const AUTHORITY_TRANSITION_OPERATIONS: readonly ["bind_boss", "rebind_boss", "revoke_boss", "bind_participant", "rebind_participant", "revoke_participant", "replace_participant", "replace_manager", "rebind_subscriber", "controller_takeover", "rotate_credential"]; export type AuthorityTransitionOperation = (typeof AUTHORITY_TRANSITION_OPERATIONS)[number]; export declare const AUTHORITY_TRANSITION_STATES: readonly ["prepared", "committed", "aborted"]; export type AuthorityTransitionState = (typeof AUTHORITY_TRANSITION_STATES)[number]; export declare const AUTHORITY_REQUEST_OPERATIONS: readonly ["prepare", "commit", "abort", "query"]; export type AuthorityRequestOperation = (typeof AUTHORITY_REQUEST_OPERATIONS)[number]; export interface AuthorityTransitionEpochs { controllerGeneration?: ControllerGeneration; bossBindingEpoch?: BossBindingEpoch; participantBindingEpoch?: ParticipantBindingEpoch; subscriberBindingEpoch?: SubscriberBindingEpoch; } export interface AuthorityTransitionTarget { bossRunId?: string; participantId?: string; replacementParticipantId?: string; controllerPrincipalId?: string; credentialId?: string; subscriberPrincipalId?: string; } export interface AuthorityTransitionRecord { version: typeof AUTHORITY_TRANSITION_VERSION; authorityTransitionId: string; expectedBrokerRevision: BrokerRevision; brokerRevision: BrokerRevision; operation: AuthorityTransitionOperation; target: AuthorityTransitionTarget; prior: AuthorityTransitionEpochs; proposed: AuthorityTransitionEpochs; idempotencyKey: string; state: AuthorityTransitionState; prepareToken: string; preparedAt: string; committedAt?: string; abortedAt?: string; abortReason?: string; } export declare function parseAuthorityTransitionRecord(value: unknown): AuthorityTransitionRecord; export interface AuthorityTransitionEvent { version: typeof AUTHORITY_EVENT_VERSION; eventId: string; bossRunId?: string; authorityTransitionId: string; brokerRevision: BrokerRevision; operation: AuthorityTransitionOperation; state: "committed"; target: AuthorityTransitionTarget; prior: AuthorityTransitionEpochs; resulting: AuthorityTransitionEpochs; occurredAt: string; } export declare function parseAuthorityTransitionEvent(value: unknown): AuthorityTransitionEvent; export type AuthorityTransitionRequest = { version: typeof AUTHORITY_REQUEST_VERSION; operation: AuthorityRequestOperation; requestId: string; idempotencyKey: string; authorityTransitionId: string; expectedBrokerRevision: BrokerRevision; payload: { requestedOperation: AuthorityTransitionOperation; target: AuthorityTransitionTarget; prior: AuthorityTransitionEpochs; } | { prepareToken: string; } | { prepareToken: string; reason: string; } | Record; }; /** Authority-socket request contract; broker responses are the persisted record returned at its authoritative revision. */ export declare function parseAuthorityTransitionRequest(value: unknown): AuthorityTransitionRequest; export declare const BOSS_CONTROL_TYPES: readonly ["boss.assignment.created", "boss.assignment.accepted", "boss.assignment.checkpoint", "boss.assignment.submitted", "boss.assignment.rejected", "boss.assignment.cancelled", "boss.staffing.requested", "boss.staffing.resolved", "boss.review.requested", "boss.review.submitted", "boss.council.requested", "boss.council.submitted", "boss.proof.submitted", "boss.worker.health", "boss.worker.blocked", "boss.worker.failed", "boss.worker.notice", "boss.worker.notice_delivery_failed", "boss.decision.required"]; export type BossControlType = (typeof BOSS_CONTROL_TYPES)[number]; export interface BossControlEnvelope { type: BossControlType; version: typeof BOSS_CONTROL_ENVELOPE_VERSION; messageId: string; bossRunId: string; participantId: string; bindingEpoch: ParticipantBindingEpoch; causationId?: string; replyTo?: string; idempotencyKey: string; payload: TPayload; } export declare function parseBossControlEnvelope(value: unknown): BossControlEnvelope; export declare const LIFECYCLE_NOTICE_VERSION: "orc.lifecycle-notice.v1"; export declare const DELIVERY_GROUP_VERSION: "orc.delivery-group.v1"; export declare const DELIVERY_CLAIM_VERSION: "orc.delivery-claim.v1"; export declare const NOTICE_RECIPIENT_INGRESS_VERSION: "orc.notice-recipient-ingress.v1"; export declare const TARGET_LEDGER_RESULT_VERSION: "orc.target-ledger-result.v1"; export declare const DELIVERY_INTENTS: readonly ["wake", "follow_up", "status_only"]; export type DeliveryIntent = (typeof DELIVERY_INTENTS)[number]; export declare const RECIPIENT_CONTEXTS: readonly ["pi", "opencode", "headless_cli"]; export type RecipientContext = (typeof RECIPIENT_CONTEXTS)[number]; export declare const DELIVERY_CLAIM_STATES: readonly ["reserved", "inserting", "inserted", "delivered", "blocked", "released"]; export type DeliveryClaimState = (typeof DELIVERY_CLAIM_STATES)[number]; export declare const NOTICE_DELIVERY_CLAIM_STATES: readonly ["reserved", "inserting", "inserted", "delivered", "blocked"]; export type NoticeDeliveryClaimState = (typeof NOTICE_DELIVERY_CLAIM_STATES)[number]; export declare const DELIVERY_MODES: readonly ["lifecycle_message", "correlated_result"]; export type DeliveryMode = (typeof DELIVERY_MODES)[number]; export declare const DELIVERY_GROUP_MEMBERSHIP_STATES: readonly ["assembling", "sealed"]; export declare const DELIVERY_GROUP_STATES: readonly ["pending", "reserved", "inserting", "inserted", "delivered", "blocked", "migrated"]; export type DeliveryGroupState = (typeof DELIVERY_GROUP_STATES)[number]; export interface LifecycleNoticeLogicalKey { workerId: string; workerGeneration: WorkerGeneration; transitionId: string; transitionVersion: TransitionVersion; kind: string; assignmentId?: string; watchdogGeneration?: WatchdogGeneration; subscriptionId?: string; subscriptionTriggerGeneration?: TriggerGeneration; } export declare function lifecycleNoticeId(key: LifecycleNoticeLogicalKey): string; export interface LifecycleNotice { version: typeof LIFECYCLE_NOTICE_VERSION; noticeId: string; deliveryGroupId: string; deliveryGroupMembershipRevision: number; requestedDeliveryIntent?: DeliveryIntent; sourceEventId: string; transitionId: string; transitionVersion: TransitionVersion; bossRunId?: string; workerId: string; workerIncarnationId: string; assignmentId?: string; turnId?: string; watchdogGeneration?: WatchdogGeneration; subscriptionId?: string; subscriptionTriggerGeneration?: TriggerGeneration; causationId?: string; resultMessageId?: string; recipientSessionId?: string; recipientTargetSessionId?: string; recipientPrincipalId?: string; recipientBindingEpoch?: number; workerGeneration: WorkerGeneration; kind: string; severity: string; observedState: string; reason: string; createdAt: string; deliveryAttemptedAt?: string; deliveryClaimId?: string; deliveryClaimGeneration?: DeliveryClaimGeneration; deliveryClaimExpiresAt?: string; deliveryClaimState?: NoticeDeliveryClaimState; recipientContext: RecipientContext; deliveredAt?: string; deliveryMode?: DeliveryMode; deliveryReceiptId?: string; coalescedByResult?: boolean; acknowledgedAt?: string; } export declare function parseLifecycleNotice(value: unknown): LifecycleNotice; export type SourceAuthorityId = { kind: "worker_store"; workerStoreId: string; journalGeneration: JournalGeneration; } | { kind: "controller"; bossRunId: string; controllerGeneration: ControllerGeneration; } | { kind: "orc_scheduler"; ownerUid: number; schedulerGeneration: SchedulerGeneration; }; export interface DeliveryEquivalenceKey { recipientPrincipalId: string; recipientBindingEpoch: number; sourceAuthorityId: SourceAuthorityId; sourceEventId: string; bossRunId?: string; workerId: string; workerGeneration: WorkerGeneration; transitionId: string; transitionVersion: TransitionVersion; assignmentId?: string; turnId?: string; watchdogGeneration?: WatchdogGeneration; } export declare function deliveryGroupId(key: DeliveryEquivalenceKey): string; export declare function effectiveDeliveryIntent(intents: readonly DeliveryIntent[]): DeliveryIntent; export declare const DELIVERY_GROUP_ASSEMBLY_VERSION: "orc.delivery-group-assembly.v1"; export interface DeliveryGroupAssemblyMember { noticeId: string; requestedDeliveryIntent: DeliveryIntent; } export interface DeliveryGroupAssemblyInput { version: typeof DELIVERY_GROUP_ASSEMBLY_VERSION; equivalenceKey: DeliveryEquivalenceKey; subscriptionRegistryRevision: number; membershipRevision: number; primaryNoticeId: string; members: DeliveryGroupAssemblyMember[]; recipientTransferGeneration: RecipientTransferGeneration; } export declare function mintDeliveryGroupAssemblyMember(value: unknown): DeliveryGroupAssemblyMember; export declare function parseDeliveryGroupAssemblyInput(value: unknown): DeliveryGroupAssemblyInput; export declare function assembleDeliveryGroup(value: unknown): DeliveryGroupRecord; export interface DeliveryGroupRecord { version: typeof DELIVERY_GROUP_VERSION; deliveryGroupId: string; equivalenceKey: DeliveryEquivalenceKey; subscriptionRegistryRevision: number; membershipRevision: number; membershipState: (typeof DELIVERY_GROUP_MEMBERSHIP_STATES)[number]; primaryNoticeId: string; memberNoticeIds: string[]; requestedIntents: DeliveryIntent[]; effectiveDeliveryIntent: DeliveryIntent; operativeActivationConsumedAt?: string; recipientTransferGeneration: RecipientTransferGeneration; supersedesDeliveryGroupId?: string; successorDeliveryGroupId?: string; authorityTransitionId?: string; state: DeliveryGroupState; } export declare function parseDeliveryGroupRecord(value: unknown): DeliveryGroupRecord; export interface DeliveryClaimRecord { version: typeof DELIVERY_CLAIM_VERSION; deliveryClaimId: string; deliveryGroupId: string; membershipRevision: number; effectiveDeliveryIntent: DeliveryIntent; primaryNoticeId: string; memberNoticeIds: string[]; claimGeneration: DeliveryClaimGeneration; expiresAt: string; recipientContext: Exclude; recipientSessionId: string; recipientTargetSessionId?: string; recipientPrincipalId: string; recipientBindingEpoch: number; recipientTransferGeneration: RecipientTransferGeneration; workerId: string; workerGeneration: WorkerGeneration; transitionId: string; transitionVersion: TransitionVersion; assignmentId?: string; turnId?: string; watchdogGeneration?: WatchdogGeneration; ingressMode: DeliveryMode; state: DeliveryClaimState; deliveryAttemptedAt?: string; targetLedgerEntryId?: string; insertedAt?: string; deliveredAt?: string; deliveryReceiptId?: string; resultMessageId?: string; coalescedByResult?: boolean; blockedReason?: string; releaseProof?: DeliveryClaimReleaseProof; releasedAt?: string; } export interface DeliveryClaimReleaseProof { deliveryClaimId: string; claimGeneration: DeliveryClaimGeneration; recipientSessionId: string; recipientTargetSessionId?: string; recipientBindingEpoch: number; barrierId: string; noSessionEntry: true; noAdapterQueue: true; noInflightInvocation: true; noPiFollowUp: true; noOpenCodePendingPrompt: true; establishedAt: string; } export declare function parseDeliveryClaimRecord(value: unknown): DeliveryClaimRecord; export declare const NOTICE_RECIPIENT_INGRESS_OPERATIONS: readonly ["reserve_delivery", "lookup_target_ledger", "insert_or_attach", "record_receipt", "prove_target_drained", "acknowledge"]; export type NoticeRecipientIngressOperation = (typeof NOTICE_RECIPIENT_INGRESS_OPERATIONS)[number]; export type NoticeRecipientIngressEnvelope = { version: typeof NOTICE_RECIPIENT_INGRESS_VERSION; operation: NoticeRecipientIngressOperation; requestId: string; idempotencyKey: string; payload: CanonicalValue; }; export declare function parseNoticeRecipientIngressEnvelope(value: unknown): NoticeRecipientIngressEnvelope; export declare const TARGET_LEDGER_STATES: readonly ["absent", "inserting", "inserted", "ambiguous"]; export interface TargetLedgerLookupResult { version: typeof TARGET_LEDGER_RESULT_VERSION; deliveryClaimId: string; claimGeneration: DeliveryClaimGeneration; state: (typeof TARGET_LEDGER_STATES)[number]; checkedAt: string; targetLedgerEntryId?: string; insertedAt?: string; } export declare function parseTargetLedgerLookupResult(value: unknown): TargetLedgerLookupResult; export declare const validateBossParticipantBindingStore: (value: unknown) => StoreValidationResult; export declare const validateBossCredentialDigestStore: (value: unknown) => StoreValidationResult; export declare const validateAuthorityTransitionStore: (value: unknown) => StoreValidationResult; export declare const validateAuthorityEventStore: (value: unknown) => StoreValidationResult; export declare const validateLifecycleNoticeStore: (value: unknown) => StoreValidationResult; export declare const validateDeliveryGroupStore: (value: unknown) => StoreValidationResult; export declare const validateDeliveryClaimStore: (value: unknown) => StoreValidationResult; export declare const validateTargetLedgerStore: (value: unknown) => StoreValidationResult; export declare function parseDeliveryEquivalenceKey(value: unknown, path?: string): DeliveryEquivalenceKey; //# sourceMappingURL=boss-wire.d.ts.map