@exellix/graph-composer 2.0.6 → 2.0.9
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 +27 -2
- package/dist/graphComposerLogging.d.ts +45 -0
- package/dist/graphComposerLogging.d.ts.map +1 -0
- package/dist/graphComposerLogging.js +132 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/runGraphComposer.d.ts +13 -5
- package/dist/runGraphComposer.d.ts.map +1 -1
- package/dist/runGraphComposer.js +37 -12
- package/functions/graph-composer/metadata/log-diagnostics.json +20 -0
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -38,7 +38,7 @@ Requires **Node.js 20+** (Catalox embedder and this package align on `>=20`).
|
|
|
38
38
|
| `OPENROUTER_API_KEY` | **Yes** (for API runs) | OpenRouter API key. |
|
|
39
39
|
| `LLM_MODEL_STRONG` | No | Model slug when using `mode: "strong"` (default preset from @x12i/funcx). |
|
|
40
40
|
| `LLM_MODEL_NORMAL` | No | Model slug for `normal` mode. |
|
|
41
|
-
| `GRAPH_COMPOSER_LOGS_LEVEL` | No | Log level for [@x12i/logxer](https://www.npmjs.com/package/@x12i/logxer) (`info`, `warn`, …). |
|
|
41
|
+
| `GRAPH_COMPOSER_LOGS_LEVEL` | No | Log level for [@x12i/logxer](https://www.npmjs.com/package/@x12i/logxer) (`debug`, `info`, `warn`, `off`, …). Overridable in code via `configureGraphComposerLogging` or per-call `logsLevel`. Uses diagnostic catalog `functions/graph-composer/metadata/log-diagnostics.json` (code `GRAPH_COMPOSER_WORKER_FAILED` on worker errors). |
|
|
42
42
|
|
|
43
43
|
Copy [`.env.example`](./.env.example) to `.env` for local development. **Do not commit secrets.**
|
|
44
44
|
|
|
@@ -158,7 +158,30 @@ const result = await runGraphComposer(inputSuggestConceptObjectiveNetworkVulnSub
|
|
|
158
158
|
|
|
159
159
|
**Requires** `existingGraph`. Returns **`verdict`** (`coherent`, `summary`) and **`findings`** (category, severity, summary, optional **`taskIndex`**, **`proposal`**, `nodeIds`, `suggestedChange`). When **`metadata.graphConcept.coreTasks`** is non-empty, the model should return **`graphConceptPatch`** or **`suggestedConceptPatch`** (same partial shape; prefer one) with **`coreTasks`** index-aligned to that array and partial **`requirements`** (`skill`, `catalogBinding`, `narrix`, `memoryIO`, optional **`webScoping`**, etc.) inferred from the graph and catalogs. When a single value cannot be chosen, the model may return **`requirementOptions`** (ranked **`candidates`** per `taskIndex` + dot-path **`field`**, plus **`needsNewArtifact`**). Optional extended string fields on the patch (e.g. `expectedInput`, `outputDescription`) and optional **`catalogProposals`** for catalog gaps. No `graph`, `changelog`, or `explanation`. Use for design review before heavy edits.
|
|
160
160
|
|
|
161
|
-
**Tracing:** For `reviewConcept` only, `runGraphWorker` logs a **redacted** JSON snapshot of the serialized worker request and the **raw LLM worker response** (@x12i/funcx function-pack invocation): at **`debug`** by default (
|
|
161
|
+
**Tracing:** For `reviewConcept` only, `runGraphWorker` logs a **redacted** JSON snapshot of the serialized worker request and the **raw LLM worker response** (@x12i/funcx function-pack invocation): at **`debug`** by default (`logsLevel: "debug"` or `GRAPH_COMPOSER_LOGS_LEVEL=debug`), or at **`info`** when **`traceReviewConceptIo: true`** is passed in `RunGraphComposerOptions`. Payloads are capped (~500k chars) and keys matching secrets (`apiKey`, `password`, `token`, etc.) are replaced with `[redacted]`. Pass **`logContext`** (`jobId`, `runId`, `graphId`, …) in `RunGraphComposerOptions` so all logs correlate in Mongo/query APIs via logxer `runWithLogContext`.
|
|
162
|
+
|
|
163
|
+
### Logging from downstream hosts
|
|
164
|
+
|
|
165
|
+
Set the threshold once at process startup, per request, or via env:
|
|
166
|
+
|
|
167
|
+
```ts
|
|
168
|
+
import {
|
|
169
|
+
configureGraphComposerLogging,
|
|
170
|
+
getGraphComposerLoggingConfig,
|
|
171
|
+
runGraphComposer,
|
|
172
|
+
} from "@x12i/graph-composer";
|
|
173
|
+
|
|
174
|
+
// Process-wide (e.g. after reading your service config)
|
|
175
|
+
configureGraphComposerLogging({ logsLevel: "info" });
|
|
176
|
+
|
|
177
|
+
// Per invocation — wins over configure + env for that call only
|
|
178
|
+
await runGraphComposer(input, { logsLevel: "debug", logContext: { jobId: "j-1" } });
|
|
179
|
+
|
|
180
|
+
// Inspect effective level (after overrides)
|
|
181
|
+
const { logsLevel, debugEnabled, envKeys } = getGraphComposerLoggingConfig();
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
Precedence per worker run: **`options.logsLevel`** → **`configureGraphComposerLogging`** → **`GRAPH_COMPOSER_LOGS_LEVEL`** (or legacy `GRAPH_COMPOSER_LOG_LEVEL`) → default **`warn`**. Use **`off`** / **`none`** / **`silent`** to silence graph-composer logs. **`getGraphComposerLogger()`** returns the shared logxer instance if you need `getJobLogs` / `scopeLogs` from the same sink.
|
|
162
185
|
|
|
163
186
|
### Generate example input
|
|
164
187
|
|
|
@@ -195,6 +218,8 @@ Both **require** `existingGraph`. Pass **`catalogCandidates`** (from **Catalox**
|
|
|
195
218
|
In addition to `client`, `mode`, `model`, `temperature`, `maxTokens`, `askTimeoutMs`, `connectTimeoutMs`:
|
|
196
219
|
|
|
197
220
|
- **`catalogMatchListsAssist`** — When not `false`, enables **`matchLists`** pre-passes for `suggestCatalogResolution`, `suggestCatalogCreations`, and **`suggestScopingNeedMatch`** when a client is resolved (skips if no client).
|
|
221
|
+
- **`logsLevel`** — Per-call log threshold (`debug`, `info`, `off`, …). Overrides `configureGraphComposerLogging` and env for that run.
|
|
222
|
+
- **`logContext`** — Correlation ids (`jobId`, `runId`, `graphId`, …) on every log line via logxer `runWithLogContext`.
|
|
198
223
|
- **`traceReviewConceptIo`** — When `true`, emit **`reviewConcept`** request/response trace logs at **`info`** (still redacted). When `false` (default), the same traces use **`debug`** only.
|
|
199
224
|
|
|
200
225
|
### Worker actions cheat sheet
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { type LogLevel, type Logxer } from "@x12i/logxer";
|
|
2
|
+
/** Canonical env prefix for graph-composer logs (`GRAPH_COMPOSER_LOGS_LEVEL`, …). */
|
|
3
|
+
export declare const GRAPH_COMPOSER_LOG_ENV_PREFIX = "GRAPH_COMPOSER";
|
|
4
|
+
export type { LogLevel };
|
|
5
|
+
/** Accepted inputs for `configureGraphComposerLogging` and `RunGraphComposerOptions.logsLevel`. */
|
|
6
|
+
export type GraphComposerLogsLevelInput = LogLevel | "off" | "none" | "silent" | (string & {});
|
|
7
|
+
export type GraphComposerLoggingConfig = {
|
|
8
|
+
/** Effective threshold after overrides (`off` when logging is disabled). */
|
|
9
|
+
logsLevel: LogLevel | "off";
|
|
10
|
+
/** True when package logging is silenced (`off` / `none` / `silent`). */
|
|
11
|
+
logsDisabled: boolean;
|
|
12
|
+
/** Whether `debug` (and `verbose`) lines are emitted. */
|
|
13
|
+
debugEnabled: boolean;
|
|
14
|
+
envKeys: {
|
|
15
|
+
canonical: string;
|
|
16
|
+
legacy: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Parse a log-level string (case-insensitive). Unknown values disable logging (`off`).
|
|
21
|
+
* Accepts logxer synonyms: `off`, `none`, `silent`.
|
|
22
|
+
*/
|
|
23
|
+
export declare function parseGraphComposerLogsLevel(raw: string | undefined): {
|
|
24
|
+
logsLevel: LogLevel | "off";
|
|
25
|
+
logsDisabled: boolean;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Process-wide logging for graph-composer (downstream hosts, servers, CLIs).
|
|
29
|
+
*
|
|
30
|
+
* Precedence for each `runGraphComposer` / `runGraphComposerAgent` call:
|
|
31
|
+
* `options.logsLevel` → `configureGraphComposerLogging` → `GRAPH_COMPOSER_LOGS_LEVEL` env → default `warn`.
|
|
32
|
+
*/
|
|
33
|
+
export declare function configureGraphComposerLogging(options: {
|
|
34
|
+
logsLevel?: GraphComposerLogsLevelInput;
|
|
35
|
+
}): void;
|
|
36
|
+
/** Current effective logging configuration (after env + programmatic overrides). */
|
|
37
|
+
export declare function getGraphComposerLoggingConfig(perCall?: GraphComposerLogsLevelInput): GraphComposerLoggingConfig;
|
|
38
|
+
/** Shared @x12i/logxer instance for graph-composer (diagnostics catalog attached). */
|
|
39
|
+
export declare function getGraphComposerLogger(): Logxer;
|
|
40
|
+
/**
|
|
41
|
+
* Run `fn` with a temporary log threshold (`options.logsLevel` on workers).
|
|
42
|
+
* Restores the previous threshold when `fn` completes.
|
|
43
|
+
*/
|
|
44
|
+
export declare function withGraphComposerLogsLevel<T>(logsLevel: GraphComposerLogsLevelInput | undefined, fn: () => T | Promise<T>): Promise<T>;
|
|
45
|
+
//# sourceMappingURL=graphComposerLogging.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graphComposerLogging.d.ts","sourceRoot":"","sources":["../src/graphComposerLogging.ts"],"names":[],"mappings":"AAEA,OAAO,EAML,KAAK,QAAQ,EACb,KAAK,MAAM,EACZ,MAAM,cAAc,CAAC;AAGtB,qFAAqF;AACrF,eAAO,MAAM,6BAA6B,mBAAmB,CAAC;AAE9D,YAAY,EAAE,QAAQ,EAAE,CAAC;AAEzB,mGAAmG;AACnG,MAAM,MAAM,2BAA2B,GACnC,QAAQ,GACR,KAAK,GACL,MAAM,GACN,QAAQ,GACR,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAElB,MAAM,MAAM,0BAA0B,GAAG;IACvC,4EAA4E;IAC5E,SAAS,EAAE,QAAQ,GAAG,KAAK,CAAC;IAC5B,yEAAyE;IACzE,YAAY,EAAE,OAAO,CAAC;IACtB,yDAAyD;IACzD,YAAY,EAAE,OAAO,CAAC;IACtB,OAAO,EAAE;QACP,SAAS,EAAE,MAAM,CAAC;QAClB,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;CACH,CAAC;AA+DF;;;GAGG;AACH,wBAAgB,2BAA2B,CACzC,GAAG,EAAE,MAAM,GAAG,SAAS,GACtB;IAAE,SAAS,EAAE,QAAQ,GAAG,KAAK,CAAC;IAAC,YAAY,EAAE,OAAO,CAAA;CAAE,CAMxD;AAoCD;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAAC,OAAO,EAAE;IACrD,SAAS,CAAC,EAAE,2BAA2B,CAAC;CACzC,GAAG,IAAI,CAMP;AAED,oFAAoF;AACpF,wBAAgB,6BAA6B,CAC3C,OAAO,CAAC,EAAE,2BAA2B,GACpC,0BAA0B,CAY5B;AAED,sFAAsF;AACtF,wBAAgB,sBAAsB,IAAI,MAAM,CAE/C;AAED;;;GAGG;AACH,wBAAsB,0BAA0B,CAAC,CAAC,EAChD,SAAS,EAAE,2BAA2B,GAAG,SAAS,EAClD,EAAE,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GACvB,OAAO,CAAC,CAAC,CAAC,CAYZ"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { initConfig } from "@x12i/env";
|
|
3
|
+
import { createLogxer, legacyPackageLogLevelEnvKey, packageLogsLevelEnvKey, parsePackageLogsLevelString, resolvePackageLogsLevel, } from "@x12i/logxer";
|
|
4
|
+
import { graphComposerPackRoot } from "./packDir.js";
|
|
5
|
+
/** Canonical env prefix for graph-composer logs (`GRAPH_COMPOSER_LOGS_LEVEL`, …). */
|
|
6
|
+
export const GRAPH_COMPOSER_LOG_ENV_PREFIX = "GRAPH_COMPOSER";
|
|
7
|
+
// Load .env before Logxer reads MONGO_URI (and related vars) at construction.
|
|
8
|
+
initConfig({}, { dotenvPath: ".env", throwOnMissing: false });
|
|
9
|
+
const logger = createLogxer({
|
|
10
|
+
packageName: "graph-composer",
|
|
11
|
+
envPrefix: GRAPH_COMPOSER_LOG_ENV_PREFIX,
|
|
12
|
+
}, {
|
|
13
|
+
diagnostics: {
|
|
14
|
+
catalogPath: path.join(graphComposerPackRoot(), "metadata", "log-diagnostics.json"),
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
let processWideLogsLevel;
|
|
18
|
+
function logxerMutableConfig(logxer) {
|
|
19
|
+
return logxer.config;
|
|
20
|
+
}
|
|
21
|
+
function applyResolvedToLogger(resolved) {
|
|
22
|
+
const internal = logxerMutableConfig(logger);
|
|
23
|
+
const prev = {
|
|
24
|
+
logLevel: internal.logLevel,
|
|
25
|
+
packageLogsDisabled: internal.packageLogsDisabled,
|
|
26
|
+
};
|
|
27
|
+
internal.logLevel = resolved.logLevel;
|
|
28
|
+
internal.packageLogsDisabled = resolved.packageLogsDisabled;
|
|
29
|
+
return () => {
|
|
30
|
+
internal.logLevel = prev.logLevel;
|
|
31
|
+
internal.packageLogsDisabled = prev.packageLogsDisabled;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
const LOG_LEVELS = new Set([
|
|
35
|
+
"verbose",
|
|
36
|
+
"debug",
|
|
37
|
+
"info",
|
|
38
|
+
"warn",
|
|
39
|
+
"error",
|
|
40
|
+
]);
|
|
41
|
+
function isLogLevel(value) {
|
|
42
|
+
return LOG_LEVELS.has(value);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Parse a log-level string (case-insensitive). Unknown values disable logging (`off`).
|
|
46
|
+
* Accepts logxer synonyms: `off`, `none`, `silent`.
|
|
47
|
+
*/
|
|
48
|
+
export function parseGraphComposerLogsLevel(raw) {
|
|
49
|
+
const parsed = parsePackageLogsLevelString(raw);
|
|
50
|
+
if (parsed.packageLogsDisabled || parsed.logLevel === undefined) {
|
|
51
|
+
return { logsLevel: "off", logsDisabled: true };
|
|
52
|
+
}
|
|
53
|
+
return { logsLevel: parsed.logLevel, logsDisabled: false };
|
|
54
|
+
}
|
|
55
|
+
function resolveFromInput(input) {
|
|
56
|
+
if (input === "off" || input === "none" || input === "silent") {
|
|
57
|
+
return { packageLogsDisabled: true, logLevel: "error" };
|
|
58
|
+
}
|
|
59
|
+
if (typeof input === "string" && isLogLevel(input)) {
|
|
60
|
+
return { packageLogsDisabled: false, logLevel: input };
|
|
61
|
+
}
|
|
62
|
+
const parsed = parsePackageLogsLevelString(String(input));
|
|
63
|
+
if (parsed.packageLogsDisabled || parsed.logLevel === undefined) {
|
|
64
|
+
return { packageLogsDisabled: true, logLevel: "error" };
|
|
65
|
+
}
|
|
66
|
+
return { packageLogsDisabled: false, logLevel: parsed.logLevel };
|
|
67
|
+
}
|
|
68
|
+
function resolveGraphComposerLogsLevel(perCall) {
|
|
69
|
+
if (perCall !== undefined) {
|
|
70
|
+
return resolveFromInput(perCall);
|
|
71
|
+
}
|
|
72
|
+
if (processWideLogsLevel !== undefined) {
|
|
73
|
+
return resolveFromInput(processWideLogsLevel);
|
|
74
|
+
}
|
|
75
|
+
return resolvePackageLogsLevel({
|
|
76
|
+
envPrefix: GRAPH_COMPOSER_LOG_ENV_PREFIX,
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
function syncLoggerToEffectiveLevel(perCall) {
|
|
80
|
+
applyResolvedToLogger(resolveGraphComposerLogsLevel(perCall));
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Process-wide logging for graph-composer (downstream hosts, servers, CLIs).
|
|
84
|
+
*
|
|
85
|
+
* Precedence for each `runGraphComposer` / `runGraphComposerAgent` call:
|
|
86
|
+
* `options.logsLevel` → `configureGraphComposerLogging` → `GRAPH_COMPOSER_LOGS_LEVEL` env → default `warn`.
|
|
87
|
+
*/
|
|
88
|
+
export function configureGraphComposerLogging(options) {
|
|
89
|
+
if (options.logsLevel === undefined) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
processWideLogsLevel = options.logsLevel;
|
|
93
|
+
syncLoggerToEffectiveLevel();
|
|
94
|
+
}
|
|
95
|
+
/** Current effective logging configuration (after env + programmatic overrides). */
|
|
96
|
+
export function getGraphComposerLoggingConfig(perCall) {
|
|
97
|
+
const resolved = resolveGraphComposerLogsLevel(perCall);
|
|
98
|
+
const logsDisabled = resolved.packageLogsDisabled;
|
|
99
|
+
return {
|
|
100
|
+
logsLevel: logsDisabled ? "off" : resolved.logLevel,
|
|
101
|
+
logsDisabled,
|
|
102
|
+
debugEnabled: !logsDisabled && logger.isLevelEnabled("debug"),
|
|
103
|
+
envKeys: {
|
|
104
|
+
canonical: packageLogsLevelEnvKey(GRAPH_COMPOSER_LOG_ENV_PREFIX),
|
|
105
|
+
legacy: legacyPackageLogLevelEnvKey(GRAPH_COMPOSER_LOG_ENV_PREFIX),
|
|
106
|
+
},
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
/** Shared @x12i/logxer instance for graph-composer (diagnostics catalog attached). */
|
|
110
|
+
export function getGraphComposerLogger() {
|
|
111
|
+
return logger;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Run `fn` with a temporary log threshold (`options.logsLevel` on workers).
|
|
115
|
+
* Restores the previous threshold when `fn` completes.
|
|
116
|
+
*/
|
|
117
|
+
export async function withGraphComposerLogsLevel(logsLevel, fn) {
|
|
118
|
+
if (logsLevel === undefined) {
|
|
119
|
+
syncLoggerToEffectiveLevel();
|
|
120
|
+
return fn();
|
|
121
|
+
}
|
|
122
|
+
const restore = applyResolvedToLogger(resolveGraphComposerLogsLevel(logsLevel));
|
|
123
|
+
try {
|
|
124
|
+
return await fn();
|
|
125
|
+
}
|
|
126
|
+
finally {
|
|
127
|
+
restore();
|
|
128
|
+
syncLoggerToEffectiveLevel();
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
// Apply env / default level at module load (before first log line).
|
|
132
|
+
syncLoggerToEffectiveLevel();
|
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ export { GRAPH_COMPOSER_ACTION_REGISTRY, getActionDefinition, getActionDefinitio
|
|
|
3
3
|
export { graphComposerPackRoot, readGraphComposerPromptFile, } from "./packDir.js";
|
|
4
4
|
export { DEFAULT_UTILITY_SKILLS } from "./defaultUtilitySkills.js";
|
|
5
5
|
export { runGraphComposer, runGraphWorker, resolveGraphComposerClient, getGraphComposerLlmClient, getPackDir, normalizeGraphComposerExplainOutput, normalizeReviewConceptComposerOutput, redactSecretsForLog, type RunGraphComposerOptions, } from "./runGraphComposer.js";
|
|
6
|
+
export type { LogRuntimeContext, LogLevel } from "@x12i/logxer";
|
|
7
|
+
export { GRAPH_COMPOSER_LOG_ENV_PREFIX, configureGraphComposerLogging, getGraphComposerLogger, getGraphComposerLoggingConfig, parseGraphComposerLogsLevel, withGraphComposerLogsLevel, type GraphComposerLoggingConfig, type GraphComposerLogsLevelInput, } from "./graphComposerLogging.js";
|
|
6
8
|
export { applyGraphConceptPatchOnlyIfEmpty } from "./graphConceptPatchMerge.js";
|
|
7
9
|
export { runGraphComposerAgent, type GraphComposerAgentResult, type GraphComposerAgentOrchestrationStep, type RunGraphComposerAgentOptions, } from "./graphComposerAgent.js";
|
|
8
10
|
export type { GraphComposerInput, GraphComposerAgentInput, GraphComposerIntent, GraphComposerConstraints, SkillDescriptor, PrimaryIntentType, GraphConceptStatus, GraphConceptEntityBindings, GraphConceptPatch, GraphConceptPatchKey, GraphConceptRequirementsPatch, GraphConceptCoreTaskPatchItem, RequirementOptionCandidate, RequirementOptionEntry, CatalogCandidates, ScopingMapCandidate, NarrixTemplateCandidate, } from "./types.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,yBAAyB,EACzB,eAAe,EACf,gBAAgB,EAChB,oBAAoB,GACrB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,8BAA8B,EAC9B,mBAAmB,EACnB,6BAA6B,EAC7B,+BAA+B,EAC/B,sBAAsB,EACtB,KAAK,mBAAmB,EACxB,KAAK,6BAA6B,GACnC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,qBAAqB,EACrB,2BAA2B,GAC5B,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,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CAAmC,EACnC,8BAA8B,EAC9B,8BAA8B,EAC9B,8BAA8B,EAC9B,iCAAiC,EACjC,gCAAgC,EAChC,iCAAiC,EACjC,qDAAqD,EACrD,qCAAqC,EACrC,wBAAwB,EACxB,oBAAoB,EACpB,KAAK,+BAA+B,GACrC,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,6BAA6B,EAAE,MAAM,6BAA6B,CAAC;AAC5E,OAAO,EACL,qBAAqB,EACrB,2BAA2B,EAC3B,2BAA2B,EAC3B,qCAAqC,EACrC,sBAAsB,EACtB,gCAAgC,EAChC,kCAAkC,EAClC,qBAAqB,EACrB,UAAU,EACV,eAAe,EACf,KAAK,yBAAyB,EAC9B,KAAK,6BAA6B,GACnC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,OAAO,EACP,YAAY,GACb,MAAM,wBAAwB,CAAC;AAChC,YAAY,EACV,cAAc,EACd,oBAAoB,GACrB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,gCAAgC,EAChC,mCAAmC,EACnC,uCAAuC,EACvC,2CAA2C,EAC3C,KAAK,8BAA8B,EACnC,KAAK,gCAAgC,EACrC,KAAK,+BAA+B,EACpC,KAAK,+BAA+B,EACpC,KAAK,2BAA2B,GACjC,MAAM,2BAA2B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -3,6 +3,7 @@ export { GRAPH_COMPOSER_ACTION_REGISTRY, getActionDefinition, getActionDefinitio
|
|
|
3
3
|
export { graphComposerPackRoot, readGraphComposerPromptFile, } from "./packDir.js";
|
|
4
4
|
export { DEFAULT_UTILITY_SKILLS } from "./defaultUtilitySkills.js";
|
|
5
5
|
export { runGraphComposer, runGraphWorker, resolveGraphComposerClient, getGraphComposerLlmClient, getPackDir, normalizeGraphComposerExplainOutput, normalizeReviewConceptComposerOutput, redactSecretsForLog, } from "./runGraphComposer.js";
|
|
6
|
+
export { GRAPH_COMPOSER_LOG_ENV_PREFIX, configureGraphComposerLogging, getGraphComposerLogger, getGraphComposerLoggingConfig, parseGraphComposerLogsLevel, withGraphComposerLogsLevel, } from "./graphComposerLogging.js";
|
|
6
7
|
export { applyGraphConceptPatchOnlyIfEmpty } from "./graphConceptPatchMerge.js";
|
|
7
8
|
export { runGraphComposerAgent, } from "./graphComposerAgent.js";
|
|
8
9
|
export { buildCatalogMatchHints, } from "./catalogMatchAssist.js";
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { type LogRuntimeContext } from "@x12i/logxer";
|
|
2
|
+
import { type GraphComposerLogsLevelInput } from "./graphComposerLogging.js";
|
|
1
3
|
import type { Client } from "@x12i/funcx";
|
|
2
4
|
import { type LlmMode } from "@x12i/funcx/functions";
|
|
3
5
|
import type { GraphComposerInput } from "./types.js";
|
|
@@ -34,9 +36,19 @@ export type RunGraphComposerOptions = {
|
|
|
34
36
|
maxTokens?: number;
|
|
35
37
|
/**
|
|
36
38
|
* When true, `reviewConcept` logs redacted serialized request and raw LLM result at `info`.
|
|
37
|
-
* When false (default), the same traces use `debug` (enable via `
|
|
39
|
+
* When false (default), the same traces use `debug` (enable via `logsLevel: "debug"` or env).
|
|
38
40
|
*/
|
|
39
41
|
traceReviewConceptIo?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Per-call log threshold. Wins over `configureGraphComposerLogging` and env for this run only.
|
|
44
|
+
* Use `off` / `none` / `silent` to silence graph-composer logs for one invocation.
|
|
45
|
+
*/
|
|
46
|
+
logsLevel?: GraphComposerLogsLevelInput;
|
|
47
|
+
/**
|
|
48
|
+
* Optional correlation ids merged into every log via @x12i/logxer `runWithLogContext`
|
|
49
|
+
* (jobId, runId, graphId, nodeId, taskId, sessionId, correlationId).
|
|
50
|
+
*/
|
|
51
|
+
logContext?: LogRuntimeContext;
|
|
40
52
|
};
|
|
41
53
|
export declare function resolveGraphComposerClient(options: RunGraphComposerOptions): Client | undefined;
|
|
42
54
|
/**
|
|
@@ -44,10 +56,6 @@ export declare function resolveGraphComposerClient(options: RunGraphComposerOpti
|
|
|
44
56
|
* Unlike `resolveGraphComposerClient`, this always returns a `Client` when OpenRouter is configured.
|
|
45
57
|
*/
|
|
46
58
|
export declare function getGraphComposerLlmClient(options?: RunGraphComposerOptions): Client;
|
|
47
|
-
/**
|
|
48
|
-
* Run a single graph-composer worker (`intent.action`) with the per-action system prompt.
|
|
49
|
-
* Shared by `runGraphComposer` and `runGraphComposerAgent`.
|
|
50
|
-
*/
|
|
51
59
|
export declare function runGraphWorker(input: GraphComposerInput, options?: RunGraphComposerOptions): Promise<unknown>;
|
|
52
60
|
export declare function runGraphComposer(input: GraphComposerInput, options?: RunGraphComposerOptions): Promise<unknown>;
|
|
53
61
|
export declare function getPackDir(): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runGraphComposer.d.ts","sourceRoot":"","sources":["../src/runGraphComposer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"runGraphComposer.d.ts","sourceRoot":"","sources":["../src/runGraphComposer.ts"],"names":[],"mappings":"AAEA,OAAO,EAKL,KAAK,iBAAiB,EACvB,MAAM,cAAc,CAAC;AACtB,OAAO,EAGL,KAAK,2BAA2B,EACjC,MAAM,2BAA2B,CAAC;AAEnC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAIL,KAAK,OAAO,EACb,MAAM,uBAAuB,CAAC;AAc/B,OAAO,KAAK,EAAE,kBAAkB,EAAmB,MAAM,YAAY,CAAC;AAEtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAGxD,OAAO,EAAE,mBAAmB,EAAE,CAAC;AAC/B,OAAO,EAAE,iCAAiC,EAAE,MAAM,6BAA6B,CAAC;AAgHhF;;;GAGG;AACH,wBAAgB,oCAAoC,CAClD,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC3B,IAAI,CASN;AAuDD;;GAEG;AACH,wBAAgB,mCAAmC,CACjD,MAAM,EAAE,OAAO,GACd,OAAO,CAKT;AA0ED,MAAM,MAAM,uBAAuB,GAAG;IACpC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,2FAA2F;IAC3F,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B;;;OAGG;IACH,SAAS,CAAC,EAAE,2BAA2B,CAAC;IACxC;;;OAGG;IACH,UAAU,CAAC,EAAE,iBAAiB,CAAC;CAChC,CAAC;AAmDF,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,uBAAuB,GAC/B,MAAM,GAAG,SAAS,CA4BpB;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,GAAE,uBAA4B,GACpC,MAAM,CAYR;AAqLD,wBAAsB,cAAc,CAClC,KAAK,EAAE,kBAAkB,EACzB,OAAO,GAAE,uBAA4B,GACpC,OAAO,CAAC,OAAO,CAAC,CAQlB;AAED,wBAAsB,gBAAgB,CACpC,KAAK,EAAE,kBAAkB,EACzB,OAAO,GAAE,uBAA4B,GACpC,OAAO,CAAC,OAAO,CAAC,CAElB;AAED,wBAAgB,UAAU,IAAI,MAAM,CAEnC"}
|
package/dist/runGraphComposer.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { readFileSync, existsSync } from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { DebugLogAbstract, exceptionEvidence, fieldEvidence, runWithLogContext, } from "@x12i/logxer";
|
|
4
|
+
import { getGraphComposerLogger, withGraphComposerLogsLevel, } from "./graphComposerLogging.js";
|
|
5
5
|
import { createClient } from "@x12i/funcx";
|
|
6
6
|
import { buildRequestPrompt, executeFuncx as invokeFuncxPack, } from "@x12i/funcx/functions";
|
|
7
7
|
import { composeWorkerInstructions } from "./composeInstructions.js";
|
|
@@ -33,12 +33,7 @@ function processSuggestConceptObjectiveOutput(shaped, intent, existingGraph) {
|
|
|
33
33
|
typeof r === "string" && r.trim().length > 0 ? `${prefix} ${r}` : prefix;
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
-
|
|
37
|
-
initConfig({}, { dotenvPath: ".env", throwOnMissing: false });
|
|
38
|
-
const logger = createLogxer({
|
|
39
|
-
packageName: "graph-composer",
|
|
40
|
-
envPrefix: "GRAPH_COMPOSER",
|
|
41
|
-
});
|
|
36
|
+
const logger = getGraphComposerLogger();
|
|
42
37
|
let cachedRules = null;
|
|
43
38
|
function loadRules() {
|
|
44
39
|
if (cachedRules !== null)
|
|
@@ -253,6 +248,9 @@ function logReviewConceptIo(phase, data, traceReviewConceptIo) {
|
|
|
253
248
|
const payload = safeJsonStringifyForLog(redacted);
|
|
254
249
|
const msg = `graph-composer reviewConcept ${phase}`;
|
|
255
250
|
const meta = {
|
|
251
|
+
phase,
|
|
252
|
+
debugKind: DebugLogAbstract.STATE,
|
|
253
|
+
evidence: [fieldEvidence("payloadCharLength", payload.length)],
|
|
256
254
|
payloadCharLength: payload.length,
|
|
257
255
|
payload,
|
|
258
256
|
};
|
|
@@ -324,7 +322,7 @@ function buildGraphComposerPrompt(request) {
|
|
|
324
322
|
* Run a single graph-composer worker (`intent.action`) with the per-action system prompt.
|
|
325
323
|
* Shared by `runGraphComposer` and `runGraphComposerAgent`.
|
|
326
324
|
*/
|
|
327
|
-
|
|
325
|
+
async function runGraphWorkerInner(input, options) {
|
|
328
326
|
assertInputShape(input);
|
|
329
327
|
const normalized = normalizeInput(input);
|
|
330
328
|
const action = normalized.intent.action;
|
|
@@ -391,6 +389,7 @@ export async function runGraphWorker(input, options = {}) {
|
|
|
391
389
|
aiSkillCount: normalized.aiSkills.length,
|
|
392
390
|
utilitySkillCount: normalized.utilitySkills.length,
|
|
393
391
|
composedInstructionChars: system.length,
|
|
392
|
+
debugKind: DebugLogAbstract.EVENT,
|
|
394
393
|
});
|
|
395
394
|
const mode = options.mode ?? "strong";
|
|
396
395
|
try {
|
|
@@ -425,17 +424,43 @@ export async function runGraphWorker(input, options = {}) {
|
|
|
425
424
|
});
|
|
426
425
|
}
|
|
427
426
|
}
|
|
428
|
-
logger.info("graph-composer worker complete", {
|
|
427
|
+
logger.info("graph-composer worker complete", {
|
|
428
|
+
action,
|
|
429
|
+
debugKind: DebugLogAbstract.EVENT,
|
|
430
|
+
});
|
|
429
431
|
return shaped;
|
|
430
432
|
}
|
|
431
433
|
catch (e) {
|
|
432
|
-
|
|
434
|
+
const message = e instanceof Error ? e.message : String(e);
|
|
435
|
+
logger.errorCode("GRAPH_COMPOSER_WORKER_FAILED", {
|
|
433
436
|
action,
|
|
434
|
-
|
|
437
|
+
error: e,
|
|
438
|
+
debugKind: DebugLogAbstract.ANOMALY,
|
|
439
|
+
evidence: [
|
|
440
|
+
exceptionEvidence(e),
|
|
441
|
+
fieldEvidence("intent.action", action),
|
|
442
|
+
],
|
|
443
|
+
diagnostics: {
|
|
444
|
+
expected: "The graph-composer worker should complete and return validated output.",
|
|
445
|
+
actual: message,
|
|
446
|
+
impact: "The requested graph-composer action did not complete; callers receive no result.",
|
|
447
|
+
retryable: true,
|
|
448
|
+
userActionRequired: false,
|
|
449
|
+
confidence: "medium",
|
|
450
|
+
},
|
|
435
451
|
});
|
|
436
452
|
throw e;
|
|
437
453
|
}
|
|
438
454
|
}
|
|
455
|
+
export async function runGraphWorker(input, options = {}) {
|
|
456
|
+
return withGraphComposerLogsLevel(options.logsLevel, async () => {
|
|
457
|
+
const ctx = options.logContext;
|
|
458
|
+
if (ctx !== undefined && Object.keys(ctx).length > 0) {
|
|
459
|
+
return runWithLogContext(ctx, () => runGraphWorkerInner(input, options));
|
|
460
|
+
}
|
|
461
|
+
return runGraphWorkerInner(input, options);
|
|
462
|
+
});
|
|
463
|
+
}
|
|
439
464
|
export async function runGraphComposer(input, options = {}) {
|
|
440
465
|
return runGraphWorker(input, options);
|
|
441
466
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"GRAPH_COMPOSER_WORKER_FAILED": {
|
|
3
|
+
"defaultLevel": "error",
|
|
4
|
+
"title": "Graph composer worker failed",
|
|
5
|
+
"impact": "The requested graph-composer action did not complete; callers receive no result.",
|
|
6
|
+
"possibleCauses": [
|
|
7
|
+
"OpenRouter or @x12i/funcx returned an error or timed out.",
|
|
8
|
+
"Model output failed action-specific validation.",
|
|
9
|
+
"Missing or invalid input (existingGraph, catalogCandidates, etc.)."
|
|
10
|
+
],
|
|
11
|
+
"remediation": [
|
|
12
|
+
"Set GRAPH_COMPOSER_LOGS_LEVEL=debug (or traceReviewConceptIo for reviewConcept).",
|
|
13
|
+
"Inspect the exception message and validation errors in logs.",
|
|
14
|
+
"Verify OPENROUTER_API_KEY and LLM model slugs."
|
|
15
|
+
],
|
|
16
|
+
"retryable": true,
|
|
17
|
+
"userActionRequired": false,
|
|
18
|
+
"confidence": "medium"
|
|
19
|
+
}
|
|
20
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exellix/graph-composer",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.9",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"verify:local": "tsx src/verify-local.ts",
|
|
37
37
|
"verify:catalog-live": "x12i-env run --env-file .env -- tsx scripts/verify-catalog-live.ts",
|
|
38
38
|
"test": "npm run test:unit && npm run test:live",
|
|
39
|
-
"test:unit": "node --import tsx/esm --test --test-force-exit test/unit/explain-shape.test.ts test/unit/graph-concept-patch.test.ts test/unit/graph-concept-story-parse.test.ts test/unit/review-concept-output-validation.test.ts test/unit/review-concept-catalog-alias.test.ts test/unit/redact-for-log.test.ts test/unit/worker-instructions.test.ts test/unit/catalog-output-validation.test.ts test/unit/catalox-catalog-bridge.test.ts test/unit/ai-task-profile.test.ts test/unit/create-modify-output-validation.test.ts test/unit/task-node-task-variable.test.ts test/unit/canonical-graph-document.test.ts test/unit/graph-engine-bridge.test.ts test/unit/example-generation.test.ts",
|
|
39
|
+
"test:unit": "node --import tsx/esm --test --test-force-exit test/unit/explain-shape.test.ts test/unit/graph-concept-patch.test.ts test/unit/graph-concept-story-parse.test.ts test/unit/review-concept-output-validation.test.ts test/unit/review-concept-catalog-alias.test.ts test/unit/redact-for-log.test.ts test/unit/graph-composer-logging.test.ts test/unit/worker-instructions.test.ts test/unit/catalog-output-validation.test.ts test/unit/catalox-catalog-bridge.test.ts test/unit/ai-task-profile.test.ts test/unit/create-modify-output-validation.test.ts test/unit/task-node-task-variable.test.ts test/unit/canonical-graph-document.test.ts test/unit/graph-engine-bridge.test.ts test/unit/example-generation.test.ts",
|
|
40
40
|
"test:live": "x12i-env run --env-file .env -- node --import tsx/esm --test test/live/all.ts",
|
|
41
41
|
"pack:check": "npm pack --dry-run",
|
|
42
42
|
"suggest-smoke": "x12i-env run --env-file .env -- tsx scripts/run-suggest-concept-smoke.ts"
|
|
@@ -71,11 +71,11 @@
|
|
|
71
71
|
}
|
|
72
72
|
},
|
|
73
73
|
"dependencies": {
|
|
74
|
-
"@x12i/ai-profiles": "^1.2.
|
|
74
|
+
"@x12i/ai-profiles": "^1.2.9",
|
|
75
75
|
"@x12i/catalox": "^5.1.1",
|
|
76
76
|
"@x12i/env": "^4.0.1",
|
|
77
|
-
"@x12i/funcx": "^4.2.
|
|
78
|
-
"@x12i/logxer": "^4.
|
|
77
|
+
"@x12i/funcx": "^4.2.3",
|
|
78
|
+
"@x12i/logxer": "^4.4.2"
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
|
81
81
|
"@exellix/graph-engine": "^7.2.0",
|