@exellix/graph-engine 7.2.13 → 7.2.15
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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 7.2.14
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
|
|
7
|
+
- **`test:live` / Node ESM:** Load `@x12i/logxer` via dynamic import in `graphEngineLogxer` (avoids CJS `trails` → `require('nanoid')` `ERR_REQUIRE_ESM` on Node 22). Inline run-log diagnostic normalization in `buildRunLog` (no static logxer import).
|
|
8
|
+
- **Live script:** Remove redundant direct `@x12i/logxer` import; use `GRAPH_ENGINE_LOGS_LEVEL` / `LOGXER_PACKAGE_LEVELS` env instead.
|
|
9
|
+
|
|
3
10
|
## 7.2.13
|
|
4
11
|
|
|
5
12
|
### Added
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { normalizeLogRecord } from '@x12i/logxer';
|
|
2
1
|
import { AI_TASKS_LOGXER_RUN_ID_METADATA_KEY, AI_TASKS_RUN_LOG_METADATA_KEY, DEFAULT_MAX_RUN_LOG_DATA_JSON_CHARS, DEFAULT_MAX_RUN_LOG_ENTRIES, } from '../types/runLog.js';
|
|
3
2
|
function safeJsonLen(value) {
|
|
4
3
|
try {
|
|
@@ -38,6 +37,22 @@ function isRunLogScope(x) {
|
|
|
38
37
|
x === 'logxer' ||
|
|
39
38
|
x === 'pipeline');
|
|
40
39
|
}
|
|
40
|
+
/** Read promoted diagnostic fields without importing @x12i/logxer at module load. */
|
|
41
|
+
function normalizeRunLogDiagnostics(row) {
|
|
42
|
+
const data = row.data != null && typeof row.data === 'object' && !Array.isArray(row.data)
|
|
43
|
+
? row.data
|
|
44
|
+
: undefined;
|
|
45
|
+
const codeRaw = row.code ?? data?.code;
|
|
46
|
+
const code = typeof codeRaw === 'string' && codeRaw.length > 0 ? codeRaw : undefined;
|
|
47
|
+
const diagRaw = row.diagnostics ?? data?.diagnostics;
|
|
48
|
+
const diagnostics = diagRaw != null && typeof diagRaw === 'object' && !Array.isArray(diagRaw)
|
|
49
|
+
? diagRaw
|
|
50
|
+
: undefined;
|
|
51
|
+
return {
|
|
52
|
+
...(code ? { code } : {}),
|
|
53
|
+
...(diagnostics ? { diagnostics } : {}),
|
|
54
|
+
};
|
|
55
|
+
}
|
|
41
56
|
/** Normalize @exellix/ai-tasks epoch-ms or ISO `ts` to epoch ms for exellix-graph `RunLogEntry`. */
|
|
42
57
|
export function parseRunLogEntryTs(v) {
|
|
43
58
|
if (typeof v === 'number' && Number.isFinite(v))
|
|
@@ -69,9 +84,7 @@ export function normalizeExternalRunLogEntries(raw) {
|
|
|
69
84
|
? r.correlationIds
|
|
70
85
|
: undefined;
|
|
71
86
|
const data = 'data' in r ? r.data : undefined;
|
|
72
|
-
const
|
|
73
|
-
const code = typeof normalized.code === 'string' && normalized.code.length > 0 ? normalized.code : undefined;
|
|
74
|
-
const diagnostics = normalized.diagnostics;
|
|
87
|
+
const { code, diagnostics } = normalizeRunLogDiagnostics(r);
|
|
75
88
|
const debugKind = typeof r.debugKind === 'string' && r.debugKind.length > 0
|
|
76
89
|
? r.debugKind
|
|
77
90
|
: undefined;
|
|
@@ -1,35 +1,24 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Graph-engine Logxer integration (@x12i/logxer 4.5.x).
|
|
3
|
-
*
|
|
3
|
+
* Dynamic import defers loading @x12i/logxer until this module is evaluated (type-only imports stay erased).
|
|
4
4
|
*/
|
|
5
|
-
import { DebugLogAbstract, exceptionEvidence, fieldEvidence, runWithLogContext, patchLogContext } from '@x12i/logxer';
|
|
6
5
|
import type { GetJobLogsInput, GetJobLogsResult, Logxer, LogRuntimeContext, StackLoggingOptions } from '@x12i/logxer';
|
|
7
6
|
import type { LogxerQueryableClient, RuntimeObjects } from './runtimeObjects.js';
|
|
8
7
|
/** Env prefix for package-level log level: `GRAPH_ENGINE_LOGS_LEVEL` (canonical). */
|
|
9
8
|
export declare const GRAPH_ENGINE_LOGXER_ENV_PREFIX: "GRAPH_ENGINE";
|
|
10
|
-
/**
|
|
11
|
-
* Factory for a graph-engine Logxer instance.
|
|
12
|
-
* Pass `logging` from host {@link StackLoggingOptions} (logxer 4.5+ stack pass-through).
|
|
13
|
-
*/
|
|
9
|
+
/** Factory for a graph-engine Logxer instance (logxer 4.5+ stack pass-through). */
|
|
14
10
|
export declare function createGraphEngineLogxer(options?: {
|
|
15
11
|
logging?: StackLoggingOptions;
|
|
16
12
|
}): Logxer;
|
|
17
13
|
/** Default process logger (env / host registry). Lazily created without stack overrides. */
|
|
18
14
|
export declare function getGraphEngineLogxer(): Logxer;
|
|
19
|
-
|
|
20
|
-
export declare function bindGraphEngineRunLogxer(logxer: Logxer): void;
|
|
15
|
+
export declare function bindGraphEngineRunLogxer(instance: Logxer): void;
|
|
21
16
|
export declare function clearGraphEngineRunLogxer(): void;
|
|
22
|
-
|
|
23
|
-
export declare function
|
|
24
|
-
/** Attach graph-level Logxer query client when hosts omit one on runtimeObjects. */
|
|
25
|
-
export declare function ensureGraphEngineLogxerOnRuntimeObjects(runtimeObjects: RuntimeObjects | undefined, logxer?: Logxer): void;
|
|
26
|
-
/** Run graph work with Logxer correlation ids (jobId, taskId, graphId, runId). */
|
|
17
|
+
export declare function createGraphEngineLogxerClient(instance?: Logxer): LogxerQueryableClient;
|
|
18
|
+
export declare function ensureGraphEngineLogxerOnRuntimeObjects(runtimeObjects: RuntimeObjects | undefined, instance?: Logxer): void;
|
|
27
19
|
export declare function runGraphWithLogContext<T>(ctx: LogRuntimeContext, fn: () => T | Promise<T>): Promise<T>;
|
|
28
|
-
/** Narrow node-scoped correlation inside an active graph run context. */
|
|
29
20
|
export declare function patchGraphNodeLogContext(nodeId: string): void;
|
|
30
|
-
/** Gated verbose/state traces (replaces DEBUG_EXECUTION_MEMORY / DEBUG_OUTPUT_MAPPING console.log). */
|
|
31
21
|
export declare function traceExecutionMemory(scope: 'executeNode' | 'executeGraph', message: string, data?: Record<string, unknown>): void;
|
|
32
|
-
/** Emit a catalog-backed graph error log when a node/graph failure occurs. */
|
|
33
22
|
export declare function logGraphEngineErrorCode(code: string, _message: string, ctx: {
|
|
34
23
|
graphId?: string;
|
|
35
24
|
nodeId?: string;
|
|
@@ -38,5 +27,15 @@ export declare function logGraphEngineErrorCode(code: string, _message: string,
|
|
|
38
27
|
error?: unknown;
|
|
39
28
|
evidence?: Record<string, unknown>;
|
|
40
29
|
}): void;
|
|
41
|
-
export
|
|
30
|
+
export declare const DebugLogAbstract: {
|
|
31
|
+
readonly STATE: "STATE";
|
|
32
|
+
readonly INTENT: "INTENT";
|
|
33
|
+
readonly EVENT: "EVENT";
|
|
34
|
+
readonly TRACE: "TRACE";
|
|
35
|
+
readonly ANOMALY: "ANOMALY";
|
|
36
|
+
};
|
|
37
|
+
export declare const fieldEvidence: typeof import("@x12i/logxer").fieldEvidence;
|
|
38
|
+
export declare const exceptionEvidence: typeof import("@x12i/logxer").exceptionEvidence;
|
|
39
|
+
export declare const runWithLogContext: typeof import("@x12i/logxer").runWithLogContext;
|
|
40
|
+
export declare const patchLogContext: typeof import("@x12i/logxer").patchLogContext;
|
|
42
41
|
export type { GetJobLogsInput, GetJobLogsResult, LogRuntimeContext, StackLoggingOptions };
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* Graph-engine Logxer integration (@x12i/logxer 4.5.x).
|
|
3
|
-
* Structured runtime logs, correlation context, stack log-level pass-through, and queryable in-process logs.
|
|
4
|
-
*/
|
|
5
|
-
import { createLogxer, DebugLogAbstract, exceptionEvidence, fieldEvidence, runWithLogContext, patchLogContext, } from '@x12i/logxer';
|
|
1
|
+
const logxer = await import('@x12i/logxer');
|
|
6
2
|
import { ExellixGraphErrorCode } from '../errors/exellixGraphErrorCodes.js';
|
|
7
3
|
import { EXELLIX_GRAPH_RUNTIME_PACKAGE_NAME } from './runtimeObjects.js';
|
|
8
4
|
/** Env prefix for package-level log level: `GRAPH_ENGINE_LOGS_LEVEL` (canonical). */
|
|
@@ -86,12 +82,9 @@ function buildGraphEngineLogxerConfig(logging) {
|
|
|
86
82
|
...(logging ? { stack: logging } : {}),
|
|
87
83
|
};
|
|
88
84
|
}
|
|
89
|
-
/**
|
|
90
|
-
* Factory for a graph-engine Logxer instance.
|
|
91
|
-
* Pass `logging` from host {@link StackLoggingOptions} (logxer 4.5+ stack pass-through).
|
|
92
|
-
*/
|
|
85
|
+
/** Factory for a graph-engine Logxer instance (logxer 4.5+ stack pass-through). */
|
|
93
86
|
export function createGraphEngineLogxer(options) {
|
|
94
|
-
return createLogxer({
|
|
87
|
+
return logxer.createLogxer({
|
|
95
88
|
packageName: EXELLIX_GRAPH_RUNTIME_PACKAGE_NAME,
|
|
96
89
|
envPrefix: GRAPH_ENGINE_LOGXER_ENV_PREFIX,
|
|
97
90
|
debugNamespace: 'graph-engine',
|
|
@@ -104,37 +97,31 @@ export function getGraphEngineLogxer() {
|
|
|
104
97
|
}
|
|
105
98
|
return activeRunLogxer ?? defaultLogxer;
|
|
106
99
|
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
activeRunLogxer = logxer;
|
|
100
|
+
export function bindGraphEngineRunLogxer(instance) {
|
|
101
|
+
activeRunLogxer = instance;
|
|
110
102
|
}
|
|
111
103
|
export function clearGraphEngineRunLogxer() {
|
|
112
104
|
activeRunLogxer = undefined;
|
|
113
105
|
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
const target = logxer ?? getGraphEngineLogxer();
|
|
106
|
+
export function createGraphEngineLogxerClient(instance) {
|
|
107
|
+
const target = instance ?? getGraphEngineLogxer();
|
|
117
108
|
return {
|
|
118
109
|
getJobLogs(input) {
|
|
119
110
|
return target.getJobLogs(input);
|
|
120
111
|
},
|
|
121
112
|
};
|
|
122
113
|
}
|
|
123
|
-
|
|
124
|
-
export function ensureGraphEngineLogxerOnRuntimeObjects(runtimeObjects, logxer) {
|
|
114
|
+
export function ensureGraphEngineLogxerOnRuntimeObjects(runtimeObjects, instance) {
|
|
125
115
|
if (!runtimeObjects || runtimeObjects.logxerClient != null)
|
|
126
116
|
return;
|
|
127
|
-
runtimeObjects.logxerClient = createGraphEngineLogxerClient(
|
|
117
|
+
runtimeObjects.logxerClient = createGraphEngineLogxerClient(instance);
|
|
128
118
|
}
|
|
129
|
-
/** Run graph work with Logxer correlation ids (jobId, taskId, graphId, runId). */
|
|
130
119
|
export function runGraphWithLogContext(ctx, fn) {
|
|
131
|
-
return runWithLogContext(ctx, fn);
|
|
120
|
+
return logxer.runWithLogContext(ctx, fn);
|
|
132
121
|
}
|
|
133
|
-
/** Narrow node-scoped correlation inside an active graph run context. */
|
|
134
122
|
export function patchGraphNodeLogContext(nodeId) {
|
|
135
|
-
patchLogContext({ nodeId });
|
|
123
|
+
logxer.patchLogContext({ nodeId });
|
|
136
124
|
}
|
|
137
|
-
/** Gated verbose/state traces (replaces DEBUG_EXECUTION_MEMORY / DEBUG_OUTPUT_MAPPING console.log). */
|
|
138
125
|
export function traceExecutionMemory(scope, message, data) {
|
|
139
126
|
if (process.env.DEBUG_EXECUTION_MEMORY !== 'true' &&
|
|
140
127
|
process.env.DEBUG_OUTPUT_MAPPING !== 'true') {
|
|
@@ -143,23 +130,26 @@ export function traceExecutionMemory(scope, message, data) {
|
|
|
143
130
|
getGraphEngineLogxer().verbose(message, {
|
|
144
131
|
scope,
|
|
145
132
|
...data,
|
|
146
|
-
debugKind: DebugLogAbstract.STATE,
|
|
133
|
+
debugKind: logxer.DebugLogAbstract.STATE,
|
|
147
134
|
});
|
|
148
135
|
}
|
|
149
|
-
/** Emit a catalog-backed graph error log when a node/graph failure occurs. */
|
|
150
136
|
export function logGraphEngineErrorCode(code, _message, ctx) {
|
|
151
|
-
const
|
|
137
|
+
const instance = getGraphEngineLogxer();
|
|
152
138
|
const evidence = [
|
|
153
|
-
...(ctx.error != null ? [exceptionEvidence(ctx.error)] : []),
|
|
154
|
-
...Object.entries(ctx.evidence ?? {}).map(([path, value]) => fieldEvidence(path, value)),
|
|
139
|
+
...(ctx.error != null ? [logxer.exceptionEvidence(ctx.error)] : []),
|
|
140
|
+
...Object.entries(ctx.evidence ?? {}).map(([path, value]) => logxer.fieldEvidence(path, value)),
|
|
155
141
|
];
|
|
156
|
-
|
|
142
|
+
instance.errorCode(code, {
|
|
157
143
|
graphId: ctx.graphId,
|
|
158
144
|
nodeId: ctx.nodeId,
|
|
159
145
|
jobId: ctx.jobId,
|
|
160
146
|
taskId: ctx.taskId,
|
|
161
|
-
debugKind: DebugLogAbstract.ANOMALY,
|
|
147
|
+
debugKind: logxer.DebugLogAbstract.ANOMALY,
|
|
162
148
|
...(evidence.length ? { evidence } : {}),
|
|
163
149
|
});
|
|
164
150
|
}
|
|
165
|
-
export
|
|
151
|
+
export const DebugLogAbstract = logxer.DebugLogAbstract;
|
|
152
|
+
export const fieldEvidence = logxer.fieldEvidence;
|
|
153
|
+
export const exceptionEvidence = logxer.exceptionEvidence;
|
|
154
|
+
export const runWithLogContext = logxer.runWithLogContext;
|
|
155
|
+
export const patchLogContext = logxer.patchLogContext;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exellix/graph-engine",
|
|
3
|
-
"version": "7.2.
|
|
3
|
+
"version": "7.2.15",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Graph executor SDK",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
@@ -50,19 +50,19 @@
|
|
|
50
50
|
"access": "public"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@exellix/ai-tasks": "^8.1.
|
|
53
|
+
"@exellix/ai-tasks": "^8.1.15",
|
|
54
54
|
"@x12i/activix": "8.3.1",
|
|
55
55
|
"@x12i/ai-profiles": "1.6.0",
|
|
56
|
-
"@x12i/catalox": "5.1.
|
|
56
|
+
"@x12i/catalox": "5.1.2",
|
|
57
57
|
"@x12i/env": "4.0.1",
|
|
58
58
|
"@x12i/funcx": "4.2.2",
|
|
59
59
|
"@x12i/graphenix": "2.5.0",
|
|
60
60
|
"@x12i/graphenix-format": "2.0.0",
|
|
61
|
-
"@x12i/logxer": "^4.5.
|
|
61
|
+
"@x12i/logxer": "^4.5.1",
|
|
62
62
|
"@x12i/memorix-descriptors": "1.6.0",
|
|
63
|
-
"@x12i/memorix-retrieval": "1.11.
|
|
63
|
+
"@x12i/memorix-retrieval": "1.11.1",
|
|
64
64
|
"@x12i/memorix-writer": "1.0.0",
|
|
65
|
-
"@x12i/optimixer": "^2.4.
|
|
65
|
+
"@x12i/optimixer": "^2.4.4",
|
|
66
66
|
"@x12i/rendrix": "4.3.0",
|
|
67
67
|
"@x12i/runx": "1.3.0"
|
|
68
68
|
},
|