agent-lyra 0.3.1 → 0.3.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/README.md +72 -112
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,160 +1,120 @@
|
|
|
1
|
-
#
|
|
1
|
+
# AgentLyra SDK
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Build and preview agent apps locally, run agents with your own OpenAI key, and inspect saved runs from your IDE. The Node.js package includes a command-line tool and typed JavaScript APIs for composing workflows.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
[AgentLyra homepage](https://agentlyra.in/) · [CLI reference](https://agentlyra.in/#sdk-commands) · [Cloud console](https://console.agentlyra.in/)
|
|
6
6
|
|
|
7
|
-
##
|
|
8
|
-
|
|
9
|
-
Use Node.js 22.13 or newer. Run these commands from your project after installing `agent-lyra`. Angle brackets mark required arguments. Square brackets mark optional arguments.
|
|
10
|
-
|
|
11
|
-
### Project setup
|
|
12
|
-
|
|
13
|
-
| Command | What it does |
|
|
14
|
-
| --- | --- |
|
|
15
|
-
| `npx agent-lyra init [options]` | Scaffold a `.lyra` workspace and starter agents. Options include `--mode`, `--domains`, `--api-key`, `--api-base-url`, `--dir`, and `--force`. |
|
|
16
|
-
| `npx agent-lyra --help` | Show the init command and its options. The help alias does the same. Add `--help` to a specific command for its syntax. |
|
|
17
|
-
|
|
18
|
-
### App Builder
|
|
7
|
+
## Install
|
|
19
8
|
|
|
20
|
-
|
|
21
|
-
| --- | --- |
|
|
22
|
-
| `npx agent-lyra app init [manifest.json]` | Create the Support IQ starter. Defaults to `.lyra/app/manifest.json`. |
|
|
23
|
-
| `npx agent-lyra app validate <manifest.json>` | Check the app manifest before previewing or exporting. |
|
|
24
|
-
| `npx agent-lyra app preview <manifest.json>` | Run the starter preview on loopback. Set `LYRA_PREVIEW_PORT` to change its port. |
|
|
25
|
-
| `npx agent-lyra app export <manifest.json> <new-directory>` | Export the supported starter into a new directory. |
|
|
26
|
-
| `npx agent-lyra app publish <manifest.json> --dry-run` | Print the proposed Marketplace payload for review. Submit the listing in the cloud. |
|
|
27
|
-
| `npx agent-lyra app use <listing-id> [new-manifest.json]` | Import a published app and save its manifest. Requires `LYRA_SESSION_TOKEN`. |
|
|
9
|
+
Requires **Node.js 22.13 or newer**. From your project directory:
|
|
28
10
|
|
|
29
|
-
|
|
11
|
+
```bash
|
|
12
|
+
npm install agent-lyra
|
|
13
|
+
```
|
|
30
14
|
|
|
31
|
-
|
|
32
|
-
| --- | --- |
|
|
33
|
-
| `npx agent-lyra agent run --model <model> --prompt <text>` | Run a local agent with an OpenAI model. Requires `OPENAI_API_KEY`. |
|
|
34
|
-
| `npx agent-lyra team run draft-review --model <model> --prompt <text>` | Run the built-in writer and reviewer team. Requires `OPENAI_API_KEY`. |
|
|
35
|
-
| `npx agent-lyra run status <run-id>` | Read the latest event for a run from local SQLite history. |
|
|
36
|
-
| `npx agent-lyra mcp serve --dir <absolute-project-directory>` | Expose saved runs to an IDE over read-only stdio MCP. |
|
|
15
|
+
Use `pnpm add agent-lyra` if your project uses pnpm. Run the CLI with `npx agent-lyra` after installation.
|
|
37
16
|
|
|
38
|
-
##
|
|
17
|
+
## Start with a working app
|
|
39
18
|
|
|
40
19
|
```bash
|
|
41
20
|
npx agent-lyra app init
|
|
42
|
-
npx agent-lyra app validate .lyra/app/manifest.json
|
|
43
21
|
npx agent-lyra app preview .lyra/app/manifest.json
|
|
44
|
-
npx agent-lyra app export .lyra/app/manifest.json ./my-support-app
|
|
45
22
|
```
|
|
46
23
|
|
|
47
|
-
|
|
24
|
+
Open the local URL printed by the preview. The **Support IQ** starter lets you enter a sample support ticket and see a draft reply. It uses a built-in example workflow, so you can try it without a Lyra account or a model API key.
|
|
48
25
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
With Node.js 22.13 or newer, set `OPENAI_API_KEY` in your terminal environment, then run these commands from your project:
|
|
26
|
+
Edit `.lyra/app/manifest.json`, then restart the preview to see your changes. When you are ready to export, stop the preview or use a second terminal:
|
|
52
27
|
|
|
53
28
|
```bash
|
|
54
|
-
npx agent-lyra
|
|
55
|
-
npx agent-lyra
|
|
29
|
+
npx agent-lyra app validate .lyra/app/manifest.json
|
|
30
|
+
npx agent-lyra app export .lyra/app/manifest.json ./support-app
|
|
31
|
+
cd support-app
|
|
32
|
+
npm start
|
|
56
33
|
```
|
|
57
34
|
|
|
58
|
-
|
|
35
|
+
## Choose the workflow you need
|
|
59
36
|
|
|
60
|
-
|
|
37
|
+
| I want to… | Start here |
|
|
38
|
+
| --- | --- |
|
|
39
|
+
| Set up a repo with starter agent definitions | `npx agent-lyra init` |
|
|
40
|
+
| Build and export the local support starter | [Start with a working app](#start-with-a-working-app) |
|
|
41
|
+
| Run a model-backed agent from my terminal | [Run an agent](#run-an-agent) |
|
|
42
|
+
| Inspect saved runs inside my IDE | [Connect your IDE](#connect-your-ide) |
|
|
43
|
+
| Share or import an app | [Use the Marketplace](#use-the-marketplace) |
|
|
44
|
+
|
|
45
|
+
### Run an agent
|
|
46
|
+
|
|
47
|
+
Set `OPENAI_API_KEY` in your environment. Replace `YOUR_MODEL` with an OpenAI model available to your key.
|
|
61
48
|
|
|
62
49
|
```bash
|
|
63
|
-
npx agent-lyra
|
|
50
|
+
npx agent-lyra agent run --model YOUR_MODEL --prompt "Draft a project update"
|
|
51
|
+
npx agent-lyra run status YOUR_RUN_ID
|
|
64
52
|
```
|
|
65
53
|
|
|
66
|
-
|
|
54
|
+
Copy the run ID printed by the first command into the second. The CLI saves run events locally in `.lyra/state/runs.sqlite`. To run a writer followed by a reviewer, use `team run draft-review` with the same model and prompt flags.
|
|
67
55
|
|
|
68
|
-
|
|
56
|
+
### Connect your IDE
|
|
69
57
|
|
|
70
|
-
Configure a stdio MCP server
|
|
58
|
+
Configure a stdio MCP server with the installed `agent-lyra` executable, using its absolute path if your IDE requires one. Set the arguments to:
|
|
71
59
|
|
|
72
60
|
```json
|
|
73
61
|
["mcp", "serve", "--dir", "ABSOLUTE_PROJECT_PATH"]
|
|
74
62
|
```
|
|
75
63
|
|
|
76
|
-
|
|
64
|
+
The MCP server reads saved runs from that project.
|
|
77
65
|
|
|
78
|
-
|
|
79
|
-
- Gated layer: compatibility client for deployments that provide the hosted invocation endpoint.
|
|
66
|
+
### Use the Marketplace
|
|
80
67
|
|
|
81
|
-
|
|
68
|
+
Generate a shareable listing preview with `npx agent-lyra app publish .lyra/app/manifest.json --dry-run`. Review it before submitting the listing in the cloud. Browse apps publicly, then sign in to import an editable private copy. CLI imports require an existing Lyra session supplied through `LYRA_SESSION_TOKEN`. [Marketplace Apps](https://agentlyra.in/marketplace/apps)
|
|
82
69
|
|
|
83
|
-
|
|
84
|
-
npm install agent-lyra
|
|
85
|
-
# or
|
|
86
|
-
pnpm add agent-lyra
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
Installation has zero side effects:
|
|
90
|
-
|
|
91
|
-
- no files/folders created
|
|
92
|
-
- no network calls by package code
|
|
93
|
-
- no postinstall hooks
|
|
94
|
-
|
|
95
|
-
Initialization is explicit and happens only when the user runs the CLI.
|
|
96
|
-
|
|
97
|
-
## Init A Repo
|
|
98
|
-
|
|
99
|
-
```bash
|
|
100
|
-
npx agent-lyra init
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
Or after install:
|
|
104
|
-
|
|
105
|
-
```bash
|
|
106
|
-
agent-lyra init
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
Flow:
|
|
70
|
+
## CLI reference
|
|
110
71
|
|
|
111
|
-
|
|
112
|
-
- choose pack type: `Professional` or `Everyday`
|
|
113
|
-
- choose `standalone` or `gated` (or set with `--mode`)
|
|
114
|
-
- standalone: select onboarding domains with `Space`, confirm with `Enter`
|
|
115
|
-
- for repository-aware engineering personas, select `engineering-bootstrap`
|
|
116
|
-
- gated: select hosted verticals, then enter the Lyra API key from the Lyra login UI
|
|
117
|
-
- logged-out gated selections are marked as `needs login` in generated metadata
|
|
118
|
-
- the command creates a `.lyra/` folder in the current repo only after confirmation
|
|
72
|
+
Prefix each command with `npx agent-lyra`. Angle brackets indicate required arguments. Square brackets indicate optional arguments.
|
|
119
73
|
|
|
120
|
-
|
|
74
|
+
### Project setup
|
|
121
75
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
- `.lyra/domains/<domain>/agents/*.md`
|
|
127
|
-
- `.lyra/agents/*.md` (flattened top-level agent specs)
|
|
128
|
-
- `.lyra/credentials.json` only for gated mode
|
|
129
|
-
- `.lyra/.gitignore` to ignore the local credentials file
|
|
76
|
+
| Command | What it does |
|
|
77
|
+
| --- | --- |
|
|
78
|
+
| `init [options]` | Scaffold a `.lyra` workspace and starter agents. Options include `--mode`, `--domains`, `--api-key`, `--api-base-url`, `--dir`, and `--force`. |
|
|
79
|
+
| `--help` | Show the init command and its options. The help alias does the same. Add `--help` to a specific command for its syntax. |
|
|
130
80
|
|
|
131
|
-
|
|
81
|
+
### App Builder
|
|
132
82
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
83
|
+
| Command | What it does |
|
|
84
|
+
| --- | --- |
|
|
85
|
+
| `app init [manifest.json]` | Create the Support IQ starter. Defaults to `.lyra/app/manifest.json`. |
|
|
86
|
+
| `app validate <manifest.json>` | Check the app manifest before previewing or exporting. |
|
|
87
|
+
| `app preview <manifest.json>` | Run the starter preview on loopback. Set `LYRA_PREVIEW_PORT` to change its port. |
|
|
88
|
+
| `app export <manifest.json> <new-directory>` | Export the supported starter into a new directory. |
|
|
89
|
+
| `app publish <manifest.json> --dry-run` | Print the proposed Marketplace payload for review. Submit the listing in the cloud. |
|
|
90
|
+
| `app use <listing-id> [new-manifest.json]` | Import a published app and save its manifest. Requires `LYRA_SESSION_TOKEN`. |
|
|
137
91
|
|
|
138
|
-
|
|
92
|
+
### Agent runs and IDE integration
|
|
139
93
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
94
|
+
| Command | What it does |
|
|
95
|
+
| --- | --- |
|
|
96
|
+
| `agent run --model <model> --prompt <text>` | Run a local agent with an OpenAI model. Requires `OPENAI_API_KEY`. |
|
|
97
|
+
| `team run draft-review --model <model> --prompt <text>` | Run the built-in writer and reviewer team. Requires `OPENAI_API_KEY`. |
|
|
98
|
+
| `run status <run-id>` | Read the latest event for a run from local SQLite history. |
|
|
99
|
+
| `mcp serve --dir <absolute-project-directory>` | Expose saved runs to an IDE over read-only stdio MCP. |
|
|
145
100
|
|
|
146
|
-
##
|
|
101
|
+
## Use the library from JavaScript
|
|
147
102
|
|
|
148
103
|
```js
|
|
149
|
-
import {
|
|
104
|
+
import { createLinearWorkflow, runWorkflow } from "agent-lyra/standalone";
|
|
150
105
|
|
|
151
|
-
const workflow =
|
|
106
|
+
const workflow = createLinearWorkflow(
|
|
152
107
|
async () => "collect",
|
|
153
|
-
async (
|
|
108
|
+
async (context) => `${context.step_1}:analyze`,
|
|
154
109
|
);
|
|
155
110
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
const client = gated.createHostedAgentClient({ apiKey: process.env.LYRA_API_KEY });
|
|
159
|
-
const output = await client.invoke("sales", { prompt: "Summarize latest pipeline risk." });
|
|
111
|
+
console.log(await runWorkflow(workflow));
|
|
160
112
|
```
|
|
113
|
+
|
|
114
|
+
The standalone entry point also includes retrieval utilities. The gated entry point is a compatibility client for deployments that expose the hosted invocation API. Check endpoint compatibility before using it with a cloud deployment.
|
|
115
|
+
|
|
116
|
+
## Current scope
|
|
117
|
+
|
|
118
|
+
The App Builder preview and exporter support the included Support IQ starter. OpenAI-backed agent runs use your own provider key. Cloud accounts and AgentLyra API keys are managed in the [AgentLyra console](https://console.agentlyra.in/).
|
|
119
|
+
|
|
120
|
+
MIT licensed.
|