@ljoukov/llm 4.0.3 → 4.0.5
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 +5 -3
- package/dist/index.cjs +5 -3
- 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 +5 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -556,7 +556,7 @@ console.log(result.text);
|
|
|
556
556
|
For read/search/write tasks in a workspace, enable `filesystemTool`. The library auto-selects a tool profile by model
|
|
557
557
|
when `profile: "auto"`:
|
|
558
558
|
|
|
559
|
-
- Codex-like models: Codex-compatible filesystem tool shape.
|
|
559
|
+
- Codex-like models (`gpt-5.4`, `chatgpt-gpt-5.4`, `chatgpt-gpt-5.4-fast`, and `*codex*` variants): Codex-compatible filesystem tool shape.
|
|
560
560
|
- Gemini models: Gemini-compatible filesystem tool shape.
|
|
561
561
|
- Other models: model-agnostic profile (currently Gemini-style).
|
|
562
562
|
|
|
@@ -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");
|
|
@@ -9707,7 +9708,7 @@ async function runAccessHook2(runtime, context) {
|
|
|
9707
9708
|
}
|
|
9708
9709
|
function isCodexModel(model) {
|
|
9709
9710
|
const normalized = model.startsWith("chatgpt-") ? model.slice("chatgpt-".length) : model;
|
|
9710
|
-
return normalized.includes("codex");
|
|
9711
|
+
return normalized.includes("codex") || normalized === "gpt-5.4" || normalized === "gpt-5.4-fast";
|
|
9711
9712
|
}
|
|
9712
9713
|
function isGeminiModel(model) {
|
|
9713
9714
|
return model.startsWith("gemini-");
|
|
@@ -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
|
}
|