shennian 0.4.2 → 0.4.3
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.
|
@@ -9,5 +9,5 @@ export type DetectedAgent = {
|
|
|
9
9
|
executableFingerprint?: string;
|
|
10
10
|
models?: ModelInfo[];
|
|
11
11
|
};
|
|
12
|
-
export declare function isPiCodingAgentRuntimeCompatible(piVersion: string | undefined
|
|
12
|
+
export declare function isPiCodingAgentRuntimeCompatible(piVersion: string | undefined): boolean;
|
|
13
13
|
export declare function detectAgents(): DetectedAgent[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{AVAILABLE_BUILTIN_AGENT_TYPES as
|
|
1
|
+
import{AVAILABLE_BUILTIN_AGENT_TYPES as i}from"@shennian/wire";import{loadConfig as m}from"../config/index.js";import{getBuiltinAgentVersion as c,resolveBuiltinCommand as l}from"./command-spec.js";import{registerCustomRuntimeSecurity as u,resolveCustomRuntimeExecutableFingerprint as a}from"./custom-managed-runtime.js";import{resolveManagedAgentExecutableIdentity as f}from"../security/managed-agent-executable.js";const d=i.filter(t=>t!=="pi");function p(t,r){const o=t?.match(/(?:^|v)(\d+)\.(\d+)\.(\d+)/);if(!o)return!1;const e=o.slice(1,4).map(Number);for(let n=0;n<r.length;n+=1)if(e[n]!==r[n])return e[n]>r[n];return!0}function g(t){return p(t,[0,85,0])}function A(t){const r=t.models?.length?t.models:t.model?[t.model]:[],o=t.defaultModel??t.model;return r.map(e=>({id:e,name:e,isDefault:e===o}))}function y(){const t=[];for(const o of d){const e=l(o);if(!e)continue;const n=c(o,e);if(o==="pi-coding-agent"&&!g(n))continue;const s=f(e);t.push({type:o,command:e.command,args:e.args,version:n,runtimePlatform:s.platform,runtimeIsWsl:s.isWsl,executableFingerprint:s.executableFingerprint})}const r=m();for(const[o,e]of Object.entries(r.customAgents??{})){const n=`custom:${o}`;u(n,e),t.push({type:n,command:e.command,args:[],version:e.caps.version,runtimePlatform:process.platform,runtimeIsWsl:process.platform==="linux"&&!!(process.env.WSL_DISTRO_NAME||process.env.WSL_INTEROP),executableFingerprint:a(e),models:A(e.caps)})}return t}export{y as detectAgents,g as isPiCodingAgentRuntimeCompatible};
|