@soulguard/core 0.1.0 → 0.1.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soulguard/core",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "bin": {
5
5
  "soulguard": "dist/cli.js"
6
6
  },
package/src/cli.ts CHANGED
@@ -5,6 +5,7 @@
5
5
 
6
6
  import { Command } from "commander";
7
7
  import { resolve } from "node:path";
8
+ import { readFileSync } from "node:fs";
8
9
  import { readFile } from "node:fs/promises";
9
10
  import { LiveConsoleOutput } from "./console-live.js";
10
11
  import { StatusCommand } from "./cli/status-command.js";
@@ -62,7 +63,7 @@ async function makeOptions(workspace: string): Promise<StatusOptions> {
62
63
  const program = new Command()
63
64
  .name("soulguard")
64
65
  .description("Identity protection for AI agents")
65
- .version("0.0.0");
66
+ .version(JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf-8")).version);
66
67
 
67
68
  program
68
69
  .command("status")
package/src/glob.ts CHANGED
@@ -73,7 +73,10 @@ export async function resolvePatterns(
73
73
  return err(result.error);
74
74
  }
75
75
  for (const match of result.value) {
76
- files.add(match);
76
+ const statResult = await ops.stat(match);
77
+ if (statResult.ok && !statResult.value.isDirectory) {
78
+ files.add(match);
79
+ }
77
80
  }
78
81
  } else {
79
82
  files.add(pattern);
@@ -93,6 +93,7 @@ export class MockSystemOps implements SystemOperations {
93
93
  return ok({
94
94
  path,
95
95
  ownership: { user: file.owner, group: file.group, mode: file.mode },
96
+ isDirectory: false,
96
97
  });
97
98
  }
98
99
 
@@ -176,6 +176,7 @@ export class NodeSystemOps implements SystemOperations {
176
176
  return ok({
177
177
  path,
178
178
  ownership: { user, group, mode: modeToString(s.mode) },
179
+ isDirectory: s.isDirectory(),
179
180
  });
180
181
  } catch (e) {
181
182
  return err(mapError(e, path, "stat"));
package/src/system-ops.ts CHANGED
@@ -18,6 +18,7 @@ import { ok } from "./result.js";
18
18
  export type FileStat = {
19
19
  path: string;
20
20
  ownership: FileOwnership;
21
+ isDirectory: boolean;
21
22
  };
22
23
 
23
24
  export interface SystemOperations {