cairn-ai 0.1.5 → 0.1.6

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,6 +1,6 @@
1
1
  {
2
2
  "name": "cairn",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "description": "Token-efficient agent harness with tool readiness for Codex, Claude Code, and Antigravity.",
5
5
  "author": {
6
6
  "name": "WkNam"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cairn-ai",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "description": "Token-efficient agent harness with tool readiness for Codex, Claude Code, and Antigravity",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -1,7 +1,8 @@
1
1
  #!/usr/bin/env node
2
+ import { realpathSync } from "node:fs";
2
3
  import { mkdir, readFile, writeFile } from "node:fs/promises";
3
4
  import { join, resolve } from "node:path";
4
- import { pathToFileURL } from "node:url";
5
+ import { fileURLToPath, pathToFileURL } from "node:url";
5
6
 
6
7
  const memoryTemplate = `# MEMORY
7
8
 
@@ -102,5 +103,10 @@ function localeValue() {
102
103
  }
103
104
 
104
105
  function isCliEntry() {
105
- return process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href;
106
+ if (!process.argv[1]) return false;
107
+ try {
108
+ return realpathSync(fileURLToPath(import.meta.url)) === realpathSync(process.argv[1]);
109
+ } catch {
110
+ return import.meta.url === pathToFileURL(process.argv[1]).href;
111
+ }
106
112
  }
@@ -1,8 +1,9 @@
1
1
  #!/usr/bin/env node
2
+ import { realpathSync } from "node:fs";
2
3
  import { readdir, stat } from "node:fs/promises";
3
4
  import { join, relative, sep } from "node:path";
4
5
  import { spawnSync } from "node:child_process";
5
- import { pathToFileURL } from "node:url";
6
+ import { fileURLToPath, pathToFileURL } from "node:url";
6
7
 
7
8
  if (isCliEntry()) {
8
9
  const root = process.cwd();
@@ -233,7 +234,12 @@ export function shouldUseShell(command, platform = process.platform) {
233
234
  }
234
235
 
235
236
  function isCliEntry() {
236
- return process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href;
237
+ if (!process.argv[1]) return false;
238
+ try {
239
+ return realpathSync(fileURLToPath(import.meta.url)) === realpathSync(process.argv[1]);
240
+ } catch {
241
+ return import.meta.url === pathToFileURL(process.argv[1]).href;
242
+ }
237
243
  }
238
244
 
239
245
  function normalizePath(path) {
package/scripts/cairn.mjs CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env node
2
+ import { realpathSync } from "node:fs";
2
3
  import { dirname, join } from "node:path";
3
4
  import { fileURLToPath, pathToFileURL } from "node:url";
4
5
  import { spawnSync } from "node:child_process";
@@ -47,7 +48,12 @@ function localeValue() {
47
48
  }
48
49
 
49
50
  function isCliEntry() {
50
- return process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href;
51
+ if (!process.argv[1]) return false;
52
+ try {
53
+ return realpathSync(fileURLToPath(import.meta.url)) === realpathSync(process.argv[1]);
54
+ } catch {
55
+ return import.meta.url === pathToFileURL(process.argv[1]).href;
56
+ }
51
57
  }
52
58
 
53
59
  const messages = {