@bendyline/gezel 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,3217 @@
1
+ import { R as Rect, V as VillageAnchor, a as VillageOverride, M as MapDistrict, b as MapStreet, c as MapPlaza, d as MapBuilding, C as CompassRegion, F as FileContextResponse, S as ScriptInputField, e as ScriptOutputField, f as ScriptMeta, G as GezelConfig, g as SecurityPolicy, P as Project, h as ModelFitnessRecord, i as GateScriptRef, j as ModelTier, D as DeliverableKindSchema, A as AdvanceWhen, k as GateCheck, l as StepGate, m as CraftbookStep, n as StepDeliverable, N as NewCraftbookStep, T as ToolsetRuntime, o as Craftbook, O as Outcome, p as Task } from './index-D_dch9Qh.js';
2
+ export { q as AcceptGrowthProposalRequest, r as AcceptGrowthProposalRequestSchema, s as ActiveImagePull, t as ActiveImagePullSchema, u as ActiveVideoPull, v as ActiveVideoPullSchema, w as AdoptedTraitRecord, x as AdoptedTraitRecordSchema, y as AdvanceWhenSchema, z as AnswerQuestionRequest, B as AnswerQuestionRequestSchema, E as AppendTaskNoteRequest, H as AppendTaskNoteRequestSchema, I as AppendTaskNoteResponse, J as AppendTaskNoteResponseSchema, K as AppliedProjectType, L as AppliedProjectTypeSchema, Q as ApplyPatchToProjectWorkspaceFileRequest, U as ApplyPatchToProjectWorkspaceFileRequestSchema, W as ApplyProjectTypeRequest, X as ApplyProjectTypeRequestSchema, Y as ArchiveEntry, Z as ArchiveEntrySchema, _ as ArchiveExtractRequest, $ as ArchiveExtractRequestSchema, a0 as ArchiveExtractResponse, a1 as ArchiveExtractResponseSchema, a2 as ArchiveListRequest, a3 as ArchiveListRequestSchema, a4 as ArchiveListResponse, a5 as ArchiveListResponseSchema, a6 as ArgSpec, a7 as ArgSpecSchema, a8 as AskQuestionRequest, a9 as AskQuestionRequestSchema, aa as AskQuestionResponse, ab as AskQuestionResponseSchema, ac as AudioCatalogModel, ad as AudioCatalogModelSchema, ae as AudioEngineHealth, af as AudioEngineHealthSchema, ag as AudioEngineStatusResponse, ah as AudioEngineStatusResponseSchema, ai as AudioModelPullEvent, aj as AudioModelPullEventSchema, ak as AudioSynthesizeMeta, al as AudioSynthesizeMetaSchema, am as AudioSynthesizeRequest, an as AudioSynthesizeRequestSchema, ao as AudioSynthesizeResponse, ap as AudioSynthesizeResponseSchema, aq as AudioTranscribeRequest, ar as AudioTranscribeRequestSchema, as as AudioTranscribeResponse, at as AudioTranscribeResponseSchema, au as AudioTranscribeSegment, av as AudioTranscribeSegmentSchema, aw as AudioVoice, ax as AudioVoiceSchema, ay as BehaviorEntry, az as BehaviorEntrySchema, aA as BehaviorId, aB as BehaviorIdSchema, aC as BinaryDocumentCheck, aD as BinaryDocumentCheckSchema, aE as CANONICAL_PROFILES, aF as CRAFTBOOK_ROLE_META, aG as CRAFTBOOK_SCRIPTS_MAX_COUNT, aH as CRAFTBOOK_SCRIPTS_TOTAL_MAX_BYTES, aI as CRAFTBOOK_SCRIPT_MAX_BYTES, aJ as CRAFTBOOK_TEST_FILENAME, aK as CRAFTBOOK_TEST_SCHEMA_VERSION, aL as CancelCodeReviewResponse, aM as CancelCodeReviewResponseSchema, aN as CatalogItemDetail, aO as CatalogItemDetailSchema, aP as CatalogItemIdentity, aQ as CatalogItemIdentitySchema, aR as CatalogItemManifest, aS as CatalogItemManifestSchema, aT as CatalogItemSummary, aU as CatalogItemSummarySchema, aV as CatalogItemVersionInfo, aW as CatalogItemVersionInfoSchema, aX as CatalogKind, aY as CatalogKindSchema, aZ as ChannelName, a_ as ChannelNameSchema, a$ as ChannelStatus, b0 as ChannelStatusSchema, b1 as ChannelsConfig, b2 as ChannelsConfigSchema, b3 as ChatHistoryResponse, b4 as ChatHistoryResponseSchema, b5 as ChatModelCategory, b6 as ChatModelCategorySchema, b7 as ChatModelDs4Source, b8 as ChatModelDs4SourceSchema, b9 as ChatModelIdentity, ba as ChatModelIdentitySchema, bb as ChatModelLlamaCppSource, bc as ChatModelLlamaCppSourceSchema, bd as ChatModelManifest, be as ChatModelManifestSchema, bf as ChatModelMlxSource, bg as ChatModelMlxSourceSchema, bh as ChatModelOllamaSource, bi as ChatModelOllamaSourceSchema, bj as ChatModelTuning, bk as ChatModelTuningBase, bl as ChatModelTuningBaseSchema, bm as ChatModelTuningSchema, bn as ChatModelVersionManifest, bo as ChatModelVersionManifestSchema, bp as ChatSession, bq as ChatSessionSchema, br as ChatSessionSummary, bs as ChatSessionSummarySchema, bt as CodeReview, bu as CodeReviewKind, bv as CodeReviewKindSchema, bw as CodeReviewManifest, bx as CodeReviewManifestSchema, by as CodeReviewRecord, bz as CodeReviewRecordSchema, bA as CodeReviewResponse, bB as CodeReviewResponseSchema, bC as CodeReviewSchema, bD as CodeReviewStatus, bE as CodeReviewStatusSchema, bF as CodeSymbol, bG as CodeSymbolSchema, bH as CodexPermissionMode, bI as CodexPermissionModeCompat, bJ as CodexPermissionModeCompatSchema, bK as CodexPermissionModeSchema, bL as CodexSetupModelOption, bM as CodexSetupModelOptionSchema, bN as CodexSetupState, bO as CodexSetupStateSchema, bP as CodexSetupStatusResponse, bQ as CodexSetupStatusResponseSchema, bR as CommandApprovalIntent, bS as CommandApprovalIntentSchema, bT as CommandApprovalScope, bU as CommandApprovalScopeSchema, bV as CommandShape, bW as CommandShapeSchema, bX as CompassRegionSchema, bY as CompleteStepGateInfo, bZ as CompleteStepGateInfoSchema, b_ as CompleteStepRequest, b$ as CompleteStepRequestSchema, c0 as CompleteStepResponse, c1 as CompleteStepResponseSchema, c2 as ConfigureCodexRequest, c3 as ConfigureCodexRequestSchema, c4 as ConnectorTypeIdentity, c5 as ConnectorTypeIdentitySchema, c6 as ConnectorTypeManifest, c7 as ConnectorTypeManifestSchema, c8 as ConnectorTypeVersionManifest, c9 as ConnectorTypeVersionManifestSchema, ca as CopilotAvailability, cb as CopilotAvailabilitySchema, cc as CopilotLoginEvent, cd as CopilotLoginEventSchema, ce as CopyArtifactToWorkspaceRequest, cf as CopyArtifactToWorkspaceRequestSchema, cg as CopyArtifactToWorkspaceResponse, ch as CopyArtifactToWorkspaceResponseSchema, ci as CosmeticProposal, cj as CosmeticProposalSchema, ck as CraftbookBasedOn, cl as CraftbookBasedOnSchema, cm as CraftbookBranch, cn as CraftbookBranchSchema, co as CraftbookConnectorNeed, cp as CraftbookConnectorNeedSchema, cq as CraftbookRequirement, cr as CraftbookRequirementContext, cs as CraftbookRequirementSchema, ct as CraftbookResponse, cu as CraftbookResponseSchema, cv as CraftbookRole, cw as CraftbookRoleSchema, cx as CraftbookRunModes, cy as CraftbookRunModesSchema, cz as CraftbookSchema, cA as CraftbookScripts, cB as CraftbookScriptsSchema, cC as CraftbookSpawn, cD as CraftbookSpawnSchema, cE as CraftbookStepSchema, cF as CraftbookSuggestion, cG as CraftbookSuggestionSchema, cH as CraftbookSummary, cI as CraftbookSummarySchema, cJ as CraftbookTemplateIdentity, cK as CraftbookTemplateIdentitySchema, cL as CraftbookTemplateManifest, cM as CraftbookTemplateManifestSchema, cN as CraftbookTemplateVersionManifest, cO as CraftbookTemplateVersionManifestSchema, cP as CraftbookTestCheck, cQ as CraftbookTestCheckSchema, cR as CraftbookTestDeliverable, cS as CraftbookTestDeliverableSchema, cT as CraftbookTestFixtureFile, cU as CraftbookTestFixtureFileSchema, cV as CraftbookTestHistoryExpectation, cW as CraftbookTestHistoryExpectationSchema, cX as CraftbookTestMockExpectation, cY as CraftbookTestMockExpectationSchema, cZ as CraftbookTestRubric, c_ as CraftbookTestRubricSchema, c$ as CraftbookTestSetup, d0 as CraftbookTestSetupSchema, d1 as CraftbookTestSpec, d2 as CraftbookTestSpecSchema, d3 as CraftbookTestSuccess, d4 as CraftbookTestSuccessSchema, d5 as CraftbookTestWorker, d6 as CraftbookTestWorkerSchema, d7 as CraftbookToolsetNeed, d8 as CraftbookToolsetNeedSchema, d9 as CreateChatSessionRequest, da as CreateChatSessionRequestSchema, db as CreateCraftbookRequest, dc as CreateCraftbookRequestSchema, dd as CreateDocumentFolderRequest, de as CreateDocumentFolderRequestSchema, df as CreateGezelRequest, dg as CreateGezelRequestSchema, dh as CreatePreviewCapabilityRequest, di as CreatePreviewCapabilityRequestSchema, dj as CreatePreviewCapabilityResponse, dk as CreatePreviewCapabilityResponseSchema, dl as CreateProjectRequest, dm as CreateProjectRequestSchema, dn as CreateScriptRequest, dp as CreateScriptRequestSchema, dq as CreateScriptResponse, dr as CreateScriptResponseSchema, ds as CreateTaskRequest, dt as CreateTaskRequestSchema, du as CreateTypedProjectRequest, dv as CreateTypedProjectRequestSchema, dw as CreateTypedProjectResponse, dx as CreateTypedProjectResponseSchema, dy as CredentialCapabilitySchema, dz as CustomMcpImportWarning, dA as CustomMcpImportWarningSchema, dB as DEFAULT_LOCAL_ENGINE_IDLE_TIMEOUT_MS, dC as DEFAULT_TUNING_PROFILE_ID, dD as DeclineGrowthLevelUpRequest, dE as DeclineGrowthLevelUpRequestSchema, dF as DeclinedProposalRecord, dG as DeclinedProposalRecordSchema, dH as DelegateSecurityFindingRequest, dI as DelegateSecurityFindingRequestSchema, dJ as DelegateSecurityFindingResponse, dK as DelegateSecurityFindingResponseSchema, dL as DescribeFolderRequest, dM as DescribeFolderRequestSchema, dN as DescribeFolderResponse, dO as DescribeFolderResponseSchema, dP as DeviceSafetyPolicyConfig, dQ as DeviceSafetyPolicySchema, dR as DiffFilesRequest, dS as DiffFilesRequestSchema, dT as DiffFilesResponse, dU as DiffFilesResponseSchema, dV as DisableSuggestedWorkRequest, dW as DisableSuggestedWorkRequestSchema, dX as DiscoveredCommand, dY as DiscoveredCommandSchema, dZ as DiscoveredInstruction, d_ as DiscoveredInstructionSchema, d$ as DiscoveredSkill, e0 as DiscoveredSkillSchema, e1 as DismissSuggestedWorkRequest, e2 as DismissSuggestedWorkRequestSchema, e3 as DocumentExportOptions, e4 as DocumentExportOptionsSchema, e5 as DocumentMediaExportRequest, e6 as DocumentMediaExportRequestSchema, e7 as DocumentMediaExportSource, e8 as DocumentMediaExportSourceSchema, e9 as DocumentSearchResult, ea as DocumentSearchResultSchema, eb as DraftScriptRequest, ec as DraftScriptRequestSchema, ed as DraftScriptResponse, ee as DraftScriptResponseSchema, ef as DriveIndexEnrichmentRequest, eg as DriveIndexEnrichmentRequestSchema, eh as DriveIndexEnrichmentResponse, ei as DriveIndexEnrichmentResponseSchema, ej as DrySamplerConfig, ek as DrySamplerSchema, el as EnableSuggestedWorkRequest, em as EnableSuggestedWorkRequestSchema, en as EngineConfig, eo as EngineConfigSchema, ep as EnsureGezelRequest, eq as EnsureGezelRequestSchema, er as EnsureGezelResponse, es as EnsureGezelResponseSchema, et as Entity, eu as EntitySchema, ev as ErrorResponse, ew as ErrorResponseSchema, ex as EvalHints, ey as EvalHintsSchema, ez as ExpectedDeliverable, eA as ExpectedDeliverableSchema, eB as ExternalFolders, eC as ExternalFoldersSchema, eD as FetchDiffRequest, eE as FetchDiffRequestSchema, eF as FetchDiffResponse, eG as FetchDiffResponseSchema, eH as FetchRepoRequest, eI as FetchRepoRequestSchema, eJ as FetchRepoResponse, eK as FetchRepoResponseSchema, eL as FetchUrlRequest, eM as FetchUrlRequestSchema, eN as FetchUrlResponse, eO as FetchUrlResponseSchema, eP as FileContextFinding, eQ as FileContextFindingSchema, eR as FileContextImporter, eS as FileContextImporterSchema, eT as FileContextRequest, eU as FileContextRequestSchema, eV as FileContextResponseSchema, eW as FileMapRequest, eX as FileMapRequestSchema, eY as FileMapResponse, eZ as FileMapResponseSchema, e_ as FileMapScope, e$ as FileMapScopeSchema, f0 as FileReviewIssue, f1 as FileReviewIssueSchema, f2 as FileReviewIssueSeverity, f3 as FileReviewIssueSeveritySchema, f4 as FileReviewReply, f5 as FileReviewReplySchema, f6 as FileReviewRequest, f7 as FileReviewRequestSchema, f8 as FileReviewResponse, f9 as FileReviewResponseSchema, fa as FileReviewWire, fb as FileReviewWireSchema, fc as FindEntityRequest, fd as FindEntityRequestSchema, fe as FindEntityResponse, ff as FindEntityResponseSchema, fg as FindFilesRequest, fh as FindFilesRequestSchema, fi as FindFilesResponse, fj as FindFilesResponseSchema, fk as FindReferencesRequest, fl as FindReferencesRequestSchema, fm as FindReferencesResponse, fn as FindReferencesResponseSchema, fo as FindSimilarImagesRequest, fp as FindSimilarImagesRequestSchema, fq as FindSimilarImagesResponse, fr as FindSimilarImagesResponseSchema, fs as FindSymbolRequest, ft as FindSymbolRequestSchema, fu as FindSymbolResponse, fv as FindSymbolResponseSchema, fw as FitnessCheck, fx as FitnessCheckSchema, fy as FlagSpec, fz as FlagSpecSchema, fA as GATE_DEFAULT_MAX_ATTEMPTS, fB as GateAttemptRecord, fC as GateCheckSchema, fD as GateScriptRefSchema, fE as GateScriptResult, fF as GateScriptResultSchema, fG as GateSpec, fH as GateSpecSchema, fI as GenerateGezelAboutRequest, fJ as GenerateGezelAboutRequestSchema, fK as GenerateGezelIconRequest, fL as GenerateGezelIconRequestSchema, fM as GetScriptSourceResponse, fN as GetScriptSourceResponseSchema, fO as GezelConfigSchema, fP as GezelGrowthResponse, fQ as GezelGrowthResponseSchema, fR as GezelGrowthState, fS as GezelGrowthStateSchema, fT as GezelGrowthSummary, fU as GezelGrowthSummarySchema, fV as GezelIconHistoryEntrySchema, fW as GezelIconHistoryResponse, fX as GezelIconHistoryResponseSchema, fY as GezelResponse, fZ as GezelResponseSchema, f_ as GezelTemplateIdentity, f$ as GezelTemplateIdentitySchema, g0 as GezelTemplateManifest, g1 as GezelTemplateManifestSchema, g2 as GezelTemplateVersionManifest, g3 as GezelTemplateVersionManifestSchema, g4 as GezmodelBundleManifest, g5 as GezmodelBundleManifestSchema, g6 as GezmodelEngine, g7 as GezmodelEngineSchema, g8 as GezmodelFile, g9 as GezmodelFileSchema, ga as GezmodelImportReview, gb as GezmodelImportReviewSchema, gc as GezmodelLicense, gd as GezmodelLicenseSchema, ge as GildeUpdateCheckOutcome, gf as GildeUpdateCheckOutcomeSchema, gg as GildeUpdateCheckResult, gh as GildeUpdateCheckResultSchema, gi as GildeUpdateStatusResponse, gj as GildeUpdateStatusResponseSchema, gk as GitAbandonMergeResponse, gl as GitAbandonMergeResponseSchema, gm as GitAiMergeRequest, gn as GitAiMergeRequestSchema, go as GitAiMergeResponse, gp as GitAiMergeResponseSchema, gq as GitBranchSwitchRequest, gr as GitBranchSwitchRequestSchema, gs as GitBranchesResponse, gt as GitBranchesResponseSchema, gu as GitChangeKind, gv as GitChangeKindSchema, gw as GitChangesResponse, gx as GitChangesResponseSchema, gy as GitCloneResponse, gz as GitCloneResponseSchema, gA as GitCommitDetailResponse, gB as GitCommitDetailResponseSchema, gC as GitCommitRequest, gD as GitCommitRequestSchema, gE as GitCommitResponse, gF as GitCommitResponseSchema, gG as GitCompleteMergeRequest, gH as GitCompleteMergeRequestSchema, gI as GitCompleteMergeResponse, gJ as GitCompleteMergeResponseSchema, gK as GitConflictFile, gL as GitConflictFileSchema, gM as GitConflictKind, gN as GitConflictKindSchema, gO as GitConflictVersionsResponse, gP as GitConflictVersionsResponseSchema, gQ as GitDiscardRequest, gR as GitDiscardRequestSchema, gS as GitDiscardResponse, gT as GitDiscardResponseSchema, gU as GitFetchResponse, gV as GitFetchResponseSchema, gW as GitFileDiffResponse, gX as GitFileDiffResponseSchema, gY as GitHubAuthMeta, gZ as GitHubAuthMetaSchema, g_ as GitHubCheckStatusResponse, g$ as GitHubCheckStatusResponseSchema, h0 as GitHubCreateCommentRequest, h1 as GitHubCreateCommentRequestSchema, h2 as GitHubCreateCommentResponse, h3 as GitHubCreateCommentResponseSchema, h4 as GitHubCreatePullRequest, h5 as GitHubCreatePullRequestSchema, h6 as GitHubCreatePullResponse, h7 as GitHubCreatePullResponseSchema, h8 as GitHubCredentialSource, h9 as GitHubIdentity, ha as GitHubIdentityResponse, hb as GitHubIdentityResponseSchema, hc as GitHubIdentitySchema, hd as GitHubLoginPollRequest, he as GitHubLoginPollRequestSchema, hf as GitHubLoginPollResponse, hg as GitHubLoginPollResponseSchema, hh as GitHubLoginStartResponse, hi as GitHubLoginStartResponseSchema, hj as GitHubPullComment, hk as GitHubPullCommentSchema, hl as GitHubPullDetail, hm as GitHubPullDetailSchema, hn as GitHubPullDiffResponse, ho as GitHubPullDiffResponseSchema, hp as GitHubPullFile, hq as GitHubPullFileSchema, hr as GitHubPullSummary, hs as GitHubPullSummarySchema, ht as GitHubRepoPreviewRequest, hu as GitHubRepoPreviewRequestSchema, hv as GitHubRepoPreviewResponse, hw as GitHubRepoPreviewResponseSchema, hx as GitHubRepoSummary, hy as GitHubRepoSummarySchema, hz as GitHubReposResponse, hA as GitHubReposResponseSchema, hB as GitHubWorkflowRun, hC as GitHubWorkflowRunSchema, hD as GitLogEntry, hE as GitLogEntrySchema, hF as GitLogResponse, hG as GitLogResponseSchema, hH as GitMergeStateResponse, hI as GitMergeStateResponseSchema, hJ as GitPushResponse, hK as GitPushResponseSchema, hL as GitResolveConflictRequest, hM as GitResolveConflictRequestSchema, hN as GitResolveConflictResponse, hO as GitResolveConflictResponseSchema, hP as GitStatusResponse, hQ as GitStatusResponseSchema, hR as GitSuggestMessageResponse, hS as GitSuggestMessageResponseSchema, hT as GitSyncResponse, hU as GitSyncResponseSchema, hV as GitSyncState, hW as GitSyncStateSchema, hX as GitWorkingChange, hY as GitWorkingChangeSchema, hZ as GithubAbandonMergeResponse, h_ as GithubAbandonMergeResponseSchema, h$ as GithubAiMergeRequest, i0 as GithubAiMergeRequestSchema, i1 as GithubAiMergeResponse, i2 as GithubAiMergeResponseSchema, i3 as GithubAuthMeta, i4 as GithubAuthMetaSchema, i5 as GithubBranchSwitchRequest, i6 as GithubBranchSwitchRequestSchema, i7 as GithubBranchesResponse, i8 as GithubBranchesResponseSchema, i9 as GithubChangeKind, ia as GithubChangeKindSchema, ib as GithubChangesResponse, ic as GithubChangesResponseSchema, id as GithubCheckStatusResponse, ie as GithubCheckStatusResponseSchema, ig as GithubCloneResponse, ih as GithubCloneResponseSchema, ii as GithubCommitDetailResponse, ij as GithubCommitDetailResponseSchema, ik as GithubCommitRequest, il as GithubCommitRequestSchema, im as GithubCommitResponse, io as GithubCommitResponseSchema, ip as GithubCompleteMergeRequest, iq as GithubCompleteMergeRequestSchema, ir as GithubCompleteMergeResponse, is as GithubCompleteMergeResponseSchema, it as GithubConflictFile, iu as GithubConflictFileSchema, iv as GithubConflictKind, iw as GithubConflictKindSchema, ix as GithubConflictVersionsResponse, iy as GithubConflictVersionsResponseSchema, iz as GithubCreateCommentRequest, iA as GithubCreateCommentRequestSchema, iB as GithubCreateCommentResponse, iC as GithubCreateCommentResponseSchema, iD as GithubCreatePullRequest, iE as GithubCreatePullRequestSchema, iF as GithubCreatePullResponse, iG as GithubCreatePullResponseSchema, iH as GithubCredentialSource, iI as GithubDiscardRequest, iJ as GithubDiscardRequestSchema, iK as GithubDiscardResponse, iL as GithubDiscardResponseSchema, iM as GithubFetchResponse, iN as GithubFetchResponseSchema, iO as GithubFileDiffResponse, iP as GithubFileDiffResponseSchema, iQ as GithubIdentity, iR as GithubIdentityResponse, iS as GithubIdentityResponseSchema, iT as GithubIdentitySchema, iU as GithubLogEntry, iV as GithubLogEntrySchema, iW as GithubLogResponse, iX as GithubLogResponseSchema, iY as GithubLoginPollRequest, iZ as GithubLoginPollRequestSchema, i_ as GithubLoginPollResponse, i$ as GithubLoginPollResponseSchema, j0 as GithubLoginStartResponse, j1 as GithubLoginStartResponseSchema, j2 as GithubMergeStateResponse, j3 as GithubMergeStateResponseSchema, j4 as GithubPullComment, j5 as GithubPullCommentSchema, j6 as GithubPullDetail, j7 as GithubPullDetailSchema, j8 as GithubPullDiffResponse, j9 as GithubPullDiffResponseSchema, ja as GithubPullFile, jb as GithubPullFileSchema, jc as GithubPullSummary, jd as GithubPullSummarySchema, je as GithubPushResponse, jf as GithubPushResponseSchema, jg as GithubRepoPreviewRequest, jh as GithubRepoPreviewRequestSchema, ji as GithubRepoPreviewResponse, jj as GithubRepoPreviewResponseSchema, jk as GithubRepoSummary, jl as GithubRepoSummarySchema, jm as GithubReposResponse, jn as GithubReposResponseSchema, jo as GithubResolveConflictRequest, jp as GithubResolveConflictRequestSchema, jq as GithubResolveConflictResponse, jr as GithubResolveConflictResponseSchema, js as GithubStatusResponse, jt as GithubStatusResponseSchema, ju as GithubSuggestMessageResponse, jv as GithubSuggestMessageResponseSchema, jw as GithubSyncResponse, jx as GithubSyncResponseSchema, jy as GithubSyncState, jz as GithubSyncStateSchema, jA as GithubWorkflowRun, jB as GithubWorkflowRunSchema, jC as GithubWorkingChange, jD as GithubWorkingChangeSchema, jE as GpuProcessMemory, jF as GpuProcessMemorySchema, jG as GpuProcessOwner, jH as GpuProcessOwnerSchema, jI as GrepArtifactRequest, jJ as GrepArtifactRequestSchema, jK as GrepArtifactResponse, jL as GrepArtifactResponseSchema, jM as GrowthEvidence, jN as GrowthEvidenceSchema, jO as GrowthProposal, jP as GrowthProposalSchema, jQ as GrowthSignals, jR as GrowthSignalsSchema, jS as GzelBundleItem, jT as GzelBundleItemSchema, jU as GzelBundleManifest, jV as GzelBundleManifestSchema, jW as HandboekArea, jX as HandboekAreaSchema, jY as HandboekArticle, jZ as HandboekArticleSchema, j_ as HandboekFigure, j$ as HandboekFigureSchema, k0 as HandboekHowDoIResponse, k1 as HandboekHowDoIResponseSchema, k2 as HandboekNarrationResponse, k3 as HandboekNarrationResponseSchema, k4 as HandboekNarrationSegment, k5 as HandboekNarrationSegmentSchema, k6 as HandboekRenderMode, k7 as HandboekRenderModeSchema, k8 as HandboekToc, k9 as HandboekTocArea, ka as HandboekTocAreaSchema, kb as HandboekTocEntry, kc as HandboekTocEntrySchema, kd as HandboekTocSchema, ke as HealthResponse, kf as HealthResponseSchema, kg as HistoryEntry, kh as HistoryEntrySchema, ki as HistoryEvent, kj as HistoryEventEntrySchema, kk as HistoryEventKind, kl as HistoryEventKindSchema, km as HistoryEventSchema, kn as HistoryFilter, ko as HistoryFilterSchema, kp as HistorySessionEntry, kq as HistorySessionEntrySchema, kr as HookDecision, ks as HookDecisionSchema, kt as HookPhase, ku as HookPhaseSchema, kv as HookResult, kw as HookResultSchema, kx as HookSpec, ky as HookSpecSchema, kz as HtmlLayer, kA as HtmlLayerSchema, kB as HttpsOriginSchema, kC as ImageEngineStatusResponse, kD as ImageEngineStatusResponseSchema, kE as ImageExif, kF as ImageExifSchema, kG as ImageGenerationApprovalIntent, kH as ImageGenerationApprovalIntentSchema, kI as ImageGenerationMeta, kJ as ImageGenerationMetaSchema, kK as ImageGenerationRequest, kL as ImageGenerationRequestSchema, kM as ImageGenerationResponse, kN as ImageGenerationResponseSchema, kO as ImageInputSource, kP as ImageInputSourceSchema, kQ as ImageLayer, kR as ImageLayerSchema, kS as ImageModelAuxiliaryFile, kT as ImageModelAuxiliaryFileSchema, kU as ImageModelAuxiliaryRole, kV as ImageModelAuxiliaryRoleSchema, kW as ImageModelCategory, kX as ImageModelCategorySchema, kY as ImageModelHardwareTier, kZ as ImageModelHardwareTierSchema, k_ as ImageModelIdentity, k$ as ImageModelIdentitySchema, l0 as ImageModelManifest, l1 as ImageModelManifestSchema, l2 as ImageModelPullEvent, l3 as ImageModelPullEventSchema, l4 as ImageModelVersionManifest, l5 as ImageModelVersionManifestSchema, l6 as ImageRecognition, l7 as ImageRecognitionSchema, l8 as ImageStaticMeta, l9 as ImageStaticMetaSchema, la as ImportCustomMcpConfigRequest, lb as ImportCustomMcpConfigRequestSchema, lc as ImportCustomMcpConfigResponse, ld as ImportCustomMcpConfigResponseSchema, le as ImportProvenance, lf as ImportProvenanceSchema, lg as ImportedAboutProvenance, lh as ImportedAboutProvenanceSchema, li as ImportedCraftbookProvenance, lj as ImportedCraftbookProvenanceSchema, lk as ImportedGezelProvenance, ll as ImportedGezelProvenanceSchema, lm as InsertAtMarkerInProjectWorkspaceFileRequest, ln as InsertAtMarkerInProjectWorkspaceFileRequestSchema, lo as InstallPackageRequest, lp as InstallPackageRequestSchema, lq as InstallPackageResponse, lr as InstallPackageResponseSchema, ls as InstalledAudioModel, lt as InstalledAudioModelSchema, lu as InstalledImageModel, lv as InstalledImageModelSchema, lw as InstalledPackage, lx as InstalledPackageSchema, ly as InstalledRecognitionModel, lz as InstalledRecognitionModelSchema, lA as InstalledToolset, lB as InstalledToolsetSchema, lC as InstalledVideoModel, lD as InstalledVideoModelSchema, lE as InstructionMergeMode, lF as InstructionMergeModeSchema, lG as InstructionSourceFile, lH as InstructionSourceFileSchema, lI as InterruptSessionRequest, lJ as InterruptSessionRequestSchema, lK as InvokePageToolRequest, lL as InvokePageToolRequestSchema, lM as InvokePageToolResponse, lN as InvokePageToolResponseSchema, lO as InvokeSessionToolRequest, lP as InvokeSessionToolRequestSchema, lQ as InvokeSessionToolResponse, lR as InvokeSessionToolResponseSchema, lS as KNOWN_PROFILE_IDS, lT as KeurmeesterAction, lU as KeurmeesterActionSchema, lV as KeurmeesterCaseClosed, lW as KeurmeesterCaseClosedSchema, lX as KeurmeesterCaseOpened, lY as KeurmeesterCaseOpenedSchema, lZ as KeurmeesterCaseOutcome, l_ as KeurmeesterCaseOutcomeSchema, l$ as KeurmeesterCaseRecord, m0 as KeurmeesterCaseRecordSchema, m1 as KeurmeesterFailureClass, m2 as KeurmeesterFailureClassSchema, m3 as KeurmeesterTriggerKind, m4 as KeurmeesterTriggerKindSchema, m5 as KeurmeesterVerdict, m6 as KeurmeesterVerdictSchema, m7 as KnownProfileId, m8 as LEVEL_THRESHOLDS, m9 as Layer, ma as LayerSchema, mb as LegacyCodexPermissionMode, mc as LegacyCodexPermissionModeSchema, md as LicenseClass, me as LicenseClassSchema, mf as LicenseMetaShape, mg as ListActiveImagePullsResponse, mh as ListActiveImagePullsResponseSchema, mi as ListActiveVideoPullsResponse, mj as ListActiveVideoPullsResponseSchema, mk as ListAudioCatalogResponse, ml as ListAudioCatalogResponseSchema, mm as ListAudioVoicesResponse, mn as ListAudioVoicesResponseSchema, mo as ListCatalogItemVersionsResponse, mp as ListCatalogItemVersionsResponseSchema, mq as ListCatalogItemsResponse, mr as ListCatalogItemsResponseSchema, ms as ListChatSessionsResponse, mt as ListChatSessionsResponseSchema, mu as ListCodeReviewsResponse, mv as ListCodeReviewsResponseSchema, mw as ListCraftbooksResponse, mx as ListCraftbooksResponseSchema, my as ListDependenciesResponse, mz as ListDependenciesResponseSchema, mA as ListEntityMentionsRequest, mB as ListEntityMentionsRequestSchema, mC as ListEntityMentionsResponse, mD as ListEntityMentionsResponseSchema, mE as ListFileIssuesRequest, mF as ListFileIssuesRequestSchema, mG as ListFileIssuesResponse, mH as ListFileIssuesResponseSchema, mI as ListGezelsResponse, mJ as ListGezelsResponseSchema, mK as ListGitHubPullCommentsResponse, mL as ListGitHubPullCommentsResponseSchema, mM as ListGitHubPullFilesResponse, mN as ListGitHubPullFilesResponseSchema, mO as ListGitHubPullsResponse, mP as ListGitHubPullsResponseSchema, mQ as ListGitHubWorkflowRunsResponse, mR as ListGitHubWorkflowRunsResponseSchema, mS as ListGithubPullCommentsResponse, mT as ListGithubPullCommentsResponseSchema, mU as ListGithubPullFilesResponse, mV as ListGithubPullFilesResponseSchema, mW as ListGithubPullsResponse, mX as ListGithubPullsResponseSchema, mY as ListGithubWorkflowRunsResponse, mZ as ListGithubWorkflowRunsResponseSchema, m_ as ListHistoryResponse, m$ as ListHistoryResponseSchema, n0 as ListInstalledAudioModelsResponse, n1 as ListInstalledAudioModelsResponseSchema, n2 as ListInstalledImageModelsResponse, n3 as ListInstalledImageModelsResponseSchema, n4 as ListInstalledRecognitionModelsResponse, n5 as ListInstalledRecognitionModelsResponseSchema, n6 as ListInstalledVideoModelsResponse, n7 as ListInstalledVideoModelsResponseSchema, n8 as ListMentionCandidatesResponse, n9 as ListMentionCandidatesResponseSchema, na as ListModelsResponse, nb as ListModelsResponseSchema, nc as ListPackageScriptsResponse, nd as ListPackageScriptsResponseSchema, ne as ListProjectsForGezelResponse, nf as ListProjectsForGezelResponseSchema, ng as ListProjectsResponse, nh as ListProjectsResponseSchema, ni as ListQuestionsResponse, nj as ListQuestionsResponseSchema, nk as ListRecognitionCatalogResponse, nl as ListRecognitionCatalogResponseSchema, nm as ListScriptsResponse, nn as ListScriptsResponseSchema, no as ListSessionQueueResponse, np as ListSessionQueueResponseSchema, nq as ListSessionToolsResponse, nr as ListSessionToolsResponseSchema, ns as ListTaskNotesResponse, nt as ListTaskNotesResponseSchema, nu as ListTasksResponse, nv as ListTasksResponseSchema, nw as ListTerminalThreadsResponse, nx as ListTerminalThreadsResponseSchema, ny as ListTimelineResponse, nz as ListTimelineResponseSchema, nA as LlamaCppContextSizing, nB as LlamaCppContextSizingResponse, nC as LlamaCppContextSizingResponseSchema, nD as LlamaCppContextSizingSchema, nE as LlamaCppEngineConfig, nF as LlamaCppEngineConfigSchema, nG as LocalEngineLifecycle, nH as LocalEngineLifecycleSchema, nI as MEESTER_STATUS_HEADLINE_MAX, nJ as MODEL_TIER_ORDER, nK as MachineMemoryKind, nL as MachineMemoryKindSchema, nM as MachineMemoryUsage, nN as MachineMemoryUsageSchema, nO as MapAttackSurfaceResponse, nP as MapAttackSurfaceResponseSchema, nQ as MapBlock, nR as MapBlockHealth, nS as MapBlockHealthSchema, nT as MapBlockSchema, nU as MapBuildingSchema, nV as MapDistrictSchema, nW as MapPlazaSchema, nX as MapPrChange, nY as MapPrChangeSchema, nZ as MapPrOverlay, n_ as MapPrOverlaySchema, n$ as MapRepoRequest, o0 as MapRepoRequestSchema, o1 as MapRepoResponse, o2 as MapRepoResponseSchema, o3 as MapRoad, o4 as MapRoadSchema, o5 as MapStreetSchema, o6 as MapUrbanity, o7 as MapUrbanitySchema, o8 as McpToolInfo, o9 as McpToolInfoSchema, oa as MeesterStatusAction, ob as MeesterStatusActionSchema, oc as MeesterStatusCta, od as MeesterStatusCtaSchema, oe as MeesterStatusModelOutput, of as MeesterStatusModelOutputSchema, og as MeesterStatusReport, oh as MeesterStatusReportSchema, oi as MeesterStatusResponse, oj as MeesterStatusResponseSchema, ok as MeesterStatusState, ol as MeesterStatusStateSchema, om as MentionCandidate, on as MentionCandidateSchema, oo as MessageGezelRequest, op as MessageGezelRequestSchema, oq as MessageGezelResponse, or as MessageGezelResponseSchema, os as MessageImageDigest, ot as MessageImageDigestSchema, ou as MinGezelVersionShape, ov as MlxRuntimeStatus, ow as MlxRuntimeStatusSchema, ox as MockHttpRoute, oy as MockHttpRouteSchema, oz as MockService, oA as MockServiceSchema, oB as ModelContextOverrideUpdate, oC as ModelContextOverrideUpdateSchema, oD as ModelContextOverridesResponse, oE as ModelContextOverridesResponseSchema, oF as ModelDownloadPreflightRequest, oG as ModelDownloadPreflightRequestSchema, oH as ModelDownloadPreflightResponse, oI as ModelDownloadPreflightResponseSchema, oJ as ModelFamily, oK as ModelFamilySchema, oL as ModelFitnessRecordSchema, oM as ModelFitnessStatus, oN as ModelFitnessStatusSchema, oO as ModelFitnessTrigger, oP as ModelFitnessTriggerSchema, oQ as ModelInfo, oR as ModelInfoSchema, oS as ModelStyle, oT as ModelStyleSchema, oU as ModelTierSchema, oV as NamedScriptCapability, oW as NamedScriptCapabilitySchema, oX as NativeEngineInstallStatus, oY as NativeEngineInstallStatusSchema, oZ as NativeEngineName, o_ as NativeEngineNameSchema, o$ as NativeEngineResolveEvent, p0 as NativeEngineResolveEventSchema, p1 as NativeEngineStatusResponse, p2 as NativeEngineStatusResponseSchema, p3 as NewCraftbookStepSchema, p4 as NewTaskFanout, p5 as NewTaskFanoutSchema, p6 as NewTaskStep, p7 as NewTaskStepSchema, p8 as NightShiftBackgroundWorkBrief, p9 as NightShiftBackgroundWorkBriefSchema, pa as NightShiftCompletedTask, pb as NightShiftCompletedTaskSchema, pc as NightShiftReport, pd as NightShiftReportSchema, pe as NightShiftReviewIntent, pf as NightShiftReviewIntentSchema, pg as NightShiftReviewResponse, ph as NightShiftReviewResponseSchema, pi as NightShiftTaskBrief, pj as NightShiftTaskBriefSchema, pk as NightShiftTasksResponse, pl as NightShiftTasksResponseSchema, pm as NodeScriptPassesCheck, pn as NodeScriptPassesCheckSchema, po as NormalizedStepGate, pp as NpmInstallApprovalDecision, pq as NpmInstallApprovalDecisionSchema, pr as NpmInstallApprovalPackage, ps as NpmInstallApprovalPackageSchema, pt as OutcomeSchema, pu as OutlineFileRequest, pv as OutlineFileRequestSchema, pw as OutlineFileResponse, px as OutlineFileResponseSchema, py as PageCheckRequest, pz as PageCheckRequestSchema, pA as PageCheckResponse, pB as PageCheckResponseSchema, pC as ParseCraftbookTestSpecOptions, pD as ParseCraftbookTestSpecResult, pE as PendingImportItem, pF as PendingImportItemSchema, pG as PendingImports, pH as PendingImportsSchema, pI as PendingLevelUp, pJ as PendingLevelUpSchema, pK as PendingPersona, pL as PendingPersonaSchema, pM as PendingScript, pN as PendingScriptSchema, pO as PixelsLayer, pP as PixelsLayerSchema, pQ as PreviewLogEntry, pR as PreviewLogEntrySchema, pS as PreviewSource, pT as PreviewSourceSchema, pU as ProfileKind, pV as ProfileMeta, pW as ProjectAboutPreviewRequest, pX as ProjectAboutPreviewRequestSchema, pY as ProjectAboutPreviewResponse, pZ as ProjectAboutPreviewResponseSchema, p_ as ProjectActivity, p$ as ProjectActivitySchema, q0 as ProjectApprovalsResponse, q1 as ProjectApprovalsResponseSchema, q2 as ProjectConnectorBinding, q3 as ProjectConnectorBindingSchema, q4 as ProjectCraftbookProvenance, q5 as ProjectCraftbookProvenanceSchema, q6 as ProjectDetail, q7 as ProjectDetailSchema, q8 as ProjectFileEntry, q9 as ProjectFileEntrySchema, qa as ProjectFolderPreviewRequest, qb as ProjectFolderPreviewRequestSchema, qc as ProjectFolderPreviewResponse, qd as ProjectFolderPreviewResponseSchema, qe as ProjectForGezel, qf as ProjectForGezelSchema, qg as ProjectGitHub, qh as ProjectGitHubSchema, qi as ProjectGithub, qj as ProjectGithubSchema, qk as ProjectLocalConfig, ql as ProjectLocalConfigSchema, qm as ProjectNudgeConfig, qn as ProjectNudgeConfigSchema, qo as ProjectNudgeState, qp as ProjectNudgeStateSchema, qq as ProjectResponse, qr as ProjectResponseSchema, qs as ProjectSchema, qt as ProjectTabVisibility, qu as ProjectTabVisibilitySchema, qv as ProjectTypeCategory, qw as ProjectTypeCategorySchema, qx as ProjectTypeGezelRef, qy as ProjectTypeGezelSchema, qz as ProjectTypeIdentity, qA as ProjectTypeIdentitySchema, qB as ProjectTypeManifest, qC as ProjectTypeManifestSchema, qD as ProjectTypePages, qE as ProjectTypePagesSchema, qF as ProjectTypePreviewRead, qG as ProjectTypePreviewReadSchema, qH as ProjectTypeProvenance, qI as ProjectTypeProvenanceSchema, qJ as ProjectTypeSchedule, qK as ProjectTypeScheduleSchema, qL as ProjectTypeTool, qM as ProjectTypeToolReaction, qN as ProjectTypeToolReactionSchema, qO as ProjectTypeToolSchema, qP as ProjectTypeToolsetRef, qQ as ProjectTypeToolsetSchema, qR as ProjectTypeVersionManifest, qS as ProjectTypeVersionManifestSchema, qT as PrometheusAlertsCheck, qU as PrometheusAlertsCheckSchema, qV as PromptTags, qW as PromptTagsSchema, qX as Question, qY as QuestionAnswer, qZ as QuestionAnswerSchema, q_ as QuestionIntent, q$ as QuestionIntentSchema, r0 as QuestionSchema, r1 as QueuedMessage, r2 as QueuedMessageSchema, r3 as ReadArtifactSliceOpts, r4 as ReadArtifactSliceOptsSchema, r5 as ReadArtifactSliceResponse, r6 as ReadArtifactSliceResponseSchema, r7 as ReadDocAsMarkdownRequest, r8 as ReadDocAsMarkdownRequestSchema, r9 as ReadDocAsMarkdownResponse, ra as ReadDocAsMarkdownResponseSchema, rb as ReadImageBase64Request, rc as ReadImageBase64RequestSchema, rd as ReadImageBase64Response, re as ReadImageBase64ResponseSchema, rf as ReadSymbolRequest, rg as ReadSymbolRequestSchema, rh as ReadSymbolResponse, ri as ReadSymbolResponseSchema, rj as ReadWorkspaceFilesRequest, rk as ReadWorkspaceFilesRequestSchema, rl as ReadWorkspaceFilesResponse, rm as ReadWorkspaceFilesResponseSchema, rn as ReasoningBlock, ro as ReasoningBlockSchema, rp as ReasoningFormat, rq as ReasoningFormatSchema, rr as RecentTab, rs as RecentTabArea, rt as RecentTabAreaSchema, ru as RecentTabSchema, rv as RecoMetaShape, rw as RecognitionCatalogEntry, rx as RecognitionCatalogEntrySchema, ry as RecognitionHealth, rz as RecognitionHealthSchema, rA as RecognitionMode, rB as RecognitionModeRequest, rC as RecognitionModeRequestSchema, rD as RecognitionModeSchema, rE as RecognitionPullEvent, rF as RecognitionPullEventSchema, rG as RecognitionRequest, rH as RecognitionRequestSchema, rI as RecognitionResponse, rJ as RecognitionResponseSchema, rK as RectSchema, rL as ReferenceFileLocationRequest, rM as ReferenceFileLocationRequestSchema, rN as ReferenceFileLocationResponse, rO as ReferenceFileLocationResponseSchema, rP as ReferencePreviewRequest, rQ as ReferencePreviewRequestSchema, rR as ReferencePreviewResponse, rS as ReferencePreviewResponseSchema, rT as RemoteServingConfig, rU as RemoteServingConfigSchema, rV as RenameDocumentRequest, rW as RenameDocumentRequestSchema, rX as RenameGezelRequest, rY as RenameGezelRequestSchema, rZ as RenderImageRequest, r_ as RenderImageRequestSchema, r$ as RenderImageResponse, s0 as RenderImageResponseSchema, s1 as ReplaceInProjectWorkspaceFileRequest, s2 as ReplaceInProjectWorkspaceFileRequestSchema, s3 as ReplaceLinesInProjectWorkspaceFileRequest, s4 as ReplaceLinesInProjectWorkspaceFileRequestSchema, s5 as ReportPreviewLogRequest, s6 as ReportPreviewLogRequestSchema, s7 as RequestAskRequest, s8 as RequestAskRequestSchema, s9 as RequestAskResponse, sa as RequestAskResponseSchema, sb as RequestPermissionRequest, sc as RequestPermissionRequestSchema, sd as RequestPermissionResponse, se as RequestPermissionResponseSchema, sf as RerollGezelPoppetjeRequest, sg as RerollGezelPoppetjeRequestSchema, sh as ResidentEngineModel, si as ResidentEngineModelSchema, sj as ResolveArtifactResponse, sk as ResolveArtifactResponseSchema, sl as ResolveSecurityFindingRequest, sm as ResolveSecurityFindingRequestSchema, sn as ResolveSecurityFindingResponse, so as ResolveSecurityFindingResponseSchema, sp as RevertGezelIconRequest, sq as RevertGezelIconRequestSchema, sr as RewriteTextContext, ss as RewriteTextContextSchema, st as RewriteTextRequest, su as RewriteTextRequestSchema, sv as RewriteTextResponse, sw as RewriteTextResponseSchema, sx as RunGitRequest, sy as RunGitRequestSchema, sz as RunGitResponse, sA as RunGitResponseSchema, sB as RunNpxRequest, sC as RunNpxRequestSchema, sD as RunNpxResponse, sE as RunNpxResponseSchema, sF as RunPackageScriptRequest, sG as RunPackageScriptRequestSchema, sH as RunPackageScriptResponse, sI as RunPackageScriptResponseSchema, sJ as RunScriptRequest, sK as RunScriptRequestSchema, sL as RunScriptResponse, sM as RunScriptResponseSchema, sN as RunTerminalCommandRequest, sO as RunTerminalCommandRequestSchema, sP as RunTerminalCommandResponse, sQ as RunTerminalCommandResponseSchema, sR as SamplingBlock, sS as SamplingBlockSchema, sT as SaveScriptSourceRequest, sU as SaveScriptSourceRequestSchema, sV as SaveScriptSourceResponse, sW as SaveScriptSourceResponseSchema, sX as ScanFindingsRequest, sY as ScanFindingsRequestSchema, sZ as ScanFindingsResponse, s_ as ScanFindingsResponseSchema, s$ as ScheduleApprovalIntent, t0 as ScheduleApprovalIntentSchema, t1 as ScheduleMaterialization, t2 as ScheduleMaterializationSchema, t3 as ScriptArrayOutputSchema, t4 as ScriptBooleanInputSchema, t5 as ScriptBooleanOutputSchema, t6 as ScriptCapability, t7 as ScriptCapabilitySchema, t8 as ScriptChoiceInputSchema, t9 as ScriptDiagnostic, ta as ScriptDiagnosticSchema, tb as ScriptInputError, tc as ScriptInputFieldSchema, td as ScriptInputs, te as ScriptInputsSchema, tf as ScriptJsonInputSchema, tg as ScriptJsonOutputSchema, th as ScriptMetaSchema, ti as ScriptNameSchema, tj as ScriptNumberInputSchema, tk as ScriptNumberOutputSchema, tl as ScriptObjectOutputSchema, tm as ScriptOutputFieldSchema, tn as ScriptOutputPredicate, to as ScriptOutputPredicateSchema, tp as ScriptOutputs, tq as ScriptOutputsSchema, tr as ScriptProvenance, ts as ScriptProvenanceSchema, tt as ScriptRef, tu as ScriptRefInputSchema, tv as ScriptRefList, tw as ScriptRefListSchema, tx as ScriptRefSchema, ty as ScriptRun, tz as ScriptRunCall, tA as ScriptRunCallSchema, tB as ScriptRunSchema, tC as ScriptRunStatus, tD as ScriptRunStatusSchema, tE as ScriptRunTrigger, tF as ScriptRunTriggerSchema, tG as ScriptScope, tH as ScriptScopeSchema, tI as ScriptStringInputSchema, tJ as ScriptStringOutputSchema, tK as ScriptTemplateId, tL as ScriptTemplateIdSchema, tM as SdkTypesResponse, tN as SdkTypesResponseSchema, tO as SearchCodeRequest, tP as SearchCodeRequestSchema, tQ as SearchCodeResponse, tR as SearchCodeResponseSchema, tS as SearchDocsRequest, tT as SearchDocsRequestSchema, tU as SearchDocsResponse, tV as SearchDocsResponseSchema, tW as SearchDocumentsRequest, tX as SearchDocumentsRequestSchema, tY as SearchDocumentsResponse, tZ as SearchDocumentsResponseSchema, t_ as SearchFilesContextLine, t$ as SearchFilesContextLineSchema, u0 as SearchFilesMatch, u1 as SearchFilesMatchSchema, u2 as SearchFilesRequest, u3 as SearchFilesRequestSchema, u4 as SearchFilesResponse, u5 as SearchFilesResponseSchema, u6 as SearchImagesRequest, u7 as SearchImagesRequestSchema, u8 as SearchImagesResponse, u9 as SearchImagesResponseSchema, ua as SearchResult, ub as SearchResultSchema, uc as SearchSessionsRequest, ud as SearchSessionsRequestSchema, ue as SearchSessionsResponse, uf as SearchSessionsResponseSchema, ug as SecurityDependency, uh as SecurityDependencySchema, ui as SecurityFindingSchema, uj as SecurityFindingStatus, uk as SecurityFindingStatusSchema, ul as SecurityFindingWire, um as SecurityOverviewResponse, un as SecurityOverviewResponseSchema, uo as SecurityPolicySchema, up as SecurityScanRequest, uq as SecurityScanRequestSchema, ur as SecurityScanResponse, us as SecurityScanResponseSchema, ut as SecuritySeveritySchema, uu as SecuritySeverityWire, uv as SecuritySourceSchema, uw as SendChannelMessageRequest, ux as SendChannelMessageRequestSchema, uy as SendChannelMessageResponse, uz as SendChannelMessageResponseSchema, uA as SendChatRequest, uB as SendChatRequestSchema, uC as SendChatResponse, uD as SendChatResponseSchema, uE as SendToSessionRequest, uF as SendToSessionRequestSchema, uG as SendToSessionResponse, uH as SendToSessionResponseSchema, uI as ServiceRole, uJ as ServiceRoleSchema, uK as SessionDebugSnapshot, uL as SessionDebugSnapshotSchema, uM as SessionGpuTask, uN as SessionGpuTaskSchema, uO as SessionSearchResult, uP as SessionSearchResultSchema, uQ as SessionTelemetry, uR as SessionTelemetryListResponse, uS as SessionTelemetryListResponseSchema, uT as SessionTelemetrySchema, uU as SessionTurnTelemetry, uV as SessionTurnTelemetrySchema, uW as SetTaskStatusRequest, uX as SetTaskStatusRequestSchema, uY as Settlement, uZ as SettlementSchema, u_ as SharedModelMigrationCandidate, u$ as SharedModelMigrationCandidateSchema, v0 as SharedModelMigrationCandidatesResponse, v1 as SharedModelMigrationCandidatesResponseSchema, v2 as SharedModelMigrationRequest, v3 as SharedModelMigrationRequestSchema, v4 as SharedModelMigrationResult, v5 as SharedModelMigrationResultSchema, v6 as SharedModelMigrationSource, v7 as SharedModelMigrationSourceSchema, v8 as SpawnTaskInstancesRequest, v9 as SpawnTaskInstancesRequestSchema, va as StartCodeReviewRequest, vb as StartCodeReviewRequestSchema, vc as StartCodeReviewResponse, vd as StartCodeReviewResponseSchema, ve as StepDeliverableSchema, vf as StepGateSchema, vg as StepGateUnion, vh as StepGateUnionSchema, vi as StepPatch, vj as StepPosition, vk as StepPositionSchema, vl as StepSniff, vm as StepSniffSchema, vn as StructuredOutput, vo as StructuredOutputSchema, vp as SuggestCraftbooksResponse, vq as SuggestCraftbooksResponseSchema, vr as SuggestedCraftbook, vs as SuggestedCraftbookSchema, vt as SuggestedWorkItem, vu as SuggestedWorkItemSchema, vv as SuggestedWorkResponse, vw as SuggestedWorkResponseSchema, vx as SuggestedWorkSource, vy as SuggestedWorkSourceSchema, vz as SuggestedWorkState, vA as SuggestedWorkStateSchema, vB as SvgLayer, vC as SvgLayerSchema, vD as SymbolContext, vE as SymbolContextSchema, vF as SystemBootstrapStatus, vG as SystemBootstrapStatusSchema, vH as SystemDiagnostics, vI as SystemDiagnosticsSchema, vJ as SystemHomeInfo, vK as SystemHomeInfoSchema, vL as SystemToolsetInstallEvent, vM as SystemToolsetInstallEventSchema, vN as SystemToolsetInstallPhase, vO as SystemToolsetInstallSnapshot, vP as SystemToolsetInstallSnapshotSchema, vQ as TOOL_CALL_DIFF_MAX_BYTES, vR as TaskAssignee, vS as TaskAssigneeSchema, vT as TaskCraftbook, vU as TaskCraftbookSchema, vV as TaskCraftbookSource, vW as TaskCraftbookSourceSchema, vX as TaskCraftbookStep, vY as TaskCraftbookStepSchema, vZ as TaskCron, v_ as TaskCronOverlap, v$ as TaskCronOverlapSchema, w0 as TaskCronSchema, w1 as TaskFanout, w2 as TaskFanoutSchema, w3 as TaskNightShift, w4 as TaskNightShiftSchema, w5 as TaskNote, w6 as TaskNoteAuthor, w7 as TaskNoteAuthorSchema, w8 as TaskNoteSchema, w9 as TaskPausedIntent, wa as TaskPausedIntentSchema, wb as TaskPausedReason, wc as TaskPausedReasonSchema, wd as TaskRefSchema, we as TaskResponse, wf as TaskResponseSchema, wg as TaskSchema, wh as TaskStatus, wi as TaskStatusSchema, wj as TaskVariation, wk as TaskVariationSchema, wl as TerminalEventEnvelope, wm as TerminalEventEnvelopeSchema, wn as TerminalFileReference, wo as TerminalFileReferenceSchema, wp as TerminalInputRequestedEvent, wq as TerminalInputRequestedEventSchema, wr as TerminalMessage, ws as TerminalMessageEvent, wt as TerminalMessageEventSchema, wu as TerminalMessageSchema, wv as TerminalOpenFileEvent, ww as TerminalOpenFileEventSchema, wx as TerminalOutputChunkEvent, wy as TerminalOutputChunkEventSchema, wz as TerminalRunStartedEvent, wA as TerminalRunStartedEventSchema, wB as TerminalThread, wC as TerminalThreadSchema, wD as TerminalThreadSummary, wE as TerminalThreadSummarySchema, wF as TerminalTimelineEntry, wG as TerminalTimelineEntrySchema, wH as TerminalWorkingDirChangedEvent, wI as TerminalWorkingDirChangedEventSchema, wJ as TextLayer, wK as TextLayerSchema, wL as TimelineMessage, wM as TimelineMessageSchema, wN as ToolCallFormat, wO as ToolCallFormatSchema, wP as ToolPermissionIntent, wQ as ToolPermissionIntentSchema, wR as ToolsetCategory, wS as ToolsetCategorySchema, wT as ToolsetConfig, wU as ToolsetConfigField, wV as ToolsetConfigFieldSchema, wW as ToolsetConfigSchema, wX as ToolsetIdentity, wY as ToolsetIdentitySchema, wZ as ToolsetInstallApprovalIntent, w_ as ToolsetInstallApprovalIntentSchema, w$ as ToolsetManifest, x0 as ToolsetManifestSchema, x1 as ToolsetPlatform, x2 as ToolsetPlatformSchema, x3 as ToolsetRuntimeSchema, x4 as ToolsetVersionManifest, x5 as ToolsetVersionManifestSchema, x6 as ToolsetsScope, x7 as ToolsetsScopeSchema, x8 as TraceTaintRequest, x9 as TraceTaintRequestSchema, xa as TraceTaintResponse, xb as TraceTaintResponseSchema, xc as TraitProposal, xd as TraitProposalSchema, xe as TransformStreamEvent, xf as TransformStreamEventSchema, xg as TransformTextMode, xh as TransformTextModeSchema, xi as TransformTextRequest, xj as TransformTextRequestSchema, xk as TuningAction, xl as TuningActionSchema, xm as TuningProfileId, xn as TuningProfileIdSchema, xo as TuningProposal, xp as TuningProposalSchema, xq as UNIFIED_SEARCH_RESULT_KINDS, xr as UnifiedSearchRequest, xs as UnifiedSearchRequestSchema, xt as UnifiedSearchResponse, xu as UnifiedSearchResponseSchema, xv as UnifiedSearchResult, xw as UnifiedSearchResultKind, xx as UnifiedSearchResultKindSchema, xy as UnifiedSearchResultSchema, xz as UpdateConfigRequest, xA as UpdateConfigRequestSchema, xB as UpdateCraftbookRequest, xC as UpdateCraftbookRequestSchema, xD as UpdateGezelAboutRequest, xE as UpdateGezelAboutRequestSchema, xF as UpdateGezelFixedFunctionDefaultsRequest, xG as UpdateGezelFixedFunctionDefaultsRequestSchema, xH as UpdateGezelIconRequest, xI as UpdateGezelIconRequestSchema, xJ as UpdateGezelMarkdownRequest, xK as UpdateGezelMarkdownRequestSchema, xL as UpdateGezelPoppetjeRequest, xM as UpdateGezelPoppetjeRequestSchema, xN as UpdateGezelSettingsRequest, xO as UpdateGezelSettingsRequestSchema, xP as UpdateProjectRequest, xQ as UpdateProjectRequestSchema, xR as UpdateQueuedMessageRequest, xS as UpdateQueuedMessageRequestSchema, xT as UpdateQueuedMessageResponse, xU as UpdateQueuedMessageResponseSchema, xV as UpdateTaskCraftbookRequest, xW as UpdateTaskCraftbookRequestSchema, xX as UpdateTaskNoteRequest, xY as UpdateTaskNoteRequestSchema, xZ as UpdateTaskNoteResponse, x_ as UpdateTaskNoteResponseSchema, x$ as UpdateTaskRequest, y0 as UpdateTaskRequestSchema, y1 as UpdateTaskStepRequest, y2 as UpdateTaskStepRequestSchema, y3 as UpdateTaskStepResponse, y4 as UpdateTaskStepResponseSchema, y5 as VILLAGE_FILE_ABOUT, y6 as VILLAGE_FILE_SCHEMA_VERSION, y7 as VideoAccelerator, y8 as VideoAcceleratorSchema, y9 as VideoEngineStatusResponse, ya as VideoEngineStatusResponseSchema, yb as VideoGenerationApprovalIntent, yc as VideoGenerationApprovalIntentSchema, yd as VideoGenerationMeta, ye as VideoGenerationMetaSchema, yf as VideoGenerationRequest, yg as VideoGenerationRequestSchema, yh as VideoGenerationResponse, yi as VideoGenerationResponseSchema, yj as VideoInputSource, yk as VideoInputSourceSchema, yl as VideoModelFamily, ym as VideoModelFamilySchema, yn as VideoModelIdentity, yo as VideoModelIdentitySchema, yp as VideoModelLoad, yq as VideoModelLoadSchema, yr as VideoModelManifest, ys as VideoModelManifestSchema, yt as VideoModelPullEvent, yu as VideoModelPullEventSchema, yv as VideoModelSource, yw as VideoModelSourceSchema, yx as VideoModelVersionManifest, yy as VideoModelVersionManifestSchema, yz as VillageAnchorSchema, yA as VillageDomainState, yB as VillageDomainStateSchema, yC as VillageDowntown, yD as VillageDowntownSchema, yE as VillageFile, yF as VillageFileSchema, yG as VillageJournalNode, yH as VillageJournalNodeSchema, yI as VillageOverrideSchema, yJ as WORKSPACE_READ_DEADLINE_MS, yK as WORKSPACE_READ_MAX_BATCH_LINES, yL as WORKSPACE_READ_MAX_BATCH_RESULT_BYTES, yM as WORKSPACE_READ_MAX_BATCH_SCAN_BYTES, yN as WORKSPACE_READ_MAX_FILES, yO as WORKSPACE_READ_MAX_RANGE_LINES, yP as WORKSPACE_READ_MAX_RESULT_BYTES, yQ as WORKSPACE_READ_MAX_SCAN_BYTES, yR as WebSearchRequest, yS as WebSearchRequestSchema, yT as WebSearchResponse, yU as WebSearchResponseSchema, yV as WebhookChannelConfig, yW as WebhookChannelConfigSchema, yX as WikipediaSearchRequest, yY as WikipediaSearchRequestSchema, yZ as WorkspaceCommandIndex, y_ as WorkspaceCommandIndexSchema, y$ as WorkspaceCommandShapes, z0 as WorkspaceCommandShapesSchema, z1 as WorkspaceEditResponse, z2 as WorkspaceEditResponseSchema, z3 as WorkspaceIndexMeta, z4 as WorkspaceIndexMetaSchema, z5 as WorkspaceIndexStatus, z6 as WorkspaceIndexStatusSchema, z7 as WorkspaceInstructionIndex, z8 as WorkspaceInstructionIndexSchema, z9 as WorkspaceReadFileError, za as WorkspaceReadFileErrorSchema, zb as WorkspaceReadFileRequest, zc as WorkspaceReadFileRequestSchema, zd as WorkspaceReadFileResult, ze as WorkspaceReadFileResultSchema, zf as WorkspaceReadFileSuccess, zg as WorkspaceReadFileSuccessSchema, zh as WorkspaceSkillIndex, zi as WorkspaceSkillIndexSchema, zj as WriteDocumentRequest, zk as WriteDocumentRequestSchema, zl as XtcSamplerConfig, zm as XtcSamplerSchema, zn as applyStepPatch, zo as assertCraftbookGraph, zp as compareSemver, zq as craftbookRequirementsMet, zr as credentialCapabilityName, zs as gateEdgeTargets, zt as isCredentialCapability, zu as isDraftTask, zv as isKnownProfileId, zw as isLegacyGateSpec, zx as isNightShiftTask, zy as isPendingNightShiftTask, zz as isScheduleHost, zA as isSemver, zB as levelForXp, zC as modelFitnessKey, zD as normalizeCodexPermissionMode, zE as normalizeScriptRefs, zF as normalizeStepGate, zG as parseCraftbookTestSpec, zH as parseTaskRef, zI as profileKind, zJ as projectAllowsAmbientWork, zK as removeStepAndCleanEdges, zL as reorderStepsArray, zM as resolveProfileChain, zN as resolveProjectTypeId, zO as resolveSteps, zP as slugifyStepId, zQ as spawnsChildren, zR as stepInsertionIndex, zS as taskRef, zT as tierAtLeast, zU as tierRank, zV as uniqueStepId, zW as unmetConnectors, zX as unmetCraftbookRequirements, zY as unmetToolsets, zZ as validateCraftbookGraph, z_ as validateCraftbookScriptRefs, z$ as validateScriptInput, A0 as xpForLevel } from './index-D_dch9Qh.js';
3
+ import { G as GezelGender, C as CraftbookDocError, a as CraftbookDoc, b as CraftbookDocFormat } from './report-action-DzdQHzGG.js';
4
+ export { A as ApplyEditsAction, c as ApplyEditsActionSchema, d as ChatEvent, e as ChatEventEnvelope, f as ChatEventEnvelopeSchema, g as ChatEventSchema, h as ChatMessage, i as ChatMessageSchema, j as ChatMessageToolCall, k as ChatMessageToolCallSchema, l as ChatTurnErrorDetail, m as ChatTurnErrorDetailSchema, n as CraftbookDocSchema, o as CreateTaskAction, p as CreateTaskActionSchema, D as DismissReportActionRequest, q as DismissReportActionRequestSchema, F as FireCraftbookAction, r as FireCraftbookActionSchema, s as FireReportActionRequest, t as FireReportActionRequestSchema, u as FireReportActionResponse, v as FireReportActionResponseSchema, w as FixedFunctionConfig, x as FixedFunctionConfigSchema, y as GezelDetail, z as GezelDetailSchema, B as GezelFrontmatter, E as GezelFrontmatterSchema, H as GezelGenderSchema, I as GezelSection, J as GezelSectionSchema, K as GezelSummary, L as GezelSummarySchema, M as GezelTrait, N as GezelTraitSchema, O as LOCAL_PROVIDER_NAMES, P as ParsedGezel, Q as ParsedGezelSchema, R as ParsedReportAction, S as ProviderName, T as ProviderNameSchema, U as ReportAction, V as ReportActionKind, W as ReportActionKindSchema, X as ReportActionParseIssue, Y as ReportActionParseIssueSchema, Z as ReportActionRecord, _ as ReportActionRecordSchema, $ as ReportActionSchema, a0 as ReportActionState, a1 as ReportActionStateSchema, a2 as ReportActionView, a3 as ReportActionViewSchema, a4 as ReportActionsResponse, a5 as ReportActionsResponseSchema, a6 as ToolCallAudio, a7 as ToolCallAudioSchema, a8 as ToolCallImage, a9 as ToolCallImageSchema, aa as ToolCallVideo, ab as ToolCallVideoSchema, ac as craftbookDocFormatFromEnv, ad as editDistance, ae as formatCraftbookDocErrors, af as isLocalProvider, ag as nearestMatch, ah as sniffCraftbookDocFormat, ai as zodIssuesToDocErrors } from './report-action-DzdQHzGG.js';
5
+ import { MdSection } from './markdown/index.js';
6
+ export { CraftbookMarkdownParse, FENCE, ParsedReportActions, REPORT_ACTION_AUTHORING_GUIDE, REPORT_ACTION_FENCE_LANG, defaultStepIdForName, extractAllFences, extractFirstFence, findFirstH1, hasReportActionFence, isFenceClose, parseCraftbookMarkdown, parseGezelMarkdown, parseReportActionBlock, parseReportActions, parseYamlBlock, pickFence, promoteBareChannelNames, reportActionContentHash, serializeCraftbookMarkdown, serializeGezelMarkdown, splitSections, stringifyYamlBlock } from './markdown/index.js';
7
+ import { z } from 'zod';
8
+ export { D as DEVICE_HARD_TEMPERATURE_C } from './device-safety-DezzpNyR.js';
9
+
10
+ /**
11
+ * Pure-layout I/O for the city-map engine. The engine knows nothing about files,
12
+ * imports, or rendering — only weighted hierarchical nodes (paths), affinity
13
+ * edges between them, and their prior persisted coordinates. That is what lets
14
+ * the same engine lay out code, docs, and data folder trees unchanged.
15
+ */
16
+ /** One live node to place: a file path, its weight (LoC) and content hash. */
17
+ interface LayoutFileInput {
18
+ path: string;
19
+ weight: number;
20
+ contentHash: string | null;
21
+ /** Import-graph centrality [0,1] — widens yards (roomier hub lots). */
22
+ importance?: number;
23
+ /** Skyline landmark — the seed reserves an adjacent plaza. */
24
+ landmark?: boolean;
25
+ }
26
+ /** An affinity edge between two file paths (higher = pull closer / seed near). */
27
+ interface AffinityEdge {
28
+ a: string;
29
+ b: string;
30
+ weight: number;
31
+ }
32
+ /** A previously-persisted coordinate (district/block/street/plate/plaza),
33
+ * incl. tombstones. */
34
+ interface PriorNode {
35
+ nodeKind: 'district' | 'block' | 'street' | 'plate' | 'plaza';
36
+ nodeId: string;
37
+ /** For streets this is the interior folder ('' persisted as null). */
38
+ parentId?: string | null;
39
+ rect: Rect;
40
+ contentHash: string | null;
41
+ /** For streets the tier rides in this column. */
42
+ weight: number;
43
+ placedAt: string | null;
44
+ removedAt: string | null;
45
+ }
46
+ interface LayoutOptions {
47
+ /** World extent the first build seeds into (default 1000×1000). */
48
+ width?: number;
49
+ height?: number;
50
+ /** Timestamp stamped onto newly-placed / tombstoned nodes (engine is pure). */
51
+ nowIso: string;
52
+ /** Tombstones removed strictly before this ISO time are pruned (gentle GC). */
53
+ tombstoneCutoffIso?: string;
54
+ /** Macro placement memory: seeds honor these compass regions for top-level
55
+ * display districts (recorded to the city file at first seed). */
56
+ anchors?: VillageAnchor[];
57
+ /** User pins from the city file (region/rect for top-level folders). */
58
+ overrides?: VillageOverride[];
59
+ /** @deprecated pre-street block gap; kept for placeGhostBlocks callers. */
60
+ gap?: number;
61
+ }
62
+ /** Where a block ended up, and how it should read on the map. */
63
+ interface BlockPlacement {
64
+ /** The parcel: persistence + collision unit, frozen across builds. */
65
+ lot: Rect;
66
+ /** The building: derived from current LoC each build, clamped inside the lot. */
67
+ footprint: Rect;
68
+ state: 'live' | 'new' | 'tombstoned';
69
+ placedAt: string | null;
70
+ }
71
+ /** A row to persist back into `map_layout` (mirrors the store's LayoutRow). */
72
+ interface PersistNode {
73
+ nodeKind: 'district' | 'block' | 'street' | 'plate' | 'plaza';
74
+ nodeId: string;
75
+ parentId: string | null;
76
+ contentHash: string | null;
77
+ /** Blocks persist their LOT (not the footprint); streets their pavement rect. */
78
+ rect: Rect;
79
+ /** Blocks: LoC. Streets: tier (documented reuse of the column). */
80
+ weight: number;
81
+ placedAt: string | null;
82
+ removedAt: string | null;
83
+ }
84
+ interface LayoutResult {
85
+ /** path → placement, including tombstoned (gone) blocks kept as rubble. */
86
+ blocks: Map<string, BlockPlacement>;
87
+ /** one per folder prefix that contains ≥1 block (live or tombstoned). */
88
+ districts: MapDistrict[];
89
+ /** paved streets between folders/rows, stable across builds. */
90
+ streets: MapStreet[];
91
+ /** plazas (fronting landmarks) + greens (leftover packing space). */
92
+ plazas: MapPlaza[];
93
+ /** compass anchors recorded by a seed build ([] on incremental builds —
94
+ * the service keeps the city file's existing anchors then). */
95
+ anchors: VillageAnchor[];
96
+ /** the authoritative layout to write back to the store. */
97
+ persist: PersistNode[];
98
+ }
99
+
100
+ /** Block side length from line count: √-scaled so area tracks LoC, then clamped. */
101
+ declare function blockSize(loc: number): number;
102
+ /** Deterministic value in [0, 1) from a path + salt (FNV-1a core). */
103
+ declare function hash01(s: string, salt: number): number;
104
+ interface LotSpec {
105
+ lotW: number;
106
+ lotH: number;
107
+ /** Footprint rect relative to the lot origin. */
108
+ foot: Rect;
109
+ }
110
+ /**
111
+ * Deterministic parcel spec for a file: footprint area follows the same
112
+ * area-∝-LoC law as `blockSize`, with per-path aspect + yard jitter.
113
+ * `importance` (import-graph centrality, 0..1) widens the yards — hubs get
114
+ * roomier, greener lots. The bonus room lands ONLY on the right/bottom yards:
115
+ * the footprint's left/top anchor must be re-derivable without knowing the
116
+ * importance at seed time (`footprintWithin` regrows footprints inside frozen
117
+ * lots on every later build), so the anchor yards stay unscaled.
118
+ */
119
+ declare function lotSpec(path: string, weight: number, importance?: number): LotSpec;
120
+ /**
121
+ * The footprint for a file inside its (frozen) lot: anchored at its original
122
+ * yard offsets (so x,y never move), growing right/down with the file's LoC and
123
+ * clamped so a minimum yard always survives. A file that outgrows its lot
124
+ * saturates visually; the weight still travels on the wire.
125
+ */
126
+ declare function footprintWithin(path: string, weight: number, lot: Rect): Rect;
127
+ interface AppendResult {
128
+ lot: Rect;
129
+ /** A fresh tier-3 lane opened under the strip, when a new row was started. */
130
+ newLane: Rect | null;
131
+ }
132
+ /**
133
+ * Grow a folder's strip the way a city grows: extend the bottom parcel row
134
+ * rightward, or open a new row below behind a fresh lane. Works purely from
135
+ * the persisted sibling geometry — no reflow, no moved neighbours. Returns
136
+ * null when neither spot is clear (caller falls back to the spiral).
137
+ */
138
+ declare function appendLotInFolder(spec: LotSpec, siblingLots: Rect[], occupied: Rect[]): AppendResult | null;
139
+ interface StripLot {
140
+ path: string;
141
+ lot: Rect;
142
+ foot: Rect;
143
+ }
144
+ interface StripPlaza {
145
+ /** The landmark file this plaza fronts. */
146
+ path: string;
147
+ rect: Rect;
148
+ }
149
+ interface StripResult {
150
+ w: number;
151
+ h: number;
152
+ lots: StripLot[];
153
+ /** One lane rect below each row except the last (the folder street serves it). */
154
+ lanes: Rect[];
155
+ /** Open squares fronting landmark files (empty without landmarks). */
156
+ plazas: StripPlaza[];
157
+ }
158
+ interface StripOptions {
159
+ /** Row-wrap width; defaults to the ~square heuristic. The town packer sets
160
+ * this to the column width so parcel rows fill wall-to-wall. */
161
+ targetW?: number;
162
+ }
163
+ /**
164
+ * Pack one folder's direct files as parcel rows: path order (not size order —
165
+ * that's what killed the "sorted carpet" look), left→right with sidewalk gaps,
166
+ * bottom-aligned so buildings face the lane below their row. Landmark files
167
+ * (`LayoutFileInput.landmark`) get an adjacent plaza slot in their row.
168
+ */
169
+ declare function packLeafStrip(files: LayoutFileInput[], options?: StripOptions): StripResult;
170
+
171
+ /**
172
+ * Streets — the gaps the packer leaves between sibling boxes, materialized as
173
+ * first-class rects so the renderer can pave them and incremental placement
174
+ * can avoid building on them. Widths are hierarchical (CodeCity-style): wide
175
+ * avenues between top-level packages, narrowing to alleys deep in the tree.
176
+ */
177
+ /** tier 0..3: avenue, street, lane, alley. */
178
+ declare const STREET_WIDTHS: readonly [16, 10, 6, 4];
179
+ type StreetTier = 0 | 1 | 2 | 3;
180
+ declare function streetTier(depth: number): StreetTier;
181
+ declare function streetWidth(depth: number): number;
182
+ /** Interior perimeter padding of a folder box (half the next tier's street). */
183
+ declare function folderPad(depth: number): number;
184
+ /** A street segment in some container's local coordinates. */
185
+ interface StreetSeg {
186
+ rect: Rect;
187
+ tier: StreetTier;
188
+ /** Folder whose interior this street runs through ('' = the map root). */
189
+ folder: string;
190
+ }
191
+ /**
192
+ * Merge collinear strips (same row/column, touching or overlapping ranges) so
193
+ * streets read as continuous runs instead of per-box stubs. Best-effort: an
194
+ * unmerged pair just paints the same pavement twice.
195
+ */
196
+ declare function mergeStreets(segs: StreetSeg[]): StreetSeg[];
197
+ /** Stable, geometry-derived street id (streets have no natural name). */
198
+ declare function streetId(seg: StreetSeg): string;
199
+
200
+ interface Point {
201
+ x: number;
202
+ y: number;
203
+ }
204
+ /**
205
+ * Find the nearest position to `seed` where a `w`×`h` rect doesn't collide
206
+ * with any occupied rect — a coarse outward spiral. Falls back to the seed
207
+ * itself (allowing overlap) after a bounded search.
208
+ */
209
+ declare function nearestFreeRect(seed: Point, w: number, h: number, occupied: Rect[], gap: number): Rect;
210
+ /**
211
+ * Place transient "ghost" blocks (e.g. PR-added files not yet in the index)
212
+ * into the free space of an already-laid-out map without overlapping existing
213
+ * blocks or each other. Each ghost is seeded near a point (its district) and
214
+ * collision-avoided. Pure + deterministic (placed in id order). Not persisted —
215
+ * this is an overlay-time helper, so it doesn't disturb the stable layout.
216
+ */
217
+ declare function placeGhostBlocks(occupied: Rect[], ghosts: Array<{
218
+ id: string;
219
+ size: number;
220
+ seedX: number;
221
+ seedY: number;
222
+ }>, gap?: number): Map<string, Rect>;
223
+ declare function layoutFileMap(files: LayoutFileInput[], edges: AffinityEdge[], prior: PriorNode[], options: LayoutOptions): LayoutResult;
224
+ /**
225
+ * Lay symbols out as a small grid of buildings inside a block, in source order
226
+ * (top-to-bottom = file order). Height and footprint follow the symbol's line
227
+ * span on the absolute `symbolSizeT` scale, bounded on both ends: a floor so
228
+ * every building stays visible, a cap so one giant can't flatten the rest.
229
+ * When a block can't host every symbol at `MIN_CELL`, the largest symbols win
230
+ * the ground (still placed in source order); `MapBlock.buildingCount` keeps
231
+ * reporting the true total.
232
+ */
233
+ declare function layoutBuildingsInBlock(blockId: string, blockRect: Rect, symbols: Array<{
234
+ name: string;
235
+ kind: string;
236
+ lineStart: number;
237
+ lineEnd: number;
238
+ }>): MapBuilding[];
239
+
240
+ /**
241
+ * Display districts and their label plates. The v2 map labeled every folder
242
+ * prefix at its rect corner, so pass-through chains (`packages/x/src` where
243
+ * each level has one child and no files) painted three near-coincident labels
244
+ * — the single worst legibility bug on the old map. Here the chain collapses
245
+ * structurally into ONE display district labeled once (`x/src`), and every
246
+ * display district reserves a real plate rect the renderer draws into.
247
+ */
248
+ /** Reserved label headroom inside a folder box (world units). Must stay under
249
+ * the street router's BRIDGE distance (20) minus the deepest folder pad, so
250
+ * district interiors remain routable: max folderPad (5) + PLATE_H < 20. */
251
+ declare const PLATE_H = 11;
252
+ /** A folder tree with pass-through chains folded into single display nodes. */
253
+ interface CollapsedNode {
254
+ /** Full folder path ('' at the root, which is never itself collapsed). */
255
+ path: string;
256
+ /** Label relative to the parent display node (e.g. 'x/src'). '' at root. */
257
+ label: string;
258
+ children: CollapsedNode[];
259
+ files: LayoutFileInput[];
260
+ weight: number;
261
+ }
262
+ /** Collapse a file set into a display tree. The root stays the root. */
263
+ declare function collapseFiles(files: LayoutFileInput[]): CollapsedNode;
264
+ /** folder path → display label, for every display district in the live tree.
265
+ * Folders absent from this map (interior links of a collapsed chain, and the
266
+ * root) must not be labeled at all. */
267
+ declare function displayLabels(files: LayoutFileInput[]): Map<string, string>;
268
+ /** The plate rect for a label at a district's interior top-left. */
269
+ declare function plateRectFor(label: string, x: number, y: number, availW: number): Rect;
270
+
271
+ /** Region containing a normalized centroid. */
272
+ declare function regionOf(cx: number, cy: number): CompassRegion;
273
+ declare function regionCell(region: CompassRegion): {
274
+ row: number;
275
+ col: number;
276
+ };
277
+ /**
278
+ * Derive anchors from a PRIOR layout's block rects — the v4→v5 migration
279
+ * path: before a version bump discards the old geometry, remember which
280
+ * compass region each top-level folder's centroid occupied so the re-seed
281
+ * preserves the user's mental map.
282
+ */
283
+ declare function deriveAnchorsFromPrior(priorBlocks: readonly PriorNode[]): VillageAnchor[];
284
+ /**
285
+ * Assign a compass region to each top-level item. Priority per item:
286
+ * override.region (exact-path match) → anchor.region → deterministic
287
+ * capacity balancing (largest first into the least-loaded region, ties in
288
+ * NW→SE order).
289
+ */
290
+ declare function assignRegions(items: ReadonlyArray<{
291
+ path: string;
292
+ area: number;
293
+ }>, anchors: readonly VillageAnchor[], overrides: readonly VillageOverride[]): Map<string, CompassRegion>;
294
+
295
+ /**
296
+ * The v5 "planned town" seed packer, replacing the potpack bin-packer whose
297
+ * 95%-fill height-sorted output read as a defrag visualization. Three ideas:
298
+ *
299
+ * - COLUMN ("ladder") PACKING per folder: sibling boxes stand in height-
300
+ * balanced columns; the vertical streets between columns run the full
301
+ * container height and every cross-street terminates on them, so the street
302
+ * network is connected by construction (the UI's Dijkstra router needs no
303
+ * changes). Deliberate jittered slack (~0.75 fill vs 0.95) lets districts
304
+ * breathe and their silhouettes vary.
305
+ *
306
+ * - COMPASS MACRO at the root: top-level display districts land in a sparse
307
+ * 3×3 grid steered by village-file anchors/overrides, with tier-0 boulevards
308
+ * spanning the whole map between occupied grid rows/columns. Re-seeds keep
309
+ * `packages/` where the user remembers it.
310
+ *
311
+ * - RESERVED GEOMETRY for labels and open space: every display district's
312
+ * plate (PLATE_H headroom) and every landmark plaza / leftover green is a
313
+ * first-class rect the incremental engine treats as occupied.
314
+ */
315
+ interface TownPlate {
316
+ folder: string;
317
+ rect: Rect;
318
+ }
319
+ interface TownPlaza {
320
+ id: string;
321
+ folder: string;
322
+ rect: Rect;
323
+ kind: 'plaza' | 'green';
324
+ blockId?: string;
325
+ }
326
+ interface TownResult {
327
+ w: number;
328
+ h: number;
329
+ lots: Map<string, {
330
+ lot: Rect;
331
+ foot: Rect;
332
+ }>;
333
+ streets: StreetSeg[];
334
+ plates: TownPlate[];
335
+ plazas: TownPlaza[];
336
+ }
337
+ interface TownRootResult extends TownResult {
338
+ anchors: VillageAnchor[];
339
+ }
340
+ /** Pack one collapsed folder (children + direct files) at `depth`. */
341
+ declare function packTownNode(node: CollapsedNode, depth: number): TownResult;
342
+ /** Pack a wholly-new subtree (incremental folder arrival) at `folderDepth`. */
343
+ declare function packTownSubtree(files: LayoutFileInput[], folderDepth: number): TownResult;
344
+ interface TownRootOptions {
345
+ anchors?: VillageAnchor[];
346
+ overrides?: VillageOverride[];
347
+ nowIso: string;
348
+ }
349
+ /**
350
+ * Seed the whole city: top-level display districts into the sparse compass
351
+ * grid, boulevards between occupied grid rows/columns, anchors recorded.
352
+ */
353
+ declare function packTownRoot(files: LayoutFileInput[], options: TownRootOptions): TownRootResult;
354
+
355
+ /**
356
+ * Pure facts→markdown composer for the per-symbol context sections shown in
357
+ * file viewers. Consumed by two hosts — the Map tab's embedded squisq editor
358
+ * (Monaco view zones) and the vscode extension (CodeLens/Hover) — so it emits
359
+ * host-neutral markdown plus a plain-text strip variant, and links use the
360
+ * gezel href grammar below, which each host translates to its own navigation.
361
+ *
362
+ * Link grammar (the single source of truth both hosts parse):
363
+ * - cross-file: `gezel-nav:` + encodeURIComponent(workspaceRelativePath)
364
+ * + optional `#L<line>`
365
+ * - in-file: bare fragment `#L<line>`
366
+ */
367
+ type GezelHref = {
368
+ kind: 'file';
369
+ path: string;
370
+ line?: number;
371
+ } | {
372
+ kind: 'line';
373
+ line: number;
374
+ };
375
+ /** One composed section, structurally spreadable into squisq's CodeContextSection. */
376
+ interface ComposedSection {
377
+ id: string;
378
+ /** 1-based line the section renders above (the symbol's lineStart). */
379
+ line: number;
380
+ /** One-line markdown strip (no links). */
381
+ summaryMarkdown: string;
382
+ /** The strip as plain text — CodeLens titles can't render markdown. */
383
+ summaryText: string;
384
+ /** Expanded body markdown. */
385
+ markdown: string;
386
+ defaultExpanded?: boolean;
387
+ }
388
+ interface ComposedCodeContext {
389
+ fileTop?: {
390
+ id: string;
391
+ summaryMarkdown: string;
392
+ summaryText: string;
393
+ markdown: string;
394
+ };
395
+ sections: ComposedSection[];
396
+ }
397
+ declare function gezelNavHref(path: string, line?: number): string;
398
+ declare function gezelLineHref(line: number): string;
399
+ /** Parse a gezel href; null for anything outside the grammar (http:, #foo, …). */
400
+ declare function parseGezelHref(href: string): GezelHref | null;
401
+ /**
402
+ * Rewrite every gezel-grammar link destination in composed markdown via `fn`
403
+ * (e.g. to vscode `command:` URIs). Non-gezel links are left untouched. Only
404
+ * safe on markdown THIS module composed — it never emits the `](...)` pattern
405
+ * inside code fences.
406
+ */
407
+ declare function rewriteGezelHrefs(markdown: string, fn: (href: GezelHref) => string): string;
408
+ /** Escape text destined for markdown prose (names, titles, summaries). */
409
+ declare function escapeMd(text: string): string;
410
+ declare function composeFileContext(res: FileContextResponse): ComposedCodeContext;
411
+
412
+ /**
413
+ * Split a gezel script's source into three editable lenses — the
414
+ * imports/comments **preamble**, the `export const meta = defineScript({...})`
415
+ * **statement**, and the script **body** — and put them back together. This
416
+ * powers the three-tab script editor (Raw / Properties / Script) in the UI.
417
+ *
418
+ * The UI cannot reuse the service's TypeScript-AST parser
419
+ * (`packages/service/src/scripts/meta.ts`): that pulls in the `typescript`
420
+ * compiler, which is far too heavy for the browser bundle. Instead this module
421
+ * locates the meta statement with a small string/comment/template-literal-aware
422
+ * scanner and parses the meta object literal with a tiny recursive-descent
423
+ * parser. Both deliberately mirror the semantics of `meta.ts`:
424
+ * - the FIRST exported `meta` const wins;
425
+ * - `defineScript(...)` and a trailing `as const` / `satisfies` are unwrapped;
426
+ * - only literal shapes are accepted (no spreads, computed keys, or calls).
427
+ *
428
+ * The canonical schema (`ScriptMetaSchema`) is the final arbiter — every parse
429
+ * path validates through it, so the form never sees a shape the runtime would
430
+ * reject.
431
+ */
432
+
433
+ interface SplitScriptSource {
434
+ /** Everything before the meta statement: imports + any standalone comments. */
435
+ preamble: string;
436
+ /** Comment block (JSDoc or `//` lines) attached directly above the meta statement, or ''. */
437
+ metaLeadingComment: string;
438
+ /** The `export const meta = ...;` statement text, WITHOUT its leading comment. */
439
+ metaText: string;
440
+ /** Everything after the meta statement — the `const input = ...` body onward. */
441
+ body: string;
442
+ /** False when no meta statement could be located (Properties/Script tabs disable). */
443
+ found: boolean;
444
+ }
445
+ /**
446
+ * Locate the `export const meta = ...;` statement and split the source around
447
+ * it. Never throws — returns `{ found: false }` with the whole source in
448
+ * `preamble` when no meta statement is present.
449
+ */
450
+ declare function splitScriptSource(source: string): SplitScriptSource;
451
+ /**
452
+ * Reassemble a full source from its three regions, normalizing the spacing
453
+ * between them to a single blank line. The result always ends in one newline,
454
+ * matching the scaffold output.
455
+ */
456
+ declare function stitchScriptSource(parts: {
457
+ preamble: string;
458
+ /** The full meta region (leading comment + statement), or just the statement. */
459
+ metaText: string;
460
+ body: string;
461
+ }): string;
462
+ /** Join a split's leading comment and statement back into one meta region. */
463
+ declare function joinMetaRegion(split: Pick<SplitScriptSource, 'metaLeadingComment' | 'metaText'>): string;
464
+ /**
465
+ * Count the leading lines a full source devotes to "setup" — the preamble
466
+ * (imports + standalone comments) plus the `export const meta = ...;`
467
+ * statement, i.e. everything before the body begins.
468
+ *
469
+ * The Script tab feeds Monaco the WHOLE file (so `gezel`, `meta`, and
470
+ * `InferredInput<typeof meta>` all resolve and type-check) but hides these
471
+ * lines from view, so the user edits only the body. Returns 0 when there's no
472
+ * meta statement — nothing to hide, and the Script tab is disabled anyway.
473
+ */
474
+ declare function setupLineSpan(source: string): number;
475
+ /**
476
+ * Parse a meta statement's object literal into a validated `ScriptMeta`. This
477
+ * is the one place the UI reads meta back out of text (after a Raw-tab edit);
478
+ * `initialMeta` from the server covers the initial load.
479
+ */
480
+ declare function parseMetaObject(metaText: string): {
481
+ ok: true;
482
+ meta: ScriptMeta;
483
+ } | {
484
+ ok: false;
485
+ error: string;
486
+ };
487
+ /** Escape a value for interpolation inside a single-quoted TS string. */
488
+ declare function quoteSingle(value: string): string;
489
+ /**
490
+ * Serialize a `ScriptMeta` into a canonical `export const meta =
491
+ * defineScript({...});` block matching the scaffold's formatting (2-space
492
+ * indent, single quotes, trailing commas, descriptors inline).
493
+ *
494
+ * Note: this regenerates the block from data — any hand-written comments or
495
+ * formatting INSIDE `defineScript({...})` are dropped. Callers re-serialize
496
+ * only when the Properties form was actually edited.
497
+ */
498
+ declare function serializeScriptMeta(meta: ScriptMeta): string;
499
+ /**
500
+ * The Properties form models `inputs`/`outputs` as ARRAYS of descriptors with a
501
+ * synthetic `name` field — because squisq's `JsonEditor` edits one value object,
502
+ * not a name-keyed record. `metaToFormValue` / `formValueToMeta` bridge the two.
503
+ * JSON-valued fields (`default`/`schema` on json/object types) are carried as
504
+ * pretty-printed JSON strings so they survive a round-trip through the form.
505
+ */
506
+ interface MetaInputFormItem {
507
+ name: string;
508
+ type: ScriptInputField['type'];
509
+ description: string;
510
+ required?: boolean;
511
+ default?: string | number | boolean;
512
+ pattern?: string;
513
+ multiline?: boolean;
514
+ min?: number;
515
+ max?: number;
516
+ integer?: boolean;
517
+ options?: Array<{
518
+ value: string;
519
+ label?: string;
520
+ }>;
521
+ kind?: 'gezel' | 'task' | 'artifact' | 'document';
522
+ defaultJson?: string;
523
+ schemaJson?: string;
524
+ }
525
+ interface MetaOutputFormItem {
526
+ name: string;
527
+ type: ScriptOutputField['type'];
528
+ description: string;
529
+ nullable?: boolean;
530
+ itemType?: 'string' | 'number' | 'boolean' | 'object';
531
+ schemaJson?: string;
532
+ }
533
+ interface MetaFormValue {
534
+ name: string;
535
+ description: string;
536
+ kind?: 'action' | 'gate';
537
+ inputs: MetaInputFormItem[];
538
+ outputs: MetaOutputFormItem[];
539
+ requires: string[];
540
+ }
541
+ declare function metaToFormValue(meta: ScriptMeta): MetaFormValue;
542
+ /**
543
+ * Rebuild a validated `ScriptMeta` from the form value. Rejects empty/duplicate
544
+ * input or output names, strips keys irrelevant to the chosen `type` (left over
545
+ * after a type switch), then validates through `ScriptMetaSchema`.
546
+ */
547
+ declare function formValueToMeta(v: MetaFormValue): {
548
+ ok: true;
549
+ meta: ScriptMeta;
550
+ } | {
551
+ ok: false;
552
+ issues: string[];
553
+ };
554
+
555
+ /**
556
+ * Map pre-quantized catalog ids from older installs/eval caches to the
557
+ * current chat-model catalog ids. The installed model manifest may keep
558
+ * an old id (`qwen3.5-9b`) while the catalog entry now encodes size and
559
+ * quantization (`qwen3.5-9b-q4`). Catalog-driven tuning, model profiles,
560
+ * eval hints, and reasoning budgets all need the current id.
561
+ */
562
+ declare function normalizeChatModelCatalogId(modelId: string | undefined): string | undefined;
563
+
564
+ /**
565
+ * ─ Project-local gezel id codec ─────────────────────────────────────
566
+ *
567
+ * Project-local gezels live in a project's workspace `.gezel/` folder but
568
+ * still flow through the *global* gezel id space — sessions, memories,
569
+ * mentions, `voormanGezelId`, and `getGezel(id)` all key off a single
570
+ * opaque string. To route those calls to the project-local store without
571
+ * a parallel call graph, we give every project-local gezel an *encoded*
572
+ * id that:
573
+ *
574
+ * 1. is a routing prefix (`tryGetGezel` checks it and delegates), and
575
+ * 2. is a legal filesystem directory name AND a legal URL path segment,
576
+ * so all the existing app-data plumbing (poppetje.json, sessions/,
577
+ * memories/ under `~/.gezel/gezels/<id>/`) works UNCHANGED.
578
+ *
579
+ * Form: `proj__<projectId>__<localId>`.
580
+ *
581
+ * Both `projectId` and `localId` are `slugify()` output — `[a-z0-9-]`
582
+ * only, never `_` — so `__` is an unambiguous delimiter and the first
583
+ * `__` after the `proj__` prefix always separates the project from the
584
+ * local id. A raw `:` / `/` scheme was rejected: `:` is illegal in
585
+ * Windows paths and `/` would nest directories under the gezels root.
586
+ */
587
+ /** Reserved local id for the canonical `@project` gezel (derived from AGENTS.md/CLAUDE.md). */
588
+ declare const PROJECT_GEZEL_LOCAL_ID = "project";
589
+ /** Prefix that marks an encoded project-local gezel id. */
590
+ declare const PROJECT_GEZEL_ID_PREFIX = "proj__";
591
+ /** Encode a project + local id into the global gezel id space. */
592
+ declare function encodeProjectGezelId(projectId: string, localId: string): string;
593
+ /** Convenience: the encoded id of a project's canonical `@project` gezel. */
594
+ declare function projectGezelId(projectId: string): string;
595
+ /**
596
+ * Decode an encoded project-local gezel id. Returns null for any id that
597
+ * isn't project-local (i.e. a normal global gezel id) so callers can use
598
+ * it as a routing test: `const dec = decodeProjectGezelId(id); if (dec) …`.
599
+ */
600
+ declare function decodeProjectGezelId(id: string): {
601
+ projectId: string;
602
+ localId: string;
603
+ } | null;
604
+ /** True when `id` belongs to the project-local namespace. */
605
+ declare function isProjectGezelId(id: string): boolean;
606
+ /** True when `id` is the canonical `@project` gezel for some project. */
607
+ declare function isCanonicalProjectGezelId(id: string): boolean;
608
+
609
+ /**
610
+ * Per-gezel chat-bubble fonts. Each entry is one of the self-hosted WOFF2
611
+ * families declared in packages/ui/src/assets/fonts/fonts.css. Gezels store
612
+ * the `id` (kebab-case) on their frontmatter; the UI resolves it back to a
613
+ * CSS font-family via `resolveGezelFontFamily`. An unset or unknown id
614
+ * falls through to the chat-bubble default (PT Serif — `.msg-body` rule
615
+ * in styles.css).
616
+ *
617
+ * `scale` is an optional per-font size-adjustment factor (default 1):
618
+ * different typefaces render at noticeably different visual sizes at the
619
+ * same point size, so a font that looks oversized gets nudged down to sit
620
+ * proportional to the rest. The UI multiplies the base chat font-size by
621
+ * this factor (see `resolveGezelFontScale`).
622
+ */
623
+ declare const GEZEL_CHAT_FONTS: readonly [{
624
+ readonly id: "pt-serif";
625
+ readonly label: "PT Serif (default)";
626
+ readonly family: "'PT Serif'";
627
+ }, {
628
+ readonly id: "hanken-grotesk";
629
+ readonly label: "Hanken Grotesk";
630
+ readonly family: "'Hanken Grotesk'";
631
+ }, {
632
+ readonly id: "cormorant-garamond";
633
+ readonly label: "Cormorant Garamond";
634
+ readonly family: "'Cormorant Garamond'";
635
+ }, {
636
+ readonly id: "crimson-text";
637
+ readonly label: "Crimson Text";
638
+ readonly family: "'Crimson Text'";
639
+ }, {
640
+ readonly id: "dm-sans";
641
+ readonly label: "DM Sans";
642
+ readonly family: "'DM Sans'";
643
+ }, {
644
+ readonly id: "dm-serif-display";
645
+ readonly label: "DM Serif Display";
646
+ readonly family: "'DM Serif Display'";
647
+ }, {
648
+ readonly id: "ibm-plex-sans";
649
+ readonly label: "IBM Plex Sans";
650
+ readonly family: "'IBM Plex Sans'";
651
+ }, {
652
+ readonly id: "inter";
653
+ readonly label: "Inter";
654
+ readonly family: "'Inter'";
655
+ }, {
656
+ readonly id: "jetbrains-mono";
657
+ readonly label: "JetBrains Mono";
658
+ readonly family: "'JetBrains Mono'";
659
+ readonly scale: 0.9;
660
+ }, {
661
+ readonly id: "lora";
662
+ readonly label: "Lora";
663
+ readonly family: "'Lora'";
664
+ }, {
665
+ readonly id: "merriweather";
666
+ readonly label: "Merriweather";
667
+ readonly family: "'Merriweather'";
668
+ }, {
669
+ readonly id: "oswald";
670
+ readonly label: "Oswald";
671
+ readonly family: "'Oswald'";
672
+ }, {
673
+ readonly id: "playfair-display";
674
+ readonly label: "Playfair Display";
675
+ readonly family: "'Playfair Display'";
676
+ }, {
677
+ readonly id: "roboto";
678
+ readonly label: "Roboto";
679
+ readonly family: "'Roboto'";
680
+ }, {
681
+ readonly id: "source-serif-4";
682
+ readonly label: "Source Serif";
683
+ readonly family: "'Source Serif 4'";
684
+ }];
685
+ type GezelFont = (typeof GEZEL_CHAT_FONTS)[number];
686
+ type GezelFontId = GezelFont['id'];
687
+ declare function resolveGezelFontFamily(id: string | undefined | null): string | undefined;
688
+ /**
689
+ * Per-font size-adjustment factor. Returns 1 for an unset / unknown id or
690
+ * any font that doesn't declare a `scale`, so callers can multiply
691
+ * unconditionally.
692
+ */
693
+ declare function resolveGezelFontScale(id: string | undefined | null): number;
694
+
695
+ type AIEngagementMode = 'proactive' | 'scheduled' | 'reactive' | 'off';
696
+ declare function getEngagementMode(cfg: Pick<GezelConfig, 'aiEngagementMode'>): AIEngagementMode;
697
+ declare function isProactiveAllowed(cfg: Pick<GezelConfig, 'aiEngagementMode'>): boolean;
698
+ /** Whether autonomous work on active tasks may start or advance. */
699
+ declare function isTaskWorkAllowed(cfg: Pick<GezelConfig, 'aiEngagementMode'>): boolean;
700
+ declare function isSchedulingAllowed(cfg: Pick<GezelConfig, 'aiEngagementMode'>): boolean;
701
+ declare function isEngagementAllowed(cfg: Pick<GezelConfig, 'aiEngagementMode'>): boolean;
702
+ type WorkshopTempo = 'gezellig' | 'bedrijvig' | 'druk' | 'dolle-boel';
703
+ declare function getWorkshopTempo(cfg: Pick<GezelConfig, 'workshopTempo'>): WorkshopTempo;
704
+ interface WorkshopTempoDefaults {
705
+ rapidIntervalMs: number;
706
+ slowIntervalMs: number;
707
+ recentActivityWindowMs: number;
708
+ rapidAttemptsBeforeBackoff: number;
709
+ /**
710
+ * Grace period applied to the very first nudge a project ever
711
+ * receives, measured from `project.createdAt`. Once the project
712
+ * has been nudged at least once this guard no longer applies and
713
+ * the rapid/slow cadence takes over.
714
+ *
715
+ * Without this, a freshly-kicked-off project gets pinged at the
716
+ * 5-minute mark exactly when the voorman is most likely deep in
717
+ * the first task and least likely to benefit from a "checking in"
718
+ * interruption. Tempo-specific so the laid-back `gezellig` mode
719
+ * gives lots of warm-up room while `dolle-boel` barely waits.
720
+ */
721
+ firstNudgeGraceMs: number;
722
+ }
723
+ declare function workshopTempoDefaults(tempo: WorkshopTempo): WorkshopTempoDefaults;
724
+
725
+ /**
726
+ * Pure time helpers for Night Shift mode, shared by the service-side
727
+ * `NightShiftManager` (window/latch decisions) and `TaskManager` (stamping
728
+ * `nightShift.lastRunDay` on a once-a-day task's completion). Keeping the
729
+ * window-key math in one place is what makes the once-per-day guard
730
+ * survive the midnight boundary: a single overnight window (e.g. 22:00 →
731
+ * 06:00) maps to ONE stable key — the local date the window *started* — so
732
+ * a task that ran at 23:00 is still "ran today" at 02:00 the next morning.
733
+ */
734
+ interface NightShiftWindow {
735
+ /** Local hour the window opens (0–23). */
736
+ startHour: number;
737
+ /** Local hour the window closes (0–23). May be ≤ startHour to wrap midnight. */
738
+ endHour: number;
739
+ }
740
+ /** Classic overnight default when nothing is configured. */
741
+ declare const DEFAULT_NIGHT_SHIFT_WINDOW: NightShiftWindow;
742
+ /** Local 'YYYY-MM-DD' for a date. */
743
+ declare function localDateKey(d: Date): string;
744
+ /** Whether `now` falls inside the (possibly midnight-wrapping) window. */
745
+ declare function isInNightShiftWindow(now: Date, window: NightShiftWindow): boolean;
746
+ /**
747
+ * Stable key for the window instance covering `now`: the local date on
748
+ * which the current window *started*, or null when `now` is outside the
749
+ * window. For a wrapping window, the early-morning tail (before `endHour`)
750
+ * belongs to the previous calendar day's window.
751
+ */
752
+ declare function nightShiftWindowKey(now: Date, window: NightShiftWindow): string | null;
753
+ /**
754
+ * Day key used to stamp/compare a once-a-day night-shift run: the
755
+ * window-start date when inside a window, else the plain local date.
756
+ */
757
+ declare function nightShiftDayKey(now: Date, window: NightShiftWindow): string;
758
+ /**
759
+ * The night window the morning review talks about: the current window
760
+ * when `now` is inside one, else the most recently COMPLETED window.
761
+ * `key` matches `nightShiftWindowKey` for instants inside that window
762
+ * (and therefore `Task.nightShift.lastRunDay` stamps from it). For an
763
+ * always-on window (equal bounds) the "window" is the last 24h and the
764
+ * key is the local date.
765
+ */
766
+ declare function lastNightShiftWindow(now: Date, window: NightShiftWindow): {
767
+ key: string;
768
+ start: Date;
769
+ end: Date;
770
+ };
771
+ /**
772
+ * The next local datetime the window opens, strictly after `now`. Used to
773
+ * pre-schedule an OS wake (`wakeOnStart`) so a sleeping machine comes up
774
+ * for the upcoming shift — the service can't detect the window if it's
775
+ * asleep, so the wake must be armed in advance.
776
+ */
777
+ declare function nextNightShiftStart(now: Date, window: NightShiftWindow): Date;
778
+
779
+ /**
780
+ * Well-known project properties — shared per-project configuration values
781
+ * stored in `project.properties` (see `ProjectSchema`). A property is a
782
+ * plain string keyed by a dotted id. Craftbook params bridge to them via
783
+ * a `projectProperty: '<id>'` annotation on a `paramSchema` property: the
784
+ * enable form prefills the param from the project property and writes the
785
+ * submitted value back, so the next book (or the same book next night)
786
+ * shares it.
787
+ *
788
+ * The registry below improves display (labels, suggestions) — it does NOT
789
+ * gate: unknown ids are legal and render with the raw id as the label.
790
+ * Add entries here when a second consumer appears for a value; a
791
+ * craftbook-private knob should stay a plain param.
792
+ */
793
+ type ProjectPropertyKind = 'string' | 'enum';
794
+ interface ProjectPropertyDefinition {
795
+ /** Dotted id, e.g. `content.language`. Stable — persisted in project.json. */
796
+ id: string;
797
+ label: string;
798
+ description: string;
799
+ kind: ProjectPropertyKind;
800
+ /** For `enum`: the allowed values. For `string`: optional quick-pick suggestions. */
801
+ options?: string[];
802
+ }
803
+ declare const PROJECT_PROPERTY_DEFINITIONS: ProjectPropertyDefinition[];
804
+ declare function projectPropertyDefinition(id: string): ProjectPropertyDefinition | undefined;
805
+ /**
806
+ * The `paramSchema` property annotation linking a craftbook param to a
807
+ * project property. Sits beside `type`/`description`/`squisq` inside a
808
+ * JSON-Schema property object:
809
+ *
810
+ * "language": { "type": "string", "projectProperty": "content.language" }
811
+ */
812
+ declare const PARAM_PROJECT_PROPERTY_KEY = "projectProperty";
813
+ /** Read the annotation off one paramSchema property object, if present. */
814
+ declare function paramProjectProperty(paramSchemaProperty: unknown): string | undefined;
815
+
816
+ /**
817
+ * Growth cosmetic unlock catalog — the single source of truth shared by
818
+ * the service (validating cosmetic proposals) and the UI (labels +
819
+ * accessory-dialog gating). Entries reference REAL poppetje slots only;
820
+ * the level badge is an HTML chip rendered automatically at level ≥2,
821
+ * not an unlock.
822
+ *
823
+ * Gating is UI-enforced and only blocks NEWLY selecting a locked option —
824
+ * a gezel already wearing one keeps it (grandfathering).
825
+ */
826
+ interface GrowthCosmetic {
827
+ /** Stable id stored in growth.json's unlockedCosmetics. */
828
+ id: string;
829
+ slot: 'hat' | 'dress' | 'accessory';
830
+ /** The poppetje option value this unlocks. */
831
+ option: string;
832
+ label: string;
833
+ /** Level at which this becomes selectable. */
834
+ level: number;
835
+ }
836
+ declare const GROWTH_COSMETICS: readonly GrowthCosmetic[];
837
+ declare function growthCosmeticById(id: string): GrowthCosmetic | undefined;
838
+ /** The next cosmetic at or below `level` that isn't in `unlockedIds`, if any. */
839
+ declare function nextLockedCosmetic(level: number, unlockedIds: ReadonlySet<string>): GrowthCosmetic | undefined;
840
+
841
+ /**
842
+ * Centralized security & compliance resolution.
843
+ *
844
+ * One config object (`config.securityPolicy`) is the single source of
845
+ * truth; every enforcement seam in the app resolves it through
846
+ * {@link resolveSecurityPolicy} and reads the effective capability set —
847
+ * never the raw level. The `level` is purely a UI label.
848
+ *
849
+ * The capability axis that actually matters is **agency**: these flags
850
+ * gate what the *model* may do autonomously. User-initiated actions (a
851
+ * human pulling a GitHub repo, downloading a HuggingFace model, the app
852
+ * running its own npm/node/CLI/MCP processes) are deliberately exempt.
853
+ */
854
+ type SecurityLevel = SecurityPolicy['level'];
855
+ /** A preset level (everything except the synthetic `custom`). */
856
+ type SecurityPresetLevel = Exclude<SecurityLevel, 'custom'>;
857
+ /** The five authoritative capability booleans (no `level`). */
858
+ type SecurityCapabilities = Omit<SecurityPolicy, 'level'>;
859
+ /**
860
+ * Copilot's SDK-native tools run outside Gezel's scoped MCP bridge. Keep
861
+ * those built-ins denied unless the user explicitly opts out, so an absent
862
+ * setting cannot bypass project scope, security-policy sinks, or auditing.
863
+ */
864
+ declare const DEFAULT_SANDBOX_COPILOT = true;
865
+ /**
866
+ * Resolve the install-level Copilot sandbox setting plus an optional
867
+ * per-gezel override. Explicit `false` remains the deliberate escape hatch;
868
+ * missing values fail closed to the sandboxed MCP surface.
869
+ */
870
+ declare function resolveSandboxCopilot(installSetting: boolean | undefined, gezelOverride?: boolean): boolean;
871
+ /**
872
+ * The resolved posture: the five stored capabilities plus the derived
873
+ * predicates the enforcement points consume directly.
874
+ */
875
+ interface ResolvedSecurityPolicy extends SecurityCapabilities {
876
+ /** Echoed for UI/telemetry; never read by enforcement. */
877
+ level: SecurityLevel;
878
+ /**
879
+ * Whether non-builtin (third-party) MCP toolsets may load. They bypass
880
+ * the builtin tool allowlist and can't be confined yet, so a declared
881
+ * "local-only" scope isn't trustworthy — allowed at `free` only.
882
+ */
883
+ allowNonBuiltinToolsets: boolean;
884
+ /**
885
+ * Whether the model's git/github tools (`run_git`, `github_*`) surface.
886
+ * Rides on file edits: git push / PR creation are mutations, and the
887
+ * `lockdown` preset (which enables edits) is exactly where GitHub R/W is
888
+ * intended to work, while `super-lockdown` (edits off) keeps the model
889
+ * out of git entirely. User-initiated GitHub R/O is unaffected — that
890
+ * path never goes through these tools.
891
+ */
892
+ allowModelGit: boolean;
893
+ /**
894
+ * Whether email sync + send may run. Both reach an external mail provider
895
+ * over the network, so they ride on `allowExternalServices` — present only
896
+ * at `free` among the presets. Under `lockdown`/`super-lockdown` the mail
897
+ * subsystem stays dormant: no background sync, and the send tool is not even
898
+ * exposed to the model (the strongest form of injection containment — the
899
+ * capability simply isn't there). User-initiated linking of a mailbox is a
900
+ * separate, deliberate action and is not gated here.
901
+ */
902
+ allowMail: boolean;
903
+ }
904
+ /**
905
+ * Preset → capability mapping. Keep in lockstep with the table in the
906
+ * Security & Compliance plan / panel copy.
907
+ *
908
+ * - `super-lockdown`: nothing leaves the machine. Local models only, no
909
+ * services, no scripts, no auto-update, no model git, and no
910
+ * shared-document writes from scripts. Read/review/index and the builtin
911
+ * artifact/document tools still work.
912
+ * Workspace file writes are NOT globally gated by this level — they are
913
+ * governed per project by {@link projectWorkspaceWritable}: internal
914
+ * workspaces (our own folder, nothing precious) stay writable, external
915
+ * working directories stay deny-until-opted-in.
916
+ * - `lockdown`: coding posture. Edits, scripts, cloud chat, GitHub R/W,
917
+ * auto-update — but no open-web research (services off).
918
+ * - `free`: everything.
919
+ */
920
+ declare const SECURITY_PRESETS: Record<SecurityPresetLevel, SecurityCapabilities>;
921
+ /**
922
+ * Fail-safe posture for a config with no stored policy. First-run migration
923
+ * explicitly writes `free` for legacy installs, preserving compatibility
924
+ * without making absence permanently mean "unrestricted".
925
+ */
926
+ declare const DEFAULT_SECURITY_LEVEL: SecurityPresetLevel;
927
+ /**
928
+ * Build a full {@link SecurityPolicy} object for a preset level — used by
929
+ * the slider (and the first-run step) to write the five booleans in
930
+ * lockstep with the chosen level.
931
+ */
932
+ declare function securityPolicyForLevel(level: SecurityPresetLevel): SecurityPolicy;
933
+ /**
934
+ * Given a set of capability booleans, return the preset level they match,
935
+ * or `'custom'` if they don't match any preset. Lets the UI re-label the
936
+ * slider to "Custom" the moment a toggle is flipped off-preset.
937
+ */
938
+ declare function classifySecurityLevel(caps: SecurityCapabilities): SecurityLevel;
939
+ /**
940
+ * Effective per-project workspace writability for gezel-initiated work —
941
+ * THE single gate for workspace file writes (tool surface, script
942
+ * `workspace.write` capability, Store mutations, ambient scheduler work).
943
+ *
944
+ * Semantics of `project.allowGezelWrites` (an optional boolean, so
945
+ * effectively a tri-state):
946
+ *
947
+ * - explicit `true` → writable, including external working dirs the
948
+ * user has consented to (the confirmation-dialog path);
949
+ * - explicit `false` → read-only for gezels, including internal
950
+ * workspaces (the per-project "edits off" switch);
951
+ * - unset → internal workspaces are writable (our folder
952
+ * under `~/.gezel/projects/<id>/workspace/`, no precious files),
953
+ * external `workingDir`s are not (the user's real folder — writes
954
+ * require the explicit opt-in above).
955
+ *
956
+ * The global security policy's `allowFileEdits` deliberately does NOT
957
+ * factor in: a fresh internal project (a checkers board, a scratch
958
+ * notebook) stays functional under super-lockdown, while folder-backed
959
+ * projects keep their deny-by-default consent gate at every security
960
+ * level. `undefined`/`null` project means the implicit default bucket —
961
+ * internal, writable.
962
+ */
963
+ declare function projectWorkspaceWritable(project?: Pick<Project, 'workingDir' | 'allowGezelWrites'> | null): boolean;
964
+ /**
965
+ * Resolve the effective security posture from config. The five stored
966
+ * booleans are always authoritative (the `level` is just a label); when
967
+ * the policy is absent we fall back to {@link DEFAULT_SECURITY_LEVEL}.
968
+ */
969
+ declare function resolveSecurityPolicy(config: Pick<GezelConfig, 'securityPolicy'>): ResolvedSecurityPolicy;
970
+
971
+ /**
972
+ * Single chokepoint for choosing between a gezel's friendly `name`
973
+ * ("Mira") and their kebab-case `roleBasedName` ("visual-designer").
974
+ *
975
+ * `roleBasedNameOnlyMode` is the global config flag: when on, every UI
976
+ * surface and every prompt substitution renders the role-based name.
977
+ * Imported from `@bendyline/gezel` by both UI and service.
978
+ */
979
+ interface DisplayableGezel {
980
+ name: string;
981
+ roleBasedName?: string;
982
+ }
983
+ declare function displayName(g: DisplayableGezel, roleBasedNameOnlyMode: boolean): string;
984
+
985
+ /**
986
+ * Process-wide structured logger. One namespaced instance per subsystem
987
+ * (`createLogger('chat')`, `createLogger('mcp-bridge')`, …) so output
988
+ * stays greppable and levels can be tuned without rewiring callers.
989
+ *
990
+ * The level gate is read from `GEZEL_LOG_LEVEL` at module load. Tests
991
+ * may override at runtime via `setLogLevel`. A null `GEZEL_LOG_LEVEL`
992
+ * defaults to `info` — debug noise stays off in packaged builds and CI
993
+ * unless a developer explicitly opts in.
994
+ *
995
+ * Per-namespace debug is available via `GEZEL_LOG_DEBUG` as a
996
+ * comma-separated allow-list (`GEZEL_LOG_DEBUG=chat,mcp-bridge`). A
997
+ * single `*` enables debug everywhere.
998
+ *
999
+ * Output goes to `stderr` for `warn`/`error`, `stdout` for `info`/`debug`,
1000
+ * matching Node's defaults so log aggregators that split streams keep
1001
+ * working.
1002
+ */
1003
+ type LogLevel = 'silent' | 'error' | 'warn' | 'info' | 'debug';
1004
+ interface Logger {
1005
+ readonly name: string;
1006
+ debug(message: string, ...rest: unknown[]): void;
1007
+ info(message: string, ...rest: unknown[]): void;
1008
+ warn(message: string, ...rest: unknown[]): void;
1009
+ error(message: string, ...rest: unknown[]): void;
1010
+ child(suffix: string): Logger;
1011
+ }
1012
+ declare function getLogLevel(): LogLevel;
1013
+ declare function setLogLevel(level: LogLevel): void;
1014
+ /**
1015
+ * Override the per-namespace debug allow-list. Pass `null` to clear.
1016
+ * Mainly used by tests; production callers set `GEZEL_LOG_DEBUG`.
1017
+ */
1018
+ declare function setDebugNamespaces(spec: string | null): void;
1019
+ declare function createLogger(name: string): Logger;
1020
+
1021
+ /**
1022
+ * Text scrubbers for anything that leaves the machine or lands in a durable
1023
+ * file: engine logs, persisted turn errors, and the body of a GitHub issue
1024
+ * the user is about to file.
1025
+ *
1026
+ * Two tiers, deliberately separate:
1027
+ *
1028
+ * - `redactCredentials` — credential shapes only. Cheap enough to run on
1029
+ * every log line, and safe to run on text the user will still read on
1030
+ * their own machine.
1031
+ * - `redactSensitive` — the publishing scrub. Adds home paths, temp dirs,
1032
+ * query-string tokens, and email addresses on top. Only for text that
1033
+ * is leaving the user's machine.
1034
+ *
1035
+ * Why the split: an `ENOENT … open '/Users/mike/proj/src/x.ts'` message is
1036
+ * genuinely useful to the user *on their own machine*. Collapsing that path
1037
+ * before they ever see it makes the app worse at the one thing errors are
1038
+ * for. The user's own disk is not a threat surface for the user's own paths
1039
+ * — a public issue tracker is.
1040
+ *
1041
+ * Why pattern-based (not a real secret-store diff):
1042
+ * - `SecretStore.listAll()` doesn't exist (and shouldn't — keyring
1043
+ * backends deliberately prevent bulk enumeration). So we'd have to copy
1044
+ * every known secret into plaintext memory just to build a substring
1045
+ * replacer. That's worse than scanning for the canonical shapes we know
1046
+ * carry credentials.
1047
+ * - False positives (redacting text that *looks* like a token but isn't)
1048
+ * cost nothing.
1049
+ * - False negatives would leak credentials. Be conservative.
1050
+ *
1051
+ * Browser-safe: regex only, no `node:` imports. The UI imports this.
1052
+ */
1053
+ declare const REDACTED = "[REDACTED]";
1054
+ declare const REDACTED_EMAIL = "[EMAIL]";
1055
+ /**
1056
+ * Replace any credential-shaped substrings with `[REDACTED]`. Pure function.
1057
+ * Returns the input unchanged when no pattern matches.
1058
+ */
1059
+ declare function redactCredentials(text: string): string;
1060
+ interface RedactSensitiveOptions {
1061
+ /** Collapse user home prefixes to `~` / `$GEZEL_HOME`. Default true. */
1062
+ homePaths?: boolean;
1063
+ /** Replace email addresses with `[EMAIL]`. Default true. */
1064
+ emails?: boolean;
1065
+ }
1066
+ /**
1067
+ * Full scrub for text the user is about to PUBLISH. Credentials always; home
1068
+ * paths and email addresses by default.
1069
+ *
1070
+ * Emails run before the credential table so the deliberately-broad JWT-ish
1071
+ * pattern can never eat half of a dotted local-part.
1072
+ */
1073
+ declare function redactSensitive(text: string, opts?: RedactSensitiveOptions): string;
1074
+
1075
+ /**
1076
+ * Shared knowledge about Ollama model families so the service and UI
1077
+ * stay aligned on which models behave like "reasoning" models. Ollama
1078
+ * doesn't expose a per-model capability flag we can trust today — this
1079
+ * is a curated prefix list. Keep it narrow: include families that
1080
+ * reliably consume their output budget on silent chain-of-thought
1081
+ * before producing a visible reply, nothing else.
1082
+ *
1083
+ * Add a family here when:
1084
+ * 1. Users report empty bubbles with the model selected.
1085
+ * 2. The model's Ollama page documents a reasoning / thinking mode.
1086
+ *
1087
+ * If Ollama later adds `capabilities: ["thinking"]` to `/api/show`
1088
+ * consistently, replace the prefix match with a runtime probe and
1089
+ * drop the list.
1090
+ */
1091
+ declare const OLLAMA_REASONING_MODEL_PREFIXES: string[];
1092
+ /**
1093
+ * True when the given Ollama model id looks like a reasoning model.
1094
+ * Matches both a leading prefix (`deepseek-r1:latest`) and an embedded
1095
+ * substring (`hf.co/bartowski/qwen3-thinking-gguf:Q4_K_M`) so tag
1096
+ * variants don't slip through. Case-insensitive.
1097
+ */
1098
+ declare function isOllamaReasoningModel(modelId: string): boolean;
1099
+ /**
1100
+ * Model families that leak unstructured chain-of-thought into the
1101
+ * visible reply unless explicitly instructed to wrap it. Broader than
1102
+ * `OLLAMA_REASONING_MODEL_PREFIXES` because the leakage problem isn't
1103
+ * confined to thinking-mode-on models — Qwen 3 base, Qwen 2.5, and a
1104
+ * handful of distillates pontificate freely as plain text and burn
1105
+ * their output token budget before reaching the actual tool call.
1106
+ *
1107
+ * Substrings, not prefixes — modelId may be an Ollama tag
1108
+ * (`qwen2.5:7b`), an MLX repo (`Qwen/Qwen3-30B-A3B-Instruct`), a
1109
+ * llama.cpp filesystem path (`/models/qwen3-coder-30b.gguf`), or a
1110
+ * bare HF id. Match case-insensitively against any substring.
1111
+ *
1112
+ * Add a family here when:
1113
+ * 1. Users report responses where reasoning prose dominates and
1114
+ * tool calls truncate or fail to materialize.
1115
+ * 2. The model's docs or runtime expose a native reasoning /
1116
+ * thinking mode.
1117
+ */
1118
+ declare const MODEL_FAMILIES_LEAKING_REASONING: string[];
1119
+ /**
1120
+ * True when the given model id (Ollama tag, MLX repo, llama.cpp path,
1121
+ * or bare HF id) belongs to a family known to leak chain-of-thought
1122
+ * into visible content unless told otherwise. Used by the system-
1123
+ * prompt builder to add local-model guidance, and by the Ollama
1124
+ * provider to bump the default `num_predict` cap so the leak doesn't
1125
+ * truncate the actual tool call mid-stream.
1126
+ */
1127
+ declare function leaksUntaggedReasoning(modelId: string | undefined): boolean;
1128
+
1129
+ /**
1130
+ * "Will this model run well on this machine?" — a hardware-fit tier for
1131
+ * a chat model, used to badge/rank models in the install browser and the
1132
+ * installed list.
1133
+ *
1134
+ * The key improvement over a naive `size > budget` check is **MoE
1135
+ * awareness**. A big Mixture-of-Experts model (e.g. a 35B-A3B at ~20 GB)
1136
+ * won't fit a 12 GB discrete GPU by raw size, but its sparse expert
1137
+ * weights can stream from system RAM (`--cpu-moe`) while attention runs
1138
+ * on the GPU — so it runs fine on a 12 GB card + 64 GB RAM. A naive
1139
+ * check labels it "may not fit"; this one labels it "runs (expert
1140
+ * offload)", which is exactly the "prefer MoE that fits" guidance.
1141
+ *
1142
+ * Pure and deterministic → unit-tested. The caller supplies the model's
1143
+ * estimated footprint and the machine's memory profile (both already
1144
+ * available from the catalog manifest + `/api/system/memory`).
1145
+ */
1146
+ type ModelFitTier = 'fits' | 'fits-offload' | 'tight' | 'too-big';
1147
+ interface ModelFitInput {
1148
+ /** Estimated GPU/host working set: on-disk size × overhead (KV, activations). */
1149
+ residentBytes: number;
1150
+ /** Mixture-of-Experts model — its experts can stream from system RAM. */
1151
+ isMoE: boolean;
1152
+ /** The fast memory budget: VRAM on a discrete GPU, a RAM fraction on unified/CPU. */
1153
+ usableBytes: number;
1154
+ /** Total system RAM in bytes. */
1155
+ totalRamBytes: number;
1156
+ /** Discrete GPU VRAM in bytes, or null on unified-memory / CPU-only machines. */
1157
+ gpuVramBytes: number | null;
1158
+ /**
1159
+ * What the capacity broker will actually admit on this machine
1160
+ * (`/api/system/memory` → `budgetBytes`). Anything above it is refused at
1161
+ * load time, so it — not a raw fraction of RAM — is where `too-big` starts.
1162
+ *
1163
+ * Optional for callers that predate the field; they keep the old
1164
+ * {@link RAM_OFFLOAD_FRACTION} ceiling, which on a discrete-GPU host
1165
+ * over-promised: it offered a 42 GB MoE against 80% of system RAM while
1166
+ * the broker's budget stopped at 60%, so the download succeeded and the
1167
+ * load did not.
1168
+ */
1169
+ admissibleBytes?: number;
1170
+ /**
1171
+ * Bytes `--cpu-moe` leaves GPU-resident (attention, dense/shared layers,
1172
+ * embeddings) — from the installed GGUF's tensor table, when scanned.
1173
+ * Absent (browse-time, pre-download) the check falls back to
1174
+ * {@link MOE_NON_EXPERT_FRACTION_ESTIMATE} of `residentBytes`.
1175
+ */
1176
+ nonExpertBytes?: number;
1177
+ }
1178
+ interface ModelFitResult {
1179
+ tier: ModelFitTier;
1180
+ /** Short pill label. */
1181
+ label: string;
1182
+ /** Longer tooltip explanation. */
1183
+ detail: string;
1184
+ /** True when the model can run at all (tier !== 'too-big'). */
1185
+ runnable: boolean;
1186
+ }
1187
+ /**
1188
+ * Browse-time estimate of the non-expert share of a MoE's footprint —
1189
+ * what `--cpu-moe` keeps on the GPU. Measured GGUFs run 5–10% for
1190
+ * DeepSeek-class giants and ~10–20% for consumer-size MoEs; 15% sits at
1191
+ * the honest end without gating out the machines full offload does serve
1192
+ * (a 4 GB card still clears a 26B-A4B). The exact per-tensor figure
1193
+ * replaces this whenever the caller has scanned the installed GGUF.
1194
+ */
1195
+ declare const MOE_NON_EXPERT_FRACTION_ESTIMATE = 0.15;
1196
+ /**
1197
+ * The working window Gezel guarantees a local chat model on a host with room
1198
+ * to spare. Tool loops, a project brief, and a few file reads spend most of a
1199
+ * 32K window before the user's second question, so this is the floor admission
1200
+ * defends by shedding engine slots rather than shortening context.
1201
+ */
1202
+ declare const LOCAL_CONTEXT_FLOOR_TOKENS = 65536;
1203
+ /**
1204
+ * The same floor on a memory-constrained host ({@link isMemoryConstrainedMachine}).
1205
+ * Half a working window still runs agentic loops — sessions just compact
1206
+ * sooner — while insisting on 64K there denies the launch outright: the KV at
1207
+ * 64K is what pushes a small machine past its budget, and a denial gives the
1208
+ * user nothing at all.
1209
+ */
1210
+ declare const CONSTRAINED_LOCAL_CONTEXT_FLOOR_TOKENS = 32768;
1211
+ /**
1212
+ * System RAM at or below which a unified-memory or CPU-only host counts as
1213
+ * memory-constrained. On those hosts the KV cache competes with the OS, the
1214
+ * Electron shell, and the weights for the same pool.
1215
+ */
1216
+ declare const CONSTRAINED_HOST_RAM_BYTES: number;
1217
+ /**
1218
+ * Usable VRAM at or below which a discrete card counts as memory-constrained.
1219
+ * Compared against the USABLE figure (~95% of the card), so an 8 GB card lands
1220
+ * under the line and a 10 GB one does not.
1221
+ */
1222
+ declare const CONSTRAINED_HOST_VRAM_BYTES: number;
1223
+ /** The memory shape of a host, as much of it as the context floor depends on. */
1224
+ interface MachineMemoryShape {
1225
+ totalRamBytes: number;
1226
+ /** Usable VRAM on a discrete card; null on unified / integrated / CPU-only hosts. */
1227
+ gpuVramBytes: number | null;
1228
+ }
1229
+ /**
1230
+ * Whether this host has to trade context for memory. A discrete card is judged
1231
+ * on VRAM alone — that is where its KV lives, so a 24 GB card next to 16 GB of
1232
+ * system RAM is not context-constrained. Everything else (Apple Silicon,
1233
+ * integrated GPUs, CPU-only) is judged on system RAM, the one pool it has.
1234
+ */
1235
+ declare function isMemoryConstrainedMachine(machine: MachineMemoryShape): boolean;
1236
+ /**
1237
+ * The context floor to hold this host to. The single derivation both the
1238
+ * daemon's admission ladder and the install browser's fit badges read, so a
1239
+ * model is never badged against a window admission would not have asked for.
1240
+ */
1241
+ declare function localContextFloorTokens(machine?: MachineMemoryShape | null): number;
1242
+ /**
1243
+ * The working window fit badges price KV at when the caller knows nothing
1244
+ * about the host. Prefer {@link localContextFloorTokens} with the machine's
1245
+ * memory profile — a constrained host launches at half this.
1246
+ */
1247
+ declare const FIT_KV_CONTEXT_TOKENS = 65536;
1248
+ /**
1249
+ * KV bytes a model would carry at the fit window, from the catalog's
1250
+ * authored f16 geometry (`kvBytesPerTokenF16` / `kvFixedBytesF16`).
1251
+ * Returns 0 when the manifest predates the fields — the fit check then
1252
+ * degrades to the historical weights-only estimate rather than blocking.
1253
+ * `cacheScale` converts the f16 baseline to the engine's cache dtype
1254
+ * (llama.cpp defaults to q8_0 ≈ 0.55; MLX runs f16 = 1).
1255
+ */
1256
+ declare function estimateManifestKvBytes(manifest: {
1257
+ kvBytesPerTokenF16?: number;
1258
+ kvFixedBytesF16?: number;
1259
+ }, opts?: {
1260
+ ctxTokens?: number;
1261
+ cacheScale?: number;
1262
+ }): number;
1263
+ /**
1264
+ * Classify a model's fit against a machine's memory. See the module
1265
+ * doc for the MoE-offload rationale.
1266
+ */
1267
+ declare function computeModelFit(input: ModelFitInput): ModelFitResult;
1268
+ /**
1269
+ * Best-effort Mixture-of-Experts detection from a model's catalog tags,
1270
+ * for browse-time (pre-install, no GGUF on disk). The catalog tags MoE
1271
+ * models inconsistently — `moe`, `mix of experts`, `mixture of experts`
1272
+ * — so we normalize all of them. Once installed, the GGUF's
1273
+ * `expert_count` is the ground truth (see the offload planner).
1274
+ */
1275
+ declare function isMoEFromTags(tags: readonly string[] | undefined): boolean;
1276
+
1277
+ /**
1278
+ * Compose the static RAM-axis fit (`computeModelFit`) with a persisted
1279
+ * fitness record (the proeve result) into one display badge. Pure and
1280
+ * unit-tested; shared by the UI pills and any service consumer.
1281
+ *
1282
+ * Warnings never gate: the badge informs, selection stays possible
1283
+ * everywhere.
1284
+ */
1285
+
1286
+ type FitnessBadgeTier = 'ok' | 'warn' | 'probing' | 'unknown';
1287
+ interface FitnessBadge {
1288
+ tier: FitnessBadgeTier;
1289
+ /** Short pill label. */
1290
+ label: string;
1291
+ /** Longer tooltip explanation. */
1292
+ detail: string;
1293
+ }
1294
+ interface FitnessBadgeInput {
1295
+ /** Static RAM-axis fit, when known (browse and installed surfaces). */
1296
+ ramFit?: ModelFitResult;
1297
+ /** Persisted proeve result plus its read-time freshness flags. */
1298
+ fitness?: {
1299
+ record: ModelFitnessRecord;
1300
+ stale: boolean;
1301
+ hardwareChanged: boolean;
1302
+ };
1303
+ /** A probe for this model is currently queued or running. */
1304
+ probing?: boolean;
1305
+ }
1306
+ declare function composeFitnessBadge(input: FitnessBadgeInput): FitnessBadge;
1307
+
1308
+ /**
1309
+ * The fields the recommendation gate reads — the structural subset every
1310
+ * model manifest satisfies, so the same predicate covers chat, image, video
1311
+ * and audio entries.
1312
+ */
1313
+ interface RecoGateInput {
1314
+ /** Hand-curated recommendation weight; absent → never recommended. */
1315
+ recoScore?: number;
1316
+ /** Only `'open'` models are ever recommended. */
1317
+ licenseClass?: string;
1318
+ /** Chat models declare this; media manifests have no such field. */
1319
+ supportsTools?: boolean;
1320
+ }
1321
+ /**
1322
+ * The single "would we recommend this model?" gate. The first-run picker
1323
+ * below, the ★ Recommended badge, the CLI bootstrap and the media pickers all
1324
+ * call this so they can never drift apart.
1325
+ *
1326
+ * Three conditions:
1327
+ * 1. a hand-curated positive `recoScore` — absent means no one nominated it;
1328
+ * 2. a fully-open license, so a stray score on a restricted model is ignored;
1329
+ * 3. tool support. Gezels do their work THROUGH the MCP toolset, so a model
1330
+ * that cannot call tools is never a sane default no matter how good its
1331
+ * prose is — it stays installable, but choosing it has to be the user's
1332
+ * deliberate act, not ours.
1333
+ *
1334
+ * Media manifests carry no `supportsTools` field, hence `!== false` rather
1335
+ * than `=== true`: undefined passes, only an explicit refusal disqualifies.
1336
+ */
1337
+ declare function isRecommendedModel(m: RecoGateInput): boolean;
1338
+ /**
1339
+ * A discrete GPU with more than this much VRAM runs a dense model fully
1340
+ * resident, so MoE expert-offload is a downgrade — skip MoE candidates.
1341
+ */
1342
+ declare const DENSE_ONLY_VRAM_THRESHOLD: number;
1343
+ interface RecoModelInput extends RecoGateInput {
1344
+ id: string;
1345
+ /** Catalog tags — MoE-ness is read from these via `isMoEFromTags`. */
1346
+ tags?: readonly string[];
1347
+ /** Provider-appropriate working set (manifest `residentBytes`, or on-disk × overhead). */
1348
+ residentBytes: number;
1349
+ /** Exact GPU-resident residue under `--cpu-moe`, when the GGUF has been scanned. */
1350
+ nonExpertBytes?: number;
1351
+ }
1352
+ interface RecoDevice {
1353
+ platform: string;
1354
+ /** GPU-addressable memory in bytes, or null when no accelerator was detected. */
1355
+ gpuVramBytes: number | null;
1356
+ /**
1357
+ * How that GPU memory relates to system RAM. Optional for compatibility
1358
+ * with older daemons/callers; absent values are inferred from
1359
+ * `gpuVramBytes` as far as possible.
1360
+ *
1361
+ * `integrated` is the consumer iGPU/UMA case where a Vulkan adapter may
1362
+ * advertise part of system RAM as device memory. `unified` is reserved for
1363
+ * high-throughput unified accelerators such as Apple Silicon and NVIDIA
1364
+ * GB10/DGX Spark, which must not be collapsed onto the CPU-only path.
1365
+ */
1366
+ gpuMemoryKind?: 'discrete' | 'integrated' | 'unified' | 'none' | 'unknown';
1367
+ totalRamBytes: number;
1368
+ /** The fast memory budget (VRAM on a discrete card, a RAM fraction otherwise). */
1369
+ usableBytes: number;
1370
+ /**
1371
+ * What the capacity broker will admit across every pool — `budgetBytes`
1372
+ * from `/api/system/memory`. Optional so older callers keep working; when
1373
+ * present it becomes the runnable ceiling, so we never recommend a model
1374
+ * the daemon then refuses to load.
1375
+ */
1376
+ budgetBytes?: number;
1377
+ }
1378
+ interface RecoPick {
1379
+ id: string;
1380
+ recoScore: number;
1381
+ /** One-line human-readable rationale (logged + surfaced to the user). */
1382
+ reason: string;
1383
+ }
1384
+ /**
1385
+ * Below 8 GiB, a discrete card cannot keep even a useful medium local model
1386
+ * resident. Expert offload may make a much larger MoE technically load, but
1387
+ * decode is then paced by system RAM/CPU and is not a functional first-run
1388
+ * recommendation.
1389
+ */
1390
+ declare const SMALL_MODEL_VRAM_THRESHOLD: number;
1391
+ /**
1392
+ * Non-Mac hosts that should receive the smallest safe recommended model:
1393
+ * CPU-only, consumer integrated/UMA graphics, or a discrete card below 8 GiB.
1394
+ * High-performance unified accelerators (notably GB10/DGX Spark) stay on the
1395
+ * normal large-model path.
1396
+ */
1397
+ declare function needsSmallModelRecommendation(device: RecoDevice): boolean;
1398
+ /** MoE offload is a Mac / small-GPU win; a big discrete GPU prefers dense. */
1399
+ declare function prefersMoE(device: RecoDevice): boolean;
1400
+ /** Big discrete GPU (> 24 GB VRAM, non-Mac) → run dense; drop MoE candidates. */
1401
+ declare function excludesMoE(device: RecoDevice): boolean;
1402
+ /**
1403
+ * Unified-memory host: Apple Silicon, or a non-Mac where the reported
1404
+ * "VRAM" is really the shared pool (GB10 / DGX Spark: nvidia-smi reports
1405
+ * no VRAM, so llama-server's device probe returns ~all of system RAM).
1406
+ *
1407
+ * Known gap this predicate exists to route around: `excludesMoE` above
1408
+ * reads `gpuVramBytes > 24 GB, non-Mac` as "big discrete GPU" and so
1409
+ * misfires TRUE on unified non-Mac hosts — exactly the bandwidth-bound
1410
+ * machines where MoE is the right call. Fixing `excludesMoE` changes
1411
+ * the first-run auto-pick and is deferred to a deliberate review (see
1412
+ * docs/model-fitness.md); the browse hint uses these predicates instead.
1413
+ */
1414
+ declare function isUnifiedMemoryDevice(device: RecoDevice): boolean;
1415
+ /**
1416
+ * Memory-bandwidth-bound host — unified memory, or a small discrete GPU
1417
+ * that must stream weights from system RAM. On these machines a sparse
1418
+ * MoE model (few experts active per token) responds faster than a dense
1419
+ * model of the same size.
1420
+ */
1421
+ declare function isBandwidthBoundHost(device: RecoDevice): boolean;
1422
+ interface HardwareHint {
1423
+ kind: 'moe-good-match' | 'large-dense-caution' | 'low-acceleration-caution';
1424
+ /** Short pill label. */
1425
+ label: string;
1426
+ /** Longer tooltip explanation. */
1427
+ detail: string;
1428
+ }
1429
+ /**
1430
+ * Browse-time, hint-only guidance for one model on this machine.
1431
+ * Advisory copy beside the fit pill — it never filters, ranks, or
1432
+ * changes the first-run pick (`prefersMoE`/`excludesMoE` above stay
1433
+ * byte-identical for that path).
1434
+ */
1435
+ declare function hardwareHint(device: RecoDevice, model: {
1436
+ isMoE: boolean;
1437
+ fitTier: string;
1438
+ residentBytes?: number;
1439
+ }): HardwareHint | null;
1440
+ /**
1441
+ * Pick the recommended model to install on `device`, or null when the catalog
1442
+ * carries no eligible (scored + open) candidate at all.
1443
+ */
1444
+ declare function pickRecommendedModel(models: readonly RecoModelInput[], device: RecoDevice): RecoPick | null;
1445
+ declare function videoMemoryBudgetBytes(device: RecoDevice): number;
1446
+ /**
1447
+ * Simple fit check for a MEDIA model (image / video). Image generation leans
1448
+ * on system RAM (sd-cpp runs partly on CPU), so it gates on `minRamGB`; video
1449
+ * generation needs real GPU VRAM (or Apple unified memory), so it gates on
1450
+ * `minVramGB` against the video-specific budget above. A field left undefined
1451
+ * isn't checked. Audio models carry neither floor, so callers treat them as
1452
+ * always fitting. Deliberately coarser than the chat picker — there's one
1453
+ * recommended model per media modality, so this only answers "can this device
1454
+ * run it at all?".
1455
+ */
1456
+ declare function mediaModelFits(device: RecoDevice, req: {
1457
+ minRamGB?: number;
1458
+ minVramGB?: number;
1459
+ }): boolean;
1460
+
1461
+ /**
1462
+ * Friendly-display utilities for the tool names that flow through the
1463
+ * chat event stream.
1464
+ *
1465
+ * Background: Claude CLI references MCP tools as `mcp__<server>__<tool>`
1466
+ * (e.g. `mcp__gezel__read_task_notes`, `mcp__playwright_mcp__browser_navigate`).
1467
+ * The raw form leaks our wire-protocol naming into UI surfaces — both
1468
+ * tool-call rows and intent breadcrumbs. Stripping the prefix and
1469
+ * humanizing the underscores gives the user a name they can actually
1470
+ * read ("read task notes" / "browser navigate") without us having to
1471
+ * thread the rich per-tool display map (lives in the UI layer) through
1472
+ * every code path.
1473
+ *
1474
+ * Shared between service and UI so service-emitted intent labels
1475
+ * ("using <tool>", "approved: <tool>", "awaiting your approval to use
1476
+ * <tool>") and UI-side tool-row rendering use the same conventions.
1477
+ */
1478
+ /**
1479
+ * Strip Claude CLI's `mcp__<server>__` prefix from a tool name. The
1480
+ * format is two-underscore-delimited (`__`) so server names that
1481
+ * themselves contain a single underscore (e.g. `playwright_mcp`) split
1482
+ * cleanly. Tools without the prefix (Claude built-ins like `Bash`,
1483
+ * `Read`; or gezel-mcp tools referenced bare like `save_memory` from
1484
+ * inside our own bridge) pass through unchanged.
1485
+ */
1486
+ declare function stripMcpPrefix(name: string): string;
1487
+ /**
1488
+ * Lightweight humanizer for tool names. Strips the MCP prefix and
1489
+ * replaces underscores with spaces. Returns lowercase — callers that
1490
+ * want title-case render via CSS (`text-transform: capitalize`) or
1491
+ * apply their own casing.
1492
+ *
1493
+ * Doesn't carry a rich per-tool display map — the UI's
1494
+ * `toolDisplayName` does that on top of `stripMcpPrefix`. This helper
1495
+ * is for service-side intent labels where the rich map isn't worth
1496
+ * threading through and a humanized fallback is enough.
1497
+ */
1498
+ declare function prettifyToolName(name: string): string;
1499
+ /**
1500
+ * Short, transient status text for a tool that is currently running.
1501
+ * Concrete tools keep their humanized name so the user sees useful
1502
+ * progress ("advance task step"), while provider-level implementation
1503
+ * buckets get a natural-language activity instead of protocol jargon.
1504
+ */
1505
+ declare function toolActivityLabel(name: string): string;
1506
+
1507
+ declare const maleNames: string[];
1508
+ declare const femaleNames: string[];
1509
+ declare function pickRandomName(): string;
1510
+ /**
1511
+ * Pronoun string for a gezel's gender — `he/him`, `she/her`, `they/them`.
1512
+ * Used in system-prompt headers and when one gezel references another.
1513
+ */
1514
+ declare function pronounsForGender(gender: GezelGender): string;
1515
+ /**
1516
+ * Grammatical forms for referring to a gezel in prose.
1517
+ *
1518
+ * `gender` is optional because legacy gezels predate the persisted field.
1519
+ * Unknown assignments fall back to neutral they/them rather than guessing
1520
+ * from the gezel's name.
1521
+ */
1522
+ interface GezelPronounForms {
1523
+ subject: 'he' | 'she' | 'they';
1524
+ object: 'him' | 'her' | 'them';
1525
+ possessiveAdjective: 'his' | 'her' | 'their';
1526
+ possessive: 'his' | 'hers' | 'theirs';
1527
+ reflexive: 'himself' | 'herself' | 'themselves';
1528
+ presentBe: 'is' | 'are';
1529
+ presentHave: 'has' | 'have';
1530
+ }
1531
+ declare function pronounFormsForGender(gender?: GezelGender): GezelPronounForms;
1532
+ /**
1533
+ * Pick a random first name AND the gender that goes with it. Names are
1534
+ * drawn 50/50 from the gendered pools; then a flat NON_BINARY_RATE share
1535
+ * of generated gezels has their gender flipped to non-binary (the name
1536
+ * is kept). Callers that want gender derived from a pre-chosen name
1537
+ * should use {@link inferGenderForName} instead.
1538
+ */
1539
+ declare function pickRandomNameWithGender(): {
1540
+ name: string;
1541
+ gender: GezelGender;
1542
+ };
1543
+ /**
1544
+ * Infer a gender for an arbitrary first name. Used by `Store.createGezel`
1545
+ * when the caller hands in an explicit name (Meester pool, MCP-supplied,
1546
+ * user-typed) without a paired gender. NB conversion is applied first
1547
+ * (so even pool names occasionally land non-binary); otherwise the name
1548
+ * is looked up in the gendered pools, falling back to a coin flip for
1549
+ * names not in either list.
1550
+ */
1551
+ declare function inferGenderForName(name: string): GezelGender;
1552
+
1553
+ interface KokoroVoiceInfo {
1554
+ id: string;
1555
+ name: string;
1556
+ language: 'en-US' | 'en-GB';
1557
+ gender: 'male' | 'female';
1558
+ /** Upstream's overall quality grade — used to weight the random picker. */
1559
+ grade: 'A' | 'A-' | 'B+' | 'B' | 'B-' | 'C+' | 'C' | 'C-' | 'D+' | 'D' | 'D-' | 'F+';
1560
+ }
1561
+ /**
1562
+ * Full Kokoro voice catalog. Source: the `VOICES` dict in
1563
+ * `kokoro-js@1.2.1/dist/kokoro.js` (model card on the HF repo
1564
+ * `onnx-community/Kokoro-82M-v1.0-ONNX`). Grades reflect upstream's
1565
+ * subjective overall ranking; the picker prefers higher grades so the
1566
+ * average gezel sounds decent.
1567
+ */
1568
+ declare const KOKORO_VOICES: readonly KokoroVoiceInfo[];
1569
+ declare function findKokoroVoice(id: string): KokoroVoiceInfo | undefined;
1570
+ declare function isValidKokoroVoice(id: string): boolean;
1571
+ /**
1572
+ * Pick a Kokoro voice id appropriate for a gezel's gender. `male` →
1573
+ * `am_*`/`bm_*` voices; `female` → `af_*`/`bf_*`. `non-binary` draws
1574
+ * uniformly from the full catalog so the assignment doesn't lean on
1575
+ * the catalog's male/female split. Quality grade biases the weighting
1576
+ * within the eligible pool.
1577
+ *
1578
+ * Deterministic when a `seed` is supplied — used by tests and by the
1579
+ * createGezel path so the same id always picks the same voice on a
1580
+ * re-roll. Without a seed, `Math.random` drives the draw.
1581
+ */
1582
+ declare function pickKokoroVoiceForGender(gender: GezelGender | undefined, opts?: {
1583
+ seed?: number;
1584
+ }): string;
1585
+
1586
+ /**
1587
+ * Poppetje catalogs — every option the figure renderer knows how to draw.
1588
+ *
1589
+ * Single source of truth shared by the service (persists resolved structs),
1590
+ * the seed generator (picks from these arrays), and the UI renderer (looks
1591
+ * up archetype dimensions). Originally ported from the renderer handoff; see
1592
+ * `docs/poppetje-rendering.md` for the maintained visual contract.
1593
+ */
1594
+
1595
+ /** Width control points (5) for each body silhouette, in the 80-wide viewBox. */
1596
+ interface BodyArchetype {
1597
+ baseW: number;
1598
+ hipW: number;
1599
+ waistW: number;
1600
+ chestW: number;
1601
+ shoulderW: number;
1602
+ label: string;
1603
+ note: string;
1604
+ }
1605
+ /**
1606
+ * Width control points (5) per body archetype, in the 80-wide viewBox.
1607
+ * Earlier versions clustered all six within ~10 units of each other, so
1608
+ * `broad` / `athletic` / `stout` were nearly indistinguishable silhouettes.
1609
+ * Spread them out — and in particular, give `broad` and `athletic` actual
1610
+ * shoulder width (the original `broad: shoulderW=42` pinched at the top,
1611
+ * which directly contradicted its "broad through the shoulders" brief).
1612
+ */
1613
+ declare const BODY_ARCHETYPES: Record<string, BodyArchetype>;
1614
+ declare const BODY_SHAPE_KEYS: BodyShape[];
1615
+ type BodyShape = 'broad' | 'tapered' | 'curvy' | 'athletic' | 'slender' | 'stout';
1616
+ interface FigureScaleDef {
1617
+ bodyScale: number;
1618
+ headScale: number;
1619
+ label: string;
1620
+ note: string;
1621
+ }
1622
+ declare const FIGURE_SCALES: Record<string, FigureScaleDef>;
1623
+ declare const FIGURE_SCALE_KEYS: FigureScale[];
1624
+ type FigureScale = 'adult' | 'shorter' | 'child' | 'toddler';
1625
+ /** Wood-grain filter presets. Tune displacement, alpha, and streak frequency together. */
1626
+ interface GrainPreset {
1627
+ skip?: boolean;
1628
+ dispScale?: number;
1629
+ /** Strength of the translucent grain tint after fiber contrast. */
1630
+ opacity?: number;
1631
+ /** Small blur applied after displacement so fibers read through paint. */
1632
+ soften?: number;
1633
+ streakFreq?: string;
1634
+ }
1635
+ /**
1636
+ * Wood-grain finish presets. The stable key adds a separate material
1637
+ * character (fine, flowing, cathedral, or knotty) inside each finish.
1638
+ * Texture should remain below facial features, but must still be visible at
1639
+ * the full-figure sizes used in detail views and galleries.
1640
+ */
1641
+ declare const GRAIN_PRESETS: Record<string, GrainPreset>;
1642
+ type GrainStyle = 'none' | 'straight' | 'wavy' | 'pronounced' | 'character';
1643
+ declare const HAT_OPTIONS: readonly ["cap", "beanie", "kerchief", "straw", "newsboy", "hood"];
1644
+ type HatOption = (typeof HAT_OPTIONS)[number];
1645
+ declare const DRESS_OPTIONS: readonly ["scarf", "apron", "collar", "turtleneck"];
1646
+ type DressOption = (typeof DRESS_OPTIONS)[number];
1647
+ declare const HAIR_SHAPES: readonly ["halo", "short", "long", "bun", "braids", "shaved", "bald"];
1648
+ type HairShape = (typeof HAIR_SHAPES)[number];
1649
+ /**
1650
+ * Wearable accessories — things a gezel can put on or take off, so
1651
+ * they're user-toggleable from the appearance dialog. Physical facial
1652
+ * features (facial hair, freckles, moles) deliberately live in their own
1653
+ * slots below and only ever change on a reroll.
1654
+ *
1655
+ * Earring sides are named from the VIEWER's perspective (what you see in
1656
+ * the preview), not the wearer's; `earrings` is the both-ears default.
1657
+ * Legacy `accessory: 'earring'` files migrate to `earrings` on read.
1658
+ * Hair-zone accessories (flower, hairclip, headband, feather, pencil, ribbon)
1659
+ * hide while a hat is worn — same rule as hair itself.
1660
+ */
1661
+ declare const ACCESSORY_OPTIONS: readonly ["glasses", "sunglasses", "cateye", "readers", "monocle", "eyepatch", "earrings", "earring-left", "earring-right", "flower", "hairclip", "headband", "bowtie", "necklace", "brooch", "facemask", "goggles", "safety-glasses", "pince-nez", "headphones", "hearing-aid", "nose-ring", "hoop-earrings", "drop-earrings", "pearl-earrings", "bandage", "feather", "pencil", "ribbon", "necktie", "cravat", "bolo-tie", "lanyard", "medal", "pocket-square", "tool-pendant"];
1662
+ type AccessoryOption = (typeof ACCESSORY_OPTIONS)[number];
1663
+ /**
1664
+ * Rarity tiers for *random* accessory assignment. The appearance dialog
1665
+ * still offers every option freely; these weights only bias the seed
1666
+ * generator so distinctive pieces (eyepatch, a single asymmetric earring)
1667
+ * stay rare instead of landing as often as plain glasses.
1668
+ */
1669
+ type AccessoryRarity = 'common' | 'uncommon' | 'rare' | 'veryRare';
1670
+ /** Relative draw weights per tier. Higher = more likely. */
1671
+ declare const ACCESSORY_RARITY_WEIGHT: Record<AccessoryRarity, number>;
1672
+ interface AccessoryRarityEntry {
1673
+ rarity: AccessoryRarity;
1674
+ /** Per-gender overrides; falls back to `rarity` for any gender not listed. */
1675
+ byGender?: Partial<Record<GezelGender, AccessoryRarity>>;
1676
+ }
1677
+ /**
1678
+ * Per-accessory rarity. Everyday items (glasses, both-ear earrings, necklace)
1679
+ * stay common; novelty pieces are rare-to-very-rare. A single left- or
1680
+ * right-only earring is `rare` in general but `veryRare` on female gezels.
1681
+ */
1682
+ declare const ACCESSORY_RARITY: Record<AccessoryOption, AccessoryRarityEntry>;
1683
+ /**
1684
+ * Per-dress rarity, reusing the shared {@link AccessoryRarity} tiers and
1685
+ * {@link ACCESSORY_RARITY_WEIGHT}. Everyday garments (scarf, collar,
1686
+ * turtleneck) stay common; the workshop apron is a `veryRare` novelty so it
1687
+ * seldom lands on a randomly seeded gezel. As with accessories, this only
1688
+ * biases the seed generator — the appearance dialog still offers every dress
1689
+ * freely. Dresses carry no per-gender overrides, so a flat tier map suffices.
1690
+ */
1691
+ declare const DRESS_RARITY: Record<DressOption, AccessoryRarity>;
1692
+ /**
1693
+ * Facial hair — a physical feature, never user-toggleable. Split out of the
1694
+ * accessory slot so a gezel can wear glasses AND have a beard, and so the
1695
+ * appearance dialog can edit wearables without ever clobbering facial hair.
1696
+ * Gender-gated during seed generation (female gezels never auto-roll it).
1697
+ */
1698
+ declare const FACIAL_HAIR_OPTIONS: readonly ["beard", "mustache"];
1699
+ type FacialHairOption = (typeof FACIAL_HAIR_OPTIONS)[number];
1700
+ declare const MARK_OPTIONS: readonly ["freckles", "mole"];
1701
+ type MarkOption = (typeof MARK_OPTIONS)[number];
1702
+ /**
1703
+ * Painted garment patterns — flat paint over the body silhouette, applied
1704
+ * under the wood grain so they read as decoration painted onto the carved
1705
+ * figure (not stickers floating above it). `plain` is the bare shirt.
1706
+ */
1707
+ declare const SHIRT_PATTERN_OPTIONS: readonly ["plain", "buttons", "stripes", "sash", "yoke", "twotone"];
1708
+ type ShirtPattern = (typeof SHIRT_PATTERN_OPTIONS)[number];
1709
+ /**
1710
+ * Felt palette for cloth hats (cap, beanie, kerchief, newsboy). Hats used
1711
+ * to render in the shirt's accent color, which camouflaged them into the
1712
+ * body — a hat should read as its own object, like the straw hat always
1713
+ * has. The felt is picked deterministically from the poppetje `key` (plus
1714
+ * the hat name), so a gezel's cap is the same red forever, but its beanie
1715
+ * — if a reroll ever lands one — gets an independent color.
1716
+ * `hood` deliberately stays in the shirt accent: it's part of the garment.
1717
+ */
1718
+ declare const HAT_FELTS: readonly [{
1719
+ readonly felt: "#a8554a";
1720
+ readonly band: "#7c3a32";
1721
+ }, {
1722
+ readonly felt: "#c9973f";
1723
+ readonly band: "#96702c";
1724
+ }, {
1725
+ readonly felt: "#5d7257";
1726
+ readonly band: "#42523e";
1727
+ }, {
1728
+ readonly felt: "#4e6586";
1729
+ readonly band: "#374a64";
1730
+ }, {
1731
+ readonly felt: "#43474e";
1732
+ readonly band: "#2e3138";
1733
+ }, {
1734
+ readonly felt: "#8a5a78";
1735
+ readonly band: "#64405a";
1736
+ }];
1737
+ declare const EXPRESSION_OPTIONS: readonly ["smile", "wider", "neutral", "wink", "sleepy"];
1738
+ type Expression = (typeof EXPRESSION_OPTIONS)[number];
1739
+ /** Workshop palette — skin/skin2 pairs, hair colors, shirt/accent pairs. */
1740
+ declare const PALETTE: {
1741
+ readonly skins: readonly [{
1742
+ readonly skin: "#ecd5b8";
1743
+ readonly skin2: "#b8a080";
1744
+ }, {
1745
+ readonly skin: "#dbb898";
1746
+ readonly skin2: "#a98870";
1747
+ }, {
1748
+ readonly skin: "#e6c7a8";
1749
+ readonly skin2: "#b89478";
1750
+ }, {
1751
+ readonly skin: "#d4b896";
1752
+ readonly skin2: "#a48c6c";
1753
+ }, {
1754
+ readonly skin: "#c79775";
1755
+ readonly skin2: "#9d7050";
1756
+ }, {
1757
+ readonly skin: "#9c6b48";
1758
+ readonly skin2: "#7a5236";
1759
+ }, {
1760
+ readonly skin: "#a87852";
1761
+ readonly skin2: "#7d5436";
1762
+ }, {
1763
+ readonly skin: "#5d3a24";
1764
+ readonly skin2: "#3d2418";
1765
+ }];
1766
+ readonly hairs: readonly ["#1a1410", "#2a1d12", "#3a2418", "#5a3a1c", "#7a5230", "#a87042", "#cc7744", "#d4a060", "#9a948a", "#dcd5c8", "#1f1812"];
1767
+ /**
1768
+ * Shirt mid-tone + accent pairs. The wood-grain filter multiplies a warm
1769
+ * brown over the body, which costs every color a step of saturation and
1770
+ * value — the earlier palette was so muted that indigo, slate, plum, and
1771
+ * moss all converged to "gray robe" after the multiply. Mid-tones here
1772
+ * are kept a step brighter than the target on-screen color, and the hues
1773
+ * cover the full warm/cool wheel so a crew of poppetjes reads as a crowd
1774
+ * of different outfits at a glance.
1775
+ */
1776
+ readonly shirts: readonly [{
1777
+ readonly shirt: "#94a87c";
1778
+ readonly accent: "#5c6a4a";
1779
+ }, {
1780
+ readonly shirt: "#6d7d54";
1781
+ readonly accent: "#46543a";
1782
+ }, {
1783
+ readonly shirt: "#d07c56";
1784
+ readonly accent: "#9a4e30";
1785
+ }, {
1786
+ readonly shirt: "#b65843";
1787
+ readonly accent: "#7e382a";
1788
+ }, {
1789
+ readonly shirt: "#d2a350";
1790
+ readonly accent: "#9a6c28";
1791
+ }, {
1792
+ readonly shirt: "#dcc06e";
1793
+ readonly accent: "#a8863a";
1794
+ }, {
1795
+ readonly shirt: "#5b7cab";
1796
+ readonly accent: "#2a4670";
1797
+ }, {
1798
+ readonly shirt: "#549191";
1799
+ readonly accent: "#2f5f5f";
1800
+ }, {
1801
+ readonly shirt: "#7d8794";
1802
+ readonly accent: "#4a5360";
1803
+ }, {
1804
+ readonly shirt: "#9d6890";
1805
+ readonly accent: "#5a3850";
1806
+ }, {
1807
+ readonly shirt: "#c28b8b";
1808
+ readonly accent: "#8f5454";
1809
+ }, {
1810
+ readonly shirt: "#7a9a62";
1811
+ readonly accent: "#4a6a3a";
1812
+ }];
1813
+ };
1814
+ /** Slot odds tuned for balanced diversity in seed-based generation. */
1815
+ declare const SLOT_ODDS: {
1816
+ readonly hat: 0.3;
1817
+ readonly dress: 0.22;
1818
+ readonly accessory: 0.5;
1819
+ readonly facialHair: 0.18;
1820
+ readonly mark: 0.2;
1821
+ /** Odds a figure gets any painted garment pattern (vs `plain`). */
1822
+ readonly shirtPattern: 0.66;
1823
+ };
1824
+ /**
1825
+ * Cumulative odds for the figure-scale roll. Height is the single
1826
+ * strongest silhouette differentiator the renderer has, and the seed
1827
+ * generator used to hardcode `adult` — every gezel stood exactly the
1828
+ * same height. Most figures are still adults; shorter and small figures
1829
+ * appear often enough that a crew lineup gets a varied skyline.
1830
+ */
1831
+ declare const FIGURE_SCALE_ODDS: ReadonlyArray<{
1832
+ scale: FigureScale;
1833
+ upTo: number;
1834
+ }>;
1835
+
1836
+ /**
1837
+ * A resolved poppetje — the carved-figure character data for a gezel.
1838
+ * Stored explicitly on disk so adding new catalog entries or tuning slot
1839
+ * odds later never drifts existing characters. The renderer reads from
1840
+ * this struct; the seed generator produces it.
1841
+ */
1842
+ declare const PoppetjeSchema: z.ZodPreprocess<z.ZodObject<{
1843
+ key: z.ZodString;
1844
+ name: z.ZodString;
1845
+ bodyShape: z.ZodEnum<{
1846
+ [x: string]: string;
1847
+ }>;
1848
+ figureScale: z.ZodEnum<{
1849
+ [x: string]: string;
1850
+ }>;
1851
+ skin: z.ZodString;
1852
+ skin2: z.ZodString;
1853
+ hair: z.ZodString;
1854
+ hairShape: z.ZodEnum<{
1855
+ halo: "halo";
1856
+ short: "short";
1857
+ long: "long";
1858
+ bun: "bun";
1859
+ braids: "braids";
1860
+ shaved: "shaved";
1861
+ bald: "bald";
1862
+ }>;
1863
+ hat: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodEnum<{
1864
+ cap: "cap";
1865
+ beanie: "beanie";
1866
+ kerchief: "kerchief";
1867
+ straw: "straw";
1868
+ newsboy: "newsboy";
1869
+ hood: "hood";
1870
+ }>>>>;
1871
+ dress: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodEnum<{
1872
+ scarf: "scarf";
1873
+ apron: "apron";
1874
+ collar: "collar";
1875
+ turtleneck: "turtleneck";
1876
+ }>>>>;
1877
+ accessory: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodEnum<{
1878
+ glasses: "glasses";
1879
+ sunglasses: "sunglasses";
1880
+ cateye: "cateye";
1881
+ readers: "readers";
1882
+ monocle: "monocle";
1883
+ eyepatch: "eyepatch";
1884
+ earrings: "earrings";
1885
+ "earring-left": "earring-left";
1886
+ "earring-right": "earring-right";
1887
+ flower: "flower";
1888
+ hairclip: "hairclip";
1889
+ headband: "headband";
1890
+ bowtie: "bowtie";
1891
+ necklace: "necklace";
1892
+ brooch: "brooch";
1893
+ facemask: "facemask";
1894
+ goggles: "goggles";
1895
+ "safety-glasses": "safety-glasses";
1896
+ "pince-nez": "pince-nez";
1897
+ headphones: "headphones";
1898
+ "hearing-aid": "hearing-aid";
1899
+ "nose-ring": "nose-ring";
1900
+ "hoop-earrings": "hoop-earrings";
1901
+ "drop-earrings": "drop-earrings";
1902
+ "pearl-earrings": "pearl-earrings";
1903
+ bandage: "bandage";
1904
+ feather: "feather";
1905
+ pencil: "pencil";
1906
+ ribbon: "ribbon";
1907
+ necktie: "necktie";
1908
+ cravat: "cravat";
1909
+ "bolo-tie": "bolo-tie";
1910
+ lanyard: "lanyard";
1911
+ medal: "medal";
1912
+ "pocket-square": "pocket-square";
1913
+ "tool-pendant": "tool-pendant";
1914
+ }>>>>;
1915
+ facialHair: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodEnum<{
1916
+ beard: "beard";
1917
+ mustache: "mustache";
1918
+ }>>>>;
1919
+ mark: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodEnum<{
1920
+ freckles: "freckles";
1921
+ mole: "mole";
1922
+ }>>>>;
1923
+ expression: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
1924
+ smile: "smile";
1925
+ wider: "wider";
1926
+ neutral: "neutral";
1927
+ wink: "wink";
1928
+ sleepy: "sleepy";
1929
+ }>>>;
1930
+ shirt: z.ZodString;
1931
+ shirtAccent: z.ZodString;
1932
+ shirtPattern: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
1933
+ plain: "plain";
1934
+ buttons: "buttons";
1935
+ stripes: "stripes";
1936
+ sash: "sash";
1937
+ yoke: "yoke";
1938
+ twotone: "twotone";
1939
+ }>>>;
1940
+ }, z.core.$strip>>;
1941
+ type Poppetje = z.infer<typeof PoppetjeSchema>;
1942
+
1943
+ /** Catalog options the generator may roll — growth cosmetics filtered out. */
1944
+ declare const ROLLABLE_HATS: ("cap" | "beanie" | "kerchief" | "straw" | "newsboy" | "hood")[];
1945
+ declare const ROLLABLE_DRESSES: ("scarf" | "apron" | "collar" | "turtleneck")[];
1946
+ declare const ROLLABLE_ACCESSORIES: ("glasses" | "sunglasses" | "cateye" | "readers" | "monocle" | "eyepatch" | "earrings" | "earring-left" | "earring-right" | "flower" | "hairclip" | "headband" | "bowtie" | "necklace" | "brooch" | "facemask" | "goggles" | "safety-glasses" | "pince-nez" | "headphones" | "hearing-aid" | "nose-ring" | "hoop-earrings" | "drop-earrings" | "pearl-earrings" | "bandage" | "feather" | "pencil" | "ribbon" | "necktie" | "cravat" | "bolo-tie" | "lanyard" | "medal" | "pocket-square" | "tool-pendant")[];
1947
+ /**
1948
+ * djb2 hash → [0, 100). Used as the SVG turbulence `seed` attribute so
1949
+ * every gezel with the same `key` gets the same wood-grain pattern,
1950
+ * forever, across every render and every viewBox crop.
1951
+ */
1952
+ declare function seedFromKey(key: string): number;
1953
+ interface PoppetjeSeedOptions {
1954
+ /** When provided, becomes the resulting `Poppetje.key` (stable wood-grain seed). */
1955
+ key?: string;
1956
+ /** When provided, becomes the resulting `Poppetje.name`. */
1957
+ name?: string;
1958
+ /**
1959
+ * When `'female'`, the generator omits `beard` and `mustache` from the
1960
+ * accessory pool. Other genders (`'male'`, `'non-binary'`, `undefined`)
1961
+ * keep the full pool. The brief is explicit that body shape, skin,
1962
+ * hair, hat, dress, and expression are **never** tied to gender —
1963
+ * only facial hair gets this anatomical gate.
1964
+ */
1965
+ gender?: GezelGender;
1966
+ }
1967
+ /**
1968
+ * Produce a deterministic, complete `Poppetje` from a single integer seed.
1969
+ *
1970
+ * Same `n` always returns the same struct. Slot odds (hat 30%, dress 22%,
1971
+ * accessory 50%, mark 20%) are applied via independent rolls so each slot
1972
+ * is empty-or-filled independent of the others.
1973
+ *
1974
+ * `options.key` and `options.name` let you decouple the wood-grain seed
1975
+ * (the `key` field — locked to the gezel id) from the catalog seed `n`
1976
+ * (the random integer that picks slots). Without an explicit key, the
1977
+ * generator falls back to `seed-${n}`.
1978
+ */
1979
+ declare function poppetjeFromSeed(n: number, options?: PoppetjeSeedOptions): Poppetje;
1980
+ /**
1981
+ * First-time poppetje for a gezel — deterministic from the gezel id alone.
1982
+ *
1983
+ * Hashes the gezel id to a catalog seed `n`, then runs `poppetjeFromSeed`
1984
+ * with `key` pinned to the id. Reproducible across tests, restarts, and
1985
+ * migrations. After this initial state, the user can reroll to draw a
1986
+ * fresh `n` — but the `key` (and so the wood-grain pattern) stays pinned.
1987
+ */
1988
+ declare function initialPoppetjeForGezel(gezelId: string, name: string, gender?: GezelGender): Poppetje;
1989
+
1990
+ /**
1991
+ * Project-type taxonomy — a broad, deliberately expandable catalog of the
1992
+ * *kinds of thing a project produces* (a browser game, a data analysis, a
1993
+ * REST service, …). It exists so the craftbook rail can suggest a small,
1994
+ * relevant subset of the ~200-book catalog instead of dumping all of them on
1995
+ * an obvious HTML-game project.
1996
+ *
1997
+ * Two halves to each entry:
1998
+ * - `detect` — cheap, deterministic signals scored against a project's
1999
+ * indexed file mix (extensions, modalities) and its
2000
+ * `about.md`/mission text (keywords). Drives auto-detection.
2001
+ * - `craftbookTags` — the curated craftbook tags that make a book
2002
+ * "suggested" for this type. Relevance = tag intersection
2003
+ * with `CraftbookTemplateManifest.tags`. Keep these aligned
2004
+ * to tags that actually exist in the catalog (the near-
2005
+ * universal `gallery` tag is intentionally never used here —
2006
+ * it would match every book).
2007
+ * - `gezelRoles` — gezel-template affinity in two tiers. `default` is the
2008
+ * core crew this kind of project normally starts with;
2009
+ * `suggested` is the useful specialist bench beyond that.
2010
+ * Detection only surfaces these choices and never creates a
2011
+ * gezel as a side effect.
2012
+ *
2013
+ * This is shared core data: the service imports it for detection + craftbook
2014
+ * partitioning, and the UI imports it for the settings override dropdown, so
2015
+ * there is no list endpoint to keep in sync.
2016
+ */
2017
+ declare const ProjectTypeDetectSchema: z.ZodObject<{
2018
+ extensions: z.ZodOptional<z.ZodArray<z.ZodString>>;
2019
+ modalities: z.ZodOptional<z.ZodArray<z.ZodString>>;
2020
+ keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
2021
+ }, z.core.$strip>;
2022
+ type ProjectTypeDetect = z.infer<typeof ProjectTypeDetectSchema>;
2023
+ declare const ProjectTypeGezelRoleSchema: z.ZodObject<{
2024
+ templateId: z.ZodString;
2025
+ reason: z.ZodString;
2026
+ }, z.core.$strip>;
2027
+ type ProjectTypeGezelRole = z.infer<typeof ProjectTypeGezelRoleSchema>;
2028
+ declare const ProjectTypeGezelAffinitySchema: z.ZodObject<{
2029
+ default: z.ZodArray<z.ZodObject<{
2030
+ templateId: z.ZodString;
2031
+ reason: z.ZodString;
2032
+ }, z.core.$strip>>;
2033
+ suggested: z.ZodArray<z.ZodObject<{
2034
+ templateId: z.ZodString;
2035
+ reason: z.ZodString;
2036
+ }, z.core.$strip>>;
2037
+ }, z.core.$strip>;
2038
+ type ProjectTypeGezelAffinity = z.infer<typeof ProjectTypeGezelAffinitySchema>;
2039
+ declare const ProjectTypeSchema: z.ZodObject<{
2040
+ id: z.ZodString;
2041
+ label: z.ZodString;
2042
+ description: z.ZodString;
2043
+ detect: z.ZodObject<{
2044
+ extensions: z.ZodOptional<z.ZodArray<z.ZodString>>;
2045
+ modalities: z.ZodOptional<z.ZodArray<z.ZodString>>;
2046
+ keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
2047
+ }, z.core.$strip>;
2048
+ craftbookTags: z.ZodArray<z.ZodString>;
2049
+ gezelRoles: z.ZodObject<{
2050
+ default: z.ZodArray<z.ZodObject<{
2051
+ templateId: z.ZodString;
2052
+ reason: z.ZodString;
2053
+ }, z.core.$strip>>;
2054
+ suggested: z.ZodArray<z.ZodObject<{
2055
+ templateId: z.ZodString;
2056
+ reason: z.ZodString;
2057
+ }, z.core.$strip>>;
2058
+ }, z.core.$strip>;
2059
+ }, z.core.$strip>;
2060
+ type ProjectType = z.infer<typeof ProjectTypeSchema>;
2061
+ /**
2062
+ * The bundled seed taxonomy. Grows over time; the detector and partitioner
2063
+ * treat it purely as data, so adding an entry needs no code change.
2064
+ */
2065
+ declare const PROJECT_TYPES: ProjectType[];
2066
+ /** Look up a project type by id. */
2067
+ declare function getProjectType(id: string | undefined | null): ProjectType | undefined;
2068
+ /** The full taxonomy, for UI listing (override dropdown). */
2069
+ declare function listProjectTypes(): ProjectType[];
2070
+
2071
+ /**
2072
+ * ─ Roles as capability contracts ─────────────────────────────────────
2073
+ *
2074
+ * A role is not a persona — it is a declared bundle of what the system
2075
+ * does with it. Historically those facets were scattered: the toolset kit
2076
+ * lived in `chat/role-tool-filter`, the tuning profile in each gilde
2077
+ * template manifest, the about text in the catalog, and the "gate
2078
+ * vocabulary" only existed implicitly. This module makes the bundle
2079
+ * explicit and is the single source of truth for:
2080
+ *
2081
+ * - `toolsetGroups` — the MCP kit (was ROLE_TOOLSET_GROUPS)
2082
+ * - `suggestedTuningProfile` — sampling preset (was template-only)
2083
+ * - `gateAffinity` — NEW: the checks a role's deliverables
2084
+ * default to (a Researcher cites + grounds
2085
+ * the way a Developer parses + tests)
2086
+ * - `defaultBooks` — NEW: craftbook templates the role runs well
2087
+ * - `capabilityFloor` — NEW: min model tier for unsupervised steps
2088
+ *
2089
+ * The about template stays in the catalog (it's prose, versioned with the
2090
+ * gallery); everything mechanical lives here. `chat/role-tool-filter` and
2091
+ * the tuning resolver read from this registry rather than re-declaring.
2092
+ *
2093
+ * IMPORTANT — behavior parity: the canonical role ids below are exactly
2094
+ * the 10 toolset-kit keys that `role-tool-filter` shipped, and
2095
+ * {@link resolveRoleId} reproduces the old `canonicalRoleKey` exactly
2096
+ * (exact-match a canonical id, else substring-match the alias table, else
2097
+ * null → DEFAULT_TOOLSET_GROUPS). Adding a brand-new canonical id would
2098
+ * change tool filtering AND the delegation/implementer classification that
2099
+ * keys off the canonical string, so keep this set stable; template-only
2100
+ * roles (builder → developer, boekwachter → default) continue to resolve
2101
+ * via the alias/fallback paths.
2102
+ */
2103
+ type RoleId = 'meester' | 'voorman' | 'reviewer' | 'researcher' | 'copywriter' | 'designer' | 'image-generator' | 'video-generator' | 'developer' | 'web-developer' | 'planner';
2104
+ interface RoleDefinition {
2105
+ /** Canonical role id — also the toolset-kit key. */
2106
+ id: RoleId;
2107
+ /** Human label. */
2108
+ label: string;
2109
+ /** One-line capability summary. */
2110
+ summary: string;
2111
+ /**
2112
+ * MCP toolset groups (ids into BUILTIN_TOOLSETS) the role's gezels get
2113
+ * by default. Group lists are conservative: a missing-but-needed group
2114
+ * is worse than a couple extras; user toolsets add/remove from here.
2115
+ */
2116
+ toolsetGroups: readonly string[];
2117
+ /**
2118
+ * Soft tuning-profile default (a `KNOWN_PROFILE_IDS` value). The
2119
+ * per-gezel pick and install default always win; this is the role's
2120
+ * sensible baseline. Omitted where the role has no opinion.
2121
+ */
2122
+ suggestedTuningProfile?: string;
2123
+ /**
2124
+ * The gate vocabulary this role is expected to clear — standard-scope
2125
+ * check scripts that fit the role's typical deliverable. Inputs are
2126
+ * usually omitted here (bound to the concrete deliverable at the point
2127
+ * of use); this is the menu, not a turnkey gate. Empty for coordinators
2128
+ * (no deliverable) and for developer-family roles whose gates are
2129
+ * task-specific build/test checks supplied by the craftbook.
2130
+ */
2131
+ gateAffinity: readonly GateScriptRef[];
2132
+ /** Craftbook template ids (catalog folder names) this role runs well. */
2133
+ defaultBooks: readonly string[];
2134
+ /** Minimum model tier to run this role's steps unsupervised. */
2135
+ capabilityFloor: ModelTier;
2136
+ }
2137
+ declare const ROLES: Record<RoleId, RoleDefinition>;
2138
+ /**
2139
+ * Fallback group set when a gezel's role matches no canonical id and no
2140
+ * alias. Mirrors a competent builder kit; `code-execution` is deliberately
2141
+ * excluded (a more specific grant roles opt into). Was `DEFAULT_GROUPS` in
2142
+ * role-tool-filter.
2143
+ */
2144
+ declare const DEFAULT_TOOLSET_GROUPS: readonly string[];
2145
+ /**
2146
+ * Coarse role-name aliases mapping the variations users/LLMs produce onto
2147
+ * canonical role ids. ORDER MATTERS — checked top-to-bottom, first match
2148
+ * wins (web-flavored dev titles must precede the generic `developer`
2149
+ * matcher; image-generator must follow `design`). Consulted via substring
2150
+ * on the normalized role string only when the exact-id lookup misses.
2151
+ */
2152
+ declare const ROLE_ALIASES: ReadonlyArray<{
2153
+ contains: string;
2154
+ canonical: RoleId;
2155
+ }>;
2156
+ /**
2157
+ * Resolve a free-form role/job-title to a canonical role id. Reproduces
2158
+ * the old `canonicalRoleKey` exactly:
2159
+ * 1. exact case-insensitive match against a canonical id, else
2160
+ * 2. first substring match in {@link ROLE_ALIASES}, else
2161
+ * 3. null (caller falls back to {@link DEFAULT_TOOLSET_GROUPS}).
2162
+ */
2163
+ declare function resolveRoleId(role: string | undefined): RoleId | null;
2164
+ /** The full role definition for a free-form role, or null if unrecognized. */
2165
+ declare function roleDefinition(role: string | undefined): RoleDefinition | null;
2166
+ /**
2167
+ * Toolset groups a role gets by default — resolves the role and falls back
2168
+ * to {@link DEFAULT_TOOLSET_GROUPS}. This is the single implementation
2169
+ * behind `role-tool-filter`'s `roleToolsetGroups`.
2170
+ */
2171
+ declare function toolsetGroupsForRole(role: string | undefined): readonly string[];
2172
+ /** Suggested tuning profile id for a role, or undefined. */
2173
+ declare function roleSuggestedTuningProfile(role: string | undefined): string | undefined;
2174
+ /** The gate vocabulary a role's deliverables default to ([] if unknown). */
2175
+ declare function roleGateAffinity(role: string | undefined): readonly GateScriptRef[];
2176
+ /**
2177
+ * A role's gateAffinity bound to a concrete deliverable `filePath` — each
2178
+ * affinity script gets `{ file: filePath }` merged into its inputs (an
2179
+ * explicit input on the ref still wins). This is the menu; the caller is
2180
+ * responsible for dropping any entry whose remaining required inputs can't
2181
+ * be satisfied (e.g. `checkValueGrounding` needs task-specific `facts`),
2182
+ * since this module can't see the script metas.
2183
+ */
2184
+ declare function roleDeliverableScripts(role: string | undefined, filePath: string): GateScriptRef[];
2185
+ /** Craftbook templates a role runs well ([] if unknown). */
2186
+ declare function roleDefaultBooks(role: string | undefined): readonly string[];
2187
+ /** Minimum model tier for a role's unsupervised steps, or null if unknown. */
2188
+ declare function roleCapabilityFloor(role: string | undefined): ModelTier | null;
2189
+ /**
2190
+ * Whether a model of `tier` clears a role's capability floor. Unknown
2191
+ * roles return true (don't block on a role we can't classify).
2192
+ */
2193
+ declare function meetsCapabilityFloor(tier: ModelTier, role: string | undefined): boolean;
2194
+
2195
+ /**
2196
+ * ─ Deliverable gates ─────────────────────────────────────────────────
2197
+ *
2198
+ * Given the CLASS of artifact a step produces, build the right gate: a cheap
2199
+ * declarative floor (`checks`) plus standard-library gate scripts that judge
2200
+ * a completion attempt and loop the step back on a miss. This is the wisdom
2201
+ * behind the gallery's per-phase gates (`archetypeToCraftbook`) AND the
2202
+ * `set_step_deliverable` MCP tool / the plan craftbook — kept here in core
2203
+ * (where the gate schema lives) so every consumer can share one source of
2204
+ * truth without depending on the catalog package.
2205
+ */
2206
+ /**
2207
+ * The CLASS of artifact a step produces. Maps to class-appropriate static
2208
+ * gate checks — authored to "what makes ANY deliverable of this class good",
2209
+ * never to a specific eval's sniff signals. The enum itself lives in the
2210
+ * schemas layer ({@link DeliverableKindSchema}) so the blueprint field and
2211
+ * the MCP tools share it without an import cycle.
2212
+ */
2213
+ type DeliverableKind = z.infer<typeof DeliverableKindSchema>;
2214
+ /**
2215
+ * Infer the deliverable class from a file path when the author didn't say.
2216
+ * Deliberately coarse — a `.html` is a page (never a game: that stricter
2217
+ * bar must be asked for), code is a module unless the filename says tests.
2218
+ */
2219
+ declare function inferDeliverableKind(path: string): DeliverableKind;
2220
+ /** Prose document extensions — Markdown-family reports, notes, plain text. */
2221
+ declare function isProseDocPath(path: string): boolean;
2222
+ /**
2223
+ * Forgiving alias map for model-supplied kind strings — small models write
2224
+ * "html", "md", "csv", "code" and should not eat a validation loop for it.
2225
+ * Case- and separator-insensitive. Returns null when nothing plausible
2226
+ * matches (the caller reports the legal values).
2227
+ */
2228
+ declare function coerceDeliverableKind(raw: string): DeliverableKind | null;
2229
+ /**
2230
+ * The completion gate for a step that produces a checkable artifact.
2231
+ * `onReject: <the step itself>` re-activates the step with a fresh
2232
+ * handoff session on every rejection — byte-for-byte the loop dynamics
2233
+ * that carried small models through the old evaluator-step shape, with
2234
+ * the judgment now made at completion time on the working step.
2235
+ */
2236
+ declare function completionGate(produces: {
2237
+ path: string;
2238
+ kind: DeliverableKind;
2239
+ minBytes?: number;
2240
+ extraChecks?: GateCheck[];
2241
+ }, selfId: string, maxAttempts: number): StepGate;
2242
+ /** The structural sniff used by a step's `advanceWhen` to leave the step once its artifact lands. */
2243
+ declare function advanceSniffForKind(kind: DeliverableKind): AdvanceWhen['sniff'];
2244
+ /**
2245
+ * Build the `{ advanceWhen, gate }` pair for a step that produces a single
2246
+ * checkable file deliverable — byte-for-byte the shape `archetypeToCraftbook`
2247
+ * puts on a gated build phase, exposed so callers outside the generator (the
2248
+ * plan craftbook and the `set_step_deliverable` MCP tool) can attach a
2249
+ * "concrete static outcome + enforced gate" to any step without hand-writing
2250
+ * gate JSON.
2251
+ *
2252
+ * `advanceWhen` auto-advances the step the moment the artifact lands; the
2253
+ * completion `gate` (cheap declarative floor + standard-library gate scripts)
2254
+ * judges every completion attempt and re-activates the step (`onReject:
2255
+ * selfId`) on a miss.
2256
+ */
2257
+ declare function deliverableStep(opts: {
2258
+ selfId: string;
2259
+ path: string;
2260
+ kind: DeliverableKind;
2261
+ minBytes?: number;
2262
+ extraChecks?: GateCheck[];
2263
+ maxAttempts?: number;
2264
+ /** Gate the artifacts drawer instead of the workspace. Artifact gates
2265
+ * keep only the checks that can read the drawer (`artifact`-capable
2266
+ * kinds) and drop workspace-reading gate scripts. */
2267
+ artifact?: boolean;
2268
+ /** The deliverable is an EDIT — hold the step until the file is written to this turn. */
2269
+ requireChange?: boolean;
2270
+ /**
2271
+ * Code deliverables ONLY: additionally execute in the sandbox and
2272
+ * require exit 0 (`nodeRuns`). Data deliverables ignore it — executing
2273
+ * `node out/customers.json` is meaningless; their execution story is
2274
+ * "produce the file BY running a script" (the `derive_file` tool), and
2275
+ * their gate verifies the OUTPUT's shape via `columns`/`minRows` plus
2276
+ * the data-table sniff floor.
2277
+ */
2278
+ execute?: boolean;
2279
+ /** Data deliverables: required column/field names (csvShape for CSV, recordSchema for JSON). */
2280
+ columns?: string[];
2281
+ /** Data deliverables: minimum row count. */
2282
+ minRows?: number;
2283
+ /**
2284
+ * The step is terminal — return the completion gate ONLY (legal and
2285
+ * meaningful on a terminal step: its reject blocks task completion)
2286
+ * and no `advanceWhen` (illegal there: nowhere to auto-advance to).
2287
+ * Models put deliverables on their final "verify" step constantly —
2288
+ * the eval A/B's #1 rejection was exactly this shape — so the sugar
2289
+ * expands to what a terminal step CAN carry instead of bouncing.
2290
+ */
2291
+ terminal?: boolean;
2292
+ }): {
2293
+ advanceWhen?: AdvanceWhen;
2294
+ gate: StepGate;
2295
+ };
2296
+ /**
2297
+ * Expand a blueprint's `deliverable` sugar into the class-appropriate
2298
+ * `advanceWhen` + completion `gate` on the resolved step. An explicitly-
2299
+ * authored `gate` / `advanceWhen` on the step WINS over the corresponding
2300
+ * expanded field — the sugar fills gaps, it never overrides intent.
2301
+ * `step.id` must be the FINAL minted id (post de-dup): the expanded gate
2302
+ * loops back with `onReject: step.id`.
2303
+ */
2304
+ declare function expandStepDeliverable(step: CraftbookStep, d: StepDeliverable): CraftbookStep;
2305
+ /**
2306
+ * Resolve step blueprints (mint/de-dupe ids) and expand each `deliverable`
2307
+ * against the FINAL ids. The one entry point every create path uses —
2308
+ * routes, TaskManager inline steps, and the document-write pipeline — so
2309
+ * a single `create_task` / `craftbook_write` call yields fully-gated steps.
2310
+ */
2311
+ declare function expandStepDeliverables(blueprints: NewCraftbookStep[]): CraftbookStep[];
2312
+ /** The workspace path a step's deliverable machinery targets, or null. */
2313
+ declare function stepDeliverablePath(step: Pick<CraftbookStep, 'advanceWhen' | 'gate'>): string | null;
2314
+ /**
2315
+ * Re-derive the deliverable CLASS from a persisted step. Null when the
2316
+ * step targets no file at all (pure-routing / user steps) — callers
2317
+ * treat that as "no kit".
2318
+ */
2319
+ declare function deliverableKindForStep(step: Pick<CraftbookStep, 'advanceWhen' | 'gate'>): DeliverableKind | null;
2320
+ /**
2321
+ * The one-line "first action" a small-model step prompt names for a
2322
+ * deliverable class (tier-collapse prompts + the tiny-tier task
2323
+ * anchor). The named tool is always present in the service-side step
2324
+ * kit for the same kind — packages/service/src/chat/step-tool-kit.ts
2325
+ * keeps the two in lockstep.
2326
+ */
2327
+ declare function firstActionForKind(kind: DeliverableKind, path: string): string;
2328
+
2329
+ /**
2330
+ * What counts as a binary office/media deliverable, and how to tell whether
2331
+ * a file actually IS one.
2332
+ *
2333
+ * This lived in three places that had already drifted apart: the MCP's
2334
+ * document-routing extension set, the eval harness's handoff regex, and —
2335
+ * by omission — core's deliverable gates, which knew nothing about it and
2336
+ * therefore gated `.docx` and `.pptx` outputs with *text* checks. That
2337
+ * omission is the bug this module exists to close:
2338
+ *
2339
+ * - A `markdown-report` deliverable at `report.docx` was gated by
2340
+ * "contains a Markdown heading". A real DOCX is a ZIP, so the check
2341
+ * REJECTED correct output and ACCEPTED the Markdown source renamed to
2342
+ * `.docx` — inverted, not merely weak.
2343
+ * - A `slide-deck` at `deck.pptx` was gated by "contains slide|section|
2344
+ * ---". A real PPTX passes only incidentally (ZIP stores the
2345
+ * `ppt/slides/slide1.xml` entry name uncompressed), while a Markdown
2346
+ * deck passes outright.
2347
+ *
2348
+ * Binary deliverables are produced through DocBlocks (`convert_document` →
2349
+ * `preview_document` → `save_artifact`), so the honest floor is "is this
2350
+ * the container the extension claims", not "does the text look right".
2351
+ */
2352
+ /** Container format a binary deliverable's bytes must actually be. */
2353
+ type BinaryDocumentContainer = 'zip' | 'pdf' | 'gif' | 'mp4';
2354
+ /** Every extension the product treats as a binary document deliverable. */
2355
+ declare const BINARY_DOCUMENT_EXTENSIONS: readonly string[];
2356
+ declare function binaryDocumentExtension(path: string | null | undefined): string | null;
2357
+ declare function isBinaryDocumentPath(path: string | null | undefined): boolean;
2358
+ declare function binaryDocumentContainer(path: string | null | undefined): BinaryDocumentContainer | null;
2359
+ interface BinaryDocumentVerdict {
2360
+ ok: boolean;
2361
+ /** Human-readable reason, suitable for a gate rejection message. */
2362
+ detail: string;
2363
+ }
2364
+ /**
2365
+ * Verify that `bytes` really are the container `path`'s extension claims.
2366
+ *
2367
+ * Deliberately a SIGNATURE check, not a parse: the point is to reject the
2368
+ * substitutions models actually make — Markdown, prose, base64 text, or
2369
+ * hand-built XML written straight to a `.pptx` path — without pulling a
2370
+ * ZIP/PDF parser into core. Anything that clears this floor came out of a
2371
+ * real converter.
2372
+ */
2373
+ declare function verifyBinaryDocumentBytes(path: string, bytes: Uint8Array | null | undefined): BinaryDocumentVerdict;
2374
+
2375
+ /**
2376
+ * ─ Model scorecard ───────────────────────────────────────────────────
2377
+ *
2378
+ * The durable, shippable record of "how did each model do on the standard
2379
+ * suites, on a real device". Written by `pnpm eval:scorecard`, read by the
2380
+ * handboek `::handboek-model-scorecard` macro, and checked in so the
2381
+ * shipped articles carry real measurements rather than claims.
2382
+ *
2383
+ * ## The one rule that makes this scientific
2384
+ *
2385
+ * **A comparison is only valid inside a single sweep.** Two models are
2386
+ * comparable when they ran the same scenario set, on the same device,
2387
+ * against the same harness commit and the same catalog pin. Change any of
2388
+ * those and the numbers describe different experiments that happen to
2389
+ * share a scale.
2390
+ *
2391
+ * That collides with the practical need to add a model later without
2392
+ * re-running everything, so the format keeps BOTH: a `runs[]` list where
2393
+ * each run is one internally-comparable sweep, and per-model results that
2394
+ * name the run they came from. Rendering then has an honest job — present
2395
+ * one run as the headline table, and mark anything measured elsewhere as
2396
+ * what it is. Nothing merges silently.
2397
+ *
2398
+ * ## What counts against a model
2399
+ *
2400
+ * Only `failureClass: 'model'` trials. A capacity denial, a wedged engine,
2401
+ * an operator interrupt, or a grader bug is not a capability signal, and
2402
+ * folding those into a pass rate is the fastest way to publish a wrong
2403
+ * number. Each cell therefore records the failure-class split, and the
2404
+ * headline rate is computed over *attributable* trials.
2405
+ *
2406
+ * ## What we deliberately do not publish as comparable
2407
+ *
2408
+ * LLM-judge axis scores. They come from a frontier model that changes
2409
+ * under us, so they are recorded WITH the judge model id and are only ever
2410
+ * compared inside one run. The deterministic pass/fail is the longitudinal
2411
+ * signal; the judge is colour.
2412
+ */
2413
+ /** Schema version — bump only on a breaking shape change. */
2414
+ declare const SCORECARD_SCHEMA_VERSION = 1;
2415
+ /**
2416
+ * Below this many trials a pass fraction is rendered as a raw count, never
2417
+ * a percentage. Mirrors the eval harness's `MIN_TRIALS_FOR_RATE`: at n=1 a
2418
+ * medium local model is close to a coin flip, and "100%" from one trial is
2419
+ * a claim the sample cannot support.
2420
+ */
2421
+ declare const MIN_TRIALS_FOR_RATE = 3;
2422
+ declare const ScorecardDeviceSchema: z.ZodObject<{
2423
+ label: z.ZodString;
2424
+ platform: z.ZodString;
2425
+ arch: z.ZodString;
2426
+ memoryGb: z.ZodOptional<z.ZodNumber>;
2427
+ osRelease: z.ZodOptional<z.ZodString>;
2428
+ cpuModel: z.ZodOptional<z.ZodString>;
2429
+ }, z.core.$strict>;
2430
+ type ScorecardDevice = z.infer<typeof ScorecardDeviceSchema>;
2431
+ /**
2432
+ * Everything that has to match for two models to be comparable. Two runs
2433
+ * with identical provenance may be merged; anything else may not.
2434
+ */
2435
+ declare const ScorecardProvenanceSchema: z.ZodObject<{
2436
+ startedAt: z.ZodString;
2437
+ device: z.ZodObject<{
2438
+ label: z.ZodString;
2439
+ platform: z.ZodString;
2440
+ arch: z.ZodString;
2441
+ memoryGb: z.ZodOptional<z.ZodNumber>;
2442
+ osRelease: z.ZodOptional<z.ZodString>;
2443
+ cpuModel: z.ZodOptional<z.ZodString>;
2444
+ }, z.core.$strict>;
2445
+ harnessCommit: z.ZodString;
2446
+ gildeVersion: z.ZodString;
2447
+ count: z.ZodNumber;
2448
+ judgeModelId: z.ZodNullable<z.ZodString>;
2449
+ engineBuilds: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2450
+ }, z.core.$strict>;
2451
+ type ScorecardProvenance = z.infer<typeof ScorecardProvenanceSchema>;
2452
+ declare const ScorecardRunSchema: z.ZodObject<{
2453
+ id: z.ZodString;
2454
+ provenance: z.ZodObject<{
2455
+ startedAt: z.ZodString;
2456
+ device: z.ZodObject<{
2457
+ label: z.ZodString;
2458
+ platform: z.ZodString;
2459
+ arch: z.ZodString;
2460
+ memoryGb: z.ZodOptional<z.ZodNumber>;
2461
+ osRelease: z.ZodOptional<z.ZodString>;
2462
+ cpuModel: z.ZodOptional<z.ZodString>;
2463
+ }, z.core.$strict>;
2464
+ harnessCommit: z.ZodString;
2465
+ gildeVersion: z.ZodString;
2466
+ count: z.ZodNumber;
2467
+ judgeModelId: z.ZodNullable<z.ZodString>;
2468
+ engineBuilds: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2469
+ }, z.core.$strict>;
2470
+ suites: z.ZodArray<z.ZodString>;
2471
+ scenariosBySuite: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>;
2472
+ note: z.ZodOptional<z.ZodString>;
2473
+ }, z.core.$strict>;
2474
+ type ScorecardRun = z.infer<typeof ScorecardRunSchema>;
2475
+ /** One model × one scenario cell. */
2476
+ declare const ScorecardCellSchema: z.ZodObject<{
2477
+ scenarioId: z.ZodString;
2478
+ trials: z.ZodNumber;
2479
+ successes: z.ZodNumber;
2480
+ nonModelFailures: z.ZodNumber;
2481
+ medianDurationMs: z.ZodOptional<z.ZodNumber>;
2482
+ }, z.core.$strict>;
2483
+ type ScorecardCell = z.infer<typeof ScorecardCellSchema>;
2484
+ declare const ScorecardModelResultSchema: z.ZodObject<{
2485
+ modelId: z.ZodString;
2486
+ label: z.ZodString;
2487
+ engine: z.ZodString;
2488
+ tier: z.ZodString;
2489
+ parameterSize: z.ZodOptional<z.ZodString>;
2490
+ quantization: z.ZodOptional<z.ZodString>;
2491
+ grantedContextTokens: z.ZodOptional<z.ZodNumber>;
2492
+ runId: z.ZodString;
2493
+ suiteId: z.ZodString;
2494
+ cells: z.ZodArray<z.ZodObject<{
2495
+ scenarioId: z.ZodString;
2496
+ trials: z.ZodNumber;
2497
+ successes: z.ZodNumber;
2498
+ nonModelFailures: z.ZodNumber;
2499
+ medianDurationMs: z.ZodOptional<z.ZodNumber>;
2500
+ }, z.core.$strict>>;
2501
+ }, z.core.$strict>;
2502
+ type ScorecardModelResult = z.infer<typeof ScorecardModelResultSchema>;
2503
+ declare const ScorecardDatasetSchema: z.ZodObject<{
2504
+ schemaVersion: z.ZodLiteral<1>;
2505
+ runs: z.ZodArray<z.ZodObject<{
2506
+ id: z.ZodString;
2507
+ provenance: z.ZodObject<{
2508
+ startedAt: z.ZodString;
2509
+ device: z.ZodObject<{
2510
+ label: z.ZodString;
2511
+ platform: z.ZodString;
2512
+ arch: z.ZodString;
2513
+ memoryGb: z.ZodOptional<z.ZodNumber>;
2514
+ osRelease: z.ZodOptional<z.ZodString>;
2515
+ cpuModel: z.ZodOptional<z.ZodString>;
2516
+ }, z.core.$strict>;
2517
+ harnessCommit: z.ZodString;
2518
+ gildeVersion: z.ZodString;
2519
+ count: z.ZodNumber;
2520
+ judgeModelId: z.ZodNullable<z.ZodString>;
2521
+ engineBuilds: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2522
+ }, z.core.$strict>;
2523
+ suites: z.ZodArray<z.ZodString>;
2524
+ scenariosBySuite: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>;
2525
+ note: z.ZodOptional<z.ZodString>;
2526
+ }, z.core.$strict>>;
2527
+ results: z.ZodArray<z.ZodObject<{
2528
+ modelId: z.ZodString;
2529
+ label: z.ZodString;
2530
+ engine: z.ZodString;
2531
+ tier: z.ZodString;
2532
+ parameterSize: z.ZodOptional<z.ZodString>;
2533
+ quantization: z.ZodOptional<z.ZodString>;
2534
+ grantedContextTokens: z.ZodOptional<z.ZodNumber>;
2535
+ runId: z.ZodString;
2536
+ suiteId: z.ZodString;
2537
+ cells: z.ZodArray<z.ZodObject<{
2538
+ scenarioId: z.ZodString;
2539
+ trials: z.ZodNumber;
2540
+ successes: z.ZodNumber;
2541
+ nonModelFailures: z.ZodNumber;
2542
+ medianDurationMs: z.ZodOptional<z.ZodNumber>;
2543
+ }, z.core.$strict>>;
2544
+ }, z.core.$strict>>;
2545
+ }, z.core.$strict>;
2546
+ type ScorecardDataset = z.infer<typeof ScorecardDatasetSchema>;
2547
+
2548
+ /**
2549
+ * Turning a recorded sweep into the numbers an article may print.
2550
+ *
2551
+ * Every rule here exists to stop a true-looking number that the data does
2552
+ * not support. They are enforced in one place so the handboek macro, the
2553
+ * CLI report, and any future surface cannot disagree about what a score
2554
+ * means.
2555
+ */
2556
+ interface ModelScore {
2557
+ result: ScorecardModelResult;
2558
+ /** Scenarios where the model was actually on trial. */
2559
+ attributableTrials: number;
2560
+ successes: number;
2561
+ /** Trials thrown out as infra/operator/grader failures. */
2562
+ discardedTrials: number;
2563
+ /** null when the sample is too small to quote as a rate. */
2564
+ passRate: number | null;
2565
+ /** Rendered claim, always safe to print verbatim. */
2566
+ claim: string;
2567
+ /** Scenarios with zero attributable trials — measured nothing. */
2568
+ unmeasuredScenarios: string[];
2569
+ /** Fewest trials any measured scenario received; gates rate-quoting. */
2570
+ weakestCellTrials: number;
2571
+ /** Scenarios that ran fewer than MIN_TRIALS_FOR_RATE times. */
2572
+ underRepeatedScenarios: string[];
2573
+ }
2574
+ /**
2575
+ * Attributable trials only: a cell's non-model failures are removed from
2576
+ * BOTH numerator and denominator. A wedged engine is not evidence about a
2577
+ * model, and letting it depress a pass rate publishes a claim about the
2578
+ * wrong thing.
2579
+ */
2580
+ declare function cellAttributableTrials(cell: ScorecardCell): number;
2581
+ /** Render a pass fraction, refusing to quote a rate the sample can't support. */
2582
+ declare function formatPassClaim(successes: number, trials: number): string;
2583
+ /**
2584
+ * Score one model.
2585
+ *
2586
+ * Rate-quoting is gated on the WEAKEST cell, not on the run's requested
2587
+ * count. Three different tasks run once each is three samples of one, and
2588
+ * says nothing about whether any result reproduces.
2589
+ *
2590
+ * The requested count is not sufficient evidence that repeats happened:
2591
+ * the matrix caps per-scenario trials at `suggestedTrials`, so a
2592
+ * `--count 3` sweep silently runs ONE trial for every craftbook scenario.
2593
+ * On the first real sweep that was six of thirteen productivity tasks —
2594
+ * and reading the requested count would have published a confident
2595
+ * percentage over a suite that was nearly half unrepeated. The recorded
2596
+ * per-cell `trials` is the only honest source.
2597
+ *
2598
+ * `trialsPerScenario` remains an upper bound the caller may impose (the
2599
+ * run's count); the effective gate is the minimum of it and every cell.
2600
+ */
2601
+ declare function scoreModel(result: ScorecardModelResult, trialsPerScenario?: number): ModelScore;
2602
+ /**
2603
+ * The run whose numbers a suite's headline table should show: the newest
2604
+ * run that covered that suite. `runs` is newest-first by contract, but sort
2605
+ * defensively — a hand-edited dataset should not silently reorder history.
2606
+ */
2607
+ declare function headlineRunForSuite(dataset: ScorecardDataset, suiteId: string): ScorecardRun | null;
2608
+ interface SuiteScoreboard {
2609
+ suiteId: string;
2610
+ run: ScorecardRun;
2611
+ /** Models measured in the headline run, best first. */
2612
+ scores: ModelScore[];
2613
+ /**
2614
+ * Models present in the dataset for this suite but measured under
2615
+ * DIFFERENT provenance. Never merged into `scores` — rendered separately
2616
+ * so a reader can see they are not directly comparable.
2617
+ */
2618
+ otherRunScores: Array<ModelScore & {
2619
+ run: ScorecardRun;
2620
+ }>;
2621
+ /** Scenario ids as run, for the "what was measured" list. */
2622
+ scenarioIds: string[];
2623
+ }
2624
+ /**
2625
+ * Build one suite's scoreboard.
2626
+ *
2627
+ * Sorting is by successes-per-attributable-trial with the raw success
2628
+ * count as the tiebreak, so a model that ran fewer attributable trials
2629
+ * cannot outrank one that ran the full set on the same ratio.
2630
+ */
2631
+ declare function buildSuiteScoreboard(dataset: ScorecardDataset, suiteId: string): SuiteScoreboard | null;
2632
+ /**
2633
+ * One-line provenance stamp. Every published table needs this next to it —
2634
+ * a score without its device, date, and code version is not a measurement,
2635
+ * it is a rumour.
2636
+ */
2637
+ declare function describeProvenance(run: ScorecardRun, engines?: readonly string[]): string;
2638
+ /**
2639
+ * Whether two runs measured the same thing. Used to explain, in the
2640
+ * article, exactly why an off-run result is footnoted rather than merged.
2641
+ */
2642
+ declare function provenanceDifferences(a: ScorecardRun, b: ScorecardRun): string[];
2643
+
2644
+ /**
2645
+ * The checked-in scorecard, parsed once.
2646
+ *
2647
+ * Deliberately NOT lazy and NOT forgiving: a malformed dataset is a build
2648
+ * error, not a runtime surprise. The handboek renders these numbers to
2649
+ * users, so a shape that no longer matches the schema must fail where an
2650
+ * engineer sees it rather than quietly render an empty table.
2651
+ */
2652
+ declare const SCORECARD: ScorecardDataset;
2653
+ /** True when no sweep has been recorded yet — articles degrade gracefully. */
2654
+ declare function scorecardIsEmpty(dataset?: ScorecardDataset): boolean;
2655
+
2656
+ /**
2657
+ * First-party local toolsets whose runtime enforces its own narrow authority.
2658
+ *
2659
+ * Keep this predicate in core so every launch surface (service routes, chat
2660
+ * orchestration, and future clients) applies the same exact provenance check.
2661
+ * A matching id alone is never enough: the bundled source, package, supported
2662
+ * published entrypoint, argv, and pinned archive hash all have to match.
2663
+ */
2664
+ declare function isTrustedConstrainedToolset(args: {
2665
+ toolsetId: string;
2666
+ sourceId: string;
2667
+ runtime: ToolsetRuntime;
2668
+ }): boolean;
2669
+
2670
+ /**
2671
+ * Tier-collapse rendering (D3): render a task's embedded craftbook for
2672
+ * a SMALL executor — merge to a ≤3-step linear chain, one artifact per
2673
+ * group, gates verbatim (a merged group carries every merged step's
2674
+ * completion checks + scripts), step prompts rewritten to single-action
2675
+ * imperatives. "One task model, tier-rendered": structure density is a
2676
+ * dial priced per executor tier, never a fork of the task model.
2677
+ *
2678
+ * Deliberately CONSERVATIVE in v1 — the pass collapses only books it
2679
+ * can prove it understands, and fails OPEN (`changed: false`, book
2680
+ * untouched) on anything else:
2681
+ *
2682
+ * - linear chains only: `next` edges must follow array order (or be
2683
+ * omitted), entry must be the first step, no `branches`, no
2684
+ * `advanceWhen.goto`, no gate routes other than `onReject: <self>`;
2685
+ * - no activation-gated steps (merging would silently drop a guard);
2686
+ * - the caller enforces single-assignee + tier gating and persists the
2687
+ * result (see TaskManager.collapseCraftbookForTier).
2688
+ *
2689
+ * The pass is generic over the step type so a task's lifecycle fields
2690
+ * (createdAt, gateAttempts, gateAttemptHistory, …) ride through on the
2691
+ * surviving anchor steps — group id = anchor id, which keeps step
2692
+ * notes, telemetry, and gate bookkeeping keyed to a live id.
2693
+ */
2694
+
2695
+ interface CollapseCraftbookResult<S extends CraftbookStep> {
2696
+ steps: S[];
2697
+ entryStepId: string;
2698
+ /** Original step id → surviving group id (identity for anchors). */
2699
+ stepIdMap: Map<string, string>;
2700
+ changed: boolean;
2701
+ /** Why the pass declined, when it did (for the caller's log line). */
2702
+ skippedReason?: string;
2703
+ }
2704
+ /**
2705
+ * Collapse `book` for a small executor tier. Returns the input
2706
+ * unchanged (`changed: false`) unless `tier === 'tiny'`, the book is
2707
+ * longer than `maxSteps`, and every structural precondition holds.
2708
+ */
2709
+ declare function collapseCraftbookForTier<S extends CraftbookStep>(book: {
2710
+ steps: S[];
2711
+ entryStepId: string;
2712
+ }, opts: {
2713
+ tier: ModelTier;
2714
+ maxSteps?: number;
2715
+ }): CollapseCraftbookResult<S>;
2716
+
2717
+ /**
2718
+ * ─ Craftbook document codecs ─────────────────────────────────────────
2719
+ *
2720
+ * Format-agnostic parse/serialize for the single-document craftbook
2721
+ * authoring format, plus the doc ↔ runtime-Craftbook conversion. Both
2722
+ * encodings (JSON / markdown) funnel through ONE schema validation and
2723
+ * ONE repair-grade error pipeline, so `craftbook_write` behaves
2724
+ * identically in the format A/B eval's two arms.
2725
+ */
2726
+ type ParseCraftbookDocResult = {
2727
+ ok: true;
2728
+ doc: CraftbookDoc;
2729
+ } | {
2730
+ ok: false;
2731
+ errors: CraftbookDocError[];
2732
+ };
2733
+ declare function parseCraftbookDoc(text: string, format?: CraftbookDocFormat): ParseCraftbookDocResult;
2734
+ declare function serializeCraftbookDoc(doc: CraftbookDoc, format: CraftbookDocFormat): string;
2735
+ interface CraftbookFromDocOptions {
2736
+ /** Forced id (update-in-place routes). Wins over `doc.id` / the minted slug. */
2737
+ id?: string;
2738
+ /** Timestamp for createdAt/updatedAt. Preserved `createdAt` may be supplied separately. */
2739
+ now: string;
2740
+ createdAt?: string;
2741
+ }
2742
+ type CraftbookFromDocResult = {
2743
+ ok: true;
2744
+ craftbook: Craftbook;
2745
+ } | {
2746
+ ok: false;
2747
+ errors: CraftbookDocError[];
2748
+ };
2749
+ /**
2750
+ * Turn a schema-valid doc into the runtime `Craftbook`: expand each
2751
+ * step's `deliverable` sugar into its enforced gate, default the entry
2752
+ * step, and run the shared graph + script-ref validators. Errors come
2753
+ * back repair-grade — this result's formatted text is what the model
2754
+ * sees when `craftbook_write` refuses a save.
2755
+ */
2756
+ declare function craftbookFromDoc(doc: CraftbookDoc, opts: CraftbookFromDocOptions): CraftbookFromDocResult;
2757
+ /**
2758
+ * Down-map a runtime `Craftbook` to the round-trippable doc. Guaranteed
2759
+ * by construction to be accepted back by `craftbookFromDoc` unchanged —
2760
+ * that invariant is what makes `craftbook_read` → edit → `craftbook_write`
2761
+ * a safe loop for a model.
2762
+ */
2763
+ declare function docFromCraftbook(book: Craftbook): CraftbookDoc;
2764
+
2765
+ interface StrippedSkillBody {
2766
+ generated: boolean;
2767
+ title?: string;
2768
+ body: string;
2769
+ whenToInvoke?: string;
2770
+ }
2771
+ declare function stripGeneratedPreamble(content: string): StrippedSkillBody;
2772
+
2773
+ /**
2774
+ * ─ Skill body segmentation ───────────────────────────────────────────
2775
+ *
2776
+ * Splits an authored skill body into H1 title, intro prose, and its H2
2777
+ * sections, and decides whether the skill is a multi-step procedure.
2778
+ *
2779
+ * Step recognition is deliberately narrow: only `## Phase N`, `## Step
2780
+ * N` (N = `1`, `2A`, `2.5`, `2.75`, optional `: title` / `— title`
2781
+ * suffix, `(MANDATORY)`-style parentheticals staying in the title) and
2782
+ * `## 1. <title>` numbered headings count. Multi-step mode requires at
2783
+ * least TWO sections matching one family — a single "Phase 1" or an
2784
+ * essay-shaped skill falls back to a single-step conversion, because a
2785
+ * wrongly-split book is worse than an unsplit one.
2786
+ */
2787
+ type StepFamily = 'phase' | 'step' | 'num';
2788
+ interface StepMatch {
2789
+ family: StepFamily;
2790
+ ordinal: string;
2791
+ title: string;
2792
+ }
2793
+ interface SegmentedSkillBody {
2794
+ /** H1 text when the body opens with one. */
2795
+ title?: string;
2796
+ /** Prose between the H1 (or start) and the first H2. */
2797
+ intro: string;
2798
+ /** Every H2 section, in document order. */
2799
+ sections: MdSection[];
2800
+ /** Indices into `sections` recognized as steps of the winning family. */
2801
+ stepIndices: number[];
2802
+ /** The winning family, or null when single-step mode applies. */
2803
+ family: StepFamily | null;
2804
+ }
2805
+ declare function matchStepHeading(heading: string): StepMatch | null;
2806
+ declare function segmentSkillBody(body: string): SegmentedSkillBody;
2807
+
2808
+ /**
2809
+ * ─ SkillDoc — the parsed intermediate form of a SKILL.md ─────────────
2810
+ *
2811
+ * One skill file (Claude `.claude/skills` or gstack format: YAML
2812
+ * frontmatter + markdown body) parsed into a plain struct. Parsing is
2813
+ * pure and deterministic — no fs, no LLM, never throws: malformed
2814
+ * frontmatter degrades to an empty frontmatter with the whole text as
2815
+ * body, because arbitrary third-party skills must always produce *some*
2816
+ * convertible document.
2817
+ */
2818
+ type SkillFileKind = 'section' | 'reference' | 'template' | 'script' | 'bin' | 'other';
2819
+ /** A companion file discovered next to the SKILL.md (never read by core). */
2820
+ interface SkillFileRef {
2821
+ relPath: string;
2822
+ kind: SkillFileKind;
2823
+ bytes: number;
2824
+ }
2825
+ /** A flattened `hooks:` frontmatter declaration (Claude hook shape). */
2826
+ interface SkillHookDecl {
2827
+ phase: 'PreToolUse' | 'PostToolUse';
2828
+ matcher: string;
2829
+ command: string;
2830
+ statusMessage?: string;
2831
+ }
2832
+ interface SkillDoc {
2833
+ name: string;
2834
+ version?: string;
2835
+ description?: string;
2836
+ /** `triggers` + `voice-triggers`, deduped case-insensitively, document order. */
2837
+ triggers: string[];
2838
+ allowedTools: string[];
2839
+ interactive?: boolean;
2840
+ sensitive?: boolean;
2841
+ hooks: SkillHookDecl[];
2842
+ /** Frontmatter keys we recognize but don't map (gbrain, preamble-tier, …). */
2843
+ extraFrontmatter: Record<string, unknown>;
2844
+ /** True when the AUTO-GENERATED template marker was present. */
2845
+ generated: boolean;
2846
+ /** First fence-aware H1 title of the authored body, when present. */
2847
+ title?: string;
2848
+ /** Authored body: preamble stripped when generated, telemetry fences dropped. */
2849
+ body: string;
2850
+ /** `## When to invoke this skill` harvested from a stripped preamble. */
2851
+ whenToInvoke?: string;
2852
+ /** The full body before any stripping — the provenance-hash basis. */
2853
+ rawBody: string;
2854
+ files: SkillFileRef[];
2855
+ }
2856
+ interface ParseSkillDocOptions {
2857
+ /** Name to use when frontmatter has none (usually the skill's directory name). */
2858
+ fallbackName: string;
2859
+ files?: SkillFileRef[];
2860
+ }
2861
+ declare function parseSkillDoc(raw: string, opts: ParseSkillDocOptions): SkillDoc;
2862
+
2863
+ interface SkillPersona {
2864
+ role: string;
2865
+ about: string;
2866
+ }
2867
+ interface ConvertedScript {
2868
+ name: string;
2869
+ body: string;
2870
+ sourceBlock: string;
2871
+ stepId: string;
2872
+ origin: 'static';
2873
+ }
2874
+ interface UntranslatedBlock {
2875
+ stepId: string;
2876
+ code: string;
2877
+ }
2878
+ interface SkillConversionOptions {
2879
+ /** Book-id prefix — `'proj-skill-'` for project-local books, `''` for catalog. */
2880
+ idPrefix?: string;
2881
+ /** Catalog lane only; runtime lanes must not stamp times into the doc. */
2882
+ releasedAt?: string;
2883
+ /** Workspace-relative SKILL.md path, for provenance + companion paths. */
2884
+ sourcePath?: string;
2885
+ /** Attempt static shell→TS conversion (default true). */
2886
+ transpileShell?: boolean;
2887
+ /**
2888
+ * Drop the `> Converted from …` provenance/notes block from the
2889
+ * description. The runtime lane keeps it (it cites the user's own repo
2890
+ * path — useful); the catalog lane omits it so shipped books read as
2891
+ * ordinary skills, not conversions.
2892
+ */
2893
+ omitProvenance?: boolean;
2894
+ }
2895
+ interface SkillConversionResult {
2896
+ doc: CraftbookDoc;
2897
+ scripts: ConvertedScript[];
2898
+ untranslated: UntranslatedBlock[];
2899
+ /** Dropped/unmapped source features, sorted — the honesty ledger. */
2900
+ notes: string[];
2901
+ persona?: SkillPersona;
2902
+ }
2903
+ declare function skillToCraftbookDoc(skill: SkillDoc, opts?: SkillConversionOptions): SkillConversionResult;
2904
+
2905
+ /**
2906
+ * ─ Static shell→gezel-script transpiler ──────────────────────────────
2907
+ *
2908
+ * Deterministically converts a *very small* shell subset into a
2909
+ * sandboxed gezel-sdk script — no LLM anywhere. A block converts only
2910
+ * when EVERY effectful line maps; one unmappable line rejects the whole
2911
+ * block (the caller keeps it as prose). The output follows the exact
2912
+ * skeleton the LLM translator is instructed to produce, so both
2913
+ * producers pass the same `validateScriptBody` gate service-side.
2914
+ *
2915
+ * Supported line forms (everything else → null):
2916
+ * npm|pnpm|yarn run <script> → gezel.mcp.call('run_package_script')
2917
+ * npm|pnpm|yarn test|start|build → same, bare lifecycle script
2918
+ * cat <relative-path> → gezel.fs.read
2919
+ * ls [<relative-path>] → gezel.fs.list
2920
+ * echo <text> → gezel.log
2921
+ * pwd | which <x> | # comment → dropped (no-op in the sandbox)
2922
+ *
2923
+ * Deliberately unsupported: arguments after the script name (their
2924
+ * semantics vary per runner), `npx`/`node` (arbitrary execution), git
2925
+ * (no MCP tool in the translated-script contract), redirects/pipes/
2926
+ * substitution (callers should pre-triage with `triageShellBlock`, but
2927
+ * the transpiler independently rejects them).
2928
+ */
2929
+ declare function transpileShellBlock(code: string, scriptName: string): {
2930
+ body: string;
2931
+ } | null;
2932
+
2933
+ /**
2934
+ * Execution density — the single switch that scales how much orchestration
2935
+ * scaffolding wraps a task, from the full crew + granular craftbook
2936
+ * ("scaffold") down to a single generalist ambachtsman running a collapsed
2937
+ * craftbook ("flat"). See `GezelConfig.executionDensity` and
2938
+ * `docs/frontier-adaptive-execution.md`.
2939
+ *
2940
+ * Kept dependency-free (string in, union out) so both the runtime and the
2941
+ * eval harness can resolve density the same way.
2942
+ */
2943
+ type ExecutionDensity = 'flat' | 'scaffold';
2944
+ type ExecutionDensitySetting = 'auto' | ExecutionDensity;
2945
+ /**
2946
+ * Providers that run their OWN internal agent loop (plan→act→observe)
2947
+ * inside a single CLI/SDK invocation — they self-orchestrate, so gezel's
2948
+ * outer crew + per-step loop is largely redundant overhead. A finer cut
2949
+ * than "is this a cloud provider": `copilot` is cloud-backed but DOES
2950
+ * self-orchestrate, whereas raw cloud APIs (`anthropic`, `openai`) and
2951
+ * local engines (`llama-cpp`, `mlx`, `ds4`) do not — gezel drives their loop
2952
+ * one turn per step.
2953
+ *
2954
+ * Mirrors `evals/src/providers.ts` `isSelfOrchestratingProvider`. Takes a
2955
+ * bare string to avoid coupling to the provider-name union.
2956
+ */
2957
+ declare function isSelfOrchestratingProvider(providerName: string | undefined): boolean;
2958
+ /**
2959
+ * Resolve the effective execution density for a session.
2960
+ *
2961
+ * - explicit `flat` / `scaffold` → that value (the config override / escape
2962
+ * hatch — set `scaffold` to force the full crew on a frontier provider).
2963
+ * - `auto` **and unset** → `flat` for self-orchestrating providers, else
2964
+ * `scaffold`. `auto` is the default: validated by the A/B
2965
+ * (codex-cli, flat == scaffold pass rate at −36% to −61% tokens; the
2966
+ * quality gates stay the universal floor that makes flat safe). Local
2967
+ * MEDIUM-tier models also resolve to `flat` (paired N=3 core A/B, see the
2968
+ * function body); local small/tiny/large and raw-cloud stay `scaffold`.
2969
+ */
2970
+ declare function resolveExecutionDensity(setting: ExecutionDensitySetting | undefined, providerName: string | undefined, tier?: string): ExecutionDensity;
2971
+
2972
+ interface PlanStepSummary {
2973
+ id: string;
2974
+ name: string;
2975
+ description?: string;
2976
+ /** The concrete static deliverable this step produces, if any. */
2977
+ deliverable?: string;
2978
+ /** A short description of how the deliverable is enforced. */
2979
+ enforcement?: string;
2980
+ /** True when the step has a gate (checks/scripts) or an advanceWhen file. */
2981
+ gated: boolean;
2982
+ terminal: boolean;
2983
+ /** True when this is the terminal step that verifies outcomes. */
2984
+ isVerification: boolean;
2985
+ /** Resolved gezel or suggested role label. */
2986
+ assignee?: string;
2987
+ }
2988
+ interface PlanSummary {
2989
+ title: string;
2990
+ about: string;
2991
+ outcomes: Outcome[];
2992
+ steps: PlanStepSummary[];
2993
+ buildStepCount: number;
2994
+ gatedBuildStepCount: number;
2995
+ hasVerification: boolean;
2996
+ }
2997
+ /** Curate a draft task's craftbook + outcomes into a structured summary. */
2998
+ declare function summarizePlanDocument(task: Task): PlanSummary;
2999
+ /**
3000
+ * Readiness warnings for a plan, in human-readable form. Empty means the
3001
+ * plan is well-formed. Surfaced in the UI (with an "Approve anyway"
3002
+ * override) and enforced by `TaskManager.activate` (unless forced).
3003
+ */
3004
+ declare function planGuardrails(summary: PlanSummary): string[];
3005
+ /** Render a draft task as a readable markdown "plan document". */
3006
+ declare function renderPlanDocument(task: Task): string;
3007
+
3008
+ /**
3009
+ * Shared parser for gezel @-mention markdown.
3010
+ *
3011
+ * The composer writes mentions as `@[Label](gezel:id)` and may append a
3012
+ * `?project=<projectId>` routing suffix to the id. The service receives the
3013
+ * raw id over the chat-session wire shape, so UI and service must agree on
3014
+ * the split rules.
3015
+ */
3016
+ interface GezelMentionToken {
3017
+ /** Bare gezel id, without an optional `?project=...` suffix. */
3018
+ id: string;
3019
+ /** Display label as written in the markdown brackets. */
3020
+ label: string;
3021
+ /** Full id as it appears between `gezel:` and `)`. */
3022
+ rawId: string;
3023
+ /** Project routing override decoded from the suffix, if present. */
3024
+ projectId?: string;
3025
+ }
3026
+ declare function extractGezelMentions(markdown: string): string[];
3027
+ declare function extractGezelMentionTokens(markdown: string): GezelMentionToken[];
3028
+ declare function parseGezelMentionId(rawId: string): {
3029
+ gezelId: string;
3030
+ projectId?: string;
3031
+ };
3032
+ declare function stripGezelMentions(text: string): string;
3033
+
3034
+ /**
3035
+ * Config override for every pnpm command that installs or operates inside
3036
+ * a relocatable install tree (system toolsets, catalog npm toolsets).
3037
+ *
3038
+ * Those trees are `pnpm install`ed in a staging directory and renamed into
3039
+ * place. pnpm's default isolated linker uses NTFS junctions on Windows,
3040
+ * whose targets are stored as absolute paths — after the rename every link
3041
+ * dangles and the first cross-package require fails. A hoisted tree
3042
+ * contains no links and survives relocation on every platform.
3043
+ *
3044
+ * Later invocations against the same tree (`pnpm exec playwright …`) must
3045
+ * repeat the flag: when the current config disagrees with the linker
3046
+ * recorded in `node_modules/.modules.yaml`, pnpm silently rebuilds the
3047
+ * tree with the default isolated linker before running the command.
3048
+ */
3049
+ declare const PNPM_HOISTED_NODE_LINKER = "--config.node-linker=hoisted";
3050
+ interface PnpmInvocationOptions {
3051
+ pnpmPath?: string;
3052
+ nodePath?: string;
3053
+ processExecPath: string;
3054
+ platform: NodeJS.Platform;
3055
+ }
3056
+ interface PnpmInvocation {
3057
+ command: string;
3058
+ args: string[];
3059
+ shell: boolean;
3060
+ mode: 'node-script' | 'executable' | 'path-fallback';
3061
+ }
3062
+ /**
3063
+ * Resolve a pnpm launch without assuming that `GEZEL_PNPM_PATH` is an
3064
+ * executable. Packaged Gezel points it at pnpm's JavaScript entrypoint
3065
+ * and launches that script with the separately bundled Node runtime.
3066
+ * Development installs can still point at an executable or fall back to
3067
+ * the `pnpm` shim on PATH.
3068
+ */
3069
+ declare function resolvePnpmInvocation(args: string[], options: PnpmInvocationOptions): PnpmInvocation;
3070
+
3071
+ /**
3072
+ * Transient-network retry primitives, shared by every code path that pulls
3073
+ * bytes off the internet.
3074
+ *
3075
+ * There are two shapes of network work in gezel and they need different
3076
+ * treatment:
3077
+ *
3078
+ * 1. **Multi-GB resumable transfers** (model weights, engine archives).
3079
+ * Those go through the service's `downloadWithRetry` helper, which
3080
+ * layers HTTP Range resumption and a progress-aware attempt budget on
3081
+ * top of the primitives here.
3082
+ * 2. **The small requests that surround a big transfer** — GitHub release
3083
+ * metadata, SHA256SUMS manifests, npm packuments, sub-100 MiB tarballs.
3084
+ * Historically these had *no* retry at all, so one dropped packet
3085
+ * during first-run setup failed the whole install with a raw
3086
+ * `fetch failed`. `retryTransient` is for those.
3087
+ *
3088
+ * Both share one backoff schedule and one notion of "is this error worth
3089
+ * retrying", so a flaky link produces consistent behavior everywhere.
3090
+ */
3091
+ /**
3092
+ * Backoff schedule (ms), indexed by 0-based retry number. Jitter is applied
3093
+ * on top so concurrent transfers don't retry in lockstep and re-collide.
3094
+ */
3095
+ declare const DEFAULT_BACKOFF_SCHEDULE_MS: readonly number[];
3096
+ /** Default attempt count for the small-request helper. 3 attempts = 2 retries. */
3097
+ declare const DEFAULT_TRANSIENT_ATTEMPTS = 3;
3098
+ declare function backoffDelayMs(retryIndex: number, schedule?: readonly number[], random?: () => number): number;
3099
+ /** Resolves `true` when the wait was cut short by an abort. */
3100
+ declare function sleepWithAbort(ms: number, signal?: AbortSignal): Promise<boolean>;
3101
+ /**
3102
+ * A non-2xx response, thrown so `retryTransient` can decide retryability from
3103
+ * the status code. Callers that want a friendlier message pass one in.
3104
+ */
3105
+ declare class HttpStatusError extends Error {
3106
+ readonly status: number;
3107
+ constructor(status: number, message?: string);
3108
+ }
3109
+ /**
3110
+ * 5xx, 408, and 429 are the server telling us to come back. Everything else in
3111
+ * 4xx is a real client-side problem (missing asset, gated repo, bad auth) and
3112
+ * retrying just delays an unavoidable error.
3113
+ */
3114
+ declare function isTransientHttpStatus(status: number): boolean;
3115
+ /**
3116
+ * Statuses that mean "the service is throttling or shedding load — back off
3117
+ * and come back later", as opposed to a fault worth retrying inline.
3118
+ */
3119
+ declare function isRateLimitStatus(status: number): boolean;
3120
+ /**
3121
+ * Undici surfaces network faults as `TypeError: fetch failed` with the real
3122
+ * errno on `.cause`, so match against the flattened chain rather than
3123
+ * `err.code`. Aborts are deliberately NOT transient — a cancel means stop.
3124
+ */
3125
+ declare function isTransientNetworkError(err: unknown): boolean;
3126
+ /** Error name + message + the whole `cause` chain, for pattern matching. */
3127
+ declare function flattenErrorMessage(err: unknown): string;
3128
+ interface RetryAttemptInfo {
3129
+ /** Which attempt is about to start (1-based). */
3130
+ attempt: number;
3131
+ maxAttempts: number;
3132
+ delayMs: number;
3133
+ /** Flattened message of the failure that triggered this retry. */
3134
+ reason: string;
3135
+ }
3136
+ interface RetryTransientOptions {
3137
+ /** Total attempts, not retries. Default 3. */
3138
+ attempts?: number;
3139
+ /** Short human label used in the give-up message, e.g. 'release metadata'. */
3140
+ label?: string;
3141
+ signal?: AbortSignal;
3142
+ /** Override which errors are worth retrying. Default: `isTransientNetworkError`. */
3143
+ isRetryable?: (err: unknown) => boolean;
3144
+ /** Notified before each wait, for progress plumbing / logging. */
3145
+ onRetry?: (info: RetryAttemptInfo) => void;
3146
+ schedule?: readonly number[];
3147
+ }
3148
+ /**
3149
+ * Run `fn`, retrying transient network failures with exponential backoff.
3150
+ * Non-transient failures (4xx, programming errors, aborts) rethrow on the
3151
+ * first try — retrying them would only add latency to a certain failure.
3152
+ */
3153
+ declare function retryTransient<T>(fn: (attempt: number) => Promise<T>, opts?: RetryTransientOptions): Promise<T>;
3154
+ /**
3155
+ * `retryTransient` around a single `fetch`, with non-retryable statuses
3156
+ * rejected as `HttpStatusError` so callers get one uniform error type.
3157
+ * The response body is left unread — the caller owns it.
3158
+ */
3159
+ declare function fetchWithRetry(url: string, init?: RequestInit & {
3160
+ fetchImpl?: typeof fetch;
3161
+ }, opts?: RetryTransientOptions): Promise<Response>;
3162
+
3163
+ /**
3164
+ * App-version compatibility checks for catalog content.
3165
+ *
3166
+ * Gilde items may declare `minGezelVersion` — the oldest gezel build that can
3167
+ * meaningfully use them (e.g. a model needing a newer bundled engine). Gezel
3168
+ * versions are date-based (`1.YYDDD.RUN`, see scripts/stamp-version.mjs), so
3169
+ * floors are authored as `1.YYDDD` — major.minor only, because the run number
3170
+ * is unknowable ahead of a release. Comparison is numeric per component with
3171
+ * missing components treated as 0, which makes a two-component floor behave
3172
+ * exactly like "any build of that day or later".
3173
+ */
3174
+ /**
3175
+ * Numeric component-wise comparison of dotted version strings. Missing
3176
+ * components count as 0. Returns NaN when either side has a non-numeric
3177
+ * component — callers decide how to treat malformed input.
3178
+ */
3179
+ declare function compareGezelVersions(a: string, b: string): number;
3180
+ /**
3181
+ * True when `current` satisfies a `minGezelVersion` floor.
3182
+ *
3183
+ * - No floor → satisfied.
3184
+ * - `current === '0.0.0'` (unstamped dev checkout — dev daemons, evals,
3185
+ * tests) → satisfied; dev builds never filter content.
3186
+ * - `GEZEL_IGNORE_MIN_GEZEL_VERSION=1` → satisfied (debug escape hatch for
3187
+ * stamped builds).
3188
+ * - A malformed floor → satisfied. Malformed content must never make items
3189
+ * vanish from the catalog (same swallow-errors stance as the loader's
3190
+ * semver `safeCompare`).
3191
+ */
3192
+ declare function satisfiesMinGezelVersion(floor: string | undefined, current: string): boolean;
3193
+ /**
3194
+ * The stricter (higher) of two optional floors — used when composing an
3195
+ * identity-level floor with a version-level one into the resolved manifest.
3196
+ * Malformed floors lose to well-formed ones; two malformed floors return the
3197
+ * first.
3198
+ */
3199
+ declare function maxMinGezelVersion(a: string | undefined, b: string | undefined): string | undefined;
3200
+
3201
+ /**
3202
+ * True for managed companion/runtime paths that travel with an outside-in
3203
+ * document but are not themselves user-visible library entries.
3204
+ */
3205
+ declare function isOutsideInInternalPath(path: string): boolean;
3206
+
3207
+ /**
3208
+ * The package version is embedded into health responses and logs so clients
3209
+ * can surface it in the UI.
3210
+ */
3211
+ declare const GEZEL_VERSION = "0.1.0";
3212
+ /**
3213
+ * Default ISO-timestamp helper so every package produces the same shape.
3214
+ */
3215
+ declare function nowIso(): string;
3216
+
3217
+ export { ACCESSORY_OPTIONS, ACCESSORY_RARITY, ACCESSORY_RARITY_WEIGHT, type AIEngagementMode, type AccessoryOption, type AccessoryRarity, type AccessoryRarityEntry, AdvanceWhen, type AffinityEdge, BINARY_DOCUMENT_EXTENSIONS, BODY_ARCHETYPES, BODY_SHAPE_KEYS, type BinaryDocumentContainer, type BinaryDocumentVerdict, type BlockPlacement, type BodyArchetype, type BodyShape, CONSTRAINED_HOST_RAM_BYTES, CONSTRAINED_HOST_VRAM_BYTES, CONSTRAINED_LOCAL_CONTEXT_FLOOR_TOKENS, type CollapseCraftbookResult, CompassRegion, type ComposedCodeContext, type ComposedSection, type ConvertedScript, Craftbook, CraftbookDoc, CraftbookDocError, CraftbookDocFormat, type CraftbookFromDocOptions, type CraftbookFromDocResult, CraftbookStep, DEFAULT_BACKOFF_SCHEDULE_MS, DEFAULT_NIGHT_SHIFT_WINDOW, DEFAULT_SANDBOX_COPILOT, DEFAULT_SECURITY_LEVEL, DEFAULT_TOOLSET_GROUPS, DEFAULT_TRANSIENT_ATTEMPTS, DENSE_ONLY_VRAM_THRESHOLD, DRESS_OPTIONS, DRESS_RARITY, type DeliverableKind, DeliverableKindSchema, type DisplayableGezel, type DressOption, EXPRESSION_OPTIONS, type ExecutionDensity, type ExecutionDensitySetting, type Expression, FACIAL_HAIR_OPTIONS, FIGURE_SCALES, FIGURE_SCALE_KEYS, FIGURE_SCALE_ODDS, FIT_KV_CONTEXT_TOKENS, type FacialHairOption, type FigureScale, type FigureScaleDef, FileContextResponse, type FitnessBadge, type FitnessBadgeInput, type FitnessBadgeTier, GEZEL_CHAT_FONTS, GEZEL_VERSION, GRAIN_PRESETS, GROWTH_COSMETICS, GateCheck, GateScriptRef, GezelConfig, type GezelFont, type GezelFontId, GezelGender, type GezelHref, type GezelMentionToken, type GezelPronounForms, type GrainPreset, type GrainStyle, type GrowthCosmetic, HAIR_SHAPES, HAT_FELTS, HAT_OPTIONS, type HairShape, type HardwareHint, type HatOption, HttpStatusError, KOKORO_VOICES, type KokoroVoiceInfo, LOCAL_CONTEXT_FLOOR_TOKENS, type LayoutFileInput, type LayoutOptions, type LayoutResult, type LogLevel, type Logger, MARK_OPTIONS, MIN_TRIALS_FOR_RATE, MODEL_FAMILIES_LEAKING_REASONING, MOE_NON_EXPERT_FRACTION_ESTIMATE, type MachineMemoryShape, MapBuilding, MapDistrict, MapPlaza, MapStreet, type MarkOption, MdSection, type MetaFormValue, type MetaInputFormItem, type MetaOutputFormItem, type ModelFitInput, type ModelFitResult, type ModelFitTier, ModelFitnessRecord, type ModelScore, ModelTier, NewCraftbookStep, type NightShiftWindow, OLLAMA_REASONING_MODEL_PREFIXES, Outcome, PALETTE, PARAM_PROJECT_PROPERTY_KEY, PLATE_H, PNPM_HOISTED_NODE_LINKER, PROJECT_GEZEL_ID_PREFIX, PROJECT_GEZEL_LOCAL_ID, PROJECT_PROPERTY_DEFINITIONS, PROJECT_TYPES, type ParseCraftbookDocResult, type ParseSkillDocOptions, type PersistNode, type PlanStepSummary, type PlanSummary, type PnpmInvocation, type PnpmInvocationOptions, type Poppetje, PoppetjeSchema, type PoppetjeSeedOptions, type PriorNode, Project, type ProjectPropertyDefinition, type ProjectPropertyKind, type ProjectType, type ProjectTypeDetect, ProjectTypeDetectSchema, type ProjectTypeGezelAffinity, ProjectTypeGezelAffinitySchema, type ProjectTypeGezelRole, ProjectTypeGezelRoleSchema, ProjectTypeSchema, REDACTED, REDACTED_EMAIL, ROLES, ROLE_ALIASES, ROLLABLE_ACCESSORIES, ROLLABLE_DRESSES, ROLLABLE_HATS, type RecoDevice, type RecoGateInput, type RecoModelInput, type RecoPick, Rect, type RedactSensitiveOptions, type ResolvedSecurityPolicy, type RetryAttemptInfo, type RetryTransientOptions, type RoleDefinition, type RoleId, SCORECARD, SCORECARD_SCHEMA_VERSION, SECURITY_PRESETS, SHIRT_PATTERN_OPTIONS, SLOT_ODDS, SMALL_MODEL_VRAM_THRESHOLD, STREET_WIDTHS, type ScorecardCell, ScorecardCellSchema, type ScorecardDataset, ScorecardDatasetSchema, type ScorecardDevice, ScorecardDeviceSchema, type ScorecardModelResult, ScorecardModelResultSchema, type ScorecardProvenance, ScorecardProvenanceSchema, type ScorecardRun, ScorecardRunSchema, ScriptInputField, ScriptMeta, ScriptOutputField, type SecurityCapabilities, type SecurityLevel, SecurityPolicy, type SecurityPresetLevel, type SegmentedSkillBody, type ShirtPattern, type SkillConversionOptions, type SkillConversionResult, type SkillDoc, type SkillFileKind, type SkillFileRef, type SkillHookDecl, type SkillPersona, type SplitScriptSource, StepDeliverable, type StepFamily, StepGate, type StepMatch, type StrippedSkillBody, type SuiteScoreboard, Task, ToolsetRuntime, type TownPlate, type TownPlaza, type TownResult, type TownRootResult, type UntranslatedBlock, VillageAnchor, VillageOverride, type WorkshopTempo, type WorkshopTempoDefaults, advanceSniffForKind, appendLotInFolder, assignRegions, backoffDelayMs, binaryDocumentContainer, binaryDocumentExtension, blockSize, buildSuiteScoreboard, cellAttributableTrials, classifySecurityLevel, coerceDeliverableKind, collapseCraftbookForTier, collapseFiles, compareGezelVersions, completionGate, composeFileContext, composeFitnessBadge, computeModelFit, craftbookFromDoc, createLogger, decodeProjectGezelId, deliverableKindForStep, deliverableStep, deriveAnchorsFromPrior, describeProvenance, displayLabels, displayName, docFromCraftbook, encodeProjectGezelId, escapeMd, estimateManifestKvBytes, excludesMoE, expandStepDeliverable, expandStepDeliverables, extractGezelMentionTokens, extractGezelMentions, femaleNames, fetchWithRetry, findKokoroVoice, firstActionForKind, flattenErrorMessage, folderPad, footprintWithin, formValueToMeta, formatPassClaim, getEngagementMode, getLogLevel, getProjectType, getWorkshopTempo, gezelLineHref, gezelNavHref, growthCosmeticById, hardwareHint, hash01, headlineRunForSuite, inferDeliverableKind, inferGenderForName, initialPoppetjeForGezel, isBandwidthBoundHost, isBinaryDocumentPath, isCanonicalProjectGezelId, isEngagementAllowed, isInNightShiftWindow, isMemoryConstrainedMachine, isMoEFromTags, isOllamaReasoningModel, isOutsideInInternalPath, isProactiveAllowed, isProjectGezelId, isProseDocPath, isRateLimitStatus, isRecommendedModel, isSchedulingAllowed, isSelfOrchestratingProvider, isTaskWorkAllowed, isTransientHttpStatus, isTransientNetworkError, isTrustedConstrainedToolset, isUnifiedMemoryDevice, isValidKokoroVoice, joinMetaRegion, lastNightShiftWindow, layoutBuildingsInBlock, layoutFileMap, leaksUntaggedReasoning, listProjectTypes, localContextFloorTokens, localDateKey, lotSpec, maleNames, matchStepHeading, maxMinGezelVersion, mediaModelFits, meetsCapabilityFloor, mergeStreets, metaToFormValue, nearestFreeRect, needsSmallModelRecommendation, nextLockedCosmetic, nextNightShiftStart, nightShiftDayKey, nightShiftWindowKey, normalizeChatModelCatalogId, nowIso, packLeafStrip, packTownNode, packTownRoot, packTownSubtree, paramProjectProperty, parseCraftbookDoc, parseGezelHref, parseGezelMentionId, parseMetaObject, parseSkillDoc, pickKokoroVoiceForGender, pickRandomName, pickRandomNameWithGender, pickRecommendedModel, placeGhostBlocks, planGuardrails, plateRectFor, poppetjeFromSeed, prefersMoE, prettifyToolName, projectGezelId, projectPropertyDefinition, projectWorkspaceWritable, pronounFormsForGender, pronounsForGender, provenanceDifferences, quoteSingle, redactCredentials, redactSensitive, regionCell, regionOf, renderPlanDocument, resolveExecutionDensity, resolveGezelFontFamily, resolveGezelFontScale, resolvePnpmInvocation, resolveRoleId, resolveSandboxCopilot, resolveSecurityPolicy, retryTransient, rewriteGezelHrefs, roleCapabilityFloor, roleDefaultBooks, roleDefinition, roleDeliverableScripts, roleGateAffinity, roleSuggestedTuningProfile, satisfiesMinGezelVersion, scoreModel, scorecardIsEmpty, securityPolicyForLevel, seedFromKey, segmentSkillBody, serializeCraftbookDoc, serializeScriptMeta, setDebugNamespaces, setLogLevel, setupLineSpan, skillToCraftbookDoc, sleepWithAbort, splitScriptSource, stepDeliverablePath, stitchScriptSource, streetId, streetTier, streetWidth, stripGeneratedPreamble, stripGezelMentions, stripMcpPrefix, summarizePlanDocument, toolActivityLabel, toolsetGroupsForRole, transpileShellBlock, verifyBinaryDocumentBytes, videoMemoryBudgetBytes, workshopTempoDefaults };