@coalex-ai/sdk 2.2.2-beta.681 → 2.3.0-beta.686
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 +17 -0
- package/dist/context.d.ts +72 -7
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +188 -85
- package/dist/context.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/span-processor.d.ts +12 -0
- package/dist/span-processor.d.ts.map +1 -1
- package/dist/span-processor.js +33 -19
- package/dist/span-processor.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -168,6 +168,23 @@ await coalexContext(
|
|
|
168
168
|
);
|
|
169
169
|
```
|
|
170
170
|
|
|
171
|
+
#### Several agents in one process
|
|
172
|
+
|
|
173
|
+
A context opened inside another agent's context belongs to the inner agent: its spans carry
|
|
174
|
+
`coalex.parent_agent_id` (the enclosing agent) and the enclosing `requestId` / `runId`, but not
|
|
175
|
+
the enclosing agent's version or prompt. `agentNode` wraps a LangGraph node function so each node
|
|
176
|
+
is its own agent, re-opened on every resume, and a LangGraph pause (`interrupt()`) ends the span
|
|
177
|
+
OK rather than as an error. `currentAgentId()`, `currentParentAgentId()`, `currentRequestId()`,
|
|
178
|
+
`currentRunId()` and `currentAgentVersion()` read the active context.
|
|
179
|
+
|
|
180
|
+
```typescript
|
|
181
|
+
graph.addNode("rfq", agentNode("rfq-worker", rfqWorker, { version: "1.4.0" }));
|
|
182
|
+
|
|
183
|
+
await coalexContext({ agentId: "orchestrator", requestId, runId, version: "2.0.0" }, () =>
|
|
184
|
+
graph.compile({ checkpointer }).invoke(state, config),
|
|
185
|
+
);
|
|
186
|
+
```
|
|
187
|
+
|
|
171
188
|
### `evaluate(options)`
|
|
172
189
|
|
|
173
190
|
Submit an AI output for evaluation. Returns the governance decision.
|
package/dist/context.d.ts
CHANGED
|
@@ -1,22 +1,53 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* Everything the active coalexContext() says about the work in progress. One store for the whole
|
|
3
|
+
* context, so the propagator, evaluate() and the getters read the same values, and a concurrent
|
|
4
|
+
* invocation of another agent cannot see them.
|
|
5
|
+
*/
|
|
6
|
+
interface ActiveContext {
|
|
7
|
+
agentId: string;
|
|
8
|
+
parentAgentId?: string;
|
|
9
|
+
requestId?: string;
|
|
10
|
+
runId?: string;
|
|
11
|
+
version?: string;
|
|
12
|
+
promptVersion?: number;
|
|
13
|
+
promptType?: string;
|
|
14
|
+
}
|
|
15
|
+
/** The active context, or undefined outside one. For the propagator; not exported publicly. */
|
|
16
|
+
export declare function activeContext(): Readonly<ActiveContext> | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* Record the prompt version/type getPrompt() served: on the active context when there is one,
|
|
19
|
+
* otherwise as the process-wide startup prompt (COA-368).
|
|
20
|
+
*/
|
|
2
21
|
export declare function setLastPrompt(version: number, type: string): void;
|
|
3
|
-
/** The prompt
|
|
22
|
+
/** The prompt of the active context, or the startup prompt outside one, or null. */
|
|
4
23
|
export declare function getLastPrompt(): {
|
|
5
24
|
version: number;
|
|
6
25
|
type: string;
|
|
7
26
|
} | null;
|
|
8
|
-
/**
|
|
27
|
+
/** Forget the prompt: the active context's, or the startup prompt outside one. */
|
|
9
28
|
export declare function clearLastPrompt(): void;
|
|
10
29
|
/**
|
|
11
|
-
* Return the agentId of the active coalexContext(), or undefined outside one.
|
|
12
|
-
*
|
|
13
|
-
* the trace ingests, so the server resolves the agent instead of forcing health=0
|
|
14
|
-
* (COA-1076).
|
|
30
|
+
* Return the agentId of the active coalexContext(), or undefined outside one. evaluate() reads it
|
|
31
|
+
* so a mid-run escalation names its agent before the trace is ingested.
|
|
15
32
|
*/
|
|
16
33
|
export declare function currentAgentId(): string | undefined;
|
|
34
|
+
/** The requestId of the active coalexContext(), given or carried from an outer one. */
|
|
35
|
+
export declare function currentRequestId(): string | undefined;
|
|
36
|
+
/** The runId of the active coalexContext(), given or carried from an outer one. */
|
|
37
|
+
export declare function currentRunId(): string | undefined;
|
|
38
|
+
/** The agent version of the active coalexContext(), or undefined when it has none. */
|
|
39
|
+
export declare function currentAgentVersion(): string | undefined;
|
|
40
|
+
/** The agent whose context the active one opened inside, or undefined for a top-level agent. */
|
|
41
|
+
export declare function currentParentAgentId(): string | undefined;
|
|
17
42
|
export interface CoalexContextOptions {
|
|
18
43
|
agentId: string;
|
|
44
|
+
/** The customer's correlation key for one unit of business work. Carried from an enclosing context when omitted. */
|
|
19
45
|
requestId?: string;
|
|
46
|
+
/**
|
|
47
|
+
* One execution of an agent graph, across interrupts and resumes. Carried from an enclosing
|
|
48
|
+
* context when omitted. Never derive it from a framework's thread or session id.
|
|
49
|
+
*/
|
|
50
|
+
runId?: string;
|
|
20
51
|
/**
|
|
21
52
|
* The build this invocation is running. Optional today, and omitting it logs a warning once
|
|
22
53
|
* per agent per process (COA-2636): a trace with no version cannot be attributed to a build,
|
|
@@ -53,6 +84,40 @@ export interface CoalexContextOptions {
|
|
|
53
84
|
export declare function missingVersionGuidance(agentId: string): string;
|
|
54
85
|
/** Forget which agents have been warned about. For tests; the registry is process-global. */
|
|
55
86
|
export declare function resetVersionWarnings(): void;
|
|
87
|
+
/** The `coalex.*` attributes a context puts on its spans, in the propagator's order. */
|
|
88
|
+
export declare function contextAttributes(ctx: Readonly<ActiveContext>): Record<string, string | number>;
|
|
89
|
+
/**
|
|
90
|
+
* The LangGraph errors that carry a pause or a hand-off up through a node, not a failure.
|
|
91
|
+
* Recognised by name on the error and on every class of its prototype chain, so this SDK never
|
|
92
|
+
* imports LangGraph, a subclass (`NodeInterrupt`) is recognised, and so is a bundled copy whose
|
|
93
|
+
* class names were minified (LangGraph sets `name` on each).
|
|
94
|
+
*/
|
|
95
|
+
export declare const PAUSE_ERROR_NAMES: ReadonlySet<string>;
|
|
96
|
+
export declare function isPause(e: unknown): boolean;
|
|
97
|
+
/**
|
|
98
|
+
* Run `fn` inside a `coalex.invocation` span for `options.agentId`; every span started inside it
|
|
99
|
+
* carries the context's `coalex.*` attributes.
|
|
100
|
+
*
|
|
101
|
+
* Nested inside another agent's context it sets `coalex.parent_agent_id` to that agent, carries
|
|
102
|
+
* `requestId` and `runId`, and inherits neither version nor prompt; inside the same agent it
|
|
103
|
+
* inherits everything. A LangGraph pause (`GraphBubbleUp`, `GraphInterrupt`, `ParentCommand`)
|
|
104
|
+
* ends the span OK and is re-thrown; any other error ends it ERROR.
|
|
105
|
+
*/
|
|
56
106
|
export declare function coalexContext<T>(options: CoalexContextOptions, fn: () => Promise<T> | T): Promise<T>;
|
|
57
107
|
export declare function coalexContextSync<T>(options: CoalexContextOptions, fn: () => T): T;
|
|
108
|
+
/**
|
|
109
|
+
* Wrap a LangGraph node function so everything it does belongs to `agentId`.
|
|
110
|
+
*
|
|
111
|
+
* Wrap the **node function**, not the graph's `invoke`: LangGraph re-executes the node from the
|
|
112
|
+
* top on every resume (`new Command({ resume })`), so the context opens again for the resumed work
|
|
113
|
+
* and the node's checkpoint namespace is unchanged. The context carries the enclosing `requestId`
|
|
114
|
+
* and `runId`, names the enclosing agent as `coalex.parent_agent_id`, and a pause (`interrupt()`)
|
|
115
|
+
* leaves its span OK. Every argument (`state`, `config`) is passed through.
|
|
116
|
+
*
|
|
117
|
+
* graph.addNode("w1_rfq", agentNode("rfq-worker", rfqWorker, { version: "1.4.0" }));
|
|
118
|
+
*/
|
|
119
|
+
export declare function agentNode<A extends unknown[], R>(agentId: string, fn: (...args: A) => Promise<R> | R, options?: {
|
|
120
|
+
version?: string;
|
|
121
|
+
}): (...args: A) => Promise<R>;
|
|
122
|
+
export {};
|
|
58
123
|
//# sourceMappingURL=context.d.ts.map
|
package/dist/context.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mapp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73 @@
|
|
|
1
1
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
2
2
|
import { trace, SpanStatusCode } from "@opentelemetry/api";
|
|
3
3
|
import { log } from "./logger.js";
|
|
4
|
-
const
|
|
4
|
+
const contextStore = new AsyncLocalStorage();
|
|
5
|
+
/** The active context, or undefined outside one. For the propagator; not exported publicly. */
|
|
6
|
+
export function activeContext() {
|
|
7
|
+
return contextStore.getStore();
|
|
8
|
+
}
|
|
5
9
|
/**
|
|
6
|
-
* The prompt version + type
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
* The prompt version + type fetched via getPrompt() outside any coalexContext() (a startup fetch),
|
|
11
|
+
* so later invocations of that agent and spans outside any context are still attributed (COA-368).
|
|
12
|
+
* Inside a context, getPrompt() writes to that context instead, so concurrent invocations of
|
|
13
|
+
* different agents never see each other's prompt.
|
|
14
|
+
*/
|
|
15
|
+
let _startupPrompt = null;
|
|
16
|
+
/**
|
|
17
|
+
* Record the prompt version/type getPrompt() served: on the active context when there is one,
|
|
18
|
+
* otherwise as the process-wide startup prompt (COA-368).
|
|
12
19
|
*/
|
|
13
|
-
let _lastPrompt = null;
|
|
14
|
-
/** Record the prompt version/type served by the most recent getPrompt() (COA-368). */
|
|
15
20
|
export function setLastPrompt(version, type) {
|
|
16
|
-
|
|
21
|
+
const active = contextStore.getStore();
|
|
22
|
+
if (active) {
|
|
23
|
+
active.promptVersion = version;
|
|
24
|
+
active.promptType = type;
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
_startupPrompt = { version, type };
|
|
17
28
|
}
|
|
18
|
-
/** The prompt
|
|
29
|
+
/** The prompt of the active context, or the startup prompt outside one, or null. */
|
|
19
30
|
export function getLastPrompt() {
|
|
20
|
-
|
|
31
|
+
const active = contextStore.getStore();
|
|
32
|
+
if (active) {
|
|
33
|
+
return active.promptVersion === undefined
|
|
34
|
+
? null
|
|
35
|
+
: { version: active.promptVersion, type: active.promptType ?? "system" };
|
|
36
|
+
}
|
|
37
|
+
return _startupPrompt;
|
|
21
38
|
}
|
|
22
|
-
/**
|
|
39
|
+
/** Forget the prompt: the active context's, or the startup prompt outside one. */
|
|
23
40
|
export function clearLastPrompt() {
|
|
24
|
-
|
|
41
|
+
const active = contextStore.getStore();
|
|
42
|
+
if (active) {
|
|
43
|
+
active.promptVersion = undefined;
|
|
44
|
+
active.promptType = undefined;
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
_startupPrompt = null;
|
|
25
48
|
}
|
|
26
49
|
/**
|
|
27
|
-
* Return the agentId of the active coalexContext(), or undefined outside one.
|
|
28
|
-
*
|
|
29
|
-
* the trace ingests, so the server resolves the agent instead of forcing health=0
|
|
30
|
-
* (COA-1076).
|
|
50
|
+
* Return the agentId of the active coalexContext(), or undefined outside one. evaluate() reads it
|
|
51
|
+
* so a mid-run escalation names its agent before the trace is ingested.
|
|
31
52
|
*/
|
|
32
53
|
export function currentAgentId() {
|
|
33
|
-
return
|
|
54
|
+
return contextStore.getStore()?.agentId;
|
|
55
|
+
}
|
|
56
|
+
/** The requestId of the active coalexContext(), given or carried from an outer one. */
|
|
57
|
+
export function currentRequestId() {
|
|
58
|
+
return contextStore.getStore()?.requestId;
|
|
59
|
+
}
|
|
60
|
+
/** The runId of the active coalexContext(), given or carried from an outer one. */
|
|
61
|
+
export function currentRunId() {
|
|
62
|
+
return contextStore.getStore()?.runId;
|
|
63
|
+
}
|
|
64
|
+
/** The agent version of the active coalexContext(), or undefined when it has none. */
|
|
65
|
+
export function currentAgentVersion() {
|
|
66
|
+
return contextStore.getStore()?.version;
|
|
67
|
+
}
|
|
68
|
+
/** The agent whose context the active one opened inside, or undefined for a top-level agent. */
|
|
69
|
+
export function currentParentAgentId() {
|
|
70
|
+
return contextStore.getStore()?.parentAgentId;
|
|
34
71
|
}
|
|
35
72
|
/**
|
|
36
73
|
* COA-2636, under COA-2634. An agent that does not say which version it is, is an agent whose
|
|
@@ -85,10 +122,14 @@ export function resetVersionWarnings() {
|
|
|
85
122
|
* Through `log.warn`, never a bare `console.warn`: COA-2192 made every diagnostic in this SDK
|
|
86
123
|
* routable into the host's own logging and silenceable with `register({ logger: null })`, and a
|
|
87
124
|
* library that writes unconditionally to a production service's stderr is a defect on its own.
|
|
125
|
+
* A context nested in the same agent inherits that agent's version, so it is not warned about.
|
|
88
126
|
*/
|
|
89
127
|
function warnMissingVersion(options) {
|
|
90
128
|
if (options.version !== undefined)
|
|
91
129
|
return;
|
|
130
|
+
const outer = contextStore.getStore();
|
|
131
|
+
if (outer?.agentId === options.agentId && outer.version !== undefined)
|
|
132
|
+
return;
|
|
92
133
|
if (warnedMissingVersion.has(options.agentId))
|
|
93
134
|
return;
|
|
94
135
|
if (warnedMissingVersion.size >= MISSING_VERSION_WARNING_CAP)
|
|
@@ -96,87 +137,149 @@ function warnMissingVersion(options) {
|
|
|
96
137
|
warnedMissingVersion.add(options.agentId);
|
|
97
138
|
log.warn(missingVersionGuidance(options.agentId));
|
|
98
139
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
140
|
+
/**
|
|
141
|
+
* The context an invocation opens, resolved against the one it opens inside.
|
|
142
|
+
*
|
|
143
|
+
* An inner context wins for every value it is given. Inside a *different* agent it names that
|
|
144
|
+
* agent as its parent, carries `requestId` and `runId`, and inherits neither the version nor the
|
|
145
|
+
* prompt: those belong to the outer agent. Inside the *same* agent it inherits everything and names
|
|
146
|
+
* no parent. A top-level context starts from the startup prompt, if getPrompt() fetched one.
|
|
147
|
+
*/
|
|
148
|
+
function resolveContext(options) {
|
|
149
|
+
const outer = contextStore.getStore();
|
|
150
|
+
const sameAgent = outer !== undefined && outer.agentId === options.agentId;
|
|
151
|
+
let inherited;
|
|
152
|
+
if (outer === undefined) {
|
|
153
|
+
inherited = { promptVersion: _startupPrompt?.version, promptType: _startupPrompt?.type };
|
|
106
154
|
}
|
|
107
|
-
if (
|
|
108
|
-
|
|
155
|
+
else if (sameAgent) {
|
|
156
|
+
inherited = outer;
|
|
109
157
|
}
|
|
110
|
-
|
|
111
|
-
|
|
158
|
+
else {
|
|
159
|
+
inherited = { parentAgentId: outer.agentId };
|
|
112
160
|
}
|
|
161
|
+
const promptGiven = options.promptVersion !== undefined;
|
|
162
|
+
return {
|
|
163
|
+
agentId: options.agentId,
|
|
164
|
+
parentAgentId: inherited.parentAgentId,
|
|
165
|
+
requestId: options.requestId ?? outer?.requestId,
|
|
166
|
+
runId: options.runId ?? outer?.runId,
|
|
167
|
+
version: options.version ?? inherited.version,
|
|
168
|
+
promptVersion: promptGiven ? options.promptVersion : inherited.promptVersion,
|
|
169
|
+
promptType: options.promptType ?? inherited.promptType ?? (promptGiven ? "system" : undefined),
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
/** The `coalex.*` attributes a context puts on its spans, in the propagator's order. */
|
|
173
|
+
export function contextAttributes(ctx) {
|
|
174
|
+
const attrs = { "coalex.agent_id": ctx.agentId };
|
|
175
|
+
if (ctx.parentAgentId !== undefined)
|
|
176
|
+
attrs["coalex.parent_agent_id"] = ctx.parentAgentId;
|
|
177
|
+
if (ctx.requestId !== undefined)
|
|
178
|
+
attrs["coalex.request_id"] = ctx.requestId;
|
|
179
|
+
if (ctx.runId !== undefined)
|
|
180
|
+
attrs["coalex.run_id"] = ctx.runId;
|
|
181
|
+
if (ctx.version !== undefined)
|
|
182
|
+
attrs["coalex.agent_version"] = ctx.version;
|
|
183
|
+
if (ctx.promptVersion !== undefined)
|
|
184
|
+
attrs["coalex.prompt_version"] = ctx.promptVersion;
|
|
185
|
+
if (ctx.promptType !== undefined)
|
|
186
|
+
attrs["coalex.prompt_type"] = ctx.promptType;
|
|
113
187
|
return attrs;
|
|
114
188
|
}
|
|
115
189
|
/**
|
|
116
|
-
*
|
|
117
|
-
*
|
|
118
|
-
*
|
|
119
|
-
*
|
|
120
|
-
* concurrent invocations with *different* versions the last write wins (same caveat as getPrompt()).
|
|
190
|
+
* The LangGraph errors that carry a pause or a hand-off up through a node, not a failure.
|
|
191
|
+
* Recognised by name on the error and on every class of its prototype chain, so this SDK never
|
|
192
|
+
* imports LangGraph, a subclass (`NodeInterrupt`) is recognised, and so is a bundled copy whose
|
|
193
|
+
* class names were minified (LangGraph sets `name` on each).
|
|
121
194
|
*/
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
195
|
+
export const PAUSE_ERROR_NAMES = new Set([
|
|
196
|
+
"GraphBubbleUp",
|
|
197
|
+
"GraphInterrupt",
|
|
198
|
+
"ParentCommand",
|
|
199
|
+
]);
|
|
200
|
+
export function isPause(e) {
|
|
201
|
+
if (typeof e !== "object" || e === null)
|
|
202
|
+
return false;
|
|
203
|
+
if (PAUSE_ERROR_NAMES.has(String(e.name)))
|
|
204
|
+
return true;
|
|
205
|
+
for (let proto = Object.getPrototypeOf(e); proto !== null; proto = Object.getPrototypeOf(proto)) {
|
|
206
|
+
const ctor = proto.constructor;
|
|
207
|
+
if (ctor && PAUSE_ERROR_NAMES.has(String(ctor.name)))
|
|
208
|
+
return true;
|
|
209
|
+
}
|
|
210
|
+
return false;
|
|
211
|
+
}
|
|
212
|
+
/** A pause ends the span OK with no exception event; anything else ends it ERROR. */
|
|
213
|
+
function endOnError(span, e) {
|
|
214
|
+
if (isPause(e)) {
|
|
215
|
+
span.setStatus({ code: SpanStatusCode.OK });
|
|
216
|
+
return;
|
|
125
217
|
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
return () => (prev ? setLastPrompt(prev.version, prev.type) : clearLastPrompt());
|
|
218
|
+
span.setStatus({ code: SpanStatusCode.ERROR, message: String(e) });
|
|
219
|
+
span.recordException(e instanceof Error ? e : new Error(String(e)));
|
|
129
220
|
}
|
|
221
|
+
/**
|
|
222
|
+
* Run `fn` inside a `coalex.invocation` span for `options.agentId`; every span started inside it
|
|
223
|
+
* carries the context's `coalex.*` attributes.
|
|
224
|
+
*
|
|
225
|
+
* Nested inside another agent's context it sets `coalex.parent_agent_id` to that agent, carries
|
|
226
|
+
* `requestId` and `runId`, and inherits neither version nor prompt; inside the same agent it
|
|
227
|
+
* inherits everything. A LangGraph pause (`GraphBubbleUp`, `GraphInterrupt`, `ParentCommand`)
|
|
228
|
+
* ends the span OK and is re-thrown; any other error ends it ERROR.
|
|
229
|
+
*/
|
|
130
230
|
export async function coalexContext(options, fn) {
|
|
131
231
|
const tracer = trace.getTracer("coalex");
|
|
132
232
|
warnMissingVersion(options);
|
|
133
|
-
const
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
span.end();
|
|
149
|
-
}
|
|
150
|
-
}));
|
|
151
|
-
}
|
|
152
|
-
finally {
|
|
153
|
-
restorePrompt();
|
|
154
|
-
}
|
|
233
|
+
const ctx = resolveContext(options);
|
|
234
|
+
return contextStore.run(ctx, () => tracer.startActiveSpan("coalex.invocation", { attributes: contextAttributes(ctx) }, async (span) => {
|
|
235
|
+
try {
|
|
236
|
+
const result = await fn();
|
|
237
|
+
span.setStatus({ code: SpanStatusCode.OK });
|
|
238
|
+
return result;
|
|
239
|
+
}
|
|
240
|
+
catch (e) {
|
|
241
|
+
endOnError(span, e);
|
|
242
|
+
throw e;
|
|
243
|
+
}
|
|
244
|
+
finally {
|
|
245
|
+
span.end();
|
|
246
|
+
}
|
|
247
|
+
}));
|
|
155
248
|
}
|
|
156
249
|
export function coalexContextSync(options, fn) {
|
|
157
250
|
const tracer = trace.getTracer("coalex");
|
|
158
251
|
warnMissingVersion(options);
|
|
159
|
-
const
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
252
|
+
const ctx = resolveContext(options);
|
|
253
|
+
return contextStore.run(ctx, () => tracer.startActiveSpan("coalex.invocation", { attributes: contextAttributes(ctx) }, (span) => {
|
|
254
|
+
try {
|
|
255
|
+
const result = fn();
|
|
256
|
+
span.setStatus({ code: SpanStatusCode.OK });
|
|
257
|
+
return result;
|
|
258
|
+
}
|
|
259
|
+
catch (e) {
|
|
260
|
+
endOnError(span, e);
|
|
261
|
+
throw e;
|
|
262
|
+
}
|
|
263
|
+
finally {
|
|
264
|
+
span.end();
|
|
265
|
+
}
|
|
266
|
+
}));
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* Wrap a LangGraph node function so everything it does belongs to `agentId`.
|
|
270
|
+
*
|
|
271
|
+
* Wrap the **node function**, not the graph's `invoke`: LangGraph re-executes the node from the
|
|
272
|
+
* top on every resume (`new Command({ resume })`), so the context opens again for the resumed work
|
|
273
|
+
* and the node's checkpoint namespace is unchanged. The context carries the enclosing `requestId`
|
|
274
|
+
* and `runId`, names the enclosing agent as `coalex.parent_agent_id`, and a pause (`interrupt()`)
|
|
275
|
+
* leaves its span OK. Every argument (`state`, `config`) is passed through.
|
|
276
|
+
*
|
|
277
|
+
* graph.addNode("w1_rfq", agentNode("rfq-worker", rfqWorker, { version: "1.4.0" }));
|
|
278
|
+
*/
|
|
279
|
+
export function agentNode(agentId, fn, options = {}) {
|
|
280
|
+
const { version } = options;
|
|
281
|
+
// Warned when the node is built, where the caller can act on it, not on every execution.
|
|
282
|
+
warnMissingVersion({ agentId, version });
|
|
283
|
+
return (...args) => coalexContext({ agentId, version }, () => fn(...args));
|
|
181
284
|
}
|
|
182
285
|
//# sourceMappingURL=context.js.map
|
package/dist/context.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAE3D,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAiBlC,MAAM,YAAY,GAAG,IAAI,iBAAiB,EAAiB,CAAC;AAE5D,+FAA+F;AAC/F,MAAM,UAAU,aAAa;IAC3B,OAAO,YAAY,CAAC,QAAQ,EAAE,CAAC;AACjC,CAAC;AAED;;;;;GAKG;AACH,IAAI,cAAc,GAA6C,IAAI,CAAC;AAEpE;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,OAAe,EAAE,IAAY;IACzD,MAAM,MAAM,GAAG,YAAY,CAAC,QAAQ,EAAE,CAAC;IACvC,IAAI,MAAM,EAAE,CAAC;QACX,MAAM,CAAC,aAAa,GAAG,OAAO,CAAC;QAC/B,MAAM,CAAC,UAAU,GAAG,IAAI,CAAC;QACzB,OAAO;IACT,CAAC;IACD,cAAc,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AACrC,CAAC;AAED,oFAAoF;AACpF,MAAM,UAAU,aAAa;IAC3B,MAAM,MAAM,GAAG,YAAY,CAAC,QAAQ,EAAE,CAAC;IACvC,IAAI,MAAM,EAAE,CAAC;QACX,OAAO,MAAM,CAAC,aAAa,KAAK,SAAS;YACvC,CAAC,CAAC,IAAI;YACN,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,aAAa,EAAE,IAAI,EAAE,MAAM,CAAC,UAAU,IAAI,QAAQ,EAAE,CAAC;I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U,EAAE,iBAAiB,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,IAAI,EAAE,EAAE;QAC3F,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,EAAE,EAAE,CAAC;YACpB,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,cAAc,CAAC,EAAE,EAAE,CAAC,CAAC;YAC5C,OAAO,MAAM,CAAC;QAChB,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,UAAU,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;YACpB,MAAM,CAAC,CAAC;QACV,CAAC;gBAAS,CAAC;YACT,IAAI,CAAC,GAAG,EAAE,CAAC;QACb,CAAC;IACH,CAAC,CAAC,CACH,CAAC;AACJ,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,SAAS,CACvB,OAAe,EACf,EAAkC,EAClC,UAAgC,EAAE;IAElC,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IAC5B,yFAAyF;IACzF,kBAAkB,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;IACzC,OAAO,CAAC,GAAG,IAAO,EAAE,EAAE,CAAC,aAAa,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;AAChF,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { CoalexConfig } from "./config.js";
|
|
|
2
2
|
import type { AgentInventory } from "./inventory.js";
|
|
3
3
|
import { type CoalexLogger } from "./logger.js";
|
|
4
4
|
export type { CoalexConfig } from "./config.js";
|
|
5
|
-
export { coalexContext, coalexContextSync, currentAgentId } from "./context.js";
|
|
5
|
+
export { agentNode, coalexContext, coalexContextSync, currentAgentId, currentAgentVersion, currentParentAgentId, currentRequestId, currentRunId, } from "./context.js";
|
|
6
6
|
export type { CoalexContextOptions } from "./context.js";
|
|
7
7
|
export { evaluate, KNOWN_METRICS } from "./evaluate.js";
|
|
8
8
|
export type { EvaluateOptions, EvaluationDecision } from "./evaluate.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAKhD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAa,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3D,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAKhD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAa,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3D,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EACL,SAAS,EACT,aAAa,EACb,iBAAiB,EACjB,cAAc,EACd,mBAAmB,EACnB,oBAAoB,EACpB,gBAAgB,EAChB,YAAY,GACb,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACxD,YAAY,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACzE,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAIxD,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACpE,YAAY,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACxD,YAAY,EAAE,cAAc,EAAE,gBAAg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,OAAO,CAAC;IAC/B;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,YAAY,GAAG,IAAI,CAAC;IAC7B;;;;OAIG;IACH,OAAO,CAAC,EAAE,cAAc,CAAC;CAC1B;AAED,wBAAgB,QAAQ,CAAC,OAAO,CAAC,EAAE,eAAe,GAAG,IAAI,CAuCxD;AAED,0CAA0C;AAC1C,wBAAgB,gBAAgB,IAAI,IAAI,CAGvC"}
|
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import { FilteringSpanExporter } from "./filtering-exporter.js";
|
|
|
9
9
|
import { CoalexAttributePropagator } from "./span-processor.js";
|
|
10
10
|
import { declareInventory } from "./inventory.js";
|
|
11
11
|
import { setLogger } from "./logger.js";
|
|
12
|
-
export { coalexContext, coalexContextSync, currentAgentId } from "./context.js";
|
|
12
|
+
export { agentNode, coalexContext, coalexContextSync, currentAgentId, currentAgentVersion, currentParentAgentId, currentRequestId, currentRunId, } from "./context.js";
|
|
13
13
|
export { evaluate, KNOWN_METRICS } from "./evaluate.js";
|
|
14
14
|
export { resolve, VALID_DECISIONS } from "./resolve.js";
|
|
15
15
|
// What ran while the platform was unreachable (COA-2394). Python has had this since COA-2197 and
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAC5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAGxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,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|
|
|
1
1
|
import type { Context } from "@opentelemetry/api";
|
|
2
2
|
import type { ReadableSpan, Span, SpanProcessor } from "@opentelemetry/sdk-trace-base";
|
|
3
|
+
export declare const ATTRIBUTES_TO_PROPAGATE: readonly ["coalex.agent_id", "coalex.parent_agent_id", "coalex.request_id", "coalex.run_id", "coalex.agent_version", "coalex.prompt_version", "coalex.prompt_type"];
|
|
4
|
+
/**
|
|
5
|
+
* Puts the `coalex.*` attributes of the active coalexContext() on every span it starts.
|
|
6
|
+
*
|
|
7
|
+
* Each attribute comes from the **active Coalex context first**, and from the parent span only when
|
|
8
|
+
* no Coalex context is active. The parent span is not trusted over the context: a framework
|
|
9
|
+
* instrumentor (OpenInference LangChain) parents its spans on its own run tree, so a worker's LLM
|
|
10
|
+
* span can have the orchestrator's span as its parent. Inside a context, an attribute the context
|
|
11
|
+
* does not hold is left unset, so a worker never carries its orchestrator's version or prompt.
|
|
12
|
+
* Outside any context, a startup getPrompt() still attributes spans no parent attributes. A value
|
|
13
|
+
* the span already carries is never overwritten.
|
|
14
|
+
*/
|
|
3
15
|
export declare class CoalexAttributePropagator implements SpanProcessor {
|
|
4
16
|
onStart(span: Span, parentContext: Context): void;
|
|
5
17
|
onEnd(span: ReadableSpan): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"span-processor.d.ts","sourceRoot":"","sources":["../src/span-processor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"span-processor.d.ts","sourceRoot":"","sources":["../src/span-processor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAIvF,eAAO,MAAM,uBAAuB,qKAQ1B,CAAC;AAEX;;;;;;;;;;GAUG;AACH,qBAAa,yBAA0B,YAAW,aAAa;IAC7D,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,aAAa,EAAE,OAAO,GAAG,IAAI;IA+BjD,KAAK,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI;IAG/B,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAGzB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;CAG5B"}
|
package/dist/span-processor.js
CHANGED
|
@@ -1,13 +1,26 @@
|
|
|
1
1
|
import { trace } from "@opentelemetry/api";
|
|
2
2
|
import { spanContextBridge } from "./ext/context-bridge.js";
|
|
3
|
-
import { getLastPrompt } from "./context.js";
|
|
4
|
-
const ATTRIBUTES_TO_PROPAGATE = [
|
|
3
|
+
import { activeContext, contextAttributes, getLastPrompt } from "./context.js";
|
|
4
|
+
export const ATTRIBUTES_TO_PROPAGATE = [
|
|
5
5
|
"coalex.agent_id",
|
|
6
|
+
"coalex.parent_agent_id",
|
|
6
7
|
"coalex.request_id",
|
|
8
|
+
"coalex.run_id",
|
|
7
9
|
"coalex.agent_version",
|
|
8
10
|
"coalex.prompt_version",
|
|
9
11
|
"coalex.prompt_type",
|
|
10
12
|
];
|
|
13
|
+
/**
|
|
14
|
+
* Puts the `coalex.*` attributes of the active coalexContext() on every span it starts.
|
|
15
|
+
*
|
|
16
|
+
* Each attribute comes from the **active Coalex context first**, and from the parent span only when
|
|
17
|
+
* no Coalex context is active. The parent span is not trusted over the context: a framework
|
|
18
|
+
* instrumentor (OpenInference LangChain) parents its spans on its own run tree, so a worker's LLM
|
|
19
|
+
* span can have the orchestrator's span as its parent. Inside a context, an attribute the context
|
|
20
|
+
* does not hold is left unset, so a worker never carries its orchestrator's version or prompt.
|
|
21
|
+
* Outside any context, a startup getPrompt() still attributes spans no parent attributes. A value
|
|
22
|
+
* the span already carries is never overwritten.
|
|
23
|
+
*/
|
|
11
24
|
export class CoalexAttributePropagator {
|
|
12
25
|
onStart(span, parentContext) {
|
|
13
26
|
// Track ALL spans in the context bridge for ext wrapper parenting.
|
|
@@ -15,25 +28,26 @@ export class CoalexAttributePropagator {
|
|
|
15
28
|
// and sets openinference.span.kind only at onEnd time. So we track all
|
|
16
29
|
// spans — the bridge returns the most recently active span in the trace.
|
|
17
30
|
spanContextBridge.push(span, parentContext);
|
|
18
|
-
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
if (parentValue !== undefined) {
|
|
24
|
-
span.setAttribute(attrName, parentValue);
|
|
25
|
-
}
|
|
31
|
+
const own = span.attributes ?? {};
|
|
32
|
+
const active = activeContext();
|
|
33
|
+
let values;
|
|
34
|
+
if (active) {
|
|
35
|
+
values = contextAttributes(active);
|
|
26
36
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
if (
|
|
33
|
-
|
|
37
|
+
else {
|
|
38
|
+
const parentSpan = trace.getSpan(parentContext);
|
|
39
|
+
const parentAttrs = parentSpan ? parentSpan.attributes : undefined;
|
|
40
|
+
values = { ...parentAttrs };
|
|
41
|
+
const prompt = getLastPrompt();
|
|
42
|
+
if (prompt) {
|
|
43
|
+
values["coalex.prompt_version"] ??= prompt.version;
|
|
44
|
+
values["coalex.prompt_type"] ??= prompt.type;
|
|
34
45
|
}
|
|
35
|
-
|
|
36
|
-
|
|
46
|
+
}
|
|
47
|
+
for (const attrName of ATTRIBUTES_TO_PROPAGATE) {
|
|
48
|
+
const value = values[attrName];
|
|
49
|
+
if (value !== undefined && own[attrName] === undefined) {
|
|
50
|
+
span.setAttribute(attrName, value);
|
|
37
51
|
}
|
|
38
52
|
}
|
|
39
53
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"span-processor.js","sourceRoot":"","sources":["../src/span-processor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAA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AI,MAAM,EAAE,CAAC;gBACX,MAAM,CAAC,uBAAuB,CAAC,KAAK,MAAM,CAAC,OAAO,CAAC;gBACnD,MAAM,CAAC,oBAAoB,CAAC,KAAK,MAAM,CAAC,IAAI,CAAC;YAC/C,CAAC;QACH,CAAC;QAED,KAAK,MAAM,QAAQ,IAAI,uBAAuB,EAAE,CAAC;YAC/C,MAAM,KAAK,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;YAC/B,IAAI,KAAK,KAAK,SAAS,IAAI,GAAG,CAAC,QAAQ,CAAC,KAAK,SAAS,EAAE,CAAC;gBACvD,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE,KAAwB,CAAC,CAAC;YACxD,CAAC;QACH,CAAC;IACH,CAAC;IAED,KAAK,CAAC,IAAkB;QACtB,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;IAC5C,CAAC;IACD,QAAQ;QACN,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IACD,UAAU;QACR,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;CACF"}
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "2.
|
|
1
|
+
export declare const VERSION = "2.3.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/version.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SDK version, sent in the X-SDK-Version header so the platform can see which
|
|
2
2
|
// SDK releases customers run before removing a deprecated field (COA-261).
|
|
3
3
|
// Keep in sync with package.json "version".
|
|
4
|
-
export const VERSION = "2.
|
|
4
|
+
export const VERSION = "2.3.0";
|
|
5
5
|
//# sourceMappingURL=version.js.map
|