clawdi 0.14.93 → 0.14.94

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 (2) hide show
  1. package/dist/index.js +1 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -943,7 +943,7 @@ await sdk.mutateConfigFile({
943
943
  mutate,
944
944
  });
945
945
  `;var k_=b(()=>{yo();vn();oa();Ve();sr();gie=new Map,hie=new Map});import{readFileSync as k9e}from"node:fs";function QH(e){if(Array.isArray(e))return e.some(QH);if(e===null||typeof e!=="object")return!1;return Object.hasOwn(e,"$include")||Object.values(e).some(QH)}function tB(e,t,n,r){let i;try{i=k9e(t.configPath,"utf8")}catch(o){if(o instanceof Error&&"code"in o&&o.code==="ENOENT")return{providers:{},included:!1};throw Error("OpenClaw native provider ownership could not be inspected")}try{let o=h.record(h.string(),h.unknown()),s=o.parse(bie.default.parse(i)),a=s.models===void 0?{}:o.parse(s.models),l=Object.hasOwn(s,"$include")||QH(a),c;if(l){let u={...r,NO_COLOR:"1",CLICOLOR:"0"};delete u.FORCE_COLOR,delete u.CLICOLOR_FORCE;let d=de(e,["config","get","models","--json"],t.home,n,{environment:u,environmentOverrides:{FORCE_COLOR:void 0,CLICOLOR_FORCE:void 0},timeoutMs:30000,maxBufferBytes:16777216});if(d.status!==0){if(d.status===1&&!d.error&&(d.stdout===""&&d.stderr===A9e||d.stderr===""&&R9e.safeParse(JSON.parse(String(d.stdout))).success))return{providers:{},included:l};throw Error("Included provider config is unavailable")}let p=o.parse(JSON.parse(String(d.stdout)));c=p.providers===void 0?{}:o.parse(p.providers)}else c=a.providers===void 0?{}:o.parse(a.providers);return{providers:c,included:l}}catch{throw Error("OpenClaw native provider ownership could not be inspected")}}function Sie(e,t,n,r){let{providers:i,included:o}=tB(e,t,n,r);return Object.entries(i).flatMap(([s,a])=>{let l=E9e.safeParse(a);if(!l.success)return[];let c=nc("openclaw",s,l.data.baseUrl);return c&&(c.runtime_env_name===l.data.apiKey.id||o&&l.data.apiKey.id==="__OPENCLAW_REDACTED__")?[s]:[]})}function eB(e,t,n,r,i,o){if(de(e,t,r,i,{...o,input:n}).status!==0)throw Error("OpenClaw native provider configuration failed")}function kie(e,t,n,r,i){let o=new Map(e.flatMap(({routing:u})=>{let d=[[u.openclaw.plugin,u.openclaw.package]];if(u.openclaw.companion_plugin&&u.openclaw.companion_package)d.push([u.openclaw.companion_plugin,u.openclaw.companion_package]);return d}));if(o.size===0)return!1;let s=(u)=>{let d=de(t,u,n,r,{timeoutMs:30000,environment:i});return{status:d.status,stdout:String(d.stdout??""),stderr:String(d.stderr??"")}},a=()=>{let u=s(["plugins","list","--json"]);if(u.status!==0)throw Error("Native OpenClaw provider plugins could not be inspected");return H0.parse(JSON.parse(String(u.stdout)))},l=!1,c=a();for(let[u,d]of o){if(!c.plugins.some((m)=>m.id===u))eB(t,["plugins","install",d,"--force",...Vd("install",s)],"",n,r,{timeoutMs:180000,environment:i}),l=!0,c=a();let p=c.plugins.filter((m)=>m.id===u);if(p.length!==1||p[0]?.status==="error")throw Error(`Required native OpenClaw provider plugin ${u} is unavailable`);if(p[0]?.enabled!==!0)eB(t,["plugins","enable",u,...Vd("enable",s)],"",n,r,{timeoutMs:30000,environment:i}),l=!0,c=a();if(!c.plugins.some((m)=>m.id===u&&m.enabled&&m.status==="loaded"))throw Error(`Required native OpenClaw provider plugin ${u} did not activate`)}return l}function nB(e,t){let n={},r=[];for(let i of e){if(i.auth.kind!=="api-key")continue;let o=i.routing.openclaw.provider;r.push(o),n[o]={baseUrl:i.routing.base_url,auth:"api-key",apiKey:{source:"env",provider:"clawdi-native",id:i.auth.envName}}}for(let i of t)if(!r.includes(i))n[i]={apiKey:null,auth:null,baseUrl:null};return{providerIds:r,config:{...e.length||Object.keys(n).length?{models:{...e.length?{mode:"merge"}:{},...Object.keys(n).length?{providers:n}:{}}}:{},...r.length?{secrets:{providers:{"clawdi-native":{source:"env"}}}}:{}}}}function Eie(e){let{command:t,context:n,workspaceRoot:r,environment:i}=e;if(S_(n,e.patch.config))return!1;return eB(t,["config","patch","--stdin"],JSON.stringify(e.patch.config),n.home,r,{timeoutMs:30000,environment:i}),!0}var bie,E9e,A9e=`Config path not found: models. Run openclaw config validate to inspect config shape.
