@grackle-ai/runtime-genaiscript 0.82.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/dist/genaiscript.d.ts +12 -0
- package/dist/genaiscript.d.ts.map +1 -0
- package/dist/genaiscript.js +218 -0
- package/dist/genaiscript.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/tsdoc-metadata.json +11 -0
- package/package.json +46 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { AgentRuntime, AgentSession, SpawnOptions, ResumeOptions } from "@grackle-ai/runtime-sdk";
|
|
2
|
+
/**
|
|
3
|
+
* Runtime for GenAIScript — executes .genai.mjs scripts via the CLI,
|
|
4
|
+
* streaming stderr progress in real-time and parsing the structured
|
|
5
|
+
* JSON result for the script's output text.
|
|
6
|
+
*/
|
|
7
|
+
export declare class GenAIScriptRuntime implements AgentRuntime {
|
|
8
|
+
name: string;
|
|
9
|
+
spawn(opts: SpawnOptions): AgentSession;
|
|
10
|
+
resume(_opts: ResumeOptions): AgentSession;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=genaiscript.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"genaiscript.d.ts","sourceRoot":"","sources":["../src/genaiscript.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAc,YAAY,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AA0OnH;;;;GAIG;AACH,qBAAa,kBAAmB,YAAW,YAAY;IAC9C,IAAI,EAAE,MAAM,CAAiB;IAE7B,KAAK,CAAC,IAAI,EAAE,YAAY,GAAG,YAAY;IAIvC,MAAM,CAAC,KAAK,EAAE,aAAa,GAAG,YAAY;CAGlD"}
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
import { spawn as spawnProcess } from "node:child_process";
|
|
2
|
+
import { writeFile, readFile, mkdtemp, rm } from "node:fs/promises";
|
|
3
|
+
import { join, dirname } from "node:path";
|
|
4
|
+
import { tmpdir, homedir } from "node:os";
|
|
5
|
+
import { createInterface } from "node:readline";
|
|
6
|
+
import { createRequire } from "node:module";
|
|
7
|
+
import { logger, ensureRuntimeInstalled } from "@grackle-ai/runtime-sdk";
|
|
8
|
+
import { SESSION_STATUS } from "@grackle-ai/common";
|
|
9
|
+
/**
|
|
10
|
+
* Resolve the path to the genaiscript CLI entry point (CJS bundle).
|
|
11
|
+
*
|
|
12
|
+
* In dev mode, resolves from the PowerLine package's own node_modules.
|
|
13
|
+
* In production, resolves from the isolated runtime directory after lazy install.
|
|
14
|
+
*
|
|
15
|
+
* @param runtimeDir - The isolated runtime directory (empty string in dev mode)
|
|
16
|
+
*/
|
|
17
|
+
function resolveGenAIScriptBin(runtimeDir) {
|
|
18
|
+
// Try the provided base first; fall back to the runtime directory if the
|
|
19
|
+
// monorepo doesn't have genaiscript (removed from devDependencies).
|
|
20
|
+
const bases = runtimeDir
|
|
21
|
+
? [join(runtimeDir, "package.json")]
|
|
22
|
+
: [import.meta.url, join(homedir(), ".grackle", "runtimes", "genaiscript", "package.json")];
|
|
23
|
+
for (const base of bases) {
|
|
24
|
+
try {
|
|
25
|
+
const esmRequire = createRequire(base);
|
|
26
|
+
const pkgPath = esmRequire.resolve("genaiscript/package.json");
|
|
27
|
+
const pkgDir = dirname(pkgPath);
|
|
28
|
+
const pkg = esmRequire(pkgPath);
|
|
29
|
+
const binRelative = typeof pkg.bin === "string"
|
|
30
|
+
? pkg.bin
|
|
31
|
+
: (pkg.bin?.genaiscript ?? "built/genaiscript.cjs");
|
|
32
|
+
return join(pkgDir, binRelative);
|
|
33
|
+
}
|
|
34
|
+
catch { /* try next base */ }
|
|
35
|
+
}
|
|
36
|
+
throw new Error("Cannot resolve genaiscript binary. Run: npm install genaiscript");
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* A session that executes a GenAIScript (.genai.mjs) program via the CLI.
|
|
40
|
+
*
|
|
41
|
+
* Stderr is streamed as system events in real-time (progress, console.log).
|
|
42
|
+
* The structured result is written to `res.json` via the `-o` flag and
|
|
43
|
+
* the script's output text is yielded as a text event on completion.
|
|
44
|
+
*/
|
|
45
|
+
class GenAIScriptSession {
|
|
46
|
+
id;
|
|
47
|
+
runtimeName = "genaiscript";
|
|
48
|
+
runtimeSessionId;
|
|
49
|
+
status = SESSION_STATUS.RUNNING;
|
|
50
|
+
scriptContent;
|
|
51
|
+
mcpBroker;
|
|
52
|
+
child = null;
|
|
53
|
+
killed = false;
|
|
54
|
+
killReason = "killed";
|
|
55
|
+
tmpDir = null;
|
|
56
|
+
constructor(opts) {
|
|
57
|
+
this.id = opts.sessionId;
|
|
58
|
+
this.runtimeSessionId = `genaiscript-${opts.sessionId}`;
|
|
59
|
+
this.scriptContent = opts.scriptContent || "";
|
|
60
|
+
this.mcpBroker = opts.mcpBroker;
|
|
61
|
+
}
|
|
62
|
+
async *stream() {
|
|
63
|
+
const ts = () => new Date().toISOString();
|
|
64
|
+
if (!this.scriptContent) {
|
|
65
|
+
yield { type: "error", timestamp: ts(), content: "No script content provided" };
|
|
66
|
+
this.status = SESSION_STATUS.STOPPED;
|
|
67
|
+
yield { type: "status", timestamp: ts(), content: "failed" };
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
this.tmpDir = await mkdtemp(join(tmpdir(), "genaiscript-"));
|
|
71
|
+
const scriptPath = join(this.tmpDir, `${this.id}.genai.mjs`);
|
|
72
|
+
const outputDir = join(this.tmpDir, "output");
|
|
73
|
+
try {
|
|
74
|
+
await writeFile(scriptPath, this.scriptContent, "utf8");
|
|
75
|
+
// Use -o to write structured result to outputDir/res.json
|
|
76
|
+
const args = ["run", scriptPath, "-o", outputDir];
|
|
77
|
+
// Inject MCP broker URL via GENAISCRIPT_VAR_ env vars so scripts can access
|
|
78
|
+
// them as `env.vars.GRACKLE_MCP_URL` / `env.vars.GRACKLE_MCP_TOKEN`.
|
|
79
|
+
const childEnv = { ...process.env };
|
|
80
|
+
if (this.mcpBroker) {
|
|
81
|
+
childEnv.GENAISCRIPT_VAR_GRACKLE_MCP_URL = this.mcpBroker.url;
|
|
82
|
+
childEnv.GENAISCRIPT_VAR_GRACKLE_MCP_TOKEN = this.mcpBroker.token;
|
|
83
|
+
}
|
|
84
|
+
const runtimeDir = await ensureRuntimeInstalled("genaiscript");
|
|
85
|
+
const genaiscriptBin = resolveGenAIScriptBin(runtimeDir);
|
|
86
|
+
logger.info({ sessionId: this.id, scriptPath, genaiscriptBin }, "genaiscript: spawning");
|
|
87
|
+
yield { type: "system", timestamp: ts(), content: "Starting GenAIScript..." };
|
|
88
|
+
this.child = spawnProcess(process.execPath, [genaiscriptBin, ...args], {
|
|
89
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
90
|
+
env: childEnv,
|
|
91
|
+
});
|
|
92
|
+
// Handle spawn errors (e.g. missing binary) to avoid unhandled 'error' events
|
|
93
|
+
this.child.on("error", (err) => {
|
|
94
|
+
logger.error({ sessionId: this.id, err }, "genaiscript: spawn error");
|
|
95
|
+
});
|
|
96
|
+
// Drain stdout to prevent pipe buffer from blocking the process.
|
|
97
|
+
// The structured result comes from res.json, not stdout.
|
|
98
|
+
this.child.stdout.resume();
|
|
99
|
+
// Stream stderr lines as system events (progress, console.log output)
|
|
100
|
+
const stderrReader = createInterface({ input: this.child.stderr });
|
|
101
|
+
for await (const line of stderrReader) {
|
|
102
|
+
if (this.killed) {
|
|
103
|
+
break;
|
|
104
|
+
}
|
|
105
|
+
if (!line.trim()) {
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
108
|
+
yield { type: "system", timestamp: ts(), content: line };
|
|
109
|
+
}
|
|
110
|
+
// Wait for process exit
|
|
111
|
+
const exitCode = await new Promise((resolve) => {
|
|
112
|
+
if (this.child.exitCode !== null) {
|
|
113
|
+
resolve(this.child.exitCode);
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
this.child.on("close", (code) => {
|
|
117
|
+
resolve(code ?? 1);
|
|
118
|
+
});
|
|
119
|
+
});
|
|
120
|
+
if (this.killed) {
|
|
121
|
+
this.status = SESSION_STATUS.STOPPED;
|
|
122
|
+
yield { type: "status", timestamp: ts(), content: this.killReason };
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
// Parse the structured result from res.json
|
|
126
|
+
let result;
|
|
127
|
+
try {
|
|
128
|
+
const resJson = await readFile(join(outputDir, "res.json"), "utf8");
|
|
129
|
+
result = JSON.parse(resJson);
|
|
130
|
+
}
|
|
131
|
+
catch {
|
|
132
|
+
logger.warn({ sessionId: this.id, outputDir }, "genaiscript: res.json not found or invalid");
|
|
133
|
+
}
|
|
134
|
+
// Emit usage data from the result
|
|
135
|
+
if (result?.usage) {
|
|
136
|
+
const inputTokens = result.usage.prompt;
|
|
137
|
+
const outputTokens = result.usage.completion;
|
|
138
|
+
const costUsd = result.usage.cost ?? 0;
|
|
139
|
+
if (inputTokens > 0 || outputTokens > 0 || costUsd > 0) {
|
|
140
|
+
yield { type: "usage", timestamp: ts(), content: JSON.stringify({
|
|
141
|
+
input_tokens: inputTokens, output_tokens: outputTokens, cost_usd: costUsd,
|
|
142
|
+
}) };
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
yield { type: "system", timestamp: ts(), content: "GenAIScript finished" };
|
|
146
|
+
// Yield the script's output text — this is the LLM response or script result
|
|
147
|
+
if (result?.text) {
|
|
148
|
+
yield { type: "text", timestamp: ts(), content: result.text };
|
|
149
|
+
}
|
|
150
|
+
// Yield any annotations (warnings/errors from the script)
|
|
151
|
+
if (result?.annotations) {
|
|
152
|
+
for (const ann of result.annotations) {
|
|
153
|
+
const severity = ann.severity ?? "info";
|
|
154
|
+
const message = ann.message ?? JSON.stringify(ann);
|
|
155
|
+
yield {
|
|
156
|
+
type: severity === "error" ? "error" : "text",
|
|
157
|
+
timestamp: ts(),
|
|
158
|
+
content: `[${severity}] ${message}`,
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
// Final status — GenAIScript is a one-shot runtime, so it goes IDLE when done
|
|
163
|
+
if (exitCode === 0 || result?.status === "success") {
|
|
164
|
+
this.status = SESSION_STATUS.IDLE;
|
|
165
|
+
yield { type: "status", timestamp: ts(), content: "waiting_input" };
|
|
166
|
+
}
|
|
167
|
+
else {
|
|
168
|
+
const errorText = result?.statusText ?? result?.status ?? `Process exited with code ${exitCode}`;
|
|
169
|
+
yield { type: "error", timestamp: ts(), content: String(errorText) };
|
|
170
|
+
this.status = SESSION_STATUS.STOPPED;
|
|
171
|
+
yield { type: "status", timestamp: ts(), content: "failed" };
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
catch (err) {
|
|
175
|
+
yield { type: "error", timestamp: ts(), content: err instanceof Error ? err.message : String(err) };
|
|
176
|
+
this.status = SESSION_STATUS.STOPPED;
|
|
177
|
+
yield { type: "status", timestamp: ts(), content: "failed" };
|
|
178
|
+
}
|
|
179
|
+
finally {
|
|
180
|
+
if (this.tmpDir) {
|
|
181
|
+
try {
|
|
182
|
+
await rm(this.tmpDir, { recursive: true, force: true });
|
|
183
|
+
}
|
|
184
|
+
catch { /* ignore */ }
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
sendInput(_text) {
|
|
189
|
+
logger.warn({ sessionId: this.id }, "GenAIScript sessions do not accept interactive input");
|
|
190
|
+
}
|
|
191
|
+
kill(reason) {
|
|
192
|
+
this.killed = true;
|
|
193
|
+
this.killReason = reason || "killed";
|
|
194
|
+
this.status = SESSION_STATUS.STOPPED;
|
|
195
|
+
if (this.child && !this.child.killed) {
|
|
196
|
+
this.child.kill("SIGTERM");
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
/** GenAIScript sessions have no buffered events to drain. */
|
|
200
|
+
drainBufferedEvents() {
|
|
201
|
+
return [];
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Runtime for GenAIScript — executes .genai.mjs scripts via the CLI,
|
|
206
|
+
* streaming stderr progress in real-time and parsing the structured
|
|
207
|
+
* JSON result for the script's output text.
|
|
208
|
+
*/
|
|
209
|
+
export class GenAIScriptRuntime {
|
|
210
|
+
name = "genaiscript";
|
|
211
|
+
spawn(opts) {
|
|
212
|
+
return new GenAIScriptSession(opts);
|
|
213
|
+
}
|
|
214
|
+
resume(_opts) {
|
|
215
|
+
throw new Error("GenAIScript sessions cannot be resumed");
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
//# sourceMappingURL=genaiscript.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"genaiscript.js","sourceRoot":"","sources":["../src/genaiscript.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAE3D,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,OAAO,EAAE,MAAM,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAiBpD;;;;;;;GAOG;AACH,SAAS,qBAAqB,CAAC,UAAkB;IAC/C,yEAAyE;IACzE,oEAAoE;IACpE,MAAM,KAAK,GAAG,UAAU;QACtB,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;QACpC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI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AAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// This file is read by tools that parse documentation comments conforming to the TSDoc standard.
|
|
2
|
+
// It should be published with your NPM package. It should not be tracked by Git.
|
|
3
|
+
{
|
|
4
|
+
"tsdocVersion": "0.12",
|
|
5
|
+
"toolPackages": [
|
|
6
|
+
{
|
|
7
|
+
"packageName": "@microsoft/api-extractor",
|
|
8
|
+
"packageVersion": "7.57.7"
|
|
9
|
+
}
|
|
10
|
+
]
|
|
11
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@grackle-ai/runtime-genaiscript",
|
|
3
|
+
"version": "0.82.2",
|
|
4
|
+
"description": "Grackle GenAIScript runtime implementation",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/nick-pape/grackle.git",
|
|
9
|
+
"directory": "packages/runtime-genaiscript"
|
|
10
|
+
},
|
|
11
|
+
"keywords": [
|
|
12
|
+
"grackle",
|
|
13
|
+
"runtime",
|
|
14
|
+
"genaiscript"
|
|
15
|
+
],
|
|
16
|
+
"homepage": "https://github.com/nick-pape/grackle#readme",
|
|
17
|
+
"bugs": {
|
|
18
|
+
"url": "https://github.com/nick-pape/grackle/issues"
|
|
19
|
+
},
|
|
20
|
+
"engines": {
|
|
21
|
+
"node": ">=22.0.0"
|
|
22
|
+
},
|
|
23
|
+
"type": "module",
|
|
24
|
+
"main": "dist/index.js",
|
|
25
|
+
"types": "dist/index.d.ts",
|
|
26
|
+
"files": [
|
|
27
|
+
"dist/"
|
|
28
|
+
],
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"@grackle-ai/common": "0.82.2",
|
|
31
|
+
"@grackle-ai/runtime-sdk": "0.82.2"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@rushstack/heft": "1.2.7",
|
|
35
|
+
"@types/node": "^22.0.0",
|
|
36
|
+
"vitest": "^3.1.1",
|
|
37
|
+
"@grackle-ai/heft-rig": "0.0.1"
|
|
38
|
+
},
|
|
39
|
+
"scripts": {
|
|
40
|
+
"build": "heft build --clean",
|
|
41
|
+
"test": "vitest run",
|
|
42
|
+
"clean": "heft clean",
|
|
43
|
+
"_phase:build": "heft run --only build -- --clean",
|
|
44
|
+
"_phase:test": "vitest run"
|
|
45
|
+
}
|
|
46
|
+
}
|