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.
Files changed (108) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +235 -435
  3. package/bin/agent-lyra.js +49 -49
  4. package/bin/lyra-oss-preview.js +16 -14
  5. package/package.json +60 -60
  6. package/src/app-builder/export.js +109 -109
  7. package/src/app-builder/gateway.js +62 -62
  8. package/src/app-builder/init.js +52 -52
  9. package/src/app-builder/manifest-contract.js +46 -46
  10. package/src/app-builder/native-adapter.js +29 -29
  11. package/src/app-builder/preview.js +22 -22
  12. package/src/app-builder/publish.js +14 -14
  13. package/src/app-builder/saved-app.js +70 -70
  14. package/src/app-builder/saved-preview-browser.js +33 -33
  15. package/src/app-builder/saved-preview.html +24 -24
  16. package/src/app-builder/saved-preview.js +61 -61
  17. package/src/app-builder/support-manifest.js +50 -50
  18. package/src/app-builder/support-template/manifest.json +55 -55
  19. package/src/app-builder/support-template/support-preview.html +56 -56
  20. package/src/app-builder/support-template/support-preview.js +37 -37
  21. package/src/app-builder/support-template/support-preview.mjs +67 -67
  22. package/src/app-builder/support-template/support-workflow.mjs +36 -36
  23. package/src/app-builder/use.js +37 -37
  24. package/src/app-builder/validate.js +21 -21
  25. package/src/app-builder/value-schema.js +37 -37
  26. package/src/catalog.js +147 -147
  27. package/src/coding/catalog.js +56 -56
  28. package/src/coding/cloud-catalog.js +64 -44
  29. package/src/coding/detect-stack.mjs +110 -110
  30. package/src/coding/export.js +130 -130
  31. package/src/coding/setup.js +175 -174
  32. package/src/coding/skills/lyra-android/SKILL.md +37 -0
  33. package/src/coding/skills/lyra-angular/SKILL.md +37 -0
  34. package/src/coding/skills/lyra-cucumber/SKILL.md +37 -0
  35. package/src/coding/skills/lyra-dbt/SKILL.md +37 -0
  36. package/src/coding/skills/lyra-django/SKILL.md +37 -0
  37. package/src/coding/skills/lyra-docker/SKILL.md +37 -0
  38. package/src/coding/skills/lyra-dotnet/SKILL.md +37 -0
  39. package/src/coding/skills/lyra-express/SKILL.md +37 -0
  40. package/src/coding/skills/lyra-fastapi/SKILL.md +37 -0
  41. package/src/coding/skills/lyra-flutter/SKILL.md +37 -0
  42. package/src/coding/skills/lyra-github-actions/SKILL.md +37 -0
  43. package/src/coding/skills/lyra-gitlab-ci/SKILL.md +37 -0
  44. package/src/coding/skills/lyra-go/SKILL.md +37 -0
  45. package/src/coding/skills/lyra-ios/SKILL.md +37 -0
  46. package/src/coding/skills/lyra-kubernetes/SKILL.md +37 -0
  47. package/src/coding/skills/lyra-mongodb/SKILL.md +37 -0
  48. package/src/coding/skills/lyra-mysql/SKILL.md +37 -0
  49. package/src/coding/skills/lyra-nextjs/SKILL.md +37 -0
  50. package/src/coding/skills/lyra-node/SKILL.md +37 -0
  51. package/src/coding/skills/lyra-playwright/SKILL.md +37 -0
  52. package/src/coding/skills/lyra-postgresql/SKILL.md +37 -0
  53. package/src/coding/skills/lyra-python/SKILL.md +37 -0
  54. package/src/coding/skills/lyra-react/SKILL.md +37 -0
  55. package/src/coding/skills/lyra-react-native/SKILL.md +37 -0
  56. package/src/coding/skills/lyra-redis/SKILL.md +37 -0
  57. package/src/coding/skills/lyra-rust/SKILL.md +37 -0
  58. package/src/coding/skills/lyra-spark/SKILL.md +37 -0
  59. package/src/coding/skills/lyra-spring-boot/SKILL.md +37 -0
  60. package/src/coding/skills/lyra-svelte/SKILL.md +37 -0
  61. package/src/coding/skills/lyra-terraform/SKILL.md +37 -0
  62. package/src/coding/skills/lyra-typescript/SKILL.md +37 -0
  63. package/src/coding/skills/lyra-vue/SKILL.md +37 -0
  64. package/src/gated/hostedAgents.js +56 -56
  65. package/src/gated/index.d.ts +25 -25
  66. package/src/gated/index.js +5 -5
  67. package/src/index.d.ts +2 -2
  68. package/src/index.js +2 -2
  69. package/src/init.js +965 -965
  70. package/src/memory/cli.js +21 -21
  71. package/src/memory/contract.json +28 -28
  72. package/src/memory/index.d.ts +49 -49
  73. package/src/memory/index.js +259 -259
  74. package/src/memory/lifecycle.js +29 -29
  75. package/src/memory/local-cli.js +34 -34
  76. package/src/memory/proposals.js +84 -84
  77. package/src/memory/skills-cli.js +26 -26
  78. package/src/memory/sync.js +89 -89
  79. package/src/memory/validation.js +25 -25
  80. package/src/onboardingAgents.js +532 -532
  81. package/src/promptTemplates.js +178 -178
  82. package/src/runtime/contracts.d.ts +47 -47
  83. package/src/runtime/local-cli.js +160 -160
  84. package/src/runtime/mcp-stdio.js +111 -111
  85. package/src/runtime/orchestration.js +59 -59
  86. package/src/runtime/run-agent.js +43 -43
  87. package/src/standalone/index.d.ts +45 -45
  88. package/src/standalone/index.js +13 -13
  89. package/src/standalone/init.js +12 -0
  90. package/src/standalone/orchestration.js +6 -6
  91. package/src/standalone/rag.js +113 -113
  92. package/src/studio/agent-ui.css +43 -43
  93. package/src/studio/agent-ui.js +32 -32
  94. package/src/studio/browser.js +331 -331
  95. package/src/studio/export.js +80 -80
  96. package/src/studio/index.html +37 -37
  97. package/src/studio/memory-actions.js +37 -37
  98. package/src/studio/memory-panel.js +200 -200
  99. package/src/studio/project.js +216 -216
  100. package/src/studio/pull-agent.js +72 -72
  101. package/src/studio/push.js +54 -54
  102. package/src/studio/python-agent.js +47 -47
  103. package/src/studio/python-agent.py +25 -25
  104. package/src/studio/server.js +143 -143
  105. package/src/studio/session.js +83 -83
  106. package/src/studio/studio.css +10 -10
  107. package/src/studio/sync.js +42 -42
  108. package/src/studio/workflow-sync.js +157 -157
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
+ }
@@ -1,56 +1,56 @@
1
- export const catalogVersion = 2;
2
-
3
- // Each technology contributes an actionable skill. Roles are reused across packs.
4
- export const areas = {
5
- frontend: "Frontend developer",
6
- backend: "Backend developer",
7
- database: "Database developer",
8
- devops: "DevOps engineer",
9
- qa: "QA automation engineer",
10
- mobile: "Mobile developer",
11
- data: "Data engineer",
12
- };
13
-
14
- export const technologies = {
15
- react: ["frontend", "React", "Component behavior", "Check loading, error, and success states. Test the visible behavior with accessible queries and keep state close to the components that own it."],
16
- nextjs: ["frontend", "Next.js", "Rendering and routing", "Identify the router and rendering boundary first. Keep server-only data on the server and test navigation, loading, and error states."],
17
- typescript: ["frontend", "TypeScript", "Type-safe changes", "Read tsconfig for the project. Narrow unknown input at boundaries, preserve public types, and run the repository type check."],
18
- node: ["backend", "Node.js", "Runtime compatibility", "Check the supported Node versions and module format. Handle async errors, close resources, and run the applicable package scripts."],
19
- express: ["backend", "Express", "Request validation", "Validate request data at the route boundary, reuse existing middleware, and test status codes for missing, invalid, and valid input."],
20
- python: ["backend", "Python", "Package and test changes", "Read pyproject.toml and supported Python versions. Use existing project tooling and test behavior through its public entry points."],
21
- fastapi: ["backend", "FastAPI", "API contracts", "Use request and response models consistent with the project. Test validation, dependency overrides, and error responses with the app test client."],
22
- mongodb: ["database", "MongoDB", "Document modeling", "Model against actual query patterns. Review indexes, existing document shapes, and migration compatibility with synthetic data."],
23
- postgresql: ["database", "PostgreSQL", "Schema migrations", "Review data volume and lock implications. Test forward migrations against realistic fixtures and document application compatibility."],
24
- docker: ["devops", "Docker", "Container builds", "Check build context and ignore rules. Keep secrets outside image layers and verify the start command and health endpoint locally."],
25
- "github-actions": ["devops", "GitHub Actions", "CI workflows", "Review job triggers, permissions, and test artifacts. Reuse repository scripts and keep credentials in repository or environment secrets."],
26
- "gitlab-ci": ["devops", "GitLab CI", "CI pipelines", "Review job rules, needs, and artifacts. Reuse project test commands and validate changes on a test branch."],
27
- playwright: ["qa", "Playwright", "Browser automation", "Use role-based locators and web-first assertions. Isolate test data with fixtures, retain traces on failures, and diagnose flaky tests without adding fixed sleeps."],
28
- vue: ["frontend", "Vue", "Reactive UI", "Check the Vue version and routing conventions. Test emitted events, user-visible states, and composable cleanup."],
29
- angular: ["frontend", "Angular", "Component and service integration", "Follow the project's standalone or module pattern. Verify DI boundaries, form validation, and loading and error states."],
30
- svelte: ["frontend", "Svelte", "Component state", "Use the project's Svelte version and reactive primitives. Cover interaction, SSR boundaries where relevant, and state reset."],
31
- django: ["backend", "Django", "Model and view changes", "Review model validation, permissions, and migration dependencies. Exercise the relevant views through the test client."],
32
- "spring-boot": ["backend", "Spring Boot", "Service and controller changes", "Follow existing configuration and dependency injection conventions. Test validation and error mapping using the project's test slices."],
33
- dotnet: ["backend", ".NET", "Application and API changes", "Check target frameworks and hosting conventions. Test middleware, dependency injection, and public endpoint behavior."],
34
- go: ["backend", "Go", "Service changes", "Use the module version and existing package boundaries. Propagate context and errors, and use table-driven tests for edge cases."],
35
- rust: ["backend", "Rust", "Crate changes", "Check workspace features and the minimum supported Rust version. Preserve API error contracts and test meaningful feature combinations."],
36
- mysql: ["database", "MySQL", "Schema and query changes", "Check server version and SQL mode. Validate migration locks, indexes, and query plans against synthetic data."],
37
- redis: ["database", "Redis", "Cache behavior", "Define key scope and expiration. Cover cache misses, stale values, and recovery when Redis is unavailable."],
38
- kubernetes: ["devops", "Kubernetes", "Deployment configuration", "Validate manifests against supported versions. Review probes, resource requests, and rollout behavior in a test namespace."],
39
- terraform: ["devops", "Terraform", "Infrastructure review", "Inspect configuration and state boundaries. Review a plan in the intended environment before any apply."],
40
- "react-native": ["mobile", "React Native", "Cross-platform screens", "Verify behavior on both supported platforms. Check accessibility, permission handling, and loading or offline states."],
41
- flutter: ["mobile", "Flutter", "Widgets and navigation", "Follow project state and navigation conventions. Cover key behavior with widget tests and verify platform integrations separately."],
42
- android: ["mobile", "Android", "Platform behavior", "Check lifecycle and target SDK constraints. Use local and instrumented tests as appropriate for storage, permissions, and navigation."],
43
- ios: ["mobile", "iOS", "Platform behavior", "Check supported OS versions and project structure. Verify main-thread UI behavior, accessibility, and permission states."],
44
- dbt: ["data", "dbt", "Data model tests", "Trace model dependencies, review incremental behavior, and test uniqueness, nullability, and source freshness with suitable data."],
45
- spark: ["data", "Apache Spark", "Pipeline changes", "Review schema evolution, joins, partitioning, and null semantics. Test with a small deterministic dataset before larger workloads."],
46
- cucumber: ["qa", "Cucumber", "Acceptance scenarios", "Write Gherkin scenarios around observable behavior. Reuse parameterized steps, keep state scoped to each scenario, and review undefined or ambiguous steps."],
47
- };
48
-
49
- export const presets = {
50
- mern: ["mongodb", "express", "react", "node"],
51
- "python-fastapi": ["python", "fastapi"],
52
- "playwright-cucumber": ["playwright", "cucumber"],
53
- "spring-postgres": ["spring-boot", "postgresql"],
54
- "react-native-mobile": ["react-native", "typescript"],
55
- "spark-dbt": ["spark", "dbt"],
56
- };
1
+ export const catalogVersion = 3;
2
+
3
+ // Each technology contributes an actionable skill. Roles are reused across packs.
4
+ export const areas = {
5
+ frontend: "Frontend developer",
6
+ backend: "Backend developer",
7
+ database: "Database developer",
8
+ devops: "DevOps engineer",
9
+ qa: "QA automation engineer",
10
+ mobile: "Mobile developer",
11
+ data: "Data engineer",
12
+ };
13
+
14
+ export const technologies = {
15
+ react: ["frontend", "React", "Component behavior", "Check loading, error, and success states. Test the visible behavior with accessible queries and keep state close to the components that own it."],
16
+ nextjs: ["frontend", "Next.js", "Rendering and routing", "Identify the router and rendering boundary first. Keep server-only data on the server and test navigation, loading, and error states."],
17
+ typescript: ["frontend", "TypeScript", "Type-safe changes", "Read tsconfig for the project. Narrow unknown input at boundaries, preserve public types, and run the repository type check."],
18
+ node: ["backend", "Node.js", "Runtime compatibility", "Check the supported Node versions and module format. Handle async errors, close resources, and run the applicable package scripts."],
19
+ express: ["backend", "Express", "Request validation", "Validate request data at the route boundary, reuse existing middleware, and test status codes for missing, invalid, and valid input."],
20
+ python: ["backend", "Python", "Package and test changes", "Read pyproject.toml and supported Python versions. Use existing project tooling and test behavior through its public entry points."],
21
+ fastapi: ["backend", "FastAPI", "API contracts", "Use request and response models consistent with the project. Test validation, dependency overrides, and error responses with the app test client."],
22
+ mongodb: ["database", "MongoDB", "Document modeling", "Model against actual query patterns. Review indexes, existing document shapes, and migration compatibility with synthetic data."],
23
+ postgresql: ["database", "PostgreSQL", "Schema migrations", "Review data volume and lock implications. Test forward migrations against realistic fixtures and document application compatibility."],
24
+ docker: ["devops", "Docker", "Container builds", "Check build context and ignore rules. Keep secrets outside image layers and verify the start command and health endpoint locally."],
25
+ "github-actions": ["devops", "GitHub Actions", "CI workflows", "Review job triggers, permissions, and test artifacts. Reuse repository scripts and keep credentials in repository or environment secrets."],
26
+ "gitlab-ci": ["devops", "GitLab CI", "CI pipelines", "Review job rules, needs, and artifacts. Reuse project test commands and validate changes on a test branch."],
27
+ playwright: ["qa", "Playwright", "Browser automation", "Use role-based locators and web-first assertions. Isolate test data with fixtures, retain traces on failures, and diagnose flaky tests without adding fixed sleeps."],
28
+ vue: ["frontend", "Vue", "Reactive UI", "Check the Vue version and routing conventions. Test emitted events, user-visible states, and composable cleanup."],
29
+ angular: ["frontend", "Angular", "Component and service integration", "Follow the project's standalone or module pattern. Verify DI boundaries, form validation, and loading and error states."],
30
+ svelte: ["frontend", "Svelte", "Component state", "Use the project's Svelte version and reactive primitives. Cover interaction, SSR boundaries where relevant, and state reset."],
31
+ django: ["backend", "Django", "Model and view changes", "Review model validation, permissions, and migration dependencies. Exercise the relevant views through the test client."],
32
+ "spring-boot": ["backend", "Spring Boot", "Service and controller changes", "Follow existing configuration and dependency injection conventions. Test validation and error mapping using the project's test slices."],
33
+ dotnet: ["backend", ".NET", "Application and API changes", "Check target frameworks and hosting conventions. Test middleware, dependency injection, and public endpoint behavior."],
34
+ go: ["backend", "Go", "Service changes", "Use the module version and existing package boundaries. Propagate context and errors, and use table-driven tests for edge cases."],
35
+ rust: ["backend", "Rust", "Crate changes", "Check workspace features and the minimum supported Rust version. Preserve API error contracts and test meaningful feature combinations."],
36
+ mysql: ["database", "MySQL", "Schema and query changes", "Check server version and SQL mode. Validate migration locks, indexes, and query plans against synthetic data."],
37
+ redis: ["database", "Redis", "Cache behavior", "Define key scope and expiration. Cover cache misses, stale values, and recovery when Redis is unavailable."],
38
+ kubernetes: ["devops", "Kubernetes", "Deployment configuration", "Validate manifests against supported versions. Review probes, resource requests, and rollout behavior in a test namespace."],
39
+ terraform: ["devops", "Terraform", "Infrastructure review", "Inspect configuration and state boundaries. Review a plan in the intended environment before any apply."],
40
+ "react-native": ["mobile", "React Native", "Cross-platform screens", "Verify behavior on both supported platforms. Check accessibility, permission handling, and loading or offline states."],
41
+ flutter: ["mobile", "Flutter", "Widgets and navigation", "Follow project state and navigation conventions. Cover key behavior with widget tests and verify platform integrations separately."],
42
+ android: ["mobile", "Android", "Platform behavior", "Check lifecycle and target SDK constraints. Use local and instrumented tests as appropriate for storage, permissions, and navigation."],
43
+ ios: ["mobile", "iOS", "Platform behavior", "Check supported OS versions and project structure. Verify main-thread UI behavior, accessibility, and permission states."],
44
+ dbt: ["data", "dbt", "Data model tests", "Trace model dependencies, review incremental behavior, and test uniqueness, nullability, and source freshness with suitable data."],
45
+ spark: ["data", "Apache Spark", "Pipeline changes", "Review schema evolution, joins, partitioning, and null semantics. Test with a small deterministic dataset before larger workloads."],
46
+ cucumber: ["qa", "Cucumber", "Acceptance scenarios", "Write Gherkin scenarios around observable behavior. Reuse parameterized steps, keep state scoped to each scenario, and review undefined or ambiguous steps."],
47
+ };
48
+
49
+ export const presets = {
50
+ mern: ["mongodb", "express", "react", "node"],
51
+ "python-fastapi": ["python", "fastapi"],
52
+ "playwright-cucumber": ["playwright", "cucumber"],
53
+ "spring-postgres": ["spring-boot", "postgresql"],
54
+ "react-native-mobile": ["react-native", "typescript"],
55
+ "spark-dbt": ["spark", "dbt"],
56
+ };
@@ -1,44 +1,64 @@
1
- import { areas, catalogVersion, presets, technologies } from "./catalog.js";
2
-
3
- export const bundledCatalog = { version: catalogVersion, technologies, presets };
4
-
5
- export async function fetchCodingCatalog(version, fetchRequest = fetch) {
6
- if (!/^[1-9][0-9]{0,5}$/.test(version)) throw new Error("Use a numeric Cloud catalog version.");
7
- const response = await fetchRequest("https://api.agentlyra.in/api/coding-catalog/" + version, {
8
- redirect: "error", signal: AbortSignal.timeout(5000),
9
- });
10
- if (!response.ok) throw new Error("Cloud coding catalog version " + version + " is unavailable. Omit --catalog-version to use bundled packs.");
11
- const reader = response.body.getReader();
12
- const chunks = [];
13
- let total = 0;
14
- while (true) {
15
- const { done, value } = await reader.read();
16
- if (done) break;
17
- total += value.byteLength;
18
- if (total > 262_144) {
19
- await reader.cancel();
20
- throw new Error("Cloud coding catalog exceeds the size limit.");
21
- }
22
- chunks.push(Buffer.from(value));
23
- }
24
- return validateCodingCatalog(JSON.parse(Buffer.concat(chunks).toString("utf8")), Number(version));
25
- }
26
-
27
- export function validateCodingCatalog(catalog, version = catalog?.version) {
28
- if (!Number.isSafeInteger(version) || version < 1 || version > 999_999) throw new Error("Invalid Cloud catalog version.");
29
- const slug = /^[a-z0-9][a-z0-9-]{0,31}$/;
30
- const plain = object => object !== null && typeof object === "object" && !Array.isArray(object);
31
- const validText = (value, max) => typeof value === "string" && value.trim() && value.length <= max &&
32
- !/[\u0000-\u001f\u007f]/.test(value);
33
- if (catalog?.version !== version || !plain(catalog.technologies) || !plain(catalog.presets)) throw new Error("Invalid Cloud catalog.");
34
- const items = Object.entries(catalog.technologies);
35
- const bundles = Object.entries(catalog.presets);
36
- if (!items.length || items.length > 150 || bundles.length > 100 ||
37
- items.some(([id, pack]) => !slug.test(id) || !Array.isArray(pack) || pack.length !== 4 ||
38
- !Object.hasOwn(areas, pack[0]) || !validText(pack[1], 80) || !validText(pack[2], 120) || !validText(pack[3], 2000)) ||
39
- bundles.some(([id, ids]) => !slug.test(id) || !Array.isArray(ids) || !ids.length || ids.length > 30 ||
40
- ids.some(item => typeof item !== "string" || !Object.hasOwn(catalog.technologies, item)))) {
41
- throw new Error("Invalid Cloud catalog.");
42
- }
43
- return { version: catalog.version, technologies: catalog.technologies, presets: catalog.presets };
44
- }
1
+ import { readFile } from "node:fs/promises";
2
+ import { areas, catalogVersion, presets, technologies } from "./catalog.js";
3
+
4
+ let bundledCatalog;
5
+
6
+ export function getBundledCatalog() {
7
+ bundledCatalog ??= Promise.all(Object.keys(technologies).map(async id => [
8
+ id, (await readFile(new URL("./skills/lyra-" + id + "/SKILL.md", import.meta.url), "utf8")).replace(/\r\n/g, "\n"),
9
+ ])).then(entries => validateCodingCatalog({
10
+ version: catalogVersion, technologies, presets, skills: Object.fromEntries(entries),
11
+ }));
12
+ return bundledCatalog;
13
+ }
14
+
15
+ export async function fetchCodingCatalog(version, fetchRequest = fetch) {
16
+ if (!/^[1-9][0-9]{0,5}$/.test(version)) throw new Error("Use a numeric Cloud catalog version.");
17
+ const response = await fetchRequest("https://api.agentlyra.in/api/coding-catalog/" + version, {
18
+ redirect: "error", signal: AbortSignal.timeout(5000),
19
+ });
20
+ if (!response.ok) throw new Error("Cloud coding catalog version " + version + " is unavailable. Omit --catalog-version to use bundled packs.");
21
+ const reader = response.body.getReader();
22
+ const chunks = [];
23
+ let total = 0;
24
+ while (true) {
25
+ const { done, value } = await reader.read();
26
+ if (done) break;
27
+ total += value.byteLength;
28
+ if (total > 262_144) {
29
+ await reader.cancel();
30
+ throw new Error("Cloud coding catalog exceeds the size limit.");
31
+ }
32
+ chunks.push(Buffer.from(value));
33
+ }
34
+ return validateCodingCatalog(JSON.parse(Buffer.concat(chunks).toString("utf8")), Number(version));
35
+ }
36
+
37
+ export function validateCodingCatalog(catalog, version = catalog?.version) {
38
+ if (!Number.isSafeInteger(version) || version < 1 || version > 999_999) throw new Error("Invalid Cloud catalog version.");
39
+ const slug = /^[a-z0-9][a-z0-9-]{0,31}$/;
40
+ const plain = object => object !== null && typeof object === "object" && !Array.isArray(object);
41
+ const validText = (value, max) => typeof value === "string" && value.trim() && value.length <= max &&
42
+ !/[\u0000-\u001f\u007f]/.test(value);
43
+ if (catalog?.version !== version || !plain(catalog.technologies) || !plain(catalog.presets)) throw new Error("Invalid Cloud catalog.");
44
+ const items = Object.entries(catalog.technologies);
45
+ const bundles = Object.entries(catalog.presets);
46
+ if (!items.length || items.length > 150 || bundles.length > 100 ||
47
+ items.some(([id, pack]) => !slug.test(id) || !Array.isArray(pack) || pack.length !== 4 ||
48
+ !Object.hasOwn(areas, pack[0]) || !validText(pack[1], 80) || !validText(pack[2], 120) || !validText(pack[3], 2000)) ||
49
+ bundles.some(([id, ids]) => !slug.test(id) || !Array.isArray(ids) || !ids.length || ids.length > 30 ||
50
+ ids.some(item => typeof item !== "string" || !Object.hasOwn(catalog.technologies, item)))) {
51
+ throw new Error("Invalid Cloud catalog.");
52
+ }
53
+ const { skills } = catalog;
54
+ if ((version >= 3 || skills !== undefined) && (!plain(skills) ||
55
+ Object.keys(skills).length !== items.length || items.some(([id]) => {
56
+ if (!Object.hasOwn(skills, id)) return true;
57
+ const skill = skills[id];
58
+ const header = "---\nname: lyra-" + id + "\ndescription: ";
59
+ return typeof skill !== "string" || skill.length > 16_000 || !skill.startsWith(header) ||
60
+ !skill.includes("\n---\n", header.length) || /[\u0000-\u0008\u000b-\u001f\u007f]/.test(skill);
61
+ }))) throw new Error("Cloud catalog is missing valid technology skill guides.");
62
+ return { version: catalog.version, technologies: catalog.technologies, presets: catalog.presets,
63
+ ...(skills ? { skills } : {}) };
64
+ }