@ljoukov/llm 4.0.3 → 4.0.4
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 +4 -2
- package/dist/index.cjs +4 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -683,7 +683,7 @@ See `docs/agent-telemetry.md` for event schema, design rationale, and backend ad
|
|
|
683
683
|
|
|
684
684
|
- console lines,
|
|
685
685
|
- `<workspace>/agent.log`,
|
|
686
|
-
- per-call artifacts under
|
|
686
|
+
- per-call artifacts under `<workspace>/llm_calls/<timestamp>-<n>/<model-id>/` by default.
|
|
687
687
|
|
|
688
688
|
Each LLM call writes:
|
|
689
689
|
|
|
@@ -694,6 +694,7 @@ Each LLM call writes:
|
|
|
694
694
|
`image_url` data URLs are redacted in text/metadata logs (`data:...,...`) so base64 payloads are not printed inline.
|
|
695
695
|
|
|
696
696
|
```ts
|
|
697
|
+
import path from "node:path";
|
|
697
698
|
import { runAgentLoop } from "@ljoukov/llm";
|
|
698
699
|
|
|
699
700
|
await runAgentLoop({
|
|
@@ -701,7 +702,8 @@ await runAgentLoop({
|
|
|
701
702
|
input: "Do the task",
|
|
702
703
|
filesystemTool: true,
|
|
703
704
|
logging: {
|
|
704
|
-
workspaceDir: process.cwd(), // optional; defaults to filesystem cwd or process.cwd()
|
|
705
|
+
workspaceDir: path.join(process.cwd(), "logs", "agent"), // optional; defaults to filesystem cwd or process.cwd()
|
|
706
|
+
callLogsDir: "llm_calls", // optional; relative paths resolve from workspaceDir
|
|
705
707
|
mirrorToConsole: false, // useful for CLI UIs that already render stream events
|
|
706
708
|
sink: {
|
|
707
709
|
append: (line) => {
|
package/dist/index.cjs
CHANGED
|
@@ -2969,7 +2969,8 @@ var AgentLoggingSessionImpl = class {
|
|
|
2969
2969
|
callCounter = 0;
|
|
2970
2970
|
constructor(config) {
|
|
2971
2971
|
this.workspaceDir = import_node_path3.default.resolve(config.workspaceDir ?? process.cwd());
|
|
2972
|
-
|
|
2972
|
+
const configuredCallLogsDir = typeof config.callLogsDir === "string" ? config.callLogsDir.trim() : "";
|
|
2973
|
+
this.logsRootDir = configuredCallLogsDir.length > 0 ? import_node_path3.default.resolve(this.workspaceDir, configuredCallLogsDir) : import_node_path3.default.join(this.workspaceDir, "llm_calls");
|
|
2973
2974
|
this.mirrorToConsole = config.mirrorToConsole !== false;
|
|
2974
2975
|
this.sink = config.sink;
|
|
2975
2976
|
this.agentLogPath = import_node_path3.default.join(this.workspaceDir, "agent.log");
|
|
@@ -10414,9 +10415,10 @@ function createRootAgentLoggingSession(request) {
|
|
|
10414
10415
|
if (!selected) {
|
|
10415
10416
|
return void 0;
|
|
10416
10417
|
}
|
|
10418
|
+
const workspaceDir = typeof selected.workspaceDir === "string" && selected.workspaceDir.trim().length > 0 ? import_node_path7.default.resolve(selected.workspaceDir) : resolveWorkspaceDirForLogging(request);
|
|
10417
10419
|
return createAgentLoggingSession({
|
|
10418
10420
|
...selected,
|
|
10419
|
-
workspaceDir
|
|
10421
|
+
workspaceDir,
|
|
10420
10422
|
mirrorToConsole: selected.mirrorToConsole !== false
|
|
10421
10423
|
});
|
|
10422
10424
|
}
|