agent-lyra 0.6.1 → 0.6.3

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 +435 -395
  3. package/bin/agent-lyra.js +49 -44
  4. package/bin/lyra-oss-preview.js +16 -0
  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 -0
  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 -64
  25. package/src/app-builder/value-schema.js +37 -37
  26. package/src/catalog.js +147 -147
  27. package/src/coding/catalog.js +56 -0
  28. package/src/coding/cloud-catalog.js +64 -0
  29. package/src/coding/detect-stack.mjs +110 -0
  30. package/src/coding/export.js +130 -0
  31. package/src/coding/setup.js +175 -0
  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 -937
  70. package/src/memory/cli.js +21 -49
  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 -0
  76. package/src/memory/proposals.js +84 -84
  77. package/src/memory/skills-cli.js +26 -26
  78. package/src/memory/sync.js +89 -85
  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 -197
  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
@@ -0,0 +1,37 @@
1
+ ---
2
+ name: lyra-spark
3
+ description: "Implement Spark batch and streaming transformations with predictable correctness and resource use."
4
+ ---
5
+
6
+ # Apache Spark
7
+
8
+ ## Inspect the project
9
+
10
+ Check Spark version, execution mode, cluster runtime, source and sink formats, and job scheduling. Define schema, grain, and ownership at each boundary.
11
+
12
+ ## Implementation practices
13
+
14
+ - Use explicit schema and null handling. Prefer Spark SQL and built-in expressions where they preserve semantics and optimize well.
15
+ - Inspect joins, shuffle, skew, and partitions using an execution plan and metrics. Avoid collecting unbounded datasets to the driver.
16
+ - Choose output strategy deliberately. For reruns, define idempotency and handle partial outputs according to sink capabilities.
17
+
18
+ ## Guardrails and trade-offs
19
+
20
+ - For streaming, document event-time and watermark assumptions, checkpoint ownership, and behavior on restarts. Scope data access and protect sensitive data in samples and logs.
21
+ - Rehearse schema evolution and backfills on representative small data and review checkpoint or table compatibility before deployment.
22
+
23
+ ## Decisions to check
24
+
25
+ Record which upstream and downstream schemas are compatible with the change. Inspect partition counts, skew, and runtime evidence before tuning executor resources. Verify replay from checkpoints with isolated test input when changing streaming jobs.
26
+
27
+ ## Review scenario
28
+
29
+ For a join with skewed keys, check unmatched rows, duplicate keys, nulls, and partition skew before changing join strategy.
30
+
31
+ ## Verification
32
+
33
+ Run deterministic local tests with edge-case fixtures and inspect a representative execution plan. Verify output partitions, rerun behavior, and operational metrics.
34
+
35
+ ## Reference
36
+
37
+ - [Apache Spark documentation](https://spark.apache.org/docs/latest/)
@@ -0,0 +1,37 @@
1
+ ---
2
+ name: lyra-spring-boot
3
+ description: "Implement Spring Boot controllers, configuration, services, persistence, and tests."
4
+ ---
5
+
6
+ # Spring Boot
7
+
8
+ ## Inspect the project
9
+
10
+ Check the Java and Spring Boot versions, build tool, MVC or WebFlux stack, Security configuration, and existing test slices.
11
+
12
+ ## Implementation practices
13
+
14
+ - Use constructor injection and typed configuration. Keep controllers focused on validation and response mapping, and define transaction boundaries around service invariants.
15
+ - Reuse the application's request validation and error model. Enforce authorization for each operation and resource using the project's policy.
16
+ - Respect the execution model. Avoid blocking I/O on reactive execution paths, and set explicit downstream timeouts with bounded retries.
17
+
18
+ ## Guardrails and trade-offs
19
+
20
+ - Keep secrets outside source configuration and limit exposure of management endpoints. Include structured correlation fields without logging sensitive payloads.
21
+ - Check migration compatibility, query behavior, and configuration precedence when changing persistence or environment behavior.
22
+
23
+ ## Decisions to check
24
+
25
+ Keep public controller DTOs independent from persistence entities. Check whether interception applies when transaction or security annotations move to another method. Verify real database behavior when a test slice cannot reproduce isolation or constraints.
26
+
27
+ ## Review scenario
28
+
29
+ For a controller validation change, use an MVC or WebFlux test slice for request mapping and a service integration test for transaction behavior.
30
+
31
+ ## Verification
32
+
33
+ Run the Maven or Gradle wrapper and targeted tests. Verify application startup, configuration binding, and packaged behavior when deployment inputs change.
34
+
35
+ ## Reference
36
+
37
+ - [Spring Boot documentation](https://docs.spring.io/spring-boot/)
@@ -0,0 +1,37 @@
1
+ ---
2
+ name: lyra-svelte
3
+ description: "Implement Svelte component state, bindings, effects, and SSR-compatible UI."
4
+ ---
5
+
6
+ # Svelte
7
+
8
+ ## Inspect the project
9
+
10
+ Identify the Svelte version and whether the touched component uses runes or legacy syntax. Locate SvelteKit boundaries and check when code executes on the server.
11
+
12
+ ## Implementation practices
13
+
14
+ - Use the active reactivity model consistently. Keep derived data in derived state and reserve effects for synchronization that requires it.
15
+ - Place state with its owner. Guard browser-only APIs in SSR, clean up resource subscriptions, and avoid shared server state that can leak between requests.
16
+ - Use the framework's event and binding conventions for the installed version. Keep forms accessible with labels, error feedback, and keyboard support.
17
+
18
+ ## Guardrails and trade-offs
19
+
20
+ - Treat raw HTML as trusted only after approved sanitization. Keep private environment variables and access controls server-side.
21
+ - Review keyed list identity, navigation, and hydration when changing async data. Measure generated output before performance tuning.
22
+
23
+ ## Decisions to check
24
+
25
+ Use SvelteKit server-only modules, load functions, and form actions according to the version installed. Verify that serialized page data is appropriate for users to see. Keep optimistic UI updates reversible when server actions reject changes.
26
+
27
+ ## Review scenario
28
+
29
+ For a component with remote options, verify that changing the selected filter renders the latest response and that unmounting releases pending work.
30
+
31
+ ## Verification
32
+
33
+ Run the project's Svelte compiler checks and tests. Exercise interactive behavior and SSR hydration when applicable.
34
+
35
+ ## Reference
36
+
37
+ - [Svelte documentation](https://svelte.dev/docs/svelte/overview)
@@ -0,0 +1,37 @@
1
+ ---
2
+ name: lyra-terraform
3
+ description: "Review Terraform modules, provider versions, state, and infrastructure plans."
4
+ ---
5
+
6
+ # Terraform
7
+
8
+ ## Inspect the project
9
+
10
+ Read Terraform and provider constraints, lockfile, backend, state layout, and environment conventions. Confirm the intended workspace and target before planning.
11
+
12
+ ## Implementation practices
13
+
14
+ - Keep reusable module inputs typed and documented. Use stable instance keys and review address moves when refactoring existing resources.
15
+ - Preserve state compatibility and use the approved remote backend and locking. Avoid broad targeted operations as a normal workflow.
16
+ - Treat plans and state as sensitive artifacts. Limit provider credentials and keep raw state and plan files out of commits and casual logs.
17
+
18
+ ## Guardrails and trade-offs
19
+
20
+ - Inspect the plan for replacements, deletions, permission changes, and cost. Apply only under the project's established authority for the target environment.
21
+ - Plan dependency order, drift handling, and rollback for high-impact changes. Know which provider operations require recovery beyond reverting code.
22
+
23
+ ## Decisions to check
24
+
25
+ Separate plans for unrelated environments and verify the selected backend before reading or changing state. Review provider aliases and module propagation when operating across accounts. Treat a rollback as another reviewed plan when actual infrastructure has changed.
26
+
27
+ ## Review scenario
28
+
29
+ For a module rename, use reviewed address moves where appropriate and confirm the plan retains the existing resources rather than recreating them.
30
+
31
+ ## Verification
32
+
33
+ Run fmt and validate. Review a plan in the intended environment, record important resource changes, and verify outputs only after an authorized apply.
34
+
35
+ ## Reference
36
+
37
+ - [Terraform documentation](https://developer.hashicorp.com/terraform/language)
@@ -0,0 +1,37 @@
1
+ ---
2
+ name: lyra-typescript
3
+ description: "Maintain TypeScript contracts and type safety at module and runtime boundaries."
4
+ ---
5
+
6
+ # TypeScript
7
+
8
+ ## Inspect the project
9
+
10
+ Read the active tsconfig, project references, module resolution, and supported target. Identify which interfaces are public and which data originates outside the type system.
11
+
12
+ ## Implementation practices
13
+
14
+ - Represent unvalidated data as unknown and narrow it with runtime checks or the existing schema library. Use discriminated unions for distinct states and exhaustive checks for critical variants.
15
+ - Model absence deliberately. Preserve null, undefined, and omitted fields where callers distinguish them. Use generics where they retain relationships between inputs and outputs.
16
+ - Prefer local inference and descriptive types. Keep assertions narrow and justified. Avoid broad any, non-null assertions on external input, and disabling repository checks to satisfy the compiler.
17
+
18
+ ## Guardrails and trade-offs
19
+
20
+ - Validate network, storage, and environment values at their boundary. Confirm serialization, platform support, and module behavior separately from static type checking.
21
+ - Use type-only imports where appropriate. Review emitted declarations and preserve compatibility of public signatures and package exports.
22
+
23
+ ## Decisions to check
24
+
25
+ Use satisfies when checking an object against a contract while preserving its inferred shape. For public libraries, exercise consumer imports with the same module resolution modes you claim to support. Verify runtime merging or type erasure before treating a declaration change as behavior-preserving.
26
+
27
+ ## Review scenario
28
+
29
+ For API results, validate the response then represent loading, success, and failure as distinct states. Test what happens when the backend adds a field or omits a required one.
30
+
31
+ ## Verification
32
+
33
+ Run the project's type check and tests. Verify consumer compilation and package exports for public API changes, and exercise malformed runtime values through a real entry point.
34
+
35
+ ## Reference
36
+
37
+ - [TypeScript documentation](https://www.typescriptlang.org/docs/handbook/intro.html)
@@ -0,0 +1,37 @@
1
+ ---
2
+ name: lyra-vue
3
+ description: "Implement and review Vue components, composables, reactivity, and accessible UI."
4
+ ---
5
+
6
+ # Vue
7
+
8
+ ## Inspect the project
9
+
10
+ Check the Vue major version, Options or Composition API convention, router, state library, and SSR mode. Trace the currently owned state and emitted events.
11
+
12
+ ## Implementation practices
13
+
14
+ - Use computed values for derived data and watchers for side effects. Declare props and emits, keep props immutable, and use stable list keys.
15
+ - Keep composables focused and clean up subscriptions and obsolete requests. Preserve reactivity when destructuring according to the installed version and API.
16
+ - Use accessible names and semantic controls. Cover keyboard, focus, and state transitions in component tests.
17
+
18
+ ## Guardrails and trade-offs
19
+
20
+ - Treat HTML passed to v-html as a privileged output. Keep sensitive data and permission enforcement on the server. Validate inputs at the service boundary.
21
+ - Measure rendering and bundle costs before optimizing. Keep shared state scoped to the features that own it.
22
+
23
+ ## Decisions to check
24
+
25
+ Scope watchers to the values that affect work and clean them up on invalidation where applicable. For SSR, keep mutable stores scoped to the request. Test emitted contracts directly when a parent integrates with a reusable component.
26
+
27
+ ## Review scenario
28
+
29
+ For a filter panel, assert the emitted change and rendered result after a prop update, including pending and empty states.
30
+
31
+ ## Verification
32
+
33
+ Run the project's lint, type check, and component tests. Verify hydration for SSR and route transitions when changing shared UI.
34
+
35
+ ## Reference
36
+
37
+ - [Vue documentation](https://vuejs.org/guide/best-practices/performance.html)
@@ -1,56 +1,56 @@
1
- export const LYRA_VERTICALS = [
2
- "hr",
3
- "sales",
4
- "support",
5
- "finance",
6
- "coding",
7
- "legal",
8
- "news",
9
- "markets",
10
- ];
11
-
12
- const DEFAULT_BASE_URL = "https://api.lyra.ai/v1";
13
-
14
- export class HostedAgentClient {
15
- constructor({ apiKey, baseUrl = DEFAULT_BASE_URL, fetchImpl = fetch } = {}) {
16
- if (!apiKey || typeof apiKey !== "string") {
17
- throw new Error("A Lyra API key is required for gated features.");
18
- }
19
- if (typeof fetchImpl !== "function") {
20
- throw new Error("fetchImpl must be a function.");
21
- }
22
-
23
- this.apiKey = apiKey;
24
- this.baseUrl = baseUrl;
25
- this.fetchImpl = fetchImpl;
26
- }
27
-
28
- listVerticals() {
29
- return [...LYRA_VERTICALS];
30
- }
31
-
32
- async invoke(vertical, payload = {}) {
33
- if (!LYRA_VERTICALS.includes(vertical)) {
34
- throw new Error(`Unsupported vertical: ${vertical}`);
35
- }
36
-
37
- const response = await this.fetchImpl(`${this.baseUrl}/agents/${vertical}/invoke`, {
38
- method: "POST",
39
- headers: {
40
- "Content-Type": "application/json",
41
- Authorization: `Bearer ${this.apiKey}`,
42
- },
43
- body: JSON.stringify(payload),
44
- });
45
-
46
- if (!response.ok) {
47
- throw new Error(`Lyra API request failed with status ${response.status}.`);
48
- }
49
-
50
- return response.json();
51
- }
52
- }
53
-
54
- export function createHostedAgentClient(options) {
55
- return new HostedAgentClient(options);
56
- }
1
+ export const LYRA_VERTICALS = [
2
+ "hr",
3
+ "sales",
4
+ "support",
5
+ "finance",
6
+ "coding",
7
+ "legal",
8
+ "news",
9
+ "markets",
10
+ ];
11
+
12
+ const DEFAULT_BASE_URL = "https://api.lyra.ai/v1";
13
+
14
+ export class HostedAgentClient {
15
+ constructor({ apiKey, baseUrl = DEFAULT_BASE_URL, fetchImpl = fetch } = {}) {
16
+ if (!apiKey || typeof apiKey !== "string") {
17
+ throw new Error("A Lyra API key is required for gated features.");
18
+ }
19
+ if (typeof fetchImpl !== "function") {
20
+ throw new Error("fetchImpl must be a function.");
21
+ }
22
+
23
+ this.apiKey = apiKey;
24
+ this.baseUrl = baseUrl;
25
+ this.fetchImpl = fetchImpl;
26
+ }
27
+
28
+ listVerticals() {
29
+ return [...LYRA_VERTICALS];
30
+ }
31
+
32
+ async invoke(vertical, payload = {}) {
33
+ if (!LYRA_VERTICALS.includes(vertical)) {
34
+ throw new Error(`Unsupported vertical: ${vertical}`);
35
+ }
36
+
37
+ const response = await this.fetchImpl(`${this.baseUrl}/agents/${vertical}/invoke`, {
38
+ method: "POST",
39
+ headers: {
40
+ "Content-Type": "application/json",
41
+ Authorization: `Bearer ${this.apiKey}`,
42
+ },
43
+ body: JSON.stringify(payload),
44
+ });
45
+
46
+ if (!response.ok) {
47
+ throw new Error(`Lyra API request failed with status ${response.status}.`);
48
+ }
49
+
50
+ return response.json();
51
+ }
52
+ }
53
+
54
+ export function createHostedAgentClient(options) {
55
+ return new HostedAgentClient(options);
56
+ }
@@ -1,25 +1,25 @@
1
- export type LyraVertical = "hr" | "sales" | "support" | "finance" | "coding" | "legal" | "news" | "markets";
2
- export const LYRA_VERTICALS: LyraVertical[];
3
-
4
- export type HostedFetch = (url: string, options: {
5
- method: string;
6
- headers: Record<string, string>;
7
- body: string;
8
- }) => Promise<{ ok: boolean; status: number; json(): Promise<unknown> }>;
9
-
10
- export interface HostedAgentOptions {
11
- apiKey: string;
12
- baseUrl?: string;
13
- fetchImpl?: HostedFetch;
14
- }
15
-
16
- export class HostedAgentClient {
17
- constructor(options: HostedAgentOptions);
18
- apiKey: string;
19
- baseUrl: string;
20
- fetchImpl: HostedFetch;
21
- listVerticals(): LyraVertical[];
22
- invoke(vertical: LyraVertical, payload?: Record<string, unknown>): Promise<unknown>;
23
- }
24
-
25
- export function createHostedAgentClient(options: HostedAgentOptions): HostedAgentClient;
1
+ export type LyraVertical = "hr" | "sales" | "support" | "finance" | "coding" | "legal" | "news" | "markets";
2
+ export const LYRA_VERTICALS: LyraVertical[];
3
+
4
+ export type HostedFetch = (url: string, options: {
5
+ method: string;
6
+ headers: Record<string, string>;
7
+ body: string;
8
+ }) => Promise<{ ok: boolean; status: number; json(): Promise<unknown> }>;
9
+
10
+ export interface HostedAgentOptions {
11
+ apiKey: string;
12
+ baseUrl?: string;
13
+ fetchImpl?: HostedFetch;
14
+ }
15
+
16
+ export class HostedAgentClient {
17
+ constructor(options: HostedAgentOptions);
18
+ apiKey: string;
19
+ baseUrl: string;
20
+ fetchImpl: HostedFetch;
21
+ listVerticals(): LyraVertical[];
22
+ invoke(vertical: LyraVertical, payload?: Record<string, unknown>): Promise<unknown>;
23
+ }
24
+
25
+ export function createHostedAgentClient(options: HostedAgentOptions): HostedAgentClient;
@@ -1,5 +1,5 @@
1
- export {
2
- LYRA_VERTICALS,
3
- createHostedAgentClient,
4
- HostedAgentClient,
5
- } from "./hostedAgents.js";
1
+ export {
2
+ LYRA_VERTICALS,
3
+ createHostedAgentClient,
4
+ HostedAgentClient,
5
+ } from "./hostedAgents.js";
package/src/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export * as standalone from "./standalone/index.js";
2
- export * as gated from "./gated/index.js";
1
+ export * as standalone from "./standalone/index.js";
2
+ export * as gated from "./gated/index.js";
package/src/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export * as standalone from "./standalone/index.js";
2
- export * as gated from "./gated/index.js";
1
+ export * as standalone from "./standalone/index.js";
2
+ export * as gated from "./gated/index.js";