@botiverse/oar 0.66.0 → 0.67.0
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/dist/contracts/records.d.ts +1 -1
- package/dist/contracts/records.d.ts.map +1 -1
- package/dist/forms/fields.d.ts +9 -0
- package/dist/forms/fields.d.ts.map +1 -0
- package/dist/forms/fields.js +46 -0
- package/dist/forms/fields.js.map +1 -0
- package/dist/forms/index.d.ts +11 -0
- package/dist/forms/index.d.ts.map +1 -0
- package/dist/forms/index.js +19 -0
- package/dist/forms/index.js.map +1 -0
- package/dist/forms/listing.d.ts +15 -0
- package/dist/forms/listing.d.ts.map +1 -0
- package/dist/forms/listing.js +28 -0
- package/dist/forms/listing.js.map +1 -0
- package/dist/forms/map.d.ts +32 -0
- package/dist/forms/map.d.ts.map +1 -0
- package/dist/forms/map.js +76 -0
- package/dist/forms/map.js.map +1 -0
- package/dist/forms/runtimes/grok.d.ts +15 -0
- package/dist/forms/runtimes/grok.d.ts.map +1 -0
- package/dist/forms/runtimes/grok.js +56 -0
- package/dist/forms/runtimes/grok.js.map +1 -0
- package/dist/forms/types.d.ts +131 -0
- package/dist/forms/types.d.ts.map +1 -0
- package/dist/forms/types.js +2 -0
- package/dist/forms/types.js.map +1 -0
- package/dist/forms/validate.d.ts +10 -0
- package/dist/forms/validate.d.ts.map +1 -0
- package/dist/forms/validate.js +147 -0
- package/dist/forms/validate.js.map +1 -0
- package/dist/runtimes/pi/open.d.ts.map +1 -1
- package/dist/runtimes/pi/open.js +12 -0
- package/dist/runtimes/pi/open.js.map +1 -1
- package/dist/runtimes/pi/projection.d.ts.map +1 -1
- package/dist/runtimes/pi/projection.js +8 -0
- package/dist/runtimes/pi/projection.js.map +1 -1
- package/dist/runtimes/pi-durable/projection.d.ts.map +1 -1
- package/dist/runtimes/pi-durable/projection.js +8 -1
- package/dist/runtimes/pi-durable/projection.js.map +1 -1
- package/dist/shared/executable/index.d.ts +2 -1
- package/dist/shared/executable/index.d.ts.map +1 -1
- package/dist/shared/executable/index.js +2 -1
- package/dist/shared/executable/index.js.map +1 -1
- package/dist/shared/executable/isolated.d.ts.map +1 -1
- package/dist/shared/executable/isolated.js +5 -1
- package/dist/shared/executable/isolated.js.map +1 -1
- package/dist/shared/executable/process.d.ts +4 -4
- package/dist/shared/executable/process.d.ts.map +1 -1
- package/dist/shared/executable/process.js +7 -7
- package/dist/shared/executable/process.js.map +1 -1
- package/dist/shared/executable/run.d.ts.map +1 -1
- package/dist/shared/executable/run.js +10 -4
- package/dist/shared/executable/run.js.map +1 -1
- package/dist/shared/executable/windows-shim.d.ts +38 -0
- package/dist/shared/executable/windows-shim.d.ts.map +1 -0
- package/dist/shared/executable/windows-shim.js +91 -0
- package/dist/shared/executable/windows-shim.js.map +1 -0
- package/package.json +11 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run.js","sourceRoot":"","sources":["../../../src/shared/executable/run.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,
|
|
1
|
+
{"version":3,"file":"run.js","sourceRoot":"","sources":["../../../src/shared/executable/run.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACrG,OAAO,EAAE,WAAW,EAAE,UAAU,EAA2B,MAAM,kBAAkB,CAAC;AACpF,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAwBtE,MAAM,YAAY,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC;AAErC,MAAM,CAAC,MAAM,aAAa,GAAqB,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,GAAG,EAAE,EAAE,EAAE;IACtF,MAAM,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|
|
2
|
+
export interface ResolvedShim {
|
|
3
|
+
readonly command: string;
|
|
4
|
+
readonly prefixArgs: readonly string[];
|
|
5
|
+
}
|
|
6
|
+
/** Whether a resolved command is a Windows shell shim (`.cmd`/`.bat`), the only commands that go through `cmd.exe`. */
|
|
7
|
+
export declare function isWindowsShim(command: string): boolean;
|
|
8
|
+
/**
|
|
9
|
+
* What a global package-manager shim (`.cmd`/`.bat`) would run, or null when
|
|
10
|
+
* the text is not a shim shape we recognize. npm and pnpm both wrap a
|
|
11
|
+
* package's `bin`, naming every path relative to the shim's own directory
|
|
12
|
+
* (`%dp0%` / `%~dp0`) and forwarding exactly `%*`:
|
|
13
|
+
* - a native binary (claude's `claude.exe`) runs directly;
|
|
14
|
+
* - a Node script (codex's `codex.js`) runs with the shim's own `node.exe`
|
|
15
|
+
* when it sits beside the shim, else `node` from PATH.
|
|
16
|
+
*
|
|
17
|
+
* Recognized by the shim-relative target alone, so npm's and pnpm's differing
|
|
18
|
+
* boilerplate both match, while an absolute target or extra fixed arguments
|
|
19
|
+
* (a hand-rolled `.cmd`) do not and the caller launches it unchanged. Pure:
|
|
20
|
+
* `shimExists` decides whether the bundled `node.exe` is present (the real
|
|
21
|
+
* check is the file system; a test passes its own). The caller spawns
|
|
22
|
+
* `command` with `[...prefixArgs, ...callerArgs]` and no shell.
|
|
23
|
+
*/
|
|
24
|
+
export declare function parseWindowsShim(shimPath: string, text: string, shimExists: (candidate: string) => boolean): ResolvedShim | null;
|
|
25
|
+
/**
|
|
26
|
+
* The command and arguments to spawn, with no shell, when a `.cmd`/`.bat`
|
|
27
|
+
* shim can be read as the Node CLI it wraps: the interpreter and script it
|
|
28
|
+
* would run, with the shim's own arguments ahead of the caller's, so nothing
|
|
29
|
+
* reaches `cmd.exe`. Off Windows, for a non-shim command, or for a shim this
|
|
30
|
+
* cannot read as a Node CLI, the inputs unchanged, so the caller spawns as
|
|
31
|
+
* before (cross-spawn's shim handling). `resolve` finds a bare command on
|
|
32
|
+
* PATH (its own default).
|
|
33
|
+
*/
|
|
34
|
+
export declare function windowsSpawnTarget(command: string, args: readonly string[], platform?: NodeJS.Platform, resolve?: (name: string) => string | null): {
|
|
35
|
+
readonly command: string;
|
|
36
|
+
readonly args: readonly string[];
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=windows-shim.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"windows-shim.d.ts","sourceRoot":"","sources":["../../../src/shared/executable/windows-shim.ts"],"names":[],"mappings":"AAyBA,2GAA2G;AAC3G,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;CACxC;AAMD,uHAAuH;AACvH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAEtD;AAsBD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,GAAG,YAAY,GAAG,IAAI,CAiBhI;AAWD;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,QAAQ,GAAE,MAAM,CAAC,QAA2B,EAC5C,OAAO,GAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,GAAG,IAAwB,GAC3D;IAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,CAWhE"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { resolveExecutable } from "./resolve.js";
|
|
4
|
+
const SHIM = /\.(?:cmd|bat)$/iu;
|
|
5
|
+
const SCRIPT = /\.(?:c|m)?js$/iu;
|
|
6
|
+
const NATIVE = /\.(?:exe|com)$/iu;
|
|
7
|
+
/** Whether a resolved command is a Windows shell shim (`.cmd`/`.bat`), the only commands that go through `cmd.exe`. */
|
|
8
|
+
export function isWindowsShim(command) {
|
|
9
|
+
return SHIM.test(command);
|
|
10
|
+
}
|
|
11
|
+
/** Every double-quoted token in the shim text, in order. */
|
|
12
|
+
function quotedTokens(text) {
|
|
13
|
+
return [...text.matchAll(/"([^"]*)"/gu)].map((match) => match[1] ?? "");
|
|
14
|
+
}
|
|
15
|
+
/** A token naming the shim's own directory: npm's `%dp0%` or pnpm's `%~dp0`. */
|
|
16
|
+
function isShimRelative(token) {
|
|
17
|
+
return /%(?:~)?dp0%?/iu.test(token);
|
|
18
|
+
}
|
|
19
|
+
/** Replace a shim's own-directory variable (`%dp0%` or `%~dp0`) and normalize to a Windows path. */
|
|
20
|
+
function expand(token, shimDir) {
|
|
21
|
+
return path.win32.normalize(token.replaceAll(/%dp0%|%~dp0/giu, `${shimDir}\\`));
|
|
22
|
+
}
|
|
23
|
+
/** `node` from a shim, bare or shim-relative; not the script it runs. */
|
|
24
|
+
function isNodeBinary(candidate) {
|
|
25
|
+
return /(?:^|[\\/])node\.exe$/iu.test(candidate);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* What a global package-manager shim (`.cmd`/`.bat`) would run, or null when
|
|
29
|
+
* the text is not a shim shape we recognize. npm and pnpm both wrap a
|
|
30
|
+
* package's `bin`, naming every path relative to the shim's own directory
|
|
31
|
+
* (`%dp0%` / `%~dp0`) and forwarding exactly `%*`:
|
|
32
|
+
* - a native binary (claude's `claude.exe`) runs directly;
|
|
33
|
+
* - a Node script (codex's `codex.js`) runs with the shim's own `node.exe`
|
|
34
|
+
* when it sits beside the shim, else `node` from PATH.
|
|
35
|
+
*
|
|
36
|
+
* Recognized by the shim-relative target alone, so npm's and pnpm's differing
|
|
37
|
+
* boilerplate both match, while an absolute target or extra fixed arguments
|
|
38
|
+
* (a hand-rolled `.cmd`) do not and the caller launches it unchanged. Pure:
|
|
39
|
+
* `shimExists` decides whether the bundled `node.exe` is present (the real
|
|
40
|
+
* check is the file system; a test passes its own). The caller spawns
|
|
41
|
+
* `command` with `[...prefixArgs, ...callerArgs]` and no shell.
|
|
42
|
+
*/
|
|
43
|
+
export function parseWindowsShim(shimPath, text, shimExists) {
|
|
44
|
+
if (!text.includes("%*")) {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
const shimDir = path.win32.dirname(shimPath);
|
|
48
|
+
const relative = [...new Set(quotedTokens(text).filter((token) => isShimRelative(token)).map((token) => expand(token, shimDir)))];
|
|
49
|
+
// The shim's own `node.exe` is the interpreter, not the target it runs.
|
|
50
|
+
const scripts = relative.filter((candidate) => SCRIPT.test(candidate));
|
|
51
|
+
const natives = relative.filter((candidate) => NATIVE.test(candidate) && !isNodeBinary(candidate));
|
|
52
|
+
if (scripts.length === 1 && natives.length === 0) {
|
|
53
|
+
const bundledNode = path.win32.join(shimDir, "node.exe");
|
|
54
|
+
return { command: shimExists(bundledNode) ? bundledNode : "node", prefixArgs: [scripts[0] ?? ""] };
|
|
55
|
+
}
|
|
56
|
+
if (natives.length === 1 && scripts.length === 0) {
|
|
57
|
+
return { command: natives[0] ?? "", prefixArgs: [] };
|
|
58
|
+
}
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
/** A shim's text, or null when it cannot be read. */
|
|
62
|
+
function readShim(shimPath) {
|
|
63
|
+
try {
|
|
64
|
+
return readFileSync(shimPath, "utf8");
|
|
65
|
+
}
|
|
66
|
+
catch {
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* The command and arguments to spawn, with no shell, when a `.cmd`/`.bat`
|
|
72
|
+
* shim can be read as the Node CLI it wraps: the interpreter and script it
|
|
73
|
+
* would run, with the shim's own arguments ahead of the caller's, so nothing
|
|
74
|
+
* reaches `cmd.exe`. Off Windows, for a non-shim command, or for a shim this
|
|
75
|
+
* cannot read as a Node CLI, the inputs unchanged, so the caller spawns as
|
|
76
|
+
* before (cross-spawn's shim handling). `resolve` finds a bare command on
|
|
77
|
+
* PATH (its own default).
|
|
78
|
+
*/
|
|
79
|
+
export function windowsSpawnTarget(command, args, platform = process.platform, resolve = resolveExecutable) {
|
|
80
|
+
if (platform !== "win32") {
|
|
81
|
+
return { command, args };
|
|
82
|
+
}
|
|
83
|
+
const resolved = isWindowsShim(command) ? command : resolve(command);
|
|
84
|
+
if (resolved === null || !isWindowsShim(resolved)) {
|
|
85
|
+
return { command, args };
|
|
86
|
+
}
|
|
87
|
+
const text = readShim(resolved);
|
|
88
|
+
const shim = text === null ? null : parseWindowsShim(resolved, text, existsSync);
|
|
89
|
+
return shim === null ? { command, args } : { command: shim.command, args: [...shim.prefixArgs, ...args] };
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=windows-shim.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"windows-shim.js","sourceRoot":"","sources":["../../../src/shared/executable/windows-shim.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AA6BjD,MAAM,IAAI,GAAG,kBAAkB,CAAC;AAChC,MAAM,MAAM,GAAG,iBAAiB,CAAC;AACjC,MAAM,MAAM,GAAG,kBAAkB,CAAC;AAElC,uHAAuH;AACvH,MAAM,UAAU,aAAa,CAAC,OAAe;IAC3C,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAC5B,CAAC;AAED,4DAA4D;AAC5D,SAAS,YAAY,CAAC,IAAY;IAChC,OAAO,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,GAAG,C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AC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACrE,IAAI,QAAQ,KAAK,IAAI,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,EAAE,CAAC;QAClD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC3B,CAAC;IACD,MAAM,IAAI,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAChC,MAAM,IAAI,GAAG,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,gBAAgB,CAAC,QAAQ,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC;IACjF,OAAO,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC,UAAU,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;AAC5G,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@botiverse/oar",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.67.0",
|
|
4
4
|
"description": "A programming interface for all agent harnesses: provider-independent contracts for controlling and observing agent runtimes",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -22,6 +22,10 @@
|
|
|
22
22
|
"types": "./dist/brands.d.ts",
|
|
23
23
|
"import": "./dist/brands.js"
|
|
24
24
|
},
|
|
25
|
+
"./forms": {
|
|
26
|
+
"types": "./dist/forms/index.d.ts",
|
|
27
|
+
"import": "./dist/forms/index.js"
|
|
28
|
+
},
|
|
25
29
|
"./testing": {
|
|
26
30
|
"types": "./dist/testing/index.d.ts",
|
|
27
31
|
"import": "./dist/testing/index.js"
|
|
@@ -72,16 +76,16 @@
|
|
|
72
76
|
"license": "Apache-2.0",
|
|
73
77
|
"dependencies": {
|
|
74
78
|
"@agentclientprotocol/sdk": "^1.4.0",
|
|
75
|
-
"@earendil-works/pi-ai": "^1.
|
|
76
|
-
"@earendil-works/pi-coding-agent": "^1.
|
|
79
|
+
"@earendil-works/pi-ai": "^1.3.0",
|
|
80
|
+
"@earendil-works/pi-coding-agent": "^1.3.0",
|
|
77
81
|
"cross-spawn": "^7.0.6",
|
|
78
82
|
"undici": "8.10.2",
|
|
79
83
|
"which": "^2.0.2"
|
|
80
84
|
},
|
|
81
85
|
"peerDependencies": {
|
|
82
86
|
"@cursor/sdk": "1.0.37",
|
|
83
|
-
"@earendil-works/pi-durable": "~1.
|
|
84
|
-
"@earendil-works/chord": "~1.
|
|
87
|
+
"@earendil-works/pi-durable": "~1.3.0",
|
|
88
|
+
"@earendil-works/chord": "~1.3.0"
|
|
85
89
|
},
|
|
86
90
|
"peerDependenciesMeta": {
|
|
87
91
|
"@cursor/sdk": {
|
|
@@ -98,8 +102,8 @@
|
|
|
98
102
|
"@cursor/sdk": "1.0.37",
|
|
99
103
|
"@types/cross-spawn": "^6.0.6",
|
|
100
104
|
"@types/which": "^2.0.2",
|
|
101
|
-
"@earendil-works/pi-durable": "1.
|
|
102
|
-
"@earendil-works/chord": "1.
|
|
105
|
+
"@earendil-works/pi-durable": "1.3.0",
|
|
106
|
+
"@earendil-works/chord": "1.3.0"
|
|
103
107
|
},
|
|
104
108
|
"scripts": {
|
|
105
109
|
"build": "tsc -p tsconfig.build.json",
|