qlogicagent 2.19.1 → 2.19.2
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/agent-contract.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/host-contract.js +1 -1
- package/dist/host-session-collection-contract.js +1 -0
- package/dist/index.js +478 -505
- package/dist/pet-host.js +8 -8
- package/dist/project-memory-host.js +23 -23
- package/dist/protocol.js +1 -1
- package/dist/types/cli/acp-commands.d.ts +1 -1
- package/dist/types/cli/acp-extended-handlers.d.ts +2 -8
- package/dist/types/cli/acp-extended-host-adapter.d.ts +0 -11
- package/dist/types/cli/acp-session-host.d.ts +2 -0
- package/dist/types/cli/core-tool-coordinator.d.ts +0 -9
- package/dist/types/cli/default-project-bootstrap.d.ts +2 -32
- package/dist/types/cli/handlers/session-handler.d.ts +0 -43
- package/dist/types/cli/handlers/solo-handler.d.ts +3 -14
- package/dist/types/cli/multi-agent-handler-host.d.ts +3 -16
- package/dist/types/cli/product-coordinator.d.ts +3 -14
- package/dist/types/cli/rpc-registry.d.ts +0 -2
- package/dist/types/cli/stdio-rpc-handler-hosts.d.ts +4 -1
- package/dist/types/cli/stdio-server.d.ts +1 -2
- package/dist/types/host-contract/index.d.ts +110 -18
- package/dist/types/host-session-collection-contract.d.ts +61 -0
- package/dist/types/orchestration/agent-instance.d.ts +4 -11
- package/dist/types/orchestration/agent-roster.d.ts +4 -4
- package/dist/types/orchestration/delegate-bridge.d.ts +8 -0
- package/dist/types/orchestration/goal-mode-adapters.d.ts +3 -3
- package/dist/types/orchestration/product-persistence.d.ts +0 -4
- package/dist/types/orchestration/product-planner.d.ts +4 -6
- package/dist/types/orchestration/solo-evaluator.d.ts +2 -5
- package/dist/types/orchestration/testing/delegate-test-bridge.d.ts +2 -1
- package/dist/types/orchestration/testing/host-agent-provider-directory-fixture.d.ts +7 -0
- package/dist/types/orchestration/workflow/qla-executor-host.d.ts +1 -1
- package/dist/types/protocol/agent-contract.d.ts +9 -3
- package/dist/types/protocol/methods.d.ts +20 -38
- package/dist/types/protocol/notifications.d.ts +1 -1
- package/dist/types/protocol/wire/acp-agent-management.d.ts +2 -190
- package/dist/types/protocol/wire/acp-protocol.d.ts +0 -4
- package/dist/types/protocol/wire/agent-methods.d.ts +1 -243
- package/dist/types/protocol/wire/gateway-rpc.d.ts +343 -15
- package/dist/types/protocol/wire/index.d.ts +3 -3
- package/dist/types/protocol/wire/notification-payloads.d.ts +48 -134
- package/dist/types/runtime/infra/host-agent-provider-directory.d.ts +17 -0
- package/dist/types/runtime/infra/project-authority-facade.d.ts +1 -1
- package/dist/types/runtime/infra/project-data-paths.d.ts +2 -1
- package/dist/types/runtime/infra/project-host-authority.d.ts +3 -2
- package/dist/types/runtime/infra/project-store.d.ts +4 -39
- package/dist/types/runtime/session/session-catalog.d.ts +0 -12
- package/dist/types/runtime/session/session-persistence.d.ts +1 -1
- package/dist/types/runtime/session/session-resource-key.d.ts +1 -1
- package/dist/types/runtime/session/session-types.d.ts +0 -23
- package/dist/types/transport/acp-server.d.ts +2 -10
- package/dist/workflow-host.js +10 -10
- package/package.json +8 -1
- package/dist/types/cli/agent-config-coordinator.d.ts +0 -27
- package/dist/types/cli/agent-config-runtime.d.ts +0 -11
- package/dist/types/cli/agent-status-notifier.d.ts +0 -11
- package/dist/types/cli/handlers/agents-handler.d.ts +0 -126
- package/dist/types/cli/handlers/project-handler.d.ts +0 -36
- package/dist/types/cli/project-command-service.d.ts +0 -28
- package/dist/types/orchestration/delegation-coordinator.d.ts +0 -100
- package/dist/types/runtime/infra/acp-detector.d.ts +0 -273
- package/dist/types/runtime/infra/agent-config-store.d.ts +0 -30
- package/dist/types/runtime/infra/agent-install-runner.d.ts +0 -80
- package/dist/types/runtime/infra/external-agent-approvals.d.ts +0 -59
- package/dist/types/runtime/infra/migrate-device-scope.d.ts +0 -49
- package/dist/types/runtime/infra/project-data-gc.d.ts +0 -15
- package/dist/types/runtime/session/native/claude-session-source.d.ts +0 -23
- package/dist/types/runtime/session/native/codex-index.d.ts +0 -21
- package/dist/types/runtime/session/native/codex-session-source.d.ts +0 -31
- package/dist/types/runtime/session/native/cwd-normalize.d.ts +0 -53
- package/dist/types/runtime/session/native/ephemeral-rollout-sweep.d.ts +0 -13
- package/dist/types/runtime/session/native/native-cwd-agents.d.ts +0 -17
- package/dist/types/runtime/session/native/native-session-source.d.ts +0 -89
- package/dist/types/runtime/session/native/native-title.d.ts +0 -1
- package/dist/types/runtime/session/native/register-builtin-sources.d.ts +0 -1
package/dist/protocol.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var Y=["idle","running-right","running-left","waving","jumping","failed","waiting","running","review"];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 k(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)||k(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","agents.list","agents.get","agents.processes","agents.scan","session.list","session.get","session.resolve","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","media.listModels","media.status","pet.status","agent.health","agent.metrics"],Q=new Set(["memory.dream","memory.propose","memory.consolidate","media.stt","pet.forge","pet.asset.import","solo.start","solo.evaluate","product.plan","product.create","product.message"]),Z=["memory.","pet.","usage."],ee=new Set(["memory.atlas","memory.activity","memory.list","memory.read","memory.search","memory.attachment.locate","memory.attachment.adopt","pet.status"]);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 n=t.now??Date.now(),r=A(e),i=t.timeoutMs??r.defaultTimeoutMs;return{requestId:t.requestId??$(),createdAt:n,deadlineAt:n+i,channel:t.channel??r.channel,idempotencyKey:t.idempotencyKey,traceId:t.traceId}}function w(e,t=Date.now()){let n=e.meta;if(!n||typeof n!="object")return{ok:!1,error:{code:l.INVALID_REQUEST,message:"RPC request meta is required."}};if(typeof n.requestId!="string"||n.requestId.length===0)return{ok:!1,error:{code:l.INVALID_REQUEST,message:"RPC request meta.requestId is required."}};if(n.channel!=="query"&&n.channel!=="task")return{ok:!1,error:{code:l.INVALID_REQUEST,message:"RPC request meta.channel must be query or task."}};if(typeof n.createdAt!="number"||!Number.isFinite(n.createdAt))return{ok:!1,error:{code:l.INVALID_REQUEST,message:"RPC request meta.createdAt is required."}};if(typeof n.deadlineAt!="number"||!Number.isFinite(n.deadlineAt))return{ok:!1,error:{code:l.INVALID_REQUEST,message:"RPC request meta.deadlineAt is required."}};if(n.deadlineAt<=t)return{ok:!1,error:{code:l.REQUEST_DEADLINE_EXCEEDED,message:"RPC request deadline has already expired."}};let r=A(e.method).channel;return n.channel!==r?{ok:!1,error:{code:l.INVALID_REQUEST,message:`RPC request channel mismatch: expected ${r}, got ${n.channel}.`}}:M(e.method)&&(typeof n.idempotencyKey!="string"||n.idempotencyKey.length===0)?{ok:!1,error:{code:l.REQUEST_IDEMPOTENCY_REQUIRED,message:`RPC method ${e.method} requires meta.idempotencyKey.`}}:{ok:!0,meta:n}}var S=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,n){let r=w({method:t,meta:n},this.now());if(!r.ok)return this.counters.invalidRequests+=1,{status:"rejected",error:r.error};if(n.idempotencyKey){let i=this.idempotency.get(n.idempotencyKey);if(i)return this.counters.dedupedRequests+=1,i.error?{status:"deduped",error:i.error}:{status:"deduped",result:i.result}}return this.active.set(n.requestId,{method:t,meta:n,cancelled:!1,startedAt:this.now()}),{status:"started"}}cancel(t,n="cancelled"){let r=this.active.get(t);return!r||r.cancelled?!1:(r.cancelled=!0,r.cancelReason=n,this.counters.cancelledRequests+=1,!0)}expire(t){return this.active.get(t)?(this.active.delete(t),this.counters.deadlineExceededRequests+=1,!0):!1}settle(t,n,r){let i=this.active.get(t);return i?(this.active.delete(t),i.cancelled?(this.counters.lateResponsesDropped+=1,{accepted:!1,reason:"cancelled"}):i.meta.deadlineAt<=this.now()?(this.counters.deadlineExceededRequests+=1,this.counters.lateResponsesDropped+=1,{accepted:!1,reason:"deadline_exceeded"}):(this.counters.completedRequests+=1,i.meta.idempotencyKey&&this.idempotency.set(i.meta.idempotencyKey,{result:n,error:r,settledAt:this.now()}),{accepted:!0})):{accepted:!1,reason:"unknown"}}metrics(){return{activeRequests:this.active.size,...this.counters}}};var ne=["agent.health","agent.metrics","agent.cancel","session.list","session.get","session.create","session.update","session.delete","session.deleteAll","session.archive","session.moveToProject","session.getState","session.switchProject","session.getMessages","project.list","project.create","project.delete","project.rename","project.archive","project.unarchive","project.update","project.purgeAll","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 I=["turn.start","turn.delta","turn.end","turn.error","turn.recovery","turn.file_changes","turn.tool_call","turn.tool_result","turn.tool_blocked","turn.reasoning_delta","turn.approval_request","turn.skill_instruction","turn.ask_user","turn.media_result","turn.media_progress","turn.media_usage","turn.media_capability_check","turn.plan_update","turn.suggestions","turn.sidechain_started","turn.subagent_started","turn.subagent_delta","turn.subagent_ended","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","memory.updated","skills.updated","turn.memory_recall","turn.memory_written","pet.soul_ready","pet.reaction","pet.growth","pet.state","pet.confirm","pet.asset.updated","system.activity","workflow.created","workflow.updated","workflow.deleted","workflow.runStarted","workflow.runCompleted","workflow.runFailed","workflow.nodeStatus","workflow.triggerDropped","workflow.alert","workflow.approvalRequested","workflow.approvalTimedOut"],E=["solo.progress","solo.specProgress","solo.agentDelta","solo.agentActivity","solo.agentUsage","solo.evaluation","product.taskStarted","product.taskOutput","product.members","product.agentActivity","product.taskCompleted","product.taskFailed","product.budgetUpdate","product.budgetWarning","product.checkpointed","product.completed","product.dagTopology","plan.interrupted","product.planReady","product.planningDelta","product.leaderMessage","product.planFailed","product.planningAsk","goal.run_state_changed","goal.phase_boundary","goal.goal_edited","goal.message_queued","goal.acceptance_updated","goal.round_message","mention.delegate_started","mention.delegate_activity","mention.delegate_settled"],re=[...I,...E],v=re;import{createHash as Tt}from"node:crypto";import{resolve as _t}from"node:path";var m={request:"x/delegate",update:"x/delegate.update",respond:"x/delegate.respond",cancel:"x/delegate.cancel"},oe=["search","addText","embedText","ingestExtracted","proposeExtracted","consumePendingProposals","feedback","findRelatedEvents","synthesizeTimeline","getActivitySummary","getAllProfiles","setProfile","getAtlas","setMemoryArchived","triggerDecay","resolveConflicts"],ie=["initialize","getIndex","addToIndex","replaceInIndex","removeFromIndex","createFile","writeFile","readFile","deleteFile","listFiles","searchLocal"],se=["getSkillSnapshot","readSkillFile","recordSkillInvocation","commitSkillMutation","applyCuratorPlan","prepareSkillInstall","finalizeSkillInstall"],ae=["loadForResume","appendTranscript","updateTitle","saveState","saveTaskSummary","groupSplit"],de=["commitTurnTelemetry","listDistillableFeedback","markFeedbackDistilled","runUploadSweep"],pe=["getSnapshot","create","switch","update"],vt=1024*1024,ce=["navigate","snapshot","click","type","screenshot","console","network"];var le=["open","recordEvent","checkpoint","get","list","delete","getCheckpoint","listCheckpoints","restoreCheckpoint"],ue=["isActive","getSoul","awardXp","journeyCatchUp"],ge=["getTunables","updateTunable","clearTunable","appendDirectoryAllowRule"];var Ot=new Set(oe),Nt=new Set(ie),Dt=new Set(ge),Ht=new Set(se),Lt=new Set(ae),Ut=new Set(de),jt=new Set(pe),Kt=new Set(le),Ft=new Set(ue),Vt=new Set(ce);var me=1,fe={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"},ye={ABORT:"x/abort",DREAM:"x/dream",AGENTS_LIST:"x/agents.list",SOLO_START:"x/solo.start",SOLO_STATUS:"x/solo.status",SOLO_SELECT:"x/solo.select",SOLO_CANCEL:"x/solo.cancel",PRODUCT_CREATE:"x/product.create",PRODUCT_PLAN:"x/product.plan",PRODUCT_CONFIRM:"x/product.confirm",PRODUCT_MESSAGE:"x/product.message",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",PRODUCT_STATUS:"x/product.status",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",PRODUCT_SUBSCRIBE:"x/product.subscribe",GOAL_START:"x/goal.start",GOAL_STATUS:"x/goal.status",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_SUBSCRIBE:"x/goal.subscribe",GOAL_EVENTS:"x/goal.events",MENTION_DELEGATE:"x/mention.delegate",MENTION_CANCEL:"x/mention.cancel",MENTION_LIST:"x/mention.list",DELEGATE:m.request,DELEGATE_UPDATE:m.update,DELEGATE_RESPOND:m.respond,DELEGATE_CANCEL:m.cancel},O={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"},Ae={X_SKILL_INSTRUCTION:"x_skill_instruction",X_SESSION_INFO:"x_session_info",X_RELAY:"x_relay"};function N(e){if(!e||typeof e!="object")return!1;let t=e;return t.jsonrpc==="2.0"&&typeof t.method=="string"&&"id"in t}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"&&"id"in t&&!("method"in t)}function Re(e){let t;try{t=JSON.parse(e)}catch{return null}return H(t)||N(t)||D(t)?t:null}function Se(e){return Object.values(O).includes(e)}function Ie(e){return e.startsWith("x_")}var b=["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 P(e){return e?e.map(t=>({...t})):void 0}function Ee(e){return e?[...e]:void 0}function L(e){return[...new Set(e.map(t=>t.trim()).filter(Boolean))].sort((t,n)=>t.localeCompare(n))}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:P(e.workspaceSummaries)}:{}}}function be(e){let{previous:t,update:n}=e;return!(n.syncMode==="diff"&&t&&(!n.baseSnapshotVersion||t.snapshotVersion===n.baseSnapshotVersion))||!t?f(n):{...f(t),snapshotVersion:n.snapshotVersion,updatedAt:n.updatedAt,...n.gatewayVersion!==void 0?{gatewayVersion:n.gatewayVersion}:{},...n.syncMode?{syncMode:n.syncMode}:{},...n.baseSnapshotVersion?{baseSnapshotVersion:n.baseSnapshotVersion}:{},...n.changedSections?{changedSections:[...n.changedSections]}:{},...n.toolNamespaces?{toolNamespaces:[...n.toolNamespaces]}:{},...n.workspaceIds?{workspaceIds:[...n.workspaceIds]}:{},...n.installedCapabilities?{installedCapabilities:[...n.installedCapabilities]}:{},...n.enabledCapabilities?{enabledCapabilities:[...n.enabledCapabilities]}:{},...n.features?{features:[...n.features]}:{},...n.approvalMode?{approvalMode:n.approvalMode}:{},...n.toolManifests?{toolManifests:g(n.toolManifests)}:{},...n.skillManifests?{skillManifests:g(n.skillManifests)}:{},...n.pluginManifests?{pluginManifests:g(n.pluginManifests)}:{},...n.mcpManifests?{mcpManifests:g(n.mcpManifests)}:{},...n.approvalPolicy?{approvalPolicy:{...n.approvalPolicy}}:{},...n.workspaceSummaries?{workspaceSummaries:P(n.workspaceSummaries)}:{}}}function Pe(e){return L(e.map(t=>t.name.split(".")[0]??"").filter(Boolean))}function Te(e){return L(e.map(t=>t.id))}function he(e){let{previous:t,current:n}=e;if(!t)return{...f(n),syncMode:"full"};if(t.snapshotVersion===n.snapshotVersion)return null;let r=b.filter(s=>JSON.stringify(t[s])!==JSON.stringify(n[s]));if(r.length===b.length)return{...f(n),syncMode:"full"};let i={snapshotVersion:n.snapshotVersion,updatedAt:n.updatedAt,syncMode:"diff",baseSnapshotVersion:t.snapshotVersion,changedSections:r,toolNamespaces:[...n.toolNamespaces],workspaceIds:[...n.workspaceIds]},p=i;for(let s of r){let o=n[s];if(o!==void 0)switch(s){case"toolNamespaces":case"workspaceIds":case"installedCapabilities":case"enabledCapabilities":case"features":p[s]=Ee(o);break;case"approvalPolicy":p[s]={...o};break;case"workspaceSummaries":p[s]=P(o);break;case"toolManifests":case"skillManifests":case"pluginManifests":case"mcpManifests":p[s]=g(o);break;default:p[s]=o;break}}return i}var _e=["web_search","web_fetch","deep_research","browser_execution"],ke=["web-intelligence","browser-execution"],Ce=["discovery","read-url","multi-source-research","interactive-browser"],xe=["stateless","render-backend","interactive-session"],Me=["stateless","stateless-single-step","stateful-session-required"],we=["required","conditional","none"],ve=["browser-read","browser-authenticated-read","browser-state-changing"];var Oe=["read-page","read-authenticated-page","fill-form","submit-form","download-file","reuse-session"],Ne=["web_search","web_fetch","deep_research","blocked"],De=["requires-interaction","requires-login-state","requires-rendered-dom","requires-persistent-session","requires-state-changing-action"],He=["none","same-capability-once","degrade-only"];var Le=["prefetch","sync_turn","on_pre_compress","on_session_end","on_delegation","on_memory_write"],Ue=["turn","sidechain","compress","session-end","agent-remember","auto-extract","implicit-extract","profile-extraction","dream"],je=["observe-only","parent-write","deny"];var Ke=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 j(e){return{...e,artifacts:e.artifacts.map(t=>({...t}))}}function Fe(e){return{...e,assetIds:[...e.assetIds]}}function K(){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 V(e,t){return e.profiles[t]}function Ve(e,t){let n=V(e,t);return n?n.assetIds.map(r=>F(e,r)).filter(r=>!!r):[]}function We(e,t){return e.assets[t.id]=j(t),W(e)}function T(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 W(e){let t=T(e.assets[a.gatewayImage]),n=T(e.assets[a.whisperModelTiny]);return{...e,gateway:t,whisperModel:n}}function U(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 qe(e){let t=e&&typeof e=="object"?e:{},n={},r=t.assets&&typeof t.assets=="object"?t.assets:{};for(let[o,d]of Object.entries(r)){if(!d||typeof d!="object")continue;let u=d;!u.id||!Array.isArray(u.artifacts)||(n[o]=j(u))}if(!n[a.gatewayImage]&&t.gateway&&typeof t.gateway=="object"){let o=U(t.gateway,{id:a.gatewayImage,title:"XiaoZhiClaw Gateway Image (Desktop Slim)",kind:"container-image",delivery:"remote",platform:"any",description:"Desktop Docker mode gateway image."});o&&(n[o.id]=o)}if(!n[a.whisperModelTiny]&&t.whisperModel&&typeof t.whisperModel=="object"){let o=U(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."});o&&(n[o.id]=o)}let p={...K()},s=t.profiles&&typeof t.profiles=="object"?t.profiles:{};for(let[o,d]of Object.entries(s)){if(!d||typeof d!="object")continue;let u=d;!u.id||!Array.isArray(u.assetIds)||(p[o]=Fe(u))}return W({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:n,profiles:p})}var Be=["pending","captured","failed","restored"],Ye=["file","directory","missing"],Ge=["metadata-only","workspace-copy","shadow-git"];var ze=["api-key","oauth","token","aws-sdk"],Xe=["rate_limit","auth","server_error","timeout","network","unknown"],$e=["requiresOpenAiAnthropicToolPayload"];function Je(e,t){return!e||typeof e!="object"||Array.isArray(e)?!1:e[t]===!0}var q="openai-codex";function R(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 B(e){let t=R(e);return t==="volcengine-plan"?"volcengine":t==="qwen-coding"?"qwen":t==="byteplus-plan"?"byteplus":t}var Qe=B,Ze={anthropicToolSchemaMode:"native",anthropicToolChoiceMode:"native",providerFamily:"default",preserveAnthropicThinkingSignatures:!0,openAiCompatTurnValidation:!0,providerThoughtSignatureSanitization:!1,transcriptToolCallIdMode:"default",transcriptToolCallIdModelHints:[],providerThoughtSignatureModelHints:[],dropThinkingBlockModelHints:[]},et={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"},[q]:{providerFamily:"openai"},openrouter:{openAiCompatTurnValidation:!1,providerThoughtSignatureSanitization:!0,providerThoughtSignatureModelHints:["gemini"]},opencode:{openAiCompatTurnValidation:!1,providerThoughtSignatureSanitization:!0,providerThoughtSignatureModelHints:["gemini"]},kilocode:{providerThoughtSignatureSanitization:!0,providerThoughtSignatureModelHints:["gemini"]}};function h(e,t){let n=(e??"").toLowerCase();return!!n&&t.some(r=>n.includes(r))}function c(e){let t=R(e??"");return{...Ze,...et[t]}}function tt(e){return c(e).preserveAnthropicThinkingSignatures}function nt(e){let t=c(e);return t.anthropicToolSchemaMode!=="native"||t.anthropicToolChoiceMode!=="native"}function rt(e){return c(e).anthropicToolSchemaMode==="openai-functions"}function ot(e){return c(e).anthropicToolChoiceMode==="openai-string-modes"}function it(e){return c(e).openAiCompatTurnValidation}function st(e){return c(e).providerFamily==="openai"}function at(e){return c(e).providerFamily==="anthropic"}function dt(e){return h(e.modelId,c(e.provider).dropThinkingBlockModelHints)}function pt(e){let t=c(e.provider);return t.providerThoughtSignatureSanitization&&h(e.modelId,t.providerThoughtSignatureModelHints)}function ct(e,t){let n=c(e),r=n.transcriptToolCallIdMode;if(r==="strict9")return r;if(h(t,n.transcriptToolCallIdModelHints))return"strict9"}var _={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 lt(){return[...new Set(Object.values(_).flat())]}function ut(e){let t=R(e.provider),n=e.env??process.env,r=new Set(e.appliedEnvKeys??[]),i=o=>{let d=n[o]?.trim();if(!d)return null;let u=r.has(o)?`shell env: ${o}`:`env: ${o}`;return{apiKey:d,source:u}},p=e.resolveSpecialApiKey?.(t,n,r);if(p)return p;let s=_[t];if(!s||s.length===0)return null;for(let o of s){let d=i(o);if(d)return d}return null}export{ye as ACP_EXTENDED_METHODS,Ae as ACP_EXTENDED_SESSION_UPDATE_TYPES,fe as ACP_METHODS,me as ACP_PROTOCOL_VERSION,O as ACP_SESSION_UPDATE_TYPES,z as AGENT_RPC_APPROVAL_METHODS,l as AGENT_RPC_ERROR_CODES,G as AGENT_RPC_PROTOCOL_VERSION,E as AGENT_TEAM_WS_EVENT_NAMES,I as AGENT_WS_EVENT_NAMES,v as ALL_AGENT_WS_EVENT_NAMES,b as CAPABILITY_MANIFEST_DIFF_SECTIONS,ne as GATEWAY_RPC_METHODS,S as GatewayRpcContract,Le as MEMORY_OBSERVATION_HOOK_VALUES,Ue as MEMORY_OBSERVATION_SOURCE_VALUES,je as MEMORY_WRITE_ACCESS_VALUES,Ge as MUTATION_CHECKPOINT_BACKEND_VALUES,Ye as MUTATION_CHECKPOINT_ENTRY_KIND_VALUES,Be as MUTATION_CHECKPOINT_PHASE_VALUES,Y as PETDEX_ANIMATION_IDS,ze as PROVIDER_RUNTIME_AUTH_MODE_VALUES,$e as PROVIDER_RUNTIME_COMPAT_FLAG_VALUES,_ as PROVIDER_RUNTIME_ENV_API_KEY_CANDIDATES,q as PROVIDER_RUNTIME_OPENAI_CODEX_PROVIDER_ID,Xe as PROVIDER_RUNTIME_VAULT_ERROR_TYPE_VALUES,Ke as RESOURCE_MANIFEST_SCHEMA_VERSION,a as RUNTIME_ASSET_IDS,y as RUNTIME_PROFILE_IDS,Oe as WEB_ACTION_SCOPE_VALUES,we as WEB_APPROVAL_DEFAULT_VALUES,ke as WEB_CAPABILITY_FAMILY_VALUES,_e as WEB_CAPABILITY_ID_VALUES,Ne as WEB_DEGRADATION_TARGET_VALUES,De as WEB_ESCALATION_REASON_VALUES,xe as WEB_EXECUTION_MODE_VALUES,ve as WEB_POLICY_RISK_CLASS_VALUES,He as WEB_RETRY_POLICY_VALUES,Me as WEB_STATEFULNESS_VALUES,Ce as WEB_TASK_MODE_VALUES,te as buildAgentRpcMeta,A as classifyGatewayRpcMethod,f as cloneCapabilityManifestSnapshot,he as createCapabilityManifestDiffPayload,K as createDefaultRuntimeResourceProfiles,Pe as deriveCapabilityToolNamespaces,Te as deriveCapabilityWorkspaceIds,T as getManifestShortcutEntry,F as getRuntimeResourceAsset,V as getRuntimeResourceProfile,Ve as getRuntimeResourceProfileAssets,D as isAcpJsonRpcNotification,N as isAcpJsonRpcRequest,H as isAcpJsonRpcResponse,x as isAgentRpcNotification,k as isAgentRpcRequest,C as isAgentRpcResponse,at as isAnthropicProviderRuntimeFamily,Ie as isExtendedSessionUpdateType,st as isOpenAiProviderRuntimeFamily,Se as isStandardSessionUpdateType,lt as listProviderRuntimeEnvApiKeyNames,be as mergeCapabilityManifestSnapshot,R as normalizeProviderRuntimeId,B as normalizeProviderRuntimeIdForAuth,qe as normalizeRuntimeResourceManifest,Re as parseAcpMessage,X as parseAgentRpcMessage,tt as preservesProviderRuntimeAnthropicThinkingSignatures,Je as readProviderRuntimeCompatFlag,w as requireGatewayRpcMeta,M as requiresIdempotencyKey,nt as requiresOpenAiCompatibleAnthropicToolPayloadForProviderRuntime,c as resolveProviderRuntimeCapabilities,ut as resolveProviderRuntimeEnvApiKey,Qe as resolveProviderRuntimeKeyFamily,ct as resolveProviderRuntimeTranscriptToolCallIdMode,dt as shouldDropThinkingBlocksForProviderRuntimeModel,pt as shouldSanitizeProviderRuntimeThoughtSignaturesForModel,it as supportsOpenAiCompatTurnValidationForProviderRuntime,We as upsertRuntimeResourceAsset,rt as usesOpenAiFunctionAnthropicToolSchemaForProviderRuntime,ot as usesOpenAiStringModeAnthropicToolChoiceForProviderRuntime};
|
|
1
|
+
var G=["idle","running-right","running-left","waving","jumping","failed","waiting","running","review"];var Y="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","media.listModels","media.status","pet.status","agent.health","agent.metrics"],Q=new Set(["memory.dream","memory.propose","memory.consolidate","media.stt","pet.forge","pet.asset.import","solo.start","solo.evaluate","product.plan","product.create","product.message"]),Z=["memory.","pet.","usage."],ee=new Set(["memory.atlas","memory.activity","memory.list","memory.read","memory.search","memory.attachment.locate","memory.attachment.adopt","pet.status"]);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 v(e){return ee.has(e)||A(e).mutability==="read"?!1:Z.some(t=>e.startsWith(t))}function te(e,t={}){let n=t.now??Date.now(),r=A(e),o=t.timeoutMs??r.defaultTimeoutMs;return{requestId:t.requestId??$(),createdAt:n,deadlineAt:n+o,channel:t.channel??r.channel,idempotencyKey:t.idempotencyKey,traceId:t.traceId}}function M(e,t=Date.now()){let n=e.meta;if(!n||typeof n!="object")return{ok:!1,error:{code:l.INVALID_REQUEST,message:"RPC request meta is required."}};if(typeof n.requestId!="string"||n.requestId.length===0)return{ok:!1,error:{code:l.INVALID_REQUEST,message:"RPC request meta.requestId is required."}};if(n.channel!=="query"&&n.channel!=="task")return{ok:!1,error:{code:l.INVALID_REQUEST,message:"RPC request meta.channel must be query or task."}};if(typeof n.createdAt!="number"||!Number.isFinite(n.createdAt))return{ok:!1,error:{code:l.INVALID_REQUEST,message:"RPC request meta.createdAt is required."}};if(typeof n.deadlineAt!="number"||!Number.isFinite(n.deadlineAt))return{ok:!1,error:{code:l.INVALID_REQUEST,message:"RPC request meta.deadlineAt is required."}};if(n.deadlineAt<=t)return{ok:!1,error:{code:l.REQUEST_DEADLINE_EXCEEDED,message:"RPC request deadline has already expired."}};let r=A(e.method).channel;return n.channel!==r?{ok:!1,error:{code:l.INVALID_REQUEST,message:`RPC request channel mismatch: expected ${r}, got ${n.channel}.`}}:v(e.method)&&(typeof n.idempotencyKey!="string"||n.idempotencyKey.length===0)?{ok:!1,error:{code:l.REQUEST_IDEMPOTENCY_REQUIRED,message:`RPC method ${e.method} requires meta.idempotencyKey.`}}:{ok:!0,meta:n}}var R=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,n){let r=M({method:t,meta:n},this.now());if(!r.ok)return this.counters.invalidRequests+=1,{status:"rejected",error:r.error};if(n.idempotencyKey){let o=this.idempotency.get(n.idempotencyKey);if(o)return this.counters.dedupedRequests+=1,o.error?{status:"deduped",error:o.error}:{status:"deduped",result:o.result}}return this.active.set(n.requestId,{method:t,meta:n,cancelled:!1,startedAt:this.now()}),{status:"started"}}cancel(t,n="cancelled"){let r=this.active.get(t);return!r||r.cancelled?!1:(r.cancelled=!0,r.cancelReason=n,this.counters.cancelledRequests+=1,!0)}expire(t){return this.active.get(t)?(this.active.delete(t),this.counters.deadlineExceededRequests+=1,!0):!1}settle(t,n,r){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:n,error:r,settledAt:this.now()}),{accepted:!0})):{accepted:!1,reason:"unknown"}}metrics(){return{activeRequests:this.active.size,...this.counters}}};var ne=["agent.health","agent.metrics","agent.cancel","provider.catalog","provider.list","provider.get","provider.install","provider.update","provider.uninstall","provider.enable","provider.disable","provider.diagnose","provider.auth.status","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 I=["turn.start","turn.delta","turn.end","turn.error","turn.recovery","turn.file_changes","turn.tool_call","turn.tool_result","turn.tool_blocked","turn.reasoning_delta","turn.approval_request","turn.skill_instruction","turn.ask_user","turn.media_result","turn.media_progress","turn.media_usage","turn.media_capability_check","turn.plan_update","turn.suggestions","turn.sidechain_started","turn.subagent_started","turn.subagent_delta","turn.subagent_ended","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","memory.updated","skills.updated","turn.memory_recall","turn.memory_written","pet.soul_ready","pet.reaction","pet.growth","pet.state","pet.confirm","pet.asset.updated","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","product.taskStarted","product.taskOutput","product.members","product.agentActivity","product.taskCompleted","product.taskFailed","product.budgetUpdate","product.budgetWarning","product.checkpointed","product.completed","product.dagTopology","plan.interrupted","product.planReady","product.planningDelta","product.leaderMessage","product.planFailed","product.planningAsk","goal.run_state_changed","goal.phase_boundary","goal.goal_edited","goal.message_queued","goal.acceptance_updated","goal.round_message","mention.delegate_started","mention.delegate_activity","mention.delegate_settled"],re=[...I,...b],w=re;import{createHash as kt}from"node:crypto";import{resolve as Ct}from"node:path";var m={request:"x/delegate",update:"x/delegate.update",respond:"x/delegate.respond",cancel:"x/delegate.cancel"},ie=["search","addText","embedText","ingestExtracted","proposeExtracted","consumePendingProposals","feedback","findRelatedEvents","synthesizeTimeline","getActivitySummary","getAllProfiles","setProfile","getAtlas","setMemoryArchived","triggerDecay","resolveConflicts"],oe=["initialize","getIndex","addToIndex","replaceInIndex","removeFromIndex","createFile","writeFile","readFile","deleteFile","listFiles","searchLocal"],se=["getSkillSnapshot","readSkillFile","recordSkillInvocation","commitSkillMutation","applyCuratorPlan","prepareSkillInstall","finalizeSkillInstall"],ae=["loadForResume","appendTranscript","updateTitle","saveState","saveTaskSummary","groupSplit"],de=["commitTurnTelemetry","listDistillableFeedback","markFeedbackDistilled","runUploadSweep"],pe=["getSnapshot","create","switch","update"],Lt=1024*1024,ce=["list","get","diagnose"],le=["navigate","snapshot","click","type","screenshot","console","network"];var ue=["open","recordEvent","checkpoint","get","list","delete","getCheckpoint","listCheckpoints","restoreCheckpoint"],ge=["isActive","getSoul","awardXp","journeyCatchUp"],me=["getTunables","updateTunable","clearTunable","appendDirectoryAllowRule"];var jt=new Set(ie),Ut=new Set(oe),Kt=new Set(me),Ft=new Set(se),Vt=new Set(ae),Wt=new Set(de),qt=new Set(pe),Bt=new Set(ue),Gt=new Set(ge),Yt=new Set(ce),zt=new Set(le);var fe=1,ye={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"},Ae={ABORT:"x/abort",DREAM:"x/dream",SOLO_START:"x/solo.start",SOLO_STATUS:"x/solo.status",SOLO_SELECT:"x/solo.select",SOLO_CANCEL:"x/solo.cancel",PRODUCT_CREATE:"x/product.create",PRODUCT_PLAN:"x/product.plan",PRODUCT_CONFIRM:"x/product.confirm",PRODUCT_MESSAGE:"x/product.message",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",PRODUCT_STATUS:"x/product.status",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",PRODUCT_SUBSCRIBE:"x/product.subscribe",GOAL_START:"x/goal.start",GOAL_STATUS:"x/goal.status",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_SUBSCRIBE:"x/goal.subscribe",GOAL_EVENTS:"x/goal.events",DELEGATE:m.request,DELEGATE_UPDATE:m.update,DELEGATE_RESPOND:m.respond,DELEGATE_CANCEL:m.cancel},O={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"},Se={X_SKILL_INSTRUCTION:"x_skill_instruction",X_SESSION_INFO:"x_session_info",X_RELAY:"x_relay"};function N(e){if(!e||typeof e!="object")return!1;let t=e;return t.jsonrpc==="2.0"&&typeof t.method=="string"&&"id"in t}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"&&"id"in t&&!("method"in t)}function Re(e){let t;try{t=JSON.parse(e)}catch{return null}return H(t)||N(t)||D(t)?t:null}function Ie(e){return Object.values(O).includes(e)}function be(e){return e.startsWith("x_")}var P=["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 Pe(e){return e?[...e]:void 0}function L(e){return[...new Set(e.map(t=>t.trim()).filter(Boolean))].sort((t,n)=>t.localeCompare(n))}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 Ee(e){let{previous:t,update:n}=e;return!(n.syncMode==="diff"&&t&&(!n.baseSnapshotVersion||t.snapshotVersion===n.baseSnapshotVersion))||!t?f(n):{...f(t),snapshotVersion:n.snapshotVersion,updatedAt:n.updatedAt,...n.gatewayVersion!==void 0?{gatewayVersion:n.gatewayVersion}:{},...n.syncMode?{syncMode:n.syncMode}:{},...n.baseSnapshotVersion?{baseSnapshotVersion:n.baseSnapshotVersion}:{},...n.changedSections?{changedSections:[...n.changedSections]}:{},...n.toolNamespaces?{toolNamespaces:[...n.toolNamespaces]}:{},...n.workspaceIds?{workspaceIds:[...n.workspaceIds]}:{},...n.installedCapabilities?{installedCapabilities:[...n.installedCapabilities]}:{},...n.enabledCapabilities?{enabledCapabilities:[...n.enabledCapabilities]}:{},...n.features?{features:[...n.features]}:{},...n.approvalMode?{approvalMode:n.approvalMode}:{},...n.toolManifests?{toolManifests:g(n.toolManifests)}:{},...n.skillManifests?{skillManifests:g(n.skillManifests)}:{},...n.pluginManifests?{pluginManifests:g(n.pluginManifests)}:{},...n.mcpManifests?{mcpManifests:g(n.mcpManifests)}:{},...n.approvalPolicy?{approvalPolicy:{...n.approvalPolicy}}:{},...n.workspaceSummaries?{workspaceSummaries:E(n.workspaceSummaries)}:{}}}function he(e){return L(e.map(t=>t.name.split(".")[0]??"").filter(Boolean))}function Te(e){return L(e.map(t=>t.id))}function ke(e){let{previous:t,current:n}=e;if(!t)return{...f(n),syncMode:"full"};if(t.snapshotVersion===n.snapshotVersion)return null;let r=P.filter(s=>JSON.stringify(t[s])!==JSON.stringify(n[s]));if(r.length===P.length)return{...f(n),syncMode:"full"};let o={snapshotVersion:n.snapshotVersion,updatedAt:n.updatedAt,syncMode:"diff",baseSnapshotVersion:t.snapshotVersion,changedSections:r,toolNamespaces:[...n.toolNamespaces],workspaceIds:[...n.workspaceIds]},p=o;for(let s of r){let i=n[s];if(i!==void 0)switch(s){case"toolNamespaces":case"workspaceIds":case"installedCapabilities":case"enabledCapabilities":case"features":p[s]=Pe(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 _e=["web_search","web_fetch","deep_research","browser_execution"],Ce=["web-intelligence","browser-execution"],xe=["discovery","read-url","multi-source-research","interactive-browser"],ve=["stateless","render-backend","interactive-session"],Me=["stateless","stateless-single-step","stateful-session-required"],we=["required","conditional","none"],Oe=["browser-read","browser-authenticated-read","browser-state-changing"];var Ne=["read-page","read-authenticated-page","fill-form","submit-form","download-file","reuse-session"],De=["web_search","web_fetch","deep_research","blocked"],He=["requires-interaction","requires-login-state","requires-rendered-dom","requires-persistent-session","requires-state-changing-action"],Le=["none","same-capability-once","degrade-only"];var je=["prefetch","sync_turn","on_pre_compress","on_session_end","on_delegation","on_memory_write"],Ue=["turn","sidechain","compress","session-end","agent-remember","auto-extract","implicit-extract","profile-extraction","dream"],Ke=["observe-only","parent-write","deny"];var Fe=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 U(e){return{...e,artifacts:e.artifacts.map(t=>({...t}))}}function Ve(e){return{...e,assetIds:[...e.assetIds]}}function K(){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 V(e,t){return e.profiles[t]}function We(e,t){let n=V(e,t);return n?n.assetIds.map(r=>F(e,r)).filter(r=>!!r):[]}function qe(e,t){return e.assets[t.id]=U(t),W(e)}function h(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 W(e){let t=h(e.assets[a.gatewayImage]),n=h(e.assets[a.whisperModelTiny]);return{...e,gateway:t,whisperModel:n}}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 Be(e){let t=e&&typeof e=="object"?e:{},n={},r=t.assets&&typeof t.assets=="object"?t.assets:{};for(let[i,d]of Object.entries(r)){if(!d||typeof d!="object")continue;let u=d;!u.id||!Array.isArray(u.artifacts)||(n[i]=U(u))}if(!n[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&&(n[i.id]=i)}if(!n[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&&(n[i.id]=i)}let p={...K()},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]=Ve(u))}return W({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:n,profiles:p})}var Ge=["pending","captured","failed","restored"],Ye=["file","directory","missing"],ze=["metadata-only","workspace-copy","shadow-git"];var Xe=["api-key","oauth","token","aws-sdk"],$e=["rate_limit","auth","server_error","timeout","network","unknown"],Je=["requiresOpenAiAnthropicToolPayload"];function Qe(e,t){return!e||typeof e!="object"||Array.isArray(e)?!1:e[t]===!0}var q="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 B(e){let t=S(e);return t==="volcengine-plan"?"volcengine":t==="qwen-coding"?"qwen":t==="byteplus-plan"?"byteplus":t}var Ze=B,et={anthropicToolSchemaMode:"native",anthropicToolChoiceMode:"native",providerFamily:"default",preserveAnthropicThinkingSignatures:!0,openAiCompatTurnValidation:!0,providerThoughtSignatureSanitization:!1,transcriptToolCallIdMode:"default",transcriptToolCallIdModelHints:[],providerThoughtSignatureModelHints:[],dropThinkingBlockModelHints:[]},tt={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"},[q]:{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 n=(e??"").toLowerCase();return!!n&&t.some(r=>n.includes(r))}function c(e){let t=S(e??"");return{...et,...tt[t]}}function nt(e){return c(e).preserveAnthropicThinkingSignatures}function rt(e){let t=c(e);return t.anthropicToolSchemaMode!=="native"||t.anthropicToolChoiceMode!=="native"}function it(e){return c(e).anthropicToolSchemaMode==="openai-functions"}function ot(e){return c(e).anthropicToolChoiceMode==="openai-string-modes"}function st(e){return c(e).openAiCompatTurnValidation}function at(e){return c(e).providerFamily==="openai"}function dt(e){return c(e).providerFamily==="anthropic"}function pt(e){return T(e.modelId,c(e.provider).dropThinkingBlockModelHints)}function ct(e){let t=c(e.provider);return t.providerThoughtSignatureSanitization&&T(e.modelId,t.providerThoughtSignatureModelHints)}function lt(e,t){let n=c(e),r=n.transcriptToolCallIdMode;if(r==="strict9")return r;if(T(t,n.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 ut(){return[...new Set(Object.values(k).flat())]}function gt(e){let t=S(e.provider),n=e.env??process.env,r=new Set(e.appliedEnvKeys??[]),o=i=>{let d=n[i]?.trim();if(!d)return null;let u=r.has(i)?`shell env: ${i}`:`env: ${i}`;return{apiKey:d,source:u}},p=e.resolveSpecialApiKey?.(t,n,r);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{Ae as ACP_EXTENDED_METHODS,Se as ACP_EXTENDED_SESSION_UPDATE_TYPES,ye as ACP_METHODS,fe as ACP_PROTOCOL_VERSION,O as ACP_SESSION_UPDATE_TYPES,z as AGENT_RPC_APPROVAL_METHODS,l as AGENT_RPC_ERROR_CODES,Y as AGENT_RPC_PROTOCOL_VERSION,b as AGENT_TEAM_WS_EVENT_NAMES,I as AGENT_WS_EVENT_NAMES,w as ALL_AGENT_WS_EVENT_NAMES,P as CAPABILITY_MANIFEST_DIFF_SECTIONS,ne as GATEWAY_RPC_METHODS,R as GatewayRpcContract,je as MEMORY_OBSERVATION_HOOK_VALUES,Ue as MEMORY_OBSERVATION_SOURCE_VALUES,Ke as MEMORY_WRITE_ACCESS_VALUES,ze as MUTATION_CHECKPOINT_BACKEND_VALUES,Ye as MUTATION_CHECKPOINT_ENTRY_KIND_VALUES,Ge as MUTATION_CHECKPOINT_PHASE_VALUES,G as PETDEX_ANIMATION_IDS,Xe as PROVIDER_RUNTIME_AUTH_MODE_VALUES,Je as PROVIDER_RUNTIME_COMPAT_FLAG_VALUES,k as PROVIDER_RUNTIME_ENV_API_KEY_CANDIDATES,q as PROVIDER_RUNTIME_OPENAI_CODEX_PROVIDER_ID,$e as PROVIDER_RUNTIME_VAULT_ERROR_TYPE_VALUES,Fe as RESOURCE_MANIFEST_SCHEMA_VERSION,a as RUNTIME_ASSET_IDS,y as RUNTIME_PROFILE_IDS,Ne as WEB_ACTION_SCOPE_VALUES,we as WEB_APPROVAL_DEFAULT_VALUES,Ce as WEB_CAPABILITY_FAMILY_VALUES,_e as WEB_CAPABILITY_ID_VALUES,De as WEB_DEGRADATION_TARGET_VALUES,He as WEB_ESCALATION_REASON_VALUES,ve as WEB_EXECUTION_MODE_VALUES,Oe as WEB_POLICY_RISK_CLASS_VALUES,Le as WEB_RETRY_POLICY_VALUES,Me as WEB_STATEFULNESS_VALUES,xe as WEB_TASK_MODE_VALUES,te as buildAgentRpcMeta,A as classifyGatewayRpcMethod,f as cloneCapabilityManifestSnapshot,ke as createCapabilityManifestDiffPayload,K as createDefaultRuntimeResourceProfiles,he as deriveCapabilityToolNamespaces,Te as deriveCapabilityWorkspaceIds,h as getManifestShortcutEntry,F as getRuntimeResourceAsset,V as getRuntimeResourceProfile,We as getRuntimeResourceProfileAssets,D as isAcpJsonRpcNotification,N as isAcpJsonRpcRequest,H as isAcpJsonRpcResponse,x as isAgentRpcNotification,_ as isAgentRpcRequest,C as isAgentRpcResponse,dt as isAnthropicProviderRuntimeFamily,be as isExtendedSessionUpdateType,at as isOpenAiProviderRuntimeFamily,Ie as isStandardSessionUpdateType,ut as listProviderRuntimeEnvApiKeyNames,Ee as mergeCapabilityManifestSnapshot,S as normalizeProviderRuntimeId,B as normalizeProviderRuntimeIdForAuth,Be as normalizeRuntimeResourceManifest,Re as parseAcpMessage,X as parseAgentRpcMessage,nt as preservesProviderRuntimeAnthropicThinkingSignatures,Qe as readProviderRuntimeCompatFlag,M as requireGatewayRpcMeta,v as requiresIdempotencyKey,rt as requiresOpenAiCompatibleAnthropicToolPayloadForProviderRuntime,c as resolveProviderRuntimeCapabilities,gt as resolveProviderRuntimeEnvApiKey,Ze as resolveProviderRuntimeKeyFamily,lt as resolveProviderRuntimeTranscriptToolCallIdMode,pt as shouldDropThinkingBlocksForProviderRuntimeModel,ct as shouldSanitizeProviderRuntimeThoughtSignaturesForModel,st as supportsOpenAiCompatTurnValidationForProviderRuntime,qe as upsertRuntimeResourceAsset,it as usesOpenAiFunctionAnthropicToolSchemaForProviderRuntime,ot as usesOpenAiStringModeAnthropicToolChoiceForProviderRuntime};
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* `buildAvailableCommands` (the list advertised via `available_commands_update` and summarized by
|
|
5
5
|
* `/help`) and `dispatchSlashCommand` (execution) share one source of truth — `BUILTIN_COMMANDS`.
|
|
6
6
|
* Each command's `dispatch` calls the same underlying data service the equivalent RPC handler uses
|
|
7
|
-
* (model-registry / tool-catalog / skills-query / project-store /
|
|
7
|
+
* (model-registry / tool-catalog / skills-query / project-store / Host Provider directory / memory store) and
|
|
8
8
|
* formats the result as a text reply. No half-wiring: a command is only listed if it can run.
|
|
9
9
|
*
|
|
10
10
|
* Command-set decision (per plan): 9 direct commands + `/init` (degraded to a prompt, no automatic
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SoloSpecChatResult, SoloSpecJudgeResult, WorkflowChatResult } from "../protocol/wire/acp-agent-management.js";
|
|
2
|
-
import {
|
|
2
|
+
import type { DelegateBridge } from "../orchestration/delegate-bridge.js";
|
|
3
3
|
import { type DreamHandlerHost } from "./handlers/dream-handler.js";
|
|
4
4
|
import { type ProductCoordinatorHost } from "./handlers/product-handler.js";
|
|
5
5
|
import { type SoloHandlerHost } from "./handlers/solo-handler.js";
|
|
@@ -13,7 +13,7 @@ export interface AcpExtendedHost extends DreamHandlerHost, SoloHandlerHost, Prod
|
|
|
13
13
|
/**
|
|
14
14
|
* 激活层(S3c):gateway-routed delegate 传输桥(可选;缺省/undefined = 旧 ProductOrchestrator 委派路径)。
|
|
15
15
|
* 懒读 AcpServer.delegate/supportsDelegate(server 在 initialize 后才 init,故 getter 而非常量);
|
|
16
|
-
*
|
|
16
|
+
* Gateway 未声明 delegate 能力位时 bridge.isSupported()=false; orchestration stations fail loud.
|
|
17
17
|
*/
|
|
18
18
|
getDelegateBridge?(): DelegateBridge | undefined;
|
|
19
19
|
resolveClientForPurpose(purpose: "textGeneration"): {
|
|
@@ -63,7 +63,6 @@ export declare function handleAcpSoloSpecJudge(host: AcpExtendedHost, params: Re
|
|
|
63
63
|
* 应用由前端经既有 workflow.create/patch 完成(触发 WS 回流画布),故本轮不碰引擎控制器。
|
|
64
64
|
*/
|
|
65
65
|
export declare function handleAcpWorkflowChat(host: AcpExtendedHost, params: Record<string, unknown>): Promise<WorkflowChatResult>;
|
|
66
|
-
export declare function handleAcpAgentsList(host: AcpExtendedHost): Promise<unknown>;
|
|
67
66
|
/**
|
|
68
67
|
* x/workflow.matchIntent(spec D22 语义兜底)— 确定性短语在客户端已查过且未命中,且存在
|
|
69
68
|
* semantic:true 的活跃意图工作流时才会被调用:对候选集做**一次**轻量 LLM 分类(单发,非 agent
|
|
@@ -84,11 +83,6 @@ export declare function handleAcpProductReplay(host: AcpExtendedHost, params: Re
|
|
|
84
83
|
/** Test-only reset. */
|
|
85
84
|
export declare function __resetGoalHandler(): void;
|
|
86
85
|
export declare function handleAcpGoalStart(host: AcpExtendedHost, params: Record<string, unknown>): Promise<unknown>;
|
|
87
|
-
/** Test-only reset. */
|
|
88
|
-
export declare function __resetMentionCoordinator(): void;
|
|
89
|
-
export declare function handleAcpMentionDelegate(host: AcpExtendedHost, params: Record<string, unknown>): Promise<unknown>;
|
|
90
|
-
export declare function handleAcpMentionCancel(host: AcpExtendedHost, params: Record<string, unknown>): Promise<unknown>;
|
|
91
|
-
export declare function handleAcpMentionList(host: AcpExtendedHost, params: Record<string, unknown>): Promise<unknown>;
|
|
92
86
|
export declare function handleAcpGoalStatus(host: AcpExtendedHost, params: Record<string, unknown>): Promise<unknown>;
|
|
93
87
|
export declare function handleAcpGoalPause(host: AcpExtendedHost, params: Record<string, unknown>): Promise<unknown>;
|
|
94
88
|
export declare function handleAcpGoalResume(host: AcpExtendedHost, params: Record<string, unknown>): Promise<unknown>;
|
|
@@ -2,15 +2,6 @@ import type { AgentRpcError } from "../protocol/wire/index.js";
|
|
|
2
2
|
import type { AcpExtendedHost } from "./acp-extended-handlers.js";
|
|
3
3
|
import type { DreamHandlerHost } from "./handlers/dream-handler.js";
|
|
4
4
|
import type { MultiAgentHandlerHost } from "./multi-agent-handler-host.js";
|
|
5
|
-
type AgentStatusExtra = {
|
|
6
|
-
missedBeats?: number;
|
|
7
|
-
lastActivityAt?: number;
|
|
8
|
-
usage?: {
|
|
9
|
-
inputTokens: number;
|
|
10
|
-
outputTokens: number;
|
|
11
|
-
totalTokens: number;
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
5
|
export interface AcpExtendedHostAdapterDeps {
|
|
15
6
|
dreamHost: DreamHandlerHost;
|
|
16
7
|
multiAgentHost: MultiAgentHandlerHost;
|
|
@@ -20,7 +11,6 @@ export interface AcpExtendedHostAdapterDeps {
|
|
|
20
11
|
resolveAgent: DreamHandlerHost["resolveAgent"];
|
|
21
12
|
sendNotification(method: string, params: Record<string, unknown>): void;
|
|
22
13
|
sendResponse(id: string | number, result?: unknown, error?: AgentRpcError): void;
|
|
23
|
-
emitAgentStatus(agentId: string, state: string, extra?: AgentStatusExtra): void;
|
|
24
14
|
handleMcpToolCall(memberId: string, toolName: string, args: Record<string, unknown>): Promise<unknown>;
|
|
25
15
|
resolveClientForPurpose: AcpExtendedHost["resolveClientForPurpose"];
|
|
26
16
|
pendingAskUser: AcpExtendedHost["pendingAskUser"];
|
|
@@ -28,4 +18,3 @@ export interface AcpExtendedHostAdapterDeps {
|
|
|
28
18
|
getDelegateBridge?: AcpExtendedHost["getDelegateBridge"];
|
|
29
19
|
}
|
|
30
20
|
export declare function createAcpExtendedHostAdapter(deps: AcpExtendedHostAdapterDeps): AcpExtendedHost;
|
|
31
|
-
export {};
|
|
@@ -4,6 +4,7 @@ import { createMemoryPrefetchState } from "../runtime/hooks/memory-hooks.js";
|
|
|
4
4
|
import type { SessionState } from "../runtime/session/session-state.js";
|
|
5
5
|
import type { SessionHistoryCoordinator } from "./session-history-coordinator.js";
|
|
6
6
|
import type { HostCapabilityClient } from "../transport/host-capability-client.js";
|
|
7
|
+
import type { HostAgentProviderDirectory } from "../runtime/infra/host-agent-provider-directory.js";
|
|
7
8
|
/**
|
|
8
9
|
* LLM config pinned on the session by the host (session/set_config_option /
|
|
9
10
|
* session/set_model / the /model command). This is host-supplied INPUT — distinct
|
|
@@ -58,6 +59,7 @@ export interface AcpSessionHost {
|
|
|
58
59
|
ensureModelRegistryHydrated?(): Promise<void>;
|
|
59
60
|
getActiveProjectRoot(): string;
|
|
60
61
|
getHostCapabilityClient?(): HostCapabilityClient | undefined;
|
|
62
|
+
getHostAgentProviderDirectory?(): HostAgentProviderDirectory | undefined;
|
|
61
63
|
log(message: string): void;
|
|
62
64
|
sendNotification(method: string, params: Record<string, unknown>): void;
|
|
63
65
|
setActiveWorkdir(dir: string): void;
|
|
@@ -20,15 +20,6 @@ export interface CliCoreToolHostDeps {
|
|
|
20
20
|
isGroupContext(): boolean;
|
|
21
21
|
getMemoryIndex(): string | null;
|
|
22
22
|
sendNotification(method: string, params: Record<string, unknown>): void;
|
|
23
|
-
emitAgentStatus(agentId: string, state: string, extra?: {
|
|
24
|
-
missedBeats?: number;
|
|
25
|
-
lastActivityAt?: number;
|
|
26
|
-
usage?: {
|
|
27
|
-
inputTokens: number;
|
|
28
|
-
outputTokens: number;
|
|
29
|
-
totalTokens: number;
|
|
30
|
-
};
|
|
31
|
-
}): void;
|
|
32
23
|
handleMcpToolCall(memberId: string, toolName: string, args: Record<string, unknown>): Promise<unknown>;
|
|
33
24
|
getHostProfileClient?(): HostProfileClient | undefined;
|
|
34
25
|
getHostCapabilityClient?(): HostCapabilityClient | undefined;
|
|
@@ -6,37 +6,7 @@ export interface DefaultProjectBootstrapDeps {
|
|
|
6
6
|
sendNotification<M extends keyof NotificationMethodMap>(method: M, params: NotificationMethodMap[M]): void;
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* (T17-class bug: sync fs on Node's single thread blocks RPC dispatch until it finishes — here
|
|
12
|
-
* `gcOrphanProjectData`'s work is unbounded in the count of project dirs ever created on the box).
|
|
13
|
-
* Mirrors the AcpDetector.scanAsync precedent: move the blocking work off the hot path (here via one
|
|
14
|
-
* deferral to a later event-loop turn — not per-iteration setImmediate slicing). None of this is
|
|
15
|
-
* needed before session.list/session.prompt can be served —
|
|
16
|
-
* the default project already exists and is registered/active (that stays synchronous below), the
|
|
17
|
-
* seeded builtin skills only enrich the lazy progressive-disclosure catalog, and GC only reclaims
|
|
18
|
-
* orphaned companion dirs (never live data).
|
|
9
|
+
* Bind compute state to the active Host project. The Gateway must already have
|
|
10
|
+
* hydrated the Project snapshot; qlogicagent never creates or repairs projects.
|
|
19
11
|
*/
|
|
20
|
-
interface DeferredHeavyWork {
|
|
21
|
-
/** A default project was freshly created this run → its starter templates still need seeding. */
|
|
22
|
-
freshDefaultDir?: string;
|
|
23
|
-
hostOwned?: boolean;
|
|
24
|
-
}
|
|
25
|
-
/** Resolves once the most recently scheduled deferred heavy work has settled (never rejects). */
|
|
26
|
-
export declare function getDefaultProjectHeavyWorkPromise(): Promise<void>;
|
|
27
12
|
export declare function ensureDefaultProjectBootstrap(deps: DefaultProjectBootstrapDeps): Promise<ProjectMemoryStore>;
|
|
28
|
-
/**
|
|
29
|
-
* Schedule (fire-and-forget) the deferred heavy work so it runs off the synchronous initialize path.
|
|
30
|
-
* Exposed for tests; production calls it from ensureDefaultProjectBootstrap. Records a gate promise on
|
|
31
|
-
* `heavyWorkPromise` so a caller that must wait can, without any synchronous blocking of startup.
|
|
32
|
-
*
|
|
33
|
-
* Uses a single `setImmediate` — NOT setImmediate *slicing*: the entire block is deferred once to a
|
|
34
|
-
* later event-loop turn (the check phase after the next poll phase), so a `session.list` that was
|
|
35
|
-
* already queued on stdin is read and dispatched BEFORE this synchronous-fs block runs. A microtask
|
|
36
|
-
* would drain before returning to the poll phase and so would not let session.list through first.
|
|
37
|
-
* The block still starts with bounded synchronous fs (builtin-skill seed + template copy), so the
|
|
38
|
-
* macrotask boundary is what lets the queued session.list run before it; the unbounded orphan GC
|
|
39
|
-
* inside is itself async and yields between directories.
|
|
40
|
-
*/
|
|
41
|
-
export declare function scheduleDefaultProjectHeavyWork(heavy: DeferredHeavyWork): void;
|
|
42
|
-
export {};
|
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
*/
|
|
13
13
|
import { SessionState } from "../../runtime/session/session-state.js";
|
|
14
14
|
import { createMemoryPrefetchState } from "../../runtime/hooks/memory-hooks.js";
|
|
15
|
-
import { type NativeSessionEntry } from "../../runtime/session/native/native-session-source.js";
|
|
16
15
|
import { type AgentRpcError, type AgentRpcErrorCode, type AgentRpcRequest } from "../../protocol/wire/index.js";
|
|
17
16
|
import type { SessionHistoryCoordinator } from "../session-history-coordinator.js";
|
|
18
17
|
export interface SessionHandlerHost {
|
|
@@ -33,49 +32,7 @@ export declare function handleThreadCreate(this: SessionHandlerHost, msg: AgentR
|
|
|
33
32
|
export declare function handleThreadList(this: SessionHandlerHost, msg: AgentRpcRequest): Promise<void>;
|
|
34
33
|
export declare function handleSessionCreate(this: SessionHandlerHost, msg: AgentRpcRequest): Promise<void>;
|
|
35
34
|
export declare function handleSessionResolve(this: SessionHandlerHost, msg: AgentRpcRequest): Promise<void>;
|
|
36
|
-
/**
|
|
37
|
-
* Resolve an agentId's sessionHistory capability ("native-cwd" vs "own") for session.list routing.
|
|
38
|
-
*
|
|
39
|
-
* Mirrors the hard invariant already encoded in {@link assembleBackendDescriptor} (acp-detector.ts):
|
|
40
|
-
* only codex/claude are adapted for native CWD-scoped session discovery — every other agentId,
|
|
41
|
-
* including undefined/missing (the default for all existing callers), custom agents, and unknown
|
|
42
|
-
* ids, resolves to "own". This is intentionally NOT a live/async descriptor lookup (that would
|
|
43
|
-
* require an AcpDetector scan — CLI probing — on the session.list hot path); it keys off the static
|
|
44
|
-
* ACP_BACKENDS registry so the two places can never drift on WHICH ids are native-adapted, without
|
|
45
|
-
* paying scan cost. Cut 1 does not distinguish installed vs not-installed codex/claude here (unlike
|
|
46
|
-
* assembleBackendDescriptor's not_installed branch) because resolveSessionSource's "no registered
|
|
47
|
-
* adapter" fallback already yields [] for native-cwd either way — the distinction has no observable
|
|
48
|
-
* effect until Cut 2 lands a real adapter.
|
|
49
|
-
*/
|
|
50
|
-
export declare function resolveAgentSessionHistory(agentId?: string): "native-cwd" | "own";
|
|
51
|
-
/**
|
|
52
|
-
* Select the session source for session.list: "own" (default, includes missing/unknown agentId)
|
|
53
|
-
* returns the caller's already-assembled own entries UNCHANGED (same reference — zero-regression
|
|
54
|
-
* contract for every existing caller, none of which pass agentId today); "native-cwd" routes to a
|
|
55
|
-
* registered {@link NativeSessionSource} for that agentId, or an empty list when none is registered
|
|
56
|
-
* yet (Cut 1: always, until Cut 2 lands codex/claude adapters) or cwd is unavailable.
|
|
57
|
-
*/
|
|
58
|
-
export declare function resolveSessionSource<T>(args: {
|
|
59
|
-
agentId?: string;
|
|
60
|
-
capability?: "native-cwd" | "own";
|
|
61
|
-
cwd?: string;
|
|
62
|
-
limit?: number;
|
|
63
|
-
ownEntries: T[];
|
|
64
|
-
}): Promise<T[] | NativeSessionEntry[]>;
|
|
65
35
|
export declare function handleSessionList(this: SessionHandlerHost, msg: AgentRpcRequest): Promise<void>;
|
|
66
|
-
/**
|
|
67
|
-
* Loads the full transcript of a single native (third-party-agent-owned) session, identified by
|
|
68
|
-
* the opaque `nativeRef` a prior session.list call returned in a `source: "native"` entry. Read-only
|
|
69
|
-
* and idempotent — the frontend calls this when a user opens a native session in the UI.
|
|
70
|
-
*
|
|
71
|
-
* Unlike handleSessionList (which falls back to [] on ANY unresolvable state — missing capability,
|
|
72
|
-
* missing cwd, no registered adapter), missing/unregistered here has exactly one meaning (no adapter
|
|
73
|
-
* registered for that agentId, or no nativeRef was sent at all) and resolves the same way: an empty
|
|
74
|
-
* transcript, NOT an error. Only an actual adapter failure (loadTranscript rejecting) is an error —
|
|
75
|
-
* that distinction matters because "no adapter yet" is an expected state during rollout (e.g. Cut 2
|
|
76
|
-
* ships claude only; codex nativeRefs would still 404-equivalent to [] until Cut 3), not a bug.
|
|
77
|
-
*/
|
|
78
|
-
export declare function handleSessionLoadNativeTranscript(this: SessionHandlerHost, msg: AgentRpcRequest): Promise<void>;
|
|
79
36
|
export declare function handleSessionGet(this: SessionHandlerHost, msg: AgentRpcRequest): Promise<void>;
|
|
80
37
|
export declare function handleSessionGetMessages(this: SessionHandlerHost, msg: AgentRpcRequest): Promise<void>;
|
|
81
38
|
export declare function handleSessionUpdate(this: SessionHandlerHost, msg: AgentRpcRequest): Promise<void>;
|
|
@@ -3,27 +3,16 @@
|
|
|
3
3
|
* Handles: solo.start, solo.status, solo.cancel, solo.select,
|
|
4
4
|
* solo.list, solo.delete, solo.message, solo.evaluate
|
|
5
5
|
*/
|
|
6
|
-
import type {
|
|
7
|
-
import type { AgentConfigStore } from "../../runtime/infra/agent-config-store.js";
|
|
6
|
+
import type { HostAgentProviderDirectory } from "../../runtime/infra/host-agent-provider-directory.js";
|
|
8
7
|
import { SoloEvaluator } from "../../orchestration/solo-evaluator.js";
|
|
9
|
-
import type { DelegateBridge } from "../../orchestration/
|
|
8
|
+
import type { DelegateBridge } from "../../orchestration/delegate-bridge.js";
|
|
10
9
|
import { type AgentRpcError, type AgentRpcRequest } from "../../protocol/wire/index.js";
|
|
11
10
|
export declare const soloProjectMap: Map<string, string>;
|
|
12
11
|
export interface SoloHandlerHost {
|
|
13
12
|
soloEvaluator: SoloEvaluator | null;
|
|
14
|
-
|
|
15
|
-
agentConfigStore: AgentConfigStore | null;
|
|
13
|
+
providerDirectory: HostAgentProviderDirectory;
|
|
16
14
|
sendNotification(method: string, params: Record<string, unknown>): void;
|
|
17
15
|
sendResponse(id: string | number, result?: unknown, error?: AgentRpcError): void;
|
|
18
|
-
emitAgentStatus(agentId: string, state: string, extra?: {
|
|
19
|
-
missedBeats?: number;
|
|
20
|
-
lastActivityAt?: number;
|
|
21
|
-
usage?: {
|
|
22
|
-
inputTokens: number;
|
|
23
|
-
outputTokens: number;
|
|
24
|
-
totalTokens: number;
|
|
25
|
-
};
|
|
26
|
-
}): void;
|
|
27
16
|
handleMcpToolCall(memberId: string, toolName: string, args: Record<string, unknown>): Promise<unknown>;
|
|
28
17
|
/** 激活层(S3c §1.5):gateway-routed delegate 桥(懒读;未挂/gate 关 = undefined → 旧本地 spawn 路径)。 */
|
|
29
18
|
getDelegateBridge?(): DelegateBridge | undefined;
|
|
@@ -1,23 +1,11 @@
|
|
|
1
1
|
import type { AgentRpcError } from "../protocol/wire/index.js";
|
|
2
|
-
import type {
|
|
3
|
-
import type { AgentsHandlerHost } from "./handlers/agents-handler.js";
|
|
2
|
+
import type { HostProviderRequestParams } from "../host-contract/index.js";
|
|
4
3
|
import type { ProductHandlerHost } from "./handlers/product-handler.js";
|
|
5
4
|
import type { SoloHandlerHost } from "./handlers/solo-handler.js";
|
|
6
|
-
type
|
|
7
|
-
missedBeats?: number;
|
|
8
|
-
lastActivityAt?: number;
|
|
9
|
-
usage?: {
|
|
10
|
-
inputTokens: number;
|
|
11
|
-
outputTokens: number;
|
|
12
|
-
totalTokens: number;
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
export type MultiAgentHandlerHost = AgentsHandlerHost & SoloHandlerHost & ProductHandlerHost;
|
|
5
|
+
export type MultiAgentHandlerHost = SoloHandlerHost & ProductHandlerHost;
|
|
16
6
|
export interface MultiAgentHandlerHostDeps {
|
|
17
|
-
|
|
18
|
-
createAgentConfigRuntime?: (deps: AgentConfigRuntimeDeps) => AgentConfigRuntime;
|
|
7
|
+
requestProvider(params: HostProviderRequestParams): Promise<unknown>;
|
|
19
8
|
getActiveProjectRoot(): string;
|
|
20
|
-
emitAgentStatus(agentId: string, state: string, extra?: AgentStatusExtra): void;
|
|
21
9
|
handleMcpToolCall(memberId: string, toolName: string, args: Record<string, unknown>): Promise<unknown>;
|
|
22
10
|
log(message: string): void;
|
|
23
11
|
sendNotification(method: string, params: Record<string, unknown>): void;
|
|
@@ -26,4 +14,3 @@ export interface MultiAgentHandlerHostDeps {
|
|
|
26
14
|
getDelegateBridge?: ProductHandlerHost["getDelegateBridge"];
|
|
27
15
|
}
|
|
28
16
|
export declare function createMultiAgentHandlerHost(deps: MultiAgentHandlerHostDeps): MultiAgentHandlerHost;
|
|
29
|
-
export {};
|
|
@@ -1,22 +1,11 @@
|
|
|
1
1
|
import { ProductOrchestrator } from "../orchestration/agent-instance.js";
|
|
2
2
|
import { ProductPlanner } from "../orchestration/product-planner.js";
|
|
3
|
-
import type { DelegateBridge } from "../orchestration/
|
|
4
|
-
import type {
|
|
5
|
-
import type { AcpDetector } from "../runtime/infra/acp-detector.js";
|
|
3
|
+
import type { DelegateBridge } from "../orchestration/delegate-bridge.js";
|
|
4
|
+
import type { HostAgentProviderDirectory } from "../runtime/infra/host-agent-provider-directory.js";
|
|
6
5
|
export interface ProductCoordinatorHost {
|
|
7
|
-
|
|
8
|
-
agentConfigStore: AgentConfigStore | null;
|
|
6
|
+
providerDirectory: HostAgentProviderDirectory;
|
|
9
7
|
productOrchestrator: ProductOrchestrator | null;
|
|
10
8
|
productPlanner: ProductPlanner | null;
|
|
11
|
-
emitAgentStatus(agentId: string, state: string, extra?: {
|
|
12
|
-
missedBeats?: number;
|
|
13
|
-
lastActivityAt?: number;
|
|
14
|
-
usage?: {
|
|
15
|
-
inputTokens: number;
|
|
16
|
-
outputTokens: number;
|
|
17
|
-
totalTokens: number;
|
|
18
|
-
};
|
|
19
|
-
}): void;
|
|
20
9
|
handleMcpToolCall(memberId: string, tool: string, args: Record<string, unknown>): Promise<unknown>;
|
|
21
10
|
sendNotification(method: string, params: Record<string, unknown>): void;
|
|
22
11
|
/** 激活层(S3c):gateway-routed delegate 桥(gate 关/未挂 = undefined → 旧本地 spawn 路径)。 */
|
|
@@ -5,7 +5,6 @@ import { type ControlHandlerHost } from "./handlers/control-handler.js";
|
|
|
5
5
|
import { type FilesHandlerHost } from "./handlers/files-handler.js";
|
|
6
6
|
import { type MediaHandlerHost } from "./handlers/media-handler.js";
|
|
7
7
|
import { type MemoryHandlerHost } from "./handlers/memory-handler.js";
|
|
8
|
-
import { type ProjectHandlerHost } from "./handlers/project-handler.js";
|
|
9
8
|
import { type SessionHandlerHost } from "./handlers/session-handler.js";
|
|
10
9
|
import { type SkillsHandlerHost } from "./handlers/skills-handler.js";
|
|
11
10
|
import { type TurnBaselineHandlerHost } from "./handlers/turn-baseline-handler.js";
|
|
@@ -50,7 +49,6 @@ export interface RpcHandlerHosts {
|
|
|
50
49
|
files: FilesHandlerHost;
|
|
51
50
|
media: MediaHandlerHost;
|
|
52
51
|
skills: SkillsHandlerHost;
|
|
53
|
-
project: ProjectHandlerHost;
|
|
54
52
|
community: CommunityHandlerHost;
|
|
55
53
|
dream: DreamHandlerHost;
|
|
56
54
|
turn: TurnControlHandlerHost;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import type { LLMRequest } from "../agent/types.js";
|
|
2
2
|
import type { ModelPurpose } from "../runtime/infra/model-registry.js";
|
|
3
3
|
import type { RpcHandlerHosts } from "./rpc-registry.js";
|
|
4
|
-
type DirectStdioRpcHost = RpcHandlerHosts["config"] & RpcHandlerHosts["control"] & RpcHandlerHosts["files"] & RpcHandlerHosts["skills"] & RpcHandlerHosts["
|
|
4
|
+
type DirectStdioRpcHost = RpcHandlerHosts["config"] & RpcHandlerHosts["control"] & RpcHandlerHosts["files"] & RpcHandlerHosts["skills"] & RpcHandlerHosts["community"] & {
|
|
5
5
|
currentTurnId?: string;
|
|
6
6
|
/** Mid-turn guidance queue (运行中引导) — shared between handleTurnGuide and the tool loop's drain. */
|
|
7
7
|
pendingTurnGuidance?: string[];
|
|
8
|
+
memdir: RpcHandlerHosts["memory"]["memdir"];
|
|
9
|
+
projectMemoryStoreFactory: RpcHandlerHosts["memory"]["projectMemoryStoreFactory"];
|
|
10
|
+
setActiveWorkdir(dir: string): void;
|
|
8
11
|
getActiveProjectRoot(): string;
|
|
9
12
|
readonly multiAgentHandlerHost: RpcHandlerHosts["multiAgent"];
|
|
10
13
|
};
|
|
@@ -122,6 +122,7 @@ export declare class StdioServer {
|
|
|
122
122
|
getHostProfileClient(): HostProfileClient | undefined;
|
|
123
123
|
/** Thin read-only facade; consumers fail loudly when the host did not advertise capability. */
|
|
124
124
|
getHostCapabilityClient(): HostCapabilityClient | undefined;
|
|
125
|
+
getHostAgentProviderDirectory(): import("../runtime/infra/host-agent-provider-directory.js").HostAgentProviderDirectory;
|
|
125
126
|
/** Session durable-state facade; absent under gate-off/standalone so compatibility stays inert. */
|
|
126
127
|
getHostSessionClient(): HostSessionClient | undefined;
|
|
127
128
|
/** D2 telemetry/feedback business facade; durable storage remains gateway-only. */
|
|
@@ -223,8 +224,6 @@ export declare class StdioServer {
|
|
|
223
224
|
ensureTaskDistillation(): TaskDistillationCoordinator;
|
|
224
225
|
resolveAgent(config: TurnConfig): Agent | null;
|
|
225
226
|
private invalidateResolvedLlmCache;
|
|
226
|
-
/** Emit an `agents.status` notification when a child process state changes. */
|
|
227
|
-
private emitAgentStatus;
|
|
228
227
|
createDreamHandlerHost(): import("./handlers/dream-handler.js").DreamHandlerHost;
|
|
229
228
|
private createAcpExtendedHandlerHost;
|
|
230
229
|
/**
|