qlogicagent 2.23.2 → 2.23.4

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.
package/dist/protocol.js CHANGED
@@ -1 +1 @@
1
- var G="1.0.0",l={PARSE_ERROR:-32700,INVALID_REQUEST:-32600,METHOD_NOT_FOUND:-32601,INVALID_PARAMS:-32602,INTERNAL_ERROR:-32603,TURN_ABORTED:-32e3,TURN_TIMEOUT:-32001,LLM_ERROR:-32010,LLM_AUTH_ERROR:-32011,LLM_RATE_LIMIT:-32012,LLM_QUOTA_EXHAUSTED:-32013,LLM_MODEL_NOT_FOUND:-32014,TOOL_INVOKE_FAILED:-32020,TOOL_TIMEOUT:-32021,PROTOCOL_MISMATCH:-32030,REQUEST_DEADLINE_EXCEEDED:-32040,REQUEST_CANCELLED:-32041,REQUEST_DEDUPED:-32042,REQUEST_IDEMPOTENCY_REQUIRED:-32043},z={REQUEST:"tool.approval.request"};function _(e){if(!e||typeof e!="object")return!1;let t=e;return t.jsonrpc==="2.0"&&typeof t.method=="string"&&t.method.length>0}function C(e){if(!e||typeof e!="object")return!1;let t=e;return t.jsonrpc==="2.0"&&(typeof t.id=="string"||typeof t.id=="number")&&!("method"in t)}function x(e){if(!e||typeof e!="object")return!1;let t=e;return t.jsonrpc==="2.0"&&typeof t.method=="string"&&!("id"in t)}function X(e){let t;try{t=JSON.parse(e)}catch{return null}return C(t)||_(t)||x(t)?t:null}import{randomUUID as $}from"node:crypto";var J=["settings.list","settings.get","settings.validate","provider.list","tools.list","todos.list","tasks.list","session.list","session.get","session.resolve","session.loadNativeTranscript","thread.list","project.list","files.list","files.gitStatus","instructions.list","instructions.read","skills.list","skills.stats","memory.atlas","memory.activity","memory.list","memory.read","memory.search","agent.health","agent.metrics"],Q=new Set(["memory.dream","memory.propose","memory.consolidate"]),Z=["memory.","usage."],ee=new Set(["memory.atlas","memory.activity","memory.list","memory.read","memory.search","memory.attachment.locate","memory.attachment.adopt"]);function A(e){return Q.has(e)?{channel:"task",mutability:"write",defaultTimeoutMs:12e4}:J.some(t=>e===t||e.startsWith(`${t}.`)||e.startsWith(t))?{channel:"query",mutability:"read",defaultTimeoutMs:1e4}:{channel:"task",mutability:"write",defaultTimeoutMs:3e4}}function M(e){return ee.has(e)||A(e).mutability==="read"?!1:Z.some(t=>e.startsWith(t))}function te(e,t={}){let r=t.now??Date.now(),n=A(e),o=t.timeoutMs??n.defaultTimeoutMs;return{requestId:t.requestId??$(),createdAt:r,deadlineAt:r+o,channel:t.channel??n.channel,idempotencyKey:t.idempotencyKey,traceId:t.traceId}}function v(e,t=Date.now()){let r=e.meta;if(!r||typeof r!="object")return{ok:!1,error:{code:l.INVALID_REQUEST,message:"RPC request meta is required."}};if(typeof r.requestId!="string"||r.requestId.length===0)return{ok:!1,error:{code:l.INVALID_REQUEST,message:"RPC request meta.requestId is required."}};if(r.channel!=="query"&&r.channel!=="task")return{ok:!1,error:{code:l.INVALID_REQUEST,message:"RPC request meta.channel must be query or task."}};if(typeof r.createdAt!="number"||!Number.isFinite(r.createdAt))return{ok:!1,error:{code:l.INVALID_REQUEST,message:"RPC request meta.createdAt is required."}};if(typeof r.deadlineAt!="number"||!Number.isFinite(r.deadlineAt))return{ok:!1,error:{code:l.INVALID_REQUEST,message:"RPC request meta.deadlineAt is required."}};if(r.deadlineAt<=t)return{ok:!1,error:{code:l.REQUEST_DEADLINE_EXCEEDED,message:"RPC request deadline has already expired."}};let n=A(e.method).channel;return r.channel!==n?{ok:!1,error:{code:l.INVALID_REQUEST,message:`RPC request channel mismatch: expected ${n}, got ${r.channel}.`}}:M(e.method)&&(typeof r.idempotencyKey!="string"||r.idempotencyKey.length===0)?{ok:!1,error:{code:l.REQUEST_IDEMPOTENCY_REQUIRED,message:`RPC method ${e.method} requires meta.idempotencyKey.`}}:{ok:!0,meta:r}}var I=class{now;active=new Map;idempotency=new Map;counters={completedRequests:0,cancelledRequests:0,deadlineExceededRequests:0,dedupedRequests:0,lateResponsesDropped:0,invalidRequests:0};constructor(t={}){this.now=t.now??(()=>Date.now())}begin(t,r){let n=v({method:t,meta:r},this.now());if(!n.ok)return this.counters.invalidRequests+=1,{status:"rejected",error:n.error};if(r.idempotencyKey){let o=this.idempotency.get(r.idempotencyKey);if(o)return this.counters.dedupedRequests+=1,o.error?{status:"deduped",error:o.error}:{status:"deduped",result:o.result}}return this.active.set(r.requestId,{method:t,meta:r,cancelled:!1,startedAt:this.now()}),{status:"started"}}cancel(t,r="cancelled"){let n=this.active.get(t);return!n||n.cancelled?!1:(n.cancelled=!0,n.cancelReason=r,this.counters.cancelledRequests+=1,!0)}expire(t){return this.active.get(t)?(this.active.delete(t),this.counters.deadlineExceededRequests+=1,!0):!1}settle(t,r,n){let o=this.active.get(t);return o?(this.active.delete(t),o.cancelled?(this.counters.lateResponsesDropped+=1,{accepted:!1,reason:"cancelled"}):o.meta.deadlineAt<=this.now()?(this.counters.deadlineExceededRequests+=1,this.counters.lateResponsesDropped+=1,{accepted:!1,reason:"deadline_exceeded"}):(this.counters.completedRequests+=1,o.meta.idempotencyKey&&this.idempotency.set(o.meta.idempotencyKey,{result:r,error:n,settledAt:this.now()}),{accepted:!0})):{accepted:!1,reason:"unknown"}}metrics(){return{activeRequests:this.active.size,...this.counters}}};var re=["agent.health","agent.metrics","agent.cancel","provider.catalog","provider.list","provider.get","provider.install","provider.install.cancel","provider.update","provider.uninstall","provider.enable","provider.disable","provider.diagnose","provider.auth.status","provider.auth.setPreference","provider.auth.setUserKey","provider.auth.methods","provider.auth.start","provider.auth.attach","provider.auth.input","provider.auth.resize","provider.auth.cancel","provider.auth.logout","provider.models.list","provider.nativeSessions.list","provider.nativeSessions.load","provider.nativeSessions.resume","delegation.cancel","delegation.reset","session.list","session.get","session.create","session.update","session.delete","session.deleteAll","session.archive","session.loadNativeTranscript","session.adoptNative","session.moveToProject","session.getState","session.switchProject","session.getMessages","project.list","project.create","project.detach","project.delete","project.rename","project.archive","project.unarchive","project.update","instructions.list","instructions.read","instructions.write","instructions.delete","files.list","files.read","files.create","files.rename","files.move","files.copy","files.delete","files.search","files.undoOperation","files.gitStatus","turnBaseline.getSummary","turnBaseline.getFileDiff","turnBaseline.listRecent","turnBaseline.getFileBaseline","workingMaterials.get","workingMaterials.replace","workingMaterials.upsert","workingMaterials.remove","workingMaterials.reorder","skills.list","memory.list-files","memory.atlas","memory.activity","memory.propose","memory.consolidate","memory.update","memory.attachment.adopt","memory.attachment.locate"];var R=["turn.start","turn.delta","turn.end","turn.error","turn.recovery","turn.text_rollback","turn.file_changes","turn.tool_call","turn.tool_result","turn.tool_blocked","turn.reasoning_delta","turn.approval_request","turn.ask_user","turn.media_result","turn.plan_update","turn.suggestions","turn.sidechain_started","turn.subagent_started","turn.subagent_delta","turn.subagent_activity","turn.subagent_ended","turn.subagent_completed","turn.subagent_decision","turn.sidechain_completed","turn.task_updated","turn.todos_updated","turn.exec_progress","turn.progress","turn.tool_use_summary","turn.tool_selection_policy","turn.lifecycle","turn.document_maintenance","turn.artifact_contract","turn.usage_update","team.member.notification","session.info","session.recovery_pending","thread.item","memory.updated","skills.updated","turn.memory_recall","turn.memory_written","system.activity","workflow.created","workflow.updated","workflow.deleted","workflow.runStarted","workflow.runCompleted","workflow.runFailed","workflow.nodeStatus","workflow.triggerDropped","workflow.alert","workflow.approvalRequested","workflow.approvalTimedOut"],b=["solo.progress","solo.specProgress","solo.agentDelta","solo.agentActivity","solo.agentUsage","solo.evaluation","solo.agentDiff","solo.state","product.taskStarted","product.taskOutput","product.members","product.agentActivity","product.taskCompleted","product.taskFailed","product.taskHandoff","product.budgetUpdate","product.budgetWarning","product.budgetExceeded","product.checkpointed","product.completed","product.dagTopology","plan.interrupted","product.planReady","product.planningDelta","product.leaderMessage","product.planFailed","product.planningAsk","mention.delegate_started","mention.delegate_activity","mention.delegate_settled"],ne=[...R,...b],w=ne;import{MODEL_PURPOSES as ar}from"@xiaozhiclaw/module-sdk/model-access";var ie=["fact","preference","insight","lesson","decision","plan","event","pattern","context","procedure","general"],_t=new Set(ie),oe=["equals","includes","excludes"],Ct=new Set(oe);import{createHash as vt}from"node:crypto";import{resolve as Ot}from"node:path";var O=["efficiency","dev","cloud","data","industrial","marketing","ecommerce","procurement","hr","accounting","finance","legal","lifestyle"];var Ht=new Set(O);var m={request:"x/delegate",update:"x/delegate.update",respond:"x/delegate.respond",cancel:"x/delegate.cancel"},se=["search","embedText","ingestExtracted","proposeExtracted","consumePendingProposals","feedback","findRelatedEvents","synthesizeTimeline","getActivitySummary","getAllProfiles","setProfile","getAtlas","setMemoryArchived","triggerDecay","resolveConflicts","readProcedureUsage","writeProcedureUsage","readDistillCandidates","writeDistillCandidates","readPromotionProposals","writePromotionProposals","listActiveMemoriesByTag","readDistilledProcedure","promoteDistilledProcedure","demoteDistilledProcedure","recordInjectedAccess","recordRecallOutcome","enqueueExtractionTurn","claimPendingExtractionTurns","completeExtractionTurn","releaseExtractionTurn","recordExtractionTurnFailure"],ae=["initialize","getIndex","addToIndex","replaceInIndex","removeFromIndex","createFile","writeFile","readFile","deleteFile","listFiles","searchLocal"],de=["getSkillSnapshot","readSkillFile","recordSkillInvocation","commitSkillMutation","applyCuratorPlan","prepareSkillInstall","finalizeSkillInstall"],pe=["loadForResume","appendTranscript","updateTitle","saveState","saveTaskSummary","groupSplit"],ce=["commitTurnTelemetry","listDistillableFeedback","markFeedbackDistilled","runUploadSweep"],le=["getSnapshot","create","switch","update"],Yt=1024*1024,ue=["resolveInstall","listResourceVersions"],ge=["probeSession"],me=["list","get","diagnose"],fe=["navigate","snapshot","click","type","screenshot","console","network"];var ye=["open","openWithCheckpoint","recordEvent","checkpoint","get","list","delete","getCheckpoint","listCheckpoints","restoreCheckpoint"],Ae=["getTunables","updateTunable","clearTunable","appendDirectoryAllowRule"];var Gt=new Set(se),zt=new Set(ae),Xt=new Set(Ae),$t=new Set(de),Jt=new Set(pe),Qt=new Set(ce),Zt=new Set(le),er=new Set(ye),tr=new Set(me),rr=new Set(ue),nr=new Set(ge),ir=new Set(fe);var Se=1,Ie={INITIALIZE:"initialize",SESSION_NEW:"session/new",SESSION_PROMPT:"session/prompt",SESSION_CLOSE:"session/close",SESSION_SET_CONFIG:"session/set_config_option",SESSION_SET_MODEL:"session/set_model",SESSION_SET_MODE:"session/set_mode",SESSION_LOAD:"session/load",SESSION_CANCEL:"session/cancel",SESSION_UPDATE:"session/update",SESSION_REQUEST_PERMISSION:"session/request_permission",FS_READ_TEXT_FILE:"fs/read_text_file",FS_WRITE_TEXT_FILE:"fs/write_text_file"},Re={ABORT:"x/abort",DREAM:"x/dream",SOLO_START:"x/solo.start",SOLO_SELECT:"x/solo.select",SOLO_CANCEL:"x/solo.cancel",SOLO_DELETE:"x/solo.delete",PRODUCT_CREATE:"x/product.create",PRODUCT_PLAN:"x/product.plan",PRODUCT_CONFIRM:"x/product.confirm",PRODUCT_MESSAGE:"x/product.message",PRODUCT_MUTATE_DAG:"x/product.mutateDag",PRODUCT_RESUME:"x/product.resume",PRODUCT_PAUSE:"x/product.pause",PRODUCT_CANCEL:"x/product.cancel",PRODUCT_ROLLBACK:"x/product.rollback",PRODUCT_REPLAY:"x/product.replay",SOLO_SUBSCRIBE:"x/solo.subscribe",SOLO_MESSAGE:"x/solo.message",SOLO_EVALUATE:"x/solo.evaluate",SOLO_SPEC_CHAT:"x/solo.specChat",SOLO_SPEC_JUDGE:"x/solo.specJudge",WORKFLOW_CHAT:"x/workflow.chat",WORKFLOW_MATCH_INTENT:"x/workflow.matchIntent",WORKFLOW_PLAN_COMMAND:"x/workflow.planCommand",PRODUCT_SUBSCRIBE:"x/product.subscribe",GOAL_START:"x/goal.start",GOAL_PAUSE:"x/goal.pause",GOAL_RESUME:"x/goal.resume",GOAL_UPDATE_GOAL:"x/goal.updateGoal",GOAL_STOP:"x/goal.stop",GOAL_MESSAGE:"x/goal.message",GOAL_RECOVER:"x/goal.recover",GOAL_DISMISS:"x/goal.dismiss",DELEGATE:m.request,DELEGATE_UPDATE:m.update,DELEGATE_RESPOND:m.respond,DELEGATE_CANCEL:m.cancel},N={USER_MESSAGE_CHUNK:"user_message_chunk",AGENT_MESSAGE_CHUNK:"agent_message_chunk",AGENT_THOUGHT_CHUNK:"agent_thought_chunk",TOOL_CALL:"tool_call",TOOL_CALL_UPDATE:"tool_call_update",PLAN:"plan",USAGE_UPDATE:"usage_update",CONFIG_OPTION_UPDATE:"config_option_update",SESSION_INFO_UPDATE:"session_info_update",AVAILABLE_COMMANDS_UPDATE:"available_commands_update",CURRENT_MODE_UPDATE:"current_mode_update"},be={X_SESSION_INFO:"x_session_info",X_RELAY:"x_relay"};function D(e){if(!e||typeof e!="object")return!1;let t=e;return t.jsonrpc==="2.0"&&typeof t.method=="string"&&"id"in t}function H(e){if(!e||typeof e!="object")return!1;let t=e;return t.jsonrpc==="2.0"&&typeof t.method=="string"&&!("id"in t)}function L(e){if(!e||typeof e!="object")return!1;let t=e;return t.jsonrpc==="2.0"&&"id"in t&&!("method"in t)}function he(e){let t;try{t=JSON.parse(e)}catch{return null}return L(t)||D(t)||H(t)?t:null}function Ee(e){return Object.values(N).includes(e)}function Pe(e){return e.startsWith("x_")}var h=["gatewayVersion","toolNamespaces","workspaceIds","installedCapabilities","enabledCapabilities","features","approvalMode","toolManifests","skillManifests","pluginManifests","mcpManifests","approvalPolicy","workspaceSummaries"];function g(e){return e?e.map(t=>({...t})):void 0}function E(e){return e?e.map(t=>({...t})):void 0}function Te(e){return e?[...e]:void 0}function U(e){return[...new Set(e.map(t=>t.trim()).filter(Boolean))].sort((t,r)=>t.localeCompare(r))}function f(e){return{...e,toolNamespaces:[...e.toolNamespaces],workspaceIds:[...e.workspaceIds],...e.changedSections?{changedSections:[...e.changedSections]}:{},...e.installedCapabilities?{installedCapabilities:[...e.installedCapabilities]}:{},...e.enabledCapabilities?{enabledCapabilities:[...e.enabledCapabilities]}:{},...e.features?{features:[...e.features]}:{},...e.toolManifests?{toolManifests:g(e.toolManifests)}:{},...e.skillManifests?{skillManifests:g(e.skillManifests)}:{},...e.pluginManifests?{pluginManifests:g(e.pluginManifests)}:{},...e.mcpManifests?{mcpManifests:g(e.mcpManifests)}:{},...e.approvalPolicy?{approvalPolicy:{...e.approvalPolicy}}:{},...e.workspaceSummaries?{workspaceSummaries:E(e.workspaceSummaries)}:{}}}function ke(e){let{previous:t,update:r}=e;return!(r.syncMode==="diff"&&t&&(!r.baseSnapshotVersion||t.snapshotVersion===r.baseSnapshotVersion))||!t?f(r):{...f(t),snapshotVersion:r.snapshotVersion,updatedAt:r.updatedAt,...r.gatewayVersion!==void 0?{gatewayVersion:r.gatewayVersion}:{},...r.syncMode?{syncMode:r.syncMode}:{},...r.baseSnapshotVersion?{baseSnapshotVersion:r.baseSnapshotVersion}:{},...r.changedSections?{changedSections:[...r.changedSections]}:{},...r.toolNamespaces?{toolNamespaces:[...r.toolNamespaces]}:{},...r.workspaceIds?{workspaceIds:[...r.workspaceIds]}:{},...r.installedCapabilities?{installedCapabilities:[...r.installedCapabilities]}:{},...r.enabledCapabilities?{enabledCapabilities:[...r.enabledCapabilities]}:{},...r.features?{features:[...r.features]}:{},...r.approvalMode?{approvalMode:r.approvalMode}:{},...r.toolManifests?{toolManifests:g(r.toolManifests)}:{},...r.skillManifests?{skillManifests:g(r.skillManifests)}:{},...r.pluginManifests?{pluginManifests:g(r.pluginManifests)}:{},...r.mcpManifests?{mcpManifests:g(r.mcpManifests)}:{},...r.approvalPolicy?{approvalPolicy:{...r.approvalPolicy}}:{},...r.workspaceSummaries?{workspaceSummaries:E(r.workspaceSummaries)}:{}}}function _e(e){return U(e.map(t=>t.name.split(".")[0]??"").filter(Boolean))}function Ce(e){return U(e.map(t=>t.id))}function xe(e){let{previous:t,current:r}=e;if(!t)return{...f(r),syncMode:"full"};if(t.snapshotVersion===r.snapshotVersion)return null;let n=h.filter(s=>JSON.stringify(t[s])!==JSON.stringify(r[s]));if(n.length===h.length)return{...f(r),syncMode:"full"};let o={snapshotVersion:r.snapshotVersion,updatedAt:r.updatedAt,syncMode:"diff",baseSnapshotVersion:t.snapshotVersion,changedSections:n,toolNamespaces:[...r.toolNamespaces],workspaceIds:[...r.workspaceIds]},p=o;for(let s of n){let i=r[s];if(i!==void 0)switch(s){case"toolNamespaces":case"workspaceIds":case"installedCapabilities":case"enabledCapabilities":case"features":p[s]=Te(i);break;case"approvalPolicy":p[s]={...i};break;case"workspaceSummaries":p[s]=E(i);break;case"toolManifests":case"skillManifests":case"pluginManifests":case"mcpManifests":p[s]=g(i);break;default:p[s]=i;break}}return o}var Me=["web_search","web_fetch","web_research","browser_execution"],ve=["web-intelligence","browser-execution"],we=["discovery","read-url","multi-source-research","interactive-browser"],Oe=["stateless","render-backend","interactive-session"],Ne=["stateless","stateless-single-step","stateful-session-required"],De=["required","conditional","none"],He=["browser-read","browser-authenticated-read","browser-state-changing"];var Le=["read-page","read-authenticated-page","fill-form","submit-form","download-file","reuse-session"],Ue=["web_search","web_fetch","web_research","blocked"],je=["requires-interaction","requires-login-state","requires-rendered-dom","requires-persistent-session","requires-state-changing-action"],Ke=["none","same-capability-once","degrade-only"];var Ve=["prefetch","sync_turn","on_pre_compress","on_session_end","on_delegation","on_memory_write"],Fe=["turn","sidechain","compress","session-end","agent-remember","auto-extract","implicit-extract","profile-extraction","dream"],We=["observe-only","parent-write","deny"];var qe=2,a={gatewayImage:"gateway.image.desktop-slim",whisperModelTiny:"speech.whisper.model.tiny",ffmpegWin32X64:"runtime.ffmpeg.win32-x64",nodeWin32X64:"runtime.node.win32-x64",dockerDesktopWin32X64:"runtime.docker-desktop.win32-x64",dockerDesktopDarwinX64:"runtime.docker-desktop.darwin-x64",dockerDesktopDarwinArm64:"runtime.docker-desktop.darwin-arm64"},y={desktopDockerBridge:"desktop.docker-bridge",desktopEmbeddedWin32X64:"desktop.embedded.win32-x64"};function K(e){return{...e,artifacts:e.artifacts.map(t=>({...t}))}}function Be(e){return{...e,assetIds:[...e.assetIds]}}function V(){return{[y.desktopDockerBridge]:{id:y.desktopDockerBridge,title:"Desktop Docker Bridge",platform:"any",assetIds:[a.gatewayImage,a.dockerDesktopWin32X64,a.dockerDesktopDarwinX64,a.dockerDesktopDarwinArm64],description:"Docker bridge mode downloads the desktop slim gateway image on demand."},[y.desktopEmbeddedWin32X64]:{id:y.desktopEmbeddedWin32X64,title:"Desktop Embedded Win32 x64",platform:"win32-x64",assetIds:[a.nodeWin32X64,a.ffmpegWin32X64,a.whisperModelTiny],description:"Embedded desktop mode requires the bundled Node/FFmpeg runtimes and the whisper model asset."}}}function F(e,t){return e.assets[t]}function W(e,t){return e.profiles[t]}function Ye(e,t){let r=W(e,t);return r?r.assetIds.map(n=>F(e,n)).filter(n=>!!n):[]}function Ge(e,t){return e.assets[t.id]=K(t),q(e)}function P(e){if(!e)return;let t=e.artifacts[0];if(!(!t?.url||!t.sha256||typeof t.size!="number"))return{version:e.version,sha256:t.sha256,size:t.size,url:t.url}}function q(e){let t=P(e.assets[a.gatewayImage]),r=P(e.assets[a.whisperModelTiny]);return{...e,gateway:t,whisperModel:r}}function j(e,t){if(!(typeof e.version!="string"||typeof e.url!="string"))return{...t,version:e.version,artifacts:[{fileName:e.url.split("/").pop()||`${t.id}.bin`,url:e.url,sha256:typeof e.sha256=="string"?e.sha256:void 0,size:typeof e.size=="number"?e.size:void 0}]}}function ze(e){let t=e&&typeof e=="object"?e:{},r={},n=t.assets&&typeof t.assets=="object"?t.assets:{};for(let[i,d]of Object.entries(n)){if(!d||typeof d!="object")continue;let u=d;!u.id||!Array.isArray(u.artifacts)||(r[i]=K(u))}if(!r[a.gatewayImage]&&t.gateway&&typeof t.gateway=="object"){let i=j(t.gateway,{id:a.gatewayImage,title:"XiaoZhiClaw Gateway Image (Desktop Slim)",kind:"container-image",delivery:"remote",platform:"any",description:"Desktop Docker mode gateway image."});i&&(r[i.id]=i)}if(!r[a.whisperModelTiny]&&t.whisperModel&&typeof t.whisperModel=="object"){let i=j(t.whisperModel,{id:a.whisperModelTiny,title:"Whisper Tiny Model",kind:"model",delivery:"remote",platform:"any",description:"Shared whisper.cpp tiny model asset for embedded desktop speech recognition."});i&&(r[i.id]=i)}let p={...V()},s=t.profiles&&typeof t.profiles=="object"?t.profiles:{};for(let[i,d]of Object.entries(s)){if(!d||typeof d!="object")continue;let u=d;!u.id||!Array.isArray(u.assetIds)||(p[i]=Be(u))}return q({schemaVersion:typeof t.schemaVersion=="number"?t.schemaVersion:2,channel:typeof t.channel=="string"?t.channel:void 0,publishedAt:typeof t.publishedAt=="string"?t.publishedAt:void 0,minElectronVersion:typeof t.minElectronVersion=="string"?t.minElectronVersion:void 0,releaseNotes:typeof t.releaseNotes=="string"?t.releaseNotes:void 0,assets:r,profiles:p})}var Xe=["pending","captured","failed","restored"],$e=["file","directory","missing"],Je=["metadata-only","workspace-copy","shadow-git"];var Qe=["api-key","oauth","token","aws-sdk"],Ze=["rate_limit","auth","server_error","timeout","network","unknown"],et=["requiresOpenAiAnthropicToolPayload"];function tt(e,t){return!e||typeof e!="object"||Array.isArray(e)?!1:e[t]===!0}var B="openai-codex";function S(e){let t=e.trim().toLowerCase();return t==="z.ai"||t==="z-ai"?"zai":t==="opencode-zen"?"opencode":t==="kimi-code"?"kimi-coding":t==="bedrock"||t==="aws-bedrock"?"amazon-bedrock":t==="bytedance"||t==="doubao"?"volcengine":t}function Y(e){let t=S(e);return t==="volcengine-plan"?"volcengine":t==="qwen-coding"?"qwen":t==="byteplus-plan"?"byteplus":t}var rt=Y,nt={anthropicToolSchemaMode:"native",anthropicToolChoiceMode:"native",providerFamily:"default",preserveAnthropicThinkingSignatures:!0,openAiCompatTurnValidation:!0,providerThoughtSignatureSanitization:!1,transcriptToolCallIdMode:"default",transcriptToolCallIdModelHints:[],providerThoughtSignatureModelHints:[],dropThinkingBlockModelHints:[]},it={anthropic:{providerFamily:"anthropic"},"amazon-bedrock":{providerFamily:"anthropic"},"kimi-coding":{anthropicToolSchemaMode:"openai-functions",anthropicToolChoiceMode:"openai-string-modes",preserveAnthropicThinkingSignatures:!1},mistral:{transcriptToolCallIdMode:"strict9",transcriptToolCallIdModelHints:["mistral","mixtral","codestral","pixtral","devstral","ministral","mistralai"]},openai:{providerFamily:"openai"},[B]:{providerFamily:"openai"},openrouter:{openAiCompatTurnValidation:!1,providerThoughtSignatureSanitization:!0,providerThoughtSignatureModelHints:["gemini"]},opencode:{openAiCompatTurnValidation:!1,providerThoughtSignatureSanitization:!0,providerThoughtSignatureModelHints:["gemini"]},kilocode:{providerThoughtSignatureSanitization:!0,providerThoughtSignatureModelHints:["gemini"]}};function T(e,t){let r=(e??"").toLowerCase();return!!r&&t.some(n=>r.includes(n))}function c(e){let t=S(e??"");return{...nt,...it[t]}}function ot(e){return c(e).preserveAnthropicThinkingSignatures}function st(e){let t=c(e);return t.anthropicToolSchemaMode!=="native"||t.anthropicToolChoiceMode!=="native"}function at(e){return c(e).anthropicToolSchemaMode==="openai-functions"}function dt(e){return c(e).anthropicToolChoiceMode==="openai-string-modes"}function pt(e){return c(e).openAiCompatTurnValidation}function ct(e){return c(e).providerFamily==="openai"}function lt(e){return c(e).providerFamily==="anthropic"}function ut(e){return T(e.modelId,c(e.provider).dropThinkingBlockModelHints)}function gt(e){let t=c(e.provider);return t.providerThoughtSignatureSanitization&&T(e.modelId,t.providerThoughtSignatureModelHints)}function mt(e,t){let r=c(e),n=r.transcriptToolCallIdMode;if(n==="strict9")return n;if(T(t,r.transcriptToolCallIdModelHints))return"strict9"}var k={anthropic:["ANTHROPIC_OAUTH_TOKEN","ANTHROPIC_API_KEY"],chutes:["CHUTES_OAUTH_TOKEN","CHUTES_API_KEY"],zai:["ZAI_API_KEY","Z_AI_API_KEY"],opencode:["OPENCODE_API_KEY","OPENCODE_ZEN_API_KEY"],qwen:["DASHSCOPE_API_KEY","QWEN_API_KEY"],"qwen-coding":["DASHSCOPE_API_KEY","QWEN_API_KEY"],volcengine:["VOLCANO_ENGINE_API_KEY","ARK_API_KEY","DOUBAO_API_KEY"],"volcengine-plan":["VOLCANO_ENGINE_API_KEY","ARK_API_KEY","DOUBAO_API_KEY"],byteplus:["BYTEPLUS_API_KEY"],"byteplus-plan":["BYTEPLUS_API_KEY"],"kimi-coding":["KIMI_API_KEY","KIMICODE_API_KEY"],huggingface:["HUGGINGFACE_HUB_TOKEN","HF_TOKEN"],openai:["OPENAI_API_KEY"],voyage:["VOYAGE_API_KEY"],groq:["GROQ_API_KEY"],deepgram:["DEEPGRAM_API_KEY"],cerebras:["CEREBRAS_API_KEY"],xai:["XAI_API_KEY"],openrouter:["OPENROUTER_API_KEY"],litellm:["LITELLM_API_KEY"],"vercel-ai-gateway":["AI_GATEWAY_API_KEY"],"cloudflare-ai-gateway":["CLOUDFLARE_AI_GATEWAY_API_KEY"],moonshot:["MOONSHOT_API_KEY"],minimax:["MINIMAX_API_KEY"],"minimax-cn":["MINIMAX_CN_API_KEY","MINIMAX_API_KEY"],nvidia:["NVIDIA_API_KEY"],xiaomi:["XIAOMI_API_KEY"],synthetic:["SYNTHETIC_API_KEY"],venice:["VENICE_API_KEY"],mistral:["MISTRAL_API_KEY"],together:["TOGETHER_API_KEY"],qianfan:["QIANFAN_API_KEY"],ollama:["OLLAMA_API_KEY"],vllm:["VLLM_API_KEY"],kilocode:["KILOCODE_API_KEY"]};function ft(){return[...new Set(Object.values(k).flat())]}function yt(e){let t=S(e.provider),r=e.env??process.env,n=new Set(e.appliedEnvKeys??[]),o=i=>{let d=r[i]?.trim();if(!d)return null;let u=n.has(i)?`shell env: ${i}`:`env: ${i}`;return{apiKey:d,source:u}},p=e.resolveSpecialApiKey?.(t,r,n);if(p)return p;let s=k[t];if(!s||s.length===0)return null;for(let i of s){let d=o(i);if(d)return d}return null}export{Re as ACP_EXTENDED_METHODS,be as ACP_EXTENDED_SESSION_UPDATE_TYPES,Ie as ACP_METHODS,Se as ACP_PROTOCOL_VERSION,N as ACP_SESSION_UPDATE_TYPES,z as AGENT_RPC_APPROVAL_METHODS,l as AGENT_RPC_ERROR_CODES,G as AGENT_RPC_PROTOCOL_VERSION,b as AGENT_TEAM_WS_EVENT_NAMES,R as AGENT_WS_EVENT_NAMES,w as ALL_AGENT_WS_EVENT_NAMES,h as CAPABILITY_MANIFEST_DIFF_SECTIONS,re as GATEWAY_RPC_METHODS,I as GatewayRpcContract,Ve as MEMORY_OBSERVATION_HOOK_VALUES,Fe as MEMORY_OBSERVATION_SOURCE_VALUES,We as MEMORY_WRITE_ACCESS_VALUES,Je as MUTATION_CHECKPOINT_BACKEND_VALUES,$e as MUTATION_CHECKPOINT_ENTRY_KIND_VALUES,Xe as MUTATION_CHECKPOINT_PHASE_VALUES,Qe as PROVIDER_RUNTIME_AUTH_MODE_VALUES,et as PROVIDER_RUNTIME_COMPAT_FLAG_VALUES,k as PROVIDER_RUNTIME_ENV_API_KEY_CANDIDATES,B as PROVIDER_RUNTIME_OPENAI_CODEX_PROVIDER_ID,Ze as PROVIDER_RUNTIME_VAULT_ERROR_TYPE_VALUES,qe as RESOURCE_MANIFEST_SCHEMA_VERSION,a as RUNTIME_ASSET_IDS,y as RUNTIME_PROFILE_IDS,Le as WEB_ACTION_SCOPE_VALUES,De as WEB_APPROVAL_DEFAULT_VALUES,ve as WEB_CAPABILITY_FAMILY_VALUES,Me as WEB_CAPABILITY_ID_VALUES,Ue as WEB_DEGRADATION_TARGET_VALUES,je as WEB_ESCALATION_REASON_VALUES,Oe as WEB_EXECUTION_MODE_VALUES,He as WEB_POLICY_RISK_CLASS_VALUES,Ke as WEB_RETRY_POLICY_VALUES,Ne as WEB_STATEFULNESS_VALUES,we as WEB_TASK_MODE_VALUES,te as buildAgentRpcMeta,A as classifyGatewayRpcMethod,f as cloneCapabilityManifestSnapshot,xe as createCapabilityManifestDiffPayload,V as createDefaultRuntimeResourceProfiles,_e as deriveCapabilityToolNamespaces,Ce as deriveCapabilityWorkspaceIds,P as getManifestShortcutEntry,F as getRuntimeResourceAsset,W as getRuntimeResourceProfile,Ye as getRuntimeResourceProfileAssets,H as isAcpJsonRpcNotification,D as isAcpJsonRpcRequest,L as isAcpJsonRpcResponse,x as isAgentRpcNotification,_ as isAgentRpcRequest,C as isAgentRpcResponse,lt as isAnthropicProviderRuntimeFamily,Pe as isExtendedSessionUpdateType,ct as isOpenAiProviderRuntimeFamily,Ee as isStandardSessionUpdateType,ft as listProviderRuntimeEnvApiKeyNames,ke as mergeCapabilityManifestSnapshot,S as normalizeProviderRuntimeId,Y as normalizeProviderRuntimeIdForAuth,ze as normalizeRuntimeResourceManifest,he as parseAcpMessage,X as parseAgentRpcMessage,ot as preservesProviderRuntimeAnthropicThinkingSignatures,tt as readProviderRuntimeCompatFlag,v as requireGatewayRpcMeta,M as requiresIdempotencyKey,st as requiresOpenAiCompatibleAnthropicToolPayloadForProviderRuntime,c as resolveProviderRuntimeCapabilities,yt as resolveProviderRuntimeEnvApiKey,rt as resolveProviderRuntimeKeyFamily,mt as resolveProviderRuntimeTranscriptToolCallIdMode,ut as shouldDropThinkingBlocksForProviderRuntimeModel,gt as shouldSanitizeProviderRuntimeThoughtSignaturesForModel,pt as supportsOpenAiCompatTurnValidationForProviderRuntime,Ge as upsertRuntimeResourceAsset,at as usesOpenAiFunctionAnthropicToolSchemaForProviderRuntime,dt as usesOpenAiStringModeAnthropicToolChoiceForProviderRuntime};
1
+ var G="1.0.0",l={PARSE_ERROR:-32700,INVALID_REQUEST:-32600,METHOD_NOT_FOUND:-32601,INVALID_PARAMS:-32602,INTERNAL_ERROR:-32603,TURN_ABORTED:-32e3,TURN_TIMEOUT:-32001,LLM_ERROR:-32010,LLM_AUTH_ERROR:-32011,LLM_RATE_LIMIT:-32012,LLM_QUOTA_EXHAUSTED:-32013,LLM_MODEL_NOT_FOUND:-32014,TOOL_INVOKE_FAILED:-32020,TOOL_TIMEOUT:-32021,PROTOCOL_MISMATCH:-32030,REQUEST_DEADLINE_EXCEEDED:-32040,REQUEST_CANCELLED:-32041,REQUEST_DEDUPED:-32042,REQUEST_IDEMPOTENCY_REQUIRED:-32043},z={REQUEST:"tool.approval.request"};function _(e){if(!e||typeof e!="object")return!1;let t=e;return t.jsonrpc==="2.0"&&typeof t.method=="string"&&t.method.length>0}function C(e){if(!e||typeof e!="object")return!1;let t=e;return t.jsonrpc==="2.0"&&(typeof t.id=="string"||typeof t.id=="number")&&!("method"in t)}function x(e){if(!e||typeof e!="object")return!1;let t=e;return t.jsonrpc==="2.0"&&typeof t.method=="string"&&!("id"in t)}function X(e){let t;try{t=JSON.parse(e)}catch{return null}return C(t)||_(t)||x(t)?t:null}import{randomUUID as $}from"node:crypto";var J=["settings.list","settings.get","settings.validate","provider.list","tools.list","todos.list","tasks.list","session.list","session.get","session.resolve","session.loadNativeTranscript","thread.list","project.list","files.list","files.gitStatus","instructions.list","instructions.read","skills.list","skills.stats","memory.atlas","memory.activity","memory.list","memory.read","memory.search","agent.health","agent.metrics"],Q=new Set(["memory.dream","memory.propose","memory.consolidate"]),Z=["memory.","usage."],ee=new Set(["memory.atlas","memory.activity","memory.list","memory.read","memory.search","memory.attachment.locate","memory.attachment.adopt"]);function A(e){return Q.has(e)?{channel:"task",mutability:"write",defaultTimeoutMs:12e4}:J.some(t=>e===t||e.startsWith(`${t}.`)||e.startsWith(t))?{channel:"query",mutability:"read",defaultTimeoutMs:1e4}:{channel:"task",mutability:"write",defaultTimeoutMs:3e4}}function M(e){return ee.has(e)||A(e).mutability==="read"?!1:Z.some(t=>e.startsWith(t))}function te(e,t={}){let r=t.now??Date.now(),n=A(e),o=t.timeoutMs??n.defaultTimeoutMs;return{requestId:t.requestId??$(),createdAt:r,deadlineAt:r+o,channel:t.channel??n.channel,idempotencyKey:t.idempotencyKey,traceId:t.traceId}}function v(e,t=Date.now()){let r=e.meta;if(!r||typeof r!="object")return{ok:!1,error:{code:l.INVALID_REQUEST,message:"RPC request meta is required."}};if(typeof r.requestId!="string"||r.requestId.length===0)return{ok:!1,error:{code:l.INVALID_REQUEST,message:"RPC request meta.requestId is required."}};if(r.channel!=="query"&&r.channel!=="task")return{ok:!1,error:{code:l.INVALID_REQUEST,message:"RPC request meta.channel must be query or task."}};if(typeof r.createdAt!="number"||!Number.isFinite(r.createdAt))return{ok:!1,error:{code:l.INVALID_REQUEST,message:"RPC request meta.createdAt is required."}};if(typeof r.deadlineAt!="number"||!Number.isFinite(r.deadlineAt))return{ok:!1,error:{code:l.INVALID_REQUEST,message:"RPC request meta.deadlineAt is required."}};if(r.deadlineAt<=t)return{ok:!1,error:{code:l.REQUEST_DEADLINE_EXCEEDED,message:"RPC request deadline has already expired."}};let n=A(e.method).channel;return r.channel!==n?{ok:!1,error:{code:l.INVALID_REQUEST,message:`RPC request channel mismatch: expected ${n}, got ${r.channel}.`}}:M(e.method)&&(typeof r.idempotencyKey!="string"||r.idempotencyKey.length===0)?{ok:!1,error:{code:l.REQUEST_IDEMPOTENCY_REQUIRED,message:`RPC method ${e.method} requires meta.idempotencyKey.`}}:{ok:!0,meta:r}}var I=class{now;active=new Map;idempotency=new Map;counters={completedRequests:0,cancelledRequests:0,deadlineExceededRequests:0,dedupedRequests:0,lateResponsesDropped:0,invalidRequests:0};constructor(t={}){this.now=t.now??(()=>Date.now())}begin(t,r){let n=v({method:t,meta:r},this.now());if(!n.ok)return this.counters.invalidRequests+=1,{status:"rejected",error:n.error};if(r.idempotencyKey){let o=this.idempotency.get(r.idempotencyKey);if(o)return this.counters.dedupedRequests+=1,o.error?{status:"deduped",error:o.error}:{status:"deduped",result:o.result}}return this.active.set(r.requestId,{method:t,meta:r,cancelled:!1,startedAt:this.now()}),{status:"started"}}cancel(t,r="cancelled"){let n=this.active.get(t);return!n||n.cancelled?!1:(n.cancelled=!0,n.cancelReason=r,this.counters.cancelledRequests+=1,!0)}expire(t){return this.active.get(t)?(this.active.delete(t),this.counters.deadlineExceededRequests+=1,!0):!1}settle(t,r,n){let o=this.active.get(t);return o?(this.active.delete(t),o.cancelled?(this.counters.lateResponsesDropped+=1,{accepted:!1,reason:"cancelled"}):o.meta.deadlineAt<=this.now()?(this.counters.deadlineExceededRequests+=1,this.counters.lateResponsesDropped+=1,{accepted:!1,reason:"deadline_exceeded"}):(this.counters.completedRequests+=1,o.meta.idempotencyKey&&this.idempotency.set(o.meta.idempotencyKey,{result:r,error:n,settledAt:this.now()}),{accepted:!0})):{accepted:!1,reason:"unknown"}}metrics(){return{activeRequests:this.active.size,...this.counters}}};var re=["agent.health","agent.metrics","agent.cancel","provider.catalog","provider.list","provider.get","provider.install","provider.install.cancel","provider.update","provider.uninstall","provider.enable","provider.disable","provider.diagnose","provider.auth.status","provider.auth.setPreference","provider.auth.setUserKey","provider.auth.methods","provider.auth.start","provider.auth.attach","provider.auth.input","provider.auth.resize","provider.auth.cancel","provider.auth.logout","provider.models.list","provider.nativeSessions.list","provider.nativeSessions.load","provider.nativeSessions.resume","delegation.cancel","delegation.reset","session.list","session.get","session.create","session.update","session.delete","session.deleteAll","session.archive","session.loadNativeTranscript","session.adoptNative","session.moveToProject","session.getState","session.switchProject","session.getMessages","project.list","project.create","project.detach","project.delete","project.rename","project.archive","project.unarchive","project.update","instructions.list","instructions.read","instructions.write","instructions.delete","files.list","files.read","files.create","files.rename","files.move","files.copy","files.delete","files.search","files.undoOperation","files.gitStatus","turnBaseline.getSummary","turnBaseline.getFileDiff","turnBaseline.listRecent","turnBaseline.getFileBaseline","workingMaterials.get","workingMaterials.replace","workingMaterials.upsert","workingMaterials.remove","workingMaterials.reorder","skills.list","memory.list-files","memory.atlas","memory.activity","memory.propose","memory.consolidate","memory.update","memory.attachment.adopt","memory.attachment.locate"];var R=["turn.start","turn.delta","turn.end","turn.error","turn.recovery","turn.text_rollback","turn.file_changes","turn.tool_call","turn.tool_result","turn.tool_blocked","turn.reasoning_delta","turn.approval_request","turn.ask_user","turn.media_result","turn.plan_update","turn.suggestions","turn.sidechain_started","turn.subagent_started","turn.subagent_delta","turn.subagent_activity","turn.subagent_ended","turn.subagent_completed","turn.subagent_decision","turn.sidechain_completed","turn.task_updated","turn.todos_updated","turn.exec_progress","turn.progress","turn.tool_use_summary","turn.tool_selection_policy","turn.lifecycle","turn.document_maintenance","turn.artifact_contract","turn.usage_update","team.member.notification","session.info","session.recovery_pending","thread.item","memory.updated","skills.updated","turn.memory_recall","turn.memory_written","system.activity","workflow.created","workflow.updated","workflow.deleted","workflow.runStarted","workflow.runCompleted","workflow.runFailed","workflow.nodeStatus","workflow.triggerDropped","workflow.alert","workflow.approvalRequested","workflow.approvalTimedOut"],b=["solo.progress","solo.specProgress","solo.agentDelta","solo.agentActivity","solo.agentUsage","solo.evaluation","solo.agentDiff","solo.state","product.taskStarted","product.taskOutput","product.members","product.agentActivity","product.taskCompleted","product.taskFailed","product.taskHandoff","product.budgetUpdate","product.budgetWarning","product.budgetExceeded","product.checkpointed","product.completed","product.dagTopology","plan.interrupted","product.planReady","product.planningDelta","product.leaderMessage","product.planFailed","product.planningAsk","mention.delegate_started","mention.delegate_activity","mention.delegate_settled"],ne=[...R,...b],w=ne;import{MODEL_PURPOSES as dr}from"@xiaozhiclaw/module-sdk/model-access";var ie=["fact","preference","insight","lesson","decision","plan","event","pattern","context","procedure","general"],Ct=new Set(ie),oe=["equals","includes","excludes"],xt=new Set(oe);import{createHash as wt}from"node:crypto";import{resolve as Nt}from"node:path";var O=["efficiency","dev","cloud","data","industrial","marketing","ecommerce","procurement","hr","accounting","finance","legal","lifestyle"];var Lt=new Set(O);var m={request:"x/delegate",update:"x/delegate.update",respond:"x/delegate.respond",cancel:"x/delegate.cancel"},se=["search","embedText","ingestExtracted","proposeExtracted","consumePendingProposals","feedback","findRelatedEvents","synthesizeTimeline","getActivitySummary","getAllProfiles","setProfile","getAtlas","setMemoryArchived","triggerDecay","resolveConflicts","readProcedureUsage","writeProcedureUsage","readDistillCandidates","writeDistillCandidates","readPromotionProposals","writePromotionProposals","listActiveMemoriesByTag","readDistilledProcedure","promoteDistilledProcedure","demoteDistilledProcedure","recordInjectedAccess","recordRecallOutcome","enqueueExtractionTurn","claimPendingExtractionTurns","completeExtractionTurn","releaseExtractionTurn","recordExtractionTurnFailure"],ae=["initialize","getIndex","addToIndex","replaceInIndex","removeFromIndex","createFile","writeFile","readFile","deleteFile","listFiles","searchLocal"],de=["getSkillSnapshot","readSkillFile","recordSkillInvocation","commitSkillMutation","applyCuratorPlan","prepareSkillInstall","finalizeSkillInstall"],pe=["loadForResume","appendTranscript","updateTitle","saveState","saveTaskSummary","groupSplit"],ce=["commitTurnTelemetry","listDistillableFeedback","markFeedbackDistilled","runUploadSweep"],le=["getSnapshot","create","switch","update"],Gt=1024*1024,ue=["resolveInstall","listResourceVersions"],ge=["probeSession"],me=["list","get","diagnose"],fe=["navigate","snapshot","click","type","screenshot","console","network"];var ye=["open","openWithCheckpoint","recordEvent","checkpoint","get","list","delete","getCheckpoint","listCheckpoints","restoreCheckpoint"],Ae=["getTunables","updateTunable","clearTunable","appendDirectoryAllowRule"];var zt=new Set(se),Xt=new Set(ae),$t=new Set(Ae),Jt=new Set(de),Qt=new Set(pe),Zt=new Set(ce),er=new Set(le),tr=new Set(ye),rr=new Set(me),nr=new Set(ue),ir=new Set(ge),or=new Set(fe);var Se=1,Ie={INITIALIZE:"initialize",SESSION_NEW:"session/new",SESSION_PROMPT:"session/prompt",SESSION_CLOSE:"session/close",SESSION_SET_CONFIG:"session/set_config_option",SESSION_SET_MODEL:"session/set_model",SESSION_SET_MODE:"session/set_mode",SESSION_LOAD:"session/load",SESSION_CANCEL:"session/cancel",SESSION_UPDATE:"session/update",SESSION_REQUEST_PERMISSION:"session/request_permission",FS_READ_TEXT_FILE:"fs/read_text_file",FS_WRITE_TEXT_FILE:"fs/write_text_file"},Re={ABORT:"x/abort",DREAM:"x/dream",SOLO_START:"x/solo.start",SOLO_SELECT:"x/solo.select",SOLO_CANCEL:"x/solo.cancel",SOLO_DELETE:"x/solo.delete",PRODUCT_CREATE:"x/product.create",PRODUCT_PLAN:"x/product.plan",PRODUCT_CONFIRM:"x/product.confirm",PRODUCT_MESSAGE:"x/product.message",PRODUCT_MUTATE_DAG:"x/product.mutateDag",PRODUCT_RESUME:"x/product.resume",PRODUCT_PAUSE:"x/product.pause",PRODUCT_CANCEL:"x/product.cancel",PRODUCT_ROLLBACK:"x/product.rollback",PRODUCT_REPLAY:"x/product.replay",SOLO_SUBSCRIBE:"x/solo.subscribe",SOLO_MESSAGE:"x/solo.message",SOLO_EVALUATE:"x/solo.evaluate",SOLO_SPEC_CHAT:"x/solo.specChat",SOLO_SPEC_JUDGE:"x/solo.specJudge",WORKFLOW_CHAT:"x/workflow.chat",WORKFLOW_MATCH_INTENT:"x/workflow.matchIntent",WORKFLOW_PLAN_COMMAND:"x/workflow.planCommand",PRODUCT_SUBSCRIBE:"x/product.subscribe",GOAL_START:"x/goal.start",GOAL_PAUSE:"x/goal.pause",GOAL_RESUME:"x/goal.resume",GOAL_UPDATE_GOAL:"x/goal.updateGoal",GOAL_STOP:"x/goal.stop",GOAL_MESSAGE:"x/goal.message",GOAL_RECOVER:"x/goal.recover",GOAL_DISMISS:"x/goal.dismiss",DELEGATE:m.request,DELEGATE_UPDATE:m.update,DELEGATE_RESPOND:m.respond,DELEGATE_CANCEL:m.cancel},N={USER_MESSAGE_CHUNK:"user_message_chunk",AGENT_MESSAGE_CHUNK:"agent_message_chunk",AGENT_THOUGHT_CHUNK:"agent_thought_chunk",TOOL_CALL:"tool_call",TOOL_CALL_UPDATE:"tool_call_update",PLAN:"plan",USAGE_UPDATE:"usage_update",CONFIG_OPTION_UPDATE:"config_option_update",SESSION_INFO_UPDATE:"session_info_update",AVAILABLE_COMMANDS_UPDATE:"available_commands_update",CURRENT_MODE_UPDATE:"current_mode_update"},be={X_SESSION_INFO:"x_session_info",X_RELAY:"x_relay"},he="xiaozhiclaw/permissionPresentation";function D(e){if(!e||typeof e!="object")return!1;let t=e;return t.jsonrpc==="2.0"&&typeof t.method=="string"&&"id"in t}function H(e){if(!e||typeof e!="object")return!1;let t=e;return t.jsonrpc==="2.0"&&typeof t.method=="string"&&!("id"in t)}function L(e){if(!e||typeof e!="object")return!1;let t=e;return t.jsonrpc==="2.0"&&"id"in t&&!("method"in t)}function Ee(e){let t;try{t=JSON.parse(e)}catch{return null}return L(t)||D(t)||H(t)?t:null}function Pe(e){return Object.values(N).includes(e)}function Te(e){return e.startsWith("x_")}var h=["gatewayVersion","toolNamespaces","workspaceIds","installedCapabilities","enabledCapabilities","features","approvalMode","toolManifests","skillManifests","pluginManifests","mcpManifests","approvalPolicy","workspaceSummaries"];function g(e){return e?e.map(t=>({...t})):void 0}function E(e){return e?e.map(t=>({...t})):void 0}function ke(e){return e?[...e]:void 0}function U(e){return[...new Set(e.map(t=>t.trim()).filter(Boolean))].sort((t,r)=>t.localeCompare(r))}function f(e){return{...e,toolNamespaces:[...e.toolNamespaces],workspaceIds:[...e.workspaceIds],...e.changedSections?{changedSections:[...e.changedSections]}:{},...e.installedCapabilities?{installedCapabilities:[...e.installedCapabilities]}:{},...e.enabledCapabilities?{enabledCapabilities:[...e.enabledCapabilities]}:{},...e.features?{features:[...e.features]}:{},...e.toolManifests?{toolManifests:g(e.toolManifests)}:{},...e.skillManifests?{skillManifests:g(e.skillManifests)}:{},...e.pluginManifests?{pluginManifests:g(e.pluginManifests)}:{},...e.mcpManifests?{mcpManifests:g(e.mcpManifests)}:{},...e.approvalPolicy?{approvalPolicy:{...e.approvalPolicy}}:{},...e.workspaceSummaries?{workspaceSummaries:E(e.workspaceSummaries)}:{}}}function _e(e){let{previous:t,update:r}=e;return!(r.syncMode==="diff"&&t&&(!r.baseSnapshotVersion||t.snapshotVersion===r.baseSnapshotVersion))||!t?f(r):{...f(t),snapshotVersion:r.snapshotVersion,updatedAt:r.updatedAt,...r.gatewayVersion!==void 0?{gatewayVersion:r.gatewayVersion}:{},...r.syncMode?{syncMode:r.syncMode}:{},...r.baseSnapshotVersion?{baseSnapshotVersion:r.baseSnapshotVersion}:{},...r.changedSections?{changedSections:[...r.changedSections]}:{},...r.toolNamespaces?{toolNamespaces:[...r.toolNamespaces]}:{},...r.workspaceIds?{workspaceIds:[...r.workspaceIds]}:{},...r.installedCapabilities?{installedCapabilities:[...r.installedCapabilities]}:{},...r.enabledCapabilities?{enabledCapabilities:[...r.enabledCapabilities]}:{},...r.features?{features:[...r.features]}:{},...r.approvalMode?{approvalMode:r.approvalMode}:{},...r.toolManifests?{toolManifests:g(r.toolManifests)}:{},...r.skillManifests?{skillManifests:g(r.skillManifests)}:{},...r.pluginManifests?{pluginManifests:g(r.pluginManifests)}:{},...r.mcpManifests?{mcpManifests:g(r.mcpManifests)}:{},...r.approvalPolicy?{approvalPolicy:{...r.approvalPolicy}}:{},...r.workspaceSummaries?{workspaceSummaries:E(r.workspaceSummaries)}:{}}}function Ce(e){return U(e.map(t=>t.name.split(".")[0]??"").filter(Boolean))}function xe(e){return U(e.map(t=>t.id))}function Me(e){let{previous:t,current:r}=e;if(!t)return{...f(r),syncMode:"full"};if(t.snapshotVersion===r.snapshotVersion)return null;let n=h.filter(s=>JSON.stringify(t[s])!==JSON.stringify(r[s]));if(n.length===h.length)return{...f(r),syncMode:"full"};let o={snapshotVersion:r.snapshotVersion,updatedAt:r.updatedAt,syncMode:"diff",baseSnapshotVersion:t.snapshotVersion,changedSections:n,toolNamespaces:[...r.toolNamespaces],workspaceIds:[...r.workspaceIds]},p=o;for(let s of n){let i=r[s];if(i!==void 0)switch(s){case"toolNamespaces":case"workspaceIds":case"installedCapabilities":case"enabledCapabilities":case"features":p[s]=ke(i);break;case"approvalPolicy":p[s]={...i};break;case"workspaceSummaries":p[s]=E(i);break;case"toolManifests":case"skillManifests":case"pluginManifests":case"mcpManifests":p[s]=g(i);break;default:p[s]=i;break}}return o}var ve=["web_search","web_fetch","web_research","browser_execution"],we=["web-intelligence","browser-execution"],Oe=["discovery","read-url","multi-source-research","interactive-browser"],Ne=["stateless","render-backend","interactive-session"],De=["stateless","stateless-single-step","stateful-session-required"],He=["required","conditional","none"],Le=["browser-read","browser-authenticated-read","browser-state-changing"];var Ue=["read-page","read-authenticated-page","fill-form","submit-form","download-file","reuse-session"],je=["web_search","web_fetch","web_research","blocked"],Ke=["requires-interaction","requires-login-state","requires-rendered-dom","requires-persistent-session","requires-state-changing-action"],Ve=["none","same-capability-once","degrade-only"];var Fe=["prefetch","sync_turn","on_pre_compress","on_session_end","on_delegation","on_memory_write"],We=["turn","sidechain","compress","session-end","agent-remember","auto-extract","implicit-extract","profile-extraction","dream"],qe=["observe-only","parent-write","deny"];var Be=2,a={gatewayImage:"gateway.image.desktop-slim",whisperModelTiny:"speech.whisper.model.tiny",ffmpegWin32X64:"runtime.ffmpeg.win32-x64",nodeWin32X64:"runtime.node.win32-x64",dockerDesktopWin32X64:"runtime.docker-desktop.win32-x64",dockerDesktopDarwinX64:"runtime.docker-desktop.darwin-x64",dockerDesktopDarwinArm64:"runtime.docker-desktop.darwin-arm64"},y={desktopDockerBridge:"desktop.docker-bridge",desktopEmbeddedWin32X64:"desktop.embedded.win32-x64"};function K(e){return{...e,artifacts:e.artifacts.map(t=>({...t}))}}function Ye(e){return{...e,assetIds:[...e.assetIds]}}function V(){return{[y.desktopDockerBridge]:{id:y.desktopDockerBridge,title:"Desktop Docker Bridge",platform:"any",assetIds:[a.gatewayImage,a.dockerDesktopWin32X64,a.dockerDesktopDarwinX64,a.dockerDesktopDarwinArm64],description:"Docker bridge mode downloads the desktop slim gateway image on demand."},[y.desktopEmbeddedWin32X64]:{id:y.desktopEmbeddedWin32X64,title:"Desktop Embedded Win32 x64",platform:"win32-x64",assetIds:[a.nodeWin32X64,a.ffmpegWin32X64,a.whisperModelTiny],description:"Embedded desktop mode requires the bundled Node/FFmpeg runtimes and the whisper model asset."}}}function F(e,t){return e.assets[t]}function W(e,t){return e.profiles[t]}function Ge(e,t){let r=W(e,t);return r?r.assetIds.map(n=>F(e,n)).filter(n=>!!n):[]}function ze(e,t){return e.assets[t.id]=K(t),q(e)}function P(e){if(!e)return;let t=e.artifacts[0];if(!(!t?.url||!t.sha256||typeof t.size!="number"))return{version:e.version,sha256:t.sha256,size:t.size,url:t.url}}function q(e){let t=P(e.assets[a.gatewayImage]),r=P(e.assets[a.whisperModelTiny]);return{...e,gateway:t,whisperModel:r}}function j(e,t){if(!(typeof e.version!="string"||typeof e.url!="string"))return{...t,version:e.version,artifacts:[{fileName:e.url.split("/").pop()||`${t.id}.bin`,url:e.url,sha256:typeof e.sha256=="string"?e.sha256:void 0,size:typeof e.size=="number"?e.size:void 0}]}}function Xe(e){let t=e&&typeof e=="object"?e:{},r={},n=t.assets&&typeof t.assets=="object"?t.assets:{};for(let[i,d]of Object.entries(n)){if(!d||typeof d!="object")continue;let u=d;!u.id||!Array.isArray(u.artifacts)||(r[i]=K(u))}if(!r[a.gatewayImage]&&t.gateway&&typeof t.gateway=="object"){let i=j(t.gateway,{id:a.gatewayImage,title:"XiaoZhiClaw Gateway Image (Desktop Slim)",kind:"container-image",delivery:"remote",platform:"any",description:"Desktop Docker mode gateway image."});i&&(r[i.id]=i)}if(!r[a.whisperModelTiny]&&t.whisperModel&&typeof t.whisperModel=="object"){let i=j(t.whisperModel,{id:a.whisperModelTiny,title:"Whisper Tiny Model",kind:"model",delivery:"remote",platform:"any",description:"Shared whisper.cpp tiny model asset for embedded desktop speech recognition."});i&&(r[i.id]=i)}let p={...V()},s=t.profiles&&typeof t.profiles=="object"?t.profiles:{};for(let[i,d]of Object.entries(s)){if(!d||typeof d!="object")continue;let u=d;!u.id||!Array.isArray(u.assetIds)||(p[i]=Ye(u))}return q({schemaVersion:typeof t.schemaVersion=="number"?t.schemaVersion:2,channel:typeof t.channel=="string"?t.channel:void 0,publishedAt:typeof t.publishedAt=="string"?t.publishedAt:void 0,minElectronVersion:typeof t.minElectronVersion=="string"?t.minElectronVersion:void 0,releaseNotes:typeof t.releaseNotes=="string"?t.releaseNotes:void 0,assets:r,profiles:p})}var $e=["pending","captured","failed","restored"],Je=["file","directory","missing"],Qe=["metadata-only","workspace-copy","shadow-git"];var Ze=["api-key","oauth","token","aws-sdk"],et=["rate_limit","auth","server_error","timeout","network","unknown"],tt=["requiresOpenAiAnthropicToolPayload"];function rt(e,t){return!e||typeof e!="object"||Array.isArray(e)?!1:e[t]===!0}var B="openai-codex";function S(e){let t=e.trim().toLowerCase();return t==="z.ai"||t==="z-ai"?"zai":t==="opencode-zen"?"opencode":t==="kimi-code"?"kimi-coding":t==="bedrock"||t==="aws-bedrock"?"amazon-bedrock":t==="bytedance"||t==="doubao"?"volcengine":t}function Y(e){let t=S(e);return t==="volcengine-plan"?"volcengine":t==="qwen-coding"?"qwen":t==="byteplus-plan"?"byteplus":t}var nt=Y,it={anthropicToolSchemaMode:"native",anthropicToolChoiceMode:"native",providerFamily:"default",preserveAnthropicThinkingSignatures:!0,openAiCompatTurnValidation:!0,providerThoughtSignatureSanitization:!1,transcriptToolCallIdMode:"default",transcriptToolCallIdModelHints:[],providerThoughtSignatureModelHints:[],dropThinkingBlockModelHints:[]},ot={anthropic:{providerFamily:"anthropic"},"amazon-bedrock":{providerFamily:"anthropic"},"kimi-coding":{anthropicToolSchemaMode:"openai-functions",anthropicToolChoiceMode:"openai-string-modes",preserveAnthropicThinkingSignatures:!1},mistral:{transcriptToolCallIdMode:"strict9",transcriptToolCallIdModelHints:["mistral","mixtral","codestral","pixtral","devstral","ministral","mistralai"]},openai:{providerFamily:"openai"},[B]:{providerFamily:"openai"},openrouter:{openAiCompatTurnValidation:!1,providerThoughtSignatureSanitization:!0,providerThoughtSignatureModelHints:["gemini"]},opencode:{openAiCompatTurnValidation:!1,providerThoughtSignatureSanitization:!0,providerThoughtSignatureModelHints:["gemini"]},kilocode:{providerThoughtSignatureSanitization:!0,providerThoughtSignatureModelHints:["gemini"]}};function T(e,t){let r=(e??"").toLowerCase();return!!r&&t.some(n=>r.includes(n))}function c(e){let t=S(e??"");return{...it,...ot[t]}}function st(e){return c(e).preserveAnthropicThinkingSignatures}function at(e){let t=c(e);return t.anthropicToolSchemaMode!=="native"||t.anthropicToolChoiceMode!=="native"}function dt(e){return c(e).anthropicToolSchemaMode==="openai-functions"}function pt(e){return c(e).anthropicToolChoiceMode==="openai-string-modes"}function ct(e){return c(e).openAiCompatTurnValidation}function lt(e){return c(e).providerFamily==="openai"}function ut(e){return c(e).providerFamily==="anthropic"}function gt(e){return T(e.modelId,c(e.provider).dropThinkingBlockModelHints)}function mt(e){let t=c(e.provider);return t.providerThoughtSignatureSanitization&&T(e.modelId,t.providerThoughtSignatureModelHints)}function ft(e,t){let r=c(e),n=r.transcriptToolCallIdMode;if(n==="strict9")return n;if(T(t,r.transcriptToolCallIdModelHints))return"strict9"}var k={anthropic:["ANTHROPIC_OAUTH_TOKEN","ANTHROPIC_API_KEY"],chutes:["CHUTES_OAUTH_TOKEN","CHUTES_API_KEY"],zai:["ZAI_API_KEY","Z_AI_API_KEY"],opencode:["OPENCODE_API_KEY","OPENCODE_ZEN_API_KEY"],qwen:["DASHSCOPE_API_KEY","QWEN_API_KEY"],"qwen-coding":["DASHSCOPE_API_KEY","QWEN_API_KEY"],volcengine:["VOLCANO_ENGINE_API_KEY","ARK_API_KEY","DOUBAO_API_KEY"],"volcengine-plan":["VOLCANO_ENGINE_API_KEY","ARK_API_KEY","DOUBAO_API_KEY"],byteplus:["BYTEPLUS_API_KEY"],"byteplus-plan":["BYTEPLUS_API_KEY"],"kimi-coding":["KIMI_API_KEY","KIMICODE_API_KEY"],huggingface:["HUGGINGFACE_HUB_TOKEN","HF_TOKEN"],openai:["OPENAI_API_KEY"],voyage:["VOYAGE_API_KEY"],groq:["GROQ_API_KEY"],deepgram:["DEEPGRAM_API_KEY"],cerebras:["CEREBRAS_API_KEY"],xai:["XAI_API_KEY"],openrouter:["OPENROUTER_API_KEY"],litellm:["LITELLM_API_KEY"],"vercel-ai-gateway":["AI_GATEWAY_API_KEY"],"cloudflare-ai-gateway":["CLOUDFLARE_AI_GATEWAY_API_KEY"],moonshot:["MOONSHOT_API_KEY"],minimax:["MINIMAX_API_KEY"],"minimax-cn":["MINIMAX_CN_API_KEY","MINIMAX_API_KEY"],nvidia:["NVIDIA_API_KEY"],xiaomi:["XIAOMI_API_KEY"],synthetic:["SYNTHETIC_API_KEY"],venice:["VENICE_API_KEY"],mistral:["MISTRAL_API_KEY"],together:["TOGETHER_API_KEY"],qianfan:["QIANFAN_API_KEY"],ollama:["OLLAMA_API_KEY"],vllm:["VLLM_API_KEY"],kilocode:["KILOCODE_API_KEY"]};function yt(){return[...new Set(Object.values(k).flat())]}function At(e){let t=S(e.provider),r=e.env??process.env,n=new Set(e.appliedEnvKeys??[]),o=i=>{let d=r[i]?.trim();if(!d)return null;let u=n.has(i)?`shell env: ${i}`:`env: ${i}`;return{apiKey:d,source:u}},p=e.resolveSpecialApiKey?.(t,r,n);if(p)return p;let s=k[t];if(!s||s.length===0)return null;for(let i of s){let d=o(i);if(d)return d}return null}export{Re as ACP_EXTENDED_METHODS,be as ACP_EXTENDED_SESSION_UPDATE_TYPES,Ie as ACP_METHODS,he as ACP_PERMISSION_PRESENTATION_META_KEY,Se as ACP_PROTOCOL_VERSION,N as ACP_SESSION_UPDATE_TYPES,z as AGENT_RPC_APPROVAL_METHODS,l as AGENT_RPC_ERROR_CODES,G as AGENT_RPC_PROTOCOL_VERSION,b as AGENT_TEAM_WS_EVENT_NAMES,R as AGENT_WS_EVENT_NAMES,w as ALL_AGENT_WS_EVENT_NAMES,h as CAPABILITY_MANIFEST_DIFF_SECTIONS,re as GATEWAY_RPC_METHODS,I as GatewayRpcContract,Fe as MEMORY_OBSERVATION_HOOK_VALUES,We as MEMORY_OBSERVATION_SOURCE_VALUES,qe as MEMORY_WRITE_ACCESS_VALUES,Qe as MUTATION_CHECKPOINT_BACKEND_VALUES,Je as MUTATION_CHECKPOINT_ENTRY_KIND_VALUES,$e as MUTATION_CHECKPOINT_PHASE_VALUES,Ze as PROVIDER_RUNTIME_AUTH_MODE_VALUES,tt as PROVIDER_RUNTIME_COMPAT_FLAG_VALUES,k as PROVIDER_RUNTIME_ENV_API_KEY_CANDIDATES,B as PROVIDER_RUNTIME_OPENAI_CODEX_PROVIDER_ID,et as PROVIDER_RUNTIME_VAULT_ERROR_TYPE_VALUES,Be as RESOURCE_MANIFEST_SCHEMA_VERSION,a as RUNTIME_ASSET_IDS,y as RUNTIME_PROFILE_IDS,Ue as WEB_ACTION_SCOPE_VALUES,He as WEB_APPROVAL_DEFAULT_VALUES,we as WEB_CAPABILITY_FAMILY_VALUES,ve as WEB_CAPABILITY_ID_VALUES,je as WEB_DEGRADATION_TARGET_VALUES,Ke as WEB_ESCALATION_REASON_VALUES,Ne as WEB_EXECUTION_MODE_VALUES,Le as WEB_POLICY_RISK_CLASS_VALUES,Ve as WEB_RETRY_POLICY_VALUES,De as WEB_STATEFULNESS_VALUES,Oe as WEB_TASK_MODE_VALUES,te as buildAgentRpcMeta,A as classifyGatewayRpcMethod,f as cloneCapabilityManifestSnapshot,Me as createCapabilityManifestDiffPayload,V as createDefaultRuntimeResourceProfiles,Ce as deriveCapabilityToolNamespaces,xe as deriveCapabilityWorkspaceIds,P as getManifestShortcutEntry,F as getRuntimeResourceAsset,W as getRuntimeResourceProfile,Ge as getRuntimeResourceProfileAssets,H as isAcpJsonRpcNotification,D as isAcpJsonRpcRequest,L as isAcpJsonRpcResponse,x as isAgentRpcNotification,_ as isAgentRpcRequest,C as isAgentRpcResponse,ut as isAnthropicProviderRuntimeFamily,Te as isExtendedSessionUpdateType,lt as isOpenAiProviderRuntimeFamily,Pe as isStandardSessionUpdateType,yt as listProviderRuntimeEnvApiKeyNames,_e as mergeCapabilityManifestSnapshot,S as normalizeProviderRuntimeId,Y as normalizeProviderRuntimeIdForAuth,Xe as normalizeRuntimeResourceManifest,Ee as parseAcpMessage,X as parseAgentRpcMessage,st as preservesProviderRuntimeAnthropicThinkingSignatures,rt as readProviderRuntimeCompatFlag,v as requireGatewayRpcMeta,M as requiresIdempotencyKey,at as requiresOpenAiCompatibleAnthropicToolPayloadForProviderRuntime,c as resolveProviderRuntimeCapabilities,At as resolveProviderRuntimeEnvApiKey,nt as resolveProviderRuntimeKeyFamily,ft as resolveProviderRuntimeTranscriptToolCallIdMode,gt as shouldDropThinkingBlocksForProviderRuntimeModel,mt as shouldSanitizeProviderRuntimeThoughtSignaturesForModel,ct as supportsOpenAiCompatTurnValidationForProviderRuntime,ze as upsertRuntimeResourceAsset,dt as usesOpenAiFunctionAnthropicToolSchemaForProviderRuntime,pt as usesOpenAiStringModeAnthropicToolChoiceForProviderRuntime};
@@ -3,6 +3,7 @@ export interface ArtifactContractState {
3
3
  artifactRoot?: string;
4
4
  rootSource?: "explicit" | "inferred";
5
5
  writePaths: string[];
6
+ deletedPaths: string[];
6
7
  outOfRootWrites: Array<{
7
8
  path: string;
8
9
  artifactRoot: string;
@@ -36,6 +37,7 @@ export interface UiAcceptanceEvidence {
36
37
  export interface ArtifactContractEventPayload {
37
38
  artifactRoot?: string;
38
39
  writePaths: string[];
40
+ deletedPaths: string[];
39
41
  outOfRootWrites: Array<{
40
42
  path: string;
41
43
  artifactRoot: string;
@@ -1,5 +1,5 @@
1
1
  import type { NotificationMethod, NotificationMethodMap } from "../protocol/notifications.js";
2
- import type { AcpPermissionRequestParams } from "../protocol/wire/index.js";
2
+ import { type AcpPermissionRequestParams } from "../protocol/wire/index.js";
3
3
  import type { ApprovalRequest, ApprovalResponse } from "../runtime/ports/index.js";
4
4
  export interface PermissionApprovalBridgeDeps {
5
5
  getAcpPermissionSession(): {
@@ -628,6 +628,18 @@ export interface SupervisorEventSink {
628
628
  arguments?: string;
629
629
  message?: string;
630
630
  category?: string;
631
+ /** Host-normalized concise explanation shown before the decision controls. */
632
+ summary?: string;
633
+ /** Exact scope affected by a remembered permission option. */
634
+ scopeTarget?: {
635
+ kind: "directory";
636
+ path: string;
637
+ };
638
+ /** Raw operation input retained behind an explicit details disclosure. */
639
+ details?: {
640
+ format: "command" | "json" | "text";
641
+ content: string;
642
+ };
631
643
  options: Array<{
632
644
  optionId: string;
633
645
  name: string;
@@ -927,6 +939,11 @@ export interface HostTurnTelemetryInput {
927
939
  hasTurnFileChanges?: boolean;
928
940
  };
929
941
  delegationSummary?: HostDelegationTelemetrySummary;
942
+ capabilityContext?: {
943
+ skillDirectoryProjected: boolean;
944
+ skillDirectoryRevision?: `sha256:${string}`;
945
+ skillDirectoryChars?: number;
946
+ };
930
947
  }
931
948
  /** Minimal, non-message-text evidence returned to the agent-side pure distiller. */
932
949
  export interface HostDistillableFeedbackEvent {
@@ -335,6 +335,17 @@ export interface AcpPermissionRequestParams {
335
335
  message?: string;
336
336
  category?: string;
337
337
  options: AcpPermissionOption[];
338
+ /** Standard ACP extensibility bag. Product-specific presentation data is namespaced here. */
339
+ _meta?: Record<string, unknown>;
340
+ }
341
+ export declare const ACP_PERMISSION_PRESENTATION_META_KEY = "xiaozhiclaw/permissionPresentation";
342
+ export interface AcpPermissionPresentationMetaV1 {
343
+ schemaVersion: 1;
344
+ summary: string;
345
+ scopeTarget?: {
346
+ kind: "directory";
347
+ path: string;
348
+ };
338
349
  }
339
350
  export interface AcpPermissionOption {
340
351
  optionId: string;
@@ -6,7 +6,7 @@ export { type AgentRpcMethodMap, type ProductInstanceDef, type ProductPhase, typ
6
6
  export type * from "./acp-agent-management.js";
7
7
  export { AGENT_TEAM_WS_EVENT_NAMES, AGENT_WS_EVENT_NAMES, ALL_AGENT_WS_EVENT_NAMES, type AgentTeamWsEventName, type AgentWsEventName, type AllAgentWsEventName, } from "./agent-events.js";
8
8
  export { type AgentSource, type ArtifactType, type MediaResultType, type MemoryDecayCompletedNotification, type MemoryUpdatedNotification, type NotificationMethod, type NotificationMethodMap, type NotificationThreadItem, type ThreadItemNotification, type PermissionRuleUpdatedNotification, type PlanInterruptedNotification, type PongNotification, type ProductBudgetUpdateNotification, type ProductBudgetWarningNotification, type ProductCheckpointedNotification, type ProductCompletedNotification, type ProductDagTopologyNotification, type ProductTaskCompletedNotification, type ProductTaskFailedNotification, type ProductTaskOutputDeltaNotification, type ProductMembersNotification, type ProductAgentActivityNotification, type ProductTaskStartedNotification, type ProjectArchivedNotification, type ProjectCreatedNotification, type ProjectDeletedNotification, type ProjectDetachedNotification, type ProjectAttachedNotification, type ProjectRenamedNotification, type ProjectSwitchedNotification, type ProjectUnarchivedNotification, type SessionInfoNotification, type SessionRecoveryPendingNotification, type SoloAgentDeltaNotification, type SoloAgentUsageNotification, type SoloEvaluationNotification, type SoloProgressNotification, type TeamMemberNotification, type ToolApprovalRequestNotification, type TurnAnnotationsNotification, type TurnArtifactContractNotification, type TurnArtifactNotification, type TurnAskUserNotification, type TurnDeltaNotification, type TurnEndNotification, type TurnErrorNotification, type TurnExecProgressNotification, type TurnHeartbeatNotification, type TurnMediaResultNotification, type TurnPlanUpdateNotification, type TurnProgressNotification, type TurnReasoningDeltaNotification, type TurnRecoveryNotification, type TurnSidechainCompletedNotification, type TurnSidechainStartedNotification, type TurnSkillAcquisitionNeededNotification, type TurnStartNotification, type TurnSubagentActivityNotification, type TurnSubagentActivityStatus, type TurnSubagentCompletedNotification, type TurnSubagentDecisionNotification, type TurnSubagentDeltaNotification, type TurnSubagentEndedNotification, type TurnSubagentEvidenceItem, type TurnSubagentStartedNotification, type TurnSubagentTokenUsage, type TurnSuggestionsNotification, type TurnTaskUpdatedNotification, type TurnTodosUpdatedNotification, type TurnToolBlockedNotification, type TurnToolCallNotification, type TurnToolResultNotification, type TurnToolSelectionPolicyNotification, type ToolCallExecutionEvidence, type FinalAnswerEvidence, type TurnToolUseSummaryNotification, type TurnUsageUpdateNotification, type WireTokenUsage, type ProductPlanReadyNotification, type ProductPlanFailedNotification, type ProductPlanningDeltaNotification, type ProductLeaderMessageNotification, type ProductPlanningAskNotification, type MentionDelegateStartedNotification, type MentionDelegateActivityNotification, type MentionDelegateSettledNotification, type WorkflowDeletedNotification, type WorkflowRecordNotification, type WorkflowRunCompletedNotification, type WorkflowRunFailedNotification, type WorkflowRunStartedNotification, } from "./notification-payloads.js";
9
- export { ACP_EXTENDED_METHODS, ACP_EXTENDED_SESSION_UPDATE_TYPES, ACP_METHODS, ACP_PROTOCOL_VERSION, ACP_SESSION_UPDATE_TYPES, isAcpJsonRpcNotification, isAcpJsonRpcRequest, isAcpJsonRpcResponse, isExtendedSessionUpdateType, isStandardSessionUpdateType, parseAcpMessage, type AcpAgentCapabilities, type AcpAgentMessageChunkPayload, type AcpAgentThoughtChunkPayload, type AcpConfigOptionDescriptor, type AcpConfigOptionUpdatePayload, type AcpContentBlock, type AcpEndTurnPayload, type AcpExtendedMethod, type AcpExtendedSessionUpdateType, type AcpFsReadTextFileParams, type AcpFsReadTextFileResult, type AcpFsWriteTextFileParams, type AcpFsWriteTextFileResult, type AcpHostCapabilities, type AcpInitializeParams, type AcpInitializeResult, type AcpJsonRpcError, type AcpJsonRpcMessage, type AcpJsonRpcNotification, type AcpJsonRpcRequest, type AcpJsonRpcResponse, type AcpMode, type AcpPermissionOption, type AcpPermissionRequestParams, type AcpPermissionRequestResult, type AcpPlanPayload, type AcpSessionCancelParams, type AcpSessionCloseParams, type AcpSessionMeta, type AcpSessionLoadParams, type AcpSessionModeState, type AcpSessionNewParams, type AcpSessionNewResult, type AcpSessionPromptParams, type AcpSessionPromptResult, type AcpSessionSetConfigParams, type AcpSessionUpdateNotification, type AcpSessionUpdateType, type AcpStandardMethod, type AcpStandardSessionUpdateType, type AcpStopReason, type AcpToolCallPayload, type AcpToolCallUpdatePayload, type AcpUsage, type AcpUsageUpdatePayload, type AcpXSessionInfoPayload, type AcpXSkillInstructionPayload, } from "./acp-protocol.js";
9
+ export { ACP_EXTENDED_METHODS, ACP_EXTENDED_SESSION_UPDATE_TYPES, ACP_METHODS, ACP_PROTOCOL_VERSION, ACP_SESSION_UPDATE_TYPES, isAcpJsonRpcNotification, isAcpJsonRpcRequest, isAcpJsonRpcResponse, isExtendedSessionUpdateType, isStandardSessionUpdateType, parseAcpMessage, type AcpAgentCapabilities, type AcpAgentMessageChunkPayload, type AcpAgentThoughtChunkPayload, type AcpConfigOptionDescriptor, type AcpConfigOptionUpdatePayload, type AcpContentBlock, type AcpEndTurnPayload, type AcpExtendedMethod, type AcpExtendedSessionUpdateType, type AcpFsReadTextFileParams, type AcpFsReadTextFileResult, type AcpFsWriteTextFileParams, type AcpFsWriteTextFileResult, type AcpHostCapabilities, type AcpInitializeParams, type AcpInitializeResult, type AcpJsonRpcError, type AcpJsonRpcMessage, type AcpJsonRpcNotification, type AcpJsonRpcRequest, type AcpJsonRpcResponse, type AcpMode, type AcpPermissionOption, type AcpPermissionRequestParams, ACP_PERMISSION_PRESENTATION_META_KEY, type AcpPermissionPresentationMetaV1, type AcpPermissionRequestResult, type AcpPlanPayload, type AcpSessionCancelParams, type AcpSessionCloseParams, type AcpSessionMeta, type AcpSessionLoadParams, type AcpSessionModeState, type AcpSessionNewParams, type AcpSessionNewResult, type AcpSessionPromptParams, type AcpSessionPromptResult, type AcpSessionSetConfigParams, type AcpSessionUpdateNotification, type AcpSessionUpdateType, type AcpStandardMethod, type AcpStandardSessionUpdateType, type AcpStopReason, type AcpToolCallPayload, type AcpToolCallUpdatePayload, type AcpUsage, type AcpUsageUpdatePayload, type AcpXSessionInfoPayload, type AcpXSkillInstructionPayload, } from "./acp-protocol.js";
10
10
  export { type ApprovalRequiredToolContract, type ModelSelectionReason, type PendingPromptContract, type RuntimeCapabilitySummaryContract, type RuntimeSessionContract, type SessionIdentityContract, } from "./session.js";
11
11
  export { CAPABILITY_MANIFEST_DIFF_SECTIONS, cloneCapabilityManifestSnapshot, createCapabilityManifestDiffPayload, deriveCapabilityToolNamespaces, deriveCapabilityWorkspaceIds, mergeCapabilityManifestSnapshot, type CapabilityManifestApprovalMode, type CapabilityManifestApprovalPolicyContract, type CapabilityManifestDiffSection, type CapabilityMcpManifestContract, type CapabilityManifestSnapshotContract, type HostCapabilitySnapshotContract, type CapabilityPluginManifestContract, type RuntimeCapabilityViewContract, type RuntimeToolEligibilityContract, type CapabilitySkillManifestContract, type CapabilityToolManifestContract, type CapabilityWorkspaceSummaryContract, type ToolEligibilityResolvedSource, type ToolEligibilityReasonCode, type ToolEligibilityStatus, } from "./capability-manifest.js";
12
12
  export { WEB_ACTION_SCOPE_VALUES, WEB_APPROVAL_DEFAULT_VALUES, WEB_CAPABILITY_FAMILY_VALUES, WEB_CAPABILITY_ID_VALUES, WEB_DEGRADATION_TARGET_VALUES, WEB_ESCALATION_REASON_VALUES, WEB_EXECUTION_MODE_VALUES, WEB_POLICY_RISK_CLASS_VALUES, WEB_RETRY_POLICY_VALUES, WEB_STATEFULNESS_VALUES, WEB_TASK_MODE_VALUES, type WebActionScope, type WebApprovalDefault, type WebCapabilityDescriptorContract, type WebCapabilityFamily, type WebCapabilityId, type WebDegradationTarget, type WebEscalationReason, type WebExecutionMode, type WebPolicyRiskClass, type WebRetryPolicy, type WebStatefulness, type WebTaskMode, type ToolRiskLevel, } from "./web-capability.js";
@@ -16,6 +16,11 @@ export interface TurnTelemetryFileContext {
16
16
  changedPathsPreview?: string[];
17
17
  hasTurnFileChanges?: boolean;
18
18
  }
19
+ export interface TurnTelemetryCapabilityContext {
20
+ skillDirectoryProjected: boolean;
21
+ skillDirectoryRevision?: `sha256:${string}`;
22
+ skillDirectoryChars?: number;
23
+ }
19
24
  export interface TurnTelemetryExecutionEvidence {
20
25
  ledgerSchemaVersion: 4;
21
26
  toolCalls: ToolCallExecutionEvidence[];
@@ -42,6 +47,7 @@ export interface TurnTelemetrySnapshot {
42
47
  executionEvidence?: TurnTelemetryExecutionEvidence;
43
48
  fileContext?: TurnTelemetryFileContext;
44
49
  delegationSummary?: HostDelegationTelemetrySummary;
50
+ capabilityContext?: TurnTelemetryCapabilityContext;
45
51
  createdAt: string;
46
52
  finalizedAt?: string;
47
53
  }
@@ -1,9 +1,10 @@
1
1
  /**
2
- * ACP Event Emittertranslates internal qlogicagent notifications to ACP
2
+ * ACP Event Emitter translates internal qlogicagent notifications to ACP
3
3
  * session/update notifications.
4
4
  *
5
- * Maps the 47+ internal notification methods (turn.delta, turn.tool_call, etc.)
6
- * to 9 standard + 19 extended ACP sessionUpdate types.
5
+ * Maps internal notifications (turn.delta, turn.tool_call, etc.) to standard
6
+ * ACP session/update messages whenever ACP has a native representation. Only
7
+ * notifications without a standard representation use negotiated extensions.
7
8
  *
8
9
  * Usage: Called by the StdioServer event loop. Instead of (or in addition to)
9
10
  * emitting raw notifications, events are translated and emitted through the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qlogicagent",
3
- "version": "2.23.2",
3
+ "version": "2.23.4",
4
4
  "packageManager": "pnpm@10.23.0",
5
5
  "description": "XiaozhiClaw Agent CLI — subprocess architecture (JSON-RPC over stdio)",
6
6
  "type": "module",