@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{
|
|
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
|
+
}
|