agent-lyra 0.6.2 → 0.6.4
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/LICENSE +21 -21
- package/README.md +235 -435
- package/bin/agent-lyra.js +49 -49
- package/bin/lyra-oss-preview.js +16 -14
- package/package.json +60 -60
- package/src/app-builder/export.js +109 -109
- package/src/app-builder/gateway.js +62 -62
- package/src/app-builder/init.js +52 -52
- package/src/app-builder/manifest-contract.js +46 -46
- package/src/app-builder/native-adapter.js +29 -29
- package/src/app-builder/preview.js +22 -22
- package/src/app-builder/publish.js +14 -14
- package/src/app-builder/saved-app.js +70 -70
- package/src/app-builder/saved-preview-browser.js +33 -33
- package/src/app-builder/saved-preview.html +24 -24
- package/src/app-builder/saved-preview.js +61 -61
- package/src/app-builder/support-manifest.js +50 -50
- package/src/app-builder/support-template/manifest.json +55 -55
- package/src/app-builder/support-template/support-preview.html +56 -56
- package/src/app-builder/support-template/support-preview.js +37 -37
- package/src/app-builder/support-template/support-preview.mjs +67 -67
- package/src/app-builder/support-template/support-workflow.mjs +36 -36
- package/src/app-builder/use.js +37 -37
- package/src/app-builder/validate.js +21 -21
- package/src/app-builder/value-schema.js +37 -37
- package/src/catalog.js +147 -147
- package/src/coding/catalog.js +56 -56
- package/src/coding/cloud-catalog.js +64 -44
- package/src/coding/detect-stack.mjs +110 -110
- package/src/coding/export.js +130 -130
- package/src/coding/setup.js +175 -174
- package/src/coding/skills/lyra-android/SKILL.md +37 -0
- package/src/coding/skills/lyra-angular/SKILL.md +37 -0
- package/src/coding/skills/lyra-cucumber/SKILL.md +37 -0
- package/src/coding/skills/lyra-dbt/SKILL.md +37 -0
- package/src/coding/skills/lyra-django/SKILL.md +37 -0
- package/src/coding/skills/lyra-docker/SKILL.md +37 -0
- package/src/coding/skills/lyra-dotnet/SKILL.md +37 -0
- package/src/coding/skills/lyra-express/SKILL.md +37 -0
- package/src/coding/skills/lyra-fastapi/SKILL.md +37 -0
- package/src/coding/skills/lyra-flutter/SKILL.md +37 -0
- package/src/coding/skills/lyra-github-actions/SKILL.md +37 -0
- package/src/coding/skills/lyra-gitlab-ci/SKILL.md +37 -0
- package/src/coding/skills/lyra-go/SKILL.md +37 -0
- package/src/coding/skills/lyra-ios/SKILL.md +37 -0
- package/src/coding/skills/lyra-kubernetes/SKILL.md +37 -0
- package/src/coding/skills/lyra-mongodb/SKILL.md +37 -0
- package/src/coding/skills/lyra-mysql/SKILL.md +37 -0
- package/src/coding/skills/lyra-nextjs/SKILL.md +37 -0
- package/src/coding/skills/lyra-node/SKILL.md +37 -0
- package/src/coding/skills/lyra-playwright/SKILL.md +37 -0
- package/src/coding/skills/lyra-postgresql/SKILL.md +37 -0
- package/src/coding/skills/lyra-python/SKILL.md +37 -0
- package/src/coding/skills/lyra-react/SKILL.md +37 -0
- package/src/coding/skills/lyra-react-native/SKILL.md +37 -0
- package/src/coding/skills/lyra-redis/SKILL.md +37 -0
- package/src/coding/skills/lyra-rust/SKILL.md +37 -0
- package/src/coding/skills/lyra-spark/SKILL.md +37 -0
- package/src/coding/skills/lyra-spring-boot/SKILL.md +37 -0
- package/src/coding/skills/lyra-svelte/SKILL.md +37 -0
- package/src/coding/skills/lyra-terraform/SKILL.md +37 -0
- package/src/coding/skills/lyra-typescript/SKILL.md +37 -0
- package/src/coding/skills/lyra-vue/SKILL.md +37 -0
- package/src/gated/hostedAgents.js +56 -56
- package/src/gated/index.d.ts +25 -25
- package/src/gated/index.js +5 -5
- package/src/index.d.ts +2 -2
- package/src/index.js +2 -2
- package/src/init.js +965 -965
- package/src/memory/cli.js +21 -21
- package/src/memory/contract.json +28 -28
- package/src/memory/index.d.ts +49 -49
- package/src/memory/index.js +259 -259
- package/src/memory/lifecycle.js +29 -29
- package/src/memory/local-cli.js +34 -34
- package/src/memory/proposals.js +84 -84
- package/src/memory/skills-cli.js +26 -26
- package/src/memory/sync.js +89 -89
- package/src/memory/validation.js +25 -25
- package/src/onboardingAgents.js +532 -532
- package/src/promptTemplates.js +178 -178
- package/src/runtime/contracts.d.ts +47 -47
- package/src/runtime/local-cli.js +160 -160
- package/src/runtime/mcp-stdio.js +111 -111
- package/src/runtime/orchestration.js +59 -59
- package/src/runtime/run-agent.js +43 -43
- package/src/standalone/index.d.ts +45 -45
- package/src/standalone/index.js +13 -13
- package/src/standalone/init.js +12 -0
- package/src/standalone/orchestration.js +6 -6
- package/src/standalone/rag.js +113 -113
- package/src/studio/agent-ui.css +43 -43
- package/src/studio/agent-ui.js +32 -32
- package/src/studio/browser.js +331 -331
- package/src/studio/export.js +80 -80
- package/src/studio/index.html +37 -37
- package/src/studio/memory-actions.js +37 -37
- package/src/studio/memory-panel.js +200 -200
- package/src/studio/project.js +216 -216
- package/src/studio/pull-agent.js +72 -72
- package/src/studio/push.js +54 -54
- package/src/studio/python-agent.js +47 -47
- package/src/studio/python-agent.py +25 -25
- package/src/studio/server.js +143 -143
- package/src/studio/session.js +83 -83
- package/src/studio/studio.css +10 -10
- package/src/studio/sync.js +42 -42
- package/src/studio/workflow-sync.js +157 -157
package/README.md
CHANGED
|
@@ -1,435 +1,235 @@
|
|
|
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
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
|
155
|
-
|
|
|
156
|
-
|
|
|
157
|
-
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
###
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
##
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
```
|
|
237
|
-
|
|
238
|
-
Example `lesson.json`:
|
|
239
|
-
|
|
240
|
-
```json
|
|
241
|
-
{
|
|
242
|
-
"type": "corrective",
|
|
243
|
-
"title": "Handle nullable API fields",
|
|
244
|
-
"learning": "Show the fallback when the response field is null.",
|
|
245
|
-
"evidence": ["test:nullable-response"]
|
|
246
|
-
}
|
|
247
|
-
```
|
|
248
|
-
|
|
249
|
-
Evidence IDs are references. Recording an ID does not verify the lesson. Copy the ID returned by `record` into `memory inspect <id>`, `memory archive <id>`, or `memory forget <id> --yes`. Archive keeps the record for inspection and excludes it from search. Forget removes the content from normal store access and retains a deletion marker with the ID, revision, and deletion time.
|
|
250
|
-
|
|
251
|
-
Set `LYRA_MEMORY=off` in the launching process to disable local memory. Store only information appropriate for your machine. The database is plain SQLite and the memory folder has its own Git ignore file. Use OS account protections or disk encryption as appropriate. Close all memory clients before copying the database for a backup or before restoring it to another project. WAL files and older backups may retain deleted content.
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
Use `openMemoryStore(projectPath)` from `agent-lyra/memory` for programmatic access. Close the store after use.
|
|
255
|
-
|
|
256
|
-
### Verify a coding correction
|
|
257
|
-
|
|
258
|
-
Run your test, review whether it supports the correction, and record the test reference in the memory's `evidence` list. Save a receipt like this as `evidence.json`:
|
|
259
|
-
|
|
260
|
-
```json
|
|
261
|
-
{
|
|
262
|
-
"adapter": "coding",
|
|
263
|
-
"evidenceId": "test:nullable-response",
|
|
264
|
-
"test": "nullable-response",
|
|
265
|
-
"result": "passed",
|
|
266
|
-
"reviewed": true,
|
|
267
|
-
"context": "graphql-client@1"
|
|
268
|
-
}
|
|
269
|
-
```
|
|
270
|
-
|
|
271
|
-
```sh
|
|
272
|
-
npx agent-lyra memory verify MEMORY_ID evidence.json
|
|
273
|
-
```
|
|
274
|
-
|
|
275
|
-
This command checks the receipt and recorded evidence reference. The developer supplies the test result and attests to the review. The command does not run the test or independently prove the correction.
|
|
276
|
-
|
|
277
|
-
For model-backed local runs, set `LYRA_MEMORY_CONTEXT` to the same compatibility tag in the terminal that launches the Node CLI or Studio. Use a new tag when relevant dependencies or assumptions change. The runner includes a few relevant verified memories as historical context and keeps the current request intact. Starting without a tag leaves retrieval off. Native Python callers can use `MemoryStore.retrieve(query, context)` explicitly. Python skills, Cloud agents, and exported apps do not automatically retrieve project memory.
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
### Practice exercise adapter
|
|
281
|
-
|
|
282
|
-
The experimental `practice` adapter supports self-contained training exercises. Record a procedural or corrective lesson with an `exercise:` evidence ID, then verify it with a reviewed passing receipt. For example:
|
|
283
|
-
|
|
284
|
-
```json
|
|
285
|
-
{"adapter":"practice","evidenceId":"exercise:async-sequence","exercise":"async-sequence","result":"passed","reviewed":true,"context":"async-practice@1"}
|
|
286
|
-
```
|
|
287
|
-
|
|
288
|
-
Set `LYRA_MEMORY_ADAPTER=practice` and `LYRA_MEMORY_CONTEXT=async-practice@1` for a model-backed local run. The default adapter is `coding`. Retrieval filters by both adapter and compatibility context. Skill proposal consolidation currently uses coding corrections.
|
|
289
|
-
|
|
290
|
-
From the AgentLyra source checkout, run `node packages/lyra/examples/evaluate-practice-memory.js` to compare a synthetic task with memory off, memory on, and a stale compatibility context. The example uses a fixed model response to test context assembly. It does not measure learning outcomes or live model quality.
|
|
291
|
-
|
|
292
|
-
### Review a skill proposal
|
|
293
|
-
|
|
294
|
-
Consolidation groups verified corrections with matching wording, a shared compatibility tag, and distinct test references. It reports the groups without changing the source memories. Use a memory ID from one group to draft a proposal.
|
|
295
|
-
|
|
296
|
-
```sh
|
|
297
|
-
npx agent-lyra memory consolidate graphql-client@1
|
|
298
|
-
npx agent-lyra skills evolve graphql-client@1 MEMORY_ID
|
|
299
|
-
npx agent-lyra skills proposal PROPOSAL_ID
|
|
300
|
-
```
|
|
301
|
-
|
|
302
|
-
Review the draft Markdown and run a separate regression test. Save a receipt such as this one as `regression.json`:
|
|
303
|
-
|
|
304
|
-
```json
|
|
305
|
-
{"evidenceId":"test:skill-regression","context":"graphql-client@1","result":"passed","reviewed":true}
|
|
306
|
-
```
|
|
307
|
-
|
|
308
|
-
```sh
|
|
309
|
-
npx agent-lyra skills approve PROPOSAL_ID regression.json
|
|
310
|
-
```
|
|
311
|
-
|
|
312
|
-
The approval records your review. It does not install the proposal or edit any skill file. Use `skills proposals` to list drafts, `skills reject PROPOSAL_ID` to reject a pending proposal, or `skills withdraw PROPOSAL_ID` to revoke an approval. These commands do not run tests themselves. Forgetting a source memory removes its dependent proposals from the local store.
|
|
313
|
-
|
|
314
|
-
### Sync selected memories to Cloud
|
|
315
|
-
|
|
316
|
-
Local memory stays on your machine by default. In [Console → API Keys](https://console.agentlyra.in/mcp-servers), select **Generate AgentLyra API key** with **Sync verified memories** enabled. Leave all permissions selected to reuse the same key for hosted agents, Cloud resources, and memories.
|
|
317
|
-
|
|
318
|
-
```sh
|
|
319
|
-
npx agent-lyra connect-cloud
|
|
320
|
-
```
|
|
321
|
-
|
|
322
|
-
If you previously saved a key, add `--replace-key` to enter the new one. Existing dedicated Memory keys still work through `LYRA_MEMORY_KEY`, which takes priority for Memory sync.
|
|
323
|
-
|
|
324
|
-
From the same terminal, preview a verified record and then explicitly confirm the upload:
|
|
325
|
-
|
|
326
|
-
```sh
|
|
327
|
-
npx agent-lyra memory cloud preview MEMORY_ID
|
|
328
|
-
npx agent-lyra memory cloud push MEMORY_ID --yes
|
|
329
|
-
```
|
|
330
|
-
|
|
331
|
-
The preview shows the name, lesson, type, and evidence IDs that will be sent. Review it for personal or proprietary information. Model requests, run transcripts, files, approvals, and working state are outside this sync path.
|
|
332
|
-
|
|
333
|
-
In a second project or machine, use the same Cloud account and run:
|
|
334
|
-
|
|
335
|
-
```sh
|
|
336
|
-
npx agent-lyra memory cloud list
|
|
337
|
-
npx agent-lyra memory cloud pull MEMORY_ID
|
|
338
|
-
```
|
|
339
|
-
|
|
340
|
-
Imported records start as candidates and require local review before an agent can retrieve them. If the two copies changed, sync stops. Review both before changing either one. To propagate a deletion, run `memory forget MEMORY_ID --yes` locally. Preview and push that ID again to remove its Cloud content. In the other project, pull the ID to apply the deletion when its local copy has no conflicting changes.
|
|
341
|
-
|
|
342
|
-
Cloud sync is manual and uses Node.js for the shared CLI. Revoking the key blocks future requests. Previously downloaded local copies remain until removed from their workspaces.
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
## CLI reference
|
|
346
|
-
|
|
347
|
-
Prefix each command with `npx agent-lyra`. Angle brackets indicate required arguments. Square brackets indicate optional arguments.
|
|
348
|
-
|
|
349
|
-
### Project setup
|
|
350
|
-
|
|
351
|
-
| Command | What it does |
|
|
352
|
-
| --- | --- |
|
|
353
|
-
| `init [options]` | Scaffold a `.lyra` workspace and starter agents. Options include `--mode`, `--domains`, `--api-key`, `--api-base-url`, `--dir`, and `--force`. |
|
|
354
|
-
| `--help` | Show the init command and its options. The help alias does the same. Add `--help` to a specific command for its syntax. |
|
|
355
|
-
|
|
356
|
-
### Studio and App Builder
|
|
357
|
-
|
|
358
|
-
| Command | What it does |
|
|
359
|
-
| --- | --- |
|
|
360
|
-
| `studio` | Open the drag-and-drop canvas. |
|
|
361
|
-
| `studio pull` | Import Cloud agents, workflows, and teams. Requires `LYRA_API_KEY`. |
|
|
362
|
-
| `app init [manifest.json]` | Select two saved Lyra agents. Defaults to `manifest.json` in your project. |
|
|
363
|
-
| `app validate <manifest.json>` | Check the app manifest before previewing or exporting. |
|
|
364
|
-
| `app preview <manifest.json>` | Preview the app in your browser on loopback. Set `LYRA_PREVIEW_PORT` to change its port. |
|
|
365
|
-
| `app export <manifest.json> <new-directory>` | Export editable app source into a new directory. |
|
|
366
|
-
| `app publish <manifest.json> --dry-run` | Print the proposed Marketplace payload for review. Submit the listing in the cloud. |
|
|
367
|
-
| `app use <listing-id> [new-manifest.json]` | Import a published app and save its manifest. Requires `LYRA_SESSION_TOKEN`. |
|
|
368
|
-
|
|
369
|
-
### Agent runs and IDE integration
|
|
370
|
-
|
|
371
|
-
| Command | What it does |
|
|
372
|
-
| --- | --- |
|
|
373
|
-
| `agent run --model <model> --prompt <text>` | Run a local agent with an OpenAI model. Requires `OPENAI_API_KEY`. |
|
|
374
|
-
| `team run draft-review --model <model> --prompt <text>` | Run the built-in writer and reviewer team. Requires `OPENAI_API_KEY`. |
|
|
375
|
-
| `run status <run-id>` | Read the latest event for a run from local SQLite history. |
|
|
376
|
-
| `mcp serve --dir <absolute-project-directory>` | Expose saved runs to an IDE over read-only stdio MCP. |
|
|
377
|
-
|
|
378
|
-
## Use the library from JavaScript
|
|
379
|
-
|
|
380
|
-
```js
|
|
381
|
-
import { createLinearWorkflow, runWorkflow } from "agent-lyra/standalone";
|
|
382
|
-
|
|
383
|
-
const workflow = createLinearWorkflow(
|
|
384
|
-
async () => "collect",
|
|
385
|
-
async (context) => `${context.step_1}:analyze`,
|
|
386
|
-
);
|
|
387
|
-
|
|
388
|
-
console.log(await runWorkflow(workflow));
|
|
389
|
-
```
|
|
390
|
-
|
|
391
|
-
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.
|
|
392
|
-
|
|
393
|
-
## Current scope
|
|
394
|
-
|
|
395
|
-
The App Builder supports two saved text agents in sequence. Publishing saved-agent app manifests to Marketplace is outside the current release. 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/).
|
|
396
|
-
|
|
397
|
-
MIT licensed.
|
|
398
|
-
|
|
399
|
-
## Set up coding agents and skills
|
|
400
|
-
|
|
401
|
-
Choose **Coding** or **Engineering** during interactive `init`, or run `npx agent-lyra setup coding` from an existing project. The Python command uses the bundled CLI and requires Node.js 22.13 or newer.
|
|
402
|
-
|
|
403
|
-
```sh
|
|
404
|
-
npx agent-lyra setup coding --stack mern,typescript,playwright --preview
|
|
405
|
-
npx agent-lyra setup coding --stack playwright-cucumber --yes
|
|
406
|
-
```
|
|
407
|
-
|
|
408
|
-
Choose frontend, backend, database, DevOps, or QA packs individually. Presets include `mern`, `python-fastapi`, and `playwright-cucumber`. Setup works locally and creates editable agents in `.lyra/agents` and skills in `.lyra/skills`. It preserves existing files on rerun. A new combination creates a separate profile for the affected area. Studio lists the generated agents and Markdown skills.
|
|
409
|
-
|
|
410
|
-
For an existing repository, preview automatic stack recommendations:
|
|
411
|
-
|
|
412
|
-
```sh
|
|
413
|
-
npx agent-lyra setup coding --detect --preview
|
|
414
|
-
```
|
|
415
|
-
|
|
416
|
-
The scan prints the evidence for each folder and flags technologies that have no bundled pack. Run interactive setup to confirm the recommendations or choose manually. Use `--detect --yes` to apply recommendations unattended. After setup, run `node .lyra/scripts/detect-stack.mjs` to get a read-only JSON report. The scanner reads local project metadata and skips hidden directories, dependency trees, and symbolic links.
|
|
417
|
-
|
|
418
|
-
### Export to a coding assistant
|
|
419
|
-
|
|
420
|
-
```sh
|
|
421
|
-
npx agent-lyra setup coding export --to claude,codex,copilot --preview
|
|
422
|
-
npx agent-lyra setup coding export --to claude,codex,copilot --yes
|
|
423
|
-
```
|
|
424
|
-
|
|
425
|
-
The command reads the editable Markdown in `.lyra/agents` and `.lyra/skills`. An interactive run suggests targets from project folders and asks which ones to configure. Each target gets its own agent format and `SKILL.md` files. Preview reports existing files and the exporter preserves them. Export carries instructions only. Check referenced scripts and resources separately. Review any changed export against your customized copy before replacing an existing file.
|
|
426
|
-
|
|
427
|
-
### Choose a catalog version
|
|
428
|
-
|
|
429
|
-
Setup uses the bundled catalog offline. It includes frontend, backend, databases, DevOps, QA, mobile, and data engineering packs. To preview a specific published version from AgentLyra Cloud, run:
|
|
430
|
-
|
|
431
|
-
```sh
|
|
432
|
-
npx agent-lyra setup coding --detect --catalog-version 2 --preview
|
|
433
|
-
```
|
|
434
|
-
|
|
435
|
-
Use `--stack` with a named preset or comma-separated technologies for manual setup. Existing agent and skill files are preserved. Review differences yourself before replacing a personalized file. The setup receipt records which catalog version was selected.
|
|
1
|
+
<img src="https://agentlyra.in/images/logo.png" width="80" height="80" alt="AgentLyra constellation mark">
|
|
2
|
+
|
|
3
|
+
# AgentLyra SDK
|
|
4
|
+
|
|
5
|
+
**Build agent workflows, design apps, and set up coding assistants from your project.**
|
|
6
|
+
|
|
7
|
+
[Get started](#get-started) · [SDK](#sdk-library) · [Coding setup](#coding-setup) · [Studio](#lyra-studio) · [App Builder](#lyra-app-builder) · [Memory](#project-memory-and-skill-proposals) · [Cloud](#agentlyra-cloud-and-marketplace)
|
|
8
|
+
|
|
9
|
+
[Website](https://agentlyra.in/) · [Cloud console](https://console.agentlyra.in/) · [GitHub](https://github.com/agentlyra-labs/agent-lyra-sdk) · [npm](https://www.npmjs.com/package/agent-lyra) · [PyPI](https://pypi.org/project/agent-lyra/)
|
|
10
|
+
|
|
11
|
+
## Choose your starting point
|
|
12
|
+
|
|
13
|
+
| | What you get |
|
|
14
|
+
| --- | --- |
|
|
15
|
+
| **GitHub source edition** | MIT-licensed JavaScript workflow and retrieval primitives, local execution and run history, evidence-based memory, manifest validation, and [technology skill guides](https://github.com/agentlyra-labs/agent-lyra-sdk/tree/main/src/coding/skills). |
|
|
16
|
+
| **SDK from npm or PyPI** | Coding stack detection, agent and skill generation, assistant exports, Studio, App Builder, and optional Cloud access. The Python package also provides native Python workflow and memory APIs. |
|
|
17
|
+
| **AgentLyra Cloud** | A signed-in workspace for hosted agents, syncing selected project resources, and browsing the Marketplace. |
|
|
18
|
+
|
|
19
|
+
## Get started
|
|
20
|
+
|
|
21
|
+
**JavaScript · Node.js 22.13 or newer**
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
npm install agent-lyra
|
|
25
|
+
npx agent-lyra --help
|
|
26
|
+
npx agent-lyra setup coding --detect --preview
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
**Python · Python 3.9 or newer**
|
|
30
|
+
|
|
31
|
+
```sh
|
|
32
|
+
python -m pip install agent-lyra
|
|
33
|
+
python -m lyra --help
|
|
34
|
+
python -m lyra setup coding --detect --preview
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Coding setup, Studio, App Builder, Cloud commands, and skill proposals require Node.js 22.13 or newer. Native Python workflows and local Memory commands run with Python alone.
|
|
38
|
+
|
|
39
|
+
**GitHub source edition · Node.js 22.13 or newer**
|
|
40
|
+
|
|
41
|
+
```sh
|
|
42
|
+
git clone https://github.com/agentlyra-labs/agent-lyra-sdk.git
|
|
43
|
+
cd agent-lyra-sdk
|
|
44
|
+
node bin/agent-lyra.js --help
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Run project commands from your own project folder using the absolute path to the cloned CLI. Use the npm or PyPI install below to try Studio, App Builder, coding setup, or Cloud commands.
|
|
48
|
+
|
|
49
|
+
**Command prefixes used below**
|
|
50
|
+
|
|
51
|
+
| Edition | Prefix |
|
|
52
|
+
| --- | --- |
|
|
53
|
+
| JavaScript | `npx agent-lyra` |
|
|
54
|
+
| Python | `python -m lyra` |
|
|
55
|
+
| GitHub source | `node /absolute/path/to/agent-lyra-sdk/bin/agent-lyra.js` |
|
|
56
|
+
|
|
57
|
+
Values in angle brackets are placeholders. Use `--help` to check arguments for the command you’re running. On Windows PowerShell, use `npm.cmd` and `npx.cmd` if PowerShell blocks the script shims.
|
|
58
|
+
|
|
59
|
+
| Command | Availability | Purpose |
|
|
60
|
+
| --- | --- | --- |
|
|
61
|
+
| `--help` | All editions | Show the CLI entry points |
|
|
62
|
+
| `init [--mode standalone] [--dir <folder>]` | All editions | Initialize a local workspace |
|
|
63
|
+
| `init --domains <ids> [--stack <names> or --detect]` | npm, Python | Select domains and optionally configure a coding stack. The registry wizard also supports hosted setup |
|
|
64
|
+
|
|
65
|
+
The registry wizard supports `--mode`, `--domains`, `--stack`, `--detect`, `--dir`, `--force`, `--api-key`, and `--api-base-url`. For account credentials, prefer the hidden prompt in `connect-cloud`.
|
|
66
|
+
|
|
67
|
+
## SDK library
|
|
68
|
+
|
|
69
|
+
Use the SDK directly in your own code to compose workflows, run agents, and work with retrieval. Choose the runtime and provider that fit your app.
|
|
70
|
+
|
|
71
|
+
**JavaScript**
|
|
72
|
+
|
|
73
|
+
```js
|
|
74
|
+
import { standalone } from 'agent-lyra';
|
|
75
|
+
|
|
76
|
+
const workflow = standalone.createLinearWorkflow(() => 'Draft ready');
|
|
77
|
+
console.log(await standalone.runWorkflow(workflow));
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
**Python**
|
|
81
|
+
|
|
82
|
+
```python
|
|
83
|
+
import asyncio
|
|
84
|
+
from lyra.standalone import create_linear_workflow, run_workflow
|
|
85
|
+
|
|
86
|
+
async def draft(context):
|
|
87
|
+
return "Draft ready"
|
|
88
|
+
|
|
89
|
+
print(asyncio.run(run_workflow(create_linear_workflow(draft))))
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
From the GitHub source edition, import the JavaScript primitives from `./src/standalone/index.js`. That edition also includes the [v1 manifest contract](https://github.com/agentlyra-labs/agent-lyra-sdk/blob/main/src/app-builder/manifest-contract.js).
|
|
93
|
+
|
|
94
|
+
| Command | Availability | Purpose |
|
|
95
|
+
| --- | --- | --- |
|
|
96
|
+
| `agent run --model <model> --prompt <text>` | Source, npm | Run the local assistant with an OpenAI model |
|
|
97
|
+
| `team run draft-review --model <model> --prompt <text>` | Source, npm | Run the built-in drafting and review sequence |
|
|
98
|
+
| `run status <run-id>` | Source, npm | Read the latest saved run event |
|
|
99
|
+
| `mcp serve --dir <absolute-project-directory>` | Source, npm | Expose `get_saved_run` over read-only stdio MCP |
|
|
100
|
+
|
|
101
|
+
Model-backed runs require `OPENAI_API_KEY`. The provider receives the prompt and any retrieved project memory included with it. AgentLyra records local run history in SQLite. The MCP tool can read saved run output by UUID.
|
|
102
|
+
|
|
103
|
+
## Coding setup
|
|
104
|
+
|
|
105
|
+
Generate editable agents and skills in `.lyra/` for the technology you use. Choose packs manually or let Lyra detect your stack from local project files. Review the preview before applying it. Existing files are preserved.
|
|
106
|
+
|
|
107
|
+
```sh
|
|
108
|
+
npx agent-lyra setup coding --detect --preview
|
|
109
|
+
npx agent-lyra setup coding --stack playwright-cucumber --yes
|
|
110
|
+
npx agent-lyra setup coding export --to claude,codex,copilot --preview
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
| Command | Purpose |
|
|
114
|
+
| --- | --- |
|
|
115
|
+
| `setup coding` | Choose technologies interactively |
|
|
116
|
+
| `setup coding --stack <names>` | Choose packs or presets such as `mern`, `python-fastapi`, and `playwright-cucumber` |
|
|
117
|
+
| `setup coding --detect` | Review detected technologies and the files that support each recommendation |
|
|
118
|
+
| `setup coding --stack <names> --catalog-version <number> --preview` | Preview a published Cloud catalog version. Without this option, setup uses the bundled catalog offline |
|
|
119
|
+
| `setup coding export --to claude,codex,copilot --preview` | Preview assistant-specific instructions. Replace `--preview` with `--yes` to write the files |
|
|
120
|
+
|
|
121
|
+
These commands are available in npm and Python. Both setup commands accept `--dir <folder>`. After setup, you can run `node .lyra/scripts/detect-stack.mjs` for a read-only JSON report. The GitHub source edition includes the guide files for reading and reuse.
|
|
122
|
+
|
|
123
|
+
## Lyra Studio
|
|
124
|
+
|
|
125
|
+
Studio is a **local browser canvas** that you launch from your IDE terminal. Add a text input, agent card or run button, and an output. Use the Inspector to bind inputs and outputs, then run an agent or workflow from the canvas.
|
|
126
|
+
|
|
127
|
+
```sh
|
|
128
|
+
npx agent-lyra studio
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
Run `python -m lyra studio` from a Python project. Start from the project root so Studio can find your `.lyra` agents, workflows, and skills. See [Cloud sync](#agentlyra-cloud-and-marketplace) for importing or pushing selected resources.
|
|
132
|
+
|
|
133
|
+
## Lyra App Builder
|
|
134
|
+
|
|
135
|
+
App Builder turns an **app manifest** into a browser preview or editable application source. Use `app init` to start with saved Cloud agents, then validate, preview, and export.
|
|
136
|
+
|
|
137
|
+
| Command | Purpose |
|
|
138
|
+
| --- | --- |
|
|
139
|
+
| `app init [manifest.json]` | Create a manifest using saved Cloud agents. Connect to Cloud first |
|
|
140
|
+
| `app validate <manifest.json>` | Check the manifest |
|
|
141
|
+
| `app preview <manifest.json>` | Open a local browser preview. Set `LYRA_PREVIEW_PORT` if you need a different port |
|
|
142
|
+
| `app export <manifest.json> <new-directory>` | Export editable source to a new directory |
|
|
143
|
+
|
|
144
|
+
These commands are available in npm and Python. To import an app or preview a public listing, see [Marketplace](#marketplace).
|
|
145
|
+
|
|
146
|
+
## Project Memory and Skill Proposals
|
|
147
|
+
|
|
148
|
+
Project Memory uses SQLite on your machine. Record a lesson, verify it against evidence, and retrieve it for later runs. The runtimes provide SQLite, so there is no separate database server to install.
|
|
149
|
+
|
|
150
|
+
### Local memory
|
|
151
|
+
|
|
152
|
+
Local memory commands work in Source, npm, and Python. `consolidate` uses the shared Node CLI from Python.
|
|
153
|
+
|
|
154
|
+
| Command | Purpose |
|
|
155
|
+
| --- | --- |
|
|
156
|
+
| `memory --help` | List memory commands |
|
|
157
|
+
| `memory init` | Initialize the SQLite memory store |
|
|
158
|
+
| `memory record <json-file>` | Record a candidate lesson |
|
|
159
|
+
| `memory list` | List project memories |
|
|
160
|
+
| `memory search <query>` | Search project memory |
|
|
161
|
+
| `memory inspect <id>` | Read a record and its evidence references |
|
|
162
|
+
| `memory verify <id> <evidence.json>` | Verify a candidate against reviewed evidence |
|
|
163
|
+
| `memory archive <id>` | Archive a memory |
|
|
164
|
+
| `memory consolidate <context>` | Find recurring lessons for a context |
|
|
165
|
+
| `memory stats` | Show store counts and search mode |
|
|
166
|
+
| `memory forget <id> --yes` | Permanently remove a local record |
|
|
167
|
+
|
|
168
|
+
See [memory types](https://github.com/agentlyra-labs/agent-lyra-sdk/blob/main/src/memory/index.d.ts) and [evidence validation](https://github.com/agentlyra-labs/agent-lyra-sdk/blob/main/src/memory/validation.js). Store evidence references and reusable lessons. Keep secrets and sensitive data in appropriate stores. Use `LYRA_MEMORY_CONTEXT=off` to disable historical retrieval for model-backed runs.
|
|
169
|
+
|
|
170
|
+
### Skill proposals
|
|
171
|
+
|
|
172
|
+
These commands work in Source, npm, and Python. Approving a proposal requires independent regression evidence.
|
|
173
|
+
|
|
174
|
+
| Command | Purpose |
|
|
175
|
+
| --- | --- |
|
|
176
|
+
| `skills --help` | List skill proposal commands |
|
|
177
|
+
| `skills evolve <context> <memory-id>` | Draft an improvement from verified memory |
|
|
178
|
+
| `skills proposals` | List proposals |
|
|
179
|
+
| `skills proposal <id>` | Inspect a proposal and its sources |
|
|
180
|
+
| `skills approve <id> <regression.json>` | Approve a proposal with evidence |
|
|
181
|
+
| `skills reject <id>` | Reject a pending proposal |
|
|
182
|
+
| `skills withdraw <id>` | Withdraw an approval |
|
|
183
|
+
|
|
184
|
+
## AgentLyra Cloud and Marketplace
|
|
185
|
+
|
|
186
|
+
[Open the AgentLyra console](https://console.agentlyra.in/) to run hosted agents, manage a workspace, and view synced records. Create one AgentLyra API key under [API Keys](https://console.agentlyra.in/mcp-servers). Enable the permissions you need for hosted runs, resource sync, and verified memory sync.
|
|
187
|
+
|
|
188
|
+
| Command | Purpose |
|
|
189
|
+
| --- | --- |
|
|
190
|
+
| `connect-cloud [--replace-key]` | Connect once from the IDE. Use `--replace-key` to enter a new key |
|
|
191
|
+
| `work-locally` | Pause Cloud actions while keeping project files |
|
|
192
|
+
|
|
193
|
+
These commands are available in npm and Python. The compatibility names `gated` and `standalone` still work for switching modes. Provider credentials are configured separately where a hosted run requires them.
|
|
194
|
+
|
|
195
|
+
### Sync project resources
|
|
196
|
+
|
|
197
|
+
These commands work in the npm and Python distributions with a key that has Cloud resource sync permission.
|
|
198
|
+
|
|
199
|
+
| Command | Purpose |
|
|
200
|
+
| --- | --- |
|
|
201
|
+
| `studio pull` | Pull the workspace catalog from Cloud |
|
|
202
|
+
| `studio push <agent-id>` | Push a local agent to Cloud |
|
|
203
|
+
| `studio pull-agent <agent-id>` | Pull changes to a linked agent |
|
|
204
|
+
| `studio push-workflow <workflow-id>` | Push a local workflow |
|
|
205
|
+
| `studio pull-workflow <workflow-id>` | Pull changes to a linked workflow |
|
|
206
|
+
| `studio push-team <team-id>` | Push a local team |
|
|
207
|
+
| `studio pull-team <team-id>` | Pull changes to a linked team |
|
|
208
|
+
| `studio push-skill <skill-id>` | Push a local text skill |
|
|
209
|
+
| `studio pull-skill <skill-id>` | Pull changes to a linked text skill |
|
|
210
|
+
|
|
211
|
+
### Sync verified memories
|
|
212
|
+
|
|
213
|
+
Cloud memory commands work in the npm and Python distributions. They require an AgentLyra API key with Memory sync permission.
|
|
214
|
+
|
|
215
|
+
| Command | Purpose |
|
|
216
|
+
| --- | --- |
|
|
217
|
+
| `memory cloud list [cursor]` | List your synced records |
|
|
218
|
+
| `memory cloud preview <id>` | Review what would be sent |
|
|
219
|
+
| `memory cloud push <id> --yes` | Upload the reviewed record |
|
|
220
|
+
| `memory cloud pull <id>` | Import a Cloud copy for local review |
|
|
221
|
+
|
|
222
|
+
A verified record stays local until you choose to upload it. Preview the payload before confirming a push. The Cloud copy is private to your account.
|
|
223
|
+
|
|
224
|
+
### Marketplace
|
|
225
|
+
|
|
226
|
+
Browse [published apps](https://agentlyra.in/marketplace/apps). Sign in to import or submit an app.
|
|
227
|
+
|
|
228
|
+
| Command | Purpose |
|
|
229
|
+
| --- | --- |
|
|
230
|
+
| `app use <listing-id> [new-manifest.json]` | Import a published app manifest. Requires `LYRA_SESSION_TOKEN` |
|
|
231
|
+
| `app publish <manifest.json> --dry-run` | Preview the listing payload. Submit the listing through Cloud |
|
|
232
|
+
|
|
233
|
+
## License
|
|
234
|
+
|
|
235
|
+
The public source edition is available under the [MIT License](https://github.com/agentlyra-labs/agent-lyra-sdk/blob/main/LICENSE). For questions and reproducible bugs, use [GitHub Issues](https://github.com/agentlyra-labs/agent-lyra-sdk/issues). Report security issues privately and keep credentials out of issue reports.
|