@schuttdev/gigai 0.3.2 → 0.3.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.
@@ -4,7 +4,7 @@ import {
4
4
  GigaiError
5
5
  } from "./chunk-P53UVHTF.js";
6
6
 
7
- // ../server/dist/chunk-PO3MFBDO.mjs
7
+ // ../server/dist/chunk-OZTLH66B.mjs
8
8
  import {
9
9
  readFile as fsReadFile,
10
10
  writeFile as fsWriteFile,
@@ -26,7 +26,7 @@ async function validatePath(targetPath, allowedPaths) {
26
26
  const isAllowed = allowedPaths.some((allowed) => {
27
27
  const resolvedAllowed = resolve(allowed);
28
28
  const allowedPrefix = resolvedAllowed.endsWith("/") ? resolvedAllowed : resolvedAllowed + "/";
29
- return real === resolvedAllowed || real.startsWith(allowedPrefix) || resolved === resolvedAllowed || resolved.startsWith(allowedPrefix);
29
+ return real === resolvedAllowed || real.startsWith(allowedPrefix);
30
30
  });
31
31
  if (!isAllowed) {
32
32
  throw new GigaiError(
@@ -34,7 +34,7 @@ async function validatePath(targetPath, allowedPaths) {
34
34
  `Path not within allowed directories: ${targetPath}`
35
35
  );
36
36
  }
37
- return resolved;
37
+ return real;
38
38
  }
39
39
  async function readFileSafe(path, allowedPaths) {
40
40
  const safePath = await validatePath(path, allowedPaths);
@@ -4,7 +4,7 @@ import {
4
4
  GigaiError
5
5
  } from "./chunk-P53UVHTF.js";
6
6
 
7
- // ../server/dist/chunk-C43LTZCK.mjs
7
+ // ../server/dist/chunk-APX4HM32.mjs
8
8
  import { spawn } from "child_process";
9
9
  var SHELL_INTERPRETERS = /* @__PURE__ */ new Set([
10
10
  "sh",
@@ -44,7 +44,7 @@ async function execCommandSafe(command, args, config) {
44
44
  }
45
45
  }
46
46
  return new Promise((resolve, reject) => {
47
- const child = spawn(command, args, {
47
+ const child = spawn(command, ["--", ...args], {
48
48
  shell: false,
49
49
  stdio: ["ignore", "pipe", "pipe"]
50
50
  });
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  execCommandSafe
4
- } from "./chunk-O45SW2HC.js";
4
+ } from "./chunk-GIUPSQGA.js";
5
5
  import {
6
6
  editBuiltin,
7
7
  globBuiltin,
@@ -11,7 +11,7 @@ import {
11
11
  readFileSafe,
12
12
  searchFilesSafe,
13
13
  writeBuiltin
14
- } from "./chunk-FW3JH5IG.js";
14
+ } from "./chunk-75GPR4GR.js";
15
15
  import {
16
16
  ErrorCode,
17
17
  GigaiConfigSchema,
@@ -367,7 +367,7 @@ function executeTool(entry, args, timeout) {
367
367
  switch (entry.type) {
368
368
  case "cli":
369
369
  command = entry.config.command;
370
- spawnArgs = [...entry.config.args ?? [], ...sanitized];
370
+ spawnArgs = [...entry.config.args ?? [], "--", ...sanitized];
371
371
  cwd = entry.config.cwd;
372
372
  env = entry.config.env;
373
373
  break;
@@ -794,7 +794,7 @@ var cronPlugin = fp5(async (server, opts) => {
794
794
  const executor = async (tool, args) => {
795
795
  const entry = server.registry.get(tool);
796
796
  if (entry.type === "builtin") {
797
- const { execCommandSafe: execCommandSafe2 } = await import("./shell-B35UFUCJ-LJUZUNM6.js");
797
+ const { execCommandSafe: execCommandSafe2 } = await import("./shell-Z3WUF2GW-TVEYB5OM.js");
798
798
  const {
799
799
  readFileSafe: readFileSafe2,
800
800
  listDirSafe: listDirSafe2,
@@ -804,7 +804,7 @@ var cronPlugin = fp5(async (server, opts) => {
804
804
  editBuiltin: editBuiltin2,
805
805
  globBuiltin: globBuiltin2,
806
806
  grepBuiltin: grepBuiltin2
807
- } = await import("./filesystem-JSSD3C2D-FJH6SPOF.js");
807
+ } = await import("./filesystem-FWNLRLL6-LQG7PWAF.js");
808
808
  const builtinConfig = entry.config.config ?? {};
809
809
  switch (entry.config.builtin) {
810
810
  case "filesystem": {
@@ -9,7 +9,7 @@ import {
9
9
  searchFilesSafe,
10
10
  validatePath,
11
11
  writeBuiltin
12
- } from "./chunk-FW3JH5IG.js";
12
+ } from "./chunk-75GPR4GR.js";
13
13
  import "./chunk-P53UVHTF.js";
14
14
  export {
15
15
  editBuiltin,
package/dist/index.js CHANGED
@@ -4,12 +4,12 @@
4
4
  import { defineCommand, runMain } from "citty";
5
5
 
6
6
  // src/version.ts
7
- var VERSION = "0.3.2";
7
+ var VERSION = "0.3.3";
8
8
 
9
9
  // src/index.ts
10
10
  async function requireServer() {
11
11
  try {
12
- return await import("./dist-DTBR4X7U.js");
12
+ return await import("./dist-2BIIMXAI.js");
13
13
  } catch {
14
14
  console.error("Server dependencies not installed.");
15
15
  console.error("Run: npm install -g @schuttdev/gigai");
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  execCommandSafe
4
- } from "./chunk-O45SW2HC.js";
4
+ } from "./chunk-GIUPSQGA.js";
5
5
  import "./chunk-P53UVHTF.js";
6
6
  export {
7
7
  execCommandSafe
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@schuttdev/gigai",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "bin": {