@agenthippo-ai/agenthippo 1.110.41 → 1.110.43

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.
@@ -1,3 +1,3 @@
1
1
  /*! Copyright (c) 2026 AgentHippo.ai. All rights reserved. Proprietary; see LICENSE. */
2
- "use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(e,r,n,t){t===void 0&&(t=n);var s=Object.getOwnPropertyDescriptor(r,n);(!s||("get"in s?!r.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return r[n]}}),Object.defineProperty(e,t,s)}):(function(e,r,n,t){t===void 0&&(t=n),e[t]=r[n]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}):function(e,r){e.default=r}),__importStar=this&&this.__importStar||(function(){var e=function(r){return e=Object.getOwnPropertyNames||function(n){var t=[];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[t.length]=s);return t},e(r)};return function(r){if(r&&r.__esModule)return r;var n={};if(r!=null)for(var t=e(r),s=0;s<t.length;s++)t[s]!=="default"&&__createBinding(n,r,t[s]);return __setModuleDefault(n,r),n}})();Object.defineProperty(exports,"__esModule",{value:!0}),exports.runCustomEngineRunnerMain=runCustomEngineRunnerMain;const node_readline_1=require("node:readline"),node_url_1=require("node:url"),path=__importStar(require("node:path")),AGENTHIPPO_MCP_SERVERS_ENV="AGENTHIPPO_MCP_SERVERS";function parseInlineMcpServers(e){if(e?.trim())try{const r=JSON.parse(e);return!r||typeof r!="object"||Array.isArray(r)?void 0:r}catch{return}}function emitEvent(e){process.stdout.write(`${JSON.stringify(e)}
3
- `)}const runtime={logger:{info:()=>{},warn:()=>{},error:()=>{}}};function applyEngineDir(e){const r=path.dirname(e);process.chdir(r);const n=path.join(r,"node_modules"),t=process.env.NODE_PATH?.trim();process.env.NODE_PATH=t?`${n}${path.delimiter}${t}`:n}async function loadEngine(e,r){const n=await import((0,node_url_1.pathToFileURL)(e).href),t=(r?n[r]??n.default?.[r]:void 0)??n.default,s=typeof t=="function"?t:null,c=s?new s:t;if(!c||typeof c.run!="function")throw new Error("Engine export must provide run(turn)");return c}function buildTurn(e,r,n){const t=e.AGENTHIPPO_ENGINE_ENTRY?.trim()??"",s=path.dirname(t),c=e.AGENTHIPPO_MESSAGE??"",i=e.AGENTHIPPO_WORKSPACE_ROOT??process.cwd(),u=e.AGENTHIPPO_MODEL_ID??"auto",a=e.AGENTHIPPO_CONVERSATION_KEY?.trim()||e.AGENTIDE_CHAT_SESSION_ID?.trim()||e.AGENTHIPPO_CHAT_SESSION_ID?.trim()||"runner",o=e.AGENTIDE_CHAT_SESSION_ID?.trim()||e.AGENTHIPPO_CHAT_SESSION_ID?.trim()||a,E=e.AGENTHIPPO_CONTEXT_SESSION_ID?.trim()||o,_=parseInlineMcpServers(e[AGENTHIPPO_MCP_SERVERS_ENV]);return{message:c,modelId:u,workspaceRoot:i,additionalDirectories:[],permissions:{fileAccess:"full"},env:{...e},routing:{useLiteLLM:e.AGENTHIPPO_USE_LITELLM==="true",...e.AGENTHIPPO_API_KEY?{apiKey:e.AGENTHIPPO_API_KEY}:{},...e.AGENTHIPPO_BASE_URL?{baseUrl:e.AGENTHIPPO_BASE_URL}:{},...e.AGENTHIPPO_OPENAI_BASE_URL?{openaiBaseUrl:e.AGENTHIPPO_OPENAI_BASE_URL}:{}},session:{key:a,chatSessionId:o,contextSessionId:E,isEphemeral:e.AGENTHIPPO_IS_EPHEMERAL==="true",engineHomeDir:e.AGENTHIPPO_ENGINE_HOME?.trim()||s,engineSessionDir:e.AGENTHIPPO_ENGINE_SESSION_DIR?.trim()||s,nativeSessionId:e.AGENTHIPPO_NATIVE_SESSION_ID?.trim()||void 0,contextFilePath:e.AGENTHIPPO_CONTEXT_EXPORT_PATH?.trim()||void 0,terminalLogPath:e.AGENTHIPPO_TERMINAL_LOG_PATH?.trim()||void 0,attachmentsDir:e.AGENTHIPPO_ATTACHMENTS_DIR?.trim()||void 0},agent:{id:e.AGENTHIPPO_ACTIVE_AGENT??"default"},..._?{mcpServers:_}:{},emitter:r,runtime,signal:n}}async function runOnce(){const e=process.env.AGENTHIPPO_ENGINE_ENTRY?.trim();if(!e)return emitEvent({type:"error",message:"AGENTHIPPO_ENGINE_ENTRY is required"}),1;applyEngineDir(e);let r=!1;const n={async text(t){emitEvent({type:"text",delta:t})},async thinking(t){emitEvent({type:"thinking",delta:t})},async toolStart(t,s,c){emitEvent({type:"toolStart",toolName:t,input:s,toolCallId:c})},async toolEnd(t,s,c,i){emitEvent({type:"toolEnd",toolName:t,toolCallId:s,result:c,isError:i})},async progress(t){emitEvent({type:"progress",message:t})},async error(t){emitEvent({type:"error",message:t})},async done(){r||(r=!0,emitEvent({type:"done"}))},async question(){return{selected:[],freeText:null,declined:!0}}};try{const t=await loadEngine(e,process.env.AGENTHIPPO_ENGINE_EXPORT?.trim());if(process.env.AGENTHIPPO_CUSTOM_ENGINE_PROBE==="import")return emitEvent({type:"probe",ok:!0}),0;const s=buildTurn(process.env,n),c=await t.run(s);return c?.nativeSessionId&&emitEvent({type:"nativeSessionId",nativeSessionId:c.nativeSessionId}),await n.done(),0}catch(t){const s=t instanceof Error?t.message:String(t);return emitEvent({type:"error",message:s}),1}}async function runPersistent(){const e=process.env.AGENTHIPPO_ENGINE_ENTRY?.trim();e||(emitEvent({type:"error",message:"AGENTHIPPO_ENGINE_ENTRY is required"}),process.exit(1)),applyEngineDir(e);let r;try{r=await loadEngine(e,process.env.AGENTHIPPO_ENGINE_EXPORT?.trim())}catch(i){emitEvent({type:"error",message:i instanceof Error?i.message:String(i)}),process.exit(1)}const n=new Map,t=i=>{const u=o=>emitEvent({id:i,event:o});let a=!1;return{async text(o){u({type:"text",delta:o})},async thinking(o){u({type:"thinking",delta:o})},async toolStart(o,E,_){u({type:"toolStart",toolName:o,input:E,toolCallId:_})},async toolEnd(o,E,_,d){u({type:"toolEnd",toolName:o,toolCallId:E,result:_,isError:d})},async progress(o){u({type:"progress",message:o})},async error(o){u({type:"error",message:o})},async done(){a||(a=!0,u({type:"done"}))},async question(){return{selected:[],freeText:null,declined:!0}}}},s=async(i,u)=>{const a=new AbortController;n.set(i,a);const o=t(i);try{const E=buildTurn(u,o,a.signal),_=await r.run(E);await o.done(),emitEvent({type:"result",id:i,nativeSessionId:_?.nativeSessionId})}catch(E){const _=E instanceof Error?E.message:String(E);emitEvent({id:i,event:{type:"error",message:_}}),emitEvent({type:"failed",id:i,message:_})}finally{n.delete(i)}},c=(0,node_readline_1.createInterface)({input:process.stdin});c.on("line",i=>{const u=i.trim();if(!u)return;let a;try{a=JSON.parse(u)}catch{return}a.type==="run"&&typeof a.id=="string"?s(a.id,a.env??{}):a.type==="abort"&&typeof a.id=="string"?n.get(a.id)?.abort():a.type==="shutdown"&&c.close()}),c.on("close",()=>{for(const i of n.values())i.abort();process.exit(0)}),emitEvent({type:"ready"})}async function runCustomEngineRunnerMain(){return runOnce()}process.env.AGENTHIPPO_RUNNER_MODE==="persistent"?runPersistent():runCustomEngineRunnerMain().then(e=>{process.exit(e)},e=>{emitEvent({type:"error",message:e instanceof Error?e.message:String(e)}),process.exit(1)});
2
+ "use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var s=Object.getOwnPropertyDescriptor(t,n);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,s)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),__importStar=this&&this.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(n){var r=[];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(r[r.length]=s);return r},e(t)};return function(t){if(t&&t.__esModule)return t;var n={};if(t!=null)for(var r=e(t),s=0;s<r.length;s++)r[s]!=="default"&&__createBinding(n,t,r[s]);return __setModuleDefault(n,t),n}})();Object.defineProperty(exports,"__esModule",{value:!0}),exports.runCustomEngineRunnerMain=runCustomEngineRunnerMain;const node_readline_1=require("node:readline"),node_url_1=require("node:url"),path=__importStar(require("node:path")),AGENTHIPPO_MCP_SERVERS_ENV="AGENTHIPPO_MCP_SERVERS";function parseInlineMcpServers(e){if(e?.trim())try{const t=JSON.parse(e);return!t||typeof t!="object"||Array.isArray(t)?void 0:t}catch{return}}function parsePermissions(e){try{const t=e?JSON.parse(e):void 0;if(t&&typeof t=="object"&&!Array.isArray(t))return t}catch{}return{fileAccess:"full"}}function emitEvent(e){process.stdout.write(`${JSON.stringify(e)}
3
+ `)}const runtime={logger:{info:()=>{},warn:()=>{},error:()=>{},debug:()=>{}}};function applyEngineDir(e){const t=path.dirname(e);process.chdir(t);const n=path.join(t,"node_modules"),r=process.env.NODE_PATH?.trim();process.env.NODE_PATH=r?`${n}${path.delimiter}${r}`:n}async function loadEngine(e,t){const n=await import((0,node_url_1.pathToFileURL)(e).href),r=(t?n[t]??n.default?.[t]:void 0)??n.default,s=typeof r=="function"?r:null,c=s?new s:r;if(!c||typeof c.run!="function")throw new Error("Engine export must provide run(turn)");return c}function buildTurn(e,t,n){const r=e.AGENTHIPPO_ENGINE_ENTRY?.trim()??"",s=path.dirname(r),c=e.AGENTHIPPO_MESSAGE??"",i=e.AGENTHIPPO_WORKSPACE_ROOT??process.cwd(),E=e.AGENTHIPPO_MODEL_ID??"auto",a=e.AGENTHIPPO_CONVERSATION_KEY?.trim()||e.AGENTIDE_CHAT_SESSION_ID?.trim()||e.AGENTHIPPO_CHAT_SESSION_ID?.trim()||"runner",o=e.AGENTIDE_CHAT_SESSION_ID?.trim()||e.AGENTHIPPO_CHAT_SESSION_ID?.trim()||a,u=e.AGENTHIPPO_CONTEXT_SESSION_ID?.trim()||o,_=parseInlineMcpServers(e[AGENTHIPPO_MCP_SERVERS_ENV]);return{message:c,modelId:E,workspaceRoot:i,additionalDirectories:[],permissions:parsePermissions(e.AGENTHIPPO_PERMISSIONS),env:{...e},routing:{useLiteLLM:e.AGENTHIPPO_USE_LITELLM==="true",...e.AGENTHIPPO_API_KEY?{apiKey:e.AGENTHIPPO_API_KEY}:{},...e.AGENTHIPPO_BASE_URL?{baseUrl:e.AGENTHIPPO_BASE_URL}:{},...e.AGENTHIPPO_OPENAI_BASE_URL?{openaiBaseUrl:e.AGENTHIPPO_OPENAI_BASE_URL}:{}},session:{key:a,chatSessionId:o,contextSessionId:u,isEphemeral:e.AGENTHIPPO_IS_EPHEMERAL==="true",engineHomeDir:e.AGENTHIPPO_ENGINE_HOME?.trim()||s,engineSessionDir:e.AGENTHIPPO_ENGINE_SESSION_DIR?.trim()||s,nativeSessionId:e.AGENTHIPPO_NATIVE_SESSION_ID?.trim()||void 0,contextFilePath:e.AGENTHIPPO_CONTEXT_EXPORT_PATH?.trim()||void 0,terminalLogPath:e.AGENTHIPPO_TERMINAL_LOG_PATH?.trim()||void 0,attachmentsDir:e.AGENTHIPPO_ATTACHMENTS_DIR?.trim()||void 0},agent:{id:e.AGENTHIPPO_ACTIVE_AGENT??"default",...e.AGENTHIPPO_RULES_FILE_PATH?{rulesFilePath:e.AGENTHIPPO_RULES_FILE_PATH}:{},...e.AGENTHIPPO_SKILLS_DIR?{skillsDir:e.AGENTHIPPO_SKILLS_DIR}:{},...e.AGENTHIPPO_RULES_DIR?{rulesDir:e.AGENTHIPPO_RULES_DIR}:{}},..._?{mcpServers:_}:{},emitter:t,runtime,signal:n}}async function runOnce(){const e=process.env.AGENTHIPPO_ENGINE_ENTRY?.trim();if(!e)return emitEvent({type:"error",message:"AGENTHIPPO_ENGINE_ENTRY is required"}),1;applyEngineDir(e);let t=!1;const n={async text(r){emitEvent({type:"text",delta:r})},async thinking(r){emitEvent({type:"thinking",delta:r})},async toolStart(r,s,c){emitEvent({type:"toolStart",toolName:r,input:s,toolCallId:c})},async toolEnd(r,s,c,i){emitEvent({type:"toolEnd",toolName:r,toolCallId:s,result:c,isError:i})},async progress(r){emitEvent({type:"progress",message:r})},async error(r){emitEvent({type:"error",message:r})},async done(){t||(t=!0,emitEvent({type:"done"}))},async question(){return{selected:[],freeText:null,declined:!0}}};try{const r=await loadEngine(e,process.env.AGENTHIPPO_ENGINE_EXPORT?.trim());if(process.env.AGENTHIPPO_CUSTOM_ENGINE_PROBE==="import")return emitEvent({type:"probe",ok:!0}),0;const s=buildTurn(process.env,n),c=await r.run(s);return c?.nativeSessionId&&emitEvent({type:"nativeSessionId",nativeSessionId:c.nativeSessionId}),await n.done(),0}catch(r){const s=r instanceof Error?r.message:String(r);return emitEvent({type:"error",message:s}),1}}async function runPersistent(){const e=process.env.AGENTHIPPO_ENGINE_ENTRY?.trim();e||(emitEvent({type:"error",message:"AGENTHIPPO_ENGINE_ENTRY is required"}),process.exit(1)),applyEngineDir(e);let t;try{t=await loadEngine(e,process.env.AGENTHIPPO_ENGINE_EXPORT?.trim())}catch(i){emitEvent({type:"error",message:i instanceof Error?i.message:String(i)}),process.exit(1)}const n=new Map,r=i=>{const E=o=>emitEvent({id:i,event:o});let a=!1;return{async text(o){E({type:"text",delta:o})},async thinking(o){E({type:"thinking",delta:o})},async toolStart(o,u,_){E({type:"toolStart",toolName:o,input:u,toolCallId:_})},async toolEnd(o,u,_,P){E({type:"toolEnd",toolName:o,toolCallId:u,result:_,isError:P})},async progress(o){E({type:"progress",message:o})},async error(o){E({type:"error",message:o})},async done(){a||(a=!0,E({type:"done"}))},async question(){return{selected:[],freeText:null,declined:!0}}}},s=async(i,E)=>{const a=new AbortController;n.set(i,a);const o=r(i);try{const u=buildTurn(E,o,a.signal),_=await t.run(u);await o.done(),emitEvent({type:"result",id:i,nativeSessionId:_?.nativeSessionId})}catch(u){const _=u instanceof Error?u.message:String(u);emitEvent({id:i,event:{type:"error",message:_}}),emitEvent({type:"failed",id:i,message:_})}finally{n.delete(i)}},c=(0,node_readline_1.createInterface)({input:process.stdin});c.on("line",i=>{const E=i.trim();if(!E)return;let a;try{a=JSON.parse(E)}catch{return}a.type==="run"&&typeof a.id=="string"?s(a.id,a.env??{}):a.type==="abort"&&typeof a.id=="string"?n.get(a.id)?.abort():a.type==="shutdown"&&c.close()}),c.on("close",()=>{for(const i of n.values())i.abort();process.exit(0)}),emitEvent({type:"ready"})}async function runCustomEngineRunnerMain(){return runOnce()}process.env.AGENTHIPPO_RUNNER_MODE==="persistent"?runPersistent():runCustomEngineRunnerMain().then(e=>{process.exit(e)},e=>{emitEvent({type:"error",message:e instanceof Error?e.message:String(e)}),process.exit(1)});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agenthippo-ai/agenthippo",
3
- "version": "1.110.41",
3
+ "version": "1.110.43",
4
4
  "description": "AgentHippo CLI — serve, chat, and deploy agent packs",
5
5
  "author": "AgentHippo <dev@agenthippo.ai>",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -38,7 +38,7 @@
38
38
  "zod": "^4.3.6"
39
39
  },
40
40
  "agenthippo": {
41
- "litellmImageTag": "0.2.23",
41
+ "litellmImageTag": "0.2.24",
42
42
  "hippoclawNpm": "@agenthippo-ai/hippoclaw@2026.7.28"
43
43
  }
44
44
  }