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.
Files changed (2) hide show
  1. package/README.md +72 -112
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,160 +1,120 @@
1
- # agent-lyra
1
+ # AgentLyra SDK
2
2
 
3
- ## Local-first release
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
- The supported release path is local. It includes the Node CLI, SQLite run history, the draft-review team, and read-only IDE MCP. OpenAI-backed runs use your own key. The legacy gated client expects a compatible hosted `/agents/<vertical>/invoke` endpoint. The bundled hosted default has not been verified against AgentLyra production, so hosted invocation is outside this release’s supported scope.
5
+ [AgentLyra homepage](https://agentlyra.in/) · [CLI reference](https://agentlyra.in/#sdk-commands) · [Cloud console](https://console.agentlyra.in/)
6
6
 
7
- ## CLI reference
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
- | Command | What it does |
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
- ### Agent runs and IDE integration
11
+ ```bash
12
+ npm install agent-lyra
13
+ ```
30
14
 
31
- | Command | What it does |
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
- ## Build a support app
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
- Run each command separately. Stop the preview before exporting from the same terminal. The starter supports the local Support IQ template without cloud authentication. Use `app publish <manifest.json> --dry-run` to review a listing payload offline. `app use <listing-id>` imports a published app using an existing cloud session supplied through `LYRA_SESSION_TOKEN`. The cloud Marketplace also lets signed-in users save a private copy and download its manifest.
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
- ## Run a local agent
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 agent run --model YOUR_MODEL --prompt "Summarize this idea"
55
- npx agent-lyra run status YOUR_RUN_ID
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
- The first command sends your prompt to OpenAI using your key and prints a run ID. The second reads the most recent event from `.lyra/state/runs.sqlite`, including the generated output on success. Keep that directory local if the output is sensitive. The run requires no Lyra account. The existing `init` wizard remains available for scaffolding.
35
+ ## Choose the workflow you need
59
36
 
60
- To run the built-in writing team with the same setup:
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 team run draft-review --model YOUR_MODEL --prompt "Draft a project update"
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
- The writer produces a draft, then the reviewer receives the prompt and draft and returns revised text. Each step prints a run ID you can inspect with `agent-lyra run status`. The team makes two model calls when both steps succeed.
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
- ## Inspect saved runs from an IDE
56
+ ### Connect your IDE
69
57
 
70
- Configure a stdio MCP server in your IDE with the installed `agent-lyra` executable (use its absolute path if needed) and these arguments:
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
- Two-layer Lyra SDK package:
64
+ The MCP server reads saved runs from that project.
77
65
 
78
- - Standalone layer: local orchestration primitives and RAG utilities with no API key.
79
- - Gated layer: compatibility client for deployments that provide the hosted invocation endpoint.
66
+ ### Use the Marketplace
80
67
 
81
- ## Install
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
- ```bash
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
- - optional login step with Lyra API key to sync your web-created agents
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
- Generated files:
74
+ ### Project setup
121
75
 
122
- - `.lyra/config.json`
123
- - `.lyra/manifest.json` (root manifest with `source` + `comparisonStatus`)
124
- - `.lyra/README.md`
125
- - `.lyra/domains/<domain>/domain.json` (domain manifest)
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
- Agent Markdown files are generated from the canonical onboarding catalog and include rich fields:
81
+ ### App Builder
132
82
 
133
- - identity: `id`, `slug`, `name`, `domain`, `category`, `mode`
134
- - execution: `type`, `runtime` (standalone) or `hosted` (gated)
135
- - behavior: `description`, `systemPrompt`, `skills`, `integrations`
136
- - output policy: `outputs`
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
- Engineering bootstrap agents are dynamic and repo-intelligence-ready:
92
+ ### Agent runs and IDE integration
139
93
 
140
- - roles generated: `Engineering Dev Lead`, `Engineering QA Lead`, `Engineering Product Manager`, `Engineering Scrum Master`, `Engineering Architect`
141
- - prompts are stack-agnostic and rely on runtime repo scan context
142
- - each agent spec includes a `repoIntelligence` contract that aligns with:
143
- - scan endpoint: `/api/repositories/:id/scan`
144
- - PR endpoint: `/api/repositories/:id/lyra-pr`
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
- ## Usage
101
+ ## Use the library from JavaScript
147
102
 
148
103
  ```js
149
- import { standalone, gated } from "agent-lyra";
104
+ import { createLinearWorkflow, runWorkflow } from "agent-lyra/standalone";
150
105
 
151
- const workflow = standalone.createLinearWorkflow(
106
+ const workflow = createLinearWorkflow(
152
107
  async () => "collect",
153
- async (ctx) => `${ctx.step_1}:analyze`,
108
+ async (context) => `${context.step_1}:analyze`,
154
109
  );
155
110
 
156
- const result = await standalone.runWorkflow(workflow);
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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-lyra",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "Two-layer Lyra SDK with standalone local primitives and gated hosted agents.",
5
5
  "type": "module",
6
6
  "main": "./src/index.js",