openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
1 lines • 36 kB
JavaScript
import{t as e}from"./openclaw-state-read-closed-object-D3QW4nRZ.mjs";import{n as t,r as n,t as r}from"./openclaw-state-read-primitives-B8yGv9fM.mjs";import{t as i}from"./openclaw-state-read-since-CMgkl5M5.mjs";import{t as a}from"./openclaw-state-read-worker-capacity-DUUED-H8.mjs";import{Type as o}from"typebox";const s={agentId:r,paths:o.Array(r),reason:r,repairHint:r},ee=o.Union([e({...s,embeddedOwnerId:r,code:o.Literal(`agent-database-ownership-mismatch`)}),e({...s,code:o.Union([o.Literal(`agent-database-inspection-pending`),o.Literal(`agent-database-inspection-failed`),o.Literal(`agent-database-held`)])})]),te=o.Union([o.Literal(`agent`),o.Literal(`system`)]),ne=o.Union([o.Literal(`operator`),o.Literal(`agent`),o.Literal(`template`)]),re=o.Union([o.Literal(`sole`),o.Literal(`legacy`),o.Literal(`explicit`)]),ie={sessionPlacement:o.Optional(e({requiredProfile:o.Optional(e({id:r,providerId:o.Optional(r),executionModes:o.Optional(o.Array(o.Literal(`worker-turn`))),inference:o.Optional(o.Literal(`worker`))}))}))};e({includeSessionPlacement:o.Optional(o.Boolean())});const ae=o.String({enum:[`available`,`unavailable`,`starting`,`stopping`,`error`]}),c=o.String({enum:[`persistent`,`disposable`]}),oe=e({state:o.Union([o.Literal(`locked`),o.Literal(`unlocked`),o.Literal(`unknown`)])}),se=o.Union([o.Literal(`requested`),o.Literal(`provisioning`),o.Literal(`bootstrapping`),o.Literal(`ready`),o.Literal(`attached`),o.Literal(`idle`),o.Literal(`draining`),o.Literal(`destroying`),o.Literal(`destroyed`),o.Literal(`failed`),o.Literal(`orphaned`)]),ce=o.Union([o.Literal(`stopped`),o.Literal(`connecting`),o.Literal(`connected`),o.Literal(`reconnecting`)]),l=o.Union([o.Literal(`browser`),o.Literal(`terminal`)]),le=o.Union([e({code:o.Literal(`update-required`),action:o.Literal(`update-and-reconnect`),updateCommand:o.Literal(`openclaw update`),headlessReconnectCommand:o.Literal(`openclaw node restart`)}),e({code:o.Literal(`worker-host-unavailable`),message:o.String({minLength:1,maxLength:1024})})]),ue=o.Union([e({status:o.Literal(`installed`),version:r}),e({status:o.Literal(`missing`)})]),de=o.Refine(e({total:o.Integer({minimum:1,maximum:a}),available:o.Integer({minimum:0,maximum:a}),reclaimableIdle:o.Optional(o.Integer({minimum:0,maximum:2}))}),e=>e.available+(e.reclaimableIdle??0)<=e.total,e=>`available worker slots ${e.available} exceed total ${e.total}`),fe=o.Union([o.Literal(`invocable`),o.Literal(`pending-approval`),o.Literal(`undeclared`),o.Literal(`unauthorized`)]),pe=e({command:o.String({minLength:1,maxLength:128}),state:fe,message:o.Optional(r)}),me=o.Union([e({mode:o.Literal(`snapshot`),phase:o.Optional(o.Literal(`saving`))}),e({mode:o.Literal(`cold`),reason:o.Union([o.Literal(`no-snapshot-yet`),o.Literal(`setup-changed`),o.Literal(`snapshot-retiring`),o.Literal(`snapshot-unavailable`),o.Literal(`os-unsupported`),o.Literal(`warm-images-off`),o.Literal(`capture-paused`),o.Literal(`backend-cannot-snapshot`),o.Literal(`class-unknown`)]),phase:o.Union([o.Literal(`provisioning`),o.Literal(`preparing`),o.Literal(`saving`)])})]),he=e({profileId:o.Optional(r),providerId:r,leaseId:o.Optional(r),state:se,startStatus:o.Optional(me),ageMs:o.Integer({minimum:0}),idleMs:o.Optional(o.Integer({minimum:0})),destroyRequestedAtMs:o.Optional(o.Integer({minimum:0})),attachedSessionIds:o.Array(r),tunnelStatus:ce,error:o.Optional(r),desktop:o.Optional(o.Boolean()),desktopApps:o.Optional(o.Array(l,{maxItems:8,uniqueItems:!0}))});function createEnvironmentSummaryProperties(){return{id:r,type:r,label:o.Optional(r),status:ae,platform:o.Optional(r),sessionHost:o.Optional(o.Boolean()),workerSlots:o.Optional(de),workerHost:o.Optional(e({deviceFolders:o.Optional(o.Literal(!0))})),workerBundle:o.Optional(ue),lastConnectedAtMs:o.Optional(o.Integer({minimum:0})),lastDisconnectedAtMs:o.Optional(o.Integer({minimum:0})),lastSeenAtMs:o.Optional(o.Integer({minimum:0})),lastSeenReason:o.Optional(r),trust:o.Optional(c),capabilities:o.Optional(o.Array(r)),invocableCommands:o.Optional(o.Array(o.String({minLength:1,maxLength:128}),{maxItems:128,uniqueItems:!0})),desktop:o.Optional(o.Boolean()),desktopAvailability:o.Optional(oe),issues:o.Optional(o.Array(le,{minItems:1,maxItems:8})),worker:o.Optional(he),preparation:o.Optional(e({purpose:o.Union([o.Literal(`reserve`),o.Literal(`build`)]),key:r,details:o.Optional(e({demandAtMs:o.Integer({minimum:0}),expiresAtMs:o.Integer({minimum:0}),consumedAtMs:o.Union([o.Integer({minimum:0}),o.Null()]),project:o.Optional(e({label:o.Optional(r),baseCommit:r}))}))}))}}const ge=e({...createEnvironmentSummaryProperties(),requiredNodeCommand:o.Optional(pe),desktopSetup:o.Optional(e({state:o.Union([o.Literal(`ready`),o.Literal(`needs-server`),o.Literal(`unsupported`),o.Literal(`managed`)]),detail:o.Optional(r)}))});e({runtimeId:o.Optional(o.String({minLength:1,maxLength:128})),projection:o.Optional(o.Literal(`profiles`)),includeDesktopSetup:o.Optional(o.Boolean()),includePreparedDetails:o.Optional(o.Boolean())});const _e=e({id:o.String({minLength:1,maxLength:128}),label:o.String({minLength:1,maxLength:128}),cpu:o.Optional(o.Integer({minimum:1,maximum:65536})),memoryGb:o.Optional(o.Integer({minimum:1,maximum:65536})),default:o.Optional(o.Boolean()),os:o.Optional(o.String({minLength:1,maxLength:64}))}),ve=o.Array(_e,{minItems:1,maxItems:64}),ye=e({id:o.String({minLength:1,maxLength:64}),label:o.String({minLength:1,maxLength:64}),default:o.Optional(o.Boolean()),disabledReason:o.Optional(o.String({minLength:1,maxLength:256}))}),u=o.Union([o.Literal(`worker-turn`),o.Literal(`remote-exec`)]),d=e({id:r,providerId:r,inference:o.Optional(o.Literal(`worker`)),readyWorkers:o.Optional(o.Integer({minimum:0})),providerDisplayId:o.Optional(o.String({pattern:`^[a-z][a-z0-9-]{0,63}(?![\\s\\S])`,maxLength:64})),trust:o.Optional(c),executionMode:o.Optional(u),executionModes:o.Optional(o.Union([o.Tuple([u]),o.Tuple([o.Literal(`worker-turn`),o.Literal(`remote-exec`)])])),machines:o.Optional(ve),operatingSystems:o.Optional(o.Array(ye,{minItems:1,maxItems:8}))}),be=e({id:r,providerId:r,providerDisplayId:o.Optional(o.String({pattern:`^[a-z][a-z0-9-]{0,63}(?![\\s\\S])`,maxLength:64}))});e({}),e({profile:d}),e({requiredProfile:o.Optional(r),environments:o.Array(ge),profiles:o.Optional(o.Array(d)),dispatchableProfileIds:o.Optional(o.Array(r,{uniqueItems:!0})),suggestedProfile:o.Optional(be),preparedPool:o.Optional(e({maxTotal:o.Integer({minimum:0}),reservedEnvironmentIds:o.Array(r,{uniqueItems:!0})}))}),e({environmentId:r,includePreparedDetails:o.Optional(o.Boolean())}),e(createEnvironmentSummaryProperties()),e({profileId:r,idempotencyKey:r}),e(createEnvironmentSummaryProperties()),e({profileId:r,projectPath:r}),e({environmentId:r,preparationKey:r,reused:o.Boolean()}),e({environmentId:r,force:o.Optional(o.Boolean())}),e(createEnvironmentSummaryProperties()),e({environmentId:r,control:o.Optional(o.Boolean())}),e({transport:o.String({enum:[`rfb`]}),wsPath:r,expiresAtMs:o.Integer({minimum:0}),control:o.Boolean(),canResize:o.Optional(o.Boolean()),vncPassword:o.Optional(r)}),e({environmentId:r,app:l}),e({app:l,status:o.Literal(`ready`)}),e({id:r,kind:o.Union([o.Literal(`api`),o.Literal(`cli`),o.Literal(`harness`)]),label:r});const xe=e({id:r,fallback:o.Optional(o.Union([o.Literal(`openclaw`),o.Literal(`none`)])),workspaceEnvironment:o.Optional(e({kind:o.Literal(`provider-hosted`),label:r})),cloudPlacementSupported:o.Optional(o.Boolean()),cloudPlacementExecutionMode:o.Optional(u),devicePlacement:o.Optional(e({requiredNodeCommands:o.Array(o.String({minLength:1,maxLength:128}),{maxItems:32,uniqueItems:!0}),consumesWorkerSlot:o.Boolean()})),devicePlacementSupported:o.Optional(o.Boolean()),source:o.Union([o.Literal(`env`),o.Literal(`agent`),o.Literal(`defaults`),o.Literal(`model`),o.Literal(`provider`),o.Literal(`implicit`),o.Literal(`session`),o.Literal(`session-key`)])}),Se=e({id:r,label:r});e({id:r,label:r,contextWindow:o.Integer({minimum:1})}),e({});const f=o.String({minLength:1,maxLength:128,pattern:`^[A-Z][A-Z0-9_]{0,127}$`}),Ce=o.String({pattern:`^github-setup-[a-f0-9]{32}$`}),p=o.String({minLength:1,maxLength:128,pattern:`^(?:[A-Z][A-Z0-9_]{0,127}|github-setup-[a-f0-9]{32})$`}),m={name:f,scopeKind:o.Literal(`team`),scopeId:o.Literal(``),createdAtMs:o.Integer({minimum:0}),updatedAtMs:o.Integer({minimum:0}),updatedBy:o.Optional(o.String())},h=o.Array(o.String({minLength:1,maxLength:253}),{maxItems:128,uniqueItems:!0}),we=e({...m,kind:o.Literal(`secret`),allowedHosts:o.Optional(i(`2026.8`,h))}),Te=e({...m,kind:o.Literal(`env`),value:o.String({maxLength:65536})}),Ee=o.Union([we,Te]);e({}),e({entries:o.Array(Ee)}),e({expectedOwnerId:o.Optional(i(`2026.9`,o.String({minLength:1}))),inheritExistingKind:o.Optional(i(`2026.9`,o.Boolean())),valueSource:o.Optional(i(`2026.9`,o.Literal(`argv`))),name:p,value:o.String({maxLength:65536}),kind:o.Union([o.Literal(`secret`),o.Literal(`env`)]),allowedHosts:o.Optional(i(`2026.8`,h))}),e({expectedOwnerId:o.Optional(i(`2026.9`,o.String({minLength:1}))),name:p}),e({expectedOwnerId:r,inheritExistingKind:o.Boolean(),entries:o.Array(e({name:f,value:o.String({maxLength:65536}),kind:o.Union([o.Literal(`secret`),o.Literal(`env`)])}),{minItems:1})}),e({expectedOwnerId:r,name:f,allowedHosts:h}),e({ok:o.Literal(!0),reloaded:o.Boolean(),kind:o.Optional(i(`2026.9`,o.Union([o.Literal(`secret`),o.Literal(`env`)]))),warningCount:o.Optional(o.Integer({minimum:0}))}),e({commandName:r,targetIds:o.Array(r),allowedPaths:o.Optional(o.Array(r)),forcedActivePaths:o.Optional(o.Array(r)),optionalActivePaths:o.Optional(o.Array(r)),providerOverrides:o.Optional(e({webSearch:o.Optional(r),webFetch:o.Optional(r)}))});const De=e({path:o.Optional(r),pathSegments:o.Array(r),value:o.Unknown()});e({ok:o.Optional(o.Boolean()),assignments:o.Optional(o.Array(De)),diagnostics:o.Optional(o.Array(r)),inactiveRefPaths:o.Optional(o.Array(r))});const Oe=r,ke=r,g=o.Union([e({type:o.Literal(`profile`),id:r}),e({type:o.Literal(`agent`),id:r}),e({type:o.Literal(`remote`),pluginId:r,domain:r,idKind:r,id:r}),e({type:o.Literal(`observation`),pluginId:o.Union([r,o.Null()]),accountId:o.Union([r,o.Null()]),senderKind:o.Union([o.Literal(`human`),o.Literal(`bot`),o.Literal(`unknown`)]),id:r}),e({type:o.Literal(`legacy`),actorType:o.String(),source:o.Union([o.String(),o.Null()]),id:o.String()})]),_=e({identity:g,label:o.Optional(r),avatarUrl:o.Optional(r)});e({identity:e({type:o.Literal(`profile`),id:r}),label:o.Optional(r),avatarUrl:o.Optional(r),sessionCount:o.Integer({minimum:1})});const v=e({canEnsure:o.Optional(o.Boolean()),text:o.Optional(o.String({maxLength:900})),updatedAt:o.Optional(o.Integer({minimum:0})),state:o.Union([o.Literal(`current`),o.Literal(`stale`),o.Literal(`updating`),o.Literal(`unavailable`)])});e({sessions:o.Array(e({key:r,agentId:o.Optional(r)}),{minItems:1,maxItems:20})}),e({sessions:o.Array(e({key:r,agentId:r,activitySummary:v}),{maxItems:20})});const y=[`always`,`ask`,`never`],b=o.Union([o.Literal(y[0]),o.Literal(y[1]),o.Literal(y[2])]),Ae=e({send:o.Optional(b),receive:o.Optional(b)}),je=e({send:b,receive:b});e({send:o.Optional(o.Union([b,o.Null()])),receive:o.Optional(o.Union([b,o.Null()]))});const Me=e({id:r,runId:r,explanation:o.Optional(o.String({maxLength:65536})),continuationMessage:o.Optional(o.String({maxLength:1024})),canContinue:o.Boolean()});e({sessionKey:r,agentId:o.Optional(r),sessionId:r,reviewId:r,idempotencyKey:o.String({minLength:1,maxLength:128})});const Ne=o.Union([o.Literal(`shared`),o.Literal(`read-only`),o.Literal(`suggest`),o.Literal(`draft`)]),Pe=o.Union([o.Literal(`admin`),o.Literal(`owner`),o.Literal(`member`),o.Literal(`viewer`)]),Fe=e({deviceId:r,path:o.String({minLength:1,maxLength:4096})}),Ie=o.Union([o.Literal(`standard`),o.Literal(`daybreak_blue`),o.Literal(`daybreak_red`)]),x=o.Union([o.Literal(`read-only`),o.Literal(`guarded`),o.Literal(`workspace`),o.Literal(`full`)]),Le=e({url:o.String({minLength:1,maxLength:2048}),ref:o.Optional(o.String({minLength:1,maxLength:1024}))}),Re=o.Union([o.Literal(`queued`),o.Literal(`running`),o.Literal(`done`),o.Literal(`failed`),o.Literal(`interrupted`),o.Literal(`killed`),o.Literal(`timeout`)]),ze=o.Union([o.Literal(`manual`),o.Literal(`active-session-cap`),o.Literal(`age-retention`),o.Literal(`stale-dashboard`),o.Literal(`restart-recovery`)]),Be=e({mcpServers:o.Optional(o.Record(o.String({minLength:1}),o.Boolean())),mcpToolsDeny:o.Optional(o.Record(o.String({minLength:1}),o.Array(r))),skills:o.Optional(o.Record(o.String({minLength:1}),o.Boolean())),webSearch:o.Optional(o.Boolean())}),S=e({type:o.Union([o.Literal(`human`),o.Literal(`agent`),o.Literal(`system`)]),id:o.Optional(r),label:o.Optional(r),avatarUrl:o.Optional(r),identity:o.Optional(g)}),Ve=e({actor:S,assignedBy:o.Optional(S),assignedAt:o.Optional(o.Number({minimum:0}))}),He=e({groups:o.Array(e({groupId:r,createdAt:o.Number({minimum:0}),children:o.Optional(o.Array(e({sessionKey:r,status:o.Union([o.Literal(`queued`),o.Literal(`running`),o.Literal(`done`),o.Literal(`failed`)])}),{maxItems:64})),queued:o.Integer({minimum:0}),running:o.Integer({minimum:0}),done:o.Integer({minimum:0}),failed:o.Integer({minimum:0})}),{maxItems:5}),otherActiveGroups:o.Integer({minimum:0})}),Ue=o.Object({key:o.String(),rowMode:o.Optional(o.Union([o.Literal(`compact`),o.Literal(`dashboard`),o.Literal(`sidebar`)])),sharedFacts:o.Optional(o.Array(o.Integer({minimum:0}))),sessionId:o.Optional(o.String()),lifecycleRevision:o.Optional(r),sessionModelRevision:o.Optional(r),incognito:o.Optional(o.Literal(!0)),kind:o.Union([o.Literal(`direct`),o.Literal(`group`),o.Literal(`global`),o.Literal(`unknown`)]),label:o.Optional(o.String()),autoLabel:o.Optional(o.String()),icon:o.Optional(o.String()),color:o.Optional(o.String()),channelAvatarUrl:o.Optional(r),boardFace:o.Optional(o.Union([o.Literal(`chat`),o.Literal(`dashboard`)])),hasBoard:o.Optional(o.Boolean()),boardPresentation:o.Optional(o.Union([o.Literal(`split`),o.Literal(`expanded`)])),displayName:o.Optional(o.String()),titlePending:o.Optional(o.Boolean()),derivedTitle:o.Optional(o.String()),lastMessagePreview:o.Optional(o.String()),lastAssistantMessage:o.Optional(o.Object({text:o.String(),timestamp:o.Number()},{additionalProperties:!1})),channel:o.Optional(o.String()),classification:o.Optional(Oe),agentId:o.Optional(r),accountId:o.Optional(r),peerKind:o.Optional(ke),isMain:o.Optional(o.Boolean()),isBackground:o.Optional(o.Boolean()),isDock:o.Optional(o.Boolean()),chatType:o.Optional(o.Union([o.Literal(`direct`),o.Literal(`group`),o.Literal(`channel`)])),activitySummary:o.Optional(v),updatedAt:o.Optional(o.Union([o.Number(),o.Null()])),snapshotAt:o.Optional(o.Number()),ancestorRevision:o.Optional(r),hiddenFromInvolvingMe:o.Optional(o.Boolean()),archived:o.Optional(o.Boolean()),archivedAt:o.Optional(o.Number()),archivedBy:o.Optional(S),archiveReason:o.Optional(ze),pinned:o.Optional(o.Boolean()),sidebarRoot:o.Optional(o.Boolean()),pinnedAt:o.Optional(o.Number()),snoozedUntil:o.Optional(o.Number()),snoozedAt:o.Optional(o.Number()),unread:o.Optional(o.Boolean()),lastReadAt:o.Optional(o.Number()),markedUnreadAt:o.Optional(o.Number()),lastActivityAt:o.Optional(o.Number()),lastInteractionAt:o.Optional(o.Number()),status:o.Optional(Re),lastRunError:o.Optional(o.String()),suppressErrorNotice:o.Optional(o.Boolean()),providerReview:o.Optional(Me),lastRunId:o.Optional(r),activeLeafEntryId:o.Optional(o.Union([r,o.Null()])),spawnedBy:o.Optional(o.String()),parentSessionKey:o.Optional(o.String()),parentSessionId:o.Optional(o.String()),controlOwnerSessionKey:o.Optional(o.String()),childOwnerSessionKeys:o.Optional(o.Array(r,{maxItems:2})),childSessions:o.Optional(o.Array(o.String())),forkedFromParent:o.Optional(o.Boolean()),spawnDepth:o.Optional(o.Number()),subagentRole:o.Optional(o.Union([o.Literal(`orchestrator`),o.Literal(`leaf`)])),subagentControlScope:o.Optional(o.Union([o.Literal(`children`),o.Literal(`none`)])),swarmGroupId:o.Optional(o.String()),swarm:o.Optional(He),deviceFolder:o.Optional(Fe),worktree:o.Optional(o.Object({id:o.String(),branch:o.String(),repoRoot:o.String()})),repositoryWorkspaceId:o.Optional(r),repository:o.Optional(e({...Le.properties,branch:r})),execNode:o.Optional(o.String()),execCwd:o.Optional(o.String()),spawnedWorkspaceDir:o.Optional(o.String()),spawnedCwd:o.Optional(o.String()),projectId:o.Optional(o.String()),workspaceDir:o.Optional(o.String()),cyberAccessProgram:o.Optional(Ie),permissionMode:o.Optional(x),communication:o.Optional(Ae),effectiveCommunication:o.Optional(je),sandboxMode:o.Optional(o.Literal(`off`)),nativeRuntimeConsent:o.Optional(r),permissionModePending:o.Optional(o.Boolean()),sessionRoot:o.Optional(o.String()),createdVia:o.Optional(o.Union([o.Literal(`operator`),o.Literal(`spawn`),o.Literal(`channel`),o.Literal(`cron`),o.Literal(`talk`),o.Literal(`run`),o.Literal(`plugin`),o.Literal(`internal`)])),createdSurface:o.Optional(o.Literal(`plugin-dock`)),createdActor:o.Optional(S),owner:o.Optional(Ve),participants:o.Optional(o.Array(_,{maxItems:4})),expandedParticipants:o.Optional(o.Array(_,{maxItems:32})),participantCount:o.Optional(o.Integer({minimum:0})),visibility:o.Optional(Ne),sharingRole:o.Optional(Pe),sendDisabledReason:o.Optional(o.Union([r,o.Null()])),createdAt:o.Optional(o.Number()),forkSource:o.Optional(o.Object({sessionKey:o.String(),sessionId:o.String(),entryId:o.Optional(o.String())})),previousSessionId:o.Optional(o.String()),inputTokens:o.Optional(o.Number()),outputTokens:o.Optional(o.Number()),usageReport:o.Optional(o.Object({state:o.Union([o.Literal(`available`),o.Literal(`unavailable`)])})),totalTokens:o.Optional(o.Number()),totalTokensFresh:o.Optional(o.Boolean()),contextTokens:o.Optional(o.Number()),estimatedCostUsd:o.Optional(o.Number()),model:o.Optional(o.String()),modelProvider:o.Optional(o.String()),activeModel:o.Optional(o.String()),activeModelProvider:o.Optional(o.String()),modelOverrideSource:o.Optional(o.Union([o.Literal(`user`),o.Literal(`auto`),o.Literal(`inherited`),o.Null()])),toolOverrides:o.Optional(Be)},{additionalProperties:!0}),We=e({key:r,sessionId:o.Optional(o.String()),agentId:o.Optional(r),revision:r,snapshotAt:o.Number()});e({ancestorSessions:o.Array(Ue,{maxItems:64}),ancestorSessionRefs:o.Optional(o.Array(We,{maxItems:64}))});const Ge=e({id:r,skillName:r,summary:o.String(),createdAtMs:o.Number({minimum:0})}),C=o.String({minLength:1,maxLength:256}),w=o.Optional(o.Union([o.Literal(`auto`),o.Literal(`user`),o.Literal(`user-link`)])),T=o.String({minLength:1,maxLength:256});o.Union([e({kind:o.Literal(`automatic`),label:T}),e({kind:o.Literal(`personal`),label:T,authProfileId:o.Optional(C),source:w}),e({kind:o.Literal(`shared`),label:T,authProfileId:C,source:w})]);const Ke=e({id:r,utilityModel:o.Optional(r),status:o.Optional(o.Literal(`degraded`)),admissionRefusal:o.Optional(ee),kind:o.Optional(te),createdVia:o.Optional(ne),creatorAgentId:o.Optional(o.Union([r,o.Null()])),createdAt:o.Optional(o.Integer({minimum:0})),name:o.Optional(r),identity:o.Optional(e({name:o.Optional(r),theme:o.Optional(r),emoji:o.Optional(r),avatar:o.Optional(r),avatarUrl:o.Optional(r)})),workspace:o.Optional(r),workspaceGit:o.Optional(o.Boolean()),model:o.Optional(e({primary:o.Optional(r),fallbacks:o.Optional(o.Array(r))})),agentRuntime:o.Optional(xe),thinkingLevels:o.Optional(o.Array(Se)),thinkingOptions:o.Optional(o.Array(r)),thinkingDefault:o.Optional(r),defaultPermissionMode:o.Optional(x)});e({...ie,defaultId:r,ownership:o.Optional(re),selectionRequired:o.Optional(o.Boolean()),mainKey:r,scope:o.Union([o.Literal(`per-sender`),o.Literal(`global`)]),agents:o.Array(Ke)}),e({agentId:r,name:o.Optional(r),workspace:o.Optional(r),model:o.Optional(o.Union([r,o.Null()])),agentRuntime:o.Optional(r),emoji:o.Optional(o.String()),avatar:o.Optional(o.String())}),e({ok:o.Literal(!0),agentId:r}),e({agentId:r,deleteFiles:o.Optional(o.Boolean())}),e({ok:o.Literal(!0),agentId:r,removedBindings:o.Integer({minimum:0}),removed:o.Optional(o.Array(e({path:r,method:o.Union([o.Literal(`trash`),o.Literal(`missing`)])}))),failed:o.Optional(o.Array(e({path:r,reason:r}))),purgeFailed:o.Optional(o.Literal(!0))}),e({refresh:o.Optional(o.Boolean()),refreshUsage:o.Optional(o.Boolean()),agentId:o.Optional(o.String())}),e({operation:o.Union([o.Literal(`login`),o.Literal(`logout`),o.Literal(`update`)]),agentId:o.Optional(o.String())}),o.Object({provider:o.String({pattern:`\\S`}),apiKey:o.String({pattern:`\\S`}),agentId:o.Optional(o.String())},{additionalProperties:!0}),e({provider:r,profileId:r,warning:o.Optional(o.String())}),e({provider:r,profileIds:o.Optional(o.Array(r,{minItems:1})),credentialType:o.Optional(o.Literal(`api_key`)),agentId:o.Optional(o.String())}),e({provider:r,profileIds:o.Optional(o.Array(r,{minItems:1,uniqueItems:!0})),agentId:o.Optional(o.String())}),e({provider:r,profileId:o.Optional(r),timeoutMs:o.Optional(o.Integer({minimum:1})),agentId:o.Optional(o.String())});const E=o.Union([o.Literal(`ok`),o.Literal(`auth`),o.Literal(`rate_limit`),o.Literal(`billing`),o.Literal(`timeout`),o.Literal(`format`),o.Literal(`unknown`),o.Literal(`no_model`)]),qe=e({profileId:o.Optional(r),label:r,status:E,latencyMs:o.Optional(o.Integer({minimum:0})),error:o.Optional(o.String())});e({provider:r,status:E,latencyMs:o.Optional(o.Integer({minimum:0})),error:o.Optional(o.String()),results:o.Array(qe)}),e({agentId:o.Optional(r),sessionKey:o.Optional(r),refresh:o.Optional(o.Boolean())}),e({}),e({bins:o.Array(r)});const Je=o.String({minLength:1,maxLength:2048}),Ye=o.String({minLength:1,maxLength:5592408});e({kind:o.Literal(`skill-archive`),slug:r,sizeBytes:o.Integer({minimum:1}),sha256:o.Optional(t),force:o.Optional(o.Boolean()),idempotencyKey:o.Optional(Je)}),e({uploadId:r,offset:o.Integer({minimum:0}),dataBase64:Ye}),e({uploadId:r,sha256:o.Optional(t)});const D="ClawHub skill reference: `@owner/slug`, `skills-sh:owner/repo/slug`, or a bare `slug` when no publisher is known.";o.Union([e({agentId:o.Optional(r),name:r,installId:r,dangerouslyForceUnsafeInstall:o.Optional(o.Boolean({deprecated:!0,description:`Deprecated compatibility field. Current servers ignore it; install policy is controlled by security.installPolicy.`})),timeoutMs:o.Optional(o.Integer({minimum:1e3}))}),e({agentId:o.Optional(r),source:o.Literal(`clawhub`),slug:o.String({minLength:1,description:D}),version:o.Optional(r),force:o.Optional(o.Boolean()),timeoutMs:o.Optional(o.Integer({minimum:1e3}))}),e({agentId:o.Optional(r),source:o.Literal(`upload`),uploadId:r,slug:r,force:o.Optional(o.Boolean()),sha256:o.Optional(t),timeoutMs:o.Optional(o.Integer({minimum:1e3}))})]),o.Union([e({skillKey:r,enabled:o.Optional(o.Boolean()),apiKey:o.Optional(o.String()),env:o.Optional(o.Record(r,o.String()))}),e({agentId:o.Optional(r),source:o.Literal(`clawhub`),slug:o.Optional(r),all:o.Optional(o.Boolean()),force:o.Optional(o.Boolean())})]),e({slug:o.String({minLength:1,description:D}),version:o.Optional(r)}),e({agentId:o.Optional(r)}),e({schema:o.Literal(`openclaw.skills.security-verdicts.v1`),items:o.Array(e({registry:r,ok:o.Boolean(),decision:r,reasons:o.Array(o.String()),requestedSlug:r,requestedOwnerHandle:o.Optional(r),requestedVersion:r,slug:o.Optional(o.Union([r,o.Null()])),version:o.Optional(o.Union([r,o.Null()])),displayName:o.Optional(o.Union([o.String(),o.Null()])),publisherHandle:o.Optional(o.Union([o.String(),o.Null()])),publisherDisplayName:o.Optional(o.Union([o.String(),o.Null()])),createdAt:o.Optional(o.Union([o.Integer(),o.Null()])),checkedAt:o.Optional(o.Union([o.Integer(),o.Null()])),skillUrl:o.Optional(o.Union([o.String(),o.Null()])),securityAuditUrl:o.Optional(o.Union([o.String(),o.Null()])),securityStatus:o.Optional(o.Union([o.String(),o.Null()])),securityPassed:o.Optional(o.Union([o.Boolean(),o.Null()])),error:o.Optional(e({code:o.Optional(o.String()),message:o.Optional(o.String())}))}))}),e({agentId:o.Optional(r),path:r}),e({path:r,name:r,content:o.String()}),e({agentId:o.Optional(r),skillKey:r}),e({schema:o.Literal(`openclaw.skills.skill-card.v1`),skillKey:r,path:r,sizeBytes:o.Integer({minimum:0}),content:o.String()});const O=o.Union([o.Literal(`create`),o.Literal(`patch`),o.Literal(`write_file`),o.Literal(`remove_file`),o.Literal(`archive`),o.Literal(`restore`)]),Xe=o.Union([o.Literal(`agent`),o.Literal(`review`),o.Literal(`curator`),o.Literal(`user`)]),k=o.Number({minimum:0}),A=e({id:r,agentId:r,skillName:r,action:O,actor:Xe,summary:o.String(),versionId:o.Optional(r),sessionKey:o.Optional(r),runId:o.Optional(r),createdAtMs:k}),Ze=e({name:r,description:o.String(),updatedAtMs:k,sizeBytes:o.Integer({minimum:0}),files:o.Array(r),useCount:o.Optional(o.Integer({minimum:0})),lastUsedAtMs:o.Optional(k)}),Qe=e({name:r,live:o.Boolean(),versions:o.Array(e({id:r,action:O,createdAtMs:k}))});e({agentId:o.Optional(r)}),e({agentId:r,mode:o.Union([o.Literal(`off`),o.Literal(`propose`),o.Literal(`auto`)]),root:r,skills:o.Array(Ze),archived:o.Array(Qe),drafts:o.Optional(o.Array(Ge))}),e({agentId:o.Optional(r),limit:o.Optional(o.Integer({minimum:1,maximum:500})),beforeMs:o.Optional(k)}),e({changes:o.Array(A)}),e({agentId:o.Optional(r),name:r,filePath:o.Optional(r),versionId:o.Optional(r),draftId:o.Optional(r)}),e({name:r,filePath:r,content:o.String(),files:o.Array(r)}),e({agentId:o.Optional(r),name:r,reason:o.Optional(o.String({minLength:1,maxLength:1e3}))}),e({agentId:o.Optional(r),name:r,versionId:o.Optional(r)}),e({change:A}),e({agentId:o.Optional(r),runId:r}),e({status:o.Union([o.Literal(`undone`),o.Literal(`already-undone`)]),changes:o.Array(A)});const j=o.Union([o.Literal(`system`),o.Literal(`agent`)]);e({agentId:r,selectedScope:j});const $e=o.Union([o.Literal(`system-detected`),o.Literal(`system-configured`),o.Literal(`agent-override`)]),M=o.String({minLength:1,pattern:`\\S`}),et=e({name:o.Optional(M),email:o.Optional(M)}),N=e({stale:o.Optional(o.Boolean()),source:$e,credentialKind:o.Union([o.Literal(`native`),o.Literal(`managed-pat`),o.Literal(`managed-oauth`),o.Literal(`app-installation`)]),credentialState:o.Union([o.Literal(`available`),o.Literal(`unavailable`),o.Literal(`configured_unavailable`),o.Literal(`unverified`),o.Literal(`rate_limited`)]),account:o.Union([e({login:r}),o.Null()]),gitAuthor:e({name:o.Union([o.String(),o.Null()]),email:o.Union([o.String(),o.Null()])}),evidence:o.Union([o.Literal(`github-api`),o.Literal(`none`),o.Literal(`unverified`),o.Literal(`rate-limited`)]),accessExpiresAtMs:o.Union([o.Integer({minimum:0}),o.Null()]),refreshState:o.Union([o.Literal(`not_applicable`),o.Literal(`available`),o.Literal(`expired`),o.Literal(`unavailable`),o.Literal(`refreshing`),o.Literal(`failed`)]),oauthScopes:o.Array(o.String({minLength:1,maxLength:128,pattern:`\\S`}),{maxItems:32}),repositoryGrants:o.Literal(`unknown`)}),tt=e({scope:j,configured:o.Boolean(),identity:o.Union([N,o.Null()])}),nt=e({agentId:r,selectedScope:j,selected:tt,effective:N}),rt=e({scope:j,agentId:r,mode:o.Literal(`managed`),secretName:Ce,gitAuthor:o.Optional(et)}),it=e({scope:j,agentId:r,mode:o.Literal(`inherit`)});o.Union([rt,it]);const P=o.String({pattern:`^github-device-[a-f0-9]{32}$`});e({scope:j,agentId:r}),e({requestId:P,userCode:o.String({pattern:`^[A-Z0-9]{4}-[A-Z0-9]{4}$`}),verificationUri:o.Literal(`https://github.com/login/device`),expiresInMs:o.Integer({minimum:1,maximum:9e5}),pollAfterMs:o.Integer({minimum:1e3,maximum:6e4})}),e({requestId:P});const F=e({status:o.Literal(`pending`),retryAfterMs:o.Integer({minimum:1,maximum:6e4})}),I=e({status:o.Literal(`slow_down`),retryAfterMs:o.Integer({minimum:1,maximum:6e4})}),L=e({status:o.Literal(`access_denied`)}),R=e({status:o.Literal(`expired`)}),z=e({status:o.Literal(`incorrect_device_code`)}),B=e({status:o.Literal(`network_error`),retryAfterMs:o.Integer({minimum:1,maximum:6e4})}),V=e({status:o.Literal(`failed`),reason:o.Union([o.Literal(`identity_changed`),o.Literal(`setup_failed`)])}),at=e({status:o.Literal(`success`),githubStatus:nt});o.Union([F,I,L,R,z,B,V,at]),e({requestId:P}),e({cancelled:o.Boolean()}),e({name:r,args:o.Optional(o.Record(o.String(),o.Unknown())),sessionKey:o.Optional(r),agentId:o.Optional(r),confirm:o.Optional(o.Boolean()),idempotencyKey:o.Optional(r),conversationReadOrigin:o.Optional(o.Literal(`direct-operator`))});const ot=e({code:r,message:r,details:o.Optional(o.Unknown())});e({ok:o.Boolean(),toolName:r,output:o.Optional(o.Unknown()),requiresApproval:o.Optional(o.Boolean()),approvalId:o.Optional(r),source:o.Optional(o.Union([o.Literal(`core`),o.Literal(`plugin`),o.Literal(`mcp`),o.Literal(`channel`),o.String()])),error:o.Optional(ot)}),e({});const H=e({kind:o.String(),label:o.String(),detail:o.String(),modelRef:o.String(),brandId:o.Optional(o.String()),icon:o.Optional(o.String()),shared:o.Optional(o.Boolean())});e({status:o.Union([o.Literal(`configured`),o.Literal(`activated`),o.Literal(`needs-sign-in`),o.Literal(`unavailable`)]),selected:o.Optional(H),alternatives:o.Array(H),attempts:o.Array(e({kind:o.String(),label:o.String(),error:o.String()})),signIn:o.Optional(e({authOptionId:o.String(),label:o.String()})),separateSignIn:o.Optional(e({authOptionId:o.String(),label:o.String()})),installedPlugins:o.Array(o.String())});const st=o.Union([o.Literal(`auth`),o.Literal(`rate_limit`),o.Literal(`billing`),o.Literal(`timeout`),o.Literal(`format`),o.Literal(`unavailable`),o.Literal(`unknown`)]),ct=e({disposition:o.Literal(`rejected-before-promotion`),status:st}),U=o.Union([o.Literal(`running`),o.Literal(`done`),o.Literal(`cancelled`),o.Literal(`error`)]);e({mode:o.Optional(o.Union([o.Literal(`local`),o.Literal(`remote`)])),workspace:o.Optional(o.String()),installDaemon:o.Optional(o.Boolean()),flow:o.Optional(o.Union([o.Literal(`setup`),o.Literal(`channels`)])),channel:o.Optional(r)}),e({sessionId:r,serverName:r});const W=e({stepId:r,value:o.Optional(o.Unknown())});e({sessionId:r,answer:o.Optional(W)}),e({sessionId:r,closeInput:o.Optional(o.Boolean())}),e({sessionId:r});const lt=e({value:o.Unknown(),label:r,hint:o.Optional(o.String())}),ut=e({code:r,expiresInMinutes:o.Optional(o.Integer({minimum:1,maximum:1440})),message:o.Optional(o.String())}),dt=e({id:r,type:o.Union([o.Literal(`note`),o.Literal(`select`),o.Literal(`text`),o.Literal(`confirm`),o.Literal(`multiselect`),o.Literal(`progress`),o.Literal(`action`)]),title:o.Optional(o.String()),message:o.Optional(o.String()),progressMessage:o.Optional(o.String()),format:o.Optional(o.Union([o.Literal(`plain`)])),options:o.Optional(o.Array(lt)),initialValue:o.Optional(o.Unknown()),placeholder:o.Optional(o.String()),sensitive:o.Optional(o.Boolean()),executor:o.Optional(o.Union([o.Literal(`gateway`),o.Literal(`client`)])),externalUrl:o.Optional(o.String()),deviceCode:o.Optional(ut)}),ft=e({channel:r,accountId:r}),pt={done:o.Boolean(),step:o.Optional(dt),status:o.Optional(U),error:o.Optional(o.String()),channels:o.Optional(o.Array(r)),accounts:o.Optional(o.Array(ft)),preparedModelRef:o.Optional(r),modelActivation:o.Optional(e({modelRef:r,modelName:o.Optional(r),modelTarget:o.Optional(o.Literal(`utility`)),gatewayRestartRequired:o.Optional(o.Literal(!0))})),activationRejection:o.Optional(ct)};e(pt),e({sessionId:r,...pt}),e({status:U,error:o.Optional(o.String())});const mt=o.String({maxLength:256}),G=o.String({minLength:1,maxLength:128,pattern:`\\S`}),K=o.String({pattern:`^.{1,256}$`}),ht=o.Record(K,o.Unknown()),gt=o.Record(K,o.Unknown(),{maxProperties:32}),_t=o.Union([o.Literal(`image/png`),o.Literal(`image/jpeg`),o.Literal(`image/webp`)]),vt=e({host:o.Optional(r),login:o.String({minLength:1,maxLength:39}),profileUrl:r,avatarUrl:r}),q=e({id:n,displayName:o.Union([mt,o.Null()]),avatarMime:o.Union([_t,o.Null()]),mergedInto:o.Union([n,o.Null()]),createdAt:o.Integer({minimum:0}),updatedAt:o.Integer({minimum:0}),emails:o.Array(r),githubIdentity:o.Union([vt,o.Null()]),hasAvatar:o.Boolean(),role:o.Optional(G),effectiveRole:o.Optional(G),roleSource:o.Optional(o.Union([o.Literal(`assigned`),o.Literal(`githubLogin`),o.Literal(`default`)]))});e({githubAccountIds:o.Optional(o.Array(o.Integer({minimum:1,maximum:2**53-1}),{maxItems:500,uniqueItems:!0}))}),e({profiles:o.Array(q),githubProfiles:o.Optional(o.Array(e({accountId:o.Integer({minimum:1,maximum:2**53-1}),profileId:n}),{maxItems:500}))}),e({agentId:r}),e({agentId:r,content:o.String({maxLength:4e3}),expectedHash:o.Union([o.String({pattern:`^[a-f0-9]{64}$`}),o.Null()])}),e({agentId:r,profileId:n,content:o.String(),hash:o.Union([o.String({pattern:`^[a-f0-9]{64}$`}),o.Null()]),missing:o.Boolean()}),e({}),e({profile:q}),e({email:o.String({minLength:1,maxLength:320}),targetProfileId:n}),e({profile:q}),e({sourceProfileId:n,targetProfileId:n}),e({profile:q,movedAliasKinds:o.Array(o.Union([o.Literal(`email`),o.Literal(`provider`),o.Literal(`channel`)]),{maxItems:3,uniqueItems:!0})});const J=o.String({minLength:1,maxLength:512,pattern:`^\\S(?:.*\\S)?$`}),yt=e({channelId:J,accountId:J,senderId:J}),bt=e({profileId:n,identity:yt});e({removed:o.Boolean()}),e({profileId:n}),e({links:o.Array(bt)}),e({profileId:n,displayName:o.Union([mt,o.Null()])}),e({profile:q}),e({profileId:n,role:o.Union([G,o.Null()])}),e({profile:q}),e({profileId:n,mime:_t,avatarBase64:o.String({minLength:1,maxLength:7e5})}),e({profile:q,avatarRevision:r});const Y=o.String({minLength:1,maxLength:128}),X=o.String({minLength:1,maxLength:128}),Z=e({provider:Y,authProfileId:C,updatedAt:o.Integer({minimum:0})}),xt=e({authProfileId:C,provider:Y,label:o.String({minLength:1,maxLength:256}),authType:o.Union([o.Literal(`api_key`),o.Literal(`oauth`),o.Literal(`token`)]),selected:o.Boolean()});e({profileId:o.Optional(n),cursor:o.Optional(C)}),e({profileId:n,accounts:o.Array(xt,{maxItems:50}),nextCursor:o.Optional(C),links:o.Array(Z)}),e({profileId:o.Optional(n),authProfileId:C}),e({links:o.Array(Z)}),e({profileId:n}),e({links:o.Array(Z)}),e({profileId:n,authProfileId:C}),e({links:o.Array(Z)}),e({profileId:n,provider:Y}),e({links:o.Array(Z)}),e({profileId:n}),e({providers:o.Array(e({id:Y,label:r,methods:o.Array(e({id:r,label:r,hint:o.Optional(o.String())}))}))}),e({profileId:n,provider:Y,method:r}),e({connectId:X,expiresAtMs:o.Integer({minimum:0})}),e({profileId:n,connectId:X,...W.properties}),e({profileId:n,connectId:X}),o.Union([e({status:o.Literal(`pending`),step:o.Optional(dt),error:o.Optional(o.String())}),e({status:o.Literal(`connected`),authProfileId:C,links:o.Array(Z)}),e({status:o.Literal(`cancelled`)}),e({status:o.Literal(`expired`)}),e({status:o.Literal(`failed`),reason:o.Union([o.Literal(`exchange`),o.Literal(`identity`),o.Literal(`authority`),o.Literal(`unavailable`)])})]),e({authProfileId:C,links:o.Array(Z)}),e({keys:o.Optional(o.Array(K,{maxItems:32,uniqueItems:!0}))}),o.Union([e({status:o.Literal(`ok`),entries:ht}),e({status:o.Literal(`no_durable_identity`)})]),e({entries:gt,expectedEntries:o.Optional(gt)}),o.Union([e({status:o.Literal(`ok`)}),e({status:o.Literal(`conflict`)}),e({status:o.Literal(`no_durable_identity`)})]),e({profileId:n,keys:o.Array(K,{maxItems:32,uniqueItems:!0})});const Q=o.String({format:`uuid`,maxLength:36}),St=e({accountId:o.Integer({minimum:1,maximum:2**53-1}),login:o.String({minLength:1,maxLength:39,pattern:`^[A-Za-z0-9](?:[A-Za-z0-9-]{0,37}[A-Za-z0-9])?$`})});e({});const Ct=e({requestId:Q,userCode:o.String({pattern:`^[A-Z0-9]{4}-[A-Z0-9]{4}$`}),verificationUri:o.Literal(`https://github.com/login/device`),expiresInMs:o.Integer({minimum:0,maximum:9e5}),pollAfterMs:o.Integer({minimum:1,maximum:6e4})});e({requestId:Q}),e({requestId:Q}),e({cancelled:o.Boolean()}),e({}),e({disconnected:o.Literal(!0)});const $=e({stale:o.Optional(o.Boolean()),state:o.Union([o.Literal(`connected`),o.Literal(`disconnected`),o.Literal(`unavailable`)]),generation:o.Union([Q,o.Null()]),account:o.Union([St,o.Null()]),accessExpiresAtMs:o.Union([o.Integer({minimum:0}),o.Null()]),refreshState:o.Union([o.Literal(`available`),o.Literal(`refreshing`),o.Literal(`expired`),o.Literal(`failed`),o.Literal(`not_applicable`)]),pending:o.Union([Ct,o.Null()])});e({}),e({personal:$,system:N}),o.Union([F,I,L,R,z,B,V,e({status:o.Literal(`success`),personal:$})]);export{yt as i,Q as n,$ as r,St as t};