@grackle-ai/runtime-genaiscript 0.108.4 → 0.110.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.
Files changed (2) hide show
  1. package/README.md +64 -0
  2. package/package.json +3 -3
package/README.md ADDED
@@ -0,0 +1,64 @@
1
+ # @grackle-ai/runtime-genaiscript
2
+
3
+ <p align="center">
4
+ <a href="https://www.npmjs.com/package/@grackle-ai/runtime-genaiscript"><img src="https://img.shields.io/npm/v/@grackle-ai/runtime-genaiscript.svg" alt="npm version" /></a>
5
+ <a href="https://github.com/nick-pape/grackle/actions/workflows/ci.yml"><img src="https://github.com/nick-pape/grackle/actions/workflows/ci.yml/badge.svg?branch=main" alt="CI" /></a>
6
+ <a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT" /></a>
7
+ </p>
8
+
9
+ <p align="center">
10
+ <img src="https://raw.githubusercontent.com/nick-pape/grackle/main/apps/docs-site/static/img/grackle-logo.png" alt="Grackle" width="200" />
11
+ </p>
12
+
13
+ Grackle runtime that drives the [GenAIScript](https://microsoft.github.io/genaiscript/) CLI.
14
+
15
+ ## Overview
16
+
17
+ This package implements the `AgentRuntime` interface from [`@grackle-ai/runtime-sdk`](https://www.npmjs.com/package/@grackle-ai/runtime-sdk), letting Grackle run agents authored as GenAIScript programs. It is registered inside PowerLine under the runtime name `genaiscript` and is selected by any persona whose `runtime` is set to `"genaiscript"`.
18
+
19
+ Each session writes the persona's script to a temporary `.genai.mjs` file and invokes the GenAIScript CLI as a child process (`genaiscript run <script> -o <outputDir>`). The CLI is one-shot: a session runs the script to completion, streams progress, and then idles — it cannot be resumed and does not accept interactive input. The GenAIScript package is installed lazily into an isolated per-runtime directory the first time it is needed (see [Requirements](#requirements)).
20
+
21
+ ## Configuration
22
+
23
+ The runtime takes no static configuration of its own. Behavior is driven by the per-session `SpawnOptions` supplied by Grackle:
24
+
25
+ | Field | Type | Description |
26
+ |-------|------|-------------|
27
+ | `sessionId` | `string` | Identifies the session and the temporary script file |
28
+ | `scriptContent` | `string` | The GenAIScript program executed as a `.genai.mjs` file |
29
+ | `mcpBroker` | `{ url, token }` | Optional MCP broker; injected into the script (see below) |
30
+
31
+ When an MCP broker is present, its URL and token are passed to the script as GenAIScript variables via environment variables, readable inside the script as `env.vars.GRACKLE_MCP_URL` and `env.vars.GRACKLE_MCP_TOKEN`:
32
+
33
+ | Environment variable | Script accessor |
34
+ |----------------------|-----------------|
35
+ | `GENAISCRIPT_VAR_GRACKLE_MCP_URL` | `env.vars.GRACKLE_MCP_URL` |
36
+ | `GENAISCRIPT_VAR_GRACKLE_MCP_TOKEN` | `env.vars.GRACKLE_MCP_TOKEN` |
37
+
38
+ ## Events
39
+
40
+ The session streams `AgentEvent`s as the CLI runs:
41
+
42
+ | Event | Source |
43
+ |-------|--------|
44
+ | `system` | Stderr lines from the CLI (progress, `console.log` output) and lifecycle messages |
45
+ | `text` | The script's output text and any annotations, parsed from the CLI's `res.json` |
46
+ | `usage` | Token counts and cost, parsed from `res.json` when reported |
47
+ | `error` | Script annotations marked as errors, non-zero exit, or spawn failures |
48
+ | `status` | Final session status — `waiting_input` on success, `failed` otherwise |
49
+
50
+ ## Models & Credentials
51
+
52
+ Model selection and provider authentication are handled by GenAIScript itself, not by this runtime. The script declares the model it wants (e.g. via `script({ model })` or a `model` alias), and the GenAIScript CLI resolves the corresponding provider credentials from the process environment / its own configuration (`.env`, etc.) following GenAIScript's standard conventions. This runtime does not define its own model list and does not read provider API keys directly — it inherits the environment of the PowerLine process it runs in.
53
+
54
+ See the [GenAIScript configuration docs](https://microsoft.github.io/genaiscript/getting-started/configuration/) for the supported providers and credential variables.
55
+
56
+ ## Requirements
57
+
58
+ - Node.js >= 22
59
+ - The [GenAIScript](https://www.npmjs.com/package/genaiscript) CLI — installed automatically on first use into an isolated per-runtime directory (Grackle pins a compatible version)
60
+ - Valid credentials for whichever model provider your scripts target (configured per GenAIScript's conventions)
61
+
62
+ ## License
63
+
64
+ MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grackle-ai/runtime-genaiscript",
3
- "version": "0.108.4",
3
+ "version": "0.110.2",
4
4
  "description": "Grackle GenAIScript runtime implementation",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -27,8 +27,8 @@
27
27
  "dist/"
28
28
  ],
29
29
  "dependencies": {
30
- "@grackle-ai/common": "0.108.4",
31
- "@grackle-ai/runtime-sdk": "0.108.4"
30
+ "@grackle-ai/common": "0.110.2",
31
+ "@grackle-ai/runtime-sdk": "0.110.2"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@rushstack/heft": "1.2.7",