import { type HermesCustomerTokenInput } from "./hermesCustomerToken.js"; import { type SetupHermesOnboardingAgentInput } from "./hermesOnboardingAgent.js"; import { type HermesAdminPackageCandidates, type SetupHermesAdminAgentInput } from "./hermesAdminAgent.js"; declare const INTERNAL_ONBOARDING_SCHEMA_VERSION = "hermes-internal-onboarding-intent-v1"; declare const INTERNAL_ONBOARDING_BOOTSTRAP_SCHEMA_VERSION = "hermes-internal-onboarding-bootstrap-v1"; type LifecycleAction = "authorize" | "preflight" | "status" | "composition" | "token" | "internal_onboarding_agent"; type CompositionMode = "plan" | "apply" | "resume" | "status" | "verify" | "restart" | "rebuild" | "rollback" | "disable"; type TokenMode = "mint" | "status" | "revoke"; type HermesProfileKind = "customer" | "admin"; export interface HermesOnboardingLifecycleInput { action: LifecycleAction; profileKind?: HermesProfileKind; lifecycleId?: string; customerSlug?: string; profileSlug?: string; company?: string; authorizedBy?: string; authorizationEventRef?: string; invitePolicy?: "no_customer_invites" | "invite_after_verification"; teamId?: string; allowedSlackUserIds?: string[]; /** Physical Hermes profile identity for Customer authorization/composition or the internal onboarding actor. */ profileId?: string; ownerSlackUserId?: string; internalChannelName?: string; appId?: string; expectedBotId?: string; manifestSha256?: string; model?: string; mode?: CompositionMode | TokenMode; workspaceId?: string; channelId?: string; primaryChannelName?: string; secondaryReadChannelIds?: string[]; canonicalAdminConfigPath?: string; canonicalAdminStatePath?: string; sellableTokenFile?: string; evidenceTarget?: string; profilesRoot?: string; packageCandidates?: SetupHermesOnboardingAgentInput["packageCandidates"] | HermesAdminPackageCandidates; surfaces?: SetupHermesOnboardingAgentInput["surfaces"]; responsePolicy?: SetupHermesOnboardingAgentInput["responsePolicy"]; approvedRoutingMigration?: boolean; disableReason?: string; liveVerification?: Record; authoritativeAbsenceClosure?: { receiptFile: string; receiptSha256: string; }; uatFailureControl?: { schemaVersion: "hermes-admin-uat-control-v1"; runId: string; action: "authorize" | "inject" | "resume" | "cleanup-only"; scenario?: "browser_session_uncertain_create" | "channel_uncertain_create"; controlHash: string; }; } interface LifecycleOptions { /** Test-only dependency injection. */ adminHome?: string; setupImpl?: (input: SetupHermesOnboardingAgentInput) => Promise>; adminSetupImpl?: (input: SetupHermesAdminAgentInput) => Promise>; tokenImpl?: (input: HermesCustomerTokenInput) => Promise>; now?: () => string; /** Test seam for current remote absence readback; production still rechecks local owned paths. */ authoritativeAbsenceRecheck?: (input: { lifecycleId: string; lifecycleRunId: string; profileSlug: string; }) => Promise>; /** Test seam and package bridge for the channel-independent Plan 01 actor receipt. */ internalOnboardingBootstrapImpl?: (input: InternalOnboardingBootstrapInput) => Promise | InternalOnboardingBootstrapReceipt; } export interface InternalOnboardingIntentRecord { schemaVersion: typeof INTERNAL_ONBOARDING_SCHEMA_VERSION; profileId: string; workspaceId: string; teamId: string; ownerSlackUserId: string; allowedSlackUserIds: string[]; internalChannelName: string; noCustomerInvites: true; appId: string; expectedBotId: string; manifestSha256: string; bootstrap: { configFingerprint: string; configPath: string; configMode: "0600"; receiptPath: string; receiptMode: "0600"; installationState: "pending_installation"; }; stagedAt: string; } export interface InternalOnboardingBootstrapInput { artifactRoot: string; lifecycleId: string; customerSlug: string; profileId: string; workspaceId: string; teamId: string; ownerSlackUserId: string; allowedSlackUserIds: string[]; internalChannelName: string; appId: string; expectedBotId: string; manifestSha256: string; } export interface InternalOnboardingBootstrapReceipt { schemaVersion: typeof INTERNAL_ONBOARDING_BOOTSTRAP_SCHEMA_VERSION; lifecycleId: string; teamId: string; expectedBotId: string; appId: string; manifestSha256: string; configFingerprint: string; configPath: string; configMode: "0600"; receiptPath: string; receiptMode: "0600"; installationState: "pending_installation"; sideEffects: { channelCreateCalls: 0; channelInviteCalls: 0; channelMessageCalls: 0; profileActivationCalls: 0; }; } interface InternalOnboardingStageBinding { profileId: string; workspaceId: string; teamId: string; internalChannelId: string; expectedBotId: string; ownerSlackUserId: string; allowedSlackUserIds: readonly string[]; bindingRevision: number; bindingHash: string; } interface InternalOnboardingStageMembershipProof { schemaVersion: "hermes-internal-onboarding-membership-proof-v1"; lifecycleId: string; profileId: string; workspaceId: string; teamId: string; internalChannelId: string; expectedBotId: string; bindingHash: string; memberIds: string[]; membershipHash: string; } interface InternalOnboardingStageProfile { profileId: string; workspaceId: string; teamId: string; internalChannelId: string; expectedBotId: string; bindingHash: string; membershipHash: string; hermes_host: "pending"; } export interface InternalOnboardingStageInput { adminHome: string; lifecycleId: string; action: "onboarding_started" | "launch_call_handoff"; binding: InternalOnboardingStageBinding; membershipProof: InternalOnboardingStageMembershipProof; profile: InternalOnboardingStageProfile; } export interface InternalOnboardingDialogueHandoffProof { schemaVersion: "hermes-onboarding-dialogue-handoff-proof-v1"; effectId: string; channelId: string; threadTs: string; replyTs: string; handoffTs: string; handoffUserId: string; observedAt: string; verifierId: string; bindingHash: string; generationHash: string | null; } export declare const hermesOnboardingLifecycleToolDefinitions: { name: string; description: string; inputSchema: { type: "object"; additionalProperties: boolean; properties: { action: { type: string; enum: string[]; }; profileKind: { type: string; enum: string[]; default: string; }; lifecycleId: { type: string; pattern: string; }; customerSlug: { type: string; pattern: string; }; profileSlug: { type: string; pattern: string; }; company: { type: string; }; authorizedBy: { type: string; enum: string[]; }; authorizationEventRef: { type: string; description: string; }; invitePolicy: { type: string; enum: string[]; }; teamId: { type: string; }; allowedSlackUserIds: { type: string; items: { type: string; }; minItems: number; }; profileId: { type: string; pattern: string; description: string; }; ownerSlackUserId: { type: string; description: string; }; internalChannelName: { type: string; description: string; }; appId: { type: string; description: string; }; expectedBotId: { type: string; description: string; }; manifestSha256: { type: string; pattern: string; }; model: { type: string; default: string; }; mode: { type: string; enum: string[]; }; workspaceId: { type: string; }; channelId: { type: string; }; primaryChannelName: { type: string; }; secondaryReadChannelIds: { type: string; items: { type: string; }; default: never[]; }; canonicalAdminConfigPath: { type: string; }; canonicalAdminStatePath: { type: string; }; sellableTokenFile: { type: string; description: string; }; evidenceTarget: { type: string; }; profilesRoot: { type: string; default: string; }; packageCandidates: { type: string; additionalProperties: boolean; description: string; properties: { sellableInstall: { type: string; additionalProperties: boolean; properties: { package: { type: string; }; sha256: { type: string; pattern: string; }; }; required: string[]; }; sellableMcp: { type: string; additionalProperties: boolean; properties: { package: { type: string; }; sha256: { type: string; pattern: string; }; }; required: string[]; }; adminMcp: { type: string; additionalProperties: boolean; properties: { package: { type: string; }; sha256: { type: string; pattern: string; }; }; required: string[]; }; adminInstall: { type: string; additionalProperties: boolean; properties: { package: { type: string; }; sha256: { type: string; pattern: string; }; }; required: string[]; }; adminInstallSha: { type: string; pattern: string; }; }; oneOf: { required: string[]; }[]; }; surfaces: { type: string; minItems: number; items: { type: string; additionalProperties: boolean; properties: { surface: { type: string; }; channelId: { type: string[]; }; slashCommand: { type: string; }; }; required: string[]; }; }; responsePolicy: { type: string; additionalProperties: boolean; description: string; properties: { mentionGated: { type: string; }; sameThread: { type: string; }; scheduledOnboardingChecks: { type: string; }; }; required: string[]; }; approvedRoutingMigration: { type: string; }; disableReason: { type: string; }; authoritativeAbsenceClosure: { type: string; additionalProperties: boolean; description: string; properties: { receiptFile: { type: string; }; receiptSha256: { type: string; pattern: string; }; }; required: string[]; }; liveVerification: { type: string; additionalProperties: boolean; description: string; properties: { teamId: { type: string; }; channelId: { type: string; }; workspaceId: { type: string; }; appId: { type: string; }; manifestSha256: { type: string; pattern: string; }; browserbaseSessionCount: { type: string; const: number; }; userActionRequired: { type: string; const: boolean; }; allowedMention: { type: string; additionalProperties: boolean; properties: { replied: { type: string; const: boolean; }; sameThread: { type: string; const: boolean; }; latencySeconds: { type: string; minimum: number; maximum: number; }; }; required: string[]; }; negativeBoundaries: { type: string; additionalProperties: boolean; properties: { unrelatedChannelSilent: { type: string; const: boolean; }; disallowedUserSilent: { type: string; const: boolean; }; botAuthoredSilent: { type: string; const: boolean; }; adminSiblingInjectionSilent: { type: string; const: boolean; }; }; required: string[]; }; managedRestart: { type: string; additionalProperties: boolean; properties: { performed: { type: string; const: boolean; }; beforePid: { type: string; minimum: number; }; afterPid: { type: string; minimum: number; }; ownerCount: { type: string; const: number; }; reply: { type: string; additionalProperties: boolean; properties: { replied: { type: string; const: boolean; }; sameThread: { type: string; const: boolean; }; latencySeconds: { type: string; minimum: number; maximum: number; }; }; required: string[]; }; }; required: string[]; }; customerMcp: { type: string; additionalProperties: boolean; properties: { startupSeconds: { type: string; minimum: number; }; toolCount: { type: string; minimum: number; }; workspaceId: { type: string; }; visibleWorkspaceCount: { type: string; const: number; }; adminMcpPresent: { type: string; const: boolean; }; siblingInventoryFetched: { type: string; const: boolean; }; }; required: string[]; }; gatewayOwnerCount: { type: string; const: number; }; redactionFindings: { type: string; const: number; }; }; required: string[]; }; uatFailureControl: { type: string; additionalProperties: boolean; description: string; properties: { schemaVersion: { type: string; const: string; }; runId: { type: string; pattern: string; }; action: { type: string; enum: string[]; }; scenario: { type: string; enum: string[]; }; controlHash: { type: string; pattern: string; }; }; required: string[]; }; }; required: string[]; }; }[]; export declare function internalOnboardingLifecycleArtifactPaths(adminHome: string, lifecycleId: string): { artifactRoot: string; bootstrapConfigFile: string; bootstrapReceiptFile: string; bindingFile: string; stageReceiptFile: string; }; /** * Persists the only finite Plan 03 lifecycle. It does not call Slack, start a * gateway, schedule work, or infer host proof: locally generated receipts are * deliberately pinned to `hermes_host: pending`. */ export declare function advanceInternalOnboardingStage(input: InternalOnboardingStageInput): Record; /** * Applies the independently observed Phase 04 handoff without granting any * routing or Slack authority. The caller must supply the exact active binding * hash and a fresh same-thread proof; terminal replay is rejected. */ export declare function completeInternalOnboardingDialogueHandoff(input: { adminHome: string; lifecycleId: string; bindingHash: string; proof: InternalOnboardingDialogueHandoffProof; }): Record; export declare function readInternalOnboardingIntent(adminHome: string, lifecycleId: string): InternalOnboardingIntentRecord; export declare function readInternalOnboardingBootstrapReceipt(adminHome: string, lifecycleId: string): InternalOnboardingBootstrapReceipt; export declare function adminHermesOnboardingLifecycle(input: HermesOnboardingLifecycleInput, options?: LifecycleOptions): Promise>; export {};