@kodax-ai/kodax 0.7.85 → 0.7.87

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.
Files changed (90) hide show
  1. package/CHANGELOG.md +125 -1
  2. package/README.md +1879 -1841
  3. package/README_CN.md +1138 -1130
  4. package/dist/chunks/{agent-OQ37XUWF.js → agent-Z64QF7KG.js} +1 -1
  5. package/dist/chunks/argument-completer-HIJBXRUT.js +2 -0
  6. package/dist/chunks/chunk-3PGNESV3.js +415 -0
  7. package/dist/chunks/{chunk-IA246OAN.js → chunk-4OLXWSCQ.js} +2 -2
  8. package/dist/chunks/chunk-7XTUXMAI.js +379 -0
  9. package/dist/chunks/{chunk-TBBY2DKE.js → chunk-ASFCAPIG.js} +3 -3
  10. package/dist/chunks/{chunk-CZCEFGQG.js → chunk-BCYJIACJ.js} +2 -2
  11. package/dist/chunks/{chunk-ZVOXWLT6.js → chunk-DB4O33RR.js} +226 -214
  12. package/dist/chunks/{chunk-RSOAHVUR.js → chunk-GRJ7NKWP.js} +1 -1
  13. package/dist/chunks/{chunk-3E4OSFP2.js → chunk-ITP7J5HX.js} +136 -137
  14. package/dist/chunks/{chunk-HTVLCHWH.js → chunk-JS4RSF4B.js} +1 -1
  15. package/dist/chunks/chunk-SKELDH3G.js +123 -0
  16. package/dist/chunks/{chunk-MJ4G5ZCW.js → chunk-U44C5STU.js} +1 -1
  17. package/dist/chunks/{chunk-IWRNGH4M.js → chunk-UWKM3HNY.js} +5 -5
  18. package/dist/chunks/chunk-XH7UM4GO.js +92 -0
  19. package/dist/chunks/{chunk-ODRLFQQH.js → chunk-XKLVC7F6.js} +1 -1
  20. package/dist/chunks/chunk-YB7YVAPL.js +519 -0
  21. package/dist/chunks/{chunk-SR4E5FQK.js → chunk-ZQNOEKOB.js} +2 -2
  22. package/dist/chunks/compaction-config-E4TFBCDJ.js +2 -0
  23. package/dist/chunks/{construction-bootstrap-CZ6NWEWQ.js → construction-bootstrap-YTFOT4M2.js} +1 -1
  24. package/dist/chunks/{dist-NFLLOZWF.js → dist-M3JV4PNA.js} +1 -1
  25. package/dist/chunks/{dist-WWL2DNIJ.js → dist-X55TWIK4.js} +1 -1
  26. package/dist/chunks/host-SJHHJBPB.js +2 -0
  27. package/dist/chunks/run-manager-T5QGWNON.js +2 -0
  28. package/dist/chunks/{utils-KFLK3EHJ.js → utils-2FHVIO6X.js} +1 -1
  29. package/dist/index.d.ts +19 -19
  30. package/dist/index.js +1 -1
  31. package/dist/kodax_bootstrap.js +1 -1
  32. package/dist/kodax_cli.js +1459 -1411
  33. package/dist/kodax_resume.js +78 -76
  34. package/dist/provider-capabilities.json +239 -133
  35. package/dist/runtime-worker.js +1467 -1419
  36. package/dist/sandbox-workspace-session.js +346 -302
  37. package/dist/sdk-a2a.d.ts +12 -12
  38. package/dist/sdk-a2a.js +1 -1
  39. package/dist/sdk-agent.d.ts +17 -17
  40. package/dist/sdk-agent.js +1 -1
  41. package/dist/sdk-coding.d.ts +22 -22
  42. package/dist/sdk-coding.js +1 -1
  43. package/dist/sdk-experimental-memory.d.ts +4 -4
  44. package/dist/sdk-experimental-memory.js +1 -1
  45. package/dist/sdk-llm.d.ts +7 -7
  46. package/dist/sdk-llm.js +1 -1
  47. package/dist/sdk-mcp.js +1 -1
  48. package/dist/sdk-media.d.ts +1 -1
  49. package/dist/sdk-media.js +1 -1
  50. package/dist/sdk-repl.d.ts +16 -18
  51. package/dist/sdk-repl.js +1 -1
  52. package/dist/sdk-runtime.d.ts +22 -14
  53. package/dist/sdk-runtime.js +1 -1
  54. package/dist/sdk-sandbox.d.ts +1 -1
  55. package/dist/sdk-sandbox.js +1 -1
  56. package/dist/sdk-session.d.ts +7 -7
  57. package/dist/sdk-session.js +1 -1
  58. package/dist/sdk-skills.js +1 -1
  59. package/dist/semantic-worker.js +63 -64
  60. package/dist/types-chunks/{base.d-DxG0m09Z.d.ts → base.d-vopO1rml.d.ts} +1 -1
  61. package/dist/types-chunks/{bash-prefix-extractor.d-BnZQDirs.d.ts → bash-prefix-extractor.d-B36OQwNA.d.ts} +13 -7
  62. package/dist/types-chunks/{capability-learning.d-iPSiAmc_.d.ts → capability-learning.d-CE1tm29C.d.ts} +1 -1
  63. package/dist/types-chunks/{capsule.d-CN_iMqAS.d.ts → capsule.d-DEncDNzD.d.ts} +3 -3
  64. package/dist/types-chunks/{controller.d-A73Kf6tH.d.ts → controller.d-C1YdP_pQ.d.ts} +1 -1
  65. package/dist/types-chunks/{controller.d-Dzxz22X-.d.ts → controller.d-Dif9pbC9.d.ts} +2 -2
  66. package/dist/types-chunks/{guardrail.d-BCkgaWT1.d.ts → guardrail.d-DhpnJv4Y.d.ts} +5 -11
  67. package/dist/types-chunks/{history-retrieval.d-Debbzn1z.d.ts → history-retrieval.d-YJQpQt7h.d.ts} +2 -2
  68. package/dist/types-chunks/{public-api.d-N6G6Jw8X.d.ts → public-api.d-D4q3WxKq.d.ts} +4 -4
  69. package/dist/types-chunks/{repl.d-BkTIOkJD.d.ts → repl.d-D4ye29Kk.d.ts} +5 -5
  70. package/dist/types-chunks/{resolver.d-C9IW4fmU.d.ts → resolver.d-RyPo99tB.d.ts} +2 -2
  71. package/dist/types-chunks/{review-inbox.d-DuZqFX-z.d.ts → review-inbox.d-C1_xZ-yg.d.ts} +1 -1
  72. package/dist/types-chunks/{run-manager.d-BS4lJfL3.d.ts → run-manager.d-D30IvnwV.d.ts} +1 -1
  73. package/dist/types-chunks/{sdk-session-DLkZTOc-.d.ts → sdk-session-DIU6sHa2.d.ts} +3 -3
  74. package/dist/types-chunks/{shell-command-sets.d-BrLw-WN9.d.ts → shell-command-sets.d-rIHkZ_VR.d.ts} +1 -1
  75. package/dist/types-chunks/{side-query.d-CP1LiRiH.d.ts → side-query.d-iH0P9ASy.d.ts} +2 -2
  76. package/dist/types-chunks/{types.d-Ch3BD97c.d.ts → types.d-Bz5Y-PD9.d.ts} +4 -4
  77. package/dist/types-chunks/{types.d-CgrXrFrq.d.ts → types.d-CK9A9rpP.d.ts} +1 -1
  78. package/dist/types-chunks/{types.d-Bo4fyMLu.d.ts → types.d-COhAF5Xo.d.ts} +2 -2
  79. package/dist/types-chunks/{types.d-DlLBRqZ9.d.ts → types.d-sW-OqiFt.d.ts} +1 -1
  80. package/dist/types-chunks/{utils.d-BI-kjuev.d.ts → utils.d-B65ozSTV.d.ts} +6 -6
  81. package/package.json +1 -1
  82. package/dist/chunks/argument-completer-IMRSIF2N.js +0 -2
  83. package/dist/chunks/chunk-2XJQNFVR.js +0 -379
  84. package/dist/chunks/chunk-CDWYKVZC.js +0 -482
  85. package/dist/chunks/chunk-RTFVMEF6.js +0 -415
  86. package/dist/chunks/chunk-TRNAWSXP.js +0 -123
  87. package/dist/chunks/chunk-UH5WNJXF.js +0 -92
  88. package/dist/chunks/compaction-config-3WLLNN57.js +0 -2
  89. package/dist/chunks/host-LWUSSCWH.js +0 -2
  90. package/dist/chunks/run-manager-PBMOVP7A.js +0 -2
package/dist/sdk-a2a.d.ts CHANGED
@@ -1,25 +1,25 @@
1
- import { aE as ExternalAgentRegistration, x as AgentEffectDeclaration, B as AgentExecutorFactory, h as AgentArtifactPolicy } from './types-chunks/controller.d-Dzxz22X-.js';
1
+ import { aE as ExternalAgentRegistration, x as AgentEffectDeclaration, B as AgentExecutorFactory, h as AgentArtifactPolicy } from './types-chunks/controller.d-Dif9pbC9.js';
2
2
  import { RuntimeKodaXOptions, RuntimeWorkspaceBinding, RuntimeExecutionToolPolicy, RuntimeUserMarkdownAgentRef, KodaXRuntime, RuntimeExternalAgentsOptions } from './sdk-runtime.js';
3
3
  import { d as IntegrationConfigSnapshot, f as IntegrationConfigStatus } from './types-chunks/integration-config.d-BNowXE8k.js';
4
- import './types-chunks/types.d-CgrXrFrq.js';
5
- import './types-chunks/types.d-DlLBRqZ9.js';
4
+ import './types-chunks/types.d-CK9A9rpP.js';
5
+ import './types-chunks/types.d-sW-OqiFt.js';
6
6
  import './types-chunks/types.d-BSPlmJqf.js';
7
7
  import './types-chunks/config.d-CJy1WENT.js';
8
8
  import './types-chunks/manager.d-B67TmPO1.js';
9
9
  import './types-chunks/capability.d-K664nHOS.js';
10
- import './types-chunks/history-retrieval.d-Debbzn1z.js';
11
- import './types-chunks/run-manager.d-BS4lJfL3.js';
12
- import './types-chunks/bash-prefix-extractor.d-BnZQDirs.js';
10
+ import './types-chunks/history-retrieval.d-YJQpQt7h.js';
11
+ import './types-chunks/run-manager.d-D30IvnwV.js';
12
+ import './types-chunks/bash-prefix-extractor.d-B36OQwNA.js';
13
13
  import 'vscode-languageserver-protocol';
14
14
  import './types-chunks/cost-tracker.d-BeaenODW.js';
15
15
  import './types-chunks/types-PHjfwebT.js';
16
- import './types-chunks/base.d-DxG0m09Z.js';
17
- import './types-chunks/types.d-Ch3BD97c.js';
18
- import './types-chunks/guardrail.d-BCkgaWT1.js';
19
- import './types-chunks/side-query.d-CP1LiRiH.js';
20
- import './types-chunks/utils.d-BI-kjuev.js';
16
+ import './types-chunks/base.d-vopO1rml.js';
17
+ import './types-chunks/types.d-Bz5Y-PD9.js';
18
+ import './types-chunks/guardrail.d-DhpnJv4Y.js';
19
+ import './types-chunks/side-query.d-iH0P9ASy.js';
20
+ import './types-chunks/utils.d-B65ozSTV.js';
21
21
  import 'readline';
22
- import './types-chunks/public-api.d-N6G6Jw8X.js';
22
+ import './types-chunks/public-api.d-D4q3WxKq.js';
23
23
  import 'child_process';
24
24
 
25
25
  declare const A2A_PROTOCOL_VERSION = "1.0";
