qlogicagent 2.10.32 → 2.10.33
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/cli.js +238 -238
- package/dist/index.js +229 -229
- package/dist/protocol.js +1 -1
- package/dist/types/cli/handlers/workflow-handler.events.test.d.ts +1 -0
- package/dist/types/protocol/wire/agent-events.d.ts +2 -2
- package/dist/types/protocol/wire/index.d.ts +1 -1
- package/dist/types/protocol/wire/notification-payloads.d.ts +38 -0
- package/dist/types/runtime/pet/pet-reaction-service.d.ts +1 -1
- package/dist/types/runtime/pet/pet-reaction-service.test.d.ts +1 -0
- package/dist/types/runtime/pet/pet-soul-service.d.ts +1 -0
- package/package.json +1 -1
package/dist/protocol.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var q="1.0.0",d={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},Y={REQUEST:"tool.approval.request",RESPONSE:"tool.approval.response"};function b(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 I(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)||b(t)||I(t)?t:null}import{randomUUID as H}from"node:crypto";var G=["settings.list","settings.get","settings.validate","provider.list","config.get","config.tunables","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"],z=new Set(["thread.turn","memory.dream","memory.propose","memory.consolidate","media.stt","pet.forge","solo.start","solo.evaluate","product.plan","product.create","product.message"]),J=["memory.","pet.","usage."],Q=new Set(["memory.atlas","memory.activity","memory.list","memory.read","memory.search","pet.status"]);function f(e){return z.has(e)?{channel:"task",mutability:"write",defaultTimeoutMs:e==="thread.turn"?3e5:12e4}:G.some(t=>e===t||e.startsWith(`${t}.`)||e.startsWith(t))?{channel:"query",mutability:"read",defaultTimeoutMs:1e4}:{channel:"task",mutability:"write",defaultTimeoutMs:3e4}}function h(e){return Q.has(e)||f(e).mutability==="read"?!1:J.some(t=>e.startsWith(t))}function $(e,t={}){let r=t.now??Date.now(),o=f(e),i=t.timeoutMs??o.defaultTimeoutMs;return{requestId:t.requestId??H(),createdAt:r,deadlineAt:r+i,channel:t.channel??o.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:d.INVALID_REQUEST,message:"RPC request meta is required."}};if(typeof r.requestId!="string"||r.requestId.length===0)return{ok:!1,error:{code:d.INVALID_REQUEST,message:"RPC request meta.requestId is required."}};if(r.channel!=="query"&&r.channel!=="task")return{ok:!1,error:{code:d.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:d.INVALID_REQUEST,message:"RPC request meta.createdAt is required."}};if(typeof r.deadlineAt!="number"||!Number.isFinite(r.deadlineAt))return{ok:!1,error:{code:d.INVALID_REQUEST,message:"RPC request meta.deadlineAt is required."}};if(r.deadlineAt<=t)return{ok:!1,error:{code:d.REQUEST_DEADLINE_EXCEEDED,message:"RPC request deadline has already expired."}};let o=f(e.method).channel;return r.channel!==o?{ok:!1,error:{code:d.INVALID_REQUEST,message:`RPC request channel mismatch: expected ${o}, got ${r.channel}.`}}:h(e.method)&&(typeof r.idempotencyKey!="string"||r.idempotencyKey.length===0)?{ok:!1,error:{code:d.REQUEST_IDEMPOTENCY_REQUIRED,message:`RPC method ${e.method} requires meta.idempotencyKey.`}}:{ok:!0,meta:r}}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,r){let o=v({method:t,meta:r},this.now());if(!o.ok)return this.counters.invalidRequests+=1,{status:"rejected",error:o.error};if(r.idempotencyKey){let i=this.idempotency.get(r.idempotencyKey);if(i)return this.counters.dedupedRequests+=1,i.error?{status:"deduped",error:i.error}:{status:"deduped",result:i.result}}return this.active.set(r.requestId,{method:t,meta:r,cancelled:!1,startedAt:this.now()}),{status:"started"}}cancel(t,r="cancelled"){let o=this.active.get(t);return!o||o.cancelled?!1:(o.cancelled=!0,o.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,o){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:r,error:o,settledAt:this.now()}),{accepted:!0})):{accepted:!1,reason:"unknown"}}metrics(){return{activeRequests:this.active.size,...this.counters}}};var Z=["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.archiveByGroup","project.purgeAll","instructions.list","instructions.read","instructions.write","instructions.delete","files.list","files.read","files.create","files.rename","files.delete","files.gitStatus","skills.list","memory.list-files","memory.atlas","memory.activity","memory.observe","memory.propose","memory.consolidate","memory.update"];var M=["turn.start","turn.delta","turn.end","turn.error","turn.recovery","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.plan_update","turn.suggestions","turn.sidechain_started","turn.subagent_delta","turn.sidechain_completed","turn.task_updated","turn.todos_updated","turn.exec_progress","turn.usage_update","team.member.notification","session.info","memory.updated","skills.updated","pet.soul_ready","pet.reaction","pet.growth","pet.state","pet.confirm","pet.forged","system.activity"],k=["solo.progress","solo.agentDelta","solo.agentUsage","solo.agentDiff","solo.evaluation","product.taskStarted","product.taskOutput","product.taskCompleted","product.taskFailed","product.budgetUpdate","product.checkpointed","product.dagTopology","plan.interrupted"],ee=[...M,...k];var te=1,re={INITIALIZE:"initialize",SESSION_NEW:"session/new",SESSION_PROMPT:"session/prompt",SESSION_END:"session/end",SESSION_SET_CONFIG:"session/set_config_option",SESSION_SET_MODEL:"session/set_model",SESSION_SET_MODE:"session/set_mode",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"},oe={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_STATUS:"x/product.status",SOLO_SUBSCRIBE:"x/solo.subscribe",SOLO_MESSAGE:"x/solo.message",SOLO_EVALUATE:"x/solo.evaluate",PRODUCT_SUBSCRIBE:"x/product.subscribe",TEAM_DELEGATE:"x/team.delegate"},x={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"},ne={X_SUBAGENT_STARTED:"x_subagent_started",X_SUBAGENT_DELTA:"x_subagent_delta",X_SUBAGENT_ENDED:"x_subagent_ended",X_MEDIA_RESULT:"x_media_result",X_MEDIA_PROGRESS:"x_media_progress",X_SKILL_INSTRUCTION:"x_skill_instruction",X_RECOVERY:"x_recovery",X_SIDECHAIN_STARTED:"x_sidechain_started",X_SIDECHAIN_COMPLETED:"x_sidechain_completed",X_SUGGESTIONS:"x_suggestions",X_ASK_USER:"x_ask_user",X_SESSION_INFO:"x_session_info",X_MEMORY_UPDATED:"x_memory_updated",X_TEAM_MEMBER_UPDATE:"x_team_member_update",X_SOLO_STARTED:"x_solo_started",X_SOLO_AGENT_FINISHED:"x_solo_agent_finished",X_SOLO_SELECTED:"x_solo_selected",X_PRODUCT_TASK_STARTED:"x_product_task_started",X_PRODUCT_TASK_COMPLETED:"x_product_task_completed",X_PRODUCT_CHECKPOINT:"x_product_checkpoint"};function O(e){if(!e||typeof e!="object")return!1;let t=e;return t.jsonrpc==="2.0"&&typeof t.method=="string"&&"id"in t}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"&&"id"in t&&!("method"in t)}function ie(e){let t;try{t=JSON.parse(e)}catch{return null}return D(t)||O(t)||N(t)?t:null}function se(e){return Object.values(x).includes(e)}function ae(e){return e.startsWith("x_")}var E=["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){return e?e.map(t=>({...t})):void 0}function pe(e){return e?[...e]:void 0}function w(e){return[...new Set(e.map(t=>t.trim()).filter(Boolean))].sort((t,r)=>t.localeCompare(r))}function m(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.workspaceSummaries)}:{}}}function ce(e){let{previous:t,update:r}=e;return!(r.syncMode==="diff"&&t&&(!r.baseSnapshotVersion||t.snapshotVersion===r.baseSnapshotVersion))||!t?m(r):{...m(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:_(r.workspaceSummaries)}:{}}}function le(e){return w(e.map(t=>t.name.split(".")[0]??"").filter(Boolean))}function de(e){return w(e.map(t=>t.id))}function ue(e){let{previous:t,current:r}=e;if(!t)return{...m(r),syncMode:"full"};if(t.snapshotVersion===r.snapshotVersion)return null;let o=E.filter(s=>JSON.stringify(t[s])!==JSON.stringify(r[s]));if(o.length===E.length)return{...m(r),syncMode:"full"};let i={snapshotVersion:r.snapshotVersion,updatedAt:r.updatedAt,syncMode:"diff",baseSnapshotVersion:t.snapshotVersion,changedSections:o,toolNamespaces:[...r.toolNamespaces],workspaceIds:[...r.workspaceIds]},c=i;for(let s of o){let n=r[s];if(n!==void 0)switch(s){case"toolNamespaces":case"workspaceIds":case"installedCapabilities":case"enabledCapabilities":case"features":c[s]=pe(n);break;case"approvalPolicy":c[s]={...n};break;case"workspaceSummaries":c[s]=_(n);break;case"toolManifests":case"skillManifests":case"pluginManifests":case"mcpManifests":c[s]=g(n);break;default:c[s]=n;break}}return i}var ge=["web_search","web_fetch","deep_research","browser_execution"],me=["web-intelligence","browser-execution"],ye=["discovery","read-url","multi-source-research","interactive-browser"],fe=["stateless","render-backend","interactive-session"],Ae=["stateless","stateless-single-step","stateful-session-required"],Re=["required","conditional","none"],Ee=["browser-read","browser-authenticated-read","browser-state-changing"],_e=["read-page","read-authenticated-page","fill-form","submit-form","download-file","reuse-session"],Se=["web_search","web_fetch","deep_research","blocked"],Te=["requires-interaction","requires-login-state","requires-rendered-dom","requires-persistent-session","requires-state-changing-action"],Pe=["none","same-capability-once","degrade-only"];var be=["prefetch","sync_turn","on_pre_compress","on_session_end","on_delegation","on_memory_write"],Ce=["turn","sidechain","compress","session-end","agent-remember","auto-extract","implicit-extract","profile-extraction","dream"],Ie=["observe-only","parent-write","deny"];var he=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 L(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 W(e,t){return e.assets[t]}function V(e,t){return e.profiles[t]}function Me(e,t){let r=V(e,t);return r?r.assetIds.map(o=>W(e,o)).filter(o=>!!o):[]}function ke(e,t){return e.assets[t.id]=L(t),F(e)}function S(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 F(e){let t=S(e.assets[a.gatewayImage]),r=S(e.assets[a.whisperModelTiny]);return{...e,gateway:t,whisperModel:r}}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 xe(e){let t=e&&typeof e=="object"?e:{},r={},o=t.assets&&typeof t.assets=="object"?t.assets:{};for(let[n,p]of Object.entries(o)){if(!p||typeof p!="object")continue;let u=p;!u.id||!Array.isArray(u.artifacts)||(r[n]=L(u))}if(!r[a.gatewayImage]&&t.gateway&&typeof t.gateway=="object"){let n=U(t.gateway,{id:a.gatewayImage,title:"OpenClaw Gateway Image (Desktop Slim)",kind:"container-image",delivery:"remote",platform:"any",description:"Desktop Docker mode gateway image."});n&&(r[n.id]=n)}if(!r[a.whisperModelTiny]&&t.whisperModel&&typeof t.whisperModel=="object"){let n=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."});n&&(r[n.id]=n)}let c={...K()},s=t.profiles&&typeof t.profiles=="object"?t.profiles:{};for(let[n,p]of Object.entries(s)){if(!p||typeof p!="object")continue;let u=p;!u.id||!Array.isArray(u.assetIds)||(c[n]=ve(u))}return F({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:c})}var Oe=["pending","captured","failed","restored"],Ne=["file","directory","missing"],De=["metadata-only","workspace-copy","shadow-git"];var we=["api-key","oauth","token","aws-sdk"],Ue=["rate_limit","auth","server_error","timeout","network","unknown"],Le=["requiresOpenAiAnthropicToolPayload"];function Ke(e,t){return!e||typeof e!="object"||Array.isArray(e)?!1:e[t]===!0}var j="openai-codex";function A(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=A(e);return t==="volcengine-plan"?"volcengine":t==="byteplus-plan"?"byteplus":t}var We=B,Ve={anthropicToolSchemaMode:"native",anthropicToolChoiceMode:"native",providerFamily:"default",preserveAnthropicThinkingSignatures:!0,openAiCompatTurnValidation:!0,providerThoughtSignatureSanitization:!1,transcriptToolCallIdMode:"default",transcriptToolCallIdModelHints:[],providerThoughtSignatureModelHints:[],dropThinkingBlockModelHints:[]},Fe={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"},[j]:{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(o=>r.includes(o))}function l(e){let t=A(e??"");return{...Ve,...Fe[t]}}function je(e){return l(e).preserveAnthropicThinkingSignatures}function Be(e){let t=l(e);return t.anthropicToolSchemaMode!=="native"||t.anthropicToolChoiceMode!=="native"}function qe(e){return l(e).anthropicToolSchemaMode==="openai-functions"}function Ye(e){return l(e).anthropicToolChoiceMode==="openai-string-modes"}function Xe(e){return l(e).openAiCompatTurnValidation}function He(e){return l(e).providerFamily==="openai"}function Ge(e){return l(e).providerFamily==="anthropic"}function ze(e){return T(e.modelId,l(e.provider).dropThinkingBlockModelHints)}function Je(e){let t=l(e.provider);return t.providerThoughtSignatureSanitization&&T(e.modelId,t.providerThoughtSignatureModelHints)}function Qe(e,t){let r=l(e),o=r.transcriptToolCallIdMode;if(o==="strict9")return o;if(T(t,r.transcriptToolCallIdModelHints))return"strict9"}var P={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"],volcengine:["VOLCANO_ENGINE_API_KEY"],"volcengine-plan":["VOLCANO_ENGINE_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 $e(){return[...new Set(Object.values(P).flat())]}function Ze(e){let t=A(e.provider),r=e.env??process.env,o=new Set(e.appliedEnvKeys??[]),i=n=>{let p=r[n]?.trim();if(!p)return null;let u=o.has(n)?`shell env: ${n}`:`env: ${n}`;return{apiKey:p,source:u}},c=e.resolveSpecialApiKey?.(t,r,o);if(c)return c;let s=P[t];if(!s||s.length===0)return null;for(let n of s){let p=i(n);if(p)return p}return null}export{oe as ACP_EXTENDED_METHODS,ne as ACP_EXTENDED_SESSION_UPDATE_TYPES,re as ACP_METHODS,te as ACP_PROTOCOL_VERSION,x as ACP_SESSION_UPDATE_TYPES,Y as AGENT_RPC_APPROVAL_METHODS,d as AGENT_RPC_ERROR_CODES,q as AGENT_RPC_PROTOCOL_VERSION,k as AGENT_TEAM_WS_EVENT_NAMES,M as AGENT_WS_EVENT_NAMES,ee as ALL_AGENT_WS_EVENT_NAMES,E as CAPABILITY_MANIFEST_DIFF_SECTIONS,Z as GATEWAY_RPC_METHODS,R as GatewayRpcContract,be as MEMORY_OBSERVATION_HOOK_VALUES,Ce as MEMORY_OBSERVATION_SOURCE_VALUES,Ie as MEMORY_WRITE_ACCESS_VALUES,De as MUTATION_CHECKPOINT_BACKEND_VALUES,Ne as MUTATION_CHECKPOINT_ENTRY_KIND_VALUES,Oe as MUTATION_CHECKPOINT_PHASE_VALUES,we as PROVIDER_RUNTIME_AUTH_MODE_VALUES,Le as PROVIDER_RUNTIME_COMPAT_FLAG_VALUES,P as PROVIDER_RUNTIME_ENV_API_KEY_CANDIDATES,j as PROVIDER_RUNTIME_OPENAI_CODEX_PROVIDER_ID,Ue as PROVIDER_RUNTIME_VAULT_ERROR_TYPE_VALUES,he as RESOURCE_MANIFEST_SCHEMA_VERSION,a as RUNTIME_ASSET_IDS,y as RUNTIME_PROFILE_IDS,_e as WEB_ACTION_SCOPE_VALUES,Re as WEB_APPROVAL_DEFAULT_VALUES,me as WEB_CAPABILITY_FAMILY_VALUES,ge as WEB_CAPABILITY_ID_VALUES,Se as WEB_DEGRADATION_TARGET_VALUES,Te as WEB_ESCALATION_REASON_VALUES,fe as WEB_EXECUTION_MODE_VALUES,Ee as WEB_POLICY_RISK_CLASS_VALUES,Pe as WEB_RETRY_POLICY_VALUES,Ae as WEB_STATEFULNESS_VALUES,ye as WEB_TASK_MODE_VALUES,$ as buildAgentRpcMeta,f as classifyGatewayRpcMethod,m as cloneCapabilityManifestSnapshot,ue as createCapabilityManifestDiffPayload,K as createDefaultRuntimeResourceProfiles,le as deriveCapabilityToolNamespaces,de as deriveCapabilityWorkspaceIds,S as getManifestShortcutEntry,W as getRuntimeResourceAsset,V as getRuntimeResourceProfile,Me as getRuntimeResourceProfileAssets,N as isAcpJsonRpcNotification,O as isAcpJsonRpcRequest,D as isAcpJsonRpcResponse,I as isAgentRpcNotification,b as isAgentRpcRequest,C as isAgentRpcResponse,Ge as isAnthropicProviderRuntimeFamily,ae as isExtendedSessionUpdateType,He as isOpenAiProviderRuntimeFamily,se as isStandardSessionUpdateType,$e as listProviderRuntimeEnvApiKeyNames,ce as mergeCapabilityManifestSnapshot,A as normalizeProviderRuntimeId,B as normalizeProviderRuntimeIdForAuth,xe as normalizeRuntimeResourceManifest,ie as parseAcpMessage,X as parseAgentRpcMessage,je as preservesProviderRuntimeAnthropicThinkingSignatures,Ke as readProviderRuntimeCompatFlag,v as requireGatewayRpcMeta,h as requiresIdempotencyKey,Be as requiresOpenAiCompatibleAnthropicToolPayloadForProviderRuntime,l as resolveProviderRuntimeCapabilities,Ze as resolveProviderRuntimeEnvApiKey,We as resolveProviderRuntimeKeyFamily,Qe as resolveProviderRuntimeTranscriptToolCallIdMode,ze as shouldDropThinkingBlocksForProviderRuntimeModel,Je as shouldSanitizeProviderRuntimeThoughtSignaturesForModel,Xe as supportsOpenAiCompatTurnValidationForProviderRuntime,ke as upsertRuntimeResourceAsset,qe as usesOpenAiFunctionAnthropicToolSchemaForProviderRuntime,Ye as usesOpenAiStringModeAnthropicToolChoiceForProviderRuntime};
|
|
1
|
+
var q="1.0.0",d={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},Y={REQUEST:"tool.approval.request",RESPONSE:"tool.approval.response"};function b(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 I(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)||b(t)||I(t)?t:null}import{randomUUID as H}from"node:crypto";var G=["settings.list","settings.get","settings.validate","provider.list","config.get","config.tunables","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"],z=new Set(["thread.turn","memory.dream","memory.propose","memory.consolidate","media.stt","pet.forge","solo.start","solo.evaluate","product.plan","product.create","product.message"]),J=["memory.","pet.","usage."],Q=new Set(["memory.atlas","memory.activity","memory.list","memory.read","memory.search","pet.status"]);function f(e){return z.has(e)?{channel:"task",mutability:"write",defaultTimeoutMs:e==="thread.turn"?3e5:12e4}:G.some(t=>e===t||e.startsWith(`${t}.`)||e.startsWith(t))?{channel:"query",mutability:"read",defaultTimeoutMs:1e4}:{channel:"task",mutability:"write",defaultTimeoutMs:3e4}}function h(e){return Q.has(e)||f(e).mutability==="read"?!1:J.some(t=>e.startsWith(t))}function $(e,t={}){let r=t.now??Date.now(),o=f(e),i=t.timeoutMs??o.defaultTimeoutMs;return{requestId:t.requestId??H(),createdAt:r,deadlineAt:r+i,channel:t.channel??o.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:d.INVALID_REQUEST,message:"RPC request meta is required."}};if(typeof r.requestId!="string"||r.requestId.length===0)return{ok:!1,error:{code:d.INVALID_REQUEST,message:"RPC request meta.requestId is required."}};if(r.channel!=="query"&&r.channel!=="task")return{ok:!1,error:{code:d.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:d.INVALID_REQUEST,message:"RPC request meta.createdAt is required."}};if(typeof r.deadlineAt!="number"||!Number.isFinite(r.deadlineAt))return{ok:!1,error:{code:d.INVALID_REQUEST,message:"RPC request meta.deadlineAt is required."}};if(r.deadlineAt<=t)return{ok:!1,error:{code:d.REQUEST_DEADLINE_EXCEEDED,message:"RPC request deadline has already expired."}};let o=f(e.method).channel;return r.channel!==o?{ok:!1,error:{code:d.INVALID_REQUEST,message:`RPC request channel mismatch: expected ${o}, got ${r.channel}.`}}:h(e.method)&&(typeof r.idempotencyKey!="string"||r.idempotencyKey.length===0)?{ok:!1,error:{code:d.REQUEST_IDEMPOTENCY_REQUIRED,message:`RPC method ${e.method} requires meta.idempotencyKey.`}}:{ok:!0,meta:r}}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,r){let o=v({method:t,meta:r},this.now());if(!o.ok)return this.counters.invalidRequests+=1,{status:"rejected",error:o.error};if(r.idempotencyKey){let i=this.idempotency.get(r.idempotencyKey);if(i)return this.counters.dedupedRequests+=1,i.error?{status:"deduped",error:i.error}:{status:"deduped",result:i.result}}return this.active.set(r.requestId,{method:t,meta:r,cancelled:!1,startedAt:this.now()}),{status:"started"}}cancel(t,r="cancelled"){let o=this.active.get(t);return!o||o.cancelled?!1:(o.cancelled=!0,o.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,o){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:r,error:o,settledAt:this.now()}),{accepted:!0})):{accepted:!1,reason:"unknown"}}metrics(){return{activeRequests:this.active.size,...this.counters}}};var Z=["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.archiveByGroup","project.purgeAll","instructions.list","instructions.read","instructions.write","instructions.delete","files.list","files.read","files.create","files.rename","files.delete","files.gitStatus","skills.list","memory.list-files","memory.atlas","memory.activity","memory.observe","memory.propose","memory.consolidate","memory.update"];var M=["turn.start","turn.delta","turn.end","turn.error","turn.recovery","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.plan_update","turn.suggestions","turn.sidechain_started","turn.subagent_delta","turn.sidechain_completed","turn.task_updated","turn.todos_updated","turn.exec_progress","turn.usage_update","team.member.notification","session.info","memory.updated","skills.updated","pet.soul_ready","pet.reaction","pet.growth","pet.state","pet.confirm","pet.forged","system.activity","workflow.created","workflow.updated","workflow.deleted","workflow.runStarted","workflow.runCompleted","workflow.runFailed"],k=["solo.progress","solo.agentDelta","solo.agentUsage","solo.agentDiff","solo.evaluation","product.taskStarted","product.taskOutput","product.taskCompleted","product.taskFailed","product.budgetUpdate","product.checkpointed","product.dagTopology","plan.interrupted"],ee=[...M,...k];var te=1,re={INITIALIZE:"initialize",SESSION_NEW:"session/new",SESSION_PROMPT:"session/prompt",SESSION_END:"session/end",SESSION_SET_CONFIG:"session/set_config_option",SESSION_SET_MODEL:"session/set_model",SESSION_SET_MODE:"session/set_mode",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"},oe={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_STATUS:"x/product.status",SOLO_SUBSCRIBE:"x/solo.subscribe",SOLO_MESSAGE:"x/solo.message",SOLO_EVALUATE:"x/solo.evaluate",PRODUCT_SUBSCRIBE:"x/product.subscribe",TEAM_DELEGATE:"x/team.delegate"},x={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"},ne={X_SUBAGENT_STARTED:"x_subagent_started",X_SUBAGENT_DELTA:"x_subagent_delta",X_SUBAGENT_ENDED:"x_subagent_ended",X_MEDIA_RESULT:"x_media_result",X_MEDIA_PROGRESS:"x_media_progress",X_SKILL_INSTRUCTION:"x_skill_instruction",X_RECOVERY:"x_recovery",X_SIDECHAIN_STARTED:"x_sidechain_started",X_SIDECHAIN_COMPLETED:"x_sidechain_completed",X_SUGGESTIONS:"x_suggestions",X_ASK_USER:"x_ask_user",X_SESSION_INFO:"x_session_info",X_MEMORY_UPDATED:"x_memory_updated",X_TEAM_MEMBER_UPDATE:"x_team_member_update",X_SOLO_STARTED:"x_solo_started",X_SOLO_AGENT_FINISHED:"x_solo_agent_finished",X_SOLO_SELECTED:"x_solo_selected",X_PRODUCT_TASK_STARTED:"x_product_task_started",X_PRODUCT_TASK_COMPLETED:"x_product_task_completed",X_PRODUCT_CHECKPOINT:"x_product_checkpoint"};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 O(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"&&"id"in t&&!("method"in t)}function ie(e){let t;try{t=JSON.parse(e)}catch{return null}return D(t)||N(t)||O(t)?t:null}function se(e){return Object.values(x).includes(e)}function ae(e){return e.startsWith("x_")}var E=["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){return e?e.map(t=>({...t})):void 0}function pe(e){return e?[...e]:void 0}function w(e){return[...new Set(e.map(t=>t.trim()).filter(Boolean))].sort((t,r)=>t.localeCompare(r))}function y(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.workspaceSummaries)}:{}}}function ce(e){let{previous:t,update:r}=e;return!(r.syncMode==="diff"&&t&&(!r.baseSnapshotVersion||t.snapshotVersion===r.baseSnapshotVersion))||!t?y(r):{...y(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:_(r.workspaceSummaries)}:{}}}function le(e){return w(e.map(t=>t.name.split(".")[0]??"").filter(Boolean))}function de(e){return w(e.map(t=>t.id))}function ue(e){let{previous:t,current:r}=e;if(!t)return{...y(r),syncMode:"full"};if(t.snapshotVersion===r.snapshotVersion)return null;let o=E.filter(s=>JSON.stringify(t[s])!==JSON.stringify(r[s]));if(o.length===E.length)return{...y(r),syncMode:"full"};let i={snapshotVersion:r.snapshotVersion,updatedAt:r.updatedAt,syncMode:"diff",baseSnapshotVersion:t.snapshotVersion,changedSections:o,toolNamespaces:[...r.toolNamespaces],workspaceIds:[...r.workspaceIds]},c=i;for(let s of o){let n=r[s];if(n!==void 0)switch(s){case"toolNamespaces":case"workspaceIds":case"installedCapabilities":case"enabledCapabilities":case"features":c[s]=pe(n);break;case"approvalPolicy":c[s]={...n};break;case"workspaceSummaries":c[s]=_(n);break;case"toolManifests":case"skillManifests":case"pluginManifests":case"mcpManifests":c[s]=g(n);break;default:c[s]=n;break}}return i}var ge=["web_search","web_fetch","deep_research","browser_execution"],ye=["web-intelligence","browser-execution"],me=["discovery","read-url","multi-source-research","interactive-browser"],fe=["stateless","render-backend","interactive-session"],Ae=["stateless","stateless-single-step","stateful-session-required"],Re=["required","conditional","none"],Ee=["browser-read","browser-authenticated-read","browser-state-changing"],_e=["read-page","read-authenticated-page","fill-form","submit-form","download-file","reuse-session"],Se=["web_search","web_fetch","deep_research","blocked"],Te=["requires-interaction","requires-login-state","requires-rendered-dom","requires-persistent-session","requires-state-changing-action"],Pe=["none","same-capability-once","degrade-only"];var be=["prefetch","sync_turn","on_pre_compress","on_session_end","on_delegation","on_memory_write"],Ce=["turn","sidechain","compress","session-end","agent-remember","auto-extract","implicit-extract","profile-extraction","dream"],Ie=["observe-only","parent-write","deny"];var he=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"},m={desktopDockerBridge:"desktop.docker-bridge",desktopEmbeddedWin32X64:"desktop.embedded.win32-x64"};function L(e){return{...e,artifacts:e.artifacts.map(t=>({...t}))}}function ve(e){return{...e,assetIds:[...e.assetIds]}}function K(){return{[m.desktopDockerBridge]:{id:m.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."},[m.desktopEmbeddedWin32X64]:{id:m.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 W(e,t){return e.assets[t]}function V(e,t){return e.profiles[t]}function Me(e,t){let r=V(e,t);return r?r.assetIds.map(o=>W(e,o)).filter(o=>!!o):[]}function ke(e,t){return e.assets[t.id]=L(t),F(e)}function S(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 F(e){let t=S(e.assets[a.gatewayImage]),r=S(e.assets[a.whisperModelTiny]);return{...e,gateway:t,whisperModel:r}}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 xe(e){let t=e&&typeof e=="object"?e:{},r={},o=t.assets&&typeof t.assets=="object"?t.assets:{};for(let[n,p]of Object.entries(o)){if(!p||typeof p!="object")continue;let u=p;!u.id||!Array.isArray(u.artifacts)||(r[n]=L(u))}if(!r[a.gatewayImage]&&t.gateway&&typeof t.gateway=="object"){let n=U(t.gateway,{id:a.gatewayImage,title:"OpenClaw Gateway Image (Desktop Slim)",kind:"container-image",delivery:"remote",platform:"any",description:"Desktop Docker mode gateway image."});n&&(r[n.id]=n)}if(!r[a.whisperModelTiny]&&t.whisperModel&&typeof t.whisperModel=="object"){let n=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."});n&&(r[n.id]=n)}let c={...K()},s=t.profiles&&typeof t.profiles=="object"?t.profiles:{};for(let[n,p]of Object.entries(s)){if(!p||typeof p!="object")continue;let u=p;!u.id||!Array.isArray(u.assetIds)||(c[n]=ve(u))}return F({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:c})}var Ne=["pending","captured","failed","restored"],Oe=["file","directory","missing"],De=["metadata-only","workspace-copy","shadow-git"];var we=["api-key","oauth","token","aws-sdk"],Ue=["rate_limit","auth","server_error","timeout","network","unknown"],Le=["requiresOpenAiAnthropicToolPayload"];function Ke(e,t){return!e||typeof e!="object"||Array.isArray(e)?!1:e[t]===!0}var j="openai-codex";function A(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=A(e);return t==="volcengine-plan"?"volcengine":t==="byteplus-plan"?"byteplus":t}var We=B,Ve={anthropicToolSchemaMode:"native",anthropicToolChoiceMode:"native",providerFamily:"default",preserveAnthropicThinkingSignatures:!0,openAiCompatTurnValidation:!0,providerThoughtSignatureSanitization:!1,transcriptToolCallIdMode:"default",transcriptToolCallIdModelHints:[],providerThoughtSignatureModelHints:[],dropThinkingBlockModelHints:[]},Fe={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"},[j]:{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(o=>r.includes(o))}function l(e){let t=A(e??"");return{...Ve,...Fe[t]}}function je(e){return l(e).preserveAnthropicThinkingSignatures}function Be(e){let t=l(e);return t.anthropicToolSchemaMode!=="native"||t.anthropicToolChoiceMode!=="native"}function qe(e){return l(e).anthropicToolSchemaMode==="openai-functions"}function Ye(e){return l(e).anthropicToolChoiceMode==="openai-string-modes"}function Xe(e){return l(e).openAiCompatTurnValidation}function He(e){return l(e).providerFamily==="openai"}function Ge(e){return l(e).providerFamily==="anthropic"}function ze(e){return T(e.modelId,l(e.provider).dropThinkingBlockModelHints)}function Je(e){let t=l(e.provider);return t.providerThoughtSignatureSanitization&&T(e.modelId,t.providerThoughtSignatureModelHints)}function Qe(e,t){let r=l(e),o=r.transcriptToolCallIdMode;if(o==="strict9")return o;if(T(t,r.transcriptToolCallIdModelHints))return"strict9"}var P={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"],volcengine:["VOLCANO_ENGINE_API_KEY"],"volcengine-plan":["VOLCANO_ENGINE_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 $e(){return[...new Set(Object.values(P).flat())]}function Ze(e){let t=A(e.provider),r=e.env??process.env,o=new Set(e.appliedEnvKeys??[]),i=n=>{let p=r[n]?.trim();if(!p)return null;let u=o.has(n)?`shell env: ${n}`:`env: ${n}`;return{apiKey:p,source:u}},c=e.resolveSpecialApiKey?.(t,r,o);if(c)return c;let s=P[t];if(!s||s.length===0)return null;for(let n of s){let p=i(n);if(p)return p}return null}export{oe as ACP_EXTENDED_METHODS,ne as ACP_EXTENDED_SESSION_UPDATE_TYPES,re as ACP_METHODS,te as ACP_PROTOCOL_VERSION,x as ACP_SESSION_UPDATE_TYPES,Y as AGENT_RPC_APPROVAL_METHODS,d as AGENT_RPC_ERROR_CODES,q as AGENT_RPC_PROTOCOL_VERSION,k as AGENT_TEAM_WS_EVENT_NAMES,M as AGENT_WS_EVENT_NAMES,ee as ALL_AGENT_WS_EVENT_NAMES,E as CAPABILITY_MANIFEST_DIFF_SECTIONS,Z as GATEWAY_RPC_METHODS,R as GatewayRpcContract,be as MEMORY_OBSERVATION_HOOK_VALUES,Ce as MEMORY_OBSERVATION_SOURCE_VALUES,Ie as MEMORY_WRITE_ACCESS_VALUES,De as MUTATION_CHECKPOINT_BACKEND_VALUES,Oe as MUTATION_CHECKPOINT_ENTRY_KIND_VALUES,Ne as MUTATION_CHECKPOINT_PHASE_VALUES,we as PROVIDER_RUNTIME_AUTH_MODE_VALUES,Le as PROVIDER_RUNTIME_COMPAT_FLAG_VALUES,P as PROVIDER_RUNTIME_ENV_API_KEY_CANDIDATES,j as PROVIDER_RUNTIME_OPENAI_CODEX_PROVIDER_ID,Ue as PROVIDER_RUNTIME_VAULT_ERROR_TYPE_VALUES,he as RESOURCE_MANIFEST_SCHEMA_VERSION,a as RUNTIME_ASSET_IDS,m as RUNTIME_PROFILE_IDS,_e as WEB_ACTION_SCOPE_VALUES,Re as WEB_APPROVAL_DEFAULT_VALUES,ye as WEB_CAPABILITY_FAMILY_VALUES,ge as WEB_CAPABILITY_ID_VALUES,Se as WEB_DEGRADATION_TARGET_VALUES,Te as WEB_ESCALATION_REASON_VALUES,fe as WEB_EXECUTION_MODE_VALUES,Ee as WEB_POLICY_RISK_CLASS_VALUES,Pe as WEB_RETRY_POLICY_VALUES,Ae as WEB_STATEFULNESS_VALUES,me as WEB_TASK_MODE_VALUES,$ as buildAgentRpcMeta,f as classifyGatewayRpcMethod,y as cloneCapabilityManifestSnapshot,ue as createCapabilityManifestDiffPayload,K as createDefaultRuntimeResourceProfiles,le as deriveCapabilityToolNamespaces,de as deriveCapabilityWorkspaceIds,S as getManifestShortcutEntry,W as getRuntimeResourceAsset,V as getRuntimeResourceProfile,Me as getRuntimeResourceProfileAssets,O as isAcpJsonRpcNotification,N as isAcpJsonRpcRequest,D as isAcpJsonRpcResponse,I as isAgentRpcNotification,b as isAgentRpcRequest,C as isAgentRpcResponse,Ge as isAnthropicProviderRuntimeFamily,ae as isExtendedSessionUpdateType,He as isOpenAiProviderRuntimeFamily,se as isStandardSessionUpdateType,$e as listProviderRuntimeEnvApiKeyNames,ce as mergeCapabilityManifestSnapshot,A as normalizeProviderRuntimeId,B as normalizeProviderRuntimeIdForAuth,xe as normalizeRuntimeResourceManifest,ie as parseAcpMessage,X as parseAgentRpcMessage,je as preservesProviderRuntimeAnthropicThinkingSignatures,Ke as readProviderRuntimeCompatFlag,v as requireGatewayRpcMeta,h as requiresIdempotencyKey,Be as requiresOpenAiCompatibleAnthropicToolPayloadForProviderRuntime,l as resolveProviderRuntimeCapabilities,Ze as resolveProviderRuntimeEnvApiKey,We as resolveProviderRuntimeKeyFamily,Qe as resolveProviderRuntimeTranscriptToolCallIdMode,ze as shouldDropThinkingBlocksForProviderRuntimeModel,Je as shouldSanitizeProviderRuntimeThoughtSignaturesForModel,Xe as supportsOpenAiCompatTurnValidationForProviderRuntime,ke as upsertRuntimeResourceAsset,qe as usesOpenAiFunctionAnthropicToolSchemaForProviderRuntime,Ye as usesOpenAiStringModeAnthropicToolChoiceForProviderRuntime};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* Turn-lifecycle events relayed to the Control UI WebSocket.
|
|
14
14
|
* These are the "chat session" events that every UI client needs.
|
|
15
15
|
*/
|
|
16
|
-
export declare const AGENT_WS_EVENT_NAMES: readonly ["turn.start", "turn.delta", "turn.end", "turn.error", "turn.recovery", "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.plan_update", "turn.suggestions", "turn.sidechain_started", "turn.subagent_delta", "turn.sidechain_completed", "turn.task_updated", "turn.todos_updated", "turn.exec_progress", "turn.usage_update", "team.member.notification", "session.info", "memory.updated", "skills.updated", "pet.soul_ready", "pet.reaction", "pet.growth", "pet.state", "pet.confirm", "pet.forged", "system.activity"];
|
|
16
|
+
export declare const AGENT_WS_EVENT_NAMES: readonly ["turn.start", "turn.delta", "turn.end", "turn.error", "turn.recovery", "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.plan_update", "turn.suggestions", "turn.sidechain_started", "turn.subagent_delta", "turn.sidechain_completed", "turn.task_updated", "turn.todos_updated", "turn.exec_progress", "turn.usage_update", "team.member.notification", "session.info", "memory.updated", "skills.updated", "pet.soul_ready", "pet.reaction", "pet.growth", "pet.state", "pet.confirm", "pet.forged", "system.activity", "workflow.created", "workflow.updated", "workflow.deleted", "workflow.runStarted", "workflow.runCompleted", "workflow.runFailed"];
|
|
17
17
|
/**
|
|
18
18
|
* Agent Team events (Solo Mode, Product Mode, Plan lifecycle).
|
|
19
19
|
* Relayed to the UI's team/orchestration panel.
|
|
@@ -23,7 +23,7 @@ export declare const AGENT_TEAM_WS_EVENT_NAMES: readonly ["solo.progress", "solo
|
|
|
23
23
|
* All agent notifications that Gateway should relay to WS clients.
|
|
24
24
|
* Union of session events + team events.
|
|
25
25
|
*/
|
|
26
|
-
export declare const ALL_AGENT_WS_EVENT_NAMES: readonly ["turn.start", "turn.delta", "turn.end", "turn.error", "turn.recovery", "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.plan_update", "turn.suggestions", "turn.sidechain_started", "turn.subagent_delta", "turn.sidechain_completed", "turn.task_updated", "turn.todos_updated", "turn.exec_progress", "turn.usage_update", "team.member.notification", "session.info", "memory.updated", "skills.updated", "pet.soul_ready", "pet.reaction", "pet.growth", "pet.state", "pet.confirm", "pet.forged", "system.activity", "solo.progress", "solo.agentDelta", "solo.agentUsage", "solo.agentDiff", "solo.evaluation", "product.taskStarted", "product.taskOutput", "product.taskCompleted", "product.taskFailed", "product.budgetUpdate", "product.checkpointed", "product.dagTopology", "plan.interrupted"];
|
|
26
|
+
export declare const ALL_AGENT_WS_EVENT_NAMES: readonly ["turn.start", "turn.delta", "turn.end", "turn.error", "turn.recovery", "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.plan_update", "turn.suggestions", "turn.sidechain_started", "turn.subagent_delta", "turn.sidechain_completed", "turn.task_updated", "turn.todos_updated", "turn.exec_progress", "turn.usage_update", "team.member.notification", "session.info", "memory.updated", "skills.updated", "pet.soul_ready", "pet.reaction", "pet.growth", "pet.state", "pet.confirm", "pet.forged", "system.activity", "workflow.created", "workflow.updated", "workflow.deleted", "workflow.runStarted", "workflow.runCompleted", "workflow.runFailed", "solo.progress", "solo.agentDelta", "solo.agentUsage", "solo.agentDiff", "solo.evaluation", "product.taskStarted", "product.taskOutput", "product.taskCompleted", "product.taskFailed", "product.budgetUpdate", "product.checkpointed", "product.dagTopology", "plan.interrupted"];
|
|
27
27
|
/** Type-level event name for session events. */
|
|
28
28
|
export type AgentWsEventName = (typeof AGENT_WS_EVENT_NAMES)[number];
|
|
29
29
|
/** Type-level event name for team events. */
|
|
@@ -5,7 +5,7 @@ export { type ChatMessage, type ChatMessageRole, type LocalizedToolText, type Th
|
|
|
5
5
|
export { type AgentCapabilities, type AgentCategory, type AgentConfig, type AgentDescriptor, type AgentProtocol, type AgentRpcMethodMap, type AgentStatus, type CustomAgentDef, type ProductInstanceDef, type ProductPhase, type ProductStatus, type ProductSummary, type ProductTaskDef, type ProductTaskStatus, type SoloAgentResult, type SoloAgentState, type SoloState, type SoloStatus, } from "./agent-methods.js";
|
|
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
|
-
export { type AgentSource, type AgentsErrorNotification, type AgentsStatusNotification, type ArtifactType, type MediaResultType, type MemoryDecayCompletedNotification, type MemoryUpdatedNotification, type NotificationMethod, type NotificationMethodMap, type NotificationThreadItem, type PermissionRuleUpdatedNotification, type PlanInterruptedNotification, type PongNotification, type ProductBudgetUpdateNotification, type ProductBudgetWarningNotification, type ProductCheckpointedNotification, type ProductCompletedNotification, type ProductDagTopologyNotification, type ProductTaskCompletedNotification, type ProductTaskFailedNotification, type ProductTaskOutputDeltaNotification, type ProductTaskStartedNotification, type ProjectArchivedNotification, type ProjectCreatedNotification, type ProjectDeletedNotification, type ProjectRenamedNotification, type ProjectSwitchedNotification, type ProjectUnarchivedNotification, type SessionInfoNotification, type SoloAgentDeltaNotification, type SoloAgentDiffNotification, type SoloAgentUsageNotification, type SoloEvaluationNotification, type SoloProgressNotification, type TeamMemberNotification, type ToolApprovalRequestNotification, type TurnAnnotationsNotification, type TurnArtifactNotification, type TurnAskUserNotification, type TurnDeltaNotification, type TurnEndNotification, type TurnErrorNotification, type TurnExecProgressNotification, type TurnHeartbeatNotification, type TurnMediaPersistedNotification, type TurnMediaProgressNotification, type TurnMediaResultNotification, type TurnPlanUpdateNotification, type TurnReasoningDeltaNotification, type TurnRecoveryNotification, type TurnSidechainCompletedNotification, type TurnSidechainStartedNotification, type TurnSkillAcquisitionNeededNotification, type TurnSkillInstructionNotification, type TurnStartNotification, type TurnSubagentDeltaNotification, type TurnSuggestionsNotification, type TurnTaskUpdatedNotification, type TurnTodosUpdatedNotification, type TurnToolBlockedNotification, type TurnToolCallNotification, type TurnToolResultNotification, type TurnToolUseSummaryNotification, type TurnUsageUpdateNotification, type WireTokenUsage, type ProductPlanReadyNotification, type ProductPlanFailedNotification, type ProductPlanningDeltaNotification, type PetSoulReadyNotification, type PetReactionNotification, type PetGrowthNotification, type PetStateNotification, type PetConfirmNotification, } from "./notification-payloads.js";
|
|
8
|
+
export { type AgentSource, type AgentsErrorNotification, type AgentsStatusNotification, type ArtifactType, type MediaResultType, type MemoryDecayCompletedNotification, type MemoryUpdatedNotification, type NotificationMethod, type NotificationMethodMap, type NotificationThreadItem, type PermissionRuleUpdatedNotification, type PlanInterruptedNotification, type PongNotification, type ProductBudgetUpdateNotification, type ProductBudgetWarningNotification, type ProductCheckpointedNotification, type ProductCompletedNotification, type ProductDagTopologyNotification, type ProductTaskCompletedNotification, type ProductTaskFailedNotification, type ProductTaskOutputDeltaNotification, type ProductTaskStartedNotification, type ProjectArchivedNotification, type ProjectCreatedNotification, type ProjectDeletedNotification, type ProjectRenamedNotification, type ProjectSwitchedNotification, type ProjectUnarchivedNotification, type SessionInfoNotification, type SoloAgentDeltaNotification, type SoloAgentDiffNotification, type SoloAgentUsageNotification, type SoloEvaluationNotification, type SoloProgressNotification, type TeamMemberNotification, type ToolApprovalRequestNotification, type TurnAnnotationsNotification, type TurnArtifactNotification, type TurnAskUserNotification, type TurnDeltaNotification, type TurnEndNotification, type TurnErrorNotification, type TurnExecProgressNotification, type TurnHeartbeatNotification, type TurnMediaPersistedNotification, type TurnMediaProgressNotification, type TurnMediaResultNotification, type TurnPlanUpdateNotification, type TurnReasoningDeltaNotification, type TurnRecoveryNotification, type TurnSidechainCompletedNotification, type TurnSidechainStartedNotification, type TurnSkillAcquisitionNeededNotification, type TurnSkillInstructionNotification, type TurnStartNotification, type TurnSubagentDeltaNotification, type TurnSuggestionsNotification, type TurnTaskUpdatedNotification, type TurnTodosUpdatedNotification, type TurnToolBlockedNotification, type TurnToolCallNotification, type TurnToolResultNotification, type TurnToolUseSummaryNotification, type TurnUsageUpdateNotification, type WireTokenUsage, type ProductPlanReadyNotification, type ProductPlanFailedNotification, type ProductPlanningDeltaNotification, type PetSoulReadyNotification, type PetReactionNotification, type PetGrowthNotification, type PetStateNotification, type PetConfirmNotification, type WorkflowDeletedNotification, type WorkflowRecordNotification, type WorkflowRunCompletedNotification, type WorkflowRunFailedNotification, type WorkflowRunStartedNotification, } from "./notification-payloads.js";
|
|
9
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 AcpAvailableCommandsUpdatePayload, type AcpConfigOptionDescriptor, type AcpConfigOptionUpdatePayload, type AcpContentBlock, type AcpContextItem, 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 AcpPermissionOption, type AcpPermissionRequestParams, type AcpPermissionRequestResult, type AcpPlanPayload, type AcpSessionEndParams, 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 AcpXAskUserPayload, type AcpXMediaProgressPayload, type AcpXMediaResultPayload, type AcpXMemoryUpdatedPayload, type AcpXProductCheckpointPayload, type AcpXProductTaskCompletedPayload, type AcpXProductTaskStartedPayload, type AcpXRecoveryPayload, type AcpXSessionInfoPayload, type AcpXSidechainCompletedPayload, type AcpXSidechainStartedPayload, type AcpXSkillInstructionPayload, type AcpXSoloAgentFinishedPayload, type AcpXSoloSelectedPayload, type AcpXSoloStartedPayload, type AcpXSubagentDeltaPayload, type AcpXSubagentEndedPayload, type AcpXSubagentStartedPayload, type AcpXSuggestionsPayload, type AcpXTeamMemberUpdatePayload, } 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 { type GatewayChannelExecutionEgressContract, type GatewayChannelExecutionEgressKind, type GatewayChannelExecutionIngressBindingContract, type GatewayChannelExecutionIngressSource, } from "./channel-ingress.js";
|
|
@@ -643,6 +643,38 @@ export interface SystemActivityNotification {
|
|
|
643
643
|
title: string;
|
|
644
644
|
detail?: string;
|
|
645
645
|
}
|
|
646
|
+
export interface WorkflowRecordNotification {
|
|
647
|
+
workflow: {
|
|
648
|
+
id: string;
|
|
649
|
+
name: string;
|
|
650
|
+
active: boolean;
|
|
651
|
+
concurrency: string;
|
|
652
|
+
rev: number;
|
|
653
|
+
createdAt: string;
|
|
654
|
+
updatedAt: string;
|
|
655
|
+
trigger?: unknown;
|
|
656
|
+
def: unknown;
|
|
657
|
+
};
|
|
658
|
+
}
|
|
659
|
+
export interface WorkflowDeletedNotification {
|
|
660
|
+
workflowId: string;
|
|
661
|
+
}
|
|
662
|
+
export interface WorkflowRunStartedNotification {
|
|
663
|
+
workflowId: string;
|
|
664
|
+
triggerType: string;
|
|
665
|
+
}
|
|
666
|
+
export interface WorkflowRunCompletedNotification {
|
|
667
|
+
workflowId: string;
|
|
668
|
+
status: "completed" | "paused" | "skipped";
|
|
669
|
+
triggerType: string;
|
|
670
|
+
outcome?: unknown;
|
|
671
|
+
}
|
|
672
|
+
export interface WorkflowRunFailedNotification {
|
|
673
|
+
workflowId: string;
|
|
674
|
+
triggerType?: string;
|
|
675
|
+
error: string;
|
|
676
|
+
outcome?: unknown;
|
|
677
|
+
}
|
|
646
678
|
export interface NotificationMethodMap {
|
|
647
679
|
"turn.start": TurnStartNotification;
|
|
648
680
|
"turn.delta": TurnDeltaNotification;
|
|
@@ -718,6 +750,12 @@ export interface NotificationMethodMap {
|
|
|
718
750
|
"pet.confirm": PetConfirmNotification;
|
|
719
751
|
"pet.forged": PetForgedNotification;
|
|
720
752
|
"system.activity": SystemActivityNotification;
|
|
753
|
+
"workflow.created": WorkflowRecordNotification;
|
|
754
|
+
"workflow.updated": WorkflowRecordNotification;
|
|
755
|
+
"workflow.deleted": WorkflowDeletedNotification;
|
|
756
|
+
"workflow.runStarted": WorkflowRunStartedNotification;
|
|
757
|
+
"workflow.runCompleted": WorkflowRunCompletedNotification;
|
|
758
|
+
"workflow.runFailed": WorkflowRunFailedNotification;
|
|
721
759
|
}
|
|
722
760
|
/** All known notification method names. */
|
|
723
761
|
export type NotificationMethod = keyof NotificationMethodMap;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* P0: Local template pools (no LLM).
|
|
5
5
|
* P1+: LLM-generated personalized reactions via small model.
|
|
6
6
|
*/
|
|
7
|
-
import type
|
|
7
|
+
import { type PetSoul } from "./pet-soul-service.js";
|
|
8
8
|
export type ReactionPool = "greeting" | "completion" | "error" | "curiosity" | "bored" | "memory" | "tool_success";
|
|
9
9
|
export type ReactionStyle = "normal" | "thinking" | "excited" | "sleepy";
|
|
10
10
|
/**
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|