agent-lyra 0.1.4 → 0.2.0
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 +118 -82
- package/bin/agent-lyra.js +15 -7
- package/package.json +56 -38
- package/src/catalog.js +147 -147
- package/src/gated/hostedAgents.js +56 -56
- package/src/gated/index.d.ts +25 -0
- package/src/gated/index.js +5 -5
- package/src/index.d.ts +2 -2
- package/src/index.js +2 -2
- package/src/init.js +937 -583
- package/src/onboardingAgents.js +532 -532
- package/src/promptTemplates.js +178 -178
- package/src/runtime/contracts.d.ts +47 -0
- package/src/runtime/local-cli.js +159 -0
- package/src/runtime/mcp-stdio.js +111 -0
- package/src/runtime/orchestration.js +59 -0
- package/src/runtime/run-agent.js +43 -0
- package/src/standalone/index.d.ts +45 -0
- package/src/standalone/index.js +13 -13
- package/src/standalone/orchestration.js +6 -59
- package/src/standalone/rag.js +113 -113
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 Lyra
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Lyra
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,82 +1,118 @@
|
|
|
1
|
-
# agent-lyra
|
|
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
|
-
|
|
1
|
+
# agent-lyra
|
|
2
|
+
|
|
3
|
+
## Local-first release 0.2.0
|
|
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.
|
|
6
|
+
|
|
7
|
+
## Run a local agent
|
|
8
|
+
|
|
9
|
+
With Node.js 22.13 or newer, set `OPENAI_API_KEY` in your terminal environment, then run these commands from your project:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npx agent-lyra agent run --model YOUR_MODEL --prompt "Summarize this idea"
|
|
13
|
+
npx agent-lyra run status YOUR_RUN_ID
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
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.
|
|
17
|
+
|
|
18
|
+
To run the built-in writing team with the same setup:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npx agent-lyra team run draft-review --model YOUR_MODEL --prompt "Draft a project update"
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
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.
|
|
25
|
+
|
|
26
|
+
## Inspect saved runs from an IDE
|
|
27
|
+
|
|
28
|
+
Configure a stdio MCP server in your IDE with the installed `agent-lyra` executable (use its absolute path if needed) and these arguments:
|
|
29
|
+
|
|
30
|
+
```json
|
|
31
|
+
["mcp", "serve", "--dir", "ABSOLUTE_PROJECT_PATH"]
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Two-layer Lyra SDK package:
|
|
35
|
+
|
|
36
|
+
- Standalone layer: local orchestration primitives and RAG utilities with no API key.
|
|
37
|
+
- Gated layer: compatibility client for deployments that provide the hosted invocation endpoint.
|
|
38
|
+
|
|
39
|
+
## Install
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
npm install agent-lyra
|
|
43
|
+
# or
|
|
44
|
+
pnpm add agent-lyra
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Installation has zero side effects:
|
|
48
|
+
|
|
49
|
+
- no files/folders created
|
|
50
|
+
- no network calls by package code
|
|
51
|
+
- no postinstall hooks
|
|
52
|
+
|
|
53
|
+
Initialization is explicit and happens only when the user runs the CLI.
|
|
54
|
+
|
|
55
|
+
## Init A Repo
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
npx agent-lyra init
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Or after install:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
agent-lyra init
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Flow:
|
|
68
|
+
|
|
69
|
+
- optional login step with Lyra API key to sync your web-created agents
|
|
70
|
+
- choose pack type: `Professional` or `Everyday`
|
|
71
|
+
- choose `standalone` or `gated` (or set with `--mode`)
|
|
72
|
+
- standalone: select onboarding domains with `Space`, confirm with `Enter`
|
|
73
|
+
- for repository-aware engineering personas, select `engineering-bootstrap`
|
|
74
|
+
- gated: select hosted verticals, then enter the Lyra API key from the Lyra login UI
|
|
75
|
+
- logged-out gated selections are marked as `needs login` in generated metadata
|
|
76
|
+
- the command creates a `.lyra/` folder in the current repo only after confirmation
|
|
77
|
+
|
|
78
|
+
Generated files:
|
|
79
|
+
|
|
80
|
+
- `.lyra/config.json`
|
|
81
|
+
- `.lyra/manifest.json` (root manifest with `source` + `comparisonStatus`)
|
|
82
|
+
- `.lyra/README.md`
|
|
83
|
+
- `.lyra/domains/<domain>/domain.json` (domain manifest)
|
|
84
|
+
- `.lyra/domains/<domain>/agents/*.md`
|
|
85
|
+
- `.lyra/agents/*.md` (flattened top-level agent specs)
|
|
86
|
+
- `.lyra/credentials.json` only for gated mode
|
|
87
|
+
- `.lyra/.gitignore` to ignore the local credentials file
|
|
88
|
+
|
|
89
|
+
Agent Markdown files are generated from the canonical onboarding catalog and include rich fields:
|
|
90
|
+
|
|
91
|
+
- identity: `id`, `slug`, `name`, `domain`, `category`, `mode`
|
|
92
|
+
- execution: `type`, `runtime` (standalone) or `hosted` (gated)
|
|
93
|
+
- behavior: `description`, `systemPrompt`, `skills`, `integrations`
|
|
94
|
+
- output policy: `outputs`
|
|
95
|
+
|
|
96
|
+
Engineering bootstrap agents are dynamic and repo-intelligence-ready:
|
|
97
|
+
|
|
98
|
+
- roles generated: `Engineering Dev Lead`, `Engineering QA Lead`, `Engineering Product Manager`, `Engineering Scrum Master`, `Engineering Architect`
|
|
99
|
+
- prompts are stack-agnostic and rely on runtime repo scan context
|
|
100
|
+
- each agent spec includes a `repoIntelligence` contract that aligns with:
|
|
101
|
+
- scan endpoint: `/api/repositories/:id/scan`
|
|
102
|
+
- PR endpoint: `/api/repositories/:id/lyra-pr`
|
|
103
|
+
|
|
104
|
+
## Usage
|
|
105
|
+
|
|
106
|
+
```js
|
|
107
|
+
import { standalone, gated } from "agent-lyra";
|
|
108
|
+
|
|
109
|
+
const workflow = standalone.createLinearWorkflow(
|
|
110
|
+
async () => "collect",
|
|
111
|
+
async (ctx) => `${ctx.step_1}:analyze`,
|
|
112
|
+
);
|
|
113
|
+
|
|
114
|
+
const result = await standalone.runWorkflow(workflow);
|
|
115
|
+
|
|
116
|
+
const client = gated.createHostedAgentClient({ apiKey: process.env.LYRA_API_KEY });
|
|
117
|
+
const output = await client.invoke("sales", { prompt: "Summarize latest pipeline risk." });
|
|
118
|
+
```
|
package/bin/agent-lyra.js
CHANGED
|
@@ -1,8 +1,16 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import { runCli } from "../src/init.js";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { runCli } from "../src/init.js";
|
|
4
|
+
import { runLocalCli } from "../src/runtime/local-cli.js";
|
|
5
|
+
import { serveSavedRuns } from "../src/runtime/mcp-stdio.js";
|
|
6
|
+
|
|
7
|
+
async function main() {
|
|
8
|
+
const argv = process.argv.slice(2);
|
|
9
|
+
if (argv[0] === "mcp" && argv[1] === "serve") return serveSavedRuns(argv.slice(2));
|
|
10
|
+
if (!(await runLocalCli(argv))) await runCli(argv);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
main().catch((error) => {
|
|
14
|
+
process.stderr.write(`${error.message}\n`);
|
|
15
|
+
process.exitCode = 1;
|
|
8
16
|
});
|
package/package.json
CHANGED
|
@@ -1,38 +1,56 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "agent-lyra",
|
|
3
|
-
"version": "0.
|
|
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
|
-
"
|
|
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
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "agent-lyra",
|
|
3
|
+
"version": "0.2.0",
|
|
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
|
+
}
|
package/src/catalog.js
CHANGED
|
@@ -1,147 +1,147 @@
|
|
|
1
|
-
import { ONBOARDING_AGENTS } from "./onboardingAgents.js";
|
|
2
|
-
import { ENGINEERING_BOOTSTRAP_ROLES, createDynamicRolePrompt } from "./promptTemplates.js";
|
|
3
|
-
|
|
4
|
-
const STANDALONE_LABELS = {
|
|
5
|
-
general: "General",
|
|
6
|
-
coding: "Engineering",
|
|
7
|
-
finance: "Finance",
|
|
8
|
-
product: "Product",
|
|
9
|
-
marketing: "Marketing",
|
|
10
|
-
hr: "HR",
|
|
11
|
-
legal: "Legal",
|
|
12
|
-
founders: "Founders",
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
const STANDALONE_ORDER = [
|
|
16
|
-
"general",
|
|
17
|
-
"coding",
|
|
18
|
-
"finance",
|
|
19
|
-
"product",
|
|
20
|
-
"marketing",
|
|
21
|
-
"hr",
|
|
22
|
-
"legal",
|
|
23
|
-
"founders",
|
|
24
|
-
];
|
|
25
|
-
|
|
26
|
-
const GATED_VERTICALS = [
|
|
27
|
-
{ id: "hr", label: "HR", defaultModel: "lyra-hosted/hr-v1" },
|
|
28
|
-
{ id: "sales", label: "Sales", defaultModel: "lyra-hosted/sales-v1" },
|
|
29
|
-
{ id: "support", label: "Support", defaultModel: "lyra-hosted/support-v1" },
|
|
30
|
-
{ id: "finance", label: "Finance", defaultModel: "lyra-hosted/finance-v1" },
|
|
31
|
-
{ id: "coding", label: "Coding", defaultModel: "lyra-hosted/coding-v1" },
|
|
32
|
-
{ id: "legal", label: "Legal", defaultModel: "lyra-hosted/legal-v1" },
|
|
33
|
-
{ id: "news", label: "News", defaultModel: "lyra-hosted/news-v1" },
|
|
34
|
-
{ id: "markets", label: "Markets", defaultModel: "lyra-hosted/markets-v1" },
|
|
35
|
-
];
|
|
36
|
-
|
|
37
|
-
function toSlug(value) {
|
|
38
|
-
return String(value)
|
|
39
|
-
.trim()
|
|
40
|
-
.toLowerCase()
|
|
41
|
-
.replace(/[^a-z0-9]+/g, "-")
|
|
42
|
-
.replace(/^-+|-+$/g, "");
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
function buildStandaloneCatalog() {
|
|
46
|
-
const grouped = new Map();
|
|
47
|
-
|
|
48
|
-
for (const category of STANDALONE_ORDER) {
|
|
49
|
-
grouped.set(category, []);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
for (const agent of ONBOARDING_AGENTS) {
|
|
53
|
-
if (!grouped.has(agent.category)) {
|
|
54
|
-
continue;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
grouped.get(agent.category).push({
|
|
58
|
-
...agent,
|
|
59
|
-
slug: toSlug(agent.name),
|
|
60
|
-
mode: "standalone",
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
return STANDALONE_ORDER
|
|
65
|
-
.map((category) => {
|
|
66
|
-
const agents = grouped.get(category) || [];
|
|
67
|
-
return {
|
|
68
|
-
id: category,
|
|
69
|
-
label: STANDALONE_LABELS[category] || category,
|
|
70
|
-
mode: "standalone",
|
|
71
|
-
agents,
|
|
72
|
-
};
|
|
73
|
-
})
|
|
74
|
-
.filter((domain) => domain.agents.length > 0);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
function buildEngineeringBootstrapDomain() {
|
|
78
|
-
return {
|
|
79
|
-
id: "engineering-bootstrap",
|
|
80
|
-
label: "Engineering Bootstrap",
|
|
81
|
-
mode: "standalone",
|
|
82
|
-
generatedFrom: "repo-intelligence",
|
|
83
|
-
agents: ENGINEERING_BOOTSTRAP_ROLES.map((roleAgent) => ({
|
|
84
|
-
id: roleAgent.id,
|
|
85
|
-
slug: roleAgent.slug,
|
|
86
|
-
name: roleAgent.name,
|
|
87
|
-
description: roleAgent.mission,
|
|
88
|
-
category: "coding",
|
|
89
|
-
icon: roleAgent.icon,
|
|
90
|
-
skills: roleAgent.skills,
|
|
91
|
-
kind: roleAgent.kind,
|
|
92
|
-
systemPrompt: createDynamicRolePrompt({
|
|
93
|
-
role: roleAgent.role,
|
|
94
|
-
domain: "Engineering",
|
|
95
|
-
mission: roleAgent.mission,
|
|
96
|
-
responsibilities: roleAgent.responsibilities,
|
|
97
|
-
deliverables: roleAgent.deliverables,
|
|
98
|
-
}),
|
|
99
|
-
promptTemplateId: `repo-intel/${roleAgent.slug}`,
|
|
100
|
-
generatedFrom: "repo-intelligence",
|
|
101
|
-
runtimeHints: {
|
|
102
|
-
requiresRepoScan: true,
|
|
103
|
-
suggestedScanEndpoint: "/api/repositories/:id/scan",
|
|
104
|
-
suggestedPrEndpoint: "/api/repositories/:id/lyra-pr",
|
|
105
|
-
},
|
|
106
|
-
})),
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
function buildGatedCatalog() {
|
|
111
|
-
return GATED_VERTICALS.map((vertical) => {
|
|
112
|
-
const hostedAgentId = `hosted-${vertical.id}-primary`;
|
|
113
|
-
return {
|
|
114
|
-
id: vertical.id,
|
|
115
|
-
label: vertical.label,
|
|
116
|
-
mode: "gated",
|
|
117
|
-
agents: [
|
|
118
|
-
{
|
|
119
|
-
id: hostedAgentId,
|
|
120
|
-
slug: hostedAgentId,
|
|
121
|
-
name: `${vertical.label} Hosted Agent`,
|
|
122
|
-
description: `Managed ${vertical.label} workflows powered by the Lyra hosted platform.`,
|
|
123
|
-
category: vertical.id,
|
|
124
|
-
icon: "Sparkles",
|
|
125
|
-
skills: ["lyra:hosted-invoke"],
|
|
126
|
-
systemPrompt: `You are the Lyra hosted ${vertical.label} agent. Coordinate and execute ${vertical.label} tasks by calling the managed Lyra API and return concise, actionable responses.`,
|
|
127
|
-
mode: "gated",
|
|
128
|
-
hosted: {
|
|
129
|
-
vertical: vertical.id,
|
|
130
|
-
defaultModel: vertical.defaultModel,
|
|
131
|
-
},
|
|
132
|
-
requiresIntegration: ["lyra-api-key"],
|
|
133
|
-
},
|
|
134
|
-
],
|
|
135
|
-
};
|
|
136
|
-
});
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
export const STANDALONE_DOMAINS = [
|
|
140
|
-
...buildStandaloneCatalog(),
|
|
141
|
-
buildEngineeringBootstrapDomain(),
|
|
142
|
-
];
|
|
143
|
-
export const GATED_DOMAINS = buildGatedCatalog();
|
|
144
|
-
|
|
145
|
-
export function getDomainCatalog(mode) {
|
|
146
|
-
return mode === "gated" ? GATED_DOMAINS : STANDALONE_DOMAINS;
|
|
147
|
-
}
|
|
1
|
+
import { ONBOARDING_AGENTS } from "./onboardingAgents.js";
|
|
2
|
+
import { ENGINEERING_BOOTSTRAP_ROLES, createDynamicRolePrompt } from "./promptTemplates.js";
|
|
3
|
+
|
|
4
|
+
const STANDALONE_LABELS = {
|
|
5
|
+
general: "General",
|
|
6
|
+
coding: "Engineering",
|
|
7
|
+
finance: "Finance",
|
|
8
|
+
product: "Product",
|
|
9
|
+
marketing: "Marketing",
|
|
10
|
+
hr: "HR",
|
|
11
|
+
legal: "Legal",
|
|
12
|
+
founders: "Founders",
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const STANDALONE_ORDER = [
|
|
16
|
+
"general",
|
|
17
|
+
"coding",
|
|
18
|
+
"finance",
|
|
19
|
+
"product",
|
|
20
|
+
"marketing",
|
|
21
|
+
"hr",
|
|
22
|
+
"legal",
|
|
23
|
+
"founders",
|
|
24
|
+
];
|
|
25
|
+
|
|
26
|
+
const GATED_VERTICALS = [
|
|
27
|
+
{ id: "hr", label: "HR", defaultModel: "lyra-hosted/hr-v1" },
|
|
28
|
+
{ id: "sales", label: "Sales", defaultModel: "lyra-hosted/sales-v1" },
|
|
29
|
+
{ id: "support", label: "Support", defaultModel: "lyra-hosted/support-v1" },
|
|
30
|
+
{ id: "finance", label: "Finance", defaultModel: "lyra-hosted/finance-v1" },
|
|
31
|
+
{ id: "coding", label: "Coding", defaultModel: "lyra-hosted/coding-v1" },
|
|
32
|
+
{ id: "legal", label: "Legal", defaultModel: "lyra-hosted/legal-v1" },
|
|
33
|
+
{ id: "news", label: "News", defaultModel: "lyra-hosted/news-v1" },
|
|
34
|
+
{ id: "markets", label: "Markets", defaultModel: "lyra-hosted/markets-v1" },
|
|
35
|
+
];
|
|
36
|
+
|
|
37
|
+
function toSlug(value) {
|
|
38
|
+
return String(value)
|
|
39
|
+
.trim()
|
|
40
|
+
.toLowerCase()
|
|
41
|
+
.replace(/[^a-z0-9]+/g, "-")
|
|
42
|
+
.replace(/^-+|-+$/g, "");
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function buildStandaloneCatalog() {
|
|
46
|
+
const grouped = new Map();
|
|
47
|
+
|
|
48
|
+
for (const category of STANDALONE_ORDER) {
|
|
49
|
+
grouped.set(category, []);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
for (const agent of ONBOARDING_AGENTS) {
|
|
53
|
+
if (!grouped.has(agent.category)) {
|
|
54
|
+
continue;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
grouped.get(agent.category).push({
|
|
58
|
+
...agent,
|
|
59
|
+
slug: toSlug(agent.name),
|
|
60
|
+
mode: "standalone",
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return STANDALONE_ORDER
|
|
65
|
+
.map((category) => {
|
|
66
|
+
const agents = grouped.get(category) || [];
|
|
67
|
+
return {
|
|
68
|
+
id: category,
|
|
69
|
+
label: STANDALONE_LABELS[category] || category,
|
|
70
|
+
mode: "standalone",
|
|
71
|
+
agents,
|
|
72
|
+
};
|
|
73
|
+
})
|
|
74
|
+
.filter((domain) => domain.agents.length > 0);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function buildEngineeringBootstrapDomain() {
|
|
78
|
+
return {
|
|
79
|
+
id: "engineering-bootstrap",
|
|
80
|
+
label: "Engineering Bootstrap",
|
|
81
|
+
mode: "standalone",
|
|
82
|
+
generatedFrom: "repo-intelligence",
|
|
83
|
+
agents: ENGINEERING_BOOTSTRAP_ROLES.map((roleAgent) => ({
|
|
84
|
+
id: roleAgent.id,
|
|
85
|
+
slug: roleAgent.slug,
|
|
86
|
+
name: roleAgent.name,
|
|
87
|
+
description: roleAgent.mission,
|
|
88
|
+
category: "coding",
|
|
89
|
+
icon: roleAgent.icon,
|
|
90
|
+
skills: roleAgent.skills,
|
|
91
|
+
kind: roleAgent.kind,
|
|
92
|
+
systemPrompt: createDynamicRolePrompt({
|
|
93
|
+
role: roleAgent.role,
|
|
94
|
+
domain: "Engineering",
|
|
95
|
+
mission: roleAgent.mission,
|
|
96
|
+
responsibilities: roleAgent.responsibilities,
|
|
97
|
+
deliverables: roleAgent.deliverables,
|
|
98
|
+
}),
|
|
99
|
+
promptTemplateId: `repo-intel/${roleAgent.slug}`,
|
|
100
|
+
generatedFrom: "repo-intelligence",
|
|
101
|
+
runtimeHints: {
|
|
102
|
+
requiresRepoScan: true,
|
|
103
|
+
suggestedScanEndpoint: "/api/repositories/:id/scan",
|
|
104
|
+
suggestedPrEndpoint: "/api/repositories/:id/lyra-pr",
|
|
105
|
+
},
|
|
106
|
+
})),
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function buildGatedCatalog() {
|
|
111
|
+
return GATED_VERTICALS.map((vertical) => {
|
|
112
|
+
const hostedAgentId = `hosted-${vertical.id}-primary`;
|
|
113
|
+
return {
|
|
114
|
+
id: vertical.id,
|
|
115
|
+
label: vertical.label,
|
|
116
|
+
mode: "gated",
|
|
117
|
+
agents: [
|
|
118
|
+
{
|
|
119
|
+
id: hostedAgentId,
|
|
120
|
+
slug: hostedAgentId,
|
|
121
|
+
name: `${vertical.label} Hosted Agent`,
|
|
122
|
+
description: `Managed ${vertical.label} workflows powered by the Lyra hosted platform.`,
|
|
123
|
+
category: vertical.id,
|
|
124
|
+
icon: "Sparkles",
|
|
125
|
+
skills: ["lyra:hosted-invoke"],
|
|
126
|
+
systemPrompt: `You are the Lyra hosted ${vertical.label} agent. Coordinate and execute ${vertical.label} tasks by calling the managed Lyra API and return concise, actionable responses.`,
|
|
127
|
+
mode: "gated",
|
|
128
|
+
hosted: {
|
|
129
|
+
vertical: vertical.id,
|
|
130
|
+
defaultModel: vertical.defaultModel,
|
|
131
|
+
},
|
|
132
|
+
requiresIntegration: ["lyra-api-key"],
|
|
133
|
+
},
|
|
134
|
+
],
|
|
135
|
+
};
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export const STANDALONE_DOMAINS = [
|
|
140
|
+
...buildStandaloneCatalog(),
|
|
141
|
+
buildEngineeringBootstrapDomain(),
|
|
142
|
+
];
|
|
143
|
+
export const GATED_DOMAINS = buildGatedCatalog();
|
|
144
|
+
|
|
145
|
+
export function getDomainCatalog(mode) {
|
|
146
|
+
return mode === "gated" ? GATED_DOMAINS : STANDALONE_DOMAINS;
|
|
147
|
+
}
|