package/dist/sdk-a2a.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
2
- import"./chunks/chunk-IWRNGH4M.js";import"./chunks/chunk-IA246OAN.js";import{j as tt,p as nt}from"./chunks/chunk-TBBY2DKE.js";import"./chunks/chunk-MJ4G5ZCW.js";import"./chunks/chunk-CZCEFGQG.js";import"./chunks/chunk-RTFVMEF6.js";import"./chunks/chunk-ODRLFQQH.js";import"./chunks/chunk-HTVLCHWH.js";import"./chunks/chunk-SR4E5FQK.js";import"./chunks/chunk-ZVOXWLT6.js";import"./chunks/chunk-RSOAHVUR.js";import"./chunks/chunk-TRNAWSXP.js";import{t as V}from"./chunks/chunk-3E4OSFP2.js";import"./chunks/chunk-UH5WNJXF.js";import{a as o}from"./chunks/chunk-ONUPGMER.js";var te="1.0",Pe="kodax-a2a-v1-jsonrpc";var A=class extends Error{constructor(n,r,i=200,s,a){super(r);this.code=n;this.httpStatus=i;this.data=s;this.headers=a;this.name="A2AError"}code;httpStatus;data;headers;static{o(this,"A2AError")}};function me(t){return t instanceof Error?t.message:String(t)}o(me,"errorMessage");var on=["apiKeySecurityScheme","httpAuthSecurityScheme","oauth2SecurityScheme","openIdConnectSecurityScheme","mtlsSecurityScheme"],an=["authorizationCode","clientCredentials","implicit","password","deviceCode"],cn=/^[\x21\x23-\x5B\x5D-\x7E]+$/u;function re(t,e){if(!cn.test(t))throw new Error(`${e} must be an RFC 6749 scope-token.`)}o(re,"assertOAuthScopeToken");function rt(t,e){let n=t.split(" ");for(let r of n)re(r,e);return[...new Set(n)]}o(rt,"parseOAuthScopeValue");function ie(t,e){if(!Array.isArray(t))throw new Error(`${e} must be an array of strings.`);let n=t.map((r,i)=>{if(typeof r!="string")throw new Error(`${e}[${i}] must be a string.`);return re(r,`${e}[${i}]`),r});if(new Set(n).size!==n.length)throw new Error(`${e} must not contain duplicates.`);return n}o(ie,"parseOAuthScopeList");function B(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}o(B,"isRecord");function O(t,e){if(typeof t!="string"||t.trim().length===0)throw new Error(`${e} must be a non-empty string.`);return t}o(O,"requireNonEmptyString");function dn(t,e){if(t!==void 0)return O(t,e)}o(dn,"optionalString");function it(t,e){return O(t,e).trim()}o(it,"trimmedUri");function un(t){return/^[A-Za-z][A-Za-z0-9+.-]*:\/\/([^/?#]*)/u.exec(t)?.[1]?.includes("@")===!0}o(un,"hasAuthorityUserinfo");function ye(t){let e=t.toLowerCase().replace(/^\[|\]$/gu,"");return e==="localhost"||e==="127.0.0.1"||e==="::1"}o(ye,"isExactOAuthLoopbackHostname");function st(t,e){let n=it(t,e);if(!/^https?:\/\/([^/?#]*)/iu.exec(n)?.[1])throw new Error(`${e} must be an absolute HTTP(S) URL.`);let i;try{i=new URL(n)}catch{throw new Error(`${e} must be an absolute HTTP(S) URL.`)}if(un(n)||i.username||i.password||n.includes("#"))throw new Error(`${e} must not contain userinfo or a fragment.`);if(i.protocol==="http:"&&!ye(i.hostname))throw new Error(`${e} must use HTTPS or exact loopback HTTP.`);return{raw:n,url:i}}o(st,"secureOAuthHttpUrl");function F(t,e){let n=st(t,e);if(n.raw.includes("?"))throw new Error(`${e} must not contain a query or fragment.`);return n.raw}o(F,"parseOAuthIssuerIdentifier");function N(t,e){return st(t,e).url}o(N,"parseOAuthEndpointUrl");function ne(t,e){let n=it(t,e);if(!/^[A-Za-z][A-Za-z0-9+.-]*:/u.test(n))throw new Error(`${e} must be an absolute URI.`);try{new URL(n)}catch{throw new Error(`${e} must be an absolute URI.`)}if(n.includes("#"))throw new Error(`${e} must not contain a fragment.`);return n}o(ne,"parseOAuthResourceIdentifier");function ot(t,e){return N(t,e).href}o(ot,"absoluteHttpUrl");function ln(t,e){if(!B(t))throw new Error(`${e} must be a scope-description object.`);return Object.entries(t).map(([n,r])=>{if(n.trim().length===0||typeof r!="string")throw new Error(`${e} must map non-empty scope names to descriptions.`);return re(n,`${e}.${n}`),n})}o(ln,"parseScopes");function An(t,e){if(!B(e))throw new Error(`securitySchemes.${t}.httpAuthSecurityScheme must be an object.`);let n=O(e.scheme,`securitySchemes.${t}.httpAuthSecurityScheme.scheme`),r=dn(e.bearerFormat,`securitySchemes.${t}.httpAuthSecurityScheme.bearerFormat`);return n.toLowerCase()!=="bearer"?{name:t,kind:"unsupported",protocol:`http:${n.toLowerCase()}`}:{name:t,kind:"http-bearer",...r?{bearerFormat:r}:{}}}o(An,"parseHttpScheme");function pn(t,e){let n=e.flows;if(!B(n))throw new Error(`securitySchemes.${t}.oauth2SecurityScheme.flows must be an object.`);let r=an.filter(c=>n[c]!==void 0);if(r.length!==1)throw new Error(`securitySchemes.${t}.oauth2SecurityScheme.flows must contain exactly one OAuth flow.`);let i=r[0],s=n[i];if(!B(s))throw new Error(`securitySchemes.${t}.oauth2SecurityScheme.flows.${i} must be an object.`);let a=ln(s.scopes,`securitySchemes.${t}.oauth2SecurityScheme.flows.${i}.scopes`);if(i==="clientCredentials"){let c=ot(s.tokenUrl,`securitySchemes.${t}.oauth2SecurityScheme.flows.clientCredentials.tokenUrl`);return{name:t,kind:"oauth2-client-credentials",tokenUrl:c,scopes:a}}return{name:t,kind:"unsupported",protocol:`oauth2:${i}`,oauthScopes:a}}o(pn,"parseOAuthFlow");function fn(t,e,n){if(!B(n))throw new Error(`securitySchemes.${t}.${e} must be an object.`);if(e==="apiKeySecurityScheme"){let r=O(n.location,`securitySchemes.${t}.${e}.location`);if(!["query","header","cookie"].includes(r))throw new Error(`securitySchemes.${t}.${e}.location must be query, header, or cookie.`);return O(n.name,`securitySchemes.${t}.${e}.name`),{name:t,kind:"unsupported",protocol:"api-key"}}return e==="openIdConnectSecurityScheme"?(ot(n.openIdConnectUrl,`securitySchemes.${t}.${e}.openIdConnectUrl`),{name:t,kind:"unsupported",protocol:"openid-connect",acceptsOAuthScopes:!0}):{name:t,kind:"unsupported",protocol:"mutual-tls"}}o(fn,"parseUnsupportedScheme");function hn(t,e){if(!B(e))throw new Error(`securitySchemes.${t} must be an object.`);let n=on.filter(i=>e[i]!==void 0);if(n.length!==1)throw new Error(`securitySchemes.${t} must contain exactly one security scheme.`);let r=n[0];if(r==="httpAuthSecurityScheme")return An(t,e[r]);if(r==="oauth2SecurityScheme"){let i=e[r];if(!B(i))throw new Error(`securitySchemes.${t}.${r} must be an object.`);return pn(t,i)}return fn(t,r,e[r])}o(hn,"parseScheme");function gn(t){if(t===void 0)return{};if(!B(t))throw new Error("securitySchemes must be an object.");return Object.fromEntries(Object.entries(t).map(([e,n])=>{if(e.trim().length===0)throw new Error("securitySchemes names must not be empty.");return[e,hn(e,n)]}))}o(gn,"parseSchemes");function mn(t,e){if(!B(t))throw new Error(`${e} must be a StringList object.`);if(t.list===void 0)return[];if(!Array.isArray(t.list)||!t.list.every(n=>typeof n=="string"&&n.trim().length>0))throw new Error(`${e}.list must be an array of non-empty strings.`);if(new Set(t.list).size!==t.list.length)throw new Error(`${e}.list must not contain duplicate scopes.`);for(let n of t.list)re(n,`${e}.list`);return t.list}o(mn,"parseScopeList");function yn(t,e){if(t.kind==="oauth2-client-credentials"||t.kind==="unsupported"&&t.oauthScopes!==void 0){let n=t.kind==="oauth2-client-credentials"?t.scopes:t.oauthScopes??[];for(let r of e)if(!n.includes(r))throw new Error(`scope "${r}" is not declared by security scheme "${t.name}".`);return}if(e.length>0&&!(t.kind==="unsupported"&&t.acceptsOAuthScopes))throw new Error(`security scheme "${t.name}" does not accept OAuth scopes.`)}o(yn,"validateRequiredScopes");function wn(t,e,n){if(!B(t))throw new Error(`securityRequirements[${e}] must be an object.`);let r=t.schemes;if(r!==void 0&&!B(r))throw new Error(`securityRequirements[${e}].schemes must be an object.`);return{schemes:Object.entries(r??{}).map(([a,c])=>{if(!Object.hasOwn(n,a))throw new Error(`securityRequirements[${e}] references unknown security scheme "${a}".`);let d=n[a],u=mn(c,`securityRequirements[${e}].schemes.${a}`);return yn(d,u),{scheme:d,scopes:u}})}}o(wn,"parseRequirement");function J(t,e){let n=gn(t);if(e===void 0)return{schemes:n,requirements:[]};if(!Array.isArray(e))throw new Error("securityRequirements must be an array.");return{schemes:n,requirements:e.map((r,i)=>wn(r,i,n))}}o(J,"parseA2ASecurity");function kn(t,e){let{scheme:n,scopes:r}=e;return n.kind!=="unsupported"&&t.schemeName===n.name&&t.kind===n.kind&&r.every(i=>t.scopes?.includes(i)===!0)}o(kn,"capabilityMatches");function $i(t,e){return we(t,e)[0]??null}o($i,"selectA2ASecurityRequirement");function we(t,e){return(t.requirements.length===0?[{schemes:[]}]:t.requirements).filter(r=>r.schemes.every(i=>e.some(s=>kn(s,i))))}o(we,"satisfiableA2ASecurityRequirements");var Sn=new Set(["TASK_STATE_UNSPECIFIED","TASK_STATE_SUBMITTED","TASK_STATE_WORKING","TASK_STATE_COMPLETED","TASK_STATE_FAILED","TASK_STATE_CANCELED","TASK_STATE_INPUT_REQUIRED","TASK_STATE_REJECTED","TASK_STATE_AUTH_REQUIRED"]);function g(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}o(g,"isRecord");function at(t){if(t===null)return;let e=t.split(";",1)[0]?.trim().toLowerCase();return e&&!/\s/u.test(e)?e:void 0}o(at,"mediaTypeEssence");function de(t){let e=at(t);return e==="application/json"||/^application\/[!#$%&'*+\-.^_`|~0-9a-z]+\+json$/u.test(e??"")}o(de,"isJsonMediaType");function ct(t){return at(t)==="text/event-stream"}o(ct,"isEventStreamMediaType");function U(t,e,n){let r=t[e];if(typeof r!="string"||r.trim().length===0)throw new A(-32602,`${n}.${e} must be a non-empty string.`);return r}o(U,"requiredString");function I(t,e){let n=t[e];return typeof n=="string"&&n.length>0?n:void 0}o(I,"optionalString");function se(t,e){if(!Array.isArray(t)||!t.every(n=>typeof n=="string"))throw new A(-32602,`${e} must be a string array.`);return t}o(se,"stringArray");function Rn(t){if(!g(t))throw new A(-32602,"Agent Card interface is invalid.");return{url:U(t,"url","interface"),protocolBinding:U(t,"protocolBinding","interface"),protocolVersion:U(t,"protocolVersion","interface"),...I(t,"tenant")?{tenant:I(t,"tenant")}:{}}}o(Rn,"parseInterface");function dt(t,e,n){try{J(t,e)}catch(r){let i=r instanceof Error?r.message:String(r);throw new A(-32602,`${n} is invalid: ${i}`)}}o(dt,"validateSecurity");function En(t,e){if(!g(t))throw new A(-32602,"Agent Card skill is invalid.");return t.securityRequirements!==void 0&&dt(e,t.securityRequirements,"skill.securityRequirements"),{id:U(t,"id","skill"),name:U(t,"name","skill"),description:U(t,"description","skill"),tags:se(t.tags,"skill.tags"),...Array.isArray(t.examples)?{examples:se(t.examples,"skill.examples")}:{},...Array.isArray(t.inputModes)?{inputModes:se(t.inputModes,"skill.inputModes")}:{},...Array.isArray(t.outputModes)?{outputModes:se(t.outputModes,"skill.outputModes")}:{},...Array.isArray(t.securityRequirements)?{securityRequirements:t.securityRequirements.filter(g)}:{}}}o(En,"parseSkill");function Tn(t){if(!g(t))throw new A(-32602,"Agent Card extension is invalid.");let e=U(t,"uri","extension");try{new URL(e)}catch{throw new A(-32602,"Agent Card extension.uri must be an absolute URI.")}if(t.description!==void 0&&typeof t.description!="string")throw new A(-32602,"Agent Card extension.description must be a string.");if(t.required!==void 0&&typeof t.required!="boolean")throw new A(-32602,"Agent Card extension.required must be a boolean.");if(t.params!==void 0&&!g(t.params))throw new A(-32602,"Agent Card extension.params must be an object.");return{uri:e,...typeof t.description=="string"?{description:t.description}:{},...typeof t.required=="boolean"?{required:t.required}:{},...g(t.params)?{params:t.params}:{}}}o(Tn,"parseExtension");function ut(t){if(!g(t))throw new A(-32602,"Agent Card must be an object.");let e=t.supportedInterfaces,n=t.skills;if(!Array.isArray(e)||e.length===0)throw new A(-32602,"Agent Card must declare supportedInterfaces.");if(!Array.isArray(n))throw new A(-32602,"Agent Card must declare skills.");if(!g(t.capabilities))throw new A(-32602,"Agent Card capabilities are invalid.");if(t.capabilities.extensions!==void 0&&!Array.isArray(t.capabilities.extensions))throw new A(-32602,"Agent Card capabilities.extensions must be an array.");return dt(t.securitySchemes,t.securityRequirements,"Agent Card security declaration"),{name:U(t,"name","Agent Card"),description:U(t,"description","Agent Card"),supportedInterfaces:e.map(Rn),version:U(t,"version","Agent Card"),capabilities:{...typeof t.capabilities.streaming=="boolean"?{streaming:t.capabilities.streaming}:{},...typeof t.capabilities.pushNotifications=="boolean"?{pushNotifications:t.capabilities.pushNotifications}:{},...typeof t.capabilities.extendedAgentCard=="boolean"?{extendedAgentCard:t.capabilities.extendedAgentCard}:{},...Array.isArray(t.capabilities.extensions)?{extensions:t.capabilities.extensions.map(Tn)}:{}},...g(t.securitySchemes)?{securitySchemes:t.securitySchemes}:{},...Array.isArray(t.securityRequirements)?{securityRequirements:t.securityRequirements.filter(g)}:{},defaultInputModes:se(t.defaultInputModes,"Agent Card defaultInputModes"),defaultOutputModes:se(t.defaultOutputModes,"Agent Card defaultOutputModes"),skills:n.map(r=>En(r,t.securitySchemes))}}o(ut,"parseA2AAgentCard");function lt(t){if(!g(t))throw new A(-32602,"Message Part must be an object.");let e=["text","raw","url","data"].filter(r=>t[r]!==void 0);if(e.length!==1)throw new A(-32602,"Message Part must contain exactly one content field.");let n=e[0];if(n!=="data"&&typeof t[n]!="string")throw new A(-32602,`Message Part ${n} content must be a string.`);return{...typeof t.text=="string"?{text:t.text}:{},...typeof t.raw=="string"?{raw:t.raw}:{},...typeof t.url=="string"?{url:t.url}:{},...t.data!==void 0?{data:t.data}:{},...g(t.metadata)?{metadata:t.metadata}:{},...I(t,"filename")?{filename:I(t,"filename")}:{},...I(t,"mediaType")?{mediaType:I(t,"mediaType")}:{}}}o(lt,"parseA2APart");function D(t){if(!g(t))throw new A(-32602,"Message must be an object.");if(t.role!=="ROLE_USER"&&t.role!=="ROLE_AGENT")throw new A(-32602,"Message role is invalid.");if(!Array.isArray(t.parts)||t.parts.length===0)throw new A(-32602,"Message parts must not be empty.");return{messageId:U(t,"messageId","Message"),role:t.role,parts:t.parts.map(lt),...I(t,"contextId")?{contextId:I(t,"contextId")}:{},...I(t,"taskId")?{taskId:I(t,"taskId")}:{},...g(t.metadata)?{metadata:t.metadata}:{}}}o(D,"parseA2AMessage");function bn(t){if(!g(t)||!Array.isArray(t.parts)||t.parts.length===0)throw new A(-32603,"A2A artifact is invalid.");return{artifactId:U(t,"artifactId","Artifact"),parts:t.parts.map(lt),...I(t,"name")?{name:I(t,"name")}:{},...I(t,"description")?{description:I(t,"description")}:{},...g(t.metadata)?{metadata:t.metadata}:{}}}o(bn,"parseArtifact");function H(t){if(!g(t)||!g(t.status))throw new A(-32603,"A2A task is invalid.");let e=t.status.state;if(typeof e!="string")throw new A(-32603,"A2A task state is invalid.");let n=Sn.has(e)?e:"TASK_STATE_UNSPECIFIED";return{id:U(t,"id","Task"),contextId:I(t,"contextId")??"",status:{state:n,...t.status.message!==void 0?{message:D(t.status.message)}:{},...I(t.status,"timestamp")?{timestamp:I(t.status,"timestamp")}:{}},...Array.isArray(t.artifacts)?{artifacts:t.artifacts.map(bn)}:{},...Array.isArray(t.history)?{history:t.history.map(D)}:{},...g(t.metadata)?{metadata:t.metadata}:{}}}o(H,"parseA2ATask");function At(t){if(!g(t)||t.jsonrpc!=="2.0")throw new A(-32600,"Invalid JSON-RPC request.");if(typeof t.id!="string"&&typeof t.id!="number")throw new A(-32600,"JSON-RPC request id is required.");return{jsonrpc:"2.0",id:t.id,method:U(t,"method","JSON-RPC request"),...g(t.params)?{params:t.params}:{}}}o(At,"parseJsonRpcRequest");import{lookup as xn}from"node:dns/promises";import{request as In}from"node:http";import{request as Cn}from"node:https";import{BlockList as vn,isIP as pt}from"node:net";import{Readable as Pn}from"node:stream";var ke=new vn;ke.addSubnet("127.0.0.0",8,"ipv4");ke.addAddress("::1","ipv6");function Oe(t){let e=pt(t);return e===4?ke.check(t,"ipv4"):e===6&&ke.check(t,"ipv6")}o(Oe,"isLoopbackAddress");function On(t){let e=t.toLowerCase();return e==="localhost"||e==="127.0.0.1"||e==="::1"}o(On,"isExactLoopbackHostname");function _e(t){let e=t.split(".").map(Number),[n,r,i,s]=e;return e.length!==4||n===void 0||r===void 0||i===void 0||s===void 0?!0:n===0||n===10||n===127||n===100&&r>=64&&r<=127||n===169&&r===254||n===172&&r>=16&&r<=31||n===192&&r===168||n===192&&r===0&&i===0&&s!==9&&s!==10||n===192&&r===0&&i===2||n===198&&(r===18||r===19)||n===198&&r===51&&i===100||n===203&&r===0&&i===113||n>=224}o(_e,"isPrivateIpv4");function _n(t){if(Oe(t))return!0;let e=t.toLowerCase(),n=/^::ffff:(\d+\.\d+\.\d+\.\d+)$/.exec(e)?.[1];if(n)return _e(n);let r=/^::ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})$/.exec(e);if(r?.[1]&&r[2]){let i=Number.parseInt(r[1],16),s=Number.parseInt(r[2],16);return _e(`${i>>8}.${i&255}.${s>>8}.${s&255}`)}return e==="::"||e==="::1"||e.startsWith("fc")||e.startsWith("fd")||e.startsWith("fe8")||e.startsWith("fe9")||e.startsWith("fea")||e.startsWith("feb")||e.startsWith("ff")}o(_n,"isPrivateIpv6");function Un(t){let e=pt(t);return e===4?_e(t):e===6?_n(t):!0}o(Un,"isPrivateAddress");async function ft(t,e){if(t.protocol!=="https:"&&t.protocol!=="http:")throw new A(-32602,"A2A URL must use HTTP or HTTPS.");if(!e.allowedOrigins.includes(t.origin))throw new A(-32602,`A2A origin is not allowed: ${t.origin}`);if(t.username||t.password)throw new A(-32602,"A2A URL must not include credentials.");let n=t.hostname.startsWith("[")&&t.hostname.endsWith("]")?t.hostname.slice(1,-1):t.hostname,r=await xn(n,{all:!0,verbatim:!0});if(r.length===0)throw new A(-32602,"A2A hostname did not resolve.");if(n.toLowerCase()==="localhost"&&!r.every(a=>Oe(a.address)))throw new A(-32602,"A2A localhost target must resolve only to loopback addresses.");let i=On(n)&&r.every(a=>Oe(a.address));if(t.protocol==="http:"&&!i&&e.allowInsecureHttp!==!0)throw new A(-32602,"Non-loopback A2A targets must use HTTPS unless plaintext HTTP is explicitly allowed.");if(!e.allowPrivateAddresses&&r.some(a=>Un(a.address)))throw new A(-32602,"A2A private network targets are not allowed.");let s=r[0];if(s===void 0||s.family!==4&&s.family!==6)throw new A(-32602,"A2A hostname returned an unsupported address.");return{address:s.address,family:s.family}}o(ft,"validateA2AUrl");async function Mn(t,e){await ft(t,e)}o(Mn,"assertSafeA2AUrl");function Ln(t){if(t==null||typeof t=="string")return t??void 0;if(t instanceof URLSearchParams)return t.toString();if(t instanceof Uint8Array)return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new A(-32602,"A2A request body type is not supported by the safe transport.")}o(Ln,"encodeRequestBody");function qn(t){return((e,n,r)=>{if(typeof n=="object"&&n.all){r(null,[t]);return}r(null,t.address,t.family)})}o(qn,"pinnedLookup");function $n(t,e,n){return new Promise((r,i)=>{let s=new Headers(e.headers);s.set("accept-encoding","identity");let a=(t.protocol==="https:"?Cn:In)(t,{method:e.method,headers:Object.fromEntries(s),lookup:qn(n),signal:e.signal??void 0},c=>{let d=new Headers;for(let p=0;p<c.rawHeaders.length;p+=2){let h=c.rawHeaders[p],w=c.rawHeaders[p+1];h!==void 0&&w!==void 0&&d.append(h,w)}let u=c.statusCode??500,l=e.method!=="HEAD"&&u!==204&&u!==205&&u!==304?Pn.toWeb(c):null;r(new Response(l,{status:u,statusText:c.statusMessage,headers:d}))});a.once("error",i),a.end(Ln(e.body))})}o($n,"requestValidatedAddress");async function Ue(t,e,n,r){let i=await ft(t,n);return r!==void 0?r(t,e):$n(t,e,i)}o(Ue,"openSafeA2AResponse");async function Nn(t,e){let n=t.headers.get("content-length");if(n&&Number(n)>e)throw new A(-32603,"A2A response is too large.");if(!t.body)return new Uint8Array;let r=t.body.getReader(),i=[],s=0;for(;;){let d=await r.read();if(d.done)break;if(s+=d.value.byteLength,s>e)throw await r.cancel(),new A(-32603,"A2A response is too large.");i.push(d.value)}let a=new Uint8Array(s),c=0;for(let d of i)a.set(d,c),c+=d.byteLength;return a}o(Nn,"boundedBody");function Dn(t,e){if(!t)return{signal:e,cleanup:o(()=>{},"cleanup")};let n=new AbortController,r=o(()=>n.abort(t.reason),"abortFromCaller"),i=o(()=>n.abort(e.reason),"abortFromDeadline");return t.aborted?r():t.addEventListener("abort",r,{once:!0}),e.aborted?i():e.addEventListener("abort",i,{once:!0}),{signal:n.signal,cleanup:o(()=>{t.removeEventListener("abort",r),e.removeEventListener("abort",i)},"cleanup")}}o(Dn,"combineAbortSignals");async function G(t,e,n,r){let i=t,s=new Headers(e.headers).get("authorization");for(let a=0;a<=n.maxRedirects;a+=1){let c=new AbortController,d=setTimeout(()=>c.abort(new Error("A2A request timed out.")),n.requestTimeoutMs),u=Dn(e.signal,c.signal),f=new Headers(e.headers);s===null?f.delete("authorization"):f.set("authorization",s);try{let l=await Ue(i,{...e,headers:f,redirect:"manual",signal:u.signal},n,r);if(l.status<300||l.status>=400)return{response:l,body:await Nn(l,n.maxResponseBytes),url:i};let p=l.headers.get("location");if(!p||a===n.maxRedirects)throw new A(-32603,"A2A redirect limit exceeded.");let h=new URL(p,i);await l.body?.cancel(),h.origin!==i.origin&&(s=null),i=h}finally{clearTimeout(d),u.cleanup()}}throw new A(-32603,"A2A redirect limit exceeded.")}o(G,"safeA2AFetch");function X(t){return new TextDecoder("utf-8",{fatal:!0}).decode(t)}o(X,"decodeUtf8");import{createHash as Fn,randomUUID as Me}from"node:crypto";import*as K from"oauth4webapi";var Kn=6e4,jn=1e3,Bn=.1;function Hn(t,e){return new Response(e.byteLength===0?null:X(e),{status:t.status,statusText:t.statusText,headers:t.headers})}o(Hn,"oauthResponse");function zn(t,e){if(e===void 0||e<=0)return t;let n=e*1e3,r=Math.min(Kn,Math.max(jn,n*Bn));return t+Math.max(0,n-r)}o(zn,"cacheExpiry");function ht(t){let e=O(t.clientId,"OAuth 2.0 clientId");if(t.clientAuthenticationMethod!=="basic"&&t.clientAuthenticationMethod!=="post")throw new Error("OAuth 2.0 clientAuthenticationMethod must be basic or post.");let n=t.clientAuthenticationMethod,r=t.scopes===void 0?void 0:ie(t.scopes,"OAuth 2.0 scopes"),i=F(t.issuer,"OAuth 2.0 issuer"),s=N(t.tokenUrl,"OAuth 2.0 token endpoint"),a=t.resource===void 0?void 0:ne(t.resource,"OAuth 2.0 resource"),c={issuer:i,token_endpoint:s.href},d={client_id:e},u={...t.networkPolicy,maxRedirects:0},f=t.now??Date.now,l,p,h=0;async function w(k){let y=n==="post"?K.ClientSecretPost(k):K.ClientSecretBasic(k),E=new URLSearchParams;r&&r.length>0&&E.set("scope",r.join(" ")),a!==void 0&&E.set("resource",a);let m={[K.customFetch]:async(R,_)=>{if(new URL(R).href!==s.href)throw new Error("OAuth 2.0 token request targeted an unexpected endpoint.");let j=await G(s,{method:_.method,headers:_.headers,body:_.body,redirect:"manual",..._.signal!==void 0?{signal:_.signal}:{}},u,t.fetch);return Hn(j.response,j.body)}};s.protocol==="http:"&&(m[K.allowInsecureRequests]=!0);let S;try{let R=await K.clientCredentialsGrantRequest(c,d,y,E,m);S=await K.processClientCredentialsResponse(c,d,R)}catch{throw new Error("OAuth 2.0 client credentials token request failed.")}if(S.token_type!=="bearer")throw new Error("OAuth 2.0 token endpoint did not return a Bearer access token.");let L=f();return{value:`Bearer ${S.access_token}`,expiresAt:zn(L,S.expires_in)}}return o(w,"requestAuthorization"),{async getAuthorization(k){if(k.length===0)throw new Error("OAuth 2.0 client secret is required.");let y=f();if(l!==void 0&&l.expiresAt>y)return l.value;if(p!==void 0)return p;let E=h,m;return m=w(k).then(S=>(h===E&&S.expiresAt>f()&&(l=S),S.value)).finally(()=>{p===m&&(p=void 0)}),p=m,m},invalidate(k){if(k!==void 0){l?.value===k&&(l=void 0);return}h+=1,l=void 0,p=void 0}}}o(ht,"createOAuth2ClientCredentialsTokenManager");var gt=4,mt=/^[A-Za-z0-9\-._~+/=]$/u;function Se(t){return t!==void 0&&/^Bearer\s+\S+$/iu.test(t)}o(Se,"isBearerAuthorization");function Jn(t,e){let n="",r=0;for(;r<t.length;){let i=t.indexOf(e,r);if(i<0)return n+t.slice(r);let s=i===0?void 0:t[i-1],a=i+e.length,c=a===t.length?void 0:t[a],d=s===void 0||!mt.test(s),u=c===void 0||!mt.test(c);n+=t.slice(r,i),d&&u?(n+="[REDACTED]",r=a):(n+=e,r=a)}return n}o(Jn,"replaceBoundedToken");function Ae(t){return Array.isArray(t)?`[${t.map(Ae).join(",")}]`:g(t)?`{${Object.keys(t).sort().map(e=>`${JSON.stringify(e)}:${Ae(t[e])}`).join(",")}}`:JSON.stringify(t)??"null"}o(Ae,"stableJson");function yt(t){return`sha256:${Fn("sha256").update(t).digest("hex")}`}o(yt,"sha256");var qe=class{static{o(this,"AuthorizationRedactor")}#e=[];#n=new Map;remember(e){if(!e)return;let n=this.#e.indexOf(e);n>=0&&this.#e.splice(n,1),this.#e.unshift(e),this.#e.length>gt&&(this.#e.length=gt)}retain(e){if(!e)return()=>{};this.remember(e),this.#n.set(e,(this.#n.get(e)??0)+1);let n=!1;return()=>{if(n)return;n=!0;let r=(this.#n.get(e)??1)-1;r===0?this.#n.delete(e):this.#n.set(e,r)}}redactText(e){let n=[...new Set([...this.#n.keys(),...this.#e])],r=n.sort((s,a)=>a.length-s.length).reduce((s,a)=>s.split(a).join("[REDACTED]"),e),i=n.flatMap(s=>{let a=/^Bearer\s+(\S+)$/iu.exec(s)?.[1];return a?[a]:[]}).sort((s,a)=>a.length-s.length);return[...new Set(i)].reduce((s,a)=>Jn(s,a),r)}redactContent(e){return typeof e=="string"?this.redactText(e):Array.isArray(e)?e.map(n=>this.redactContent(n)):g(e)?Object.fromEntries(Object.entries(e).map(([n,r])=>[n,this.redactContent(r)])):e}redactPart(e){return{...e,...e.text===void 0?{}:{text:this.redactText(e.text)},...e.raw===void 0?{}:{raw:this.redactText(e.raw)},...e.url===void 0?{}:{url:this.redactText(e.url)},...e.data===void 0?{}:{data:this.redactContent(e.data)},...e.metadata===void 0?{}:{metadata:this.redactContent(e.metadata)},...e.filename===void 0?{}:{filename:this.redactText(e.filename)}}}redactMessage(e){return{...e,parts:e.parts.map(n=>this.redactPart(n)),...e.metadata===void 0?{}:{metadata:this.redactContent(e.metadata)}}}redactArtifact(e){return{...e,...e.name===void 0?{}:{name:this.redactText(e.name)},...e.description===void 0?{}:{description:this.redactText(e.description)},parts:e.parts.map(n=>this.redactPart(n)),...e.metadata===void 0?{}:{metadata:this.redactContent(e.metadata)}}}redactTask(e){return{...e,status:{...e.status,...e.status.message===void 0?{}:{message:this.redactMessage(e.status.message)}},...e.artifacts===void 0?{}:{artifacts:e.artifacts.map(n=>this.redactArtifact(n))},...e.history===void 0?{}:{history:e.history.map(n=>this.redactMessage(n))},...e.metadata===void 0?{}:{metadata:this.redactContent(e.metadata)}}}redactError(e){let n=this.redactText(e instanceof Error?e.message:String(e));return e instanceof A?new A(e.code,n,e.httpStatus,this.redactContent(e.data),e.headers):new Error(n)}};function wt(t,e){let n=new URL(e).origin;if(!t.allowedOrigins.some(i=>new URL(i).origin===n))throw new Error(`A2A endpoint origin is not allowed by network policy: ${n}`);return{...t,allowedOrigins:[n]}}o(wt,"endpointNetworkPolicy");function Wn(t){if(t!==void 0){if(!g(t)||typeof t.scheme!="string")throw new Error("A2A registration authentication is invalid.");if(t.type==="http-bearer")return{type:"http-bearer",scheme:t.scheme};if(t.type!=="oauth2-client-credentials"||typeof t.issuer!="string"||typeof t.tokenUrl!="string"||typeof t.clientId!="string"||!Array.isArray(t.scopes)||!t.scopes.every(e=>typeof e=="string")||!["client-secret-basic","client-secret-post"].includes(String(t.clientAuthentication)))throw new Error("A2A registration OAuth2 authentication is invalid.");return{type:"oauth2-client-credentials",scheme:t.scheme,issuer:t.issuer,tokenUrl:t.tokenUrl,clientId:t.clientId,scopes:t.scopes,...typeof t.resource=="string"?{resource:t.resource}:{},clientAuthentication:t.clientAuthentication}}}o(Wn,"executorAuthentication");function Q(t){let e=t.executorConfig;if(!g(e))throw new Error("A2A registration executorConfig is missing.");if(typeof e.agentCardUrl!="string"||typeof e.interfaceUrl!="string")throw new Error("A2A registration endpoints are invalid.");let n=Wn(e.authentication);return{agentCardUrl:e.agentCardUrl,interfaceUrl:e.interfaceUrl,...typeof e.tenant=="string"?{tenant:e.tenant}:{},...n?{authentication:n}:{}}}o(Q,"executorConfig");function Vn(t,e){let n=t.supportedInterfaces.find(i=>i.protocolBinding.toUpperCase()==="JSONRPC"&&i.protocolVersion==="1.0");if(!n)throw new Error("Agent Card has no supported A2A 1.0 JSONRPC interface.");let r=new URL(n.url);if(r.username||r.password||r.hash)throw new Error("A2A interface URL must not contain credentials or a fragment.");if(r.origin!==e.origin)throw new Error("A2A interface must use the same origin as the trusted Agent Card.");return n}o(Vn,"chooseInterface");function Gn(t){if(t===void 0)return;if(!g(t))throw new Error("A2A authentication must be an object.");let e=O(t.scheme,"A2A authentication.scheme");if(t.type==="http-bearer")return{type:"http-bearer",scheme:e,credentialRef:O(t.credentialRef,"A2A authentication.credentialRef")};if(t.type!=="oauth2-client-credentials")throw new Error("A2A authentication.type must be http-bearer or oauth2-client-credentials.");if(t.clientAuthentication!=="client-secret-basic"&&t.clientAuthentication!=="client-secret-post")throw new Error("A2A authentication.clientAuthentication is invalid.");return{type:"oauth2-client-credentials",scheme:e,issuer:F(t.issuer,"Configured OAuth2 issuer"),tokenUrl:N(t.tokenUrl,"Configured OAuth2 token endpoint").href,clientId:O(t.clientId,"Configured OAuth2 clientId"),clientSecretRef:O(t.clientSecretRef,"Configured OAuth2 clientSecretRef"),scopes:ie(t.scopes,"Configured OAuth2 scopes"),...t.resource===void 0?{}:{resource:ne(t.resource,"Configured OAuth2 resource")},clientAuthentication:t.clientAuthentication}}o(Gn,"validatedClientAuthentication");function Xn(t){let e=t.credentialRef===void 0?void 0:O(t.credentialRef,"A2A credentialRef"),n=Gn(t.authentication);if(t.credentialRef!==void 0&&t.authentication!==void 0)throw new Error("A2A registration cannot combine credentialRef with structured authentication.");return{agentId:t.agentId,agentCardUrl:t.agentCardUrl,...e!==void 0?{credentialRef:e}:{},...n!==void 0?{authentication:n}:{},effects:t.effects}}o(Xn,"validatedRegistrationInput");function Qn(t,e,n){if(t.authentication)return[[{schemeName:t.authentication.scheme,kind:t.authentication.type,...t.authentication.type==="oauth2-client-credentials"?{scopes:t.authentication.scopes}:{}}]];let r=Se(n);if(!t.credentialRef&&!r)return[[]];let i=J(e.securitySchemes,e.securityRequirements);return Object.values(i.schemes).flatMap(s=>s.kind==="http-bearer"?[[{schemeName:s.name,kind:"http-bearer"}]]:[])}o(Qn,"configuredCapabilityCandidates");function kt(t,e){for(let n of t){if(n.schemes.length!==1)continue;let r=n.schemes[0].scheme;if(e.some(i=>i.schemeName===r.name&&i.kind===r.kind))return r}}o(kt,"matchingDeclaredScheme");function Zn(t,e){let n=J(t.securitySchemes,t.securityRequirements),r=we(n,e).filter(a=>a.schemes.length<=1);if(r.length===0)return null;let i=kt(r,e),s=[];for(let a of t.skills){let c=J(t.securitySchemes,a.securityRequirements),d=we(c,e).filter(u=>u.schemes.length<=1);d.length!==0&&(s.push(a.id),i??=kt(d,e))}return t.skills.length>0&&s.length===0?null:{skillIds:s,...i?{declaredScheme:i}:{}}}o(Zn,"evaluateSecurityCapabilities");function Yn(t,e,n){if(t.credentialRef!==void 0&&t.authentication!==void 0)throw new Error("A2A registration cannot combine credentialRef with structured authentication.");if(n!==void 0&&!Se(n))throw new Error("A2A options.authorization must be a valid Bearer authorization.");let r=Se(n),i=t.credentialRef!==void 0||t.authentication!==void 0||r,s;for(let h of Qn(t,e,n)){let w=Zn(e,h);if(w&&(!i||w.declaredScheme)){s=w;break}}if(!s)throw new Error(i?"Configured A2A authentication cannot fully satisfy the Agent Card and any advertised Skill security requirements.":"Agent Card or at least one advertised Skill requires authentication, but no compatible A2A authentication is configured.");if(!i)return{skillIds:s.skillIds};let a=s.declaredScheme,c=t.authentication;if(!c&&!t.credentialRef&&r)return{skillIds:s.skillIds};if(!c)return{credentialRef:t.credentialRef,authentication:{type:"http-bearer",scheme:a.name},skillIds:s.skillIds};if(c.type==="http-bearer")return{credentialRef:c.credentialRef,authentication:{type:"http-bearer",scheme:c.scheme},skillIds:s.skillIds};if(a.kind!=="oauth2-client-credentials")throw new Error("Configured OAuth2 authentication does not match the selected Agent Card scheme.");let d=a,u=F(c.issuer,"Configured OAuth2 issuer"),f=N(c.tokenUrl,"Configured OAuth2 token endpoint").href,l=c.resource===void 0?void 0:ne(c.resource,"Configured OAuth2 resource");if(new URL(d.tokenUrl).href!==f)throw new Error("Configured OAuth2 tokenUrl does not match the selected Agent Card security scheme.");let p=c.scopes.find(h=>!d.scopes.includes(h));if(p)throw new Error(`Configured OAuth2 scope is not declared by the Agent Card: ${p}`);return{credentialRef:c.clientSecretRef,authentication:{type:"oauth2-client-credentials",scheme:c.scheme,issuer:u,tokenUrl:f,clientId:c.clientId,scopes:c.scopes,...l?{resource:l}:{},clientAuthentication:c.clientAuthentication},skillIds:s.skillIds}}o(Yn,"planClientAuthentication");function $e(t,e){try{return JSON.parse(t)}catch{throw new Error(`${e} returned invalid JSON.`)}}o($e,"parseJson");function Et(t){let e=t.maxTaskResponseBytes??t.networkPolicy.maxResponseBytes;if(!Number.isSafeInteger(e)||e<=0)throw new Error("A2A maxTaskResponseBytes must be a positive safe integer.");return e}o(Et,"taskResponseBytes");function er(t){return{...t.networkPolicy,maxResponseBytes:Et(t)}}o(er,"taskNetworkPolicy");async function Tt(t,e){let n=Xn(t),r=await G(new URL(n.agentCardUrl),{headers:{accept:"application/json"}},e.networkPolicy,e.fetch);if(!r.response.ok)throw new Error(`Agent Card request failed with HTTP ${r.response.status}.`);if(!de(r.response.headers.get("content-type")))throw new Error("Agent Card response is not JSON.");let i=ut($e(X(r.body),"Agent Card")),s=i.capabilities.extensions?.filter(f=>f.required)??[];if(s.length>0)throw new Error(`Agent Card required A2A extension(s) are unsupported: ${s.map(f=>f.uri).join(", ")}`);let a=Vn(i,r.url),c=Yn(n,i,e.authorization),d=Ae({agentCardUrl:r.url.href,interfaceUrl:a.url,protocolBinding:a.protocolBinding,protocolVersion:a.protocolVersion,tenant:a.tenant??"",authentication:c.authentication??null}),u=yt(Ae({card:i,endpointIdentity:d,credentialRef:c.credentialRef??null,effects:n.effects}));return{agentCard:i,registration:{agentId:n.agentId,displayName:i.name,description:i.description,enabled:!0,executorId:Pe,protocol:"a2a",configurationRevision:u,endpointIdentityHash:yt(d),...c.credentialRef?{credentialRef:c.credentialRef}:{},executorConfig:{agentCardUrl:r.url.href,interfaceUrl:a.url,...a.tenant?{tenant:a.tenant}:{},...c.authentication?{authentication:c.authentication}:{}},skills:c.skillIds,inputModalities:i.defaultInputModes,outputModalities:i.defaultOutputModes,capabilities:{streaming:i.capabilities.streaming?"supported":"unsupported",durableTasks:"supported",inputRequired:"supported",cancellation:"supported",artifacts:"supported"},effects:{remote:n.effects.remote,workspace:"proposal"},health:{status:"healthy",checkedAt:new Date().toISOString()}}}}o(Tt,"discoverA2ARegistration");function le(t){return t.metadata??{}}o(le,"metadata");function Ne(t){if(t===null||typeof t=="string"||typeof t=="boolean"||typeof t=="number"&&Number.isFinite(t))return t;if(Array.isArray(t))return t.map(Ne);if(g(t)){let e={};for(let[n,r]of Object.entries(t))e[n]=Ne(r);return e}throw new Error("A2A response metadata must be JSON-safe.")}o(Ne,"toAgentJsonValue");function St(t){let e=le(t).directMessage;return e===void 0?void 0:D(e)}o(St,"directMessage");function tr(t){return{TASK_STATE_UNSPECIFIED:"unknown",TASK_STATE_SUBMITTED:"submitted",TASK_STATE_WORKING:"working",TASK_STATE_COMPLETED:"completed",TASK_STATE_FAILED:"failed",TASK_STATE_CANCELED:"canceled",TASK_STATE_INPUT_REQUIRED:"input-required",TASK_STATE_REJECTED:"rejected",TASK_STATE_AUTH_REQUIRED:"auth-required"}[t]??"unknown"}o(tr,"taskState");function De(t){return t.flatMap(e=>e.text===void 0?[]:[e.text]).join(`
2
+ import"./chunks/chunk-UWKM3HNY.js";import"./chunks/chunk-4OLXWSCQ.js";import{j as tt,p as nt}from"./chunks/chunk-ASFCAPIG.js";import"./chunks/chunk-U44C5STU.js";import"./chunks/chunk-BCYJIACJ.js";import"./chunks/chunk-3PGNESV3.js";import"./chunks/chunk-XKLVC7F6.js";import"./chunks/chunk-JS4RSF4B.js";import"./chunks/chunk-ZQNOEKOB.js";import"./chunks/chunk-DB4O33RR.js";import"./chunks/chunk-GRJ7NKWP.js";import"./chunks/chunk-SKELDH3G.js";import{t as V}from"./chunks/chunk-ITP7J5HX.js";import"./chunks/chunk-XH7UM4GO.js";import{a as o}from"./chunks/chunk-ONUPGMER.js";var te="1.0",Pe="kodax-a2a-v1-jsonrpc";var A=class extends Error{constructor(n,r,i=200,s,a){super(r);this.code=n;this.httpStatus=i;this.data=s;this.headers=a;this.name="A2AError"}code;httpStatus;data;headers;static{o(this,"A2AError")}};function me(t){return t instanceof Error?t.message:String(t)}o(me,"errorMessage");var on=["apiKeySecurityScheme","httpAuthSecurityScheme","oauth2SecurityScheme","openIdConnectSecurityScheme","mtlsSecurityScheme"],an=["authorizationCode","clientCredentials","implicit","password","deviceCode"],cn=/^[\x21\x23-\x5B\x5D-\x7E]+$/u;function re(t,e){if(!cn.test(t))throw new Error(`${e} must be an RFC 6749 scope-token.`)}o(re,"assertOAuthScopeToken");function rt(t,e){let n=t.split(" ");for(let r of n)re(r,e);return[...new Set(n)]}o(rt,"parseOAuthScopeValue");function ie(t,e){if(!Array.isArray(t))throw new Error(`${e} must be an array of strings.`);let n=t.map((r,i)=>{if(typeof r!="string")throw new Error(`${e}[${i}] must be a string.`);return re(r,`${e}[${i}]`),r});if(new Set(n).size!==n.length)throw new Error(`${e} must not contain duplicates.`);return n}o(ie,"parseOAuthScopeList");function B(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}o(B,"isRecord");function O(t,e){if(typeof t!="string"||t.trim().length===0)throw new Error(`${e} must be a non-empty string.`);return t}o(O,"requireNonEmptyString");function dn(t,e){if(t!==void 0)return O(t,e)}o(dn,"optionalString");function it(t,e){return O(t,e).trim()}o(it,"trimmedUri");function un(t){return/^[A-Za-z][A-Za-z0-9+.-]*:\/\/([^/?#]*)/u.exec(t)?.[1]?.includes("@")===!0}o(un,"hasAuthorityUserinfo");function ye(t){let e=t.toLowerCase().replace(/^\[|\]$/gu,"");return e==="localhost"||e==="127.0.0.1"||e==="::1"}o(ye,"isExactOAuthLoopbackHostname");function st(t,e){let n=it(t,e);if(!/^https?:\/\/([^/?#]*)/iu.exec(n)?.[1])throw new Error(`${e} must be an absolute HTTP(S) URL.`);let i;try{i=new URL(n)}catch{throw new Error(`${e} must be an absolute HTTP(S) URL.`)}if(un(n)||i.username||i.password||n.includes("#"))throw new Error(`${e} must not contain userinfo or a fragment.`);if(i.protocol==="http:"&&!ye(i.hostname))throw new Error(`${e} must use HTTPS or exact loopback HTTP.`);return{raw:n,url:i}}o(st,"secureOAuthHttpUrl");function F(t,e){let n=st(t,e);if(n.raw.includes("?"))throw new Error(`${e} must not contain a query or fragment.`);return n.raw}o(F,"parseOAuthIssuerIdentifier");function N(t,e){return st(t,e).url}o(N,"parseOAuthEndpointUrl");function ne(t,e){let n=it(t,e);if(!/^[A-Za-z][A-Za-z0-9+.-]*:/u.test(n))throw new Error(`${e} must be an absolute URI.`);try{new URL(n)}catch{throw new Error(`${e} must be an absolute URI.`)}if(n.includes("#"))throw new Error(`${e} must not contain a fragment.`);return n}o(ne,"parseOAuthResourceIdentifier");function ot(t,e){return N(t,e).href}o(ot,"absoluteHttpUrl");function ln(t,e){if(!B(t))throw new Error(`${e} must be a scope-description object.`);return Object.entries(t).map(([n,r])=>{if(n.trim().length===0||typeof r!="string")throw new Error(`${e} must map non-empty scope names to descriptions.`);return re(n,`${e}.${n}`),n})}o(ln,"parseScopes");function An(t,e){if(!B(e))throw new Error(`securitySchemes.${t}.httpAuthSecurityScheme must be an object.`);let n=O(e.scheme,`securitySchemes.${t}.httpAuthSecurityScheme.scheme`),r=dn(e.bearerFormat,`securitySchemes.${t}.httpAuthSecurityScheme.bearerFormat`);return n.toLowerCase()!=="bearer"?{name:t,kind:"unsupported",protocol:`http:${n.toLowerCase()}`}:{name:t,kind:"http-bearer",...r?{bearerFormat:r}:{}}}o(An,"parseHttpScheme");function pn(t,e){let n=e.flows;if(!B(n))throw new Error(`securitySchemes.${t}.oauth2SecurityScheme.flows must be an object.`);let r=an.filter(c=>n[c]!==void 0);if(r.length!==1)throw new Error(`securitySchemes.${t}.oauth2SecurityScheme.flows must contain exactly one OAuth flow.`);let i=r[0],s=n[i];if(!B(s))throw new Error(`securitySchemes.${t}.oauth2SecurityScheme.flows.${i} must be an object.`);let a=ln(s.scopes,`securitySchemes.${t}.oauth2SecurityScheme.flows.${i}.scopes`);if(i==="clientCredentials"){let c=ot(s.tokenUrl,`securitySchemes.${t}.oauth2SecurityScheme.flows.clientCredentials.tokenUrl`);return{name:t,kind:"oauth2-client-credentials",tokenUrl:c,scopes:a}}return{name:t,kind:"unsupported",protocol:`oauth2:${i}`,oauthScopes:a}}o(pn,"parseOAuthFlow");function fn(t,e,n){if(!B(n))throw new Error(`securitySchemes.${t}.${e} must be an object.`);if(e==="apiKeySecurityScheme"){let r=O(n.location,`securitySchemes.${t}.${e}.location`);if(!["query","header","cookie"].includes(r))throw new Error(`securitySchemes.${t}.${e}.location must be query, header, or cookie.`);return O(n.name,`securitySchemes.${t}.${e}.name`),{name:t,kind:"unsupported",protocol:"api-key"}}return e==="openIdConnectSecurityScheme"?(ot(n.openIdConnectUrl,`securitySchemes.${t}.${e}.openIdConnectUrl`),{name:t,kind:"unsupported",protocol:"openid-connect",acceptsOAuthScopes:!0}):{name:t,kind:"unsupported",protocol:"mutual-tls"}}o(fn,"parseUnsupportedScheme");function hn(t,e){if(!B(e))throw new Error(`securitySchemes.${t} must be an object.`);let n=on.filter(i=>e[i]!==void 0);if(n.length!==1)throw new Error(`securitySchemes.${t} must contain exactly one security scheme.`);let r=n[0];if(r==="httpAuthSecurityScheme")return An(t,e[r]);if(r==="oauth2SecurityScheme"){let i=e[r];if(!B(i))throw new Error(`securitySchemes.${t}.${r} must be an object.`);return pn(t,i)}return fn(t,r,e[r])}o(hn,"parseScheme");function gn(t){if(t===void 0)return{};if(!B(t))throw new Error("securitySchemes must be an object.");return Object.fromEntries(Object.entries(t).map(([e,n])=>{if(e.trim().length===0)throw new Error("securitySchemes names must not be empty.");return[e,hn(e,n)]}))}o(gn,"parseSchemes");function mn(t,e){if(!B(t))throw new Error(`${e} must be a StringList object.`);if(t.list===void 0)return[];if(!Array.isArray(t.list)||!t.list.every(n=>typeof n=="string"&&n.trim().length>0))throw new Error(`${e}.list must be an array of non-empty strings.`);if(new Set(t.list).size!==t.list.length)throw new Error(`${e}.list must not contain duplicate scopes.`);for(let n of t.list)re(n,`${e}.list`);return t.list}o(mn,"parseScopeList");function yn(t,e){if(t.kind==="oauth2-client-credentials"||t.kind==="unsupported"&&t.oauthScopes!==void 0){let n=t.kind==="oauth2-client-credentials"?t.scopes:t.oauthScopes??[];for(let r of e)if(!n.includes(r))throw new Error(`scope "${r}" is not declared by security scheme "${t.name}".`);return}if(e.length>0&&!(t.kind==="unsupported"&&t.acceptsOAuthScopes))throw new Error(`security scheme "${t.name}" does not accept OAuth scopes.`)}o(yn,"validateRequiredScopes");function wn(t,e,n){if(!B(t))throw new Error(`securityRequirements[${e}] must be an object.`);let r=t.schemes;if(r!==void 0&&!B(r))throw new Error(`securityRequirements[${e}].schemes must be an object.`);return{schemes:Object.entries(r??{}).map(([a,c])=>{if(!Object.hasOwn(n,a))throw new Error(`securityRequirements[${e}] references unknown security scheme "${a}".`);let d=n[a],u=mn(c,`securityRequirements[${e}].schemes.${a}`);return yn(d,u),{scheme:d,scopes:u}})}}o(wn,"parseRequirement");function J(t,e){let n=gn(t);if(e===void 0)return{schemes:n,requirements:[]};if(!Array.isArray(e))throw new Error("securityRequirements must be an array.");return{schemes:n,requirements:e.map((r,i)=>wn(r,i,n))}}o(J,"parseA2ASecurity");function kn(t,e){let{scheme:n,scopes:r}=e;return n.kind!=="unsupported"&&t.schemeName===n.name&&t.kind===n.kind&&r.every(i=>t.scopes?.includes(i)===!0)}o(kn,"capabilityMatches");function $i(t,e){return we(t,e)[0]??null}o($i,"selectA2ASecurityRequirement");function we(t,e){return(t.requirements.length===0?[{schemes:[]}]:t.requirements).filter(r=>r.schemes.every(i=>e.some(s=>kn(s,i))))}o(we,"satisfiableA2ASecurityRequirements");var Sn=new Set(["TASK_STATE_UNSPECIFIED","TASK_STATE_SUBMITTED","TASK_STATE_WORKING","TASK_STATE_COMPLETED","TASK_STATE_FAILED","TASK_STATE_CANCELED","TASK_STATE_INPUT_REQUIRED","TASK_STATE_REJECTED","TASK_STATE_AUTH_REQUIRED"]);function g(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}o(g,"isRecord");function at(t){if(t===null)return;let e=t.split(";",1)[0]?.trim().toLowerCase();return e&&!/\s/u.test(e)?e:void 0}o(at,"mediaTypeEssence");function de(t){let e=at(t);return e==="application/json"||/^application\/[!#$%&'*+\-.^_`|~0-9a-z]+\+json$/u.test(e??"")}o(de,"isJsonMediaType");function ct(t){return at(t)==="text/event-stream"}o(ct,"isEventStreamMediaType");function U(t,e,n){let r=t[e];if(typeof r!="string"||r.trim().length===0)throw new A(-32602,`${n}.${e} must be a non-empty string.`);return r}o(U,"requiredString");function I(t,e){let n=t[e];return typeof n=="string"&&n.length>0?n:void 0}o(I,"optionalString");function se(t,e){if(!Array.isArray(t)||!t.every(n=>typeof n=="string"))throw new A(-32602,`${e} must be a string array.`);return t}o(se,"stringArray");function Rn(t){if(!g(t))throw new A(-32602,"Agent Card interface is invalid.");return{url:U(t,"url","interface"),protocolBinding:U(t,"protocolBinding","interface"),protocolVersion:U(t,"protocolVersion","interface"),...I(t,"tenant")?{tenant:I(t,"tenant")}:{}}}o(Rn,"parseInterface");function dt(t,e,n){try{J(t,e)}catch(r){let i=r instanceof Error?r.message:String(r);throw new A(-32602,`${n} is invalid: ${i}`)}}o(dt,"validateSecurity");function En(t,e){if(!g(t))throw new A(-32602,"Agent Card skill is invalid.");return t.securityRequirements!==void 0&&dt(e,t.securityRequirements,"skill.securityRequirements"),{id:U(t,"id","skill"),name:U(t,"name","skill"),description:U(t,"description","skill"),tags:se(t.tags,"skill.tags"),...Array.isArray(t.examples)?{examples:se(t.examples,"skill.examples")}:{},...Array.isArray(t.inputModes)?{inputModes:se(t.inputModes,"skill.inputModes")}:{},...Array.isArray(t.outputModes)?{outputModes:se(t.outputModes,"skill.outputModes")}:{},...Array.isArray(t.securityRequirements)?{securityRequirements:t.securityRequirements.filter(g)}:{}}}o(En,"parseSkill");function Tn(t){if(!g(t))throw new A(-32602,"Agent Card extension is invalid.");let e=U(t,"uri","extension");try{new URL(e)}catch{throw new A(-32602,"Agent Card extension.uri must be an absolute URI.")}if(t.description!==void 0&&typeof t.description!="string")throw new A(-32602,"Agent Card extension.description must be a string.");if(t.required!==void 0&&typeof t.required!="boolean")throw new A(-32602,"Agent Card extension.required must be a boolean.");if(t.params!==void 0&&!g(t.params))throw new A(-32602,"Agent Card extension.params must be an object.");return{uri:e,...typeof t.description=="string"?{description:t.description}:{},...typeof t.required=="boolean"?{required:t.required}:{},...g(t.params)?{params:t.params}:{}}}o(Tn,"parseExtension");function ut(t){if(!g(t))throw new A(-32602,"Agent Card must be an object.");let e=t.supportedInterfaces,n=t.skills;if(!Array.isArray(e)||e.length===0)throw new A(-32602,"Agent Card must declare supportedInterfaces.");if(!Array.isArray(n))throw new A(-32602,"Agent Card must declare skills.");if(!g(t.capabilities))throw new A(-32602,"Agent Card capabilities are invalid.");if(t.capabilities.extensions!==void 0&&!Array.isArray(t.capabilities.extensions))throw new A(-32602,"Agent Card capabilities.extensions must be an array.");return dt(t.securitySchemes,t.securityRequirements,"Agent Card security declaration"),{name:U(t,"name","Agent Card"),description:U(t,"description","Agent Card"),supportedInterfaces:e.map(Rn),version:U(t,"version","Agent Card"),capabilities:{...typeof t.capabilities.streaming=="boolean"?{streaming:t.capabilities.streaming}:{},...typeof t.capabilities.pushNotifications=="boolean"?{pushNotifications:t.capabilities.pushNotifications}:{},...typeof t.capabilities.extendedAgentCard=="boolean"?{extendedAgentCard:t.capabilities.extendedAgentCard}:{},...Array.isArray(t.capabilities.extensions)?{extensions:t.capabilities.extensions.map(Tn)}:{}},...g(t.securitySchemes)?{securitySchemes:t.securitySchemes}:{},...Array.isArray(t.securityRequirements)?{securityRequirements:t.securityRequirements.filter(g)}:{},defaultInputModes:se(t.defaultInputModes,"Agent Card defaultInputModes"),defaultOutputModes:se(t.defaultOutputModes,"Agent Card defaultOutputModes"),skills:n.map(r=>En(r,t.securitySchemes))}}o(ut,"parseA2AAgentCard");function lt(t){if(!g(t))throw new A(-32602,"Message Part must be an object.");let e=["text","raw","url","data"].filter(r=>t[r]!==void 0);if(e.length!==1)throw new A(-32602,"Message Part must contain exactly one content field.");let n=e[0];if(n!=="data"&&typeof t[n]!="string")throw new A(-32602,`Message Part ${n} content must be a string.`);return{...typeof t.text=="string"?{text:t.text}:{},...typeof t.raw=="string"?{raw:t.raw}:{},...typeof t.url=="string"?{url:t.url}:{},...t.data!==void 0?{data:t.data}:{},...g(t.metadata)?{metadata:t.metadata}:{},...I(t,"filename")?{filename:I(t,"filename")}:{},...I(t,"mediaType")?{mediaType:I(t,"mediaType")}:{}}}o(lt,"parseA2APart");function D(t){if(!g(t))throw new A(-32602,"Message must be an object.");if(t.role!=="ROLE_USER"&&t.role!=="ROLE_AGENT")throw new A(-32602,"Message role is invalid.");if(!Array.isArray(t.parts)||t.parts.length===0)throw new A(-32602,"Message parts must not be empty.");return{messageId:U(t,"messageId","Message"),role:t.role,parts:t.parts.map(lt),...I(t,"contextId")?{contextId:I(t,"contextId")}:{},...I(t,"taskId")?{taskId:I(t,"taskId")}:{},...g(t.metadata)?{metadata:t.metadata}:{}}}o(D,"parseA2AMessage");function bn(t){if(!g(t)||!Array.isArray(t.parts)||t.parts.length===0)throw new A(-32603,"A2A artifact is invalid.");return{artifactId:U(t,"artifactId","Artifact"),parts:t.parts.map(lt),...I(t,"name")?{name:I(t,"name")}:{},...I(t,"description")?{description:I(t,"description")}:{},...g(t.metadata)?{metadata:t.metadata}:{}}}o(bn,"parseArtifact");function H(t){if(!g(t)||!g(t.status))throw new A(-32603,"A2A task is invalid.");let e=t.status.state;if(typeof e!="string")throw new A(-32603,"A2A task state is invalid.");let n=Sn.has(e)?e:"TASK_STATE_UNSPECIFIED";return{id:U(t,"id","Task"),contextId:I(t,"contextId")??"",status:{state:n,...t.status.message!==void 0?{message:D(t.status.message)}:{},...I(t.status,"timestamp")?{timestamp:I(t.status,"timestamp")}:{}},...Array.isArray(t.artifacts)?{artifacts:t.artifacts.map(bn)}:{},...Array.isArray(t.history)?{history:t.history.map(D)}:{},...g(t.metadata)?{metadata:t.metadata}:{}}}o(H,"parseA2ATask");function At(t){if(!g(t)||t.jsonrpc!=="2.0")throw new A(-32600,"Invalid JSON-RPC request.");if(typeof t.id!="string"&&typeof t.id!="number")throw new A(-32600,"JSON-RPC request id is required.");return{jsonrpc:"2.0",id:t.id,method:U(t,"method","JSON-RPC request"),...g(t.params)?{params:t.params}:{}}}o(At,"parseJsonRpcRequest");import{lookup as xn}from"node:dns/promises";import{request as In}from"node:http";import{request as Cn}from"node:https";import{BlockList as vn,isIP as pt}from"node:net";import{Readable as Pn}from"node:stream";var ke=new vn;ke.addSubnet("127.0.0.0",8,"ipv4");ke.addAddress("::1","ipv6");function Oe(t){let e=pt(t);return e===4?ke.check(t,"ipv4"):e===6&&ke.check(t,"ipv6")}o(Oe,"isLoopbackAddress");function On(t){let e=t.toLowerCase();return e==="localhost"||e==="127.0.0.1"||e==="::1"}o(On,"isExactLoopbackHostname");function _e(t){let e=t.split(".").map(Number),[n,r,i,s]=e;return e.length!==4||n===void 0||r===void 0||i===void 0||s===void 0?!0:n===0||n===10||n===127||n===100&&r>=64&&r<=127||n===169&&r===254||n===172&&r>=16&&r<=31||n===192&&r===168||n===192&&r===0&&i===0&&s!==9&&s!==10||n===192&&r===0&&i===2||n===198&&(r===18||r===19)||n===198&&r===51&&i===100||n===203&&r===0&&i===113||n>=224}o(_e,"isPrivateIpv4");function _n(t){if(Oe(t))return!0;let e=t.toLowerCase(),n=/^::ffff:(\d+\.\d+\.\d+\.\d+)$/.exec(e)?.[1];if(n)return _e(n);let r=/^::ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})$/.exec(e);if(r?.[1]&&r[2]){let i=Number.parseInt(r[1],16),s=Number.parseInt(r[2],16);return _e(`${i>>8}.${i&255}.${s>>8}.${s&255}`)}return e==="::"||e==="::1"||e.startsWith("fc")||e.startsWith("fd")||e.startsWith("fe8")||e.startsWith("fe9")||e.startsWith("fea")||e.startsWith("feb")||e.startsWith("ff")}o(_n,"isPrivateIpv6");function Un(t){let e=pt(t);return e===4?_e(t):e===6?_n(t):!0}o(Un,"isPrivateAddress");async function ft(t,e){if(t.protocol!=="https:"&&t.protocol!=="http:")throw new A(-32602,"A2A URL must use HTTP or HTTPS.");if(!e.allowedOrigins.includes(t.origin))throw new A(-32602,`A2A origin is not allowed: ${t.origin}`);if(t.username||t.password)throw new A(-32602,"A2A URL must not include credentials.");let n=t.hostname.startsWith("[")&&t.hostname.endsWith("]")?t.hostname.slice(1,-1):t.hostname,r=await xn(n,{all:!0,verbatim:!0});if(r.length===0)throw new A(-32602,"A2A hostname did not resolve.");if(n.toLowerCase()==="localhost"&&!r.every(a=>Oe(a.address)))throw new A(-32602,"A2A localhost target must resolve only to loopback addresses.");let i=On(n)&&r.every(a=>Oe(a.address));if(t.protocol==="http:"&&!i&&e.allowInsecureHttp!==!0)throw new A(-32602,"Non-loopback A2A targets must use HTTPS unless plaintext HTTP is explicitly allowed.");if(!e.allowPrivateAddresses&&r.some(a=>Un(a.address)))throw new A(-32602,"A2A private network targets are not allowed.");let s=r[0];if(s===void 0||s.family!==4&&s.family!==6)throw new A(-32602,"A2A hostname returned an unsupported address.");return{address:s.address,family:s.family}}o(ft,"validateA2AUrl");async function Mn(t,e){await ft(t,e)}o(Mn,"assertSafeA2AUrl");function Ln(t){if(t==null||typeof t=="string")return t??void 0;if(t instanceof URLSearchParams)return t.toString();if(t instanceof Uint8Array)return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new A(-32602,"A2A request body type is not supported by the safe transport.")}o(Ln,"encodeRequestBody");function qn(t){return((e,n,r)=>{if(typeof n=="object"&&n.all){r(null,[t]);return}r(null,t.address,t.family)})}o(qn,"pinnedLookup");function $n(t,e,n){return new Promise((r,i)=>{let s=new Headers(e.headers);s.set("accept-encoding","identity");let a=(t.protocol==="https:"?Cn:In)(t,{method:e.method,headers:Object.fromEntries(s),lookup:qn(n),signal:e.signal??void 0},c=>{let d=new Headers;for(let p=0;p<c.rawHeaders.length;p+=2){let h=c.rawHeaders[p],w=c.rawHeaders[p+1];h!==void 0&&w!==void 0&&d.append(h,w)}let u=c.statusCode??500,l=e.method!=="HEAD"&&u!==204&&u!==205&&u!==304?Pn.toWeb(c):null;r(new Response(l,{status:u,statusText:c.statusMessage,headers:d}))});a.once("error",i),a.end(Ln(e.body))})}o($n,"requestValidatedAddress");async function Ue(t,e,n,r){let i=await ft(t,n);return r!==void 0?r(t,e):$n(t,e,i)}o(Ue,"openSafeA2AResponse");async function Nn(t,e){let n=t.headers.get("content-length");if(n&&Number(n)>e)throw new A(-32603,"A2A response is too large.");if(!t.body)return new Uint8Array;let r=t.body.getReader(),i=[],s=0;for(;;){let d=await r.read();if(d.done)break;if(s+=d.value.byteLength,s>e)throw await r.cancel(),new A(-32603,"A2A response is too large.");i.push(d.value)}let a=new Uint8Array(s),c=0;for(let d of i)a.set(d,c),c+=d.byteLength;return a}o(Nn,"boundedBody");function Dn(t,e){if(!t)return{signal:e,cleanup:o(()=>{},"cleanup")};let n=new AbortController,r=o(()=>n.abort(t.reason),"abortFromCaller"),i=o(()=>n.abort(e.reason),"abortFromDeadline");return t.aborted?r():t.addEventListener("abort",r,{once:!0}),e.aborted?i():e.addEventListener("abort",i,{once:!0}),{signal:n.signal,cleanup:o(()=>{t.removeEventListener("abort",r),e.removeEventListener("abort",i)},"cleanup")}}o(Dn,"combineAbortSignals");async function G(t,e,n,r){let i=t,s=new Headers(e.headers).get("authorization");for(let a=0;a<=n.maxRedirects;a+=1){let c=new AbortController,d=setTimeout(()=>c.abort(new Error("A2A request timed out.")),n.requestTimeoutMs),u=Dn(e.signal,c.signal),f=new Headers(e.headers);s===null?f.delete("authorization"):f.set("authorization",s);try{let l=await Ue(i,{...e,headers:f,redirect:"manual",signal:u.signal},n,r);if(l.status<300||l.status>=400)return{response:l,body:await Nn(l,n.maxResponseBytes),url:i};let p=l.headers.get("location");if(!p||a===n.maxRedirects)throw new A(-32603,"A2A redirect limit exceeded.");let h=new URL(p,i);await l.body?.cancel(),h.origin!==i.origin&&(s=null),i=h}finally{clearTimeout(d),u.cleanup()}}throw new A(-32603,"A2A redirect limit exceeded.")}o(G,"safeA2AFetch");function X(t){return new TextDecoder("utf-8",{fatal:!0}).decode(t)}o(X,"decodeUtf8");import{createHash as Fn,randomUUID as Me}from"node:crypto";import*as K from"oauth4webapi";var Kn=6e4,jn=1e3,Bn=.1;function Hn(t,e){return new Response(e.byteLength===0?null:X(e),{status:t.status,statusText:t.statusText,headers:t.headers})}o(Hn,"oauthResponse");function zn(t,e){if(e===void 0||e<=0)return t;let n=e*1e3,r=Math.min(Kn,Math.max(jn,n*Bn));return t+Math.max(0,n-r)}o(zn,"cacheExpiry");function ht(t){let e=O(t.clientId,"OAuth 2.0 clientId");if(t.clientAuthenticationMethod!=="basic"&&t.clientAuthenticationMethod!=="post")throw new Error("OAuth 2.0 clientAuthenticationMethod must be basic or post.");let n=t.clientAuthenticationMethod,r=t.scopes===void 0?void 0:ie(t.scopes,"OAuth 2.0 scopes"),i=F(t.issuer,"OAuth 2.0 issuer"),s=N(t.tokenUrl,"OAuth 2.0 token endpoint"),a=t.resource===void 0?void 0:ne(t.resource,"OAuth 2.0 resource"),c={issuer:i,token_endpoint:s.href},d={client_id:e},u={...t.networkPolicy,maxRedirects:0},f=t.now??Date.now,l,p,h=0;async function w(k){let y=n==="post"?K.ClientSecretPost(k):K.ClientSecretBasic(k),E=new URLSearchParams;r&&r.length>0&&E.set("scope",r.join(" ")),a!==void 0&&E.set("resource",a);let m={[K.customFetch]:async(R,_)=>{if(new URL(R).href!==s.href)throw new Error("OAuth 2.0 token request targeted an unexpected endpoint.");let j=await G(s,{method:_.method,headers:_.headers,body:_.body,redirect:"manual",..._.signal!==void 0?{signal:_.signal}:{}},u,t.fetch);return Hn(j.response,j.body)}};s.protocol==="http:"&&(m[K.allowInsecureRequests]=!0);let S;try{let R=await K.clientCredentialsGrantRequest(c,d,y,E,m);S=await K.processClientCredentialsResponse(c,d,R)}catch{throw new Error("OAuth 2.0 client credentials token request failed.")}if(S.token_type!=="bearer")throw new Error("OAuth 2.0 token endpoint did not return a Bearer access token.");let L=f();return{value:`Bearer ${S.access_token}`,expiresAt:zn(L,S.expires_in)}}return o(w,"requestAuthorization"),{async getAuthorization(k){if(k.length===0)throw new Error("OAuth 2.0 client secret is required.");let y=f();if(l!==void 0&&l.expiresAt>y)return l.value;if(p!==void 0)return p;let E=h,m;return m=w(k).then(S=>(h===E&&S.expiresAt>f()&&(l=S),S.value)).finally(()=>{p===m&&(p=void 0)}),p=m,m},invalidate(k){if(k!==void 0){l?.value===k&&(l=void 0);return}h+=1,l=void 0,p=void 0}}}o(ht,"createOAuth2ClientCredentialsTokenManager");var gt=4,mt=/^[A-Za-z0-9\-._~+/=]$/u;function Se(t){return t!==void 0&&/^Bearer\s+\S+$/iu.test(t)}o(Se,"isBearerAuthorization");function Jn(t,e){let n="",r=0;for(;r<t.length;){let i=t.indexOf(e,r);if(i<0)return n+t.slice(r);let s=i===0?void 0:t[i-1],a=i+e.length,c=a===t.length?void 0:t[a],d=s===void 0||!mt.test(s),u=c===void 0||!mt.test(c);n+=t.slice(r,i),d&&u?(n+="[REDACTED]",r=a):(n+=e,r=a)}return n}o(Jn,"replaceBoundedToken");function Ae(t){return Array.isArray(t)?`[${t.map(Ae).join(",")}]`:g(t)?`{${Object.keys(t).sort().map(e=>`${JSON.stringify(e)}:${Ae(t[e])}`).join(",")}}`:JSON.stringify(t)??"null"}o(Ae,"stableJson");function yt(t){return`sha256:${Fn("sha256").update(t).digest("hex")}`}o(yt,"sha256");var qe=class{static{o(this,"AuthorizationRedactor")}#e=[];#n=new Map;remember(e){if(!e)return;let n=this.#e.indexOf(e);n>=0&&this.#e.splice(n,1),this.#e.unshift(e),this.#e.length>gt&&(this.#e.length=gt)}retain(e){if(!e)return()=>{};this.remember(e),this.#n.set(e,(this.#n.get(e)??0)+1);let n=!1;return()=>{if(n)return;n=!0;let r=(this.#n.get(e)??1)-1;r===0?this.#n.delete(e):this.#n.set(e,r)}}redactText(e){let n=[...new Set([...this.#n.keys(),...this.#e])],r=n.sort((s,a)=>a.length-s.length).reduce((s,a)=>s.split(a).join("[REDACTED]"),e),i=n.flatMap(s=>{let a=/^Bearer\s+(\S+)$/iu.exec(s)?.[1];return a?[a]:[]}).sort((s,a)=>a.length-s.length);return[...new Set(i)].reduce((s,a)=>Jn(s,a),r)}redactContent(e){return typeof e=="string"?this.redactText(e):Array.isArray(e)?e.map(n=>this.redactContent(n)):g(e)?Object.fromEntries(Object.entries(e).map(([n,r])=>[n,this.redactContent(r)])):e}redactPart(e){return{...e,...e.text===void 0?{}:{text:this.redactText(e.text)},...e.raw===void 0?{}:{raw:this.redactText(e.raw)},...e.url===void 0?{}:{url:this.redactText(e.url)},...e.data===void 0?{}:{data:this.redactContent(e.data)},...e.metadata===void 0?{}:{metadata:this.redactContent(e.metadata)},...e.filename===void 0?{}:{filename:this.redactText(e.filename)}}}redactMessage(e){return{...e,parts:e.parts.map(n=>this.redactPart(n)),...e.metadata===void 0?{}:{metadata:this.redactContent(e.metadata)}}}redactArtifact(e){return{...e,...e.name===void 0?{}:{name:this.redactText(e.name)},...e.description===void 0?{}:{description:this.redactText(e.description)},parts:e.parts.map(n=>this.redactPart(n)),...e.metadata===void 0?{}:{metadata:this.redactContent(e.metadata)}}}redactTask(e){return{...e,status:{...e.status,...e.status.message===void 0?{}:{message:this.redactMessage(e.status.message)}},...e.artifacts===void 0?{}:{artifacts:e.artifacts.map(n=>this.redactArtifact(n))},...e.history===void 0?{}:{history:e.history.map(n=>this.redactMessage(n))},...e.metadata===void 0?{}:{metadata:this.redactContent(e.metadata)}}}redactError(e){let n=this.redactText(e instanceof Error?e.message:String(e));return e instanceof A?new A(e.code,n,e.httpStatus,this.redactContent(e.data),e.headers):new Error(n)}};function wt(t,e){let n=new URL(e).origin;if(!t.allowedOrigins.some(i=>new URL(i).origin===n))throw new Error(`A2A endpoint origin is not allowed by network policy: ${n}`);return{...t,allowedOrigins:[n]}}o(wt,"endpointNetworkPolicy");function Wn(t){if(t!==void 0){if(!g(t)||typeof t.scheme!="string")throw new Error("A2A registration authentication is invalid.");if(t.type==="http-bearer")return{type:"http-bearer",scheme:t.scheme};if(t.type!=="oauth2-client-credentials"||typeof t.issuer!="string"||typeof t.tokenUrl!="string"||typeof t.clientId!="string"||!Array.isArray(t.scopes)||!t.scopes.every(e=>typeof e=="string")||!["client-secret-basic","client-secret-post"].includes(String(t.clientAuthentication)))throw new Error("A2A registration OAuth2 authentication is invalid.");return{type:"oauth2-client-credentials",scheme:t.scheme,issuer:t.issuer,tokenUrl:t.tokenUrl,clientId:t.clientId,scopes:t.scopes,...typeof t.resource=="string"?{resource:t.resource}:{},clientAuthentication:t.clientAuthentication}}}o(Wn,"executorAuthentication");function Q(t){let e=t.executorConfig;if(!g(e))throw new Error("A2A registration executorConfig is missing.");if(typeof e.agentCardUrl!="string"||typeof e.interfaceUrl!="string")throw new Error("A2A registration endpoints are invalid.");let n=Wn(e.authentication);return{agentCardUrl:e.agentCardUrl,interfaceUrl:e.interfaceUrl,...typeof e.tenant=="string"?{tenant:e.tenant}:{},...n?{authentication:n}:{}}}o(Q,"executorConfig");function Vn(t,e){let n=t.supportedInterfaces.find(i=>i.protocolBinding.toUpperCase()==="JSONRPC"&&i.protocolVersion==="1.0");if(!n)throw new Error("Agent Card has no supported A2A 1.0 JSONRPC interface.");let r=new URL(n.url);if(r.username||r.password||r.hash)throw new Error("A2A interface URL must not contain credentials or a fragment.");if(r.origin!==e.origin)throw new Error("A2A interface must use the same origin as the trusted Agent Card.");return n}o(Vn,"chooseInterface");function Gn(t){if(t===void 0)return;if(!g(t))throw new Error("A2A authentication must be an object.");let e=O(t.scheme,"A2A authentication.scheme");if(t.type==="http-bearer")return{type:"http-bearer",scheme:e,credentialRef:O(t.credentialRef,"A2A authentication.credentialRef")};if(t.type!=="oauth2-client-credentials")throw new Error("A2A authentication.type must be http-bearer or oauth2-client-credentials.");if(t.clientAuthentication!=="client-secret-basic"&&t.clientAuthentication!=="client-secret-post")throw new Error("A2A authentication.clientAuthentication is invalid.");return{type:"oauth2-client-credentials",scheme:e,issuer:F(t.issuer,"Configured OAuth2 issuer"),tokenUrl:N(t.tokenUrl,"Configured OAuth2 token endpoint").href,clientId:O(t.clientId,"Configured OAuth2 clientId"),clientSecretRef:O(t.clientSecretRef,"Configured OAuth2 clientSecretRef"),scopes:ie(t.scopes,"Configured OAuth2 scopes"),...t.resource===void 0?{}:{resource:ne(t.resource,"Configured OAuth2 resource")},clientAuthentication:t.clientAuthentication}}o(Gn,"validatedClientAuthentication");function Xn(t){let e=t.credentialRef===void 0?void 0:O(t.credentialRef,"A2A credentialRef"),n=Gn(t.authentication);if(t.credentialRef!==void 0&&t.authentication!==void 0)throw new Error("A2A registration cannot combine credentialRef with structured authentication.");return{agentId:t.agentId,agentCardUrl:t.agentCardUrl,...e!==void 0?{credentialRef:e}:{},...n!==void 0?{authentication:n}:{},effects:t.effects}}o(Xn,"validatedRegistrationInput");function Qn(t,e,n){if(t.authentication)return[[{schemeName:t.authentication.scheme,kind:t.authentication.type,...t.authentication.type==="oauth2-client-credentials"?{scopes:t.authentication.scopes}:{}}]];let r=Se(n);if(!t.credentialRef&&!r)return[[]];let i=J(e.securitySchemes,e.securityRequirements);return Object.values(i.schemes).flatMap(s=>s.kind==="http-bearer"?[[{schemeName:s.name,kind:"http-bearer"}]]:[])}o(Qn,"configuredCapabilityCandidates");function kt(t,e){for(let n of t){if(n.schemes.length!==1)continue;let r=n.schemes[0].scheme;if(e.some(i=>i.schemeName===r.name&&i.kind===r.kind))return r}}o(kt,"matchingDeclaredScheme");function Zn(t,e){let n=J(t.securitySchemes,t.securityRequirements),r=we(n,e).filter(a=>a.schemes.length<=1);if(r.length===0)return null;let i=kt(r,e),s=[];for(let a of t.skills){let c=J(t.securitySchemes,a.securityRequirements),d=we(c,e).filter(u=>u.schemes.length<=1);d.length!==0&&(s.push(a.id),i??=kt(d,e))}return t.skills.length>0&&s.length===0?null:{skillIds:s,...i?{declaredScheme:i}:{}}}o(Zn,"evaluateSecurityCapabilities");function Yn(t,e,n){if(t.credentialRef!==void 0&&t.authentication!==void 0)throw new Error("A2A registration cannot combine credentialRef with structured authentication.");if(n!==void 0&&!Se(n))throw new Error("A2A options.authorization must be a valid Bearer authorization.");let r=Se(n),i=t.credentialRef!==void 0||t.authentication!==void 0||r,s;for(let h of Qn(t,e,n)){let w=Zn(e,h);if(w&&(!i||w.declaredScheme)){s=w;break}}if(!s)throw new Error(i?"Configured A2A authentication cannot fully satisfy the Agent Card and any advertised Skill security requirements.":"Agent Card or at least one advertised Skill requires authentication, but no compatible A2A authentication is configured.");if(!i)return{skillIds:s.skillIds};let a=s.declaredScheme,c=t.authentication;if(!c&&!t.credentialRef&&r)return{skillIds:s.skillIds};if(!c)return{credentialRef:t.credentialRef,authentication:{type:"http-bearer",scheme:a.name},skillIds:s.skillIds};if(c.type==="http-bearer")return{credentialRef:c.credentialRef,authentication:{type:"http-bearer",scheme:c.scheme},skillIds:s.skillIds};if(a.kind!=="oauth2-client-credentials")throw new Error("Configured OAuth2 authentication does not match the selected Agent Card scheme.");let d=a,u=F(c.issuer,"Configured OAuth2 issuer"),f=N(c.tokenUrl,"Configured OAuth2 token endpoint").href,l=c.resource===void 0?void 0:ne(c.resource,"Configured OAuth2 resource");if(new URL(d.tokenUrl).href!==f)throw new Error("Configured OAuth2 tokenUrl does not match the selected Agent Card security scheme.");let p=c.scopes.find(h=>!d.scopes.includes(h));if(p)throw new Error(`Configured OAuth2 scope is not declared by the Agent Card: ${p}`);return{credentialRef:c.clientSecretRef,authentication:{type:"oauth2-client-credentials",scheme:c.scheme,issuer:u,tokenUrl:f,clientId:c.clientId,scopes:c.scopes,...l?{resource:l}:{},clientAuthentication:c.clientAuthentication},skillIds:s.skillIds}}o(Yn,"planClientAuthentication");function $e(t,e){try{return JSON.parse(t)}catch{throw new Error(`${e} returned invalid JSON.`)}}o($e,"parseJson");function Et(t){let e=t.maxTaskResponseBytes??t.networkPolicy.maxResponseBytes;if(!Number.isSafeInteger(e)||e<=0)throw new Error("A2A maxTaskResponseBytes must be a positive safe integer.");return e}o(Et,"taskResponseBytes");function er(t){return{...t.networkPolicy,maxResponseBytes:Et(t)}}o(er,"taskNetworkPolicy");async function Tt(t,e){let n=Xn(t),r=await G(new URL(n.agentCardUrl),{headers:{accept:"application/json"}},e.networkPolicy,e.fetch);if(!r.response.ok)throw new Error(`Agent Card request failed with HTTP ${r.response.status}.`);if(!de(r.response.headers.get("content-type")))throw new Error("Agent Card response is not JSON.");let i=ut($e(X(r.body),"Agent Card")),s=i.capabilities.extensions?.filter(f=>f.required)??[];if(s.length>0)throw new Error(`Agent Card required A2A extension(s) are unsupported: ${s.map(f=>f.uri).join(", ")}`);let a=Vn(i,r.url),c=Yn(n,i,e.authorization),d=Ae({agentCardUrl:r.url.href,interfaceUrl:a.url,protocolBinding:a.protocolBinding,protocolVersion:a.protocolVersion,tenant:a.tenant??"",authentication:c.authentication??null}),u=yt(Ae({card:i,endpointIdentity:d,credentialRef:c.credentialRef??null,effects:n.effects}));return{agentCard:i,registration:{agentId:n.agentId,displayName:i.name,description:i.description,enabled:!0,executorId:Pe,protocol:"a2a",configurationRevision:u,endpointIdentityHash:yt(d),...c.credentialRef?{credentialRef:c.credentialRef}:{},executorConfig:{agentCardUrl:r.url.href,interfaceUrl:a.url,...a.tenant?{tenant:a.tenant}:{},...c.authentication?{authentication:c.authentication}:{}},skills:c.skillIds,inputModalities:i.defaultInputModes,outputModalities:i.defaultOutputModes,capabilities:{streaming:i.capabilities.streaming?"supported":"unsupported",durableTasks:"supported",inputRequired:"supported",cancellation:"supported",artifacts:"supported"},effects:{remote:n.effects.remote,workspace:"proposal"},health:{status:"healthy",checkedAt:new Date().toISOString()}}}}o(Tt,"discoverA2ARegistration");function le(t){return t.metadata??{}}o(le,"metadata");function Ne(t){if(t===null||typeof t=="string"||typeof t=="boolean"||typeof t=="number"&&Number.isFinite(t))return t;if(Array.isArray(t))return t.map(Ne);if(g(t)){let e={};for(let[n,r]of Object.entries(t))e[n]=Ne(r);return e}throw new Error("A2A response metadata must be JSON-safe.")}o(Ne,"toAgentJsonValue");function St(t){let e=le(t).directMessage;return e===void 0?void 0:D(e)}o(St,"directMessage");function tr(t){return{TASK_STATE_UNSPECIFIED:"unknown",TASK_STATE_SUBMITTED:"submitted",TASK_STATE_WORKING:"working",TASK_STATE_COMPLETED:"completed",TASK_STATE_FAILED:"failed",TASK_STATE_CANCELED:"canceled",TASK_STATE_INPUT_REQUIRED:"input-required",TASK_STATE_REJECTED:"rejected",TASK_STATE_AUTH_REQUIRED:"auth-required"}[t]??"unknown"}o(tr,"taskState");function De(t){return t.flatMap(e=>e.text===void 0?[]:[e.text]).join(`
3
3
  `)}o(De,"textFromParts");function bt(t,e){let n=t.mediaType??(t.data!==void 0?"application/json":"application/octet-stream"),r=t.raw!==void 0?`data:${n};base64,${t.raw}`:t.data!==void 0?`data:${n};base64,${Buffer.from(JSON.stringify(t.data),"utf8").toString("base64")}`:void 0,i=t.url??r;if(i)return{name:e,...t.mediaType?{mimeType:t.mediaType}:{},...t.raw!==void 0?{size:Buffer.from(t.raw,"base64").byteLength}:{},uri:i,provenance:"a2a"}}o(bt,"partArtifactReference");function nr(t){let e=t.parts.find(n=>n.url!==void 0||n.raw!==void 0||n.data!==void 0);return e?bt(e,t.name??t.artifactId):void 0}o(nr,"artifactReference");function ue(t){let e=(t.artifacts??[]).flatMap(i=>De(i.parts)),n=t.status.message?De(t.status.message.parts):"",r=[...e,n].filter(Boolean).join(`
4
4
  `);return{state:tr(t.status.state),...r?{output:r}:{},...t.status.state==="TASK_STATE_FAILED"?{error:n||"Remote A2A task failed."}:{},...t.artifacts?.length?{artifacts:t.artifacts.flatMap(i=>nr(i)??[])}:{}}}o(ue,"snapshotFromTask");function Le(t){let e=De(t.parts),n=t.parts.flatMap((r,i)=>{if(r.text!==void 0)return[];let s=bt(r,r.filename??`message-part-${i+1}`);return s?[s]:[]});return{state:"completed",...e?{output:e}:{},...n.length>0?{artifacts:n}:{}}}o(Le,"snapshotFromMessage");function Rt(t){return t==="completed"||t==="failed"||t==="canceled"||t==="rejected"}o(Rt,"isTerminal");function rr(t,e,n){let r=t.get(e.artifactId);t.set(e.artifactId,n&&r?{...r,...e,parts:[...r.parts,...e.parts]}:e)}o(rr,"mergeStreamArtifact");var Re=class{constructor(e,n,r,i,s){this.registration=e;this.context=n;this.options=r;this.oauthTokenManager=i;this.releaseOAuthTokenManager=s}registration;context;options;oauthTokenManager;releaseOAuthTokenManager;static{o(this,"A2AClientExecutor")}#e=!1;#n=new Set;#t=new qe;async preflight(){try{return Q(this.registration),{ok:!0}}catch(e){return{ok:!1,reasons:[e instanceof Error?e.message:String(e)]}}}async start(e,n){let r=e.idempotencyKey;if(!r)throw new Error("A2A executor requires an idempotency key.");let i=await this.sendMessage({message:{messageId:r,role:"ROLE_USER",parts:[{text:e.input??e.objective,mediaType:"text/plain"}]},configuration:{returnImmediately:!0}},n);if(g(i.task)){let s=H(i.task);return{idempotencyKey:r,remoteTaskId:s.id,...s.contextId?{metadata:{contextId:s.contextId}}:{}}}if(i.message!==void 0){let s=this.#t.redactMessage(D(i.message));return{idempotencyKey:r,metadata:{directMessage:Ne(s)}}}throw new Error("A2A SendMessage returned neither task nor message.")}async*events(e){let n=St(e);if(n){yield await this.authorizeArtifacts(Le(this.#t.redactMessage(n)));return}if(this.registration.capabilities.streaming==="supported")try{yield*this.streamEvents(e);return}catch(r){if(this.#e)return;V({source:"a2a.client",level:"warn",message:"A2A event stream failed; polling fallback started.",detail:r}),yield{progress:{message:"A2A stream unavailable; polling."}}}for(;!this.#e;){let r=await this.get(e);if(yield r,Rt(r.state)||r.state==="input-required"||r.state==="auth-required")return;await new Promise(i=>setTimeout(i,this.options.pollIntervalMs))}}async get(e){let n=St(e);if(n)return this.authorizeArtifacts(Le(this.#t.redactMessage(n)));if(!e.remoteTaskId)throw new Error("A2A task reference has no remote task ID.");let r=H(await this.rpc("GetTask",this.taskParams(e)));return this.assertTaskReference(r,e),this.authorizeArtifacts(ue(this.#t.redactTask(r)))}async sendInput(e,n){if(!e.remoteTaskId)throw new Error("Direct A2A responses cannot accept input.");await this.sendMessage({message:{messageId:Me(),taskId:e.remoteTaskId,...typeof le(e).contextId=="string"?{contextId:le(e).contextId}:{},role:"ROLE_USER",parts:[{text:n.content,mediaType:"text/plain"}]},configuration:{returnImmediately:!0}})}async cancel(e){if(!e.remoteTaskId)return this.get(e);let n=H(await this.rpc("CancelTask",this.taskParams(e)));return this.assertTaskReference(n,e),this.authorizeArtifacts(ue(this.#t.redactTask(n)))}async reconcile(e){return this.get(e)}async dispose(){if(!this.#e){this.#e=!0;try{for(let e of this.#n)e.abort(new Error("A2A executor disposed."))}finally{this.releaseOAuthTokenManager?.()}}}async*streamEvents(e){if(!e.remoteTaskId)throw new Error("A2A stream requires a remote task ID.");let n=Q(this.registration),r=new URL(n.interfaceUrl),i=new Headers({accept:"text/event-stream","a2a-version":"1.0","content-type":"application/json"}),s=new AbortController,a=Me();this.#n.add(s);let c,d,u=o(()=>{d!==void 0&&clearTimeout(d),d=void 0},"disarmTimeout"),f=o(l=>{u(),d=setTimeout(()=>s.abort(new Error(l)),this.options.networkPolicy.requestTimeoutMs),d.unref?.()},"armTimeout");try{f("A2A stream connection timed out.");let l=await this.openStreamResponse(r,i,s.signal,{jsonrpc:"2.0",id:a,method:"SubscribeToTask",params:this.taskParams(e)}),p=l.response;if(c=l.releaseAuthorization,u(),!p.ok||!p.body)throw new Error(`A2A stream failed with HTTP ${p.status}.`);if(!ct(p.headers.get("content-type")))throw new Error("A2A stream returned an invalid content type.");let h=p.body.getReader(),w=new TextDecoder,k=new Map,y="",E=0;for(;!this.#e;){f("A2A stream was idle for too long.");let m=await h.read();if(u(),m.done)break;if(E+=m.value.byteLength,E>Et(this.options))throw new Error("A2A stream exceeded the response size limit.");y+=w.decode(m.value,{stream:!0});let S=y.split(/\r?\n\r?\n/);y=S.pop()??"";for(let L of S){let R=L.split(/\r?\n/).filter(j=>j.startsWith("data:")).map(j=>j.slice(5).trimStart()).join(`
5
5
  `);if(!R)continue;let _=await this.snapshotFromStreamPayload($e(R,"A2A stream"),a,e,k);if(_&&(yield _,_.state&&(Rt(_.state)||_.state==="input-required"||_.state==="auth-required")))return}}if(!this.#e)throw new Error("A2A event stream ended before the task reached a stable state.")}catch(l){throw this.#t.redactError(l)}finally{u(),c?.(),this.#n.delete(s)}}async snapshotFromStreamPayload(e,n,r,i){if(!g(e))throw new Error("A2A stream frame is invalid.");if(e.jsonrpc!=="2.0"||e.id!==n)throw new Error("A2A stream frame has an invalid JSON-RPC version or response id.");if(e.error!==void 0){let s=g(e.error)?e.error:{},a=typeof s.message=="string"?s.message:"A2A stream error.";throw new A(typeof s.code=="number"?s.code:-32603,this.#t.redactText(a))}if(g(e.result)){if(e.result.task!==void 0){let s=H(e.result.task);this.assertTaskReference(s,r),i.clear();for(let a of s.artifacts??[])i.set(a.artifactId,a);return this.authorizeArtifacts(ue(this.#t.redactTask(s)))}if(e.result.message!==void 0){let s=D(e.result.message);if(s.taskId!==void 0&&s.taskId!==r.remoteTaskId)throw new Error("A2A stream message belongs to a different task.");return this.authorizeArtifacts(Le(this.#t.redactMessage(s)))}if(g(e.result.statusUpdate)&&g(e.result.statusUpdate.status)){this.assertStreamTaskScope(e.result.statusUpdate,r);let s=H({id:r.remoteTaskId,contextId:e.result.statusUpdate.contextId,status:e.result.statusUpdate.status,...i.size>0?{artifacts:[...i.values()]}:{}});return this.authorizeArtifacts(ue(this.#t.redactTask(s)))}if(g(e.result.artifactUpdate)&&e.result.artifactUpdate.artifact!==void 0){this.assertStreamTaskScope(e.result.artifactUpdate,r);let s=H({id:r.remoteTaskId,contextId:e.result.artifactUpdate.contextId,status:{state:"TASK_STATE_WORKING"},artifacts:[e.result.artifactUpdate.artifact]}),a=s.artifacts?.[0];if(!a)throw new Error("A2A artifact update has no artifact.");rr(i,a,e.result.artifactUpdate.append===!0);let c={...s,artifacts:[...i.values()]};return this.authorizeArtifacts(ue(this.#t.redactTask(c)))}}}async authorizeArtifacts(e){for(let n of e.artifacts??[])await this.context.authorizeArtifact(n);return e}assertTaskReference(e,n){if(e.id!==n.remoteTaskId)throw new Error("A2A response belongs to a different task id.");let r=le(n).contextId;if(typeof r=="string"&&e.contextId&&e.contextId!==r)throw new Error("A2A response belongs to a different task context.")}assertStreamTaskScope(e,n){if(typeof e.taskId!="string"||e.taskId!==n.remoteTaskId)throw new Error("A2A stream event belongs to a different task.");let r=le(n).contextId;if(typeof e.contextId!="string"||typeof r=="string"&&e.contextId!==r)throw new Error("A2A stream event belongs to a different task context.")}async openStreamResponse(e,n,r,i){let s=o(a=>{let c=new Headers(n);return a&&c.set("authorization",a),Ue(e,{method:"POST",headers:c,redirect:"manual",signal:r,body:JSON.stringify(i)},this.options.networkPolicy,this.options.fetch)},"open");return this.withAuthorization(async a=>{let c=this.#t.retain(a);try{let d=await s(a);if(d.status===401)throw await d.body?.cancel(),new A(-32600,"A2A authentication was rejected.",401);return{response:d,releaseAuthorization:c}}catch(d){throw c(),d}})}taskParams(e){let n=Q(this.registration);return{id:e.remoteTaskId,...n.tenant?{tenant:n.tenant}:{}}}async sendMessage(e,n){let r=await this.rpc("SendMessage",{...e,...Q(this.registration).tenant?{tenant:Q(this.registration).tenant}:{}},n);if(!g(r))throw new Error("A2A SendMessage result is invalid.");return r}async rpc(e,n,r){if(this.#e)throw new Error("A2A executor is disposed.");return this.withAuthorization(i=>this.rpcWithAuthorization(e,n,i,r))}redactRpcResult(e,n){return e==="GetTask"||e==="CancelTask"?this.#t.redactTask(H(n)):e!=="SendMessage"||!g(n)?n:{...n,...n.task===void 0?{}:{task:this.#t.redactTask(H(n.task))},...n.message===void 0?{}:{message:this.#t.redactMessage(D(n.message))}}}async withAuthorization(e){let n=Q(this.registration).authentication;if(!n){if(this.options.authorization!==void 0&&!Se(this.options.authorization))throw new Error("A2A options.authorization must be a valid Bearer authorization.");let c=this.#t.retain(this.options.authorization);try{return await e(this.options.authorization)}catch(d){throw this.#t.redactError(d)}finally{c()}}let r=this.registration.credentialRef;if(!r)throw new Error("Authenticated A2A registration has no credential reference.");let i=o(c=>this.context.withCredential(r,async d=>{let u,f;try{return u=n.type==="http-bearer"?`Bearer ${d}`:await this.requireOAuthTokenManager().getAuthorization(d),f=this.#t.retain(u),{ok:!0,value:await e(u)}}catch(l){if(c&&n.type==="oauth2-client-credentials"&&l instanceof A&&l.httpStatus===401&&u!==void 0)return{ok:!1,rejectedAuthorization:u};throw this.#t.redactError(l)}finally{f?.()}}),"execute"),s=await i(n.type==="oauth2-client-credentials");if(s.ok)return s.value;this.requireOAuthTokenManager().invalidate(s.rejectedAuthorization);let a=await i(!1);if(!a.ok)throw new Error("A2A OAuth2 retry did not produce a result.");return a.value}requireOAuthTokenManager(){if(!this.oauthTokenManager)throw new Error("A2A OAuth2 token manager is unavailable.");return this.oauthTokenManager}async rpcWithAuthorization(e,n,r,i){let s=Q(this.registration),a=new Headers({accept:"application/json","a2a-version":"1.0","content-type":"application/json"});r&&a.set("authorization",r);let c=Me(),d=await G(new URL(s.interfaceUrl),{method:"POST",headers:a,body:JSON.stringify({jsonrpc:"2.0",id:c,method:e,params:n}),...i?{signal:i}:{}},er(this.options),this.options.fetch);if(d.response.status===401)throw new A(-32600,"A2A authentication was rejected.",401);if(!de(d.response.headers.get("content-type")))throw new Error("A2A JSON-RPC response has an invalid content type.");let u=$e(X(d.body),"A2A endpoint");if(!g(u))throw new Error("A2A JSON-RPC response is invalid.");if(u.jsonrpc!=="2.0"||u.id!==c)throw new Error("A2A JSON-RPC response has an invalid version or response id.");let f=Object.hasOwn(u,"result"),l=Object.hasOwn(u,"error");if(f===l)throw new Error("A2A JSON-RPC response must contain exactly one result or error.");if(l)throw!g(u.error)||typeof u.error.code!="number"||typeof u.error.message!="string"?new Error("A2A JSON-RPC error response is invalid."):new A(u.error.code,this.#t.redactText(u.error.message),d.response.status,this.#t.redactContent(u.error.data));if(!d.response.ok)throw new Error(`A2A request failed with HTTP ${d.response.status}.`);return this.redactRpcResult(e,u.result)}};function xt(t){let e=new Map;return{executorId:Pe,protocol:"a2a",async create(n,r){let i=typeof t=="function"?t(n):t,s=Q(n),a=s.authentication,c={...i,networkPolicy:wt(i.networkPolicy,s.interfaceUrl)},d;if(a?.type==="oauth2-client-credentials"){let p=wt(i.networkPolicy,a.tokenUrl),h=Ae({authentication:a,credentialRef:n.credentialRef??"",networkPolicy:p}),w=e.get(n.agentId);if(d=w?.key===h&&w.fetch===i.fetch?w:void 0,!d){let k=ht({issuer:a.issuer,tokenUrl:a.tokenUrl,clientId:a.clientId,scopes:a.scopes,...a.resource?{resource:a.resource}:{},clientAuthenticationMethod:a.clientAuthentication==="client-secret-post"?"post":"basic",networkPolicy:p,...i.fetch?{fetch:i.fetch}:{}});d={key:h,fetch:i.fetch,manager:k,references:0},e.set(n.agentId,d)}}if(!d)return new Re(n,r,c);let u=d;u.references+=1;let f=!1,l=o(()=>{f||(f=!0,u.references-=1,u.references===0&&(u.manager.invalidate(),e.get(n.agentId)===u&&e.delete(n.agentId)))},"releaseOAuthTokenManager");return new Re(n,r,c,u.manager,l)}}}o(xt,"createA2AAgentExecutorFactory");import{createHash as ar,randomUUID as he}from"node:crypto";import W from"node:fs";import{createServer as cr}from"node:http";import b from"node:path";import{Readable as Pt}from"node:stream";import{createHash as ir}from"node:crypto";var Z="realm-subject-tenant-v1";function It(t){return ir("sha256").update(t).digest("hex")}o(It,"sha256");function Ct(t){return It(`${t.subject}\0${t.tenant??""}`)}o(Ct,"legacyA2APrincipalKey");function Ee(t){return It(JSON.stringify([t.securityRealm,t.subject,t.tenant??null]))}o(Ee,"realmA2APrincipalKey");import T from"node:fs";import pe from"node:path";import{createHash as sr}from"node:crypto";function Y(t){return structuredClone(t)}o(Y,"clone");function or(t){if(!g(t))throw new Error("A2A task store record must be an object.");for(let r of["taskId","contextId","principalKey","runtimeIdentity","sessionId","createdAt","updatedAt"])if(typeof t[r]!="string")throw new Error(`A2A task store record has invalid ${r}.`);if(!g(t.messageDigests)||!Object.values(t.messageDigests).every(r=>typeof r=="string"))throw new Error("A2A task store message digests are invalid.");if(!Array.isArray(t.runIds)||!t.runIds.every(r=>typeof r=="string"))throw new Error("A2A task store run IDs are invalid.");if(!Array.isArray(t.history))throw new Error("A2A task store history is invalid.");if(t.principalKeyScheme!==void 0&&t.principalKeyScheme!==Z)throw new Error("A2A task store principal key scheme is unsupported.");if(!Number.isSafeInteger(t.eventSeq))throw new Error("A2A task store event cursors are invalid.");let e=vt(t.runtimeSessionCursor);if(t.runtimeSessionCursor!==void 0&&e===void 0)throw new Error("A2A task store Runtime Session cursor is invalid.");let n=t.pendingUserInput;if(n!==void 0&&(!g(n)||typeof n.requestId!="string"||!Number.isSafeInteger(n.revision)||typeof n.runId!="string"||typeof n.kind!="string"))throw new Error("A2A task store pending user input is invalid.");if(t.acceptedOutputModes!==void 0&&(!Array.isArray(t.acceptedOutputModes)||!t.acceptedOutputModes.every(r=>typeof r=="string")))throw new Error("A2A task store accepted output modes are invalid.");return{taskId:t.taskId,contextId:t.contextId,principalKey:t.principalKey,...t.principalKeyScheme===Z?{principalKeyScheme:Z}:{},runtimeIdentity:t.runtimeIdentity,sessionId:t.sessionId,...typeof t.workspaceRoot=="string"?{workspaceRoot:t.workspaceRoot}:{},...typeof t.executionPolicyRevision=="string"?{executionPolicyRevision:t.executionPolicyRevision}:{},messageDigests:t.messageDigests,runIds:t.runIds,task:H(t.task),history:t.history.map(D),createdAt:t.createdAt,updatedAt:t.updatedAt,eventSeq:t.eventSeq,...e!==void 0?{runtimeSessionCursor:e}:{},runtimeEventCount:Number.isSafeInteger(t.runtimeEventCount)?t.runtimeEventCount:0,runtimeEventBytes:Number.isSafeInteger(t.runtimeEventBytes)?t.runtimeEventBytes:0,...t.acceptedOutputModes!==void 0?{acceptedOutputModes:t.acceptedOutputModes}:{},...n!==void 0?{pendingUserInput:{requestId:n.requestId,revision:n.revision,runId:n.runId,kind:n.kind}}:{}}}o(or,"parseRecord");function vt(t){if(!(!g(t)||typeof t.sessionId!="string"||t.sessionId.length===0||typeof t.journalEpoch!="string"||t.journalEpoch.length===0||!Number.isSafeInteger(t.seq)||typeof t.seq!="number"||t.seq<0))return{sessionId:t.sessionId,journalEpoch:t.journalEpoch,seq:t.seq}}o(vt,"parseRuntimeSessionCursor");var oe=class{static{o(this,"A2AFileTaskStore")}#e=new Map;#n=new Map;#t;#s;#r;#i;constructor(e){let n=pe.resolve(e);T.mkdirSync(n,{recursive:!0,mode:448}),this.#t=pe.join(n,"tasks.json"),this.#s=pe.join(n,"runtime-cursors"),this.#r=pe.join(n,".server.lock"),this.#i=this.acquireLock();try{this.load()}catch(r){throw T.closeSync(this.#i),T.rmSync(this.#r,{force:!0}),r}}get(e){let n=this.#e.get(e);return n?Y(n):void 0}findByMessage(e,n){for(let r of this.#e.values())if(r.principalKey===e&&r.messageDigests[n]!==void 0)return Y(r)}list(e){return[...this.#e.values()].filter(n=>n.principalKey===e).sort((n,r)=>r.updatedAt.localeCompare(n.updatedAt)||r.taskId.localeCompare(n.taskId)).map(Y)}all(){return[...this.#e.values()].map(Y)}save(e){let n=Y(e),r=this.#e.get(e.taskId);this.#e.set(e.taskId,n);try{this.persist()}catch(i){throw r?this.#e.set(e.taskId,r):this.#e.delete(e.taskId),i}for(let i of this.#n.get(e.taskId)??[])i(Y(n));return Y(n)}checkpointRuntimeCursor(e,n){let r=this.#e.get(e);if(!r)return;if(n.sessionId!==r.sessionId)throw new Error(`A2A Runtime cursor belongs to another Session: ${e}`);let i={...r,runtimeSessionCursor:{...n}};this.#e.set(e,i);try{this.persistRuntimeCursor(e,n)}catch(s){throw this.#e.set(e,r),s}}pruneTerminal(e,n){let r=[...this.#e.values()].filter(s=>s.principalKey===e).sort((s,a)=>s.updatedAt.localeCompare(a.updatedAt)),i=[];for(;r.length>n;){let s=r.findIndex(c=>c.task.status.state==="TASK_STATE_COMPLETED"||c.task.status.state==="TASK_STATE_FAILED"||c.task.status.state==="TASK_STATE_CANCELED"||c.task.status.state==="TASK_STATE_REJECTED");if(s<0)break;let[a]=r.splice(s,1);if(!a)break;this.#e.delete(a.taskId),this.#n.delete(a.taskId),i.push(Y(a))}i.length>0&&this.persist();for(let s of i)T.rmSync(this.runtimeCursorFile(s.taskId),{force:!0});return i}migrateUnversionedPrincipalKeys(e){let n=0,r=0,i=0,s=[];for(let[a,c]of this.#e){if(c.principalKeyScheme!==void 0)continue;let d=e.legacyToCurrent.get(c.principalKey);d!==void 0?(n+=1,s.push([a,{...c,principalKey:d,principalKeyScheme:Z}])):e.currentKeys.has(c.principalKey)?(r+=1,s.push([a,{...c,principalKeyScheme:Z}])):i+=1}if(e.apply&&s.length>0){for(let[a,c]of s)this.#e.set(a,c);this.persist()}return{matchedLegacyTaskCount:n,matchedCurrentTaskCount:r,unmatchedUnversionedTaskCount:i}}subscribe(e,n){let r=this.#n.get(e)??new Set;return r.add(n),this.#n.set(e,r),()=>{r.delete(n),r.size===0&&this.#n.delete(e)}}close(){this.#n.clear(),T.closeSync(this.#i),T.rmSync(this.#r,{force:!0})}acquireLock(){let e=o(()=>{let n=T.openSync(this.#r,"wx",384);return T.writeFileSync(n,`${process.pid}
@@ -1,20 +1,20 @@
1
- import { aE as MemoryContextIdentity, au as MemoryActionProposal, aM as MemoryItemRef, av as MemoryApplicability, ab as KodaXSessionLineage, $ as KodaXMemoryOutcomeDigest, ak as KodaXSessionStorage, a6 as KodaXSessionData, V as KodaXGoalState, U as KodaXGoalEventType, a7 as KodaXSessionEntry, a9 as KodaXSessionGoalEntry, a2 as KodaXSessionArtifactLedgerEntry, S as KodaXExtensionStore, T as KodaXExtensionStoreEntry, Y as KodaXJsonValue, k as AgentBudgetExhausted, x as AgentLimitReached } from './types-chunks/types.d-DlLBRqZ9.js';
2
- export { A as AgentActor, a as AgentActorClient, b as AgentActorOwner, c as AgentActorSnapshot, d as AgentActorSnapshotV1, e as AgentActorSnapshotV2, f as AgentActorState, g as AgentActorStore, h as AgentArtifactDescriptor, i as AgentBudgetAdmission, j as AgentBudgetAdmissionInput, l as AgentBudgetPort, m as AgentCapabilities, n as AgentDataClassification, o as AgentDetail, p as AgentEvent, q as AgentEventKind, r as AgentExecutionInput, s as AgentExecutionKind, t as AgentExecutionResult, u as AgentFollowupResult, v as AgentForkTurns, w as AgentInterruptScope, y as AgentListEntry, z as AgentMailboxMessage, B as AgentMetadataValue, C as AgentMutationOptions, D as AgentOutput, E as AgentProgressItem, F as AgentProgressKind, G as AgentProgressUpdate, H as AgentSpawnInput, I as AgentTreeSnapshot, J as AgentTurn, K as AgentTurnExecutor, L as AgentTurnRef, M as AgentTurnState, N as AgentTurnSummary, O as KodaXCompactMemoryProgress, P as KodaXCompactMemorySeed, Q as KodaXExtensionSessionRecord, R as KodaXExtensionSessionState, W as KodaXGoalStatus, X as KodaXHandledMemoryOperation, Z as KodaXMemoryInfluenceRef, _ as KodaXMemoryIntent, a0 as KodaXMemoryOutcomeEvidence, a1 as KodaXSessionArchiveMarkerEntry, a3 as KodaXSessionBranchSummaryEntry, a4 as KodaXSessionClientNoticeEntry, a5 as KodaXSessionCompactionEntry, a8 as KodaXSessionEntryBase, aa as KodaXSessionLabelEntry, ac as KodaXSessionMemoryOutcomeDigestEntry, ad as KodaXSessionMemoryReviewReceiptEntry, ae as KodaXSessionMessageEntry, af as KodaXSessionMeta, ag as KodaXSessionNavigationOptions, ah as KodaXSessionRewindMarkerEntry, ai as KodaXSessionRuntimeInfo, aj as KodaXSessionScope, al as KodaXSessionTreeNode, am as KodaXSessionUiHistoryItem, an as KodaXSessionUiHistoryItemType, ao as KodaXSessionUiTextHistoryItem, ap as KodaXSessionUiTextHistoryItemType, aq as KodaXSessionUiToolCall, ar as KodaXSessionUiToolCallStatus, as as KodaXSessionUiToolGroupHistoryItem, at as KodaXSessionWorkspaceKind, aw as MemoryApplyPreview, ax as MemoryApplyResult, ay as MemoryApproval, az as MemoryAuthority, aC as MemoryBodySnapshot, aD as MemoryClaimKind, aF as MemoryController, aG as MemoryCuratorInput, aH as MemoryEpisodeReviewResult, aI as MemoryEvent, aJ as MemoryGovernanceFinding, aK as MemoryGovernanceFindingKind, aL as MemoryGovernanceReport, aN as MemoryLifecycle, aO as MemoryLifecycleOperationResult, aP as MemoryManagementController, aQ as MemoryPack, aR as MemoryPackHint, aS as MemoryPackInput, aT as MemoryPackTraceMetadata, aU as MemoryProposalAction, aV as MemoryRefFilter, aW as MemoryRefKind, aX as MemoryRejectResult, aY as MemoryRememberInput, aZ as MemoryRememberResult, a_ as MemoryReviewCandidateRef, a$ as MemoryReviewDraftAction, b0 as MemoryReviewInput, b1 as MemoryReviewModelInput, b2 as MemoryReviewPersistenceDecision, b3 as MemoryReviewPersistenceKind, b4 as MemoryReviewPlan, b5 as MemoryReviewRunner, b6 as MemoryReviewTrigger, b7 as MemoryScope, b8 as MemorySourceAdapter, b9 as MemoryVisibility, ba as SessionErrorMetadata, bb as hashMemoryIdentityComponent, bc as isMemoryManagementController, bd as matchesMemoryApplicability, be as memoryApplicabilityFingerprint } from './types-chunks/types.d-DlLBRqZ9.js';
3
- import { M as WorkflowScriptManifest } from './types-chunks/capsule.d-CN_iMqAS.js';
4
- export { C as CompactionContext, a as CompactionEntry, b as CompactionEntryPayload, c as CompactionPolicy, d as CreateWorkflowCapsuleInput, D as DefaultSummaryCompaction, e as DefaultSummaryCompactionOptions, K as KODAX_API_MIN_INTERVAL, f as KODAX_DEFAULT_TIMEOUT, g as KODAX_HARD_TIMEOUT, h as KODAX_MAX_INCOMPLETE_RETRIES, i as KODAX_MAX_MAXTOKENS_RETRIES, j as KODAX_MAX_RETRIES, k as KODAX_MAX_TOKENS, l as KODAX_RETRY_BASE_DELAY, m as KODAX_STAGGER_DELAY, L as LINEAGE_ENTRY_TYPES, n as LineageArtifactLedgerPayload, o as LineageCompaction, p as LineageCompactionDelegates, q as LineageEntryType, r as LineageExtension, s as LineageLabelPayload, t as LineageTreeNode, P as PROMISE_PATTERN, u as PolicyCompactionResult, W as WORKFLOW_CAPSULE_API_VERSION, v as WORKFLOW_CAPSULE_FORMAT, w as WORKFLOW_CAPSULE_VERSION, x as WORKFLOW_PATTERN_IDS, y as WorkflowCapsule, z as WorkflowCapsuleEnvironmentRequirement, A as WorkflowCapsuleInputs, B as WorkflowCapsuleIntent, E as WorkflowCapsuleProvenance, F as WorkflowCapsuleRequirements, G as WorkflowPatternId, H as WorkflowQualityLintFinding, I as WorkflowQualityLintOptions, J as WorkflowQualityLintSeverity, _ as _resetActiveRootQueueRoutesForTests, N as actorQueueId, O as appendSessionLineageLabel, Q as applyLineageTruncation, R as applySessionCompaction, S as archiveOldIslands, T as assertRestrictedWorkflowQuality, U as buildSessionTree, V as buildWorkflowCapsuleIntent, X as cleanupIncompleteToolCalls, Y as countActiveLineageMessages, Z as countTokens, $ as createSessionLineage, a0 as createWorkflowCapsule, a1 as createWorkflowModuleFromCapsule, a2 as estimateTokens, a3 as evictOldIslandMessageContent, a4 as extractArtifactLedger, a5 as extractFileOps, a6 as extractTitleFromMessages, a7 as findPreviousUserEntryId, a8 as forkSessionLineage, a9 as generateSessionId, aa as generateSessionIdSync, ab as getAgentConfigHome, ac as getAgentConfigPath, ad as getAppDataDir, ae as getSessionLineagePath, af as getSessionMessageEntryId, ag as getSessionMessagesFromLineage, ah as isPathInsideDirectory, ai as lintRestrictedWorkflowSource, aj as mergeArtifactLedger, ak as mergeFileOps, al as registerActiveRootQueueRoute, am as resolveActiveRootQueueRoute, an as resolveExecutionPath, ao as resolveSessionLineageTarget, ap as rewindSessionLineage, aq as setAgentConfigHome, ar as setSessionLineageActiveEntry, as as validateAndFixToolHistory, at as validateWorkflowCapsule, au as validateWorkflowScriptManifest } from './types-chunks/capsule.d-CN_iMqAS.js';
5
- import { ci as Span, cD as Trace, f as Agent, aQ as Handoff, c5 as RunnerToolCall, c8 as RunnerToolResult, P as AgentMessage, O as AgentManifest, bJ as ManifestPatch, aV as InvariantId, bS as QualityInvariant, b0 as KodaXInputArtifactSource, a_ as KodaXImageMediaType, b2 as KodaXVideoMediaType, aY as KodaXFileInputArtifact, aZ as KodaXImageInputArtifact, b1 as KodaXVideoInputArtifact, a$ as KodaXInputArtifact, at as DiscoveredInstance, cg as SessionMeta, ch as SessionStateSnapshot, cq as StateWriterFs, aU as InstanceDiscoveryFs, cp as StateWriter, cs as StopHookContext, cu as StopHookResult, ct as StopHookFn, bq as LearningActionDriver, bA as LearningQuery, bz as LearningPage, bc as LearnedCapabilityRecord, bF as LearningSurfaceSnapshot, bv as LearningEvent, bE as LearningSubscribeOptions, bx as LearningExplicitUserAuthority, b4 as LearnedAreaStore, bf as LearnedCapabilityScope, am as CompactionUpdate, ah as CompactionConfig, ai as CompactionDetails, ak as CompactionResult, dl as WorkflowRunState, c$ as WorkflowOutcome, cM as WorkflowApi, c_ as WorkflowModule, cL as WorkflowAgentBackend, cW as WorkflowLimits, cR as WorkflowEvent, cX as WorkflowLogEvent, ds as WorkflowTaskResult, H as AgentExecutorPlaneStore, an as CreateAgentExecutorPlaneOptions, D as AgentExecutorPlane, aD as ExternalAgentProtocol, B as AgentExecutorFactory } from './types-chunks/controller.d-Dzxz22X-.js';
6
- export { A as ASK_USER_BACK_SIGNAL, a as ASK_USER_CUSTOM_INPUT_SIGNAL, b as AdmissionAuditOptions, c as AdmissionCtx, d as AdmissionVerdict, e as AdmittedHandle, g as AgentActorController, h as AgentArtifactPolicy, i as AgentArtifactPolicyDecision, j as AgentArtifactPolicyInput, k as AgentArtifactReference, l as AgentCapabilityDeclaration, m as AgentCapabilityRequirements, n as AgentContinuationInput, o as AgentControllerHealth, p as AgentControllerOptions, q as AgentCredentialBroker, r as AgentDispatchContext, s as AgentDispatchPolicy, t as AgentDispatchPolicyDecision, u as AgentDispatchPolicyInput, v as AgentDispatchabilitySnapshot, w as AgentDispatchabilityStatus, x as AgentEffectDeclaration, y as AgentExecutor, z as AgentExecutorEvent, C as AgentExecutorFactoryContext, E as AgentExecutorPlaneBackgroundErrorContext, F as AgentExecutorPlaneBackgroundErrorHandler, G as AgentExecutorPlaneBinding, I as AgentExecutorPreflightResult, J as AgentExecutorProtocol, K as AgentExecutorTaskReference, L as AgentExecutorTaskSnapshot, M as AgentJsonObject, N as AgentJsonValue, Q as AgentMiddlewareDeclaration, R as AgentPreflightInput, S as AgentPreflightResult, T as AgentReasoningProfile, U as AgentRegistrationEnabledMutationOptions, V as AgentRegistrationMutationOptions, W as AgentRegistrationService, X as AgentSpanData, Y as AgentTaskCancellation, Z as AgentTaskCorrelation, _ as AgentTaskEvent, $ as AgentTaskFilter, a0 as AgentTaskProgress, a1 as AgentTaskRegistrationSnapshot, a2 as AgentTaskService, a3 as AgentTaskSnapshot, a4 as AgentTaskStartInput, a5 as AgentTaskState, a6 as AgentTaskUsage, a7 as AgentTool, a8 as AskUserAnswer, a9 as AskUserCustomInputAnswer, aa as AskUserMultiOptions, ab as AskUserQuestionItem, ac as AskUserQuestionOptions, ad as AskUserSelectionAnswer, ae as CapabilitySupport, af as CommitLearnedSkillRevisionInput, ag as CompactionAnchor, aj as CompactionReport, al as CompactionSpanData, ao as CreateLearnedSkillRecordInput, ap as CurrentTodoSummary, aq as DEFAULT_SYSTEM_CAP, ar as DeclarativeSkillSpec, as as Deliverable, au as DiscoveryOptions, av as DispatchableAgentDescriptor, aw as DispatchableAgentListing, ax as DispatchableAgentOrigin, ay as DispatchableAgentQuery, az as EvidenceSpanData, aA as ExactInvokedSkillSnapshot, aB as ExternalAgentEffectDeclaration, aC as ExternalAgentHealth, aE as ExternalAgentRegistration, aF as ExternalAgentRegistrationSummary, aG as FanoutSpanData, aH as FileOperations, aI as GenerationSpanData, aJ as Guardrail, aK as GuardrailBlockedError, aL as GuardrailContext, aM as GuardrailEscalateError, aN as GuardrailPermissionIntent, aO as GuardrailSpanData, aP as GuardrailVerdict, aR as HandoffSpanData, aS as InMemorySessionOptions, aT as InputGuardrail, aW as InvariantResult, aX as InvariantSession, b3 as LearnedAreaPaths, b5 as LearnedCapabilityArtifact, b6 as LearnedCapabilityCanary, b7 as LearnedCapabilityCanaryBinding, b8 as LearnedCapabilityCanaryInvocation, b9 as LearnedCapabilityCarrier, ba as LearnedCapabilityLifecycle, bb as LearnedCapabilityProvenance, bd as LearnedCapabilityRecordV1, be as LearnedCapabilityRecordV2, bg as LearnedCapabilitySource, bh as LearnedSkillBindingAdmission, bi as LearnedSkillCanaryOutcome, bj as LearnedSkillDecisionDisposition, bk as LearnedSkillInvocationAdmission, bl as LearnedSkillInvokedReceipt, bm as LearnedSkillOfferedReceipt, bn as LearnedSkillOutcomeReceipt, bo as LearnedSkillUsageReceipt, bp as LearningAction, br as LearningCapabilityError, bs as LearningCapabilityErrorCode, bt as LearningClientEventState, bu as LearningClientRecord, bw as LearningEventKind, by as LearningNotificationState, bB as LearningReviewEvidencePacket, bC as LearningReviewQualification, bD as LearningReviewVerifierFact, bG as LocalAgentTaskInput, bH as LocalAgentTaskUpdate, bI as MAX_TOOL_LOOP_ITERATIONS, bK as MemoryDecisionTraceReceipt, bL as MessageEntry, bM as NormalizedLearnedSkillDecision, bN as ObserveCtx, bO as OutputGuardrail, bP as PersistedSessionState, bQ as PresetDispatcher, bR as PresetTracingContext, bT as ReadonlyMutationTracker, bU as ReadonlyRecorder, bV as ReasoningDepth, bW as RecentlyModifiedFile, bX as RunEvent, bY as RunOptions, bZ as RunResult, b_ as RunnableTool, b$ as Runner, c0 as RunnerEvent, c1 as RunnerIterationLimitError, c2 as RunnerLlmResult, c3 as RunnerLlmReturn, c4 as RunnerRecoveryTranscriptCarrier, c6 as RunnerToolContext, c7 as RunnerToolObserver, c9 as RunnerToolResultBatch, ca as RunnerToolResultBatchTransform, cb as Session, cc as SessionDispatchResult, cd as SessionEntry, ce as SessionExtension, cf as SessionForkOptions, cj as SpanData, ck as SpanError, cl as SpanImpl, cm as SpanImplOptions, cn as StagedLearnedSkillArtifact, co as StartTraceOptions, cr as StateWriterOptions, cv as StopHookSpanData, cw as SystemCap, cx as TerminalCtx, cy as ToolBeforeOutcome, cz as ToolCallSpanData, cA as ToolCapability, cB as ToolGuardrail, cC as ToolPermission, cE as TraceOptions, cF as Tracer, cG as TracerOptions, cH as UnifiedLearningReviewModelInput, cI as UnifiedLearningReviewResult, cJ as UnifiedLearningReviewRunner, cK as UserInteraction, cN as WorkflowApproval, cO as WorkflowApprovalSummary, cP as WorkflowArtifactRef, cQ as WorkflowBudget, cS as WorkflowEventCorrelation, cT as WorkflowEventRecorder, cU as WorkflowEventType, cV as WorkflowIsolation, cY as WorkflowMeta, cZ as WorkflowModelHint, d0 as WorkflowOutcomeError, d1 as WorkflowOutcomeResult, d2 as WorkflowOutcomeStatus, d3 as WorkflowOutcomeUsage, d4 as WorkflowParallelOptions, d5 as WorkflowProcessArtifact, d6 as WorkflowProcessCounts, d7 as WorkflowProcessEvent, d8 as WorkflowProcessItem, d9 as WorkflowProcessItemKind, da as WorkflowProcessItemOrigin, db as WorkflowProcessItemStatus, dc as WorkflowProcessProgress, dd as WorkflowProcessSnapshot, de as WorkflowProcessSource, df as WorkflowProcessStatus, dg as WorkflowProcessSummaryStatus, dh as WorkflowProcessTokenUsage, di as WorkflowProcessTracker, dj as WorkflowProcessTrackerOptions, dk as WorkflowRun, dm as WorkflowRunStatus, dn as WorkflowSpawnAgentInput, dp as WorkflowSynthesis, dq as WorkflowSynthesizeInput, dr as WorkflowTaskHandle, dt as WorkflowTaskSnapshot, du as WorkflowTaskStatus, dv as WorkflowTaskSummaryEventUpdate, dw as WorkflowTaskSummaryKind, dx as WorkflowTaskSummaryUpdate, dy as WorkflowTaskUsage, dz as WorkflowTaskVerification, dA as WorkflowTaskVerificationResult, dB as WorkflowWaitOptions, dC as _resetAdmittedAgentBindings, dD as _resetPresetDispatchers, dE as admitAndRecordLearnedSkillInvocation, dF as admitLearnedSkillBinding, dG as asSingleSelection, dH as assertLearnedCapabilityTransition, dI as attachRunnerRecoveryTranscript, dJ as buildAssistantMessageFromLlmResult, dK as buildSystemPrompt, dL as buildToolResultMessage, dM as canTransitionLearnedCapability, dN as collectGuardrails, dO as commitLearnedSkillRevision, dP as completeLearnedSkillOutcome, dQ as completeLearnedSkillSessionOutcomes, dR as createAgent, dS as createAgentActorController, dT as createHandoff, dU as createInMemorySession, dV as createInvariantSessionForAgent, dW as createLearnedCapabilityScope, dX as createLearnedSkillRecord, dY as createStateWriter, dZ as createTrace, d_ as createWorkflowProcessTracker, d$ as defaultTracer, e0 as detectInstructionsInjection, e1 as discoverInstances, e2 as eventFromCapability, e3 as exactInvokedSkillSnapshotForSession, e4 as executeRunnerToolCall, e5 as extractAssistantTextFromMessage, e6 as getActiveUserInteraction, e7 as getAdmittedAgentBindings, e8 as invokeLearnedSkillCanary, e9 as isAskUserCustomInputAnswer, ea as isFinalWorkflowProcessStatus, eb as isLearnedCapabilityRecordV2, ec as isRunnableTool, ed as isRunnerIterationLimitError, ee as isRunnerLlmResult, ef as isUnifiedLearningReviewModelInput, eg as learningEventIdFor, eh as learningEventKindForLifecycle, ei as listLearnedSkillUsageReceipts, ej as normalizeHostMetadata, ek as normalizeUnifiedLearningReview, el as quarantineLearnedSkillRevision, em as readRunnerRecoveryTranscript, en as reconcileLearnedSkillBindingOutcomes, eo as recordLearnedSkillOffered, ep as registerPresetDispatcher, eq as releaseLearnedSkillBinding, er as renderDeclarativeSkill, es as resolveLearnedAreaPaths, et as resolveProjectLearnedAreaRoot, eu as runAdmissionAudit, ev as runInputGuardrails, ew as runOutputGuardrails, ex as runToolAfterGuardrails, ey as runToolBeforeGuardrails, ez as sanitizeUnifiedLearningReviewInput, eA as setActiveUserInteraction, eB as setAdmittedAgentBindings, eC as slugifyLearnedCapabilityName, eD as stageLearnedSkillRevision, eE as validateDeclarativeSkillSpec } from './types-chunks/controller.d-Dzxz22X-.js';
7
- import { i as KodaXImageBlock, k as KodaXMessage, a2 as KodaXToolDefinition, a7 as KodaXToolUseBlock, I as KodaXReasoningRequest, e as KodaXEphemeralSuffix, a1 as KodaXTokenUsage } from './types-chunks/types.d-CgrXrFrq.js';
8
- export { K as KodaXAssuranceIntent, c as KodaXContentBlock, f as KodaXExecutionMode, g as KodaXExecutionPattern, m as KodaXMutationSurface, r as KodaXProviderConfig, z as KodaXProviderStreamOptions, C as KodaXReasoningCapability, G as KodaXReasoningMode, J as KodaXRedactedThinkingBlock, M as KodaXRiskLevel, O as KodaXStreamResult, P as KodaXTaskActionability, Q as KodaXTaskBudgetOverrides, R as KodaXTaskComplexity, S as KodaXTaskFamily, T as KodaXTaskResultMetadata, U as KodaXTaskResultSource, V as KodaXTaskRoutingDecision, W as KodaXTaskType, X as KodaXTaskWorkIntent, Y as KodaXTextBlock, Z as KodaXThinkingBlock, _ as KodaXThinkingBudgetMap, $ as KodaXThinkingDepth, a3 as KodaXToolResultBlock } from './types-chunks/types.d-CgrXrFrq.js';
9
- import { C as CapabilityCache, b as CapabilityCacheSource } from './types-chunks/capability-learning.d-iPSiAmc_.js';
10
- export { a as CapabilityCacheEntry } from './types-chunks/capability-learning.d-iPSiAmc_.js';
1
+ import { aE as MemoryContextIdentity, au as MemoryActionProposal, aM as MemoryItemRef, av as MemoryApplicability, ab as KodaXSessionLineage, $ as KodaXMemoryOutcomeDigest, ak as KodaXSessionStorage, a6 as KodaXSessionData, V as KodaXGoalState, U as KodaXGoalEventType, a7 as KodaXSessionEntry, a9 as KodaXSessionGoalEntry, a2 as KodaXSessionArtifactLedgerEntry, S as KodaXExtensionStore, T as KodaXExtensionStoreEntry, Y as KodaXJsonValue, k as AgentBudgetExhausted, x as AgentLimitReached } from './types-chunks/types.d-sW-OqiFt.js';
2
+ export { A as AgentActor, a as AgentActorClient, b as AgentActorOwner, c as AgentActorSnapshot, d as AgentActorSnapshotV1, e as AgentActorSnapshotV2, f as AgentActorState, g as AgentActorStore, h as AgentArtifactDescriptor, i as AgentBudgetAdmission, j as AgentBudgetAdmissionInput, l as AgentBudgetPort, m as AgentCapabilities, n as AgentDataClassification, o as AgentDetail, p as AgentEvent, q as AgentEventKind, r as AgentExecutionInput, s as AgentExecutionKind, t as AgentExecutionResult, u as AgentFollowupResult, v as AgentForkTurns, w as AgentInterruptScope, y as AgentListEntry, z as AgentMailboxMessage, B as AgentMetadataValue, C as AgentMutationOptions, D as AgentOutput, E as AgentProgressItem, F as AgentProgressKind, G as AgentProgressUpdate, H as AgentSpawnInput, I as AgentTreeSnapshot, J as AgentTurn, K as AgentTurnExecutor, L as AgentTurnRef, M as AgentTurnState, N as AgentTurnSummary, O as KodaXCompactMemoryProgress, P as KodaXCompactMemorySeed, Q as KodaXExtensionSessionRecord, R as KodaXExtensionSessionState, W as KodaXGoalStatus, X as KodaXHandledMemoryOperation, Z as KodaXMemoryInfluenceRef, _ as KodaXMemoryIntent, a0 as KodaXMemoryOutcomeEvidence, a1 as KodaXSessionArchiveMarkerEntry, a3 as KodaXSessionBranchSummaryEntry, a4 as KodaXSessionClientNoticeEntry, a5 as KodaXSessionCompactionEntry, a8 as KodaXSessionEntryBase, aa as KodaXSessionLabelEntry, ac as KodaXSessionMemoryOutcomeDigestEntry, ad as KodaXSessionMemoryReviewReceiptEntry, ae as KodaXSessionMessageEntry, af as KodaXSessionMeta, ag as KodaXSessionNavigationOptions, ah as KodaXSessionRewindMarkerEntry, ai as KodaXSessionRuntimeInfo, aj as KodaXSessionScope, al as KodaXSessionTreeNode, am as KodaXSessionUiHistoryItem, an as KodaXSessionUiHistoryItemType, ao as KodaXSessionUiTextHistoryItem, ap as KodaXSessionUiTextHistoryItemType, aq as KodaXSessionUiToolCall, ar as KodaXSessionUiToolCallStatus, as as KodaXSessionUiToolGroupHistoryItem, at as KodaXSessionWorkspaceKind, aw as MemoryApplyPreview, ax as MemoryApplyResult, ay as MemoryApproval, az as MemoryAuthority, aC as MemoryBodySnapshot, aD as MemoryClaimKind, aF as MemoryController, aG as MemoryCuratorInput, aH as MemoryEpisodeReviewResult, aI as MemoryEvent, aJ as MemoryGovernanceFinding, aK as MemoryGovernanceFindingKind, aL as MemoryGovernanceReport, aN as MemoryLifecycle, aO as MemoryLifecycleOperationResult, aP as MemoryManagementController, aQ as MemoryPack, aR as MemoryPackHint, aS as MemoryPackInput, aT as MemoryPackTraceMetadata, aU as MemoryProposalAction, aV as MemoryRefFilter, aW as MemoryRefKind, aX as MemoryRejectResult, aY as MemoryRememberInput, aZ as MemoryRememberResult, a_ as MemoryReviewCandidateRef, a$ as MemoryReviewDraftAction, b0 as MemoryReviewInput, b1 as MemoryReviewModelInput, b2 as MemoryReviewPersistenceDecision, b3 as MemoryReviewPersistenceKind, b4 as MemoryReviewPlan, b5 as MemoryReviewRunner, b6 as MemoryReviewTrigger, b7 as MemoryScope, b8 as MemorySourceAdapter, b9 as MemoryVisibility, ba as SessionErrorMetadata, bb as hashMemoryIdentityComponent, bc as isMemoryManagementController, bd as matchesMemoryApplicability, be as memoryApplicabilityFingerprint } from './types-chunks/types.d-sW-OqiFt.js';
3
+ import { M as WorkflowScriptManifest } from './types-chunks/capsule.d-DEncDNzD.js';
4
+ export { C as CompactionContext, a as CompactionEntry, b as CompactionEntryPayload, c as CompactionPolicy, d as CreateWorkflowCapsuleInput, D as DefaultSummaryCompaction, e as DefaultSummaryCompactionOptions, K as KODAX_API_MIN_INTERVAL, f as KODAX_DEFAULT_TIMEOUT, g as KODAX_HARD_TIMEOUT, h as KODAX_MAX_INCOMPLETE_RETRIES, i as KODAX_MAX_MAXTOKENS_RETRIES, j as KODAX_MAX_RETRIES, k as KODAX_MAX_TOKENS, l as KODAX_RETRY_BASE_DELAY, m as KODAX_STAGGER_DELAY, L as LINEAGE_ENTRY_TYPES, n as LineageArtifactLedgerPayload, o as LineageCompaction, p as LineageCompactionDelegates, q as LineageEntryType, r as LineageExtension, s as LineageLabelPayload, t as LineageTreeNode, P as PROMISE_PATTERN, u as PolicyCompactionResult, W as WORKFLOW_CAPSULE_API_VERSION, v as WORKFLOW_CAPSULE_FORMAT, w as WORKFLOW_CAPSULE_VERSION, x as WORKFLOW_PATTERN_IDS, y as WorkflowCapsule, z as WorkflowCapsuleEnvironmentRequirement, A as WorkflowCapsuleInputs, B as WorkflowCapsuleIntent, E as WorkflowCapsuleProvenance, F as WorkflowCapsuleRequirements, G as WorkflowPatternId, H as WorkflowQualityLintFinding, I as WorkflowQualityLintOptions, J as WorkflowQualityLintSeverity, _ as _resetActiveRootQueueRoutesForTests, N as actorQueueId, O as appendSessionLineageLabel, Q as applyLineageTruncation, R as applySessionCompaction, S as archiveOldIslands, T as assertRestrictedWorkflowQuality, U as buildSessionTree, V as buildWorkflowCapsuleIntent, X as cleanupIncompleteToolCalls, Y as countActiveLineageMessages, Z as countTokens, $ as createSessionLineage, a0 as createWorkflowCapsule, a1 as createWorkflowModuleFromCapsule, a2 as estimateTokens, a3 as evictOldIslandMessageContent, a4 as extractArtifactLedger, a5 as extractFileOps, a6 as extractTitleFromMessages, a7 as findPreviousUserEntryId, a8 as forkSessionLineage, a9 as generateSessionId, aa as generateSessionIdSync, ab as getAgentConfigHome, ac as getAgentConfigPath, ad as getAppDataDir, ae as getSessionLineagePath, af as getSessionMessageEntryId, ag as getSessionMessagesFromLineage, ah as isPathInsideDirectory, ai as lintRestrictedWorkflowSource, aj as mergeArtifactLedger, ak as mergeFileOps, al as registerActiveRootQueueRoute, am as resolveActiveRootQueueRoute, an as resolveExecutionPath, ao as resolveSessionLineageTarget, ap as rewindSessionLineage, aq as setAgentConfigHome, ar as setSessionLineageActiveEntry, as as validateAndFixToolHistory, at as validateWorkflowCapsule, au as validateWorkflowScriptManifest } from './types-chunks/capsule.d-DEncDNzD.js';
5
+ import { ci as Span, cD as Trace, f as Agent, aQ as Handoff, c5 as RunnerToolCall, c8 as RunnerToolResult, P as AgentMessage, O as AgentManifest, bJ as ManifestPatch, aV as InvariantId, bS as QualityInvariant, b0 as KodaXInputArtifactSource, a_ as KodaXImageMediaType, b2 as KodaXVideoMediaType, aY as KodaXFileInputArtifact, aZ as KodaXImageInputArtifact, b1 as KodaXVideoInputArtifact, a$ as KodaXInputArtifact, at as DiscoveredInstance, cg as SessionMeta, ch as SessionStateSnapshot, cq as StateWriterFs, aU as InstanceDiscoveryFs, cp as StateWriter, cs as StopHookContext, cu as StopHookResult, ct as StopHookFn, bq as LearningActionDriver, bA as LearningQuery, bz as LearningPage, bc as LearnedCapabilityRecord, bF as LearningSurfaceSnapshot, bv as LearningEvent, bE as LearningSubscribeOptions, bx as LearningExplicitUserAuthority, b4 as LearnedAreaStore, bf as LearnedCapabilityScope, am as CompactionUpdate, ah as CompactionConfig, ai as CompactionDetails, ak as CompactionResult, dl as WorkflowRunState, c$ as WorkflowOutcome, cM as WorkflowApi, c_ as WorkflowModule, cL as WorkflowAgentBackend, cW as WorkflowLimits, cR as WorkflowEvent, cX as WorkflowLogEvent, ds as WorkflowTaskResult, H as AgentExecutorPlaneStore, an as CreateAgentExecutorPlaneOptions, D as AgentExecutorPlane, aD as ExternalAgentProtocol, B as AgentExecutorFactory } from './types-chunks/controller.d-Dif9pbC9.js';
6
+ export { A as ASK_USER_BACK_SIGNAL, a as ASK_USER_CUSTOM_INPUT_SIGNAL, b as AdmissionAuditOptions, c as AdmissionCtx, d as AdmissionVerdict, e as AdmittedHandle, g as AgentActorController, h as AgentArtifactPolicy, i as AgentArtifactPolicyDecision, j as AgentArtifactPolicyInput, k as AgentArtifactReference, l as AgentCapabilityDeclaration, m as AgentCapabilityRequirements, n as AgentContinuationInput, o as AgentControllerHealth, p as AgentControllerOptions, q as AgentCredentialBroker, r as AgentDispatchContext, s as AgentDispatchPolicy, t as AgentDispatchPolicyDecision, u as AgentDispatchPolicyInput, v as AgentDispatchabilitySnapshot, w as AgentDispatchabilityStatus, x as AgentEffectDeclaration, y as AgentExecutor, z as AgentExecutorEvent, C as AgentExecutorFactoryContext, E as AgentExecutorPlaneBackgroundErrorContext, F as AgentExecutorPlaneBackgroundErrorHandler, G as AgentExecutorPlaneBinding, I as AgentExecutorPreflightResult, J as AgentExecutorProtocol, K as AgentExecutorTaskReference, L as AgentExecutorTaskSnapshot, M as AgentJsonObject, N as AgentJsonValue, Q as AgentMiddlewareDeclaration, R as AgentPreflightInput, S as AgentPreflightResult, T as AgentReasoningProfile, U as AgentRegistrationEnabledMutationOptions, V as AgentRegistrationMutationOptions, W as AgentRegistrationService, X as AgentSpanData, Y as AgentTaskCancellation, Z as AgentTaskCorrelation, _ as AgentTaskEvent, $ as AgentTaskFilter, a0 as AgentTaskProgress, a1 as AgentTaskRegistrationSnapshot, a2 as AgentTaskService, a3 as AgentTaskSnapshot, a4 as AgentTaskStartInput, a5 as AgentTaskState, a6 as AgentTaskUsage, a7 as AgentTool, a8 as AskUserAnswer, a9 as AskUserCustomInputAnswer, aa as AskUserMultiOptions, ab as AskUserQuestionItem, ac as AskUserQuestionOptions, ad as AskUserSelectionAnswer, ae as CapabilitySupport, af as CommitLearnedSkillRevisionInput, ag as CompactionAnchor, aj as CompactionReport, al as CompactionSpanData, ao as CreateLearnedSkillRecordInput, ap as CurrentTodoSummary, aq as DEFAULT_SYSTEM_CAP, ar as DeclarativeSkillSpec, as as Deliverable, au as DiscoveryOptions, av as DispatchableAgentDescriptor, aw as DispatchableAgentListing, ax as DispatchableAgentOrigin, ay as DispatchableAgentQuery, az as EvidenceSpanData, aA as ExactInvokedSkillSnapshot, aB as ExternalAgentEffectDeclaration, aC as ExternalAgentHealth, aE as ExternalAgentRegistration, aF as ExternalAgentRegistrationSummary, aG as FanoutSpanData, aH as FileOperations, aI as GenerationSpanData, aJ as Guardrail, aK as GuardrailBlockedError, aL as GuardrailContext, aM as GuardrailEscalateError, aN as GuardrailPermissionIntent, aO as GuardrailSpanData, aP as GuardrailVerdict, aR as HandoffSpanData, aS as InMemorySessionOptions, aT as InputGuardrail, aW as InvariantResult, aX as InvariantSession, b3 as LearnedAreaPaths, b5 as LearnedCapabilityArtifact, b6 as LearnedCapabilityCanary, b7 as LearnedCapabilityCanaryBinding, b8 as LearnedCapabilityCanaryInvocation, b9 as LearnedCapabilityCarrier, ba as LearnedCapabilityLifecycle, bb as LearnedCapabilityProvenance, bd as LearnedCapabilityRecordV1, be as LearnedCapabilityRecordV2, bg as LearnedCapabilitySource, bh as LearnedSkillBindingAdmission, bi as LearnedSkillCanaryOutcome, bj as LearnedSkillDecisionDisposition, bk as LearnedSkillInvocationAdmission, bl as LearnedSkillInvokedReceipt, bm as LearnedSkillOfferedReceipt, bn as LearnedSkillOutcomeReceipt, bo as LearnedSkillUsageReceipt, bp as LearningAction, br as LearningCapabilityError, bs as LearningCapabilityErrorCode, bt as LearningClientEventState, bu as LearningClientRecord, bw as LearningEventKind, by as LearningNotificationState, bB as LearningReviewEvidencePacket, bC as LearningReviewQualification, bD as LearningReviewVerifierFact, bG as LocalAgentTaskInput, bH as LocalAgentTaskUpdate, bI as MAX_TOOL_LOOP_ITERATIONS, bK as MemoryDecisionTraceReceipt, bL as MessageEntry, bM as NormalizedLearnedSkillDecision, bN as ObserveCtx, bO as OutputGuardrail, bP as PersistedSessionState, bQ as PresetDispatcher, bR as PresetTracingContext, bT as ReadonlyMutationTracker, bU as ReadonlyRecorder, bV as ReasoningDepth, bW as RecentlyModifiedFile, bX as RunEvent, bY as RunOptions, bZ as RunResult, b_ as RunnableTool, b$ as Runner, c0 as RunnerEvent, c1 as RunnerIterationLimitError, c2 as RunnerLlmResult, c3 as RunnerLlmReturn, c4 as RunnerRecoveryTranscriptCarrier, c6 as RunnerToolContext, c7 as RunnerToolObserver, c9 as RunnerToolResultBatch, ca as RunnerToolResultBatchTransform, cb as Session, cc as SessionDispatchResult, cd as SessionEntry, ce as SessionExtension, cf as SessionForkOptions, cj as SpanData, ck as SpanError, cl as SpanImpl, cm as SpanImplOptions, cn as StagedLearnedSkillArtifact, co as StartTraceOptions, cr as StateWriterOptions, cv as StopHookSpanData, cw as SystemCap, cx as TerminalCtx, cy as ToolBeforeOutcome, cz as ToolCallSpanData, cA as ToolCapability, cB as ToolGuardrail, cC as ToolPermission, cE as TraceOptions, cF as Tracer, cG as TracerOptions, cH as UnifiedLearningReviewModelInput, cI as UnifiedLearningReviewResult, cJ as UnifiedLearningReviewRunner, cK as UserInteraction, cN as WorkflowApproval, cO as WorkflowApprovalSummary, cP as WorkflowArtifactRef, cQ as WorkflowBudget, cS as WorkflowEventCorrelation, cT as WorkflowEventRecorder, cU as WorkflowEventType, cV as WorkflowIsolation, cY as WorkflowMeta, cZ as WorkflowModelHint, d0 as WorkflowOutcomeError, d1 as WorkflowOutcomeResult, d2 as WorkflowOutcomeStatus, d3 as WorkflowOutcomeUsage, d4 as WorkflowParallelOptions, d5 as WorkflowProcessArtifact, d6 as WorkflowProcessCounts, d7 as WorkflowProcessEvent, d8 as WorkflowProcessItem, d9 as WorkflowProcessItemKind, da as WorkflowProcessItemOrigin, db as WorkflowProcessItemStatus, dc as WorkflowProcessProgress, dd as WorkflowProcessSnapshot, de as WorkflowProcessSource, df as WorkflowProcessStatus, dg as WorkflowProcessSummaryStatus, dh as WorkflowProcessTokenUsage, di as WorkflowProcessTracker, dj as WorkflowProcessTrackerOptions, dk as WorkflowRun, dm as WorkflowRunStatus, dn as WorkflowSpawnAgentInput, dp as WorkflowSynthesis, dq as WorkflowSynthesizeInput, dr as WorkflowTaskHandle, dt as WorkflowTaskSnapshot, du as WorkflowTaskStatus, dv as WorkflowTaskSummaryEventUpdate, dw as WorkflowTaskSummaryKind, dx as WorkflowTaskSummaryUpdate, dy as WorkflowTaskUsage, dz as WorkflowTaskVerification, dA as WorkflowTaskVerificationResult, dB as WorkflowWaitOptions, dC as _resetAdmittedAgentBindings, dD as _resetPresetDispatchers, dE as admitAndRecordLearnedSkillInvocation, dF as admitLearnedSkillBinding, dG as asSingleSelection, dH as assertLearnedCapabilityTransition, dI as attachRunnerRecoveryTranscript, dJ as buildAssistantMessageFromLlmResult, dK as buildSystemPrompt, dL as buildToolResultMessage, dM as canTransitionLearnedCapability, dN as collectGuardrails, dO as commitLearnedSkillRevision, dP as completeLearnedSkillOutcome, dQ as completeLearnedSkillSessionOutcomes, dR as createAgent, dS as createAgentActorController, dT as createHandoff, dU as createInMemorySession, dV as createInvariantSessionForAgent, dW as createLearnedCapabilityScope, dX as createLearnedSkillRecord, dY as createStateWriter, dZ as createTrace, d_ as createWorkflowProcessTracker, d$ as defaultTracer, e0 as detectInstructionsInjection, e1 as discoverInstances, e2 as eventFromCapability, e3 as exactInvokedSkillSnapshotForSession, e4 as executeRunnerToolCall, e5 as extractAssistantTextFromMessage, e6 as getActiveUserInteraction, e7 as getAdmittedAgentBindings, e8 as invokeLearnedSkillCanary, e9 as isAskUserCustomInputAnswer, ea as isFinalWorkflowProcessStatus, eb as isLearnedCapabilityRecordV2, ec as isRunnableTool, ed as isRunnerIterationLimitError, ee as isRunnerLlmResult, ef as isUnifiedLearningReviewModelInput, eg as learningEventIdFor, eh as learningEventKindForLifecycle, ei as listLearnedSkillUsageReceipts, ej as normalizeHostMetadata, ek as normalizeUnifiedLearningReview, el as quarantineLearnedSkillRevision, em as readRunnerRecoveryTranscript, en as reconcileLearnedSkillBindingOutcomes, eo as recordLearnedSkillOffered, ep as registerPresetDispatcher, eq as releaseLearnedSkillBinding, er as renderDeclarativeSkill, es as resolveLearnedAreaPaths, et as resolveProjectLearnedAreaRoot, eu as runAdmissionAudit, ev as runInputGuardrails, ew as runOutputGuardrails, ex as runToolAfterGuardrails, ey as runToolBeforeGuardrails, ez as sanitizeUnifiedLearningReviewInput, eA as setActiveUserInteraction, eB as setAdmittedAgentBindings, eC as slugifyLearnedCapabilityName, eD as stageLearnedSkillRevision, eE as validateDeclarativeSkillSpec } from './types-chunks/controller.d-Dif9pbC9.js';
7
+ import { i as KodaXImageBlock, k as KodaXMessage, a2 as KodaXToolDefinition, a7 as KodaXToolUseBlock, I as KodaXReasoningRequest, e as KodaXEphemeralSuffix, a1 as KodaXTokenUsage } from './types-chunks/types.d-CK9A9rpP.js';
8
+ export { K as KodaXAssuranceIntent, c as KodaXContentBlock, f as KodaXExecutionMode, g as KodaXExecutionPattern, m as KodaXMutationSurface, r as KodaXProviderConfig, z as KodaXProviderStreamOptions, C as KodaXReasoningCapability, G as KodaXReasoningMode, J as KodaXRedactedThinkingBlock, M as KodaXRiskLevel, O as KodaXStreamResult, P as KodaXTaskActionability, Q as KodaXTaskBudgetOverrides, R as KodaXTaskComplexity, S as KodaXTaskFamily, T as KodaXTaskResultMetadata, U as KodaXTaskResultSource, V as KodaXTaskRoutingDecision, W as KodaXTaskType, X as KodaXTaskWorkIntent, Y as KodaXTextBlock, Z as KodaXThinkingBlock, _ as KodaXThinkingBudgetMap, $ as KodaXThinkingDepth, a3 as KodaXToolResultBlock } from './types-chunks/types.d-CK9A9rpP.js';
9
+ import { C as CapabilityCache, b as CapabilityCacheSource } from './types-chunks/capability-learning.d-CE1tm29C.js';
10
+ export { a as CapabilityCacheEntry } from './types-chunks/capability-learning.d-CE1tm29C.js';
11
11
  export { C as CapabilityKind, a as CapabilityProvider, b as CapabilityResult, c as CapabilitySearchFailure, d as CapabilitySearchFreshness, e as CapabilitySearchOptions, f as CapabilitySearchSnapshot } from './types-chunks/capability.d-K664nHOS.js';
12
12
  import { ChildProcess } from 'node:child_process';
13
- import { Q as QueueEventListener, c as QueuedMessage, E as EnqueueInput, D as DequeueFilter, a as MessagePriority, b as QueuedInputArtifact } from './types-chunks/types.d-Bo4fyMLu.js';
14
- export { M as MessageMode } from './types-chunks/types.d-Bo4fyMLu.js';
15
- import { K as KodaXBaseProvider } from './types-chunks/base.d-DxG0m09Z.js';
16
- export { C as CreateMemoryControlPlaneOptions, M as MemoryControlPlane, c as createMemoryControlPlane } from './types-chunks/controller.d-A73Kf6tH.js';
17
- export { E as EpisodeReviewActionInput, a as EpisodeReviewActionReceipt, b as EpisodeReviewBranchChangedError, c as EpisodeReviewClaim, d as EpisodeReviewDecision, e as EpisodeReviewDecisionInput, f as EpisodeReviewDrainEligibility, g as EpisodeReviewDrainOptions, h as EpisodeReviewDrainResult, i as EpisodeReviewFailure, j as EpisodeReviewFailureKind, k as EpisodeReviewInputCheckpoint, l as EpisodeReviewInputSpec, m as EpisodeReviewJobSnapshot, n as EpisodeReviewJobState, o as EpisodeReviewJobStatus, p as EpisodeReviewReceipt, P as PendingEpisodeReview, q as PendingEpisodeReviewFilter, r as PendingEpisodeReviewSummary, s as PendingEpisodeReviewV1, t as PendingEpisodeReviewV2, u as captureEpisodeReviewBranchEpoch, v as claimEpisodeReview, w as commitEpisodeReviewAction, x as commitEpisodeReviewDecision, y as completeEpisodeReview, z as completeFencedEpisodeReview, A as deferEpisodeReview, B as discardFencedEpisodeReview, C as drainPendingEpisodeReviews, D as failEpisodeReviewApply, F as failEpisodeReviewAttempt, G as freezeEpisodeReviewInput, H as inspectEpisodeReviewJob, I as listPendingEpisodeReviewSummaries, J as listPendingEpisodeReviews, K as persistPendingEpisodeReview, L as withEpisodeReviewClaimAuthority, M as withPendingEpisodeReviewSessionFence } from './types-chunks/review-inbox.d-DuZqFX-z.js';
13
+ import { Q as QueueEventListener, c as QueuedMessage, E as EnqueueInput, D as DequeueFilter, a as MessagePriority, b as QueuedInputArtifact } from './types-chunks/types.d-COhAF5Xo.js';
14
+ export { M as MessageMode } from './types-chunks/types.d-COhAF5Xo.js';
15
+ import { K as KodaXBaseProvider } from './types-chunks/base.d-vopO1rml.js';
16
+ export { C as CreateMemoryControlPlaneOptions, M as MemoryControlPlane, c as createMemoryControlPlane } from './types-chunks/controller.d-C1YdP_pQ.js';
17
+ export { E as EpisodeReviewActionInput, a as EpisodeReviewActionReceipt, b as EpisodeReviewBranchChangedError, c as EpisodeReviewClaim, d as EpisodeReviewDecision, e as EpisodeReviewDecisionInput, f as EpisodeReviewDrainEligibility, g as EpisodeReviewDrainOptions, h as EpisodeReviewDrainResult, i as EpisodeReviewFailure, j as EpisodeReviewFailureKind, k as EpisodeReviewInputCheckpoint, l as EpisodeReviewInputSpec, m as EpisodeReviewJobSnapshot, n as EpisodeReviewJobState, o as EpisodeReviewJobStatus, p as EpisodeReviewReceipt, P as PendingEpisodeReview, q as PendingEpisodeReviewFilter, r as PendingEpisodeReviewSummary, s as PendingEpisodeReviewV1, t as PendingEpisodeReviewV2, u as captureEpisodeReviewBranchEpoch, v as claimEpisodeReview, w as commitEpisodeReviewAction, x as commitEpisodeReviewDecision, y as completeEpisodeReview, z as completeFencedEpisodeReview, A as deferEpisodeReview, B as discardFencedEpisodeReview, C as drainPendingEpisodeReviews, D as failEpisodeReviewApply, F as failEpisodeReviewAttempt, G as freezeEpisodeReviewInput, H as inspectEpisodeReviewJob, I as listPendingEpisodeReviewSummaries, J as listPendingEpisodeReviews, K as persistPendingEpisodeReview, L as withEpisodeReviewClaimAuthority, M as withPendingEpisodeReviewSessionFence } from './types-chunks/review-inbox.d-C1_xZ-yg.js';
18
18
  import { R as ResolvedSkillSource } from './types-chunks/types.d-BSPlmJqf.js';
19
19
  export { I as ISkillRegistry, a as IVariableResolver, L as LearnedSkillDiscoveryConfig, S as Skill, b as SkillArtifact, c as SkillContext, d as SkillDynamicContextExecutor, e as SkillFile, f as SkillFrontmatter, g as SkillHook, h as SkillHooks, i as SkillMetadata, j as SkillPathsConfig, k as SkillResult, l as SkillSource, m as getDefaultSkillPaths, n as getSkillPathsFlat } from './types-chunks/types.d-BSPlmJqf.js';
20
20
  export { M as McpConnectMode, a as McpServerConfig, b as McpServersConfig, c as McpTransportKind } from './types-chunks/config.d-CJy1WENT.js';
@@ -22,8 +22,8 @@ export { M as McpCapabilityDescriptor, a as McpCapabilityKind, b as McpCapabilit
22
22
  export { A as AuthorizationServerMetadata, D as DiscoveredOAuthEndpoints, M as McpAuthRequiredError, a as McpExpiredSessionError, b as McpTransport, c as McpTransportCleanupIncompleteError, d as McpTransportEvents, O as OAuthClientInfo, e as OAuthLoginConsent, P as PerformOAuthLoginOptions, f as ProtectedResourceMetadata, W as WwwAuthenticateChallenge, g as createMcpTransport, h as discoverAuthorizationServerMetadata, i as discoverOAuthEndpoints, j as discoverProtectedResourceMetadata, k as extractInsufficientScope, l as extractResourceMetadataUrl, m as loadValidToken, p as performOAuthLogin, r as registerOAuthClient } from './types-chunks/oauth-login.d-6i-vidxv.js';
23
23
  export { createMcpTestServerFixture } from './sdk-mcp.js';
24
24
  export { DiscoveryResult, ExecutionMode, ExecutionOptions, SkillExecutor, SkillExpansionResult, SkillRegistry, VariableResolver, clearPluginSkillPaths, createExecutor, createResolver, discoverSkills, discoverSkillsWithMonorepo, executeSkill, expandSkillForLLM, formatSkillActivationMessage, getNestedSkillPaths, getSkillRegistry, initializeSkillRegistry, listPluginSkillPaths, loadFullSkill, loadSkillFileContent, loadSkillMetadata, parseArguments, parseSkillMarkdown, registerPluginSkillPath, resetSkillRegistry, resolveSkillContent, unregisterPluginSkillPath } from './sdk-skills.js';
25
- export { K as KodaXSessionHistoryHit, a as KodaXSessionHistoryReadOptions, b as KodaXSessionHistoryReadResult, c as KodaXSessionHistoryScope, d as KodaXSessionHistorySearchOptions, e as KodaXSessionHistorySearchResult, f as KodaXSessionHistorySource, r as readSessionHistoryEntry, s as searchSessionHistory, g as searchSessionHistoryCooperatively, v as validateSessionHistorySearchQuery } from './types-chunks/history-retrieval.d-Debbzn1z.js';
26
- export { M as ManagedRunClassification, a as ManagedRunHooks, b as ManagedWorkflowRun, c as ManagedWorkflowSnapshot, d as ManagedWorkflowStatus, S as StartManagedRunInput, W as WorkflowProcessMetadata, e as WorkflowRunManager, f as createWorkflowRunManager, g as getDefaultWorkflowRunManager } from './types-chunks/run-manager.d-BS4lJfL3.js';
25
+ export { K as KodaXSessionHistoryHit, a as KodaXSessionHistoryReadOptions, b as KodaXSessionHistoryReadResult, c as KodaXSessionHistoryScope, d as KodaXSessionHistorySearchOptions, e as KodaXSessionHistorySearchResult, f as KodaXSessionHistorySource, r as readSessionHistoryEntry, s as searchSessionHistory, g as searchSessionHistoryCooperatively, v as validateSessionHistorySearchQuery } from './types-chunks/history-retrieval.d-YJQpQt7h.js';
26
+ export { M as ManagedRunClassification, a as ManagedRunHooks, b as ManagedWorkflowRun, c as ManagedWorkflowSnapshot, d as ManagedWorkflowStatus, S as StartManagedRunInput, W as WorkflowProcessMetadata, e as WorkflowRunManager, f as createWorkflowRunManager, g as getDefaultWorkflowRunManager } from './types-chunks/run-manager.d-D30IvnwV.js';
27
27
 
28
28
  declare const CONTEXT_SAFETY_FLOOR_TOKENS = 2048;
29
29
  declare const CONTEXT_SAFETY_RATIO = 0.03;
package/dist/sdk-agent.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
2
- import{$,$a as or,$b as Ge,$c as Ef,$d as Dm,$e as Dp,$f as Dt,$g as Dx,A,Aa as Bo,Ab as pe,Ac as ef,Ad as fm,Ae as ep,Af as et,Ag as ex,B,Ba as Co,Bb as te,Bc as ff,Bd as mm,Be as fp,Bf as ft,Bg as fx,C,Ca as Do,Cb as xe,Cc as mf,Cd as pm,Ce as mp,Cf as mt,Cg as mx,D,Da as Eo,Db as ae,Dc as pf,Dd as tm,De as pp,Df as pt,Dg as px,E,Ea as Fo,Eb as be,Ec as tf,Ed as xm,Ee as tp,Ef as tt,Eg as tx,F,Fa as Go,Fb as ce,Fc as xf,Fd as am,Fe as xp,Ff as xt,Fg as xx,G,Ga as Ho,Gb as de,Gc as af,Gd as bm,Ge as ap,Gf as at,Gg as ax,H,Ha as Io,Hb as ge,Hc as bf,Hd as cm,He as bp,Hf as bt,Hg as bx,I,Ia as Jo,Ib as he,Ic as cf,Id as dm,Ie as cp,If as ct,Ig as cx,J,Ja as Ko,Jb as ie,Jc as df,Jd as gm,Je as dp,Jf as dt,Jg as dx,K,Ka as Lo,Kb as je,Kc as gf,Kd as hm,Ke as gp,Kf as gt,Kg as gx,L,La as Mo,Lb as ke,Lc as hf,Ld as im,Le as hp,Lf as ht,Lg as hx,M,Ma as No,Mb as le,Mc as jf,Md as jm,Me as ip,Mf as it,Mg as ix,N,Na as Oo,Nb as ne,Nc as kf,Nd as km,Ne as jp,Nf as jt,Ng as jx,O,Oa as Po,Ob as qe,Oc as lf,Od as lm,Oe as kp,Of as kt,Og as kx,P,Pa as Qo,Pb as se,Pc as nf,Pd as nm,Pe as lp,Pf as lt,Pg as lx,Q,Qa as Ro,Qb as ue,Qc as qf,Qd as qm,Qe as np,Qf as nt,Qg as nx,R,Ra as So,Rb as ve,Rc as sf,Re as qp,Rf as qt,Rg as qx,S,Sa as To,Sb as we,Sc as uf,Sd as sm,Se as sp,Sf as st,Sg as sx,T,Ta as Uo,Tb as ye,Tc as vf,Td as um,Te as up,Tf as ut,Tg as ux,U,Ua as Vo,Ub as ze,Uc as wf,Ud as vm,Ue as vp,Uf as vt,Ug as vx,V,Va as Wo,Vb as Ae,Vc as yf,Vd as wm,Ve as wp,Vf as wt,Vg as wx,W,Wa as Xo,Wb as Be,Wc as zf,Wd as ym,We as yp,Wf as yt,Wg as yx,X,Xa as Yo,Xb as Ce,Xc as Af,Xd as zm,Xe as zp,Xf as zt,Xg as zx,Y,Ya as Zo,Yb as De,Yc as Bf,Yd as Am,Ye as Ap,Yf as At,Yg as Ax,Z,Za as _o,Zb as Ee,Zc as Cf,Zd as Bm,Ze as Bp,Zf as Bt,Zg as Bx,_,_a as $o,_b as Fe,_c as Df,_d as Cm,_e as Cp,_f as Ct,_g as Cx,a as o,aa as oo,ab as rr,ac as He,ad as Ff,ae as Em,af as Ep,ag as Et,ah as Ex,b as r,ba as ro,bb as er,bc as Ie,bd as Gf,be as Fm,bf as Fp,bg as Ft,bh as Fx,c as e,ca as eo,cb as fr,cc as Je,cd as Hf,ce as Gm,cf as Gp,cg as Gt,d as f,da as fo,db as mr,dc as Ke,dd as If,de as Hm,df as Hp,dg as Ht,e as m,ea as mo,eb as pr,ec as Le,ed as Jf,ee as Im,ef as Ip,eg as It,f as p,fa as po,fb as tr,fc as Me,fd as Kf,fe as Jm,ff as Jp,fg as Jt,g as t,ga as to,gb as xr,gc as Ne,gd as Lf,ge as Km,gf as Kp,gg as Kt,h as x,ha as xo,hb as ar,hc as Oe,hd as Mf,he as Lm,hf as Lp,hg as Lt,i as a,ia as ao,ib as br,ic as Pe,id as Nf,ie as Mm,if as Mp,ig as Mt,j as b,ja as bo,jb as cr,jc as Qe,jd as Of,je as Nm,jf as Np,jg as Nt,k as c,ka as co,kb as dr,kc as Re,kd as Pf,ke as Om,kf as Op,kg as Ot,l as d,la as go,lb as gr,lc as Se,ld as Qf,le as Pm,lf as Pp,lg as Pt,m as g,ma as ho,mb as hr,md as Rf,me as Qm,mf as Qp,mg as Qt,n as h,na as io,nb as ir,nd as Sf,ne as Rm,nf as Rp,ng as Rt,o as i,oa as jo,ob as jr,od as Tf,oe as Sm,of as Sp,og as St,p as j,pa as ko,pb as kr,pc as Te,pd as Uf,pe as Tm,pf as Tp,pg as Tt,q as k,qa as lo,qb as lr,qc as Ue,qd as Vf,qe as Um,qf as Up,qg as Ut,r as l,ra as no,rb as nr,rc as Ve,rd as Wf,re as Vm,rf as Vp,rg as Vt,s as n,sa as qo,sb as qr,sc as We,sd as Xf,se as Wm,sf as Wp,sg as Wt,t as q,ta as so,tb as _r,tc as Xe,td as Yf,te as Xm,tf as Xp,tg as Xt,u as s,ua as uo,ub as $r,uc as Ye,ud as Zf,ue as Ym,uf as Yp,ug as Yt,v as u,va as vo,vb as oe,vc as Ze,vd as _f,ve as Zm,vf as Zp,vg as Zt,w as v,wa as wo,wb as re,wc as _e,wd as $f,we as _m,wf as _p,wg as _t,x as w,xa as yo,xb as ee,xc as $e,xd as om,xe as $m,xf as $p,xg as $t,y,ya as zo,yb as fe,yc as of,yd as rm,ye as op,yf as ot,yg as ox,z,za as Ao,zb as me,zc as rf,zd as em,ze as rp,zf as rt,zg as rx}from"./chunks/chunk-3E4OSFP2.js";import{A as Or,B as Pr,C as Qr,D as Rr,E as Sr,F as Tr,G as Ur,H as Vr,I as Wr,J as Xr,K as Yr,L as Zr,g as sr,h as ur,i as vr,j as wr,k as yr,l as zr,m as Ar,n as Br,o as Cr,p as Dr,q as Er,r as Fr,s as Gr,t as Hr,u as Ir,v as Jr,w as Kr,x as Lr,y as Mr,z as Nr}from"./chunks/chunk-UH5WNJXF.js";import"./chunks/chunk-ONUPGMER.js";export{ir as ASK_USER_BACK_SIGNAL,jr as ASK_USER_CUSTOM_INPUT_SIGNAL,Ex as AgentActorController,wx as AgentActorStoreConflictError,ux as AgentBudgetExhaustedError,kx as AgentCancellationUncertainError,Cx as AgentControlError,sx as AgentLimitReachedError,yx as AgentOwnerConflictError,zx as AgentOwnerUnknownError,vx as AgentRevisionConflictError,Ax as AgentSettlementPersistenceError,Bx as AgentShutdownPersistenceError,jx as AgentStartUncertainError,Dx as AgentTurnScheduler,Yo as BUN_BE_BUN_ENV,Oo as CAPABILITY_CACHE_FILENAME,Pp as COMPACTED_HISTORY_RECOVERY_GUIDANCE,Gp as COMPACTION_PROTECTION_RATIO,Op as COMPACTION_SUMMARY_PREFIX,g as CONTEXT_SAFETY_FLOOR_TOKENS,h as CONTEXT_SAFETY_RATIO,Go as CORE_INVARIANTS,K as ConsoleTracingProcessor,i as ContextCapacityError,Dp as DEFAULT_COMPACTION_TRIGGER_PERCENT,Lt as DEFAULT_CONTEXT_WINDOW,me as DEFAULT_IDLE_YIELD_MAX_ITERATIONS,Dt as DEFAULT_MICROCOMPACTION_CONFIG,Vp as DEFAULT_POST_COMPACT_CONFIG,yp as DEFAULT_SUMMARY_PROMPT,X as DEFAULT_SYSTEM_CAP,zp as DEFAULT_UPDATE_SUMMARY_PROMPT,y as DefaultSummaryCompaction,Zo as ELECTRON_NODE_ENV_SCRUB_IMPORT,Xo as ELECTRON_RUN_AS_NODE_ENV,ym as EpisodeReviewBranchChangedError,wm as EpisodeReviewFailure,lx as ExternalAgentRegistrationConflictError,Ht as FileExtensionStore,Df as FileLearningCenterService,L as FileTracingProcessor,bo as GuardrailBlockedError,co as GuardrailEscalateError,Vo as HARDENED_ENV_VARS,Wo as HARDENING_OPT_OUT_ENV,Fr as ImageResizeError,ro as InvariantSession,a as KODAX_API_MIN_INTERVAL,r as KODAX_DEFAULT_TIMEOUT,Wr as KODAX_FILE_MEDIA_TYPES,e as KODAX_HARD_TIMEOUT,Ur as KODAX_IMAGE_MEDIA_TYPES,p as KODAX_MAX_INCOMPLETE_RETRIES,t as KODAX_MAX_MAXTOKENS_RETRIES,f as KODAX_MAX_RETRIES,o as KODAX_MAX_TOKENS,m as KODAX_RETRY_BASE_DELAY,x as KODAX_STAGGER_DELAY,Vr as KODAX_VIDEO_MEDIA_TYPES,Er as KodaXMediaError,kp as LINEAGE_ENTRY_TYPES,Af as LearnedAreaStore,qf as LearningCapabilityError,np as LineageCompaction,lp as LineageExtension,Fp as MAX_COMPACTION_TRIGGER_PERCENT,Lr as MAX_DIMENSION,Ke as MAX_ENTRYPOINT_BYTES,Je as MAX_ENTRYPOINT_LINES,_e as MAX_SKILL_MD_BYTES,$e as MAX_SKILL_SUPPORT_FILE_BYTES,fo as MAX_TOOL_LOOP_ITERATIONS,we as MEMORY_POLICY_VERSION,Ep as MIN_COMPACTION_TRIGGER_PERCENT,$m as McpAuthRequiredError,gp as McpCapabilityProvider,_m as McpExpiredSessionError,hp as McpManager,dp as McpServerRuntime,op as McpTransportCleanupIncompleteError,vm as MemoryControlPlane,sr as MessageQueue,Qr as PASTE_TMP_DIR_ENV,Rr as PASTE_TMP_TTL_MS,Up as POST_COMPACT_MAX_TOKENS_PER_FILE,Tp as POST_COMPACT_TOKEN_BUDGET,b as PROMISE_PATTERN,Np as PROTECTED_TOOL_NAMES,_r as QueuedInputArtifactError,Bo as Runner,vo as RunnerIterationLimitError,dm as SkillExecutor,xm as SkillRegistry,z as SpanImpl,Mr as TARGET_RAW_SIZE_BYTES,I as Tracer,mm as VariableResolver,ox as WORKFLOW_CAPSULE_API_VERSION,_t as WORKFLOW_CAPSULE_FORMAT,$t as WORKFLOW_CAPSULE_VERSION,St as WORKFLOW_PATTERN_IDS,px as WorkflowAbortError,xx as WorkflowBudgetError,Ot as WorkflowEventRecorder,tx as WorkflowLimitError,Wt as WorkflowScriptExecutionError,ax as WorkflowTaskFailedError,Br as YIELD_TOOL_NAMES,F as _emitSpanEnd,E as _emitSpanStart,G as _emitTraceEnd,D as _getRegisteredProcessors,Ar as _resetActiveRootQueueRoutesForTests,V as _resetAdmissionMetrics,oo as _resetAdmittedAgentBindings,R as _resetInvariantRegistry,vr as _resetMessageQueueForTests,zo as _resetPresetDispatchers,ef as acquireKodaXFileLock,wr as actorQueueId,B as addTracingProcessor,Xf as admitAndRecordLearnedSkillInvocation,Of as admitLearnedSkillBinding,Bt as appendGoalEntry,kt as appendMemoryClientNotice,ht as appendMemoryOutcomeDigest,it as appendMemoryReviewReceipt,ft as appendSessionLineageLabel,pt as applyLineageTruncation,M as applyManifestPatch,_o as applyProcessHardening,mt as applySessionCompaction,xf as applySkillLearningProposal,af as approveStoredLearningProposal,gt as archiveOldIslands,lr as asSingleSelection,uf as assertLearnedCapabilityTransition,Vt as assertRestrictedWorkflowQuality,so as attachRunnerRecoveryTranscript,he as bootstrapTeamMode,xo as buildAssistantMessageFromLlmResult,Ap as buildCompactionCacheInstruction,Bp as buildCompactionPromptSnapshot,Yp as buildFileContentMessages,cp as buildInitializeCapabilities,be as buildOtherInstancesPromptBlock,Wp as buildPostCompactAttachments,Gt as buildRecoverySeed,ct as buildSessionTree,Ao as buildSystemPrompt,ao as buildToolResultMessage,mx as buildWorkflowCapsuleIntent,Nt as buildWorkflowOutcome,j as calculateContextSafetyMargin,l as calculateMaxContextInputTokens,Ye as canMarkCreatedByAgent,sf as canTransitionLearnedCapability,zm as captureEpisodeReviewBranchEpoch,Bm as claimEpisodeReview,je as cleanupIncompleteToolCalls,gr as cleanupRegisteredManagedChildren,To as clearCapabilityCache,Qe as clearPluginSkillPaths,go as collectGuardrails,Jp as collectUserQueryLedger,Em as commitEpisodeReviewAction,Dm as commitEpisodeReviewDecision,Nf as commitLearnedSkillRevision,Sp as compact,Om as completeEpisodeReview,Jm as completeFencedEpisodeReview,Rf as completeLearnedSkillOutcome,Yf as completeLearnedSkillSessionOutcomes,fe as composeIdleYieldUserMessage,N as composePatches,lf as computeSkillConsumerImpact,hr as containWindowsEffectProcess,dt as countActiveLineageMessages,oe as countLastAssistantToolCalls,d as countTokens,u as createAgent,Fx as createAgentActorController,nx as createAgentExecutorPlane,gm as createExecutor,It as createExtensionStore,Jr as createFileArtifactFromPath,v as createHandoff,Ir as createImageArtifactFromPath,w as createInMemorySession,eo as createInvariantSessionForAgent,If as createLearnedCapabilityScope,Uf as createLearnedSkillActionDriver,Mf as createLearnedSkillRecord,Ef as createLearningCenterService,qe as createLlmJudgedStopHook,Vm as createMcpCapabilityId,ip as createMcpManager,jp as createMcpTestServerFixture,rp as createMcpTransport,ix as createMemoryAgentExecutorPlaneStore,um as createMemoryControlPlane,qx as createReferenceAgentExecutorFactory,pm as createResolver,Zt as createRestrictedWorkflowModule,_p as createSessionLineage,xe as createStateWriter,A as createTrace,Kr as createVideoArtifactFromPath,ex as createWorkflowCapsule,fx as createWorkflowModuleFromCapsule,Rt as createWorkflowProcessTracker,gx as createWorkflowRunManager,cx as createWorkflowRuntime,Ze as decideSkillGovernance,Um as defaultMcpCacheDir,J as defaultTracer,Im as deferEpisodeReview,lo as detectHandoffSignal,re as detectIdleYield,Y as detectInstructionsInjection,Km as discardFencedEpisodeReview,pp as discoverAuthorizationServerMetadata,ae as discoverInstances,tp as discoverOAuthEndpoints,mp as discoverProtectedResourceMetadata,om as discoverSkills,em as discoverSkillsWithMonorepo,lm as dispatchSkillCreatorTool,Qm as drainPendingEpisodeReviews,ke as editDistance,qo as emitHandoffSpan,q as emitKodaXDiagnostic,Zr as enqueueWithArtifacts,c as estimateTokens,Bf as eventFromCapability,tt as evictOldIslandMessageContent,Do as evidenceTrail,$f as exactInvokedSkillSnapshotForSession,k as exceedsContextCapacity,to as executeRunnerToolCall,hm as executeSkill,im as expandSkillForLLM,up as extractArtifactLedger,Co as extractAssistantTextFromMessage,qp as extractFileOps,fp as extractInsufficientScope,ep as extractResourceMetadataUrl,qt as extractTitleFromMessages,Hm as failEpisodeReviewApply,Gm as failEpisodeReviewAttempt,Eo as finalOwner,le as findFuzzyToolMatch,xt as findPreviousUserEntryId,bt as forkSessionLineage,s as formatKodaXDiagnostic,jm as formatSkillActivationMessage,Cm as freezeEpisodeReviewInput,nt as generateSessionId,lt as generateSessionIdSync,Cp as generateSummary,jt as getActiveMemoryOutcomeReviewIds,de as getActiveTeamModeWriter,qr as getActiveUserInteraction,U as getAdmissionMetricsSnapshot,$ as getAdmittedAgentBindings,Jo as getAgentConfigHome,Ko as getAgentConfigPath,No as getAppDataDir,Ro as getCachedRejectedEfforts,Po as getCapabilityCacheFile,Re as getDefaultSkillPaths,hx as getDefaultWorkflowRunManager,P as getInvariant,Ff as getLearnedExtensionToolName,Zm as getMcpCachePaths,ur as getMessageQueue,Xr as getModelInputCapabilities,rm as getNestedSkillPaths,$p as getSessionLineagePath,Zp as getSessionMessageEntryId,ot as getSessionMessagesFromLineage,Se as getSkillPathsFlat,am as getSkillRegistry,Kt as gracefulCompactDegradation,Fo as handoffLegality,ze as hashCwd,ue as hashMemoryIdentityComponent,Gr as inferImageMediaType,Hr as inferVideoMediaType,bm as initializeSkillRegistry,Xp as injectPostCompactAttachments,Lm as inspectEpisodeReviewJob,Qf as invokeLearnedSkillCanary,ne as invokeLlmJudge,W as isAdmissionDebugEnabled,kr as isAskUserCustomInputAnswer,Ee as isAutoManagedMemoryFile,er as isChildProcessExited,pr as isCurrentProcessWindowsJobContained,Qp as isEmptyLikeSummary,Pt as isFinalWorkflowProcessStatus,Ct as isGoalEntry,$r as isIdleYieldEnabled,Tf as isLearnedCapabilityRecordV2,Gf as isLearnedExtensionCommandAllowed,Me as isMemoryManagementController,Lo as isPathInsideDirectory,mo as isRunnableTool,wo as isRunnerIterationLimitError,po as isRunnerLlmResult,km as isSkillCreatorDispatchAction,Sm as isUnifiedLearningReviewModelInput,br as killChildProcessTree,cr as killChildProcessTreeSync,xr as killPidTree,ar as killPidTreeSync,yf as learningEventIdFor,wf as learningEventKindForLifecycle,Ut as lintRestrictedWorkflowSource,_f as listLearnedSkillUsageReceipts,Nm as listPendingEpisodeReviewSummaries,Mm as listPendingEpisodeReviews,Pe as listPluginSkillPaths,Q as listRegisteredInvariants,Qo as loadCapabilityCache,Ve as loadFullSkill,We as loadSkillFileContent,Ue as loadSkillMetadata,bp as loadValidToken,se as matchesMemoryApplicability,Dr as maybeDrainMidTurn,ve as memoryApplicabilityFingerprint,qm as memoryMutationHandle,nm as memoryProposalRevision,vp as mergeArtifactLedger,sp as mergeFileOps,Kp as mergeUserQueryLedger,Et as microcompact,Cr as midTurnDrainPriority,Vf as migrateLegacyLearnedSkillsForProject,Rp as needsCompaction,Hp as normalizeCompactionConfig,Qt as normalizeHostMetadata,Wm as normalizeMcpCapabilityId,Nr as normalizePastedImage,Ft as normalizeRecoveryPrompt,Tm as normalizeUnifiedLearningReview,bx as normalizeWorkflowLimits,fm as parseArguments,Xm as parseMcpCapabilityId,He as parseMemoryFile,Ge as parseMemoryType,Fe as parseMemoryTypeFromFilename,Ie as parseScalarFields,Te as parseSkillMarkdown,Mp as parseUserQueryLedger,ap as performOAuthLogin,yt as persistCompactedSessionHistory,Sr as persistImageAsBlock,Am as persistPendingEpisodeReview,$o as prepareInternalNodeLaunch,or as prepareJavaScriptChildLaunch,Cf as projectLearningProposals,Tr as prunePasteTmpDir,Sf as quarantineLearnedSkillRevision,Pr as readAndNormalizeClipboardImage,Or as readClipboardImage,zt as readLatestGoalFromBranch,At as readLatestGoalState,ff as readLearningProposalStore,mr as readProcessStartIdentity,uo as readRunnerRecoveryTranscript,wt as readSessionHistoryEntry,jf as readSkillTrustLedger,gf as readSkillUsageLedger,Zf as reconcileLearnedSkillBindingOutcomes,nf as recordCompletedTurnLearning,Wf as recordLearnedSkillOffered,bf as recordProceduralLearning,So as recordRejectedEffort,hf as recordSkillUsage,yr as registerActiveRootQueueRoute,Ho as registerCoreInvariants,O as registerInvariant,dr as registerManagedChildProcess,xp as registerOAuthClient,Ne as registerPluginSkillPath,yo as registerPresetDispatcher,Pf as releaseLearnedSkillBinding,tr as rememberChildProcessTree,Kf as renderDeclarativeSkill,Lp as renderUserQueryLedger,no as replaceSystemMessage,Uo as resetCapabilityCacheMemoForTesting,cm as resetSkillRegistry,zr as resolveActiveRootQueueRoute,Ip as resolveCompactionPolicy,Mt as resolveContextWindow,T as resolveEffectiveInvariants,Mo as resolveExecutionPath,zf as resolveLearnedAreaPaths,pf as resolveLearningProposalStore,Ce as resolveMemoryEntrypoint,Be as resolveMemoryRoot,Hf as resolveProjectLearnedAreaRoot,S as resolveRequiredInvariants,De as resolveScopedMemoryRoot,rt as resolveSessionLineageTarget,tm as resolveSkillContent,of as resolveSkillSnapshotLocation,df as resolveSkillTrustLedger,cf as resolveSkillUsageLedger,at as rewindSessionLineage,Z as runAdmissionAudit,te as runFanOut,ho as runInputGuardrails,io as runOutputGuardrails,Yt as runRestrictedWorkflowScript,ko as runToolAfterGuardrails,jo as runToolBeforeGuardrails,pe as runWithIdleYield,dx as runWorkflow,ye as sanitizeProjectKey,sm as sanitizePromptSafeMemoryClaim,Rm as sanitizeUnifiedLearningReviewInput,Ym as searchMcpCatalog,st as searchSessionHistory,vt as searchSessionHistoryCooperatively,wp as serializeConversation,ce as setActiveTeamModeWriter,nr as setActiveUserInteraction,_ as setAdmittedAgentBindings,Io as setAgentConfigHome,n as setKodaXDiagnosticSink,et as setSessionLineageActiveEntry,C as setTracingProcessors,Jt as shouldCompact,H as shutdownTracing,vf as slugifyLearnedCapabilityName,Lf as stageLearnedSkillRevision,rr as stripHardenedEnvVars,Xe as triageProceduralLearning,Le as truncateEntrypointContent,Ae as tryGitRemote,Oe as unregisterPluginSkillPath,ge as updateActiveTeamMode,tf as updateLearningProposalStatus,kf as updateSkillTrustLedger,mf as upsertLearningProposal,ie as validateAndFixToolHistory,Jf as validateDeclarativeSkillSpec,Yr as validateInputArtifactsForModel,Xt as validateRestrictedWorkflowSource,ut as validateSessionHistorySearchQuery,rx as validateWorkflowCapsule,Tt as validateWorkflowScriptManifest,fr as waitForChildProcessExit,ee as waitForWakeEvent,Fm as withEpisodeReviewClaimAuthority,rf as withKodaXFileLock,Pm as withPendingEpisodeReviewSessionFence};
2
+ import{$,$a as or,$b as Ge,$c as Ef,$d as Dm,$e as Dp,$f as Dt,$g as Dx,A,Aa as Bo,Ab as pe,Ac as ef,Ad as fm,Ae as ep,Af as et,Ag as ex,B,Ba as Co,Bb as te,Bc as ff,Bd as mm,Be as fp,Bf as ft,Bg as fx,C,Ca as Do,Cb as xe,Cc as mf,Cd as pm,Ce as mp,Cf as mt,Cg as mx,D,Da as Eo,Db as ae,Dc as pf,Dd as tm,De as pp,Df as pt,Dg as px,E,Ea as Fo,Eb as be,Ec as tf,Ed as xm,Ee as tp,Ef as tt,Eg as tx,F,Fa as Go,Fb as ce,Fc as xf,Fd as am,Fe as xp,Ff as xt,Fg as xx,G,Ga as Ho,Gb as de,Gc as af,Gd as bm,Ge as ap,Gf as at,Gg as ax,H,Ha as Io,Hb as ge,Hc as bf,Hd as cm,He as bp,Hf as bt,Hg as bx,I,Ia as Jo,Ib as he,Ic as cf,Id as dm,Ie as cp,If as ct,Ig as cx,J,Ja as Ko,Jb as ie,Jc as df,Jd as gm,Je as dp,Jf as dt,Jg as dx,K,Ka as Lo,Kb as je,Kc as gf,Kd as hm,Ke as gp,Kf as gt,Kg as gx,L,La as Mo,Lb as ke,Lc as hf,Ld as im,Le as hp,Lf as ht,Lg as hx,M,Ma as No,Mb as le,Mc as jf,Md as jm,Me as ip,Mf as it,Mg as ix,N,Na as Oo,Nb as ne,Nc as kf,Nd as km,Ne as jp,Nf as jt,Ng as jx,O,Oa as Po,Ob as qe,Oc as lf,Od as lm,Oe as kp,Of as kt,Og as kx,P,Pa as Qo,Pb as se,Pc as nf,Pd as nm,Pe as lp,Pf as lt,Pg as lx,Q,Qa as Ro,Qb as ue,Qc as qf,Qd as qm,Qe as np,Qf as nt,Qg as nx,R,Ra as So,Rb as ve,Rc as sf,Re as qp,Rf as qt,Rg as qx,S,Sa as To,Sb as we,Sc as uf,Sd as sm,Se as sp,Sf as st,Sg as sx,T,Ta as Uo,Tb as ye,Tc as vf,Td as um,Te as up,Tf as ut,Tg as ux,U,Ua as Vo,Ub as ze,Uc as wf,Ud as vm,Ue as vp,Uf as vt,Ug as vx,V,Va as Wo,Vb as Ae,Vc as yf,Vd as wm,Ve as wp,Vf as wt,Vg as wx,W,Wa as Xo,Wb as Be,Wc as zf,Wd as ym,We as yp,Wf as yt,Wg as yx,X,Xa as Yo,Xb as Ce,Xc as Af,Xd as zm,Xe as zp,Xf as zt,Xg as zx,Y,Ya as Zo,Yb as De,Yc as Bf,Yd as Am,Ye as Ap,Yf as At,Yg as Ax,Z,Za as _o,Zb as Ee,Zc as Cf,Zd as Bm,Ze as Bp,Zf as Bt,Zg as Bx,_,_a as $o,_b as Fe,_c as Df,_d as Cm,_e as Cp,_f as Ct,_g as Cx,a as o,aa as oo,ab as rr,ac as He,ad as Ff,ae as Em,af as Ep,ag as Et,ah as Ex,b as r,ba as ro,bb as er,bc as Ie,bd as Gf,be as Fm,bf as Fp,bg as Ft,bh as Fx,c as e,ca as eo,cb as fr,cc as Je,cd as Hf,ce as Gm,cf as Gp,cg as Gt,d as f,da as fo,db as mr,dc as Ke,dd as If,de as Hm,df as Hp,dg as Ht,e as m,ea as mo,eb as pr,ec as Le,ed as Jf,ee as Im,ef as Ip,eg as It,f as p,fa as po,fb as tr,fc as Me,fd as Kf,fe as Jm,ff as Jp,fg as Jt,g as t,ga as to,gb as xr,gc as Ne,gd as Lf,ge as Km,gf as Kp,gg as Kt,h as x,ha as xo,hb as ar,hc as Oe,hd as Mf,he as Lm,hf as Lp,hg as Lt,i as a,ia as ao,ib as br,ic as Pe,id as Nf,ie as Mm,if as Mp,ig as Mt,j as b,ja as bo,jb as cr,jc as Qe,jd as Of,je as Nm,jf as Np,jg as Nt,k as c,ka as co,kb as dr,kc as Re,kd as Pf,ke as Om,kf as Op,kg as Ot,l as d,la as go,lb as gr,lc as Se,ld as Qf,le as Pm,lf as Pp,lg as Pt,m as g,ma as ho,mb as hr,md as Rf,me as Qm,mf as Qp,mg as Qt,n as h,na as io,nb as ir,nd as Sf,ne as Rm,nf as Rp,ng as Rt,o as i,oa as jo,ob as jr,od as Tf,oe as Sm,of as Sp,og as St,p as j,pa as ko,pb as kr,pc as Te,pd as Uf,pe as Tm,pf as Tp,pg as Tt,q as k,qa as lo,qb as lr,qc as Ue,qd as Vf,qe as Um,qf as Up,qg as Ut,r as l,ra as no,rb as nr,rc as Ve,rd as Wf,re as Vm,rf as Vp,rg as Vt,s as n,sa as qo,sb as qr,sc as We,sd as Xf,se as Wm,sf as Wp,sg as Wt,t as q,ta as so,tb as _r,tc as Xe,td as Yf,te as Xm,tf as Xp,tg as Xt,u as s,ua as uo,ub as $r,uc as Ye,ud as Zf,ue as Ym,uf as Yp,ug as Yt,v as u,va as vo,vb as oe,vc as Ze,vd as _f,ve as Zm,vf as Zp,vg as Zt,w as v,wa as wo,wb as re,wc as _e,wd as $f,we as _m,wf as _p,wg as _t,x as w,xa as yo,xb as ee,xc as $e,xd as om,xe as $m,xf as $p,xg as $t,y,ya as zo,yb as fe,yc as of,yd as rm,ye as op,yf as ot,yg as ox,z,za as Ao,zb as me,zc as rf,zd as em,ze as rp,zf as rt,zg as rx}from"./chunks/chunk-ITP7J5HX.js";import{A as Or,B as Pr,C as Qr,D as Rr,E as Sr,F as Tr,G as Ur,H as Vr,I as Wr,J as Xr,K as Yr,L as Zr,g as sr,h as ur,i as vr,j as wr,k as yr,l as zr,m as Ar,n as Br,o as Cr,p as Dr,q as Er,r as Fr,s as Gr,t as Hr,u as Ir,v as Jr,w as Kr,x as Lr,y as Mr,z as Nr}from"./chunks/chunk-XH7UM4GO.js";import"./chunks/chunk-ONUPGMER.js";export{ir as ASK_USER_BACK_SIGNAL,jr as ASK_USER_CUSTOM_INPUT_SIGNAL,Ex as AgentActorController,wx as AgentActorStoreConflictError,ux as AgentBudgetExhaustedError,kx as AgentCancellationUncertainError,Cx as AgentControlError,sx as AgentLimitReachedError,yx as AgentOwnerConflictError,zx as AgentOwnerUnknownError,vx as AgentRevisionConflictError,Ax as AgentSettlementPersistenceError,Bx as AgentShutdownPersistenceError,jx as AgentStartUncertainError,Dx as AgentTurnScheduler,Yo as BUN_BE_BUN_ENV,Oo as CAPABILITY_CACHE_FILENAME,Pp as COMPACTED_HISTORY_RECOVERY_GUIDANCE,Gp as COMPACTION_PROTECTION_RATIO,Op as COMPACTION_SUMMARY_PREFIX,g as CONTEXT_SAFETY_FLOOR_TOKENS,h as CONTEXT_SAFETY_RATIO,Go as CORE_INVARIANTS,K as ConsoleTracingProcessor,i as ContextCapacityError,Dp as DEFAULT_COMPACTION_TRIGGER_PERCENT,Lt as DEFAULT_CONTEXT_WINDOW,me as DEFAULT_IDLE_YIELD_MAX_ITERATIONS,Dt as DEFAULT_MICROCOMPACTION_CONFIG,Vp as DEFAULT_POST_COMPACT_CONFIG,yp as DEFAULT_SUMMARY_PROMPT,X as DEFAULT_SYSTEM_CAP,zp as DEFAULT_UPDATE_SUMMARY_PROMPT,y as DefaultSummaryCompaction,Zo as ELECTRON_NODE_ENV_SCRUB_IMPORT,Xo as ELECTRON_RUN_AS_NODE_ENV,ym as EpisodeReviewBranchChangedError,wm as EpisodeReviewFailure,lx as ExternalAgentRegistrationConflictError,Ht as FileExtensionStore,Df as FileLearningCenterService,L as FileTracingProcessor,bo as GuardrailBlockedError,co as GuardrailEscalateError,Vo as HARDENED_ENV_VARS,Wo as HARDENING_OPT_OUT_ENV,Fr as ImageResizeError,ro as InvariantSession,a as KODAX_API_MIN_INTERVAL,r as KODAX_DEFAULT_TIMEOUT,Wr as KODAX_FILE_MEDIA_TYPES,e as KODAX_HARD_TIMEOUT,Ur as KODAX_IMAGE_MEDIA_TYPES,p as KODAX_MAX_INCOMPLETE_RETRIES,t as KODAX_MAX_MAXTOKENS_RETRIES,f as KODAX_MAX_RETRIES,o as KODAX_MAX_TOKENS,m as KODAX_RETRY_BASE_DELAY,x as KODAX_STAGGER_DELAY,Vr as KODAX_VIDEO_MEDIA_TYPES,Er as KodaXMediaError,kp as LINEAGE_ENTRY_TYPES,Af as LearnedAreaStore,qf as LearningCapabilityError,np as LineageCompaction,lp as LineageExtension,Fp as MAX_COMPACTION_TRIGGER_PERCENT,Lr as MAX_DIMENSION,Ke as MAX_ENTRYPOINT_BYTES,Je as MAX_ENTRYPOINT_LINES,_e as MAX_SKILL_MD_BYTES,$e as MAX_SKILL_SUPPORT_FILE_BYTES,fo as MAX_TOOL_LOOP_ITERATIONS,we as MEMORY_POLICY_VERSION,Ep as MIN_COMPACTION_TRIGGER_PERCENT,$m as McpAuthRequiredError,gp as McpCapabilityProvider,_m as McpExpiredSessionError,hp as McpManager,dp as McpServerRuntime,op as McpTransportCleanupIncompleteError,vm as MemoryControlPlane,sr as MessageQueue,Qr as PASTE_TMP_DIR_ENV,Rr as PASTE_TMP_TTL_MS,Up as POST_COMPACT_MAX_TOKENS_PER_FILE,Tp as POST_COMPACT_TOKEN_BUDGET,b as PROMISE_PATTERN,Np as PROTECTED_TOOL_NAMES,_r as QueuedInputArtifactError,Bo as Runner,vo as RunnerIterationLimitError,dm as SkillExecutor,xm as SkillRegistry,z as SpanImpl,Mr as TARGET_RAW_SIZE_BYTES,I as Tracer,mm as VariableResolver,ox as WORKFLOW_CAPSULE_API_VERSION,_t as WORKFLOW_CAPSULE_FORMAT,$t as WORKFLOW_CAPSULE_VERSION,St as WORKFLOW_PATTERN_IDS,px as WorkflowAbortError,xx as WorkflowBudgetError,Ot as WorkflowEventRecorder,tx as WorkflowLimitError,Wt as WorkflowScriptExecutionError,ax as WorkflowTaskFailedError,Br as YIELD_TOOL_NAMES,F as _emitSpanEnd,E as _emitSpanStart,G as _emitTraceEnd,D as _getRegisteredProcessors,Ar as _resetActiveRootQueueRoutesForTests,V as _resetAdmissionMetrics,oo as _resetAdmittedAgentBindings,R as _resetInvariantRegistry,vr as _resetMessageQueueForTests,zo as _resetPresetDispatchers,ef as acquireKodaXFileLock,wr as actorQueueId,B as addTracingProcessor,Xf as admitAndRecordLearnedSkillInvocation,Of as admitLearnedSkillBinding,Bt as appendGoalEntry,kt as appendMemoryClientNotice,ht as appendMemoryOutcomeDigest,it as appendMemoryReviewReceipt,ft as appendSessionLineageLabel,pt as applyLineageTruncation,M as applyManifestPatch,_o as applyProcessHardening,mt as applySessionCompaction,xf as applySkillLearningProposal,af as approveStoredLearningProposal,gt as archiveOldIslands,lr as asSingleSelection,uf as assertLearnedCapabilityTransition,Vt as assertRestrictedWorkflowQuality,so as attachRunnerRecoveryTranscript,he as bootstrapTeamMode,xo as buildAssistantMessageFromLlmResult,Ap as buildCompactionCacheInstruction,Bp as buildCompactionPromptSnapshot,Yp as buildFileContentMessages,cp as buildInitializeCapabilities,be as buildOtherInstancesPromptBlock,Wp as buildPostCompactAttachments,Gt as buildRecoverySeed,ct as buildSessionTree,Ao as buildSystemPrompt,ao as buildToolResultMessage,mx as buildWorkflowCapsuleIntent,Nt as buildWorkflowOutcome,j as calculateContextSafetyMargin,l as calculateMaxContextInputTokens,Ye as canMarkCreatedByAgent,sf as canTransitionLearnedCapability,zm as captureEpisodeReviewBranchEpoch,Bm as claimEpisodeReview,je as cleanupIncompleteToolCalls,gr as cleanupRegisteredManagedChildren,To as clearCapabilityCache,Qe as clearPluginSkillPaths,go as collectGuardrails,Jp as collectUserQueryLedger,Em as commitEpisodeReviewAction,Dm as commitEpisodeReviewDecision,Nf as commitLearnedSkillRevision,Sp as compact,Om as completeEpisodeReview,Jm as completeFencedEpisodeReview,Rf as completeLearnedSkillOutcome,Yf as completeLearnedSkillSessionOutcomes,fe as composeIdleYieldUserMessage,N as composePatches,lf as computeSkillConsumerImpact,hr as containWindowsEffectProcess,dt as countActiveLineageMessages,oe as countLastAssistantToolCalls,d as countTokens,u as createAgent,Fx as createAgentActorController,nx as createAgentExecutorPlane,gm as createExecutor,It as createExtensionStore,Jr as createFileArtifactFromPath,v as createHandoff,Ir as createImageArtifactFromPath,w as createInMemorySession,eo as createInvariantSessionForAgent,If as createLearnedCapabilityScope,Uf as createLearnedSkillActionDriver,Mf as createLearnedSkillRecord,Ef as createLearningCenterService,qe as createLlmJudgedStopHook,Vm as createMcpCapabilityId,ip as createMcpManager,jp as createMcpTestServerFixture,rp as createMcpTransport,ix as createMemoryAgentExecutorPlaneStore,um as createMemoryControlPlane,qx as createReferenceAgentExecutorFactory,pm as createResolver,Zt as createRestrictedWorkflowModule,_p as createSessionLineage,xe as createStateWriter,A as createTrace,Kr as createVideoArtifactFromPath,ex as createWorkflowCapsule,fx as createWorkflowModuleFromCapsule,Rt as createWorkflowProcessTracker,gx as createWorkflowRunManager,cx as createWorkflowRuntime,Ze as decideSkillGovernance,Um as defaultMcpCacheDir,J as defaultTracer,Im as deferEpisodeReview,lo as detectHandoffSignal,re as detectIdleYield,Y as detectInstructionsInjection,Km as discardFencedEpisodeReview,pp as discoverAuthorizationServerMetadata,ae as discoverInstances,tp as discoverOAuthEndpoints,mp as discoverProtectedResourceMetadata,om as discoverSkills,em as discoverSkillsWithMonorepo,lm as dispatchSkillCreatorTool,Qm as drainPendingEpisodeReviews,ke as editDistance,qo as emitHandoffSpan,q as emitKodaXDiagnostic,Zr as enqueueWithArtifacts,c as estimateTokens,Bf as eventFromCapability,tt as evictOldIslandMessageContent,Do as evidenceTrail,$f as exactInvokedSkillSnapshotForSession,k as exceedsContextCapacity,to as executeRunnerToolCall,hm as executeSkill,im as expandSkillForLLM,up as extractArtifactLedger,Co as extractAssistantTextFromMessage,qp as extractFileOps,fp as extractInsufficientScope,ep as extractResourceMetadataUrl,qt as extractTitleFromMessages,Hm as failEpisodeReviewApply,Gm as failEpisodeReviewAttempt,Eo as finalOwner,le as findFuzzyToolMatch,xt as findPreviousUserEntryId,bt as forkSessionLineage,s as formatKodaXDiagnostic,jm as formatSkillActivationMessage,Cm as freezeEpisodeReviewInput,nt as generateSessionId,lt as generateSessionIdSync,Cp as generateSummary,jt as getActiveMemoryOutcomeReviewIds,de as getActiveTeamModeWriter,qr as getActiveUserInteraction,U as getAdmissionMetricsSnapshot,$ as getAdmittedAgentBindings,Jo as getAgentConfigHome,Ko as getAgentConfigPath,No as getAppDataDir,Ro as getCachedRejectedEfforts,Po as getCapabilityCacheFile,Re as getDefaultSkillPaths,hx as getDefaultWorkflowRunManager,P as getInvariant,Ff as getLearnedExtensionToolName,Zm as getMcpCachePaths,ur as getMessageQueue,Xr as getModelInputCapabilities,rm as getNestedSkillPaths,$p as getSessionLineagePath,Zp as getSessionMessageEntryId,ot as getSessionMessagesFromLineage,Se as getSkillPathsFlat,am as getSkillRegistry,Kt as gracefulCompactDegradation,Fo as handoffLegality,ze as hashCwd,ue as hashMemoryIdentityComponent,Gr as inferImageMediaType,Hr as inferVideoMediaType,bm as initializeSkillRegistry,Xp as injectPostCompactAttachments,Lm as inspectEpisodeReviewJob,Qf as invokeLearnedSkillCanary,ne as invokeLlmJudge,W as isAdmissionDebugEnabled,kr as isAskUserCustomInputAnswer,Ee as isAutoManagedMemoryFile,er as isChildProcessExited,pr as isCurrentProcessWindowsJobContained,Qp as isEmptyLikeSummary,Pt as isFinalWorkflowProcessStatus,Ct as isGoalEntry,$r as isIdleYieldEnabled,Tf as isLearnedCapabilityRecordV2,Gf as isLearnedExtensionCommandAllowed,Me as isMemoryManagementController,Lo as isPathInsideDirectory,mo as isRunnableTool,wo as isRunnerIterationLimitError,po as isRunnerLlmResult,km as isSkillCreatorDispatchAction,Sm as isUnifiedLearningReviewModelInput,br as killChildProcessTree,cr as killChildProcessTreeSync,xr as killPidTree,ar as killPidTreeSync,yf as learningEventIdFor,wf as learningEventKindForLifecycle,Ut as lintRestrictedWorkflowSource,_f as listLearnedSkillUsageReceipts,Nm as listPendingEpisodeReviewSummaries,Mm as listPendingEpisodeReviews,Pe as listPluginSkillPaths,Q as listRegisteredInvariants,Qo as loadCapabilityCache,Ve as loadFullSkill,We as loadSkillFileContent,Ue as loadSkillMetadata,bp as loadValidToken,se as matchesMemoryApplicability,Dr as maybeDrainMidTurn,ve as memoryApplicabilityFingerprint,qm as memoryMutationHandle,nm as memoryProposalRevision,vp as mergeArtifactLedger,sp as mergeFileOps,Kp as mergeUserQueryLedger,Et as microcompact,Cr as midTurnDrainPriority,Vf as migrateLegacyLearnedSkillsForProject,Rp as needsCompaction,Hp as normalizeCompactionConfig,Qt as normalizeHostMetadata,Wm as normalizeMcpCapabilityId,Nr as normalizePastedImage,Ft as normalizeRecoveryPrompt,Tm as normalizeUnifiedLearningReview,bx as normalizeWorkflowLimits,fm as parseArguments,Xm as parseMcpCapabilityId,He as parseMemoryFile,Ge as parseMemoryType,Fe as parseMemoryTypeFromFilename,Ie as parseScalarFields,Te as parseSkillMarkdown,Mp as parseUserQueryLedger,ap as performOAuthLogin,yt as persistCompactedSessionHistory,Sr as persistImageAsBlock,Am as persistPendingEpisodeReview,$o as prepareInternalNodeLaunch,or as prepareJavaScriptChildLaunch,Cf as projectLearningProposals,Tr as prunePasteTmpDir,Sf as quarantineLearnedSkillRevision,Pr as readAndNormalizeClipboardImage,Or as readClipboardImage,zt as readLatestGoalFromBranch,At as readLatestGoalState,ff as readLearningProposalStore,mr as readProcessStartIdentity,uo as readRunnerRecoveryTranscript,wt as readSessionHistoryEntry,jf as readSkillTrustLedger,gf as readSkillUsageLedger,Zf as reconcileLearnedSkillBindingOutcomes,nf as recordCompletedTurnLearning,Wf as recordLearnedSkillOffered,bf as recordProceduralLearning,So as recordRejectedEffort,hf as recordSkillUsage,yr as registerActiveRootQueueRoute,Ho as registerCoreInvariants,O as registerInvariant,dr as registerManagedChildProcess,xp as registerOAuthClient,Ne as registerPluginSkillPath,yo as registerPresetDispatcher,Pf as releaseLearnedSkillBinding,tr as rememberChildProcessTree,Kf as renderDeclarativeSkill,Lp as renderUserQueryLedger,no as replaceSystemMessage,Uo as resetCapabilityCacheMemoForTesting,cm as resetSkillRegistry,zr as resolveActiveRootQueueRoute,Ip as resolveCompactionPolicy,Mt as resolveContextWindow,T as resolveEffectiveInvariants,Mo as resolveExecutionPath,zf as resolveLearnedAreaPaths,pf as resolveLearningProposalStore,Ce as resolveMemoryEntrypoint,Be as resolveMemoryRoot,Hf as resolveProjectLearnedAreaRoot,S as resolveRequiredInvariants,De as resolveScopedMemoryRoot,rt as resolveSessionLineageTarget,tm as resolveSkillContent,of as resolveSkillSnapshotLocation,df as resolveSkillTrustLedger,cf as resolveSkillUsageLedger,at as rewindSessionLineage,Z as runAdmissionAudit,te as runFanOut,ho as runInputGuardrails,io as runOutputGuardrails,Yt as runRestrictedWorkflowScript,ko as runToolAfterGuardrails,jo as runToolBeforeGuardrails,pe as runWithIdleYield,dx as runWorkflow,ye as sanitizeProjectKey,sm as sanitizePromptSafeMemoryClaim,Rm as sanitizeUnifiedLearningReviewInput,Ym as searchMcpCatalog,st as searchSessionHistory,vt as searchSessionHistoryCooperatively,wp as serializeConversation,ce as setActiveTeamModeWriter,nr as setActiveUserInteraction,_ as setAdmittedAgentBindings,Io as setAgentConfigHome,n as setKodaXDiagnosticSink,et as setSessionLineageActiveEntry,C as setTracingProcessors,Jt as shouldCompact,H as shutdownTracing,vf as slugifyLearnedCapabilityName,Lf as stageLearnedSkillRevision,rr as stripHardenedEnvVars,Xe as triageProceduralLearning,Le as truncateEntrypointContent,Ae as tryGitRemote,Oe as unregisterPluginSkillPath,ge as updateActiveTeamMode,tf as updateLearningProposalStatus,kf as updateSkillTrustLedger,mf as upsertLearningProposal,ie as validateAndFixToolHistory,Jf as validateDeclarativeSkillSpec,Yr as validateInputArtifactsForModel,Xt as validateRestrictedWorkflowSource,ut as validateSessionHistorySearchQuery,rx as validateWorkflowCapsule,Tt as validateWorkflowScriptManifest,fr as waitForChildProcessExit,ee as waitForWakeEvent,Fm as withEpisodeReviewClaimAuthority,rf as withKodaXFileLock,Pm as withPendingEpisodeReviewSessionFence};