pi-landstrip 0.18.38 → 0.18.40
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/api.ts +1 -1
- package/dist/index.ts +31 -23
- package/package.json +2 -2
package/api.ts
CHANGED
|
@@ -6,7 +6,7 @@ import type { Readable, Writable } from 'node:stream';
|
|
|
6
6
|
|
|
7
7
|
import type { ExtensionAPI, ExtensionContext } from '@earendil-works/pi-coding-agent';
|
|
8
8
|
|
|
9
|
-
import { isRecord } from '@landstrip/landstrip/shared';
|
|
9
|
+
import { isRecord } from '@landstrip/landstrip-api/shared';
|
|
10
10
|
|
|
11
11
|
export const LANDSTRIP_CONTEXT_ENV = 'LANDSTRIP_CONTEXT';
|
|
12
12
|
export const LANDSTRIP_RUNTIME_VERSION = 2;
|
package/dist/index.ts
CHANGED
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
} from "@earendil-works/pi-coding-agent";
|
|
25
25
|
import {
|
|
26
26
|
binaryPath
|
|
27
|
-
} from "@landstrip/landstrip";
|
|
27
|
+
} from "@landstrip/landstrip-api";
|
|
28
28
|
import {
|
|
29
29
|
allowsAllDomains,
|
|
30
30
|
controlResponseLine,
|
|
@@ -43,11 +43,11 @@ import {
|
|
|
43
43
|
parseTrapLine,
|
|
44
44
|
pathUnderDirectory,
|
|
45
45
|
sessionScopeFor
|
|
46
|
-
} from "@landstrip/landstrip/shared";
|
|
47
|
-
import { startFilterProxy } from "@landstrip/landstrip/proxy";
|
|
46
|
+
} from "@landstrip/landstrip-api/shared";
|
|
47
|
+
import { startFilterProxy } from "@landstrip/landstrip-api/proxy";
|
|
48
48
|
|
|
49
49
|
// api.ts
|
|
50
|
-
import { isRecord } from "@landstrip/landstrip/shared";
|
|
50
|
+
import { isRecord } from "@landstrip/landstrip-api/shared";
|
|
51
51
|
var LANDSTRIP_CONTEXT_ENV = "LANDSTRIP_CONTEXT";
|
|
52
52
|
var LANDSTRIP_RUNTIME_VERSION = 2;
|
|
53
53
|
var RUNTIME_REGISTER_EVENT = "landstrip:runtime:register:v2";
|
|
@@ -209,7 +209,7 @@ var BUILT_IN_LANDSTRIP_CONFIG = {
|
|
|
209
209
|
import { readFileSync } from "node:fs";
|
|
210
210
|
import { homedir } from "node:os";
|
|
211
211
|
import { isAbsolute, join, resolve } from "node:path";
|
|
212
|
-
import { expandHomePath, isRecord as isRecord2 } from "@landstrip/landstrip/shared";
|
|
212
|
+
import { expandHomePath, isRecord as isRecord2 } from "@landstrip/landstrip-api/shared";
|
|
213
213
|
function expandFileReferences(text, baseDir) {
|
|
214
214
|
if (!text.includes("{file:"))
|
|
215
215
|
return text;
|
|
@@ -2084,25 +2084,37 @@ function isSupportedPiVersion(version) {
|
|
|
2084
2084
|
}
|
|
2085
2085
|
return true;
|
|
2086
2086
|
}
|
|
2087
|
+
function findPiPackage(entry) {
|
|
2088
|
+
let dir = dirname3(realpathSync(entry));
|
|
2089
|
+
for (;; ) {
|
|
2090
|
+
const pkgPath = join6(dir, "package.json");
|
|
2091
|
+
if (existsSync4(pkgPath)) {
|
|
2092
|
+
const pkg = readPiPackage(pkgPath);
|
|
2093
|
+
if (pkg)
|
|
2094
|
+
return pkg;
|
|
2095
|
+
}
|
|
2096
|
+
const parent = dirname3(dir);
|
|
2097
|
+
if (parent === dir)
|
|
2098
|
+
return;
|
|
2099
|
+
dir = parent;
|
|
2100
|
+
}
|
|
2101
|
+
}
|
|
2087
2102
|
function resolvePiPackage() {
|
|
2088
2103
|
if (piPackageResolved)
|
|
2089
2104
|
return cachedPiPackage;
|
|
2090
2105
|
piPackageResolved = true;
|
|
2106
|
+
const argvEntry = process.argv[1];
|
|
2107
|
+
if (argvEntry) {
|
|
2108
|
+
try {
|
|
2109
|
+
const pkg = findPiPackage(argvEntry);
|
|
2110
|
+
if (pkg)
|
|
2111
|
+
return pkg;
|
|
2112
|
+
} catch {}
|
|
2113
|
+
}
|
|
2091
2114
|
try {
|
|
2092
|
-
const
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
const pkgPath = join6(dir2, "package.json");
|
|
2096
|
-
if (existsSync4(pkgPath)) {
|
|
2097
|
-
const pkg = readPiPackage(pkgPath);
|
|
2098
|
-
if (pkg)
|
|
2099
|
-
return pkg;
|
|
2100
|
-
}
|
|
2101
|
-
const parent = dirname3(dir2);
|
|
2102
|
-
if (parent === dir2)
|
|
2103
|
-
break;
|
|
2104
|
-
dir2 = parent;
|
|
2105
|
-
}
|
|
2115
|
+
const pkg = findPiPackage(fileURLToPath(import.meta.resolve("@earendil-works/pi-coding-agent")));
|
|
2116
|
+
if (pkg)
|
|
2117
|
+
return pkg;
|
|
2106
2118
|
} catch {}
|
|
2107
2119
|
let dir = packageDir;
|
|
2108
2120
|
for (;; ) {
|
|
@@ -4563,10 +4575,6 @@ ${catalog.diagnostics.join(`
|
|
|
4563
4575
|
return { ...context, agent: this.primaryAgent?.name };
|
|
4564
4576
|
}
|
|
4565
4577
|
piInvocation() {
|
|
4566
|
-
const argvEntry = process.argv[1];
|
|
4567
|
-
if (argvEntry && /(?:^|[/\\])cli\.(?:js|mjs|cjs|ts)$/.test(argvEntry)) {
|
|
4568
|
-
return { command: process.execPath, args: [argvEntry] };
|
|
4569
|
-
}
|
|
4570
4578
|
const pkg = resolvePiPackage();
|
|
4571
4579
|
if (!pkg) {
|
|
4572
4580
|
throw new Error("Unable to determine the running Pi CLI entry; process-backed subagents are unavailable");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-landstrip",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.40",
|
|
4
4
|
"description": "Sandboxed Bash and process-backed agents for Pi",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"landstrip",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"ci:test": "npm run test"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@landstrip/landstrip": "^0.18.
|
|
42
|
+
"@landstrip/landstrip-api": "^0.18.40",
|
|
43
43
|
"jsonc-parser": "^3.3.1",
|
|
44
44
|
"minimatch": "^10.2.5",
|
|
45
45
|
"yaml": "^2.9.0"
|