946
- `,R9e;var rB=b(()=>{Bi();Gt();b_();k_();Ve();bie=fu(e0(),1),E9e=h.object({baseUrl:h.string(),auth:h.literal("api-key"),apiKey:h.strictObject({source:h.literal("env"),provider:h.literal("clawdi-native"),id:h.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/)})}),R9e=h.strictObject({ok:h.literal(!1),error:h.strictObject({type:h.literal("cli_error"),message:h.literal("Config path is valid but unset: models. The runtime default applies until you set an authored value with openclaw config set models <value>.")})})});import{join as P9e}from"node:path";function Pie(e){let{placeholderEnv:t,configEnv:n,secretEnv:r}=Qa(e.manifest,e.runtime),i={...t,...n};for(let[o,s]of Object.entries(r)){let a=st(e.secretValues??{},s);if(!a)throw Error("Connection provider credential is unavailable");i[o]=a}return i}function Cie(e){if(e.runtime==="openclaw"){if(!e.observation.commandPath)throw Error("OpenClaw config command is unavailable");return tB(e.observation.commandPath,e.openClawContext,e.workspaceRoot,Pie(e)).providers}if(e.runtime!=="hermes"||!e.hermesConfig)throw Error("Connection runtime config is unavailable");let t=kn(e.hermesConfig,"providers");if(!t.exists)return{};let n=V(t.value);if(!n)throw Error("Hermes providers must be an object");return n}function $ie(e,t){return Zt(Object.fromEntries(t.sort().map((n)=>[n,e[n]??null])))}function xie(e,t){if(e.runtime!=="hermes"||t.length===0)return[];let n=Ld("hermes",e.home);if(!n)throw Error("Hermes application path is unavailable");let r=de(xc(e.home),["-c",C9e,n],e.home,e.workspaceRoot,{environmentOverrides:{HERMES_HOME:P9e(e.home,".hermes")},input:JSON.stringify(t.map(({id:o,baseUrl:s})=>({id:o,baseUrl:s}))),timeoutMs:30000,maxBufferBytes:65536}),i;try{i=r.status===0?JSON.parse(String(r.stdout)).conflicts:null}catch{i=null}if(!Array.isArray(i)||i.some((o)=>!t.some((s)=>s.id===o)))throw Error("Hermes custom provider credential conflict or unsupported public pool API");return i}function iB(e,t){let n=V(e);return n?.source==="env"&&(n.provider==="clawdi-connection"||n.provider==="default")&&n.id===t}function Rie(e){return Object.keys(V(e)??{}).some((t)=>["authorization","x-api-key","api-key","x-goog-api-key","cookie"].includes(t.toLowerCase()))}function Iie(e){return Zt({provider:e?.provider??null,nestedProvider:V(e?.default)?.provider??null,credentials:Object.fromEntries(["api_key","api","key_env","auth_mode"].map((t)=>[t,e?.[t]??null])),baseUrl:e?.base_url??null,apiMode:e?.api_mode??null})}function oB(e,t,n){for(let{id:r,envName:i,cloudIdentity:o,credentialAuthority:s}of sg(e,t)){let a=n[r];if(s==="native"){let c=e.runtimes[t];for(let u of[c?.run,...Object.values(c?.services??{})])if(u?.env?.[i]!==void 0||u?.secretEnv?.[i]!==void 0)throw Error("Runtime environment overrides native credential ownership")}if(s==="native"&&(!a?.handoffId||!o))throw Error("Native credentials require an acknowledged identity handoff");if(a&&a.envName!==i)throw Error("Connection credential environment is immutable");let l=!a?.cloudIdentity&&!a?.handoffId&&o!==void 0&&s!=="native";if(a&&!l&&!fi(a.cloudIdentity??null,o??null))throw Error("Provider Cloud identity requires explicit operator handoff")}}function $9e(e,t,n,r){let{id:i,baseUrl:o,apiMode:s,envName:a}=t,l=V(r[i]);if(t.cloudIdentity&&t.initialize&&!n&&l)throw new Vi("Existing native provider requires explicit operator handoff");let c=!l&&t.initialize&&(!n||n.pendingCreation===!0);if(!l&&!c)throw Error(`Connection provider ${i} must already exist`);if(r[i]!==void 0&&!l)throw Error("Custom provider config must be an object");if(c){let g=e.runtime==="openclaw"?Aie[s]:B0[s];if(!g)throw Error("Connection protocol is unsupported by this runtime");return{transfer:{envName:a,baseUrl:o,apiMode:s,cloudIdentity:t.cloudIdentity,pendingCreation:!0},patch:e.runtime==="openclaw"?{baseUrl:o,api:g,models:[],auth:"api-key",apiKey:{source:"env",provider:"clawdi-connection",id:a}}:{base_url:o,transport:g,key_env:a}}}if(!l)throw Error("Connection provider config is unavailable");if(t.initialize&&!n&&!(e.runtime==="openclaw"?iB(l.apiKey,a):l.key_env===a||l.api_key_env===a))throw new Vi("Custom provider ID is already owned by another connection");let u=e.runtime==="openclaw"?l.baseUrl:l.api??l.url??l.base_url,d=e.runtime==="openclaw"?l.api??"openai-completions":l.api_mode??l.transport,p=e.runtime==="openclaw"?Aie[s]:B0[s];if(!p)throw Error("Connection protocol is unsupported by this runtime");if(!n&&(u!==o||d!==p))throw new Vi(`Connection provider ${i} routing changed before handoff`);let m={};if(e.runtime==="openclaw"){if(!Array.isArray(l.models))throw Error("Custom OpenClaw provider must retain its models array");if(l.apiKey!==void 0&&!iB(l.apiKey,a))throw new Vi("OpenClaw connection credential ownership conflict");if(l.auth!==void 0&&l.auth!=="api-key")throw new Vi("OpenClaw connection auth mode conflict");if(l.authHeader===!1||Rie(l.headers)||l.models.some((g)=>Rie(V(g)?.headers)))throw new Vi("OpenClaw connection authentication header conflict");if(m.auth="api-key",m.apiKey={source:"env",provider:"clawdi-connection",id:a},n&&u!==o)m.baseUrl=o;if(n&&d!==p)m.api=p}else{if(l.api_key||l.key_cmd||l.key_env&&l.key_env!==a||l.api_key_env&&l.api_key_env!==a)throw new Vi("Hermes connection credential ownership conflict");if(m.key_env=a,n&&u!==o)m[Object.hasOwn(l,"api")?"api":Object.hasOwn(l,"url")?"url":"base_url"]=o;if(n&&d!==p)m[Object.hasOwn(l,"api_mode")?"api_mode":"transport"]=p}return{transfer:{...n,envName:a,baseUrl:o,apiMode:s,cloudIdentity:t.cloudIdentity},patch:m}}function x9e(e,t,n){if(["api_key","api","auth_mode"].some((s)=>Boolean(e?.[s]))||e?.key_env&&e.key_env!==t.envName)throw new Vi("Hermes model credentials conflict with the custom connection");let r=n?.api??n?.url??n?.base_url??t.baseUrl,i=n?.api_mode??n?.transport??B0[t.apiMode],o={};if(e?.base_url){if(typeof e.base_url!=="string"||typeof r!=="string"||e.base_url.replace(/\/+$/,"")!==r.replace(/\/+$/,""))throw new Vi("Hermes model endpoint conflicts with the custom connection");if(e.base_url.replace(/\/+$/,"")!==t.baseUrl.replace(/\/+$/,""))o.base_url=t.baseUrl}if(e?.api_mode){if(e.api_mode!==i)throw new Vi("Hermes model protocol conflicts with the custom connection");let s=B0[t.apiMode];if(s&&e.api_mode!==s)o.api_mode=s}return{source:Iie(e),patch:o}}function Oie(e){oB(e.manifest,e.runtime,e.ownership.providers);let t=sg(e.manifest,e.runtime);for(let u of t)if(u.credentialAuthority!=="native"&&!st(e.secretValues??{},u.secretRef))throw Error("Connection provider credential is unavailable");let n=Cie(e),r={...e.ownership.providers},i={},o={},s=(u,d)=>{o[u]=d,delete i[u];let p=e.ownership.providers[u];if(p)r[u]=p;else delete r[u]};for(let u of t)try{let d=$9e(e,u,r[u.id],n);r[u.id]=d.transfer,i[u.id]=d.patch}catch(d){if(!(d instanceof Vi))throw d;s(u.id,d.code)}let a=new Set(t.map((u)=>u.id));for(let[u,d]of Object.entries(r)){if(a.has(u))continue;let{pendingCreation:p,...m}=d;if(r[u]=m,d.handoffId)continue;let g=V(n[u]);if(!g)continue;if(e.runtime==="openclaw"&&iB(g.apiKey,d.envName))i[u]={apiKey:null,...g.auth==="api-key"?{auth:null}:{}};if(e.runtime==="hermes"){let f=Object.fromEntries(["key_env","api_key_env"].filter((y)=>g[y]===d.envName).map((y)=>[y,null]));if(Object.keys(f).length)i[u]=f}}let l,c=null;if(e.runtime==="hermes"&&e.hermesConfig){let u=V(kn(e.hermesConfig,"model").value),d=V(u?.default)?.provider??u?.provider,p=t.find(({id:m})=>!o[m]&&(d===m||d===`custom:${m}`));if(p)try{l=x9e(u,p,V(n[p.id])),c=p.id}catch(m){if(!(m instanceof Vi))throw m;s(p.id,m.code)}}for(let u of xie(e,t.filter((d)=>!o[d.id])))if(s(u,"native_credential_pool_conflict"),u===c)l=void 0;return{runtime:e.runtime,providers:r,sourceRevision:$ie(n,Object.keys(r)),patch:i,...l?{hermesModelRouting:l}:{},conflicts:o}}function Tie(e){let t=e.ownership.prepared;if(!t||t.runtime!==e.runtime||!fi(t.providers,e.ownership.providers))throw Error("Connection providers require a durably prepared ownership transfer");let n=Cie(e);if($ie(n,Object.keys(t.providers))!==t.sourceRevision)throw Error("Connection provider config changed after preflight");let r=sg(e.manifest,e.runtime).filter(({id:s})=>!t.conflicts[s]);if(xie(e,r).length>0)throw Error("Hermes custom provider credential pool changed after preflight");if(t.hermesModelRouting&&(!e.hermesConfig||Iie(V(kn(e.hermesConfig,"model").value))!==t.hermesModelRouting.source))throw Error("Hermes model routing changed after preflight");let i=Object.keys(t.hermesModelRouting?.patch??{}).length>0,o={};for(let[s,a]of Object.entries(t.patch)){let l=V(n[s])??{},c={...l};for(let[u,d]of Object.entries(a))if(d===null)delete c[u];else c[u]=d;if(fi(l,c))continue;i=!0,o[s]=a,n[s]=c}if(!i)return!1;if(e.runtime==="hermes"){if(!e.hermesConfig)throw Error("Hermes config command is unavailable");Ot(e.hermesConfig,"providers",n);for(let[s,a]of Object.entries(t.hermesModelRouting?.patch??{}))Ot(e.hermesConfig,`model.${s}`,a)}else{if(!e.observation.commandPath)throw Error("OpenClaw config command is unavailable");let s={models:{providers:o},...sg(e.manifest,e.runtime).length?{secrets:{providers:{"clawdi-connection":{source:"env"}}}}:{}};if(de(e.observation.commandPath,["config","patch","--stdin"],e.home,e.workspaceRoot,{input:JSON.stringify(s),environment:Pie(e),timeoutMs:30000}).status!==0)throw Error("OpenClaw connection configuration failed")}return!0}var Vi,Aie,B0,C9e=`
946
+ `,R9e;var rB=b(()=>{Bi();Gt();b_();k_();Ve();bie=fu(e0(),1),E9e=h.object({baseUrl:h.string(),auth:h.literal("api-key"),apiKey:h.strictObject({source:h.literal("env"),provider:h.literal("clawdi-native"),id:h.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/)})}),R9e=h.strictObject({ok:h.literal(!1),error:h.strictObject({type:h.literal("cli_error"),message:h.literal("Config path is valid but unset: models. The runtime default applies until you set an authored value with openclaw config set models <value>.")})})});import{join as P9e}from"node:path";function Pie(e){let{placeholderEnv:t,configEnv:n,secretEnv:r}=Qa(e.manifest,e.runtime),i={...t,...n};for(let[o,s]of Object.entries(r)){let a=st(e.secretValues??{},s);if(!a)throw Error("Connection provider credential is unavailable");i[o]=a}return i}function Cie(e){if(e.runtime==="openclaw"){if(!e.observation.commandPath)throw Error("OpenClaw config command is unavailable");return tB(e.observation.commandPath,e.openClawContext,e.workspaceRoot,Pie(e)).providers}if(e.runtime!=="hermes"||!e.hermesConfig)throw Error("Connection runtime config is unavailable");let t=kn(e.hermesConfig,"providers");if(!t.exists)return{};let n=V(t.value);if(!n)throw Error("Hermes providers must be an object");return n}function $ie(e,t){return Zt(Object.fromEntries(t.sort().map((n)=>[n,e[n]??null])))}function xie(e,t){if(e.runtime!=="hermes"||t.length===0)return[];let n=Ld("hermes",e.home);if(!n)throw Error("Hermes application path is unavailable");let r=de(xc(e.home),["-c",C9e,n],e.home,e.workspaceRoot,{environmentOverrides:{HERMES_HOME:P9e(e.home,".hermes")},input:JSON.stringify(t.map(({id:o,baseUrl:s})=>({id:o,baseUrl:s}))),timeoutMs:30000,maxBufferBytes:65536}),i;try{i=r.status===0?JSON.parse(String(r.stdout)).conflicts:null}catch{i=null}if(!Array.isArray(i)||i.some((o)=>!t.some((s)=>s.id===o)))throw Error("Hermes custom provider credential conflict or unsupported public pool API");return i}function iB(e,t){let n=V(e);return n?.source==="env"&&(n.provider==="clawdi-connection"||n.provider==="default")&&n.id===t}function Rie(e){return Object.keys(V(e)??{}).some((t)=>["authorization","x-api-key","api-key","x-goog-api-key","cookie"].includes(t.toLowerCase()))}function Iie(e){return Zt({provider:e?.provider??null,nestedProvider:V(e?.default)?.provider??null,credentials:Object.fromEntries(["api_key","api","key_env","auth_mode"].map((t)=>[t,e?.[t]??null])),baseUrl:e?.base_url??null,apiMode:e?.api_mode??null})}function oB(e,t,n){for(let{id:r,envName:i,cloudIdentity:o,credentialAuthority:s}of sg(e,t)){let a=n[r];if(s==="native"){let c=e.runtimes[t];for(let u of[c?.run,...Object.values(c?.services??{})])if(u?.env?.[i]!==void 0||u?.secretEnv?.[i]!==void 0)throw Error("Runtime environment overrides native credential ownership")}if(s==="native"&&(!a?.handoffId||!o))throw Error("Native credentials require an acknowledged identity handoff");if(a&&a.envName!==i)throw Error("Connection credential environment is immutable");let l=!a?.cloudIdentity&&!a?.handoffId&&o!==void 0&&s!=="native";if(a&&!l&&!fi(a.cloudIdentity??null,o??null))throw Error("Provider Cloud identity requires explicit operator handoff")}}function $9e(e,t,n,r){let{id:i,baseUrl:o,apiMode:s,envName:a}=t,l=V(r[i]);if(t.cloudIdentity&&t.initialize&&!n&&l)throw new Vi("Existing native provider requires explicit operator handoff");let c=n!==void 0&&!n.handoffId&&t.credentialAuthority!=="native",u=!l&&t.initialize&&(!n||n.pendingCreation===!0||c);if(!l&&!u)throw Error(`Connection provider ${i} must already exist`);if(r[i]!==void 0&&!l)throw Error("Custom provider config must be an object");if(u){let f=e.runtime==="openclaw"?Aie[s]:B0[s];if(!f)throw Error("Connection protocol is unsupported by this runtime");return{transfer:{envName:a,baseUrl:o,apiMode:s,cloudIdentity:t.cloudIdentity,pendingCreation:!0},patch:e.runtime==="openclaw"?{baseUrl:o,api:f,models:[],auth:"api-key",apiKey:{source:"env",provider:"clawdi-connection",id:a}}:{base_url:o,transport:f,key_env:a}}}if(!l)throw Error("Connection provider config is unavailable");if(t.initialize&&!n&&!(e.runtime==="openclaw"?iB(l.apiKey,a):l.key_env===a||l.api_key_env===a))throw new Vi("Custom provider ID is already owned by another connection");let d=e.runtime==="openclaw"?l.baseUrl:l.api??l.url??l.base_url,p=e.runtime==="openclaw"?l.api??"openai-completions":l.api_mode??l.transport,m=e.runtime==="openclaw"?Aie[s]:B0[s];if(!m)throw Error("Connection protocol is unsupported by this runtime");if(!n&&(d!==o||p!==m))throw new Vi(`Connection provider ${i} routing changed before handoff`);let g={};if(e.runtime==="openclaw"){if(!Array.isArray(l.models))throw Error("Custom OpenClaw provider must retain its models array");if(l.apiKey!==void 0&&!iB(l.apiKey,a))throw new Vi("OpenClaw connection credential ownership conflict");if(l.auth!==void 0&&l.auth!=="api-key")throw new Vi("OpenClaw connection auth mode conflict");if(l.authHeader===!1||Rie(l.headers)||l.models.some((f)=>Rie(V(f)?.headers)))throw new Vi("OpenClaw connection authentication header conflict");if(g.auth="api-key",g.apiKey={source:"env",provider:"clawdi-connection",id:a},n&&d!==o)g.baseUrl=o;if(n&&p!==m)g.api=m}else{if(l.api_key||l.key_cmd||l.key_env&&l.key_env!==a||l.api_key_env&&l.api_key_env!==a)throw new Vi("Hermes connection credential ownership conflict");if(g.key_env=a,n&&d!==o)g[Object.hasOwn(l,"api")?"api":Object.hasOwn(l,"url")?"url":"base_url"]=o;if(n&&p!==m)g[Object.hasOwn(l,"api_mode")?"api_mode":"transport"]=m}return{transfer:{...n,envName:a,baseUrl:o,apiMode:s,cloudIdentity:t.cloudIdentity},patch:g}}function x9e(e,t,n){if(["api_key","api","auth_mode"].some((s)=>Boolean(e?.[s]))||e?.key_env&&e.key_env!==t.envName)throw new Vi("Hermes model credentials conflict with the custom connection");let r=n?.api??n?.url??n?.base_url??t.baseUrl,i=n?.api_mode??n?.transport??B0[t.apiMode],o={};if(e?.base_url){if(typeof e.base_url!=="string"||typeof r!=="string"||e.base_url.replace(/\/+$/,"")!==r.replace(/\/+$/,""))throw new Vi("Hermes model endpoint conflicts with the custom connection");if(e.base_url.replace(/\/+$/,"")!==t.baseUrl.replace(/\/+$/,""))o.base_url=t.baseUrl}if(e?.api_mode){if(e.api_mode!==i)throw new Vi("Hermes model protocol conflicts with the custom connection");let s=B0[t.apiMode];if(s&&e.api_mode!==s)o.api_mode=s}return{source:Iie(e),patch:o}}function Oie(e){oB(e.manifest,e.runtime,e.ownership.providers);let t=sg(e.manifest,e.runtime);for(let u of t)if(u.credentialAuthority!=="native"&&!st(e.secretValues??{},u.secretRef))throw Error("Connection provider credential is unavailable");let n=Cie(e),r={...e.ownership.providers},i={},o={},s=(u,d)=>{o[u]=d,delete i[u];let p=e.ownership.providers[u];if(p)r[u]=p;else delete r[u]};for(let u of t)try{let d=$9e(e,u,r[u.id],n);r[u.id]=d.transfer,i[u.id]=d.patch}catch(d){if(!(d instanceof Vi))throw d;s(u.id,d.code)}let a=new Set(t.map((u)=>u.id));for(let[u,d]of Object.entries(r)){if(a.has(u))continue;let{pendingCreation:p,...m}=d;if(r[u]=m,d.handoffId)continue;let g=V(n[u]);if(!g)continue;if(e.runtime==="openclaw"&&iB(g.apiKey,d.envName))i[u]={apiKey:null,...g.auth==="api-key"?{auth:null}:{}};if(e.runtime==="hermes"){let f=Object.fromEntries(["key_env","api_key_env"].filter((y)=>g[y]===d.envName).map((y)=>[y,null]));if(Object.keys(f).length)i[u]=f}}let l,c=null;if(e.runtime==="hermes"&&e.hermesConfig){let u=V(kn(e.hermesConfig,"model").value),d=V(u?.default)?.provider??u?.provider,p=t.find(({id:m})=>!o[m]&&(d===m||d===`custom:${m}`));if(p)try{l=x9e(u,p,V(n[p.id])),c=p.id}catch(m){if(!(m instanceof Vi))throw m;s(p.id,m.code)}}for(let u of xie(e,t.filter((d)=>!o[d.id])))if(s(u,"native_credential_pool_conflict"),u===c)l=void 0;return{runtime:e.runtime,providers:r,sourceRevision:$ie(n,Object.keys(r)),patch:i,...l?{hermesModelRouting:l}:{},conflicts:o}}function Tie(e){let t=e.ownership.prepared;if(!t||t.runtime!==e.runtime||!fi(t.providers,e.ownership.providers))throw Error("Connection providers require a durably prepared ownership transfer");let n=Cie(e);if($ie(n,Object.keys(t.providers))!==t.sourceRevision)throw Error("Connection provider config changed after preflight");let r=sg(e.manifest,e.runtime).filter(({id:s})=>!t.conflicts[s]);if(xie(e,r).length>0)throw Error("Hermes custom provider credential pool changed after preflight");if(t.hermesModelRouting&&(!e.hermesConfig||Iie(V(kn(e.hermesConfig,"model").value))!==t.hermesModelRouting.source))throw Error("Hermes model routing changed after preflight");let i=Object.keys(t.hermesModelRouting?.patch??{}).length>0,o={};for(let[s,a]of Object.entries(t.patch)){let l=V(n[s])??{},c={...l};for(let[u,d]of Object.entries(a))if(d===null)delete c[u];else c[u]=d;if(fi(l,c))continue;i=!0,o[s]=a,n[s]=c}if(!i)return!1;if(e.runtime==="hermes"){if(!e.hermesConfig)throw Error("Hermes config command is unavailable");Ot(e.hermesConfig,"providers",n);for(let[s,a]of Object.entries(t.hermesModelRouting?.patch??{}))Ot(e.hermesConfig,`model.${s}`,a)}else{if(!e.observation.commandPath)throw Error("OpenClaw config command is unavailable");let s={models:{providers:o},...sg(e.manifest,e.runtime).length?{secrets:{providers:{"clawdi-connection":{source:"env"}}}}:{}};if(de(e.observation.commandPath,["config","patch","--stdin"],e.home,e.workspaceRoot,{input:JSON.stringify(s),environment:Pie(e),timeoutMs:30000}).status!==0)throw Error("OpenClaw connection configuration failed")}return!0}var Vi,Aie,B0,C9e=`
947
947
  import contextlib, io, json, sys
948
948
  sys.path.insert(0, sys.argv[1])
949
949
  with contextlib.redirect_stdout(io.StringIO()), contextlib.redirect_stderr(io.StringIO()):
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clawdi",
3
- "version": "0.14.93",
3
+ "version": "0.14.94",
4
4
  "description": "The best home for all your AI agents. Run them in the cloud or connect your own—with their context and tools in one place.",
5
5
  "license": "MIT",
6
6
  "type": "module",