micro-models-agent 0.13.1 → 0.13.3

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.
@@ -1,11 +1,12 @@
1
1
  import { writeFileSync, mkdirSync, existsSync, readFileSync } from "fs";
2
- import { resolve, normalize, dirname } from "path";
2
+ import { dirname } from "path";
3
3
  import { t } from "../i18n/index";
4
4
  import { isPathWritable } from "../modules/security/path-validator";
5
5
  import { scanContent } from "../modules/security/content-scanner";
6
6
  import { logFileWrite, logSecurityBlock } from "../modules/security/audit-log";
7
7
  import { getSessionSecurityConfig } from "../modules/security/session-isolation";
8
8
  import { generateDiff, generateNewFileDiff } from "../ui/diff";
9
+ import { safeResolvePath } from "./path-utils";
9
10
  export const writeFileTool = {
10
11
  name: "write_file",
11
12
  description: "Create or overwrite a file with given content. Creates intermediate directories if needed.",
@@ -20,10 +21,9 @@ export const writeFileTool = {
20
21
  },
21
22
  handler: async (ctx, args) => {
22
23
  const path = String(args.path);
23
- const baseDir = resolve(ctx.baseDir);
24
- const resolved = resolve(baseDir, normalize(path));
25
- // Check path permissions
26
- const scopeCheck = isPathWritable(ctx.baseDir, path, ctx.scope, ctx.config.security?.paths);
24
+ const resolved = safeResolvePath(ctx.baseDir, path);
25
+ // Check path permissions using the resolved path
26
+ const scopeCheck = isPathWritable(ctx.baseDir, resolved, ctx.scope, ctx.config.security?.paths);
27
27
  if (!scopeCheck.allowed) {
28
28
  logSecurityBlock(ctx.sessionId, "file_write", scopeCheck.reason || "Path not allowed", path);
29
29
  return {
@@ -136,6 +136,6 @@ export class Renderer {
136
136
  if (!this.card)
137
137
  return;
138
138
  const { tool, start } = this.card;
139
- this.toolEnd(tool, Date.now() - start, true);
139
+ this.toolEnd(tool, Date.now() - start);
140
140
  }
141
141
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "micro-models-agent",
3
- "version": "0.13.1",
3
+ "version": "0.13.3",
4
4
  "description": "Micro Models Agent (MMA) — LLM agent harness for small models (Qwen3.5-9B, 32K-64K context)",
5
5
  "type": "module",
6
6
  "bin": {