@schuttdev/gigai 0.4.0-beta.1 → 0.4.0-beta.2

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.
@@ -6,9 +6,9 @@ import {
6
6
  canUseSudo,
7
7
  expandTilde,
8
8
  validateCommandArgs
9
- } from "./chunk-ROMGFLOH.js";
9
+ } from "./chunk-RATFNHIS.js";
10
10
 
11
- // ../server/dist/chunk-BO7QE6T2.mjs
11
+ // ../server/dist/chunk-DC6XGDGZ.mjs
12
12
  import { spawn } from "child_process";
13
13
  var MAX_OUTPUT_SIZE = 10 * 1024 * 1024;
14
14
  async function execCommandSafe(command, args, config, tier = "strict") {
@@ -4,9 +4,9 @@ import {
4
4
  GigaiError,
5
5
  canAccessPath,
6
6
  expandTilde
7
- } from "./chunk-ROMGFLOH.js";
7
+ } from "./chunk-RATFNHIS.js";
8
8
 
9
- // ../server/dist/chunk-HXHM5BKW.mjs
9
+ // ../server/dist/chunk-5JL7OKOY.mjs
10
10
  import {
11
11
  readFile as fsReadFile,
12
12
  writeFile as fsWriteFile,
@@ -1,8 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- // ../server/dist/chunk-NO4R43QM.mjs
3
+ // ../server/dist/chunk-2UGW2XVV.mjs
4
4
  import { resolve } from "path";
5
- import { homedir } from "os";
5
+ import { userInfo } from "os";
6
+ var SERVER_HOME = userInfo().homedir;
6
7
  var DEFAULT_SECURITY = { default: "strict", overrides: {} };
7
8
  function getEffectiveTier(config, toolName) {
8
9
  const c = config ?? DEFAULT_SECURITY;
@@ -124,7 +125,7 @@ function hasRecursiveFlag(args) {
124
125
  function validateCommandArgs(tier, command, args) {
125
126
  if (tier === "unrestricted") return { allowed: true };
126
127
  if (command === "rm" && hasRecursiveFlag(args)) {
127
- const home = homedir();
128
+ const home = SERVER_HOME;
128
129
  for (const arg of args) {
129
130
  if (arg.startsWith("-")) continue;
130
131
  const resolved = resolve(arg);
@@ -165,7 +166,7 @@ function canAccessPath(tier, resolvedPath, allowedPaths) {
165
166
  return { allowed: true };
166
167
  }
167
168
  case "standard": {
168
- const home = homedir();
169
+ const home = SERVER_HOME;
169
170
  for (const blocked of STANDARD_BLOCKED_PATHS) {
170
171
  const full = resolve(home, blocked);
171
172
  if (resolvedPath === full || resolvedPath.startsWith(full + "/")) {
@@ -179,8 +180,10 @@ function canAccessPath(tier, resolvedPath, allowedPaths) {
179
180
  }
180
181
  }
181
182
  function expandTilde(p) {
182
- if (p === "~") return homedir();
183
- if (p.startsWith("~/")) return homedir() + p.slice(1);
183
+ if (p === "~") return SERVER_HOME;
184
+ if (p.startsWith("~/")) return SERVER_HOME + p.slice(1);
185
+ if (p === "/root") return SERVER_HOME;
186
+ if (p.startsWith("/root/")) return SERVER_HOME + p.slice(5);
184
187
  return p;
185
188
  }
186
189
  function shouldInjectSeparator(tier) {
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  execCommandSafe
4
- } from "./chunk-NFKBLW3D.js";
4
+ } from "./chunk-2M2DRMA6.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-VCFG6XXN.js";
14
+ } from "./chunk-MMSQIOZJ.js";
15
15
  import {
16
16
  ErrorCode,
17
17
  GigaiConfigSchema,
@@ -21,7 +21,7 @@ import {
21
21
  generateEncryptionKey,
22
22
  getEffectiveTier,
23
23
  shouldInjectSeparator
24
- } from "./chunk-ROMGFLOH.js";
24
+ } from "./chunk-RATFNHIS.js";
25
25
 
26
26
  // ../server/dist/index.mjs
27
27
  import { parseArgs } from "util";
@@ -800,7 +800,7 @@ var cronPlugin = fp5(async (server, opts) => {
800
800
  const executor = async (tool, args) => {
801
801
  const entry = server.registry.get(tool);
802
802
  if (entry.type === "builtin") {
803
- const { execCommandSafe: execCommandSafe2 } = await import("./shell-IBJTGIEW-UEOHS5M2.js");
803
+ const { execCommandSafe: execCommandSafe2 } = await import("./shell-VQR5PWIE-DJ2D4RTS.js");
804
804
  const {
805
805
  readFileSafe: readFileSafe2,
806
806
  listDirSafe: listDirSafe2,
@@ -810,7 +810,7 @@ var cronPlugin = fp5(async (server, opts) => {
810
810
  editBuiltin: editBuiltin2,
811
811
  globBuiltin: globBuiltin2,
812
812
  grepBuiltin: grepBuiltin2
813
- } = await import("./filesystem-CVLQFP7T-VBJWEKEE.js");
813
+ } = await import("./filesystem-XG5X7226-QQZ5PZ5D.js");
814
814
  const builtinConfig = entry.config.config ?? {};
815
815
  switch (entry.config.builtin) {
816
816
  case "filesystem": {
@@ -9,8 +9,8 @@ import {
9
9
  searchFilesSafe,
10
10
  validatePath,
11
11
  writeBuiltin
12
- } from "./chunk-VCFG6XXN.js";
13
- import "./chunk-ROMGFLOH.js";
12
+ } from "./chunk-MMSQIOZJ.js";
13
+ import "./chunk-RATFNHIS.js";
14
14
  export {
15
15
  editBuiltin,
16
16
  globBuiltin,
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.4.0-beta.1";
7
+ var VERSION = "0.4.0-beta.2";
8
8
 
9
9
  // src/index.ts
10
10
  async function requireServer() {
11
11
  try {
12
- return await import("./dist-XQICZQ57.js");
12
+ return await import("./dist-NRIA4Z27.js");
13
13
  } catch {
14
14
  console.error("Server dependencies not installed.");
15
15
  console.error("Run: npm install -g @schuttdev/gigai");
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  execCommandSafe
4
- } from "./chunk-NFKBLW3D.js";
5
- import "./chunk-ROMGFLOH.js";
4
+ } from "./chunk-2M2DRMA6.js";
5
+ import "./chunk-RATFNHIS.js";
6
6
  export {
7
7
  execCommandSafe
8
8
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@schuttdev/gigai",
3
- "version": "0.4.0-beta.1",
3
+ "version": "0.4.0-beta.2",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "bin": {