agent-lyra 0.3.0 → 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 +120 -129
- package/package.json +56 -56
package/README.md
CHANGED
|
@@ -1,129 +1,120 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
##
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
[
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
async () => "collect",
|
|
122
|
-
async (ctx) => `${ctx.step_1}:analyze`,
|
|
123
|
-
);
|
|
124
|
-
|
|
125
|
-
const result = await standalone.runWorkflow(workflow);
|
|
126
|
-
|
|
127
|
-
const client = gated.createHostedAgentClient({ apiKey: process.env.LYRA_API_KEY });
|
|
128
|
-
const output = await client.invoke("sales", { prompt: "Summarize latest pipeline risk." });
|
|
129
|
-
```
|
|
1
|
+
# AgentLyra SDK
|
|
2
|
+
|
|
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
|
+
|
|
5
|
+
[AgentLyra homepage](https://agentlyra.in/) · [CLI reference](https://agentlyra.in/#sdk-commands) · [Cloud console](https://console.agentlyra.in/)
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
Requires **Node.js 22.13 or newer**. From your project directory:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install agent-lyra
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Use `pnpm add agent-lyra` if your project uses pnpm. Run the CLI with `npx agent-lyra` after installation.
|
|
16
|
+
|
|
17
|
+
## Start with a working app
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npx agent-lyra app init
|
|
21
|
+
npx agent-lyra app preview .lyra/app/manifest.json
|
|
22
|
+
```
|
|
23
|
+
|
|
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.
|
|
25
|
+
|
|
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:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
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
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Choose the workflow you need
|
|
36
|
+
|
|
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.
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
npx agent-lyra agent run --model YOUR_MODEL --prompt "Draft a project update"
|
|
51
|
+
npx agent-lyra run status YOUR_RUN_ID
|
|
52
|
+
```
|
|
53
|
+
|
|
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.
|
|
55
|
+
|
|
56
|
+
### Connect your IDE
|
|
57
|
+
|
|
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:
|
|
59
|
+
|
|
60
|
+
```json
|
|
61
|
+
["mcp", "serve", "--dir", "ABSOLUTE_PROJECT_PATH"]
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
The MCP server reads saved runs from that project.
|
|
65
|
+
|
|
66
|
+
### Use the Marketplace
|
|
67
|
+
|
|
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)
|
|
69
|
+
|
|
70
|
+
## CLI reference
|
|
71
|
+
|
|
72
|
+
Prefix each command with `npx agent-lyra`. Angle brackets indicate required arguments. Square brackets indicate optional arguments.
|
|
73
|
+
|
|
74
|
+
### Project setup
|
|
75
|
+
|
|
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. |
|
|
80
|
+
|
|
81
|
+
### App Builder
|
|
82
|
+
|
|
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`. |
|
|
91
|
+
|
|
92
|
+
### Agent runs and IDE integration
|
|
93
|
+
|
|
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. |
|
|
100
|
+
|
|
101
|
+
## Use the library from JavaScript
|
|
102
|
+
|
|
103
|
+
```js
|
|
104
|
+
import { createLinearWorkflow, runWorkflow } from "agent-lyra/standalone";
|
|
105
|
+
|
|
106
|
+
const workflow = createLinearWorkflow(
|
|
107
|
+
async () => "collect",
|
|
108
|
+
async (context) => `${context.step_1}:analyze`,
|
|
109
|
+
);
|
|
110
|
+
|
|
111
|
+
console.log(await runWorkflow(workflow));
|
|
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.
|
package/package.json
CHANGED
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "agent-lyra",
|
|
3
|
-
"version": "0.3.
|
|
4
|
-
"description": "Two-layer Lyra SDK with standalone local primitives and gated hosted agents.",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"main": "./src/index.js",
|
|
7
|
-
"types": "./src/index.d.ts",
|
|
8
|
-
"engines": {
|
|
9
|
-
"node": ">=22.13.0"
|
|
10
|
-
},
|
|
11
|
-
"repository": {
|
|
12
|
-
"type": "git",
|
|
13
|
-
"url": "git+https://gitlab.com/vibified/agent-lyra.git",
|
|
14
|
-
"directory": "packages/lyra"
|
|
15
|
-
},
|
|
16
|
-
"homepage": "https://agentlyra.in",
|
|
17
|
-
"bin": {
|
|
18
|
-
"agent-lyra": "./bin/agent-lyra.js"
|
|
19
|
-
},
|
|
20
|
-
"exports": {
|
|
21
|
-
".": {
|
|
22
|
-
"types": "./src/index.d.ts",
|
|
23
|
-
"default": "./src/index.js"
|
|
24
|
-
},
|
|
25
|
-
"./standalone": {
|
|
26
|
-
"types": "./src/standalone/index.d.ts",
|
|
27
|
-
"default": "./src/standalone/index.js"
|
|
28
|
-
},
|
|
29
|
-
"./gated": {
|
|
30
|
-
"types": "./src/gated/index.d.ts",
|
|
31
|
-
"default": "./src/gated/index.js"
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
"files": [
|
|
35
|
-
"bin",
|
|
36
|
-
"src",
|
|
37
|
-
"README.md",
|
|
38
|
-
"LICENSE"
|
|
39
|
-
],
|
|
40
|
-
"sideEffects": false,
|
|
41
|
-
"scripts": {
|
|
42
|
-
"test": "node --test"
|
|
43
|
-
},
|
|
44
|
-
"keywords": [
|
|
45
|
-
"lyra",
|
|
46
|
-
"orchestration",
|
|
47
|
-
"rag",
|
|
48
|
-
"agents",
|
|
49
|
-
"sdk"
|
|
50
|
-
],
|
|
51
|
-
"author": "",
|
|
52
|
-
"license": "MIT",
|
|
53
|
-
"publishConfig": {
|
|
54
|
-
"access": "public"
|
|
55
|
-
}
|
|
56
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "agent-lyra",
|
|
3
|
+
"version": "0.3.2",
|
|
4
|
+
"description": "Two-layer Lyra SDK with standalone local primitives and gated hosted agents.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./src/index.js",
|
|
7
|
+
"types": "./src/index.d.ts",
|
|
8
|
+
"engines": {
|
|
9
|
+
"node": ">=22.13.0"
|
|
10
|
+
},
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git+https://gitlab.com/vibified/agent-lyra.git",
|
|
14
|
+
"directory": "packages/lyra"
|
|
15
|
+
},
|
|
16
|
+
"homepage": "https://agentlyra.in",
|
|
17
|
+
"bin": {
|
|
18
|
+
"agent-lyra": "./bin/agent-lyra.js"
|
|
19
|
+
},
|
|
20
|
+
"exports": {
|
|
21
|
+
".": {
|
|
22
|
+
"types": "./src/index.d.ts",
|
|
23
|
+
"default": "./src/index.js"
|
|
24
|
+
},
|
|
25
|
+
"./standalone": {
|
|
26
|
+
"types": "./src/standalone/index.d.ts",
|
|
27
|
+
"default": "./src/standalone/index.js"
|
|
28
|
+
},
|
|
29
|
+
"./gated": {
|
|
30
|
+
"types": "./src/gated/index.d.ts",
|
|
31
|
+
"default": "./src/gated/index.js"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"files": [
|
|
35
|
+
"bin",
|
|
36
|
+
"src",
|
|
37
|
+
"README.md",
|
|
38
|
+
"LICENSE"
|
|
39
|
+
],
|
|
40
|
+
"sideEffects": false,
|
|
41
|
+
"scripts": {
|
|
42
|
+
"test": "node --test"
|
|
43
|
+
},
|
|
44
|
+
"keywords": [
|
|
45
|
+
"lyra",
|
|
46
|
+
"orchestration",
|
|
47
|
+
"rag",
|
|
48
|
+
"agents",
|
|
49
|
+
"sdk"
|
|
50
|
+
],
|
|
51
|
+
"author": "",
|
|
52
|
+
"license": "MIT",
|
|
53
|
+
"publishConfig": {
|
|
54
|
+
"access": "public"
|
|
55
|
+
}
|
|
56
|
+
}
|