@picoflow/ezgraph 0.0.19 → 0.0.20

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.
@@ -0,0 +1 @@
1
+ var l=Object.defineProperty;var s=(i,e)=>l(i,"name",{value:e,configurable:!0});import{fileURLToPath as p}from"url";import{readFileSync as h}from"fs";import n from"path";class d{static{s(this,"Prompt")}static cache=new Map;static file(e){const a=this.getCallerDir(),r=n.resolve(a,e);if(this.cache.has(r))return this.cache.get(r);const t=h(r,"utf-8");return this.cache.set(r,t),t}static getCallerDir(){const e=Error.prepareStackTrace;Error.prepareStackTrace=(c,o)=>o;const r=new Error().stack;Error.prepareStackTrace=e;const t=r?.[2]?.getFileName();if(!t)throw new Error("Unable to determine caller file path");return n.dirname(t.startsWith("file:")?p(t):t)}static set(e,a,r){return e.replace(`{{${a}}}`,r)}static replace(e,a){return e.replace(/{{(.*?)}}/g,(r,t)=>a[t]||r)}static replace2(e,a){return e.replace(/{{(.*?)}}/g,(r,t)=>{const c=a[t.trim()];return c===void 0?r:typeof c=="string"?c:JSON.stringify(c)})}}export{d as Prompt};
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{GraphContextChannel as r}from"./framework/graph-context.js";import{RunNodeBatchError as s}from"./framework/run-node.js";import{BaseGraph as i}from"./framework/base-graph.js";import{GRAPH_NODE_CLASS as m,GraphNode as p,GraphNodeRuntime as S,Tool as E}from"./framework/graph-node.js";import{LlmNode as x}from"./framework/llm-node.js";import{LLM_GATEWAY_FACTORY as d,assertLlmTimeoutMs as l}from"./framework/llm-gateway.js";import{LlmRunner as D,DEFAULT_LLM_POLICY as R,DEFAULT_EMPTY_HISTORY_SEED as T,DEFAULT_EMPTY_RESPONSE_RECOVERY as _,DEFAULT_MAX_AGENT_ROUNDS as c,EmptyModelResponseError as u,assertEmptyResponseRetries as C,assertMaxAgentRounds as M}from"./framework/llm-runner.js";import{describeStopReason as N,isRetryableStopReason as O,modelStopReason as I}from"./framework/model-stop-reason.js";import{currentTurnContext as G,currentTurnSignal as P,withTurnContext as U}from"./framework/turn-context.js";import{direct as v,directTo as F,finish as Y,fanout as k,go as B,isToolResponse as H,stay as b,taskResult as V}from"./framework/tool-response.js";import{GraphStateSupport as w}from"./framework/graph-state-support.js";import{GRAPH_END_NODE as q,createGraphStateAnnotation as J}from"./framework/graph-state.js";import{GraphRegistry as X}from"./framework/graph-registry.js";import{GraphEngine as K}from"./framework/graph-engine.js";import{ConfigManager as $}from"./framework/config-manager.js";import{StateGraphExt as oe}from"./framework/state-graph-ext.js";import{TerminateSessionNode as te}from"./framework/terminate-session.node.js";import{SessionLogError as ne,SessionLogDecision as ie,SessionLogWarning as ae,createSessionLogs as me,drainSessionLogs as pe,restoreSessionLogs as Se,withSessionLogs as Ee}from"./framework/session-log.js";import{ProviderFileManager as xe}from"./framework/llm-file.js";import{SessionManager as de,SessionTurnError as le,SESSION_BUSY as ge,SESSION_CONFLICT as De,SESSION_COMPLETED as Re,SESSION_DOCUMENT_VERSION as Te,MemorySessionDocumentContainer as _e,sessionTurnLeaseMs as ce,sessionRevision as ue,isLiveSessionTurn as Ce,matchesSessionWritePredicate as Me}from"./framework/persistence/session-manager.js";import{MongoDbSessionDocumentContainer as Ne}from"./framework/persistence/mongodb-session-document.container.js";import{SqliteSessionDocumentContainer as Ie}from"./framework/persistence/sqlite-session-document.container.js";import{CosmosSessionDocumentContainer as Ge}from"./framework/persistence/cosmos-session-document.container.js";import{mergeNodeStates as Ue,replaceNodeStates as ye}from"./framework/node-state.js";import{LangChainLlmGateway as Fe}from"./framework/langchain-llm-gateway.js";import{ModelProvider as ke}from"./framework/model-provider.js";import{langChainModelInitialization as He}from"./framework/langchain-provider.adapter.js";import{GRAPH_LLM_PROVIDERS as Ve,GRAPH_LLM_FAMILIES as We,GRAPH_LLM_CAPABILITIES as we,BUILT_IN_MODEL_CATALOG as ze,GraphLlm as qe,ModelCatalog as Je,ModelProviderRegistry as Qe}from"./framework/graph-llm.config.js";import{addTokenUsage as je,emptyTokenUsage as Ke,modelExecution as Ze,normalizeTokenUsage as $e,tokenUsageFromMessage as eo}from"./framework/token-usage.js";import{DecisionNode as ro}from"./framework/decision/decision-node.js";import{DecisionRunner as so}from"./framework/decision/decision-runner.js";import{DecisionProvider as io,DecisionProviderRegistry as ao}from"./framework/decision/decision-provider.js";import{TypeSafeClassifierAdapter as po}from"./framework/decision/typesafe-provider.js";import{DecisionConfigurationError as Eo,DecisionTimeoutError as fo,DecisionValidationError as xo,DEFAULT_DECISION_OPTIONS as Lo,addDecisionUsage as lo,decisionUsage as go,emptyDecisionUsage as Do,normalizeDecisionUsage as Ro,resolveDecisionOptions as To}from"./framework/decision/decision-types.js";import{assertJsonCompatible as co,validateDecisionQuestions as uo,validateDecisionResult as Co}from"./framework/decision/decision-validation.js";import{retryWithModel as Ao,LlmResponseBlockedError as No,LlmSetupError as Oo}from"./framework/llm-lifecycle.js";export{ze as BUILT_IN_MODEL_CATALOG,i as BaseGraph,$ as ConfigManager,Ge as CosmosSessionDocumentContainer,Lo as DEFAULT_DECISION_OPTIONS,T as DEFAULT_EMPTY_HISTORY_SEED,_ as DEFAULT_EMPTY_RESPONSE_RECOVERY,R as DEFAULT_LLM_POLICY,c as DEFAULT_MAX_AGENT_ROUNDS,Eo as DecisionConfigurationError,ro as DecisionNode,io as DecisionProvider,ao as DecisionProviderRegistry,so as DecisionRunner,fo as DecisionTimeoutError,xo as DecisionValidationError,u as EmptyModelResponseError,q as GRAPH_END_NODE,we as GRAPH_LLM_CAPABILITIES,We as GRAPH_LLM_FAMILIES,Ve as GRAPH_LLM_PROVIDERS,m as GRAPH_NODE_CLASS,r as GraphContextChannel,K as GraphEngine,qe as GraphLlm,p as GraphNode,S as GraphNodeRuntime,X as GraphRegistry,w as GraphStateSupport,d as LLM_GATEWAY_FACTORY,Fe as LangChainLlmGateway,x as LlmNode,No as LlmResponseBlockedError,D as LlmRunner,Oo as LlmSetupError,_e as MemorySessionDocumentContainer,Je as ModelCatalog,ke as ModelProvider,Qe as ModelProviderRegistry,Ne as MongoDbSessionDocumentContainer,xe as ProviderFileManager,s as RunNodeBatchError,ge as SESSION_BUSY,Re as SESSION_COMPLETED,De as SESSION_CONFLICT,Te as SESSION_DOCUMENT_VERSION,ie as SessionLogDecision,ne as SessionLogError,ae as SessionLogWarning,de as SessionManager,le as SessionTurnError,Ie as SqliteSessionDocumentContainer,oe as StateGraphExt,te as TerminateSessionNode,E as Tool,po as TypeSafeClassifierAdapter,lo as addDecisionUsage,je as addTokenUsage,C as assertEmptyResponseRetries,co as assertJsonCompatible,l as assertLlmTimeoutMs,M as assertMaxAgentRounds,J as createGraphStateAnnotation,me as createSessionLogs,G as currentTurnContext,P as currentTurnSignal,go as decisionUsage,N as describeStopReason,v as direct,F as directTo,pe as drainSessionLogs,Do as emptyDecisionUsage,Ke as emptyTokenUsage,k as fanout,Y as finish,B as go,Ce as isLiveSessionTurn,O as isRetryableStopReason,H as isToolResponse,He as langChainModelInitialization,Me as matchesSessionWritePredicate,Ue as mergeNodeStates,Ze as modelExecution,I as modelStopReason,Ro as normalizeDecisionUsage,$e as normalizeTokenUsage,ye as replaceNodeStates,To as resolveDecisionOptions,Se as restoreSessionLogs,Ao as retryWithModel,ue as sessionRevision,ce as sessionTurnLeaseMs,b as stay,V as taskResult,eo as tokenUsageFromMessage,uo as validateDecisionQuestions,Co as validateDecisionResult,Ee as withSessionLogs,U as withTurnContext};
1
+ import{Prompt as r}from"./framework/prompt.js";import{GraphContextChannel as s}from"./framework/graph-context.js";import{RunNodeBatchError as i}from"./framework/run-node.js";import{BaseGraph as m}from"./framework/base-graph.js";import{GRAPH_NODE_CLASS as S,GraphNode as E,GraphNodeRuntime as f,Tool as x}from"./framework/graph-node.js";import{LlmNode as d}from"./framework/llm-node.js";import{LLM_GATEWAY_FACTORY as g,assertLlmTimeoutMs as D}from"./framework/llm-gateway.js";import{LlmRunner as T,DEFAULT_LLM_POLICY as _,DEFAULT_EMPTY_HISTORY_SEED as c,DEFAULT_EMPTY_RESPONSE_RECOVERY as u,DEFAULT_MAX_AGENT_ROUNDS as C,EmptyModelResponseError as M,assertEmptyResponseRetries as A,assertMaxAgentRounds as N}from"./framework/llm-runner.js";import{describeStopReason as I,isRetryableStopReason as P,modelStopReason as h}from"./framework/model-stop-reason.js";import{currentTurnContext as U,currentTurnSignal as y,withTurnContext as v}from"./framework/turn-context.js";import{direct as Y,directTo as k,finish as B,fanout as H,go as b,isToolResponse as V,stay as W,taskResult as w}from"./framework/tool-response.js";import{GraphStateSupport as q}from"./framework/graph-state-support.js";import{GRAPH_END_NODE as Q,createGraphStateAnnotation as X}from"./framework/graph-state.js";import{GraphRegistry as K}from"./framework/graph-registry.js";import{GraphEngine as $}from"./framework/graph-engine.js";import{ConfigManager as eo}from"./framework/config-manager.js";import{StateGraphExt as to}from"./framework/state-graph-ext.js";import{TerminateSessionNode as no}from"./framework/terminate-session.node.js";import{SessionLogError as ao,SessionLogDecision as mo,SessionLogWarning as po,createSessionLogs as So,drainSessionLogs as Eo,restoreSessionLogs as fo,withSessionLogs as xo}from"./framework/session-log.js";import{ProviderFileManager as lo}from"./framework/llm-file.js";import{SessionManager as Do,SessionTurnError as Ro,SESSION_BUSY as To,SESSION_CONFLICT as _o,SESSION_COMPLETED as co,SESSION_DOCUMENT_VERSION as uo,MemorySessionDocumentContainer as Co,sessionTurnLeaseMs as Mo,sessionRevision as Ao,isLiveSessionTurn as No,matchesSessionWritePredicate as Oo}from"./framework/persistence/session-manager.js";import{MongoDbSessionDocumentContainer as Po}from"./framework/persistence/mongodb-session-document.container.js";import{SqliteSessionDocumentContainer as Go}from"./framework/persistence/sqlite-session-document.container.js";import{CosmosSessionDocumentContainer as yo}from"./framework/persistence/cosmos-session-document.container.js";import{mergeNodeStates as Fo,replaceNodeStates as Yo}from"./framework/node-state.js";import{LangChainLlmGateway as Bo}from"./framework/langchain-llm-gateway.js";import{ModelProvider as bo}from"./framework/model-provider.js";import{langChainModelInitialization as Wo}from"./framework/langchain-provider.adapter.js";import{GRAPH_LLM_PROVIDERS as zo,GRAPH_LLM_FAMILIES as qo,GRAPH_LLM_CAPABILITIES as Jo,BUILT_IN_MODEL_CATALOG as Qo,GraphLlm as Xo,ModelCatalog as jo,ModelProviderRegistry as Ko}from"./framework/graph-llm.config.js";import{addTokenUsage as $o,emptyTokenUsage as oe,modelExecution as ee,normalizeTokenUsage as re,tokenUsageFromMessage as te}from"./framework/token-usage.js";import{DecisionNode as ne}from"./framework/decision/decision-node.js";import{DecisionRunner as ae}from"./framework/decision/decision-runner.js";import{DecisionProvider as pe,DecisionProviderRegistry as Se}from"./framework/decision/decision-provider.js";import{TypeSafeClassifierAdapter as fe}from"./framework/decision/typesafe-provider.js";import{DecisionConfigurationError as Le,DecisionTimeoutError as de,DecisionValidationError as le,DEFAULT_DECISION_OPTIONS as ge,addDecisionUsage as De,decisionUsage as Re,emptyDecisionUsage as Te,normalizeDecisionUsage as _e,resolveDecisionOptions as ce}from"./framework/decision/decision-types.js";import{assertJsonCompatible as Ce,validateDecisionQuestions as Me,validateDecisionResult as Ae}from"./framework/decision/decision-validation.js";import{retryWithModel as Oe,LlmResponseBlockedError as Ie,LlmSetupError as Pe}from"./framework/llm-lifecycle.js";export{Qo as BUILT_IN_MODEL_CATALOG,m as BaseGraph,eo as ConfigManager,yo as CosmosSessionDocumentContainer,ge as DEFAULT_DECISION_OPTIONS,c as DEFAULT_EMPTY_HISTORY_SEED,u as DEFAULT_EMPTY_RESPONSE_RECOVERY,_ as DEFAULT_LLM_POLICY,C as DEFAULT_MAX_AGENT_ROUNDS,Le as DecisionConfigurationError,ne as DecisionNode,pe as DecisionProvider,Se as DecisionProviderRegistry,ae as DecisionRunner,de as DecisionTimeoutError,le as DecisionValidationError,M as EmptyModelResponseError,Q as GRAPH_END_NODE,Jo as GRAPH_LLM_CAPABILITIES,qo as GRAPH_LLM_FAMILIES,zo as GRAPH_LLM_PROVIDERS,S as GRAPH_NODE_CLASS,s as GraphContextChannel,$ as GraphEngine,Xo as GraphLlm,E as GraphNode,f as GraphNodeRuntime,K as GraphRegistry,q as GraphStateSupport,g as LLM_GATEWAY_FACTORY,Bo as LangChainLlmGateway,d as LlmNode,Ie as LlmResponseBlockedError,T as LlmRunner,Pe as LlmSetupError,Co as MemorySessionDocumentContainer,jo as ModelCatalog,bo as ModelProvider,Ko as ModelProviderRegistry,Po as MongoDbSessionDocumentContainer,r as Prompt,lo as ProviderFileManager,i as RunNodeBatchError,To as SESSION_BUSY,co as SESSION_COMPLETED,_o as SESSION_CONFLICT,uo as SESSION_DOCUMENT_VERSION,mo as SessionLogDecision,ao as SessionLogError,po as SessionLogWarning,Do as SessionManager,Ro as SessionTurnError,Go as SqliteSessionDocumentContainer,to as StateGraphExt,no as TerminateSessionNode,x as Tool,fe as TypeSafeClassifierAdapter,De as addDecisionUsage,$o as addTokenUsage,A as assertEmptyResponseRetries,Ce as assertJsonCompatible,D as assertLlmTimeoutMs,N as assertMaxAgentRounds,X as createGraphStateAnnotation,So as createSessionLogs,U as currentTurnContext,y as currentTurnSignal,Re as decisionUsage,I as describeStopReason,Y as direct,k as directTo,Eo as drainSessionLogs,Te as emptyDecisionUsage,oe as emptyTokenUsage,H as fanout,B as finish,b as go,No as isLiveSessionTurn,P as isRetryableStopReason,V as isToolResponse,Wo as langChainModelInitialization,Oo as matchesSessionWritePredicate,Fo as mergeNodeStates,ee as modelExecution,h as modelStopReason,_e as normalizeDecisionUsage,re as normalizeTokenUsage,Yo as replaceNodeStates,ce as resolveDecisionOptions,fo as restoreSessionLogs,Oe as retryWithModel,Ao as sessionRevision,Mo as sessionTurnLeaseMs,W as stay,w as taskResult,te as tokenUsageFromMessage,Me as validateDecisionQuestions,Ae as validateDecisionResult,xo as withSessionLogs,v as withTurnContext};
@@ -1,3 +1,4 @@
1
+ export { Prompt } from "../../src/framework/prompt.js";
1
2
  export { GraphContextChannel, type DeepReadonly } from "../../src/framework/graph-context.js";
2
3
  export { RunNodeBatchError, type RunNodeTarget, type RunNodeArgument, type RunNodeRequest, type RunNodeResult, type RunNodeResults, type RunNodeOutcome, type RunNodeFailure, type RunNodeSettlement, } from "../../src/framework/run-node.js";
3
4
  export { BaseGraph, type GraphDefinition, type GraphNodeConstructor, type GraphSchemaMigration, type HistorySpace, } from "../../src/framework/base-graph.js";
@@ -0,0 +1,8 @@
1
+ export declare class Prompt {
2
+ private static cache;
3
+ static file(filePath: string): string;
4
+ private static getCallerDir;
5
+ static set(prompt: string, key: string, value: string): string;
6
+ static replace(template: string, values: Record<string, string>): string;
7
+ static replace2(template: string, values: Record<string, any>): string;
8
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@picoflow/ezgraph",
3
- "version": "0.0.19",
3
+ "version": "0.0.20",
4
4
  "description": "Provider-neutral graph primitives built on LangGraph and LangChain.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",