@picoflow/ezgraph 0.0.4 → 0.0.6
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.
- package/README.md +123 -150
- package/dist/framework/conversation-runner.js +1 -1
- package/dist/framework/graph-engine.js +1 -1
- package/dist/framework/langchain-llm-gateway.js +1 -1
- package/dist/framework/langchain-provider.adapter.js +1 -1
- package/dist/framework/model-catalog.js +1 -1
- package/dist/framework/openai-auth-provider.js +4 -0
- package/dist/framework/persistence/session-manager.js +1 -1
- package/dist/framework/state-graph-ext.js +1 -1
- package/dist/types/npmlib/src/index.d.ts +1 -1
- package/dist/types/src/framework/graph-llm.config.d.ts +1 -1
- package/dist/types/src/framework/model-catalog.d.ts +20 -1
- package/dist/types/src/framework/openai-auth-provider.d.ts +12 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,171 +1,144 @@
|
|
|
1
|
-
#
|
|
1
|
+
# EZGraph
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
EZGraph is a pre-release TypeScript application layer for durable,
|
|
4
|
+
multi-turn conversational workflows. It is built on LangGraph and LangChain,
|
|
5
|
+
but gives each conversation an explicit graph, typed node state, durable session
|
|
6
|
+
handling, and code-owned outcomes for validation, confirmation, and routing.
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
It is provider-neutral and framework-neutral: use it with the model provider
|
|
9
|
+
and Node.js HTTP framework you already run.
|
|
9
10
|
|
|
10
|
-
##
|
|
11
|
+
## What it provides
|
|
11
12
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
- Graph and node primitives for staged conversations, rather than one large
|
|
14
|
+
prompt or an implicit agent loop.
|
|
15
|
+
- Per-node state, named history spaces, and typed outcomes such as `stay()`,
|
|
16
|
+
`advance()`, `finish()`, and `quit()`.
|
|
17
|
+
- One versioned session document per conversation, backed by memory, SQLite,
|
|
18
|
+
MongoDB, or Azure Cosmos DB.
|
|
19
|
+
- A model and tool loop that is bounded and owned by the graph, while business
|
|
20
|
+
validation and routing remain ordinary application code.
|
|
21
|
+
- Provider adapters and a typed model catalog, with support for OpenAI,
|
|
22
|
+
Anthropic, Google, Azure OpenAI, and custom compatible endpoints.
|
|
15
23
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
24
|
+
For the product overview, tutorial, and full developer guide, visit
|
|
25
|
+
[picoflow.io/ezgraph](https://www.picoflow.io/ezgraph/).
|
|
26
|
+
|
|
27
|
+
## Requirements
|
|
28
|
+
|
|
29
|
+
- Node.js 22.5 or later
|
|
30
|
+
- TypeScript 5.x
|
|
31
|
+
- A model-provider package and credentials for the provider you choose
|
|
32
|
+
|
|
33
|
+
Tool handlers use method decorators. Enable `experimentalDecorators` and
|
|
34
|
+
`emitDecoratorMetadata` in `tsconfig.json`, and import `reflect-metadata` once
|
|
35
|
+
at the very top of your application entry point.
|
|
36
|
+
|
|
37
|
+
## Install
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
npm install @picoflow/ezgraph
|
|
41
|
+
|
|
42
|
+
# Install only the provider adapter you use.
|
|
43
|
+
npm install @langchain/openai
|
|
44
|
+
# or: npm install @langchain/anthropic
|
|
45
|
+
# or: npm install @langchain/google
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
The provider adapters are optional peer dependencies. The published package is
|
|
49
|
+
ESM; TypeScript applications should use `module` and `moduleResolution` set to
|
|
50
|
+
`NodeNext`.
|
|
51
|
+
|
|
52
|
+
## Start an application graph
|
|
53
|
+
|
|
54
|
+
Define your graph and nodes in application code, then register the graph with a
|
|
55
|
+
`GraphEngine`. The engine creates or resumes a session using the supplied
|
|
56
|
+
`sessionId`.
|
|
57
|
+
|
|
58
|
+
```ts
|
|
59
|
+
import "reflect-metadata";
|
|
60
|
+
import { GraphEngine } from "@picoflow/ezgraph";
|
|
61
|
+
import { WeatherGraph } from "./weather-graph.js";
|
|
62
|
+
|
|
63
|
+
const engine = await GraphEngine.create({ graphs: [WeatherGraph] });
|
|
21
64
|
|
|
22
65
|
const result = await engine.run({
|
|
23
|
-
graphName: "
|
|
24
|
-
|
|
66
|
+
graphName: "WeatherGraph",
|
|
67
|
+
sessionId: "customer-123",
|
|
68
|
+
userMessage: "I need the weather in Seattle",
|
|
25
69
|
});
|
|
26
|
-
~~~
|
|
27
|
-
|
|
28
|
-
Graph and node IDs default to their class names, so existing declarations need
|
|
29
|
-
no identity boilerplate. If a class is renamed, preserve its persisted identity
|
|
30
|
-
with an override:
|
|
31
|
-
|
|
32
|
-
~~~ts
|
|
33
|
-
export class MyWeatherNode extends GraphNode<DemoGraphState> {
|
|
34
|
-
static override id() {
|
|
35
|
-
return "WeatherNode";
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
~~~
|
|
39
|
-
|
|
40
|
-
References that intentionally select a node identity should likewise use
|
|
41
|
-
`WeatherNode.id()` rather than `WeatherNode.name`, including the initial node
|
|
42
|
-
passed to `createGraphStateAnnotation`. Existing `nodes(...)`, `registerTurns(...)`,
|
|
43
|
-
`addEdge(...)`, and `advance(...)` calls remain unchanged. `branchBy(...)`
|
|
44
|
-
cases use `{ when: selector, routeTo: destination }` objects.
|
|
45
|
-
|
|
46
|
-
Every graph has an independent persisted schema version. Version 1 is the
|
|
47
|
-
default; set `schemaVersion` and provide ordered migrations in the graph
|
|
48
|
-
definition only when its persisted state shape changes.
|
|
49
|
-
|
|
50
|
-
Conversational stages extend `ConversationNode` and return semantic outcomes
|
|
51
|
-
instead of manually coordinating graph protocol fields:
|
|
52
|
-
|
|
53
|
-
~~~ts
|
|
54
|
-
protected nextStep(state, context, conversation) {
|
|
55
|
-
if (conversation.quitRequested) return this.quit(conversation);
|
|
56
|
-
if (context.complete) {
|
|
57
|
-
return this.advance(NextNode, conversation)
|
|
58
|
-
.withState({ value: context.value });
|
|
59
|
-
}
|
|
60
|
-
return this.stay(conversation).withState({ value: context.value });
|
|
61
|
-
}
|
|
62
|
-
~~~
|
|
63
|
-
|
|
64
|
-
Use `finish(response, conversation)` for terminal responses. Outcome builders
|
|
65
|
-
automatically coordinate history, tokens, response, input consumption, and the
|
|
66
|
-
persisted resume node. `toolResult(output).withContext(...)` provides typed
|
|
67
|
-
per-turn tool effects, and `branchBy(...)` keeps conditional
|
|
68
|
-
topology in the graph without a repetitive `route()` method. See
|
|
69
|
-
`docs/conversation-node-outcomes.md` in the source repository for the complete
|
|
70
|
-
contract.
|
|
71
|
-
|
|
72
|
-
For conversation graphs, call `graph.configAutoRoute()` to route semantic
|
|
73
|
-
outcomes automatically: `stay()` ends the current invocation, `advance()`
|
|
74
|
-
continues at its target, `quit()` continues at `TerminateSessionNode`, and
|
|
75
|
-
`finish()` ends it. Use `.via(WorkerNode)` to run a registered worker first
|
|
76
|
-
without changing the outcome's durable `currentNode`. `branchBy(SourceNode,
|
|
77
|
-
...)` remains available when a source needs explicit topology and takes
|
|
78
|
-
precedence over automatic routing for that source.
|
|
79
|
-
|
|
80
|
-
`GraphEngine` uses in-memory session persistence by default, so the shorter
|
|
81
|
-
`new GraphEngine().registerGraph([DemoGraph])` form works without configuration.
|
|
82
|
-
Set `SESSION_STORE` to `sqlite`, `mongodb`, or `cosmos` when durable persistence
|
|
83
|
-
is needed.
|
|
84
|
-
|
|
85
|
-
## Model catalog
|
|
86
|
-
|
|
87
|
-
Built-in models use `ModelCatalog.model`, which correlates each model ID with its legal
|
|
88
|
-
parameters at compile time and validates the same contract at runtime:
|
|
89
|
-
|
|
90
|
-
~~~ts
|
|
91
|
-
import { ModelCatalog } from "ezgraph";
|
|
92
|
-
|
|
93
|
-
const llmConfig = ModelCatalog.model("openai:gpt-5.4", {
|
|
94
|
-
retries: 3,
|
|
95
|
-
reasoningEffort: "medium",
|
|
96
|
-
forceToolCalls: true,
|
|
97
|
-
});
|
|
98
|
-
~~~
|
|
99
70
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
71
|
+
// { status, body, session }
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
`GraphEngine.create()` reads `.env` and process environment values. Model
|
|
75
|
+
credentials stay with the provider you configure; EZGraph does not require an
|
|
76
|
+
EZGraph account or runtime key.
|
|
105
77
|
|
|
106
|
-
|
|
107
|
-
import modelCatalogJson from "./model-catalog.json" with { type: "json" };
|
|
108
|
-
import { ModelCatalog } from "ezgraph";
|
|
78
|
+
### Experimental local OpenAI auth
|
|
109
79
|
|
|
110
|
-
|
|
111
|
-
|
|
80
|
+
For local development, `openai-auth` uses the OAuth session owned by an
|
|
81
|
+
already signed-in Codex client. The graph only selects the built-in model; no
|
|
82
|
+
provider adapter or `OPENAI_API_KEY` is required:
|
|
83
|
+
|
|
84
|
+
```ts
|
|
85
|
+
ModelCatalog.model("openai-auth:gpt-5.4", {
|
|
112
86
|
retries: 3,
|
|
113
|
-
reasoningEffort: "
|
|
114
|
-
});
|
|
115
|
-
~~~
|
|
116
|
-
|
|
117
|
-
The complete JSON format is published as
|
|
118
|
-
`ezgraph/model-catalog.schema.json`. Built-in entries cannot be replaced by an
|
|
119
|
-
application catalog. A full node model configuration replaces the graph model;
|
|
120
|
-
`{ params: { temperature: 0.5 } }` patches the current model and `null` removes
|
|
121
|
-
an inherited optional parameter.
|
|
122
|
-
|
|
123
|
-
Providers absent from EZGraph and LangChain require application code because
|
|
124
|
-
JSON cannot safely contain constructors or credentials. Register an initializer
|
|
125
|
-
and pass the registry when creating the catalog:
|
|
126
|
-
|
|
127
|
-
~~~ts
|
|
128
|
-
import { ModelCatalog, ModelProviderRegistry } from "ezgraph";
|
|
129
|
-
|
|
130
|
-
const providers = ModelProviderRegistry.create().register("glm", {
|
|
131
|
-
initialize({ model, options }) {
|
|
132
|
-
return {
|
|
133
|
-
model,
|
|
134
|
-
options: {
|
|
135
|
-
modelProvider: "openai",
|
|
136
|
-
...options,
|
|
137
|
-
apiKey: process.env.GLM_API_KEY,
|
|
138
|
-
configuration: { baseURL: "https://api.z.ai/api/paas/v4" },
|
|
139
|
-
},
|
|
140
|
-
cacheKey: JSON.stringify({ provider: "glm", model, options }),
|
|
141
|
-
};
|
|
142
|
-
},
|
|
87
|
+
reasoningEffort: "low",
|
|
143
88
|
});
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
The provider reads `~/.codex/auth.json` for each request and never writes the
|
|
92
|
+
shared credential or refresh token. Run `codex` when the access token expires.
|
|
93
|
+
`EZGRAPH_OPENAI_AUTH_FILE` and `EZGRAPH_OPENAI_AUTH_BASE_URL` override the
|
|
94
|
+
local defaults for testing.
|
|
95
|
+
|
|
96
|
+
This provider targets a private ChatGPT Codex backend. It is experimental,
|
|
97
|
+
intended for local use, and may change independently of the supported OpenAI
|
|
98
|
+
API-key provider.
|
|
99
|
+
|
|
100
|
+
For a complete two-stage graph, including state, a tool handler, explicit
|
|
101
|
+
outcomes, and graph registration, follow the
|
|
102
|
+
[Get started tutorial](https://www.picoflow.io/ezgraph/tutorial/).
|
|
103
|
+
|
|
104
|
+
## Persistence and configuration
|
|
105
|
+
|
|
106
|
+
The default `SESSION_STORE=memory` is useful for local development. Select a
|
|
107
|
+
durable store when conversations must resume across process restarts or
|
|
108
|
+
instances:
|
|
109
|
+
|
|
110
|
+
```dotenv
|
|
111
|
+
# memory (default), sqlite, mongodb, or cosmos
|
|
112
|
+
SESSION_STORE=sqlite
|
|
113
|
+
SQLITE_DB_PATH=./data/sessions.sqlite
|
|
144
114
|
|
|
145
|
-
|
|
146
|
-
|
|
115
|
+
# Set the credential for the model provider you use.
|
|
116
|
+
OPENAI_API_KEY=...
|
|
117
|
+
```
|
|
147
118
|
|
|
148
|
-
|
|
149
|
-
|
|
119
|
+
For MongoDB, configure `MONGODB_URL`, `MONGODB_NAME`, and
|
|
120
|
+
`MONGODB_COLLECTION`. For Cosmos DB, use the Cosmos settings described in the
|
|
121
|
+
[developer guide](https://www.picoflow.io/ezgraph/docs/developer-guide/).
|
|
150
122
|
|
|
151
|
-
|
|
123
|
+
The [EZGraph demo application](https://github.com/picoflowio/ezgraph-demo)
|
|
124
|
+
shows a NestJS + Fastify service with QuoteGraph, a LangGraph comparison, and a
|
|
125
|
+
copyable [`.env.example`](https://github.com/picoflowio/ezgraph-demo/blob/main/.env.example).
|
|
152
126
|
|
|
153
|
-
|
|
127
|
+
## Learn more
|
|
154
128
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
~~~
|
|
129
|
+
- [Get started tutorial](https://www.picoflow.io/ezgraph/tutorial/)
|
|
130
|
+
- [Developer guide](https://www.picoflow.io/ezgraph/docs/developer-guide/)
|
|
131
|
+
- [QuoteGraph walkthrough](https://www.picoflow.io/ezgraph/quote-graph/)
|
|
132
|
+
- [EZGraph compared with direct LangGraph](https://www.picoflow.io/ezgraph/compare/langgraph/)
|
|
160
133
|
|
|
161
|
-
|
|
162
|
-
is minified, keeps public runtime names, and deliberately contains no source
|
|
163
|
-
map or source files. `build:locallib` creates `staging/lib`, a local-only package
|
|
164
|
-
that retains the framework TypeScript source and an unbundled, source-mapped
|
|
165
|
-
runtime for debugging through the sibling demo. Re-run `build:locallib` after
|
|
166
|
-
framework changes.
|
|
134
|
+
## License
|
|
167
135
|
|
|
168
|
-
|
|
136
|
+
EZGraph is proprietary software distributed under the
|
|
137
|
+
[EZGraph Commercial Runtime License](https://www.picoflow.io/ezgraph/license/).
|
|
138
|
+
Personal use, commercial SaaS, internal enterprise production, client work,
|
|
139
|
+
and closed-source applications are permitted with no EZGraph runtime fee or
|
|
140
|
+
license key. Optional support is separate; an active support subscription
|
|
141
|
+
includes the private source and debug package.
|
|
169
142
|
|
|
170
|
-
|
|
171
|
-
|
|
143
|
+
See the [license page](https://www.picoflow.io/ezgraph/license/) for the
|
|
144
|
+
applicable production-use terms.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const GN=e;(function(Y,R){const Go={Y:0x1df,R:0x1f1,Z:0x20f,m:0x209},Ga=e,Z=Y();while(!![]){try{const m=-parseInt(Ga(0x1f2))/0x1*(parseInt(Ga(Go.Y))/0x2)+-parseInt(Ga(0x1de))/0x3*(-parseInt(Ga(0x1e5))/0x4)+parseInt(Ga(0x20a))/0x5+parseInt(Ga(0x1ed))/0x6*(parseInt(Ga(Go.R))/0x7)+-parseInt(Ga(0x1dc))/0x8*(-parseInt(Ga(0x1f7))/0x9)+-parseInt(Ga(Go.Z))/0xa*(-parseInt(Ga(0x204))/0xb)+-parseInt(Ga(Go.m))/0xc;if(m===R)break;else Z['push'](Z['shift']());}catch(J){Z['push'](Z['shift']());}}}(G,0x8250d));var v=Object[GN(0x1ef)],p=(Y,R)=>v(Y,GN(0x207),{'value':R,'configurable':!0x0});import{HumanMessage as j,ToolMessage as g}from'@langchain/core/messages';import{addTokenUsage as E,emptyTokenUsage as X}from'./token-usage.js';import{describeStopReason as a,isRetryableStopReason as w,modelStopReason as i}from'./model-stop-reason.js';import{SessionLogWarning as c}from'./session-log.js';import{isOpenAIAuthConfig as f,openAIAuthMessageText as o}from'./openai-auth-provider.js';class V extends Error{static{p(this,GN(0x1ea));}[GN(0x200)];constructor(Y){const GY={Y:0x1db},GF=GN;super(GF(GY.Y)+a(Y)+').'),this[GF(0x200)]=Y,this[GF(0x207)]=GF(0x1ea);}}const D=0x8;function L(Y){const GU=GN;if(!Number[GU(0x20c)](Y)||Y<0x1)throw new Error('maxAgentRounds\x20must\x20be\x20a\x20positive\x20integer;\x20received\x20'+String(Y)+'.');return Y;}p(L,GN(0x20d));const S=GN(0x1f3),T={'retries':0x2,'nudge':GN(0x1e8)};function e(j,S){j=j-0x1da;const C=G();let g=C[j];if(e['zpVeGM']===undefined){var E=function(F){const U='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let w='',i='';for(let c=0x0,q,f,o=0x0;f=F['charAt'](o++);~f&&(q=c%0x4?q*0x40+f:f,c++%0x4)?w+=String['fromCharCode'](0xff&q>>(-0x2*c&0x6)):0x0){f=U['indexOf'](f);}for(let Y=0x0,R=w['length'];Y<R;Y++){i+='%'+('00'+w['charCodeAt'](Y)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(i);};e['BHXLBH']=E,e['kNhkym']={},e['zpVeGM']=!![];}const X=C[0x0],a=j+X,N=e['kNhkym'][a];return!N?(g=e['BHXLBH'](g),e['kNhkym'][a]=g):g=N,g;}function $(Y){const Gw=GN;if(!Number[Gw(0x20c)](Y)||Y<0x0)throw new Error(Gw(0x20b)+String(Y)+'.');return Y;}p($,GN(0x20e));const q={'emptyHistorySeed':S,'emptyResponseRecovery':T};class W{static{p(this,'ConversationRunner');}[GN(0x1fd)];constructor(Y){const Gi=GN;this[Gi(0x1fd)]=Y;}async[GN(0x1da)](Y){const GJ={Y:0x1ee,R:0x205,Z:0x208,m:0x202,J:0x203,Q:0x1eb,s:0x1fd,K:0x1fb,n:0x1e2,H:0x1e9,u:0x1f9,t:0x1f0,B:0x1e0,r:0x1fe,z:0x201,h:0x1dd,d:0x206,l:0x201,y:0x1e1,k:0x201},Gc=GN,Z=Y['emptyHistorySeed']===void 0x0?S:Y[Gc(GJ.Y)],J=Y[Gc(GJ.R)][Gc(GJ.Z)]===0x0&&Z!==null,Q=J?[new j(Z)]:[...Y[Gc(0x205)]],K=J?[...Q]:[];let H=[],t=X();const B=L(Y[Gc(GJ.m)]??D),z=Y[Gc(GJ.J)]===void 0x0?T:Y['emptyResponseRecovery'],k=z?$(z[Gc(GJ.Q)]):0x0;let G0=0x0;for(let G2=0x0;G2<B;G2+=0x1){let G3;try{G3=await this[Gc(GJ.s)]['agent'](Y[Gc(0x1ec)],Q,Y[Gc(GJ.K)],Y[Gc(0x1ff)],Y[Gc(GJ.n)]);}catch(G6){const G7=H;throw H=[],await Promise[Gc(0x1e6)](G7[Gc(GJ.H)](G8=>G8())),G6;}t=E(t,G3[Gc(GJ.u)]),K['push'](G3[Gc(GJ.t)]),Q['push'](G3['value']);const G4=G3[Gc(0x1f0)][Gc(GJ.B)]??[];if(G4[Gc(0x208)]===0x0){const G8=f(Y['llmConfig'])?o(G3[Gc(GJ.t)][Gc(0x1f8)]):F(G3[Gc(0x1f0)]);if(G8[Gc(GJ.r)]())return await G1(),{'messages':K,'usage':t,'response':G8,'stoppedAfterTool':!0x1};const G9=i(G3[Gc(0x1f0)]),GG=w(G9)&&z!==null&&G0<k;if(c({'empty_model_response':a(G9),'retried':GG}),GG&&z){G0+=0x1,K[Gc(0x1f4)](),Q[Gc(0x1f4)](),Q[Gc(GJ.z)](new j(z[Gc(GJ.h)]));continue;}return await G1(),{'messages':K,'usage':t,'response':G8,'stoppedAfterTool':!0x1,'stopReason':G9};}await G1();let G5=!0x1;try{for(const [Ge,Gj]of G4[Gc(0x1fa)]()){const GS=await Y[Gc(0x1e7)](Gj),GC=new g({'content':JSON[Gc(0x1e4)](GS[Gc(GJ.d)]),'tool_call_id':Gj['id']??'tool-call-'+G2+'-'+Ge,'name':Gj[Gc(0x207)]});K['push'](GC),Q['push'](GC),GS['messages']&&(K[Gc(GJ.l)](...GS[Gc(0x1f5)]),Q[Gc(0x201)](...GS['messages'])),GS[Gc(GJ.y)]&&H[Gc(GJ.k)](GS[Gc(0x1e1)]),G5||=GS['stopAfterBatch']===!0x0;}}catch(Gg){throw await G1(),Gg;}if(G5)return await G1(),{'messages':K,'usage':t,'stoppedAfterTool':!0x0};}throw await G1(),new Error('Conversation\x20exceeded\x20'+B+Gc(0x1f6));async function G1(){const Gq=Gc,GE=H;H=[],await Promise[Gq(0x1e6)](GE['map'](GX=>GX()));}p(G1,Gc(0x1e3));}}function G(){const Gs=['nZi0mZrXsNnKC2m','u3rHCNq','Cg9W','BwvZC2fNzxm','igfNzw50ihjVDw5KCY4','mti3mde5n2DZt0vbEa','y29UDgvUDa','DxnHz2u','zw50CMLLCW','Dg9VBhm','BwvZC2fNzvrLEhq','BgXTr2f0zxDHEq','DhjPBq','BgXTq29UzMLN','CMvHC29U','ChvZAa','Bwf4qwDLBNrsB3vUzhm','zw1WDhLszxnWB25ZzvjLy292zxj5','mJCXn2j5zwDkvG','AgLZDg9YEq','B3v0Chv0','BMfTzq','BgvUz3rO','odu3nZK5nK9WwfvKDq','mJq2nZG1y0DxthrP','zw1WDhLszxnWB25ZzvjLy292zxj5lNjLDhjPzxmGBxvZDcbIzsbHig5VBI1UzwDHDgL2zsbPBNrLz2vYoYbYzwnLAxzLzca','AxnjBNrLz2vY','yxnZzxj0twf4qwDLBNrsB3vUzhm','yxnZzxj0rw1WDhLszxnWB25ZzvjLDhjPzxm','mtK0mdbpCxbXqKy','C3rYAw5N','CNvU','vgHLig1VzgvSihjLDhvYBMvKigfUigvTChr5ihjLC3bVBNnLicG','mtzdt0nMEfC','BNvKz2u','mJGZmJe3n09rDenQCa','mtHYwhzsA0u','Dg9VBf9JywXSCW','y2XLyw51Ca','y2fSBe9WDgLVBNm','y2XLyw51Cef0DgfJAg1LBNrZ','C3rYAw5NAwz5','nerSAxv6Aa','ywXSu2v0DgXLza','zxHLy3v0zvrVB2W','rM9SBg93ihrOzsbZExn0zw0GChjVBxb0igfUzcbYzxnWB25KihbYB3bLCMX5lIbvC2uGDgHLihjLCxvPCMvKihrVB2WGD2HLBIbPBNn0CNvJDgvKlG','BwfW','rw1WDhLnB2rLBfjLC3bVBNnLrxjYB3i','CMv0CMLLCW','C3LZDgvTuhjVBxb0','mte2ntjowgLQshK','zw1WDhLiAxn0B3j5u2vLza','zgvMAw5LuhjVCgvYDhK','DMfSDwu','nti1uNnkyuTi'];G=function(){return Gs;};return G();}function F(Y){const GQ={Y:0x1f8,R:0x1e4,Z:0x1f8},Gf=GN;return typeof Y['content']==Gf(0x210)?Y[Gf(GQ.Y)]:JSON[Gf(GQ.R)](Y[Gf(GQ.Z)]);}p(F,GN(0x1fc));export{W as ConversationRunner,q as DEFAULT_CONVERSATION_POLICY,S as DEFAULT_EMPTY_HISTORY_SEED,T as DEFAULT_EMPTY_RESPONSE_RECOVERY,D as DEFAULT_MAX_AGENT_ROUNDS,V as EmptyModelResponseError,$ as assertEmptyResponseRetries,L as assertMaxAgentRounds};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const Ge=g;(function(n,p){const Gi={n:0xc3,p:0xc6,H:0xaf,u:0xc1,v:0xdf},GG=g,H=n();while(!![]){try{const u=parseInt(GG(0xae))/0x1+-parseInt(GG(0xcb))/0x2+-parseInt(GG(Gi.n))/0x3+-parseInt(GG(Gi.p))/0x4*(parseInt(GG(0xa2))/0x5)+-parseInt(GG(0xa8))/0x6+parseInt(GG(Gi.H))/0x7*(-parseInt(GG(Gi.u))/0x8)+-parseInt(GG(0xac))/0x9*(-parseInt(GG(Gi.v))/0xa);if(u===p)break;else H['push'](H['shift']());}catch(v){H['push'](H['shift']());}}}(e,0xf2844));var E=Object[Ge(0xc2)],S=(n,p)=>E(n,'name',{'value':p,'configurable':!0x0});import{HumanMessage as X}from'@langchain/core/messages';import{randomUUID as a}from'node:crypto';import{GraphRegistry as U,registeredGraphId as i,registeredGraphSchemaVersion as c}from'./graph-registry.js';import{LangChainLlmGateway as q}from'./langchain-llm-gateway.js';import{SessionLogError as f,createSessionLogs as o,withSessionLogs as Y}from'./session-log.js';import{withTurnContext as Z}from'./turn-context.js';import{SessionManager as m,SessionTurnError as J,SESSION_BUSY as Q,SESSION_COMPLETED as s}from'./persistence/session-manager.js';import{parseJsonObjectResponse as K}from'./json-response.js';function e(){const GH=['y29UzMLN','jYbPCYbHBhjLywr5ihbYB2nLC3nPBMCGysb0DxjUlG','CMvSzwfZzvr1CM4','z2v0r3jHCgHZ','ANnVBLjLC3vSDa','nw11DKf1tG','y29Kzq','D2L0Afr1CM5ty29Wzq','C2vZC2LVBNm','CMvXDwLYzxnvC2vYtwvZC2fNzq','BwvZC2fNzq','ndm3ntCYofzVD1f3vW','ChjLCgfYzuLUChv0','CMvZCg9UC2u','BMfTzxm','mti3otm2oeX2vKDczq','z3jHCgHZ','mZu2nZLVr01ys0y','mtrWy2vUAfm','Aw5MBgLNAhrtzxnZAw9UCW','vw5HyMXLihrVihbLCNnPC3qGC2vZC2LVBIbLCNjVCIbSB2C6','CMvZCg9UC2vnB2rL','r3jHCgHfBMDPBMu','oYbLEhbLy3rLzca','BwfW','ANnVBG','y29TCgXLDgvK','CMvNAxn0zxjhCMfWAa','yMvNAw5uDxjU','y29UzMXPy3rszxn1Bhq','ywrK','C2LNBMfS','zgvSzxrLu2vZC2LVBG','ChjVDMLKzxjZ','AgfZ','jYbYzxn0B3jLihjLDhvYBMvKihnJAgvTysb2zxjZAw9Uia','nJy3nJmYofLive1rvq','zgvMAw5LuhjVCgvYDhK','mJe1mZa4nxPurxPQzW','BgXTr2f0zxDHEuzHy3rVCNK','y3jLyxrL','nJm4oty2ogXJD0jKuq','y2HHDfjLC3vSDa','zw5KrMfPBgvKvhvYBG','y29UzMLNtwfUywDLCG','BgXTq29UzMLN','mZCYntGXme1UC25pAa','z3jHCgHoyw1L','DMfSAwrHDgvtzxnZAw9Uswq','y29TCgXLDgvKu2vZC2LVBLjLC3vSDa','z3jHCgG','CMvNAxn0CNK','CMvNAxn0zxi','CMvZDg9YzvnLC3nPB25eB2m','r3jHCgGGjW','z2v0u2vZC2LVBG','y2XVC2u','zg9JDw1LBNq','zxjYB3i','DhjPBq','C2f2zvn0yxrL','CNvU','jYbPCYbUB3qGCMvNAxn0zxjLzc4','C3rYAw5N','BM9Kzxm','C2nOzw1HvMvYC2LVBG','ntmWs0Diq1vn','Aw52B2TL','C2vZC2LVBK1HBMfNzxi','CMvZDg9YzvnLC3nPB25eB2n1BwvUDa','u2vZC2LVBIaN','z2v0r3jHCgHezwzPBML0Aw9U','zgvSzxrL','CgvYC2LZDe1Pz3jHDgvKu2vZC2LVBG','DxnLCK1LC3nHz2u','DxnLCK1LC3nHz2uGBxvZDcbIzsbHig5VBI1LBxb0EsbZDhjPBMCU','C2vZC2LVBKLK'];e=function(){return GH;};return e();}function g(G,j){G=G-0x95;const S=e();let C=S[G];if(g['bNAqUg']===undefined){var E=function(F){const U='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let w='',i='';for(let c=0x0,q,f,o=0x0;f=F['charAt'](o++);~f&&(q=c%0x4?q*0x40+f:f,c++%0x4)?w+=String['fromCharCode'](0xff&q>>(-0x2*c&0x6)):0x0){f=U['indexOf'](f);}for(let Y=0x0,R=w['length'];Y<R;Y++){i+='%'+('00'+w['charCodeAt'](Y)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(i);};g['DQckiz']=E,g['gfuxCv']={},g['bNAqUg']=!![];}const X=S[0x0],a=G+X,N=g['gfuxCv'][a];return!N?(C=g['DQckiz'](C),g['gfuxCv'][a]=C):C=N,C;}class R{static{S(this,Ge(0xb3));}[Ge(0xd0)]=new U();['sessions'];[Ge(0xc4)];[Ge(0xb0)]=new Set();constructor(n={}){const Gc={n:0xe1,p:0xb8},Gj=Ge;this['sessions']=n[Gj(Gc.n)]??new m(),this[Gj(0xc4)]=n['llmGatewayFactory']??(p=>new q(p,n['providers']?{'providers':n[Gj(0xbe)]}:{})),this[Gj(Gc.p)](n[Gj(0xad)]??[]);}static async[Ge(0xc5)](n={}){const Gq={n:0xc4,p:0xad},GS=Ge,p=await m['fromConfig'](n[GS(0xc9)]);return new R({'sessionManager':p,...n[GS(0xc4)]?{'llmGatewayFactory':n[GS(Gq.n)]}:{},...n[GS(Gq.p)]?{'graphs':n[GS(Gq.p)]}:{},...n['providers']?{'providers':n['providers']}:{}});}[Ge(0xb8)](n){const Gf={n:0xd0,p:0xd1},GC=Ge,p=n[GC(0xb5)](H=>new H(this[GC(0xc4)](H[GC(0x97)]()[GC(0xca)])));return this[GC(Gf.n)][GC(Gf.p)](p),this;}[Ge(0xa0)](){const Gg=Ge;return this[Gg(0xd0)][Gg(0xab)]();}['getSession'](n){const GY={n:0xd4},GE=Ge;return this[GE(0xa5)][GE(GY.n)](w(n));}async[Ge(0xda)](n){const GZ={n:0xd3,p:0x9b,H:0x9c,u:0xb0,v:0xbf,t:0xba,B:0x96,r:0x9e,z:0xbc},GR={n:0xdd,p:0xcf,H:0xde,u:0xcf,v:0xc0,t:0xde,B:0xde,r:0xa5,z:0xb7,h:0xb2,d:0xcf,l:0xa5,y:0xba,P:0xa3,A:0xa7,k:0xc8,W:0xd7,G0:0xb0},GX=Ge,H=this['registry']['get'](n['graphName']);if(!H)return{'status':0x190,'body':{'success':!0x1,'completed':!0x0,'message':GX(GZ.n)+(n[GX(0xcc)]??'')+GX(0xdb)}};const B=typeof n[GX(0x9a)]==GX(0xdc)?n[GX(0x9a)][GX(0xd8)]():void 0x0;if(H[GX(0xa6)]!==!0x1&&!B)return{'status':0x190,'body':{'success':!0x1,'completed':!0x1,'message':GX(GZ.p)}};let z;try{z=n[GX(GZ.H)]?w(n['sessionId']):a();}catch(A){return{'status':0x190,'body':{'success':!0x1,'completed':!0x1,'message':A instanceof Error?A[GX(0xa7)]:String(A)}};}const h=i(H),d=c(H),l={'graphId':h,'graphSchemaVersion':d,'llmConfig':H[GX(0xca)]},y=o();if(this[GX(GZ.u)][GX(GZ.v)](z))return this[GX(GZ.t)](z,Q,GX(GZ.B)+z+GX(GZ.r));this['inflightSessions'][GX(0xbb)](z);const P={'session':z,...n[GX(GZ.z)]===void 0x0?{}:{'signal':n['signal']}};return this[GX(0xa4)](P,y,async()=>{const Ga=GX;let k=!0x0,W,G0;try{const G1=a(),G2=await this[Ga(0xa5)][Ga(0xb9)](z,G1,l);W=G1,G0=G2['expectedRevision'];const G3=G2[Ga(0xd6)]['graph'][Ga(GR.n)]?G2[Ga(0xd6)]:void 0x0;G3&&G3[Ga(GR.p)][Ga(GR.H)]!==d&&(k=!0x1);const G4=G3?H[Ga(0xd2)]?await H[Ga(0xd2)](G3):G3:void 0x0;if(G4&&G4[Ga(GR.u)][Ga(0xde)]!==d)throw new Error(Ga(0xd3)+h+Ga(GR.v)+G4[Ga(0xcf)][Ga(GR.t)]+Ga(0xb4)+d+'.');G3&&G4&&G4['graph'][Ga(0xde)]!==G3[Ga(GR.u)][Ga(GR.B)]&&await this[Ga(0xa5)][Ga(0x99)](G4,{'owner':G1,'expectedRevision':G0}),k=!0x0;const G5=G4?this[Ga(GR.r)][Ga(0x95)](G4,h):void 0x0;if(G5?.[Ga(GR.z)])return await this['sessions'][Ga(0x9f)](z,G1,G0),this[Ga(0xce)](H[Ga(GR.h)],z);const G6=await H[Ga(GR.d)][Ga(0xe0)]({...B?H[Ga(0xa9)](G5,new X(B)):G5??{},'config':{...G5?.[Ga(0x9d)]??{},...n[Ga(0x9d)]??{}},'inputConsumed':!0x1,'response':''});return await this[Ga(GR.l)][Ga(0xd9)](z,G6,l,y,{'owner':G1,'expectedRevision':G0}),H['responseMode']==='json'?this['jsonResult'](z,G6[Ga(0xaa)]):this['chatResult'](z,G6['response'],G6['completed']);}catch(G7){if(G7 instanceof J)return this[Ga(GR.y)](z,G7[Ga(GR.P)],G7[Ga(GR.A)]);const G8=G7 instanceof Error?G7[Ga(0xa7)]:String(G7);if(f({'chat_service':G8}),W)try{await this['sessions'][Ga(GR.k)](z,W,l,k?y:void 0x0,G0);}catch(G9){console[Ga(GR.W)](Ga(0xb1),G9);}return{'status':0x190,'session':z,'body':{'success':!0x1,'completed':!0x1,'message':G8,'session':z}};}finally{this[Ga(GR.G0)][Ga(0x98)](z);}});}[Ge(0xa4)](n,p,H){return Z(n,()=>Y(p,H));}async[Ge(0xbd)](n){const GI={n:0xbd},GN=Ge;if(!n)return{'status':0x190,'body':{'success':!0x1,'message':'SESSION_ID\x20is\x20required.'}};try{const p=w(n);return await this[GN(0xa5)][GN(GI.n)](p),{'status':0xc8,'body':{'success':!0x0,'session':p}};}catch(H){return{'status':0x190,'body':{'success':!0x1,'session':n,'message':H instanceof Error?H[GN(0xa7)]:String(H)}};}}async[Ge(0xd5)](){const GF=Ge;await this[GF(0xa5)]['close']();}[Ge(0xba)](n,p,H){return{'status':0x199,'session':n,'body':{'success':!0x1,'completed':!0x1,'message':H,'code':p,'session':n}};}[Ge(0xce)](n,p){const Gs={n:0xc7},GU=Ge,H='This\x20conversation\x20is\x20already\x20complete.';return n===GU(0xb6)?this['conflictResult'](p,s,H):this[GU(Gs.n)](p,H,!0x0);}[Ge(0xa1)](n,p){return{'status':0xc8,'session':n,'contentType':'application/json','body':K(p)};}[Ge(0xc7)](n,p,H){return{'status':0xc8,'session':n,'body':{'success':!0x0,'completed':H,'message':p,'bot':p,'session':n}};}}function w(n){const Gp={n:0xd8},Gw=Ge,p=n[Gw(Gp.n)]();if(!/^[A-Za-z0-9_-]{1,128}$/['test'](p))throw new Error('SESSION_ID\x20must\x20be\x201-128\x20letters,\x20numbers,\x20underscores,\x20or\x20hyphens.');return p;}S(w,Ge(0xcd));export{R as GraphEngine};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var M=Object.defineProperty;var p=(c,n)=>M(c,"name",{value:n,configurable:!0});import{HumanMessage as f,SystemMessage as h}from"@langchain/core/messages";import{initChatModel as k}from"langchain";import{assertLlmTimeoutMs as S}from"./llm-gateway.js";import{GraphLlm as m}from"./graph-llm.config.js";import{langChainModelInitialization as x}from"./langchain-provider.adapter.js";import{validateModelProviderAdapters as A}from"./model-provider.js";import{SessionLogWarning as T}from"./session-log.js";import{modelExecution as u,tokenUsageFromMessage as l}from"./token-usage.js";import{isOpenAIAuthConfig as w,openAIAuthMessageText as v}from"./openai-auth-provider.js";class K{static{p(this,"LangChainLlmGateway")}models=new Map;llmConfig;providers;constructor(n,e={}){this.llmConfig=m.validateConfig(n),this.providers=e.providers??[],A(this.providers)}async generate(n,e,o=this.llmConfig,i){const t=await this.invoke(o,i,async s=>(await this.getModel(o)).invoke([new h(n),new f(e)],s));return{value:w(o)?v(t.content):typeof t.content=="string"?t.content:JSON.stringify(t.content),usage:l(t),execution:u(o)}}async structured(n,e,o,i,t=this.llmConfig,s,a){const r=await this.invoke(t,a,async d=>(await this.getModel(t)).withStructuredOutput(n,{name:i,method:"functionCalling",includeRaw:!0}).invoke(this.messages(e,s,o),d));return{value:r.parsed,usage:l(r.raw),execution:u(t)}}async respond(n,e,o=this.llmConfig,i){const t=await this.invoke(o,i,async s=>(await this.getModel(o)).invoke([new h(n),...e],s));return{value:w(o)?v(t.content):typeof t.content=="string"?t.content:JSON.stringify(t.content),usage:l(t),execution:u(o)}}async agent(n,e,o,i=this.llmConfig,t){const s=await this.invoke(i,t,async a=>y(await this.getModel(i),o,i.params.forceToolCalls).invoke([new h(n),...e],a));return{value:s,usage:l(s),execution:u(i)}}async toolCall(n,e,o,i=this.llmConfig,t,s){const a=await this.invoke(i,s,async d=>y(await this.getModel(i),o,i.params.forceToolCalls).invoke(this.messages(n,t,e),d)),r=a.tool_calls?.[0];return{value:r?{name:r.name,args:r.args}:void 0,usage:l(a),execution:u(i)}}messages(n,e,o){return[new h(n),...e??[],new f(o)]}getModel(n){const e=x(n,this.providers),o=e.cacheKey??JSON.stringify({model:e.model,options:e.options}),i=this.models.get(o);if(i)return i;const t=k(e.model,e.options).then(s=>(m.validateProfile(n,s.profile),s));return this.models.set(o,t),t}async invoke(n,e,o){const i=e?.timeoutMs===void 0?void 0:S(e.timeoutMs),t=i===void 0?void 0:AbortSignal.timeout(i),s=[e?.signal,t].filter(r=>r!==void 0),a=s.length>1?AbortSignal.any(s):s[0];try{return await o(a?{signal:a}:void 0)}catch(r){const d=t?.aborted===!0&&e?.signal?.aborted!==!0,g=d?`Model call for '${m.modelIdentifier(n)}' exceeded its ${String(i)} ms timeout.`:r instanceof Error?r.message:String(r);throw T({llm_call:g,model:m.modelIdentifier(n)}),d?new Error(g,{cause:r}):r}}}function y(c,n,e=!1){if(n.length>0&&c.profile.toolCalling===!1)throw new Error("The selected model profile reports that tool calling is unsupported.");if(e&&c.profile.toolChoice===!1)throw new Error("The selected model profile reports that tool choice is unsupported.");return c.bindTools(n,e?{tool_choice:"any"}:void 0)}p(y,"bindTools");export{K as LangChainLlmGateway};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function G(){const t=['CMvZB2X2zu1VzgvSrgvZy3jPChrVCG','DMfSAwrHDgvdB25MAwC','zw50CMLLCW','CgfYyw1Z','ntuYndy4DNHqAfjm','CgfYyw1LDgvYtwfWCgLUz3m','C2v0ugf0Aa','BgfUz0nOywLUtw9KzwXjBML0AwfSAxPHDgLVBG','Aw5PDgLHBgL6zq','ntCXmZCYohLHBhDsra','ndbUuejIqM8','ChjVDMLKzxjnB2rLBa','ChjVDMLKzxi','B2jQzwn0','ChjVDMLKzxjbzgfWDgvY','BMfTzq','C2XPy2u','ntKXnJCXELjNrNDU','nZDVtujpzhK','mZeYotq1m1vtC294qG','q2f0ywXVzYbWyxjHBwv0zxiGBwfWCgLUzYaN','C3bSAxq','nde1nZq5nxn1CKL2Aq','q2f0ywXVzYbWyxjHBwv0zxiGBwfWCgLUzYbWyxrOCYbJyw5UB3qGyMuGzw1WDhKU','mJqWndK2nwzoDNfWqq','AxnbCNjHEq','mJm2nJa5nePzAg10ta'];G=function(){return t;};return G();}const Q=e;(function(N,F){const p={N:0x17a,F:0x16b,U:0x178,w:0x166},J=e,U=N();while(!![]){try{const w=parseInt(J(0x173))/0x1+-parseInt(J(0x17c))/0x2+-parseInt(J(p.N))/0x3+-parseInt(J(p.F))/0x4+parseInt(J(p.U))/0x5+parseInt(J(p.w))/0x6*(parseInt(J(0x174))/0x7)+parseInt(J(0x16c))/0x8*(parseInt(J(0x175))/0x9);if(w===F)break;else U['push'](U['shift']());}catch(i){U['push'](U['shift']());}}}(G,0xb9e87));var s=Object['defineProperty'],l=(N,F)=>s(N,Q(0x171),{'value':F,'configurable':!0x0});import{GraphLlm as j,ModelCatalog as S}from'./graph-llm.config.js';function e(j,S){j=j-0x165;const C=G();let g=C[j];if(e['uapbbH']===undefined){var E=function(F){const U='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let w='',i='';for(let c=0x0,q,f,o=0x0;f=F['charAt'](o++);~f&&(q=c%0x4?q*0x40+f:f,c++%0x4)?w+=String['fromCharCode'](0xff&q>>(-0x2*c&0x6)):0x0){f=U['indexOf'](f);}for(let Y=0x0,R=w['length'];Y<R;Y++){i+='%'+('00'+w['charCodeAt'](Y)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(i);};e['ujitrk']=E,e['tGlJwF']={},e['uapbbH']=!![];}const X=C[0x0],a=j+X,N=e['tGlJwF'][a];return!N?(g=e['ujitrk'](g),e['tGlJwF'][a]=g):g=N,g;}import{modelProviderAdapter as E}from'./model-provider.js';import{OPENAI_AUTH_PROVIDER as X,initializeOpenAIAuthProvider as a}from'./openai-auth-provider.js';function C(N,F=[]){const H={N:0x17e,F:0x17d,U:0x165,w:0x167,i:0x16d,q:0x16e,o:0x170,Y:0x16a,R:0x16e},K=Q,U=j[K(H.N)](N),w=S[K(H.F)](U),q={};for(const [R,Z]of Object[K(0x17f)](U[K(H.U)])){const I=w[K(H.w)][R];I!==null&&u(q,I??R,Z);}if(w[K(0x16e)]===X)return a(w[K(H.i)],q);const Y=E(w[K(H.q)],F)??w[K(H.o)];return Y?Y[K(H.Y)]({'provider':w[K(H.R)],'model':w[K(H.i)],'options':q}):{'model':w[K(H.i)],'options':{'modelProvider':w[K(0x16e)],...q}};}l(C,Q(0x169));function u(N,F,U){const x={N:0x16f,F:0x17b,U:0x176,w:0x179},n=Q,w=F[n(0x177)]('.');let q=N;for(const R of w[n(0x172)](0x0,-0x1)){const Z=q[R];if(Z===void 0x0){const I={};q[R]=I,q=I;}else{if(typeof Z==n(x.N)&&Z!==null&&!Array[n(x.F)](Z))q=Z;else throw new Error(n(x.U)+F+'\x27\x20has\x20a\x20conflicting\x20path.');}}const Y=w['at'](-0x1);if(!Y)throw new Error(n(x.w));q[Y]=U;}l(u,Q(0x168));export{C as langChainModelInitialization};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var x=Object.defineProperty;var
|
|
1
|
+
var x=Object.defineProperty;var m=(i,e)=>x(i,"name",{value:e,configurable:!0});import{z as o}from"zod";const y=["openai","openai-auth","anthropic","google","azure_openai","bedrock","ollama","cohere","cerebras","deepseek","fireworks","groq","mistral","mistralai","perplexity","together","xai","scripted"],E=["chat","reasoning","thinking"],S=["imageInputs","imageUrlInputs","pdfInputs","audioInputs","videoInputs","reasoningOutput","toolCalling","toolChoice","structuredOutput"],$=Symbol("ezgraph.builtInModelConfig");class k{static{m(this,"ModelProviderRegistry")}adapters=new Map;static create(){return new k}register(e,r){const t=e.trim();if(!/^[a-z][a-z0-9_-]*$/.test(t))throw new Error(`Model provider ID '${e}' is invalid.`);if(y.includes(t))throw new Error(`Model provider '${t}' is built in and cannot be replaced.`);if(this.adapters.has(t))throw new Error(`Model provider '${t}' is already registered.`);return this.adapters.set(t,r),this}adapter(e){return this.adapters.get(e)}}const g=Symbol("ezgraph.runtimeModelDescriptor"),T={type:"object",additionalProperties:!1,properties:Object.fromEntries(S.map(i=>[i,{const:!0}]))},I={retries:{type:"integer",minimum:0},maxOutputTokens:{type:"integer",minimum:1},forceToolCalls:{type:"boolean"},requiredCapabilities:T},l={retries:"maxRetries",forceToolCalls:null,requiredCapabilities:null};function d(i){return{type:"object",additionalProperties:!1,required:["retries"],properties:{...I,...i}}}m(d,"parameterSchema");const h={"openai.chat":{provider:"openai",family:"chat",paramsSchema:d({temperature:{type:"number"},serviceTier:{enum:["auto","default","flex","priority"]},promptCacheKey:{type:"string",minLength:1}}),parameterMappings:{...l,maxOutputTokens:"maxTokens",temperature:"temperature",serviceTier:"service_tier",promptCacheKey:"promptCacheKey"}},"openai.reasoning":{provider:"openai",family:"reasoning",paramsSchema:d({reasoningEffort:{enum:["none","minimal","low","medium","high","xhigh","max"]},serviceTier:{enum:["auto","default","flex","priority"]},promptCacheKey:{type:"string",minLength:1}}),parameterMappings:{...l,maxOutputTokens:"maxTokens",reasoningEffort:"reasoningEffort",serviceTier:"service_tier",promptCacheKey:"promptCacheKey"}},"openai-auth.reasoning":{provider:"openai-auth",family:"reasoning",paramsSchema:d({reasoningEffort:{enum:["none","minimal","low","medium","high","xhigh","max"]}}),parameterMappings:{...l,maxOutputTokens:"maxTokens",reasoningEffort:"reasoningEffort"}},"anthropic.chat":{provider:"anthropic",family:"chat",paramsSchema:d({temperature:{type:"number"},outputEffort:{enum:["low","medium","high","xhigh","max"]}}),parameterMappings:{...l,maxOutputTokens:"maxTokens",temperature:"temperature",outputEffort:"outputConfig.effort"}},"anthropic.thinking":{provider:"anthropic",family:"thinking",paramsSchema:d({thinking:{oneOf:[{type:"object",additionalProperties:!1,required:["type"],properties:{type:{const:"adaptive"}}},{type:"object",additionalProperties:!1,required:["type"],properties:{type:{const:"disabled"}}},{type:"object",additionalProperties:!1,required:["type","budget_tokens"],properties:{type:{const:"enabled"},budget_tokens:{type:"integer",minimum:1024}}}]},outputEffort:{enum:["low","medium","high","xhigh","max"]}}),parameterMappings:{...l,maxOutputTokens:"maxTokens",thinking:"thinking",outputEffort:"outputConfig.effort"}},"google.chat":{provider:"google",family:"chat",paramsSchema:d({temperature:{type:"number"},thinkingBudget:{type:"integer",minimum:0},reasoningEffort:{enum:["minimal","low","medium","high"]},safetySettings:{type:"array",items:{type:"object",additionalProperties:!1,required:["category","threshold"],properties:{category:{type:"string",minLength:1},threshold:{type:"string",minLength:1}}}}}),parameterMappings:{...l,maxOutputTokens:"maxOutputTokens",temperature:"temperature",thinkingBudget:"thinkingConfig.thinkingBudget",reasoningEffort:"thinkingConfig.reasoningEffort",safetySettings:"safetySettings"}},"scripted.chat":{provider:"scripted",family:"chat",paramsSchema:d({temperature:{type:"number"}}),parameterMappings:{...l,maxOutputTokens:"maxTokens",temperature:"temperature"}}},O={version:1,profiles:h,models:{"openai:gpt-4o":{profile:"openai.chat"},"openai:gpt-4o-mini":{profile:"openai.chat"},"openai:gpt-5.1":{profile:"openai.reasoning"},"openai:gpt-5.4":{profile:"openai.reasoning"},"openai-auth:gpt-5.4":{profile:"openai-auth.reasoning"},"anthropic:claude-sonnet-4-5":{profile:"anthropic.chat"},"anthropic:claude-opus-4-1":{profile:"anthropic.thinking"},"google:gemini-3.1-flash-lite":{profile:"google.chat"},"google:gemini-3.5-flash":{profile:"google.chat"},"scripted:scripted-model":{profile:"scripted.chat"}}},C=o.object({provider:o.string().regex(/^[a-z][a-z0-9_-]*$/),family:o.enum(E),paramsSchema:o.record(o.string(),o.unknown()),parameterMappings:o.record(o.string(),o.string().min(1).nullable())}).strict(),_=o.object({$schema:o.string().min(1).optional(),version:o.literal(1),profiles:o.record(o.string().min(1),C).optional(),models:o.record(o.string().min(1),o.object({profile:o.string().min(1),providerModel:o.string().min(1).optional()}).strict())}).strict();class f{static{m(this,"ModelCatalog")}descriptors;static create(e,r={}){return new f(e,r)}static model(e,r){const t={model:e,params:r,[$]:!0};return f.validateConfig(t),t}static validateConfig(e){return f.resolveModelDescriptor(e).paramsSchema.parse(e.params),e}static resolveModelDescriptor(e){if(g in e)return e[g];const r=b().get(e.model);if(!r)throw new Error(`Unknown model '${e.model}'. Add it to a ModelCatalog and construct it with catalog.model().`);return r}constructor(e,r={}){const t=_.parse(e);for(const n of Object.keys(t.profiles??{}))if(n in h)throw new Error(`Model catalog cannot replace built-in profile '${n}'.`);const a=v(t.profiles??{}),p=new Map(b());for(const[n,s]of a){const c=s.definition.provider;if(!y.includes(c)&&!r.providers?.adapter(c))throw new Error(`Model parameter profile '${n}' uses unregistered provider '${c}'.`)}for(const[n,s]of Object.entries(t.models)){if(p.has(n))throw new Error(`Model catalog cannot replace built-in model '${n}'.`);const c=a.get(s.profile)??w().get(s.profile);if(!c)throw new Error(`Model '${n}' references unknown profile '${s.profile}'.`);p.set(n,M(n,s.providerModel,c,r.providers?.adapter(c.definition.provider)))}this.descriptors=p}model(e,r){const t=this.descriptors.get(e);if(!t)throw new Error(`Model '${e}' is not present in the model catalog.`);const a=t.paramsSchema.parse(r);return{model:e,params:a,[g]:t}}}function w(){return P??=v(h)}m(w,"builtInProfiles");function b(){if(u)return u;const i=w(),e=new Map;for(const[r,t]of Object.entries(O.models)){const a=i.get(t.profile);if(!a)throw new Error(`Built-in model '${r}' has an invalid profile.`);e.set(r,M(r,void 0,a))}return u=e,u}m(b,"builtInDescriptors");let P,u;function v(i){const e=new Map;for(const[r,t]of Object.entries(i)){let a;try{a=o.fromJSONSchema(t.paramsSchema)}catch(n){throw new Error(`Model parameter profile '${r}' has an invalid paramsSchema: ${n instanceof Error?n.message:String(n)}`)}const p=t.paramsSchema.properties;if(!p||typeof p!="object"||Array.isArray(p))throw new Error(`Model parameter profile '${r}' must define object properties.`);for(const n of Object.keys(t.parameterMappings)){if(!(n in p))throw new Error(`Model parameter profile '${r}' maps undeclared parameter '${n}'.`);const s=t.parameterMappings[n];typeof s=="string"&&j(r,n,s)}e.set(r,{definition:t,schema:a})}return e}m(v,"compileProfiles");function j(i,e,r){const t=new Set(["__proto__","prototype","constructor"]);if(r.split(".").some(p=>!/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(p)||t.has(p)))throw new Error(`Model parameter profile '${i}' has unsafe mapping for '${e}': '${r}'.`)}m(j,"validateMappingPath");function M(i,e,r,t){const a=i.indexOf(":");if(a<=0||a===i.length-1)throw new Error(`Model ID '${i}' must use the '<provider>:<model>' format.`);const p=i.slice(0,a);if(p!==r.definition.provider)throw new Error(`Model '${i}' uses provider '${p}' but profile uses '${r.definition.provider}'.`);return{id:i,providerModel:e??i.slice(a+1),provider:r.definition.provider,family:r.definition.family,paramsSchema:r.schema,parameterMappings:r.definition.parameterMappings,...t?{providerAdapter:t}:{}}}m(M,"descriptor");export{O as BUILT_IN_MODEL_CATALOG,S as GRAPH_LLM_CAPABILITIES,E as GRAPH_LLM_FAMILIES,y as GRAPH_LLM_PROVIDERS,f as ModelCatalog,k as ModelProviderRegistry};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
var l=Object.defineProperty;var i=(t,n)=>l(t,"name",{value:n,configurable:!0});import{readFileSync as h}from"node:fs";import{homedir as x}from"node:os";import{resolve as g}from"node:path";const f="openai-auth",m="https://chatgpt.com/backend-api/codex",I=".codex/auth.json";function J(t,n){const e=y(),r=process.env.EZGRAPH_OPENAI_AUTH_BASE_URL?.trim()||m;return{model:t,options:{...n,modelProvider:"openai",useResponsesApi:!0,streaming:!0,zdrEnabled:!0,apiKey:_(e),configuration:{baseURL:r,fetch:E(e)}},cacheKey:JSON.stringify({provider:f,model:t,baseURL:r,authFile:e,options:n})}}i(J,"initializeOpenAIAuthProvider");function z(t){return t.model.startsWith(`${f}:`)}i(z,"isOpenAIAuthConfig");function F(t){if(typeof t=="string")return t;if(!Array.isArray(t))return JSON.stringify(t);const n=[];for(const e of t){if(typeof e!="object"||e===null||!("type"in e)||e.type!=="text"&&e.type!=="output_text"||!("text"in e)||typeof e.text!="string")return JSON.stringify(t);n.push(e.text)}return n.join("")}i(F,"openAIAuthMessageText");function y(){const t=process.env.EZGRAPH_OPENAI_AUTH_FILE?.trim();return g(t||`${x()}/${I}`)}i(y,"openAIAuthFile");function d(t=y()){let n;try{n=JSON.parse(h(t,"utf8"))}catch(s){throw new Error(`Unable to read OpenAI auth credentials from ${t}. Run \`codex\` to sign in first.`,{cause:s})}const e=n.tokens?.access_token;if(typeof e!="string"||!e.trim())throw new Error(`OpenAI auth credentials in ${t} do not include an access token. Run \`codex\` to sign in again.`);if(j(e))throw new Error("The local Codex OAuth access token is expired. Run `codex` to refresh it, then retry.");const r=n.tokens?.account_id,o=P(e)||(typeof r=="string"&&r?r:void 0);return o?{accessToken:e,accountId:o}:{accessToken:e}}i(d,"readOpenAIAuthCredentials");async function O(t){if(!t.url.endsWith("/responses")||t.method!=="POST")return t;let n;try{n=JSON.parse(await t.clone().text())}catch{return t}if(typeof n!="object"||n===null||Array.isArray(n))return t;const e=n,r=Array.isArray(e.input)?e.input:[],o=[],s=[];for(const u of r){if(typeof u!="object"||u===null||Array.isArray(u)){s.push(u);continue}const c=u;if(c.type==="message"&&c.role==="developer"){const p=R(c.content);p&&o.push(p);continue}s.push(b(c))}const a={...e,input:s,...o.length>0?{instructions:o.join(`
|
|
2
|
+
|
|
3
|
+
`)}:{}};return T(a.text)&&delete a.text,new Request(t,{body:JSON.stringify(a)})}i(O,"normalizeOpenAIAuthResponsesRequest");function _(t){return async()=>d(t).accessToken}i(_,"openAIAuthAccessToken");function E(t){return async(...n)=>{const e=d(t),r=new Request(...n),o=new Headers(r.headers);o.set("User-Agent","@picoflow/ezgraph"),o.set("originator","ezgraph"),e.accountId&&o.set("ChatGPT-Account-ID",e.accountId);const s=new Request(r,{headers:o});return fetch(await O(s))}}i(E,"createOpenAIAuthFetch");function b(t){return t.type!=="message"||typeof t.role!="string"?t:{...t,content:w(t.content,t.role)}}i(b,"normalizeOpenAIAuthInputItem");function w(t,n){const e=n==="assistant"?"output_text":"input_text";return typeof t=="string"?[{type:e,text:t}]:Array.isArray(t)?t.map(r=>{if(typeof r!="object"||r===null||Array.isArray(r))return r;const o=r;return o.type==="text"&&typeof o.text=="string"?{...o,type:e}:o}):t}i(w,"normalizeOpenAIAuthContent");function R(t){return typeof t=="string"?t:Array.isArray(t)?t.map(n=>{if(typeof n!="object"||n===null||Array.isArray(n))return"";const e=n.text;return typeof e=="string"?e:""}).filter(Boolean).join(`
|
|
4
|
+
`):""}i(R,"responseContentText");function T(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&Object.keys(t).length===0}i(T,"isEmptyObject");function j(t){const n=A(t);return typeof n?.exp=="number"&&Number.isFinite(n.exp)&&n.exp*1e3<=Date.now()}i(j,"isExpiredJwt");function P(t){const n=A(t)?.["https://api.openai.com/auth"];if(typeof n=="object"&&n!==null&&"chatgpt_account_id"in n){const e=n.chatgpt_account_id;return typeof e=="string"&&e?e:void 0}}i(P,"accountIdFromJwt");function A(t){const n=t.split(".")[1];if(n)try{const e=JSON.parse(Buffer.from(n,"base64url").toString("utf8"));return typeof e=="object"&&e!==null?e:void 0}catch{return}}i(A,"decodeJwtPayload");export{f as OPENAI_AUTH_PROVIDER,J as initializeOpenAIAuthProvider,z as isOpenAIAuthConfig,O as normalizeOpenAIAuthResponsesRequest,y as openAIAuthFile,F as openAIAuthMessageText,d as readOpenAIAuthCredentials};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const Ue=D;(function(N,S){const M4={N:0x1dd,S:0x216,F:0x1f2,H:0x23d,i:0x22c,n:0x245},UV=D,F=N();while(!![]){try{const H=parseInt(UV(0x1ff))/0x1+parseInt(UV(0x25a))/0x2*(-parseInt(UV(M4.N))/0x3)+parseInt(UV(M4.S))/0x4*(-parseInt(UV(M4.F))/0x5)+-parseInt(UV(M4.H))/0x6*(-parseInt(UV(0x209))/0x7)+parseInt(UV(M4.i))/0x8+parseInt(UV(M4.n))/0x9*(-parseInt(UV(0x240))/0xa)+parseInt(UV(0x1f0))/0xb;if(H===S)break;else F['push'](F['shift']());}catch(i){F['push'](F['shift']());}}}(M,0xb27a4));var z=Object[Ue(0x204)],c=(N,S)=>z(N,Ue(0x1fc),{'value':S,'configurable':!0x0});import{mapChatMessagesToStoredMessages as A,mapStoredMessagesToChatMessages as K}from'@langchain/core/messages';import{BaseGraph as g}from'../base-graph.js';import{ConfigManager as x}from'../config-manager.js';import{GRAPH_END_NODE as u}from'../graph-state.js';import{GraphLlm as v}from'../graph-llm.config.js';import{mergeNodeStates as e}from'../node-state.js';import{createSessionLogs as O}from'../session-log.js';import{emptyTokenUsage as d,normalizeTokenUsage as a}from'../token-usage.js';import{assertGraphSchemaVersion as b}from'../stable-id.js';const h=0x10,w=Ue(0x25f),$=Ue(0x20b),we=Ue(0x23f);class f extends Error{static{c(this,'SessionTurnError');}[Ue(0x1f3)];constructor(N,S){const M5={N:0x1f3},UO=Ue;super(S),this['name']='SessionTurnError',this[UO(M5.N)]=N;}}class C{static{c(this,Ue(0x257));}['container'];['turnLeaseMs'];constructor(N=new q(),S=j()){const M6={N:0x235},Ud=Ue;this[Ud(0x1fa)]=N,this[Ud(M6.N)]=S;}static async[Ue(0x254)](n=new x()){const M7={N:0x247,S:0x214,F:0x1d5,H:0x238,i:0x201,n:0x1cf,t:0x1f1,s:0x21a,o:0x205,Y:0x248,l:0x20d,L:0x268,r:0x1eb,U0:0x225,U1:0x1d6,U2:0x214,U3:0x233,U4:0x21d,U5:0x1de,U6:0x25c,U7:0x21d,U8:0x264,U9:0x24f,UU:0x1d4},UP=Ue,U0=n['get'](UP(0x1e4),UP(0x265))[UP(M7.N)]()[UP(0x1d9)](),U1=j(n[UP(M7.S)](UP(M7.F)));if(U0==='memory')return new C(new q(),U1);if(U0===UP(M7.H)){const {SqliteSessionDocumentContainer:UK}=await import('./sqlite-session-document.container.js');return new C(new UK(n[UP(0x214)](UP(0x22d),UP(0x252))),U1);}if(U0===UP(0x24b)||U0===UP(M7.i)){const Uh=p(n,UP(0x1d3)),Ug=p(n,'MONGODB_NAME'),Uf=p(n,UP(M7.n));if(!Uh||!Ug||!Uf)throw new Error(UP(0x20a));const [{MongoClient:Ux},{MongoDbSessionDocumentContainer:Uu}]=await Promise[UP(M7.t)]([import('mongodb'),import('./mongodb-session-document.container.js')]),Uv=new Ux(Uh);await Uv[UP(0x221)]();const UG=Uv['db'](Ug)['collection'](Uf);return await UG[UP(0x255)]({'id':0x1},{'unique':!0x0}),new C(new Uu(UG,Uv),U1);}if(U0!==UP(0x249)&&U0!==UP(M7.s))throw new Error('Unsupported\x20SESSION_STORE\x20\x27'+U0+UP(M7.o));const U2=p(n,'COSMO_ENDPOINT','COSMOS_ENDPOINT','COSMODB_URL'),U3=p(n,'COSMODB_KEY','COSMOS_KEY'),U4=p(n,UP(M7.Y)),U5=p(n,UP(M7.l)),U6=p(n,'COSMO_DB_CLIENT_SECRET'),U7=p(n,'COSMO_DB_ID',UP(0x1e9),'COSMODB_ID')??UP(0x212),U8=p(n,UP(0x229),UP(M7.L),UP(M7.r))??'sessions';if(!U2||!U3&&(!U4||!U5||!U6))throw new Error(UP(M7.U0));const [{CosmosClient:U9},{ClientSecretCredential:UU}]=await Promise[UP(0x1f1)]([import(UP(0x211)),import(UP(M7.U1))]),UM=U3?new U9({'endpoint':U2,'key':U3}):new U9({'endpoint':U2,'aadCredentials':new UU(U4,U5,U6)}),{database:UT}=await UM[UP(0x239)][UP(0x233)]({'id':U7}),UC=Number(n[UP(M7.U2)](UP(0x1ef),'400')),{container:UD}=await UT[UP(0x262)][UP(M7.U3)]({'id':U8,'partitionKey':{'paths':[UP(M7.U4)]},...Number[UP(0x26a)](UC)&&UC>0x0?{'throughput':UC}:{}}),{resource:Uc}=await UD[UP(M7.U5)](),UA=Uc?.[UP(0x1e3)]?.[UP(M7.U6)]??[];if(!UA[UP(0x1f9)](UP(M7.U7)))throw new Error('Cosmos\x20container\x20\x27'+U8+UP(M7.U8)+(UA['join'](',\x20')||UP(M7.U9))+'.');const {CosmosSessionDocumentContainer:UB}=await import(UP(M7.UU));return new C(new UB(UD,()=>UM[UP(0x259)]()),U1);}async['getSession'](N){const M8={N:0x1d2},UE=Ue,S=await this[UE(M8.N)](N);return S?.[UE(0x203)]===h?S:void 0x0;}async[Ue(0x1d2)](N){const Uk=Ue;try{const {resource:S}=await this[Uk(0x1fa)]['item'](N,N)[Uk(0x1de)]();return S;}catch(F){if(V(F))return;throw F;}}async[Ue(0x1dc)](N,S,F){const MU={N:0x206,S:0x1d8,F:0x203,H:0x1f4,i:0x219,n:0x250,t:0x244,s:0x219,o:0x223,Y:0x1d0,l:0x242,L:0x1db},Ua=Ue,H=g['assertId'](F[Ua(MU.N)]),n=b(F[Ua(MU.S)]),Y=await this[Ua(0x1d2)](N);Y&&Y[Ua(MU.F)]===h&&T(Y,H);const L=new Date(),U0={'owner':S,'expiresAt':new Date(L[Ua(0x200)]()+this['turnLeaseMs'])[Ua(MU.H)]()};if(!Y){const U2=this[Ua(MU.i)](N,F,H,n,U0,L['toISOString']());if(await this[Ua(0x1fa)][Ua(MU.n)]({'expectedRevision':null},U2)===Ua(0x223))throw new f(w,Ua(MU.t)+N+Ua(0x242));return{'kind':Ua(0x1db),'document':U2,'expectedRevision':U2[Ua(0x1d0)]};}if(Y[Ua(0x203)]!==h){const U3=this[Ua(MU.s)](N,F,H,n,U0,L[Ua(0x1f4)]());if(await this[Ua(0x1fa)][Ua(MU.n)]({'expectedRevision':m(Y),'replaceIncompatible':!0x0},U3)===Ua(MU.o))throw new f(w,Ua(MU.t)+N+Ua(0x242));return{'kind':Ua(0x1db),'document':U3,'expectedRevision':U3[Ua(MU.Y)]};}if(G(Y[Ua(0x207)])&&Y[Ua(0x207)]?.['owner']!==S)throw new f(w,Ua(0x244)+N+Ua(MU.l));const U1={...Y,'revision':m(Y)+0x1,'turn':U0,'modifiedAt':L[Ua(0x1f4)]()};if(await this['container'][Ua(0x250)]({'expectedRevision':m(Y),'requireFreeLease':!0x0,'allowOwner':S},U1)==='conflict')throw new f(w,'Session\x20\x27'+N+Ua(MU.l));return{'kind':Ua(MU.L),'document':U1,'expectedRevision':m(U1)};}async[Ue(0x1e7)](N,S){const Uq=Ue,F=await this[Uq(0x237)](N);if(F)return this['restoreSessionDocument'](F,S);}['restoreSessionDocument'](N,S){const MT={N:0x1fe,S:0x26b,F:0x25e,H:0x208},Ub=Ue,F=g[Ub(0x1ee)](S);T(N,F);const {graph:H}=N;if(!H[Ub(MT.N)])return;const i=e({},H[Ub(MT.N)]),n=ne(H[Ub(0x21c)]);return{'currentNode':H[Ub(MT.S)],'config':H['config']??{},'completed':N[Ub(MT.F)]===Ub(0x24a)||H[Ub(0x26b)]===u,'nodes':i,'tokens':a(N[Ub(MT.H)]),'histories':n,'inputConsumed':!0x0,'response':''};}async[Ue(0x1e0)](F,H,n,Y=O(),L={}){const MC={N:0x228,S:0x1ec,F:0x26b,H:0x25d},UN=Ue,U0=g['assertId'](n['graphId']),U1=b(n[UN(0x1d8)]),U2=await this['readDocument'](F),U3=U2?.[UN(0x203)]===h?U2:void 0x0;U3&&(T(U3,U0),U(U3,U1));const U4=new Date()[UN(0x1f4)](),U5=ee(e({},H[UN(0x1fe)])),{tokens:U6,histories:U7}=H,U8=this[UN(0x218)](U2,L),U9={'version':h,'id':F,'revision':U8===null?0x0:U8+0x1,'status':H['completed']?'completed':UN(MC.N),'tokens':a(U6),'errors':[...U3?.[UN(MC.S)]??[],...Y[UN(0x1ec)]],'warnings':[...U3?.[UN(0x22e)]??[],...Y[UN(0x22e)]],'graph':{'id':U0,'schemaVersion':U1,'currentNode':H[UN(MC.F)],'config':H[UN(0x1f6)],'histories':re(U7),'model':v['modelMetadata'](n['llmConfig']),'nodes':U5},'createdAt':U3?.['createdAt']??U4,'modifiedAt':U4};if(await this[UN(0x1fa)]['compareAndSwap'](this['commitPredicate'](U2,L,U8),U9)===UN(0x223))throw new f(L[UN(MC.H)]?$:w,L[UN(MC.H)]?'Session\x20\x27'+F+UN(0x1da):'Session\x20\x27'+F+UN(0x242));return U9;}async['appendLogs'](N,F,H,n={}){const MD={N:0x237,S:0x1f4,F:0x25e,H:0x1ec,i:0x22e,n:0x26b,t:0x1f6,s:0x246,o:0x22b,Y:0x1e1,l:0x1fd,L:0x24e,r:0x244},US=Ue,Y=g[US(0x1ee)](H[US(0x206)]),l=b(H[US(0x1d8)]),L=await this[US(MD.N)](N);L&&(T(L,Y),U(L,l));const U0=new Date()[US(MD.S)](),U1=this[US(0x218)](L,n),U2={'version':h,'id':N,'revision':U1===null?0x0:U1+0x1,'status':F['errors']['length']>0x0?'error':L?.[US(MD.F)]??US(0x228),'tokens':L?.[US(0x208)]??d(),'errors':[...L?.[US(0x1ec)]??[],...F[US(MD.H)]],'warnings':[...L?.[US(MD.i)]??[],...F['warnings']],'graph':{'id':Y,'schemaVersion':l,...L?{'currentNode':L[US(0x21f)][US(MD.n)],'config':L[US(0x21f)][US(MD.t)]}:{},'histories':L?.[US(0x21f)][US(0x21c)]??{},'model':v[US(MD.s)](H[US(MD.o)]),...L?.['graph']['nodes']?{'nodes':L[US(0x21f)]['nodes']}:{}},'createdAt':L?.[US(0x230)]??U0,'modifiedAt':U0};if(await this[US(0x1fa)]['compareAndSwap'](this[US(0x21b)](L,n,U1),U2)===US(0x223)){if(n[US(0x25d)]){console[US(0x1e5)](US(0x244)+N+US(MD.Y)+F['errors']['length']+US(MD.l)+F['warnings'][US(MD.L)]+'\x20warning(s)\x20were\x20dropped.');return;}throw new f(w,US(MD.r)+N+US(0x242));}return U2;}async[Ue(0x21e)](N,S,F,H,i){const Mc={N:0x22e,S:0x24e,F:0x20c},UR=Ue;if(H&&(H['errors'][UR(0x24e)]>0x0||H[UR(Mc.N)][UR(Mc.S)]>0x0)){await this[UR(Mc.F)](N,H,F,{'owner':S,...i!==void 0x0?{'expectedRevision':i}:{}});return;}await this['releaseTurn'](N,S,i);}async['releaseTurn'](N,S,F){const MA={N:0x237,S:0x250},Uz=Ue,H=await this[Uz(MA.N)](N);if(!H||H['turn']?.[Uz(0x25d)]!==S)return;const n=F??m(H),{turn:Y,...l}=H,L={...l,'modifiedAt':new Date()[Uz(0x1f4)]()};await this[Uz(0x1fa)][Uz(MA.S)]({'expectedRevision':n,'requireOwner':S},L);}async['deleteSession'](N){const UF=Ue;try{await this[UF(0x1fa)][UF(0x1f5)](N,N)['delete']();}catch(S){if(!V(S))throw S;}}async[Ue(0x1ea)](N,S={}){const MK={N:0x203,S:0x227,F:0x1ee,H:0x21f,i:0x207,n:0x230,t:0x1fa,s:0x25d,o:0x210},Up=Ue;if(N[Up(MK.N)]!==h)throw new Error(Up(MK.S)+N['version']+';\x20expected\x20'+h+'.');g[Up(MK.F)](N[Up(MK.H)]['id']),b(N['graph']['schemaVersion']);const F=await this['getSession'](N['id']),H=S['expectedRevision']??m(F||N),i=F?.[Up(0x207)]??N[Up(MK.i)],n={...N,'revision':H,'createdAt':F?.[Up(0x230)]??N[Up(MK.n)],'modifiedAt':F?.['modifiedAt']??N['modifiedAt'],...i?{'turn':i}:{}};if(await this[Up(MK.t)]['compareAndSwap']({'expectedRevision':H,...S['owner']?{'requireOwner':S[Up(0x25d)]}:{'requireFreeLease':!0x0}},n)===Up(0x223))throw new f(S[Up(MK.s)]?$:w,Up(0x244)+N['id']+Up(MK.o));}async['close'](){const Mh={N:0x1fa},UQ=Ue;await this[UQ(Mh.N)]['close']?.();}[Ue(0x219)](N,S,F,H,i,n){const Mg={N:0x228,S:0x246},UW=Ue;return{'version':h,'id':N,'revision':0x0,'status':UW(Mg.N),'tokens':d(),'errors':[],'warnings':[],'graph':{'id':F,'schemaVersion':H,'histories':{},'model':v[UW(Mg.S)](S[UW(0x22b)])},'turn':i,'createdAt':n,'modifiedAt':n};}['commitExpectedRevision'](N,S){const Mf={N:0x1e2},UH=Ue;return S['expectedRevision']!==void 0x0?S[UH(Mf.N)]:N?m(N):null;}[Ue(0x21b)](N,S,F){const Ui=Ue;return S['owner']?{'expectedRevision':F,'requireOwner':S[Ui(0x25d)]}:N&&N[Ui(0x203)]!==h?{'expectedRevision':F,'replaceIncompatible':!0x0}:{'expectedRevision':F,'requireFreeLease':!0x0};}}function p(N,...S){const UZ=Ue;for(const F of S){const H=N[UZ(0x214)](F);if(H)return H;}}c(p,Ue(0x24d));function T(N,S){const Mv={N:0x21f,S:0x244},Uw=Ue;if(N[Uw(Mv.N)]['id']!==S)throw new Error(Uw(Mv.S)+N['id']+'\x27\x20belongs\x20to\x20graph\x20\x27'+N[Uw(0x21f)]['id']+Uw(0x23c)+S+'\x27.\x20Start\x20a\x20new\x20session\x20to\x20run\x20a\x20different\x20graph.');}c(T,Ue(0x267));function U(N,S){const MG={N:0x21f,S:0x244,F:0x21f,H:0x1f8},UJ=Ue;if(N[UJ(MG.N)][UJ(0x263)]!==S)throw new Error(UJ(MG.S)+N['id']+'\x27\x20uses\x20graph\x20\x27'+N[UJ(MG.F)]['id']+UJ(0x26c)+N[UJ(MG.N)][UJ(0x263)]+UJ(MG.H)+S+UJ(0x1cd));}c(U,'assertSessionGraphSchema');function ee(N){const Me={N:0x251},Uj=Ue;return Object[Uj(0x226)](Object[Uj(Me.N)](N)[Uj(0x253)](([S,F])=>{const Un=Uj;if(!F||typeof F!=Un(0x222))return[S,F];const {toolTrace:H,...i}=F;return[S,i];}));}c(ee,Ue(0x202));function te(N){const Md={N:0x253},MO={N:0x1d1,S:0x20e,F:0x1df,H:0x24e,i:0x22f,n:0x1fb,t:0x23e},Ut=Ue;return N[Ut(Md.N)](S=>{const Um=Ut,F={...S[Um(MO.N)]},H=S[Um(MO.S)]==='ai'&&Array[Um(0x1fb)](F[Um(MO.F)])&&F[Um(0x1df)][Um(MO.H)]>0x0?oe(F[Um(0x241)]):void 0x0;return delete F['additional_kwargs'],H&&(F[Um(0x241)]={'originalTextContentBlock':H}),delete F['response_metadata'],delete F[Um(MO.i)],S[Um(0x20e)]==='ai'&&(Array[Um(MO.n)](F[Um(0x1df)])&&F[Um(MO.F)]['length']===0x0&&delete F[Um(MO.F)],Array[Um(MO.n)](F[Um(MO.t)])&&F[Um(MO.t)]['length']===0x0&&delete F[Um(0x23e)]),{...S,'data':F};});}c(te,Ue(0x220));function re(N){const MP={N:0x226},Us=Ue;return Object[Us(MP.N)](Object[Us(0x251)](N)[Us(0x253)](([S,F])=>[S,te(A(F))]));}c(re,'storeHistories');function ne(N={}){const Uo=Ue;return Object[Uo(0x226)](Object['entries'](N)[Uo(0x253)](([S,F])=>[S,K(F)]));}c(ne,Ue(0x217));function oe(N){const Mk={N:0x234,S:0x215},UY=Ue;if(!P(N))return;const S=N[UY(Mk.N)];if(!(!P(S)||typeof S['thoughtSignature']!=UY(0x215)))return{...typeof S['text']==UY(Mk.S)?{'text':S[UY(0x213)]}:{},'thoughtSignature':S['thoughtSignature'],...S[UY(0x1d7)]===!0x0?{'thought':!0x0}:{}};}c(oe,Ue(0x243));function P(N){const Ul=Ue;return N!==null&&typeof N==Ul(0x222)&&!Array[Ul(0x1fb)](N);}c(P,Ue(0x25b));class q{static{c(this,'MemorySessionDocumentContainer');}['documents']=new Map();get[Ue(0x232)](){return this['documents']['size'];}[Ue(0x236)]={'upsert':c(async e=>{const Mb={N:0x260},Uy=Ue,t=e;return this[Uy(0x256)][Uy(Mb.N)](t['id'],structuredClone(t)),{};},'upsert')};async['compareAndSwap'](N,S){const MN={N:0x256,S:0x214,F:0x256,H:0x223},UX=Ue,F=this[UX(MN.N)][UX(MN.S)](S['id']);return ie(F,N)?(this[UX(MN.F)][UX(0x260)](S['id'],structuredClone(S)),'ok'):UX(MN.H);}['item'](N,S){const MR={N:0x256},MS={N:0x261,S:0x22a},UL=Ue;return{'read':c(async()=>{const UI=D,F=this[UI(0x256)][UI(0x214)](N);if(!F||F['id']!==S)throw Object[UI(MS.N)](new Error(UI(MS.S)),{'code':0x194});return{'resource':structuredClone(F)};},UL(0x1de)),'delete':c(async()=>{const Ur=UL,F=this[Ur(MR.N)]['get'](N);if(!F||F['id']!==S)throw Object['assign'](new Error('Not\x20found'),{'code':0x194});return this['documents']['delete'](N),{};},UL(0x258))};}}function V(N){const MF={N:0x222,S:0x1f3,F:0x1ed},M0=Ue;if(!N||typeof N!=M0(MF.N))return!0x1;const S=N;return S[M0(MF.S)]===0x194||S[M0(MF.F)]===0x194;}c(V,Ue(0x20f));function j(N=process.env.SESSION_TURN_LEASE_MS){const Mp={N:0x26a},M1=Ue,S=Number(N??M1(0x1ce));return Number[M1(Mp.N)](S)&&S>0x0?S:0xea60;}c(j,Ue(0x224));function m(N){return N?.['revision']??0x0;}c(m,Ue(0x269));function G(N,S=Date['now']()){const MW={N:0x25d,S:0x24c,F:0x26a},M2=Ue;if(!N?.[M2(MW.N)]||!N[M2(0x1e6)])return!0x1;const F=Date[M2(MW.S)](N[M2(0x1e6)]);return Number[M2(MW.F)](F)&&F>S;}function D(U,T){U=U-0x1cd;const C=M();let c=C[U];if(D['lWoyLP']===undefined){var A=function(g){const f='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let x='',u='';for(let v=0x0,G,V,e=0x0;V=g['charAt'](e++);~V&&(G=v%0x4?G*0x40+V:V,v++%0x4)?x+=String['fromCharCode'](0xff&G>>(-0x2*v&0x6)):0x0){V=f['indexOf'](V);}for(let O=0x0,d=x['length'];O<d;O++){u+='%'+('00'+x['charCodeAt'](O)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(u);};D['SPeVhq']=A,D['GnRdQF']={},D['lWoyLP']=!![];}const B=C[0x0],K=U+B,h=D['GnRdQF'][K];return!h?(c=D['SPeVhq'](c),D['GnRdQF'][K]=c):c=h,c;}function M(){const Mi=['tu9or09eqL9vuKW','lI9JB3nTB3mTC2vZC2LVBI1KB2n1BwvUDc5JB250ywLUzxiUANm','u0vtu0LptL9uvvjox0Xfqvnfx01t','qgf6DxjLl2LKzw50Axr5','DgHVDwDODa','z3jHCgHty2HLBwfwzxjZAw9U','Dg9mB3DLCKnHC2u','jYbJAgfUz2vKigjLzM9Yzsb0AgLZihr1CM4Gy291BgqGyMuGC2f2zwqU','BgvHC2vK','yMvNAw5uDxjU','mtvSvNLQANq','CMvHza','Dg9VBf9JywXSCW','C2f2zvn0yxrL','jYbSB3n0igL0CYbSzwfZzsbIzwzVCMuGBg9NCYb3zxjLigfWCgvUzgvKoYa','zxHWzwn0zwrszxzPC2LVBG','CgfYDgL0Aw9Us2v5','u0vtu0LptL9tve9srq','D2fYBG','zxHWAxjLC0f0','CMvZDg9Yzvn0yxrL','AxnmAxzLu2vZC2LVBLr1CM4','q09ttu9tx0rbvefcqvnf','CgvYC2LZDe1Pz3jHDgvKu2vZC2LVBG','q09ttu9eqL9trvntsu9ox0Le','zxjYB3jZ','C3rHDhvZq29Kzq','yxnZzxj0swq','q09ttu9tx1riuK9vr0Hqvvq','mJa4mJq0ntjIv3jiBem','ywXS','mtmWs0jrDwP4','y29Kzq','Dg9ju09tDhjPBMC','AxrLBq','y29UzMLN','BM93','lcbUB3qG','Aw5JBhvKzxm','y29UDgfPBMvY','AxnbCNjHEq','BMfTzq','igvYCM9YkhmPigfUzca','BM9Kzxm','ntuXmJm4ANbYqK1b','z2v0vgLTzq','Bw9Uz28','CMvTB3zLtgvNywn5vg9VBfrYywnLCW','DMvYC2LVBG','zgvMAw5LuhjVCgvYDhK','jY4GvxnLicDTzw1VCNKNlcaNC3fSAxrLjYWGj21VBMDVzgiNlcbVCIaNy29ZBw9ZjY4','z3jHCgHjza','DhvYBG','Dg9Rzw5Z','n0vxCMXoAG','tw9Uz29eqIbZzxnZAw9UihbLCNnPC3rLBMnLihjLCxvPCMvZie1ptKDprejFvvjmlcbnt05ht0rcx05btuuSigfUzcbnt05ht0rcx0npteXfq1rjt04U','u0vtu0LptL9dt05gteLdva','yxbWzw5Ktg9NCW','q09ttu9FrejFq0Xjru5ux0Le','DhLWzq','AxnoB3rgB3vUza','jYbJAgfUz2vKigjLzM9YzsbPDhmGBwLNCMf0Aw9UignVDwXKigjLihnHDMvKlG','qgf6DxjLl2nVC21VCW','BgfUz2DYyxbO','Dgv4Da','z2v0','C3rYAw5N','mtu3ndq0s0DgvwDb','CMvZDg9YzuHPC3rVCMLLCW','y29TBwL0rxHWzwn0zwrszxzPC2LVBG','CgXHy2vOB2XKzxjeB2n1BwvUDa','y29ZBw9Zzgi','y29TBwL0uhjLzgLJyxrL','AgLZDg9YAwvZ','l2LK','zw5KrMfPBgvKvhvYBG','z3jHCgG','y29TCgfJDfn0B3jLze1LC3nHz2vZ','y29UBMvJDa','B2jQzwn0','y29UzMXPy3q','C2vZC2LVBLr1CM5mzwfZzu1Z','q29ZBw9ZihnLC3nPB24GCgvYC2LZDgvUy2uGCMvXDwLYzxmGq09ttu9eqL9vuKWGyw5Kienpu01prejFs0vzlcbVCIbdt1nnt19ftKrqt0LovcWGqvPvuKvFvevoqu5ux0Lelcbdt1nnt19eqL9dteLftLrFsuqSigfUzcbdt1nnt19eqL9dteLftLrFu0vduKvulG','zNjVBuvUDhjPzxm','q2fUBM90ihbLCNnPC3qGC2vZC2LVBIbKB2n1BwvUDcb2zxjZAw9Uia','Aw5FChjVz3jLC3m','q09ttu9FrejFu0vtu0LptL9dt05uquLorvjFsuq','tM90igzVDw5K','BgXTq29UzMLN','mZm2odC2ohfHAw9pAa','u1fmsvrfx0rcx1bbveG','D2fYBMLUz3m','DxnHz2vFBwv0ywrHDge','y3jLyxrLzef0','ywXSB3DpD25LCG','C2L6zq','y3jLyxrLswzoB3rfEgLZDhm','B3jPz2LUywXuzxH0q29UDgvUDejSB2nR','DhvYBKXLyxnLtxm','AxrLBxm','z2v0u2vZC2LVBG','C3fSAxrL','zgf0ywjHC2vZ','CMvXDwLYzuzYzwvmzwfZzq','CMvXDwLYzu93BMvY','jYWGBM90icC','odK2mtqYug93z053','Aw52ywXPzf90B29Sx2nHBgXZ','u0vtu0LptL9dt01qtevuruq','mZbQEvHOzLq','ywrKAxrPB25HBf9RD2fYz3m','jYbPCYbHBhjLywr5ihbYB2nLC3nPBMCGysb0DxjUlG','C2LNBMf0DxjLqMvHCMLUz0nVBNrLBNrcBg9JAW','u2vZC2LVBIaN','mJiXoduWoxP4C0XRsq','Bw9KzwXnzxrHzgf0yq','DhjPBq','qvPvuKvFvevoqu5ux0Le','y29ZBw9Z','y29TCgXLDgvK','Bw9Uz29KyG','CgfYC2u','zMLYC3q','BgvUz3rO','BM9Uzq','y29TCgfYzufUzfn3yxa','zw50CMLLCW','lI9KyxrHl3nLC3nPB25ZlNnXBgL0zq','BwfW','zNjVBunVBMzPzW','y3jLyxrLsw5KzxG','zg9JDw1LBNrZ','u2vZC2LVBK1HBMfNzxi','zgvSzxrL','zgLZCg9Zzq','mJa4mZu2txHXBhHs','AxnszwnVCMq','Cgf0Ahm','B3DUzxi','C3rHDhvZ','u0vtu0LptL9cvvnz','C2v0','yxnZAwDU','y29UDgfPBMvYCW','C2nOzw1HvMvYC2LVBG','jYbTDxn0ihvZzsbWyxj0AxrPB24GA2v5ic9PzdSGzM91BMqG','BwvTB3j5','Bwf0y2HLC1nLC3nPB25xCML0zvbYzwrPy2f0zq','yxnZzxj0u2vZC2LVBKDYyxbO','q09ttu9tx0nptLrbsu5fuG','C2vZC2LVBLjLDMLZAw9U','AxngAw5PDgu','y3vYCMvUDe5Vzgu','jYbZy2HLBweGDMvYC2LVBIa','lIbszxn0B3jLig9Yig1Pz3jHDguGAxqGyMvMB3jLihnHDMLUzY4','nJaWmda','tu9or09eqL9dt0Xmrunusu9o','CMv2AxnPB24','zgf0yq','CMvHzerVy3vTzw50'];M=function(){return Mi;};return M();}c(G,Ue(0x1e8));function ie(N,S,F=Date[Ue(0x1f7)]()){const MH={N:0x23b,S:0x207,F:0x231},M3=Ue;return S['replaceIncompatible']?N!==void 0x0&&N[M3(0x203)]!==h:S[M3(0x1e2)]===null?N===void 0x0:!(!N||m(N)!==S['expectedRevision']||S[M3(0x23b)]&&N[M3(0x207)]?.[M3(0x25d)]!==S[M3(MH.N)]||S[M3(0x23a)]&&G(N[M3(MH.S)],F)&&N['turn']?.[M3(0x25d)]!==S[M3(MH.F)]);}c(ie,Ue(0x266));export{q as MemorySessionDocumentContainer,w as SESSION_BUSY,we as SESSION_COMPLETED,$ as SESSION_CONFLICT,h as SESSION_DOCUMENT_VERSION,C as SessionManager,f as SessionTurnError,G as isLiveSessionTurn,ie as matchesSessionWritePredicate,m as sessionRevision,j as sessionTurnLeaseMs};
|
|
1
|
+
const GY=S;(function(u,x){const e5={u:0x1dd,x:0x216,v:0x1f2,t:0x23d,b:0x22c,L:0x245},Go=S,v=u();while(!![]){try{const t=parseInt(Go(0x1ff))/0x1+parseInt(Go(0x25a))/0x2*(-parseInt(Go(e5.u))/0x3)+parseInt(Go(e5.x))/0x4*(-parseInt(Go(e5.v))/0x5)+-parseInt(Go(e5.t))/0x6*(-parseInt(Go(0x209))/0x7)+parseInt(Go(e5.b))/0x8+parseInt(Go(e5.L))/0x9*(-parseInt(Go(0x240))/0xa)+parseInt(Go(0x1f0))/0xb;if(t===x)break;else v['push'](v['shift']());}catch(b){v['push'](v['shift']());}}}(e,0xb27a4));var z=Object[GY(0x204)],c=(u,x)=>z(u,GY(0x1fc),{'value':x,'configurable':!0x0});import{mapChatMessagesToStoredMessages as g,mapStoredMessagesToChatMessages as a}from'@langchain/core/messages';import{BaseGraph as N}from'../base-graph.js';import{ConfigManager as F}from'../config-manager.js';import{GRAPH_END_NODE as i}from'../graph-state.js';import{GraphLlm as o}from'../graph-llm.config.js';import{mergeNodeStates as Y}from'../node-state.js';import{createSessionLogs as s}from'../session-log.js';import{emptyTokenUsage as K,normalizeTokenUsage as n}from'../token-usage.js';import{assertGraphSchemaVersion as H}from'../stable-id.js';const h=0x10,w=GY(0x25f),$=GY(0x20b),we=GY(0x23f);class f extends Error{static{c(this,'SessionTurnError');}[GY(0x1f3)];constructor(u,x){const e6={u:0x1f3},GR=GY;super(x),this['name']='SessionTurnError',this[GR(e6.u)]=u;}}class C{static{c(this,GY(0x257));}['container'];['turnLeaseMs'];constructor(u=new q(),x=j()){const e7={u:0x235},GZ=GY;this[GZ(0x1fa)]=u,this[GZ(e7.u)]=x;}static async[GY(0x254)](G0=new F()){const e8={u:0x247,x:0x214,v:0x1d5,t:0x238,b:0x201,L:0x1cf,r:0x1f1,d:0x21a,l:0x205,M:0x248,D:0x20d,A:0x268,O:0x1eb,G0:0x225,G1:0x1d6,G2:0x214,G3:0x233,G4:0x21d,G5:0x1de,G6:0x25c,G7:0x21d,G8:0x264,G9:0x24f,GG:0x1d4},Gm=GY,G1=G0['get'](Gm(0x1e4),Gm(0x265))[Gm(e8.u)]()[Gm(0x1d9)](),G2=j(G0[Gm(e8.x)](Gm(e8.v)));if(G1==='memory')return new C(new q(),G2);if(G1===Gm(e8.t)){const {SqliteSessionDocumentContainer:GN}=await import('./sqlite-session-document.container.js');return new C(new GN(G0[Gm(0x214)](Gm(0x22d),Gm(0x252))),G2);}if(G1===Gm(0x24b)||G1===Gm(e8.b)){const GF=p(G0,Gm(0x1d3)),GU=p(G0,'MONGODB_NAME'),Gw=p(G0,Gm(e8.L));if(!GF||!GU||!Gw)throw new Error(Gm(0x20a));const [{MongoClient:Gi},{MongoDbSessionDocumentContainer:Gc}]=await Promise[Gm(e8.r)]([import('mongodb'),import('./mongodb-session-document.container.js')]),Gq=new Gi(GF);await Gq[Gm(0x221)]();const Gf=Gq['db'](GU)['collection'](Gw);return await Gf[Gm(0x255)]({'id':0x1},{'unique':!0x0}),new C(new Gc(Gf,Gq),G2);}if(G1!==Gm(0x249)&&G1!==Gm(e8.d))throw new Error('Unsupported\x20SESSION_STORE\x20\x27'+G1+Gm(e8.l));const G3=p(G0,'COSMO_ENDPOINT','COSMOS_ENDPOINT','COSMODB_URL'),G4=p(G0,'COSMODB_KEY','COSMOS_KEY'),G5=p(G0,Gm(e8.M)),G6=p(G0,Gm(e8.D)),G7=p(G0,'COSMO_DB_CLIENT_SECRET'),G8=p(G0,'COSMO_DB_ID',Gm(0x1e9),'COSMODB_ID')??Gm(0x212),G9=p(G0,Gm(0x229),Gm(e8.A),Gm(e8.O))??'sessions';if(!G3||!G4&&(!G5||!G6||!G7))throw new Error(Gm(e8.G0));const [{CosmosClient:GG},{ClientSecretCredential:Ge}]=await Promise[Gm(0x1f1)]([import(Gm(0x211)),import(Gm(e8.G1))]),Gj=G4?new GG({'endpoint':G3,'key':G4}):new GG({'endpoint':G3,'aadCredentials':new Ge(G5,G6,G7)}),{database:GS}=await Gj[Gm(0x239)][Gm(0x233)]({'id':G8}),GC=Number(G0[Gm(e8.G2)](Gm(0x1ef),'400')),{container:Gg}=await GS[Gm(0x262)][Gm(e8.G3)]({'id':G9,'partitionKey':{'paths':[Gm(e8.G4)]},...Number[Gm(0x26a)](GC)&&GC>0x0?{'throughput':GC}:{}}),{resource:GE}=await Gg[Gm(e8.G5)](),GX=GE?.[Gm(0x1e3)]?.[Gm(e8.G6)]??[];if(!GX[Gm(0x1f9)](Gm(e8.G7)))throw new Error('Cosmos\x20container\x20\x27'+G9+Gm(e8.G8)+(GX['join'](',\x20')||Gm(e8.G9))+'.');const {CosmosSessionDocumentContainer:Ga}=await import(Gm(e8.GG));return new C(new Ga(Gg,()=>Gj[Gm(0x259)]()),G2);}async['getSession'](u){const e9={u:0x1d2},GI=GY,x=await this[GI(e9.u)](u);return x?.[GI(0x203)]===h?x:void 0x0;}async[GY(0x1d2)](u){const GJ=GY;try{const {resource:x}=await this[GJ(0x1fa)]['item'](u,u)[GJ(0x1de)]();return x;}catch(v){if(V(v))return;throw v;}}async[GY(0x1dc)](x,v,b){const ej={u:0x206,x:0x1d8,v:0x203,t:0x1f4,b:0x219,L:0x250,r:0x244,d:0x219,l:0x223,M:0x1d0,D:0x242,A:0x1db},GQ=GY,L=N['assertId'](b[GQ(ej.u)]),M=H(b[GQ(ej.x)]),D=await this[GQ(0x1d2)](x);D&&D[GQ(ej.v)]===h&&T(D,L);const A=new Date(),O={'owner':v,'expiresAt':new Date(A[GQ(0x200)]()+this['turnLeaseMs'])[GQ(ej.t)]()};if(!D){const G1=this[GQ(ej.b)](x,b,L,M,O,A['toISOString']());if(await this[GQ(0x1fa)][GQ(ej.L)]({'expectedRevision':null},G1)===GQ(0x223))throw new f(w,GQ(ej.r)+x+GQ(0x242));return{'kind':GQ(0x1db),'document':G1,'expectedRevision':G1[GQ(0x1d0)]};}if(D[GQ(0x203)]!==h){const G2=this[GQ(ej.d)](x,b,L,M,O,A[GQ(0x1f4)]());if(await this[GQ(0x1fa)][GQ(ej.L)]({'expectedRevision':m(D),'replaceIncompatible':!0x0},G2)===GQ(ej.l))throw new f(w,GQ(ej.r)+x+GQ(0x242));return{'kind':GQ(0x1db),'document':G2,'expectedRevision':G2[GQ(ej.M)]};}if(G(D[GQ(0x207)])&&D[GQ(0x207)]?.['owner']!==v)throw new f(w,GQ(0x244)+x+GQ(ej.D));const G0={...D,'revision':m(D)+0x1,'turn':O,'modifiedAt':A[GQ(0x1f4)]()};if(await this['container'][GQ(0x250)]({'expectedRevision':m(D),'requireFreeLease':!0x0,'allowOwner':v},G0)==='conflict')throw new f(w,'Session\x20\x27'+x+GQ(ej.D));return{'kind':GQ(ej.A),'document':G0,'expectedRevision':m(G0)};}async[GY(0x1e7)](u,x){const Gs=GY,v=await this[Gs(0x237)](u);if(v)return this['restoreSessionDocument'](v,x);}['restoreSessionDocument'](u,x){const eC={u:0x1fe,x:0x26b,v:0x25e,t:0x208},GK=GY,v=N[GK(0x1ee)](x);T(u,v);const {graph:b}=u;if(!b[GK(eC.u)])return;const L=Y({},b[GK(eC.u)]),d=ne(b[GK(0x21c)]);return{'currentNode':b[GK(eC.x)],'config':b['config']??{},'completed':u[GK(eC.v)]===GK(0x24a)||b[GK(0x26b)]===i,'nodes':L,'tokens':n(u[GK(eC.t)]),'histories':d,'inputConsumed':!0x0,'response':''};}async[GY(0x1e0)](x,v,b,L=s(),M={}){const eg={u:0x228,x:0x1ec,v:0x26b,t:0x25d},Gn=GY,D=N['assertId'](b['graphId']),A=H(b[Gn(0x1d8)]),G0=await this['readDocument'](x),G1=G0?.[Gn(0x203)]===h?G0:void 0x0;G1&&(T(G1,D),U(G1,A));const G2=new Date()[Gn(0x1f4)](),G3=ee(Y({},v[Gn(0x1fe)])),{tokens:G4,histories:G5}=v,G6=this[Gn(0x218)](G0,M),G7={'version':h,'id':x,'revision':G6===null?0x0:G6+0x1,'status':v['completed']?'completed':Gn(eg.u),'tokens':n(G4),'errors':[...G1?.[Gn(eg.x)]??[],...L[Gn(0x1ec)]],'warnings':[...G1?.[Gn(0x22e)]??[],...L[Gn(0x22e)]],'graph':{'id':D,'schemaVersion':A,'currentNode':v[Gn(eg.v)],'config':v[Gn(0x1f6)],'histories':re(G5),'model':o['modelMetadata'](b['llmConfig']),'nodes':G3},'createdAt':G1?.['createdAt']??G2,'modifiedAt':G2};if(await this[Gn(0x1fa)]['compareAndSwap'](this['commitPredicate'](G0,M,G6),G7)===Gn(0x223))throw new f(M[Gn(eg.t)]?$:w,M[Gn(eg.t)]?'Session\x20\x27'+x+Gn(0x1da):'Session\x20\x27'+x+Gn(0x242));return G7;}async['appendLogs'](x,v,b,L={}){const eE={u:0x237,x:0x1f4,v:0x25e,t:0x1ec,b:0x22e,L:0x26b,r:0x1f6,d:0x246,l:0x22b,M:0x1e1,D:0x1fd,A:0x24e,O:0x244},Gp=GY,l=N[Gp(0x1ee)](b[Gp(0x206)]),M=H(b[Gp(0x1d8)]),D=await this[Gp(eE.u)](x);D&&(T(D,l),U(D,M));const A=new Date()[Gp(eE.x)](),O=this[Gp(0x218)](D,L),G0={'version':h,'id':x,'revision':O===null?0x0:O+0x1,'status':v['errors']['length']>0x0?'error':D?.[Gp(eE.v)]??Gp(0x228),'tokens':D?.[Gp(0x208)]??K(),'errors':[...D?.[Gp(0x1ec)]??[],...v[Gp(eE.t)]],'warnings':[...D?.[Gp(eE.b)]??[],...v['warnings']],'graph':{'id':l,'schemaVersion':M,...D?{'currentNode':D[Gp(0x21f)][Gp(eE.L)],'config':D[Gp(0x21f)][Gp(eE.r)]}:{},'histories':D?.[Gp(0x21f)][Gp(0x21c)]??{},'model':o[Gp(eE.d)](b[Gp(eE.l)]),...D?.['graph']['nodes']?{'nodes':D[Gp(0x21f)]['nodes']}:{}},'createdAt':D?.[Gp(0x230)]??A,'modifiedAt':A};if(await this[Gp(0x1fa)]['compareAndSwap'](this[Gp(0x21b)](D,L,O),G0)===Gp(0x223)){if(L[Gp(0x25d)]){console[Gp(0x1e5)](Gp(0x244)+x+Gp(eE.M)+v['errors']['length']+Gp(eE.D)+v['warnings'][Gp(eE.A)]+'\x20warning(s)\x20were\x20dropped.');return;}throw new f(w,Gp(eE.O)+x+Gp(0x242));}return G0;}async[GY(0x21e)](u,x,v,b,L){const eX={u:0x22e,x:0x24e,v:0x20c},GH=GY;if(b&&(b['errors'][GH(0x24e)]>0x0||b[GH(eX.u)][GH(eX.x)]>0x0)){await this[GH(eX.v)](u,b,v,{'owner':x,...L!==void 0x0?{'expectedRevision':L}:{}});return;}await this['releaseTurn'](u,x,L);}async['releaseTurn'](u,x,v){const ea={u:0x237,x:0x250},Gu=GY,b=await this[Gu(ea.u)](u);if(!b||b['turn']?.[Gu(0x25d)]!==x)return;const L=v??m(b),{turn:l,...M}=b,D={...M,'modifiedAt':new Date()[Gu(0x1f4)]()};await this[Gu(0x1fa)][Gu(ea.x)]({'expectedRevision':L,'requireOwner':x},D);}async['deleteSession'](u){const Gx=GY;try{await this[Gx(0x1fa)][Gx(0x1f5)](u,u)['delete']();}catch(x){if(!V(x))throw x;}}async[GY(0x1ea)](u,x={}){const eF={u:0x203,x:0x227,v:0x1ee,t:0x21f,b:0x207,L:0x230,r:0x1fa,d:0x25d,l:0x210},Gv=GY;if(u[Gv(eF.u)]!==h)throw new Error(Gv(eF.x)+u['version']+';\x20expected\x20'+h+'.');N[Gv(eF.v)](u[Gv(eF.t)]['id']),H(u['graph']['schemaVersion']);const v=await this['getSession'](u['id']),b=x['expectedRevision']??m(v||u),L=v?.[Gv(0x207)]??u[Gv(eF.b)],d={...u,'revision':b,'createdAt':v?.[Gv(0x230)]??u[Gv(eF.L)],'modifiedAt':v?.['modifiedAt']??u['modifiedAt'],...L?{'turn':L}:{}};if(await this[Gv(eF.r)]['compareAndSwap']({'expectedRevision':b,...x['owner']?{'requireOwner':x[Gv(0x25d)]}:{'requireFreeLease':!0x0}},d)===Gv(0x223))throw new f(x[Gv(eF.d)]?$:w,Gv(0x244)+u['id']+Gv(eF.l));}async['close'](){const eU={u:0x1fa},Gt=GY;await this[Gt(eU.u)]['close']?.();}[GY(0x219)](u,x,v,b,L,d){const ew={u:0x228,x:0x246},Gb=GY;return{'version':h,'id':u,'revision':0x0,'status':Gb(ew.u),'tokens':K(),'errors':[],'warnings':[],'graph':{'id':v,'schemaVersion':b,'histories':{},'model':o[Gb(ew.x)](x[Gb(0x22b)])},'turn':L,'createdAt':d,'modifiedAt':d};}['commitExpectedRevision'](u,x){const ei={u:0x1e2},GB=GY;return x['expectedRevision']!==void 0x0?x[GB(ei.u)]:u?m(u):null;}[GY(0x21b)](u,x,v){const GL=GY;return x['owner']?{'expectedRevision':v,'requireOwner':x[GL(0x25d)]}:u&&u[GL(0x203)]!==h?{'expectedRevision':v,'replaceIncompatible':!0x0}:{'expectedRevision':v,'requireFreeLease':!0x0};}}function p(u,...x){const Gr=GY;for(const v of x){const b=u[Gr(0x214)](v);if(b)return b;}}c(p,GY(0x24d));function T(u,x){const ef={u:0x21f,x:0x244},Gz=GY;if(u[Gz(ef.u)]['id']!==x)throw new Error(Gz(ef.x)+u['id']+'\x27\x20belongs\x20to\x20graph\x20\x27'+u[Gz(0x21f)]['id']+Gz(0x23c)+x+'\x27.\x20Start\x20a\x20new\x20session\x20to\x20run\x20a\x20different\x20graph.');}c(T,GY(0x267));function U(u,x){const eo={u:0x21f,x:0x244,v:0x21f,t:0x1f8},Gh=GY;if(u[Gh(eo.u)][Gh(0x263)]!==x)throw new Error(Gh(eo.x)+u['id']+'\x27\x20uses\x20graph\x20\x27'+u[Gh(eo.v)]['id']+Gh(0x26c)+u[Gh(eo.u)][Gh(0x263)]+Gh(eo.t)+x+Gh(0x1cd));}c(U,'assertSessionGraphSchema');function ee(u){const eR={u:0x251},Gd=GY;return Object[Gd(0x226)](Object[Gd(eR.u)](u)[Gd(0x253)](([x,v])=>{const Gl=Gd;if(!v||typeof v!=Gl(0x222))return[x,v];const {toolTrace:b,...L}=v;return[x,L];}));}c(ee,GY(0x202));function te(u){const em={u:0x253},eZ={u:0x1d1,x:0x20e,v:0x1df,t:0x24e,b:0x22f,L:0x1fb,r:0x23e},GM=GY;return u[GM(em.u)](x=>{const GV=GM,v={...x[GV(eZ.u)]},b=x[GV(eZ.x)]==='ai'&&Array[GV(0x1fb)](v[GV(eZ.v)])&&v[GV(0x1df)][GV(eZ.t)]>0x0?oe(v[GV(0x241)]):void 0x0;return delete v['additional_kwargs'],b&&(v[GV(0x241)]={'originalTextContentBlock':b}),delete v['response_metadata'],delete v[GV(eZ.b)],x[GV(0x20e)]==='ai'&&(Array[GV(eZ.L)](v[GV(0x1df)])&&v[GV(eZ.v)]['length']===0x0&&delete v[GV(eZ.v)],Array[GV(eZ.L)](v[GV(eZ.r)])&&v[GV(eZ.r)]['length']===0x0&&delete v[GV(0x23e)]),{...x,'data':v};});}c(te,GY(0x220));function re(u){const eI={u:0x226},Gy=GY;return Object[Gy(eI.u)](Object[Gy(0x251)](u)[Gy(0x253)](([x,v])=>[x,te(g(v))]));}c(re,'storeHistories');function ne(u={}){const GP=GY;return Object[GP(0x226)](Object['entries'](u)[GP(0x253)](([x,v])=>[x,a(v)]));}c(ne,GY(0x217));function oe(u){const eQ={u:0x234,x:0x215},GD=GY;if(!P(u))return;const x=u[GD(eQ.u)];if(!(!P(x)||typeof x['thoughtSignature']!=GD(0x215)))return{...typeof x['text']==GD(eQ.x)?{'text':x[GD(0x213)]}:{},'thoughtSignature':x['thoughtSignature'],...x[GD(0x1d7)]===!0x0?{'thought':!0x0}:{}};}c(oe,GY(0x243));function P(u){const GT=GY;return u!==null&&typeof u==GT(0x222)&&!Array[GT(0x1fb)](u);}c(P,GY(0x25b));class q{static{c(this,'MemorySessionDocumentContainer');}['documents']=new Map();get[GY(0x232)](){return this['documents']['size'];}[GY(0x236)]={'upsert':c(async e=>{const en={u:0x260},GA=GY,t=e;return this[GA(0x256)][GA(en.u)](t['id'],structuredClone(t)),{};},'upsert')};async['compareAndSwap'](u,x){const ep={u:0x256,x:0x214,v:0x256,t:0x223},Gk=GY,v=this[Gk(ep.u)][Gk(ep.x)](x['id']);return ie(v,u)?(this[Gk(ep.v)][Gk(0x260)](x['id'],structuredClone(x)),'ok'):Gk(ep.t);}['item'](u,x){const eu={u:0x256},eH={u:0x261,x:0x22a},GO=GY;return{'read':c(async()=>{const GW=S,v=this[GW(0x256)][GW(0x214)](u);if(!v||v['id']!==x)throw Object[GW(eH.u)](new Error(GW(eH.x)),{'code':0x194});return{'resource':structuredClone(v)};},GO(0x1de)),'delete':c(async()=>{const e0=GO,v=this[e0(eu.u)]['get'](u);if(!v||v['id']!==x)throw Object['assign'](new Error('Not\x20found'),{'code':0x194});return this['documents']['delete'](u),{};},GO(0x258))};}}function V(u){const ev={u:0x222,x:0x1f3,v:0x1ed},e1=GY;if(!u||typeof u!=e1(ev.u))return!0x1;const x=u;return x[e1(ev.x)]===0x194||x[e1(ev.v)]===0x194;}c(V,GY(0x20f));function j(u=process.env.SESSION_TURN_LEASE_MS){const et={u:0x26a},e2=GY,x=Number(u??e2(0x1ce));return Number[e2(et.u)](x)&&x>0x0?x:0xea60;}c(j,GY(0x224));function m(u){return u?.['revision']??0x0;}c(m,GY(0x269));function G(u,x=Date['now']()){const eB={u:0x25d,x:0x24c,v:0x26a},e3=GY;if(!u?.[e3(eB.u)]||!u[e3(0x1e6)])return!0x1;const v=Date[e3(eB.x)](u[e3(0x1e6)]);return Number[e3(eB.v)](v)&&v>x;}function S(G,j){G=G-0x1cd;const C=e();let g=C[G];if(S['lWoyLP']===undefined){var E=function(F){const U='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let w='',i='';for(let c=0x0,q,f,o=0x0;f=F['charAt'](o++);~f&&(q=c%0x4?q*0x40+f:f,c++%0x4)?w+=String['fromCharCode'](0xff&q>>(-0x2*c&0x6)):0x0){f=U['indexOf'](f);}for(let Y=0x0,R=w['length'];Y<R;Y++){i+='%'+('00'+w['charCodeAt'](Y)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(i);};S['SPeVhq']=E,S['GnRdQF']={},S['lWoyLP']=!![];}const X=C[0x0],a=G+X,N=S['GnRdQF'][a];return!N?(g=S['SPeVhq'](g),S['GnRdQF'][a]=g):g=N,g;}function e(){const er=['tu9or09eqL9vuKW','lI9JB3nTB3mTC2vZC2LVBI1KB2n1BwvUDc5JB250ywLUzxiUANm','u0vtu0LptL9uvvjox0Xfqvnfx01t','qgf6DxjLl2LKzw50Axr5','DgHVDwDODa','z3jHCgHty2HLBwfwzxjZAw9U','Dg9mB3DLCKnHC2u','jYbJAgfUz2vKigjLzM9Yzsb0AgLZihr1CM4Gy291BgqGyMuGC2f2zwqU','BgvHC2vK','yMvNAw5uDxjU','mtvSvNLQANq','CMvHza','Dg9VBf9JywXSCW','C2f2zvn0yxrL','jYbSB3n0igL0CYbSzwfZzsbIzwzVCMuGBg9NCYb3zxjLigfWCgvUzgvKoYa','zxHWzwn0zwrszxzPC2LVBG','CgfYDgL0Aw9Us2v5','u0vtu0LptL9tve9srq','D2fYBG','zxHWAxjLC0f0','CMvZDg9Yzvn0yxrL','AxnmAxzLu2vZC2LVBLr1CM4','q09ttu9tx0rbvefcqvnf','CgvYC2LZDe1Pz3jHDgvKu2vZC2LVBG','q09ttu9eqL9trvntsu9ox0Le','zxjYB3jZ','C3rHDhvZq29Kzq','yxnZzxj0swq','q09ttu9tx1riuK9vr0Hqvvq','mJa4mJq0ntjIv3jiBem','ywXS','mtmWs0jrDwP4','y29Kzq','Dg9ju09tDhjPBMC','AxrLBq','y29UzMLN','BM93','lcbUB3qG','Aw5JBhvKzxm','y29UDgfPBMvY','AxnbCNjHEq','BMfTzq','igvYCM9YkhmPigfUzca','BM9Kzxm','ntuXmJm4ANbYqK1b','z2v0vgLTzq','Bw9Uz28','CMvTB3zLtgvNywn5vg9VBfrYywnLCW','DMvYC2LVBG','zgvMAw5LuhjVCgvYDhK','jY4GvxnLicDTzw1VCNKNlcaNC3fSAxrLjYWGj21VBMDVzgiNlcbVCIaNy29ZBw9ZjY4','z3jHCgHjza','DhvYBG','Dg9Rzw5Z','n0vxCMXoAG','tw9Uz29eqIbZzxnZAw9UihbLCNnPC3rLBMnLihjLCxvPCMvZie1ptKDprejFvvjmlcbnt05ht0rcx05btuuSigfUzcbnt05ht0rcx0npteXfq1rjt04U','u0vtu0LptL9dt05gteLdva','yxbWzw5Ktg9NCW','q09ttu9FrejFq0Xjru5ux0Le','DhLWzq','AxnoB3rgB3vUza','jYbJAgfUz2vKigjLzM9YzsbPDhmGBwLNCMf0Aw9UignVDwXKigjLihnHDMvKlG','qgf6DxjLl2nVC21VCW','BgfUz2DYyxbO','Dgv4Da','z2v0','C3rYAw5N','mtu3ndq0s0DgvwDb','CMvZDg9YzuHPC3rVCMLLCW','y29TBwL0rxHWzwn0zwrszxzPC2LVBG','CgXHy2vOB2XKzxjeB2n1BwvUDa','y29ZBw9Zzgi','y29TBwL0uhjLzgLJyxrL','AgLZDg9YAwvZ','l2LK','zw5KrMfPBgvKvhvYBG','z3jHCgG','y29TCgfJDfn0B3jLze1LC3nHz2vZ','y29UBMvJDa','B2jQzwn0','y29UzMXPy3q','C2vZC2LVBLr1CM5mzwfZzu1Z','q29ZBw9ZihnLC3nPB24GCgvYC2LZDgvUy2uGCMvXDwLYzxmGq09ttu9eqL9vuKWGyw5Kienpu01prejFs0vzlcbVCIbdt1nnt19ftKrqt0LovcWGqvPvuKvFvevoqu5ux0Lelcbdt1nnt19eqL9dteLftLrFsuqSigfUzcbdt1nnt19eqL9dteLftLrFu0vduKvulG','zNjVBuvUDhjPzxm','q2fUBM90ihbLCNnPC3qGC2vZC2LVBIbKB2n1BwvUDcb2zxjZAw9Uia','Aw5FChjVz3jLC3m','q09ttu9FrejFu0vtu0LptL9dt05uquLorvjFsuq','tM90igzVDw5K','BgXTq29UzMLN','mZm2odC2ohfHAw9pAa','u1fmsvrfx0rcx1bbveG','D2fYBMLUz3m','DxnHz2vFBwv0ywrHDge','y3jLyxrLzef0','ywXSB3DpD25LCG','C2L6zq','y3jLyxrLswzoB3rfEgLZDhm','B3jPz2LUywXuzxH0q29UDgvUDejSB2nR','DhvYBKXLyxnLtxm','AxrLBxm','z2v0u2vZC2LVBG','C3fSAxrL','zgf0ywjHC2vZ','CMvXDwLYzuzYzwvmzwfZzq','CMvXDwLYzu93BMvY','jYWGBM90icC','odK2mtqYug93z053','Aw52ywXPzf90B29Sx2nHBgXZ','u0vtu0LptL9dt01qtevuruq','mZbQEvHOzLq','ywrKAxrPB25HBf9RD2fYz3m','jYbPCYbHBhjLywr5ihbYB2nLC3nPBMCGysb0DxjUlG','C2LNBMf0DxjLqMvHCMLUz0nVBNrLBNrcBg9JAW','u2vZC2LVBIaN','mJiXoduWoxP4C0XRsq','Bw9KzwXnzxrHzgf0yq','DhjPBq','qvPvuKvFvevoqu5ux0Le','y29ZBw9Z','y29TCgXLDgvK','Bw9Uz29KyG','CgfYC2u','zMLYC3q','BgvUz3rO','BM9Uzq','y29TCgfYzufUzfn3yxa','zw50CMLLCW','lI9KyxrHl3nLC3nPB25ZlNnXBgL0zq','BwfW','zNjVBunVBMzPzW','y3jLyxrLsw5KzxG','zg9JDw1LBNrZ','u2vZC2LVBK1HBMfNzxi','zgvSzxrL','zgLZCg9Zzq','mJa4mZu2txHXBhHs','AxnszwnVCMq','Cgf0Ahm','B3DUzxi','C3rHDhvZ','u0vtu0LptL9cvvnz','C2v0','yxnZAwDU','y29UDgfPBMvYCW','C2nOzw1HvMvYC2LVBG','jYbTDxn0ihvZzsbWyxj0AxrPB24GA2v5ic9PzdSGzM91BMqG','BwvTB3j5','Bwf0y2HLC1nLC3nPB25xCML0zvbYzwrPy2f0zq','yxnZzxj0u2vZC2LVBKDYyxbO','q09ttu9tx0nptLrbsu5fuG','C2vZC2LVBLjLDMLZAw9U','AxngAw5PDgu','y3vYCMvUDe5Vzgu','jYbZy2HLBweGDMvYC2LVBIa','lIbszxn0B3jLig9Yig1Pz3jHDguGAxqGyMvMB3jLihnHDMLUzY4','nJaWmda','tu9or09eqL9dt0Xmrunusu9o','CMv2AxnPB24','zgf0yq','CMvHzerVy3vTzw50'];e=function(){return er;};return e();}c(G,GY(0x1e8));function ie(u,x,v=Date[GY(0x1f7)]()){const eL={u:0x23b,x:0x207,v:0x231},e4=GY;return x['replaceIncompatible']?u!==void 0x0&&u[e4(0x203)]!==h:x[e4(0x1e2)]===null?u===void 0x0:!(!u||m(u)!==x['expectedRevision']||x[e4(0x23b)]&&u[e4(0x207)]?.[e4(0x25d)]!==x[e4(eL.u)]||x[e4(0x23a)]&&G(u[e4(eL.x)],v)&&u['turn']?.[e4(0x25d)]!==x[e4(eL.v)]);}c(ie,GY(0x266));export{q as MemorySessionDocumentContainer,w as SESSION_BUSY,we as SESSION_COMPLETED,$ as SESSION_CONFLICT,h as SESSION_DOCUMENT_VERSION,C as SessionManager,f as SessionTurnError,G as isLiveSessionTurn,ie as matchesSessionWritePredicate,m as sessionRevision,j as sessionTurnLeaseMs};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const B=j;(function(R,Z){const G7={R:0xe6,Z:0xd2,m:0xe0,J:0x106,Q:0xe5,s:0xda},t=j,m=R();while(!![]){try{const J=parseInt(t(G7.R))/0x1+parseInt(t(G7.Z))/0x2+parseInt(t(G7.m))/0x3+-parseInt(t(0x10b))/0x4+-parseInt(t(G7.J))/0x5*(parseInt(t(G7.Q))/0x6)+-parseInt(t(0xfa))/0x7*(-parseInt(t(0x119))/0x8)+-parseInt(t(0xe2))/0x9*(parseInt(t(G7.s))/0xa);if(J===Z)break;else m['push'](m['shift']());}catch(Q){m['push'](m['shift']());}}}(e,0xd5f91));var w=Object[B(0x11b)],f=(R,Z)=>w(R,'name',{'value':Z,'configurable':!0x0});import{END as C,START as X,StateGraph as F}from'@langchain/langgraph';function e(){const GZ=['zNjVBuvUDhjPzxm','AgfZ','zMLUza','q3vYCMvUDc1UB2rLihnLBgvJDg9YicC','y3vYCMvUDe5VzgvtzwXLy3rVCK5HBwu','zNvUy3rPB24','BM9KzunSyxnZzxm','z2v0','BgvUz3rO','yxnZzxj0qwrKzwroB2rL','jYbTDxn0igjLigfKzgvKigjLzM9YzsbPDcbPCYb1C2vKlG','vgHLihrLCM1PBMfSihn0yxrLicC','y29TCgLSzq','zw5KCg9PBNrjza','C3vWCg9YDhnbDxrVBwf0AwnpDxrJB21LuM91DgLUzW','yxnZzxj0u291CMnL','jYbJyw5UB3qGyNjHBMnOihDPDgHVDxqGysbZDhjPBMCGy3vYCMvUDe5VzguU','mtu1mdvlEwHXEem','AxnbCNjHEq','jYbPCYbYzxnLCNzLzcbIEsbtDgf0zuDYyxbOrxH0lNjLz2LZDgvYvhvYBNmOks4','BwfW','zxHWBgLJAxrdB25KAxrPB25HBe5Vzgvjzhm','zw5KtM9Kzq','r3jHCgGGBM9KzsaN','jYbTDxn0igjLigfUigfKzgvKieDYyxbOtM9KzsbVCIb0AguGy29UzMLNDxjLzcb0zxjTAw5HBcbZDgf0zsaN','z3jHCgGGBM9Kzq','BM9Kzxm','ywrKq29UzgL0Aw9UywXfzgDL','DgfYz2v0','mtq1sKvhuKTW','B3v0y29TzvjVDxrL','Aw5KzxHpzG','u3rHDgvhCMfWAev4DcbUB2rLCYbTDxn0igjLigfKzgvKigfZieDYyxbOtM9KzsbJBgfZC2vZoIbNCMfWAc5HzgroB2rLke15tM9KzsKU','yNjHBMnOqNK','odK1nZe2r2DLCvns','r3jHCgGGBM9KzsbMywn0B3j5igzVCIaN','qxv0B21HDgLJig91DgnVBwuGCM91DguGjW','yNjHBMnOqNKOksbYzxf1AxjLCYbHDcbSzwfZDcbVBMuGy2fZzs4','ywrKzwroB2rLswrZ','jYbPCYbHBhjLywr5ihjLz2LZDgvYzwqU','jYbMCM9TicC','BM9KzuLUC3rHBMnLCW','CMvNAxn0zxjuDxjUtM9Kzxm','C29Tzq','CM91Dgu','ywrKrwrNzq','ywrK','jYbYzxr1CM5LzcaN','odCYr2DgAMf3','CMvNAxn0zxjuDxjUCW','zgvMAw5LuhjVCgvYDhK','Aw52B2TL','z3jHCgG','C291CMnL','yNjHBMnOqNKOksbOyxmGBw9Yzsb0AgfUig9UzsbJyxnLigzVCIaN','ywrKtM9Kzq','B3rOzxj3AxnL','C3rYAw5N','mtG1otyXnhrQEhD6sq','u3rHDgvhCMfWAev4Da','CMvNAxn0zxjoB2rL','y3jLyxrLr3jHCgHoB2rL','q29UzgL0Aw9UywWGB3iGzgLYzwn0igvKz2uG','yxv0B21HDgLJt3v0y29TzvjVDxrLC0fKzgvK','y2fZzxm','ywrKq29UzgL0Aw9UywXfzgDLCW','mtbJC0jnrNO','y3vYCMvUDe5Vzgu','DMfSAwrHDgvuB29SCW','jYbTDxn0igjLigfKzgvKigjLzM9YzsbPDcbPCYbJB25Uzwn0zwqU','yxv0B21HDgLJt3v0y29TzvjVDxrPBMDszxf1zxn0zwq','AxnhCMfWAe5VzgvdBgfZCW','mZm2ntG1oxrxCLjkCW','y2fZztO','mta5mtGXmZrbBeD5z20','jYbTDxn0ihrHCMDLDcbHihjLz2LZDgvYzwqGr3jHCgHoB2rLig9Yievorc4','yxnZzxj0vgfYz2v0','mtK5ndeWAK1bsfrN','otG0mta4CKXMzLLp','vgHPCYbNCMfWAcbOyxmGBM8Gr3jHCgHoB2rLigzHy3rVCNKU','C2v0'];e=function(){return GZ;};return e();}function j(G,S){G=G-0xce;const C=e();let g=C[G];if(j['wkJwmQ']===undefined){var E=function(F){const U='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let w='',i='';for(let c=0x0,q,f,o=0x0;f=F['charAt'](o++);~f&&(q=c%0x4?q*0x40+f:f,c++%0x4)?w+=String['fromCharCode'](0xff&q>>(-0x2*c&0x6)):0x0){f=U['indexOf'](f);}for(let Y=0x0,R=w['length'];Y<R;Y++){i+='%'+('00'+w['charCodeAt'](Y)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(i);};j['cIIvrF']=E,j['bCZXhO']={},j['wkJwmQ']=!![];}const X=C[0x0],a=G+X,N=j['bCZXhO'][a];return!N?(g=j['cIIvrF'](g),j['bCZXhO'][a]=g):g=N,g;}import{GRAPH_NODE_CLASS as U,GraphNode as i}from'./graph-node.js';import{GRAPH_END_NODE as q}from'./graph-state.js';import{outcomeRouteTarget as o}from'./node-outcome.js';import{stableClassId as Y}from'./stable-id.js';class S{static{f(this,B(0xd3));}['createGraphNode'];['endNode'];['graph'];[B(0x10f)]=new Set();[B(0xef)]=new Map();[B(0xfe)]=new Set();[B(0x112)]=new Map();[B(0xde)]=!0x1;['automaticOutcomeRoutesAdded']=!0x1;constructor(R,Z,m=q){const L=B;this[L(0xd5)]=Z,this['endNode']=m,this[L(0x11d)]=new F(R);}[B(0xcf)](R){const G9={R:0x109,Z:0xd5,m:0xe7,J:0x102,Q:0x118,s:0xe8,K:0xd4},r=B;if(!N(R))throw new Error(r(G9.R));if(!this[r(G9.Z)])throw new Error(r(G9.m));const Z=this[r(G9.Z)](R),m=Y(R,r(G9.J));if(Z['id']!==m)throw new Error(r(0x10c)+m+r(G9.Q)+Z['id']+'\x27.');return this[r(0xef)][r(G9.s)](m,R),this[r(G9.K)](Z);}[B(0x103)](...R){const z=B;for(const Z of R)this[z(0xcf)](Z);return this;}[B(0x113)](...R){const h=B;return this['nodes'](...R),this[h(0x11a)](...R),this;}[B(0x116)](R,Z){const Gj={R:0xe4,Z:0x11d,m:0x116},d=B,m=Array[d(0xfb)](R)?R:[R];for(const Q of m)this['assertSource'](Q);this[d(Gj.R)](Z);const J=m[d(0xfd)](c);return this[d(Gj.Z)][d(Gj.m)](J[d(0xf1)]===0x1?J[0x0]:J,c(Z)),this;}['branch'](R,Z){const GS={R:0xfe,Z:0x112,m:0x104,J:0x115},M=B;this[M(GS.R)][M(0x117)](Y(R,M(0x102)));const m=Y(R,M(0x102)),J=this[M(GS.Z)][M(0xf0)](m);if(!J)throw new Error('Graph\x20node\x20\x27'+m+'\x27\x20must\x20be\x20added\x20before\x20it\x20is\x20connected.');return this[M(GS.m)](R,J[M(GS.J)]['bind'](J),Z),this;}[B(0x10a)](R,Z){const Gg={R:0xfe,Z:0x117,m:0x112,J:0xea,Q:0x100,s:0xdd,K:0xd8,n:0xf1,p:0x10e,H:0xeb,x:0xce,v:0x104},GC={R:0xdb,Z:0xf9},V=B,J=Y(R,'graph\x20node');if(this[V(Gg.R)][V(Gg.Z)](J),!this[V(Gg.m)][V(Gg.J)](J))throw new Error(V(Gg.Q)+J+V(Gg.s));if(Z[V(Gg.K)][V(Gg.n)]===0x0)throw new Error(V(Gg.p));const Q=Z[V(Gg.K)]['map'](({when:p})=>this[V(0xed)](p)),s=Q[V(Gg.H)]((p,H)=>Q[V(0x108)](p)!==H);if(s)throw new Error(V(Gg.x)+s+'\x27.');const K=Q['map']((p,H)=>V(0xe1)+H),n=V(0xd0);return this[V(Gg.v)](R,H=>{const y=V,x=H[y(GC.R)];if(typeof x!=y(0xd1))throw new Error('Graph\x20node\x20\x27'+J+y(GC.Z));const v=Q[y(0x108)](x);return v===-0x1?n:K[v];},{...Object[V(0xe9)](Z['cases']['map'](({routeTo:p},H)=>[K[H],p])),[n]:Z['otherwise']}),this;}['configAutoRoute'](){const GE={R:0xde},P=B;return this[P(GE.R)]=!0x0,this;}[B(0x11a)](...R){const GX={R:0x104,Z:0xfd,m:0xff},D=B;if(R[D(0x114)](Z=>Y(Z,D(0x102))===this[D(0xff)]))throw new Error(D(0xf4)+this['endNode']+D(0xfc));return this[D(GX.R)](X,Z=>Z[D(0xdb)],{...Object['fromEntries'](R[D(GX.Z)](Z=>[Y(Z,D(0x102)),Z])),[this[D(GX.m)]]:C}),this;}[B(0xf5)](){const Ga={R:0x112,Z:0x11d},T=B;this['addAutomaticOutcomeRoutes']();for(const R of this[T(Ga.R)]['values']())R[T(0xdc)]?.();return this[T(Ga.Z)][T(0xf5)]();}['addConditionalEdge'](R,Z,m){const GN={R:0xf8,Z:0xe4,m:0x11d,J:0xd9},A=B;this[A(GN.R)](R);for(const J of Object['values'](m))this[A(GN.Z)](J);this[A(GN.m)][A(GN.J)](c(R),Z,Object[A(0xe9)](Object['entries'](m)[A(0xfd)](([Q,s])=>[Q,c(s)])));}[B(0xd4)](R){const GU={R:0xea,Z:0x110,m:0xcf,J:0x112},k=B;if(this[k(0x10f)][k(GU.R)](R['id']))throw new Error('Graph\x20node\x20\x27'+R['id']+k(GU.Z));return this[k(0x11d)][k(GU.m)](R['id'],async Z=>{const W=k,m=await R[W(0x11c)](Z),J=o(m);return J&&this[W(0xe4)](J),m;}),this['addedNodeIds']['add'](R['id']),this[k(GU.J)][k(0xe8)](R['id'],R),this;}['addAutomaticOutcomeRoutes'](){const Gi={R:0xd7,Z:0xe9,m:0xef,J:0xf7,Q:0xea},Gw={R:0x111},O=B;if(!this[O(0xde)]||this[O(Gi.R)])return;this['automaticOutcomeRoutesAdded']=!0x0;const R={...Object[O(Gi.Z)](this[O(Gi.m)]),[C]:C};for(const [Z,m]of this['nodeInstances']){if(!m[O(Gi.J)]||this['explicitConditionalNodeIds'][O(Gi.Q)](Z))continue;const J=this['nodeClasses'][O(0xf0)](Z);this[O(0x104)](J,Q=>{const G0=O,s=Q[G0(0x107)];if(typeof s!='string')return C;if(!(s in R))throw new Error(G0(0x10d)+s+G0(Gw.R)+Z+G0(0xe3));return s;},R);}}[B(0xf8)](R){const Gc={R:0x11e},G1=B;c(R)!==X&&this['assertAddedNode'](R,G1(Gc.R));}[B(0xe4)](R){const G2=B;c(R)!==C&&this[G2(0xf2)](R,G2(0x105));}['assertAddedNode'](R,Z){const G3=B,m=c(R);if(!this[G3(0x10f)][G3(0xea)](m))throw new Error(G3(0xd6)+Z+'\x20\x27'+m+G3(0xdd));}[B(0xed)](R){const Go={R:0x10f,Z:0xec,m:0x101,J:0xff},G4=B;if(typeof R!=G4(0xd1)){if(!N(R))throw new Error('branchBy()\x20selectors\x20must\x20be\x20GraphNode\x20classes\x20or\x20the\x20configured\x20terminal\x20state.');const Z=Y(R,'graph\x20node');if(!this[G4(Go.R)]['has'](Z))throw new Error(G4(0xec)+Z+G4(0xf3));return Z;}if(R!==this[G4(0xff)]&&!this[G4(0x10f)]['has'](R))throw new Error(G4(Go.Z)+R+G4(Go.m)+this[G4(Go.J)]+'\x27.');return R;}}function N(R){const G5=B,Z=R;return typeof R==G5(0xee)&&R!==null&&Z[U]===!0x0&&Z['prototype']instanceof i;}f(N,B(0xdf));function c(R){const G6=B;return typeof R==G6(0xd1)?R:Y(R,G6(0x102));}f(c,B(0xf6));export{S as StateGraphExt};
|
|
@@ -23,5 +23,5 @@ export { mergeNodeStates, type GraphNodeStates, type NodeStateValue, } from "../
|
|
|
23
23
|
export { LangChainLlmGateway, type LangChainLlmGatewayOptions, } from "../../src/framework/langchain-llm-gateway.js";
|
|
24
24
|
export { ModelProvider, type BuiltInModelProviderConfigs, type CustomModelProviderOptions, type ModelProviderRuntimeConfig, type RegisteredModelProviderAdapter, } from "../../src/framework/model-provider.js";
|
|
25
25
|
export { langChainModelInitialization, type LangChainModelInitialization, } from "../../src/framework/langchain-provider.adapter.js";
|
|
26
|
-
export { GRAPH_LLM_PROVIDERS, GRAPH_LLM_FAMILIES, GRAPH_LLM_CAPABILITIES, BUILT_IN_MODEL_CATALOG, GraphLlm, ModelCatalog, ModelProviderRegistry, type BuiltInGraphLlmConfig, type BuiltInModelId, type BuiltInModelParameters, type CommonModelParameters, type GraphLlmConfig, type GraphLlmConfigOverride, type GraphLlmCapability, type GraphLlmFamily, type GraphLlmModelMetadata, type GraphLlmParameters, type GraphLlmProvider, type GraphLlmRequiredCapabilities, type ModelCatalogDocument, type ModelParameterProfile, type ModelProviderAdapter, type ModelProviderInitialization, type RuntimeGraphLlmConfig, } from "../../src/framework/graph-llm.config.js";
|
|
26
|
+
export { GRAPH_LLM_PROVIDERS, GRAPH_LLM_FAMILIES, GRAPH_LLM_CAPABILITIES, BUILT_IN_MODEL_CATALOG, GraphLlm, ModelCatalog, ModelProviderRegistry, type BuiltInGraphLlmConfig, type BuiltInModelId, type BuiltInModelParameters, type CommonModelParameters, type GraphLlmConfig, type GraphLlmConfigOverride, type GraphLlmCapability, type GraphLlmFamily, type GraphLlmModelMetadata, type GraphLlmParameters, type GraphLlmProvider, type GraphLlmRequiredCapabilities, type ModelCatalogDocument, type ModelParameterProfile, type ModelProviderAdapter, type ModelProviderInitialization, type OpenAIAuthReasoningParameters, type RuntimeGraphLlmConfig, } from "../../src/framework/graph-llm.config.js";
|
|
27
27
|
export { addTokenUsage, emptyTokenUsage, modelExecution, normalizeTokenUsage, tokenUsageFromMessage, type ModelExecution, type ModelResult, type TokenUsage, } from "../../src/framework/token-usage.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ModelProfile } from '@langchain/core/language_models/profile';
|
|
2
2
|
import { type GraphLlmConfig, type GraphLlmFamily, type GraphLlmParameters } from './model-catalog.js';
|
|
3
|
-
export { BUILT_IN_MODEL_CATALOG, GRAPH_LLM_CAPABILITIES, GRAPH_LLM_FAMILIES, GRAPH_LLM_PROVIDERS, ModelCatalog, ModelProviderRegistry, type AnthropicChatParameters, type AnthropicThinkingParameters, type BasicChatParameters, type BuiltInGraphLlmConfig, type BuiltInModelId, type BuiltInModelParameters, type CommonModelParameters, type GoogleChatParameters, type GraphLlmCapability, type GraphLlmConfig, type GraphLlmFamily, type GraphLlmParameters, type GraphLlmProvider, type GraphLlmRequiredCapabilities, type ModelCatalogDocument, type ModelParameterProfile, type ModelProviderAdapter, type ModelProviderInitialization, type OpenAIChatParameters, type OpenAIReasoningParameters, type ResolvedModelDescriptor, type RuntimeGraphLlmConfig, } from './model-catalog.js';
|
|
3
|
+
export { BUILT_IN_MODEL_CATALOG, GRAPH_LLM_CAPABILITIES, GRAPH_LLM_FAMILIES, GRAPH_LLM_PROVIDERS, ModelCatalog, ModelProviderRegistry, type AnthropicChatParameters, type AnthropicThinkingParameters, type BasicChatParameters, type BuiltInGraphLlmConfig, type BuiltInModelId, type BuiltInModelParameters, type CommonModelParameters, type GoogleChatParameters, type GraphLlmCapability, type GraphLlmConfig, type GraphLlmFamily, type GraphLlmParameters, type GraphLlmProvider, type GraphLlmRequiredCapabilities, type ModelCatalogDocument, type ModelParameterProfile, type ModelProviderAdapter, type ModelProviderInitialization, type OpenAIAuthReasoningParameters, type OpenAIChatParameters, type OpenAIReasoningParameters, type ResolvedModelDescriptor, type RuntimeGraphLlmConfig, } from './model-catalog.js';
|
|
4
4
|
export type GraphLlmConfigOverride = GraphLlmConfig | Readonly<{
|
|
5
5
|
model?: never;
|
|
6
6
|
params?: Readonly<Record<string, unknown | null>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
export declare const GRAPH_LLM_PROVIDERS: readonly ["openai", "anthropic", "google", "azure_openai", "bedrock", "ollama", "cohere", "cerebras", "deepseek", "fireworks", "groq", "mistral", "mistralai", "perplexity", "together", "xai", "scripted"];
|
|
2
|
+
export declare const GRAPH_LLM_PROVIDERS: readonly ["openai", "openai-auth", "anthropic", "google", "azure_openai", "bedrock", "ollama", "cohere", "cerebras", "deepseek", "fireworks", "groq", "mistral", "mistralai", "perplexity", "together", "xai", "scripted"];
|
|
3
3
|
export type GraphLlmProvider = (typeof GRAPH_LLM_PROVIDERS)[number];
|
|
4
4
|
export declare const GRAPH_LLM_FAMILIES: readonly ["chat", "reasoning", "thinking"];
|
|
5
5
|
export type GraphLlmFamily = (typeof GRAPH_LLM_FAMILIES)[number];
|
|
@@ -22,6 +22,9 @@ export type OpenAIReasoningParameters = CommonModelParameters & Readonly<{
|
|
|
22
22
|
serviceTier?: "auto" | "default" | "flex" | "priority";
|
|
23
23
|
promptCacheKey?: string;
|
|
24
24
|
}>;
|
|
25
|
+
export type OpenAIAuthReasoningParameters = CommonModelParameters & Readonly<{
|
|
26
|
+
reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max";
|
|
27
|
+
}>;
|
|
25
28
|
export type AnthropicChatParameters = CommonModelParameters & Readonly<{
|
|
26
29
|
temperature?: number;
|
|
27
30
|
outputEffort?: "low" | "medium" | "high" | "xhigh" | "max";
|
|
@@ -54,6 +57,7 @@ export type BuiltInModelParameters = Readonly<{
|
|
|
54
57
|
"openai:gpt-4o-mini": OpenAIChatParameters;
|
|
55
58
|
"openai:gpt-5.1": OpenAIReasoningParameters;
|
|
56
59
|
"openai:gpt-5.4": OpenAIReasoningParameters;
|
|
60
|
+
"openai-auth:gpt-5.4": OpenAIAuthReasoningParameters;
|
|
57
61
|
"anthropic:claude-sonnet-4-5": AnthropicChatParameters;
|
|
58
62
|
"anthropic:claude-opus-4-1": AnthropicThinkingParameters;
|
|
59
63
|
"google:gemini-3.1-flash-lite": GoogleChatParameters;
|
|
@@ -150,6 +154,18 @@ export declare const BUILT_IN_MODEL_CATALOG: {
|
|
|
150
154
|
readonly requiredCapabilities: null;
|
|
151
155
|
};
|
|
152
156
|
};
|
|
157
|
+
readonly "openai-auth.reasoning": {
|
|
158
|
+
readonly provider: "openai-auth";
|
|
159
|
+
readonly family: "reasoning";
|
|
160
|
+
readonly paramsSchema: Record<string, unknown>;
|
|
161
|
+
readonly parameterMappings: {
|
|
162
|
+
readonly maxOutputTokens: "maxTokens";
|
|
163
|
+
readonly reasoningEffort: "reasoningEffort";
|
|
164
|
+
readonly retries: "maxRetries";
|
|
165
|
+
readonly forceToolCalls: null;
|
|
166
|
+
readonly requiredCapabilities: null;
|
|
167
|
+
};
|
|
168
|
+
};
|
|
153
169
|
readonly "anthropic.chat": {
|
|
154
170
|
readonly provider: "anthropic";
|
|
155
171
|
readonly family: "chat";
|
|
@@ -217,6 +233,9 @@ export declare const BUILT_IN_MODEL_CATALOG: {
|
|
|
217
233
|
readonly "openai:gpt-5.4": {
|
|
218
234
|
readonly profile: "openai.reasoning";
|
|
219
235
|
};
|
|
236
|
+
readonly "openai-auth:gpt-5.4": {
|
|
237
|
+
readonly profile: "openai-auth.reasoning";
|
|
238
|
+
};
|
|
220
239
|
readonly "anthropic:claude-sonnet-4-5": {
|
|
221
240
|
readonly profile: "anthropic.chat";
|
|
222
241
|
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { GraphLlmConfig, ModelProviderInitialization } from './graph-llm.config.js';
|
|
2
|
+
export declare const OPENAI_AUTH_PROVIDER = "openai-auth";
|
|
3
|
+
export type OpenAIAuthCredentials = Readonly<{
|
|
4
|
+
accessToken: string;
|
|
5
|
+
accountId?: string;
|
|
6
|
+
}>;
|
|
7
|
+
export declare function initializeOpenAIAuthProvider(model: string, options: Readonly<Record<string, unknown>>): ModelProviderInitialization;
|
|
8
|
+
export declare function isOpenAIAuthConfig(config: GraphLlmConfig): boolean;
|
|
9
|
+
export declare function openAIAuthMessageText(content: unknown): string;
|
|
10
|
+
export declare function openAIAuthFile(): string;
|
|
11
|
+
export declare function readOpenAIAuthCredentials(authFile?: string): OpenAIAuthCredentials;
|
|
12
|
+
export declare function normalizeOpenAIAuthResponsesRequest(request: Request): Promise<Request>;
|