@lensagent/core 0.1.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.
Files changed (104) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +48 -0
  3. package/config/lens.example.jsonc +92 -0
  4. package/config/pair.example.json +3 -0
  5. package/dist/adapters/executor.d.ts +35 -0
  6. package/dist/adapters/executor.js +296 -0
  7. package/dist/adapters/lsp.d.ts +18 -0
  8. package/dist/adapters/lsp.js +218 -0
  9. package/dist/adapters/mcp.d.ts +32 -0
  10. package/dist/adapters/mcp.js +283 -0
  11. package/dist/adapters/revert.d.ts +12 -0
  12. package/dist/adapters/revert.js +155 -0
  13. package/dist/config/runtime.d.ts +55 -0
  14. package/dist/config/runtime.js +371 -0
  15. package/dist/config/schema.d.ts +292 -0
  16. package/dist/config/schema.js +177 -0
  17. package/dist/contracts/adapter.d.ts +28 -0
  18. package/dist/contracts/adapter.js +8 -0
  19. package/dist/contracts/capability.d.ts +41 -0
  20. package/dist/contracts/capability.js +1 -0
  21. package/dist/contracts/domain.d.ts +61 -0
  22. package/dist/contracts/domain.js +1 -0
  23. package/dist/contracts/index.d.ts +5 -0
  24. package/dist/contracts/index.js +5 -0
  25. package/dist/contracts/model.d.ts +77 -0
  26. package/dist/contracts/model.js +1 -0
  27. package/dist/contracts/ports.d.ts +14 -0
  28. package/dist/contracts/ports.js +14 -0
  29. package/dist/core/access.d.ts +24 -0
  30. package/dist/core/access.js +205 -0
  31. package/dist/core/codec.d.ts +33 -0
  32. package/dist/core/codec.js +105 -0
  33. package/dist/core/domain.d.ts +13 -0
  34. package/dist/core/domain.js +24 -0
  35. package/dist/core/host.d.ts +19 -0
  36. package/dist/core/host.js +249 -0
  37. package/dist/core/identity.d.ts +19 -0
  38. package/dist/core/identity.js +54 -0
  39. package/dist/entry/bun.d.ts +1 -0
  40. package/dist/entry/bun.js +2 -0
  41. package/dist/entry/node.d.ts +2 -0
  42. package/dist/entry/node.js +3 -0
  43. package/dist/entry/rebuild.d.ts +1 -0
  44. package/dist/entry/rebuild.js +47 -0
  45. package/dist/entry/run.d.ts +1 -0
  46. package/dist/entry/run.js +43 -0
  47. package/dist/execution/lsp-process.d.ts +14 -0
  48. package/dist/execution/lsp-process.js +234 -0
  49. package/dist/http/server.d.ts +34 -0
  50. package/dist/http/server.js +1332 -0
  51. package/dist/launch.d.ts +3 -0
  52. package/dist/launch.js +4 -0
  53. package/dist/runtime/agent.d.ts +35 -0
  54. package/dist/runtime/agent.js +853 -0
  55. package/dist/runtime/artifacts.d.ts +15 -0
  56. package/dist/runtime/artifacts.js +72 -0
  57. package/dist/runtime/cache.d.ts +20 -0
  58. package/dist/runtime/cache.js +44 -0
  59. package/dist/runtime/calls.d.ts +21 -0
  60. package/dist/runtime/calls.js +130 -0
  61. package/dist/runtime/capabilities.d.ts +58 -0
  62. package/dist/runtime/capabilities.js +196 -0
  63. package/dist/runtime/cleanup.d.ts +7 -0
  64. package/dist/runtime/cleanup.js +33 -0
  65. package/dist/runtime/context.d.ts +34 -0
  66. package/dist/runtime/context.js +169 -0
  67. package/dist/runtime/diagnostics.d.ts +8 -0
  68. package/dist/runtime/diagnostics.js +71 -0
  69. package/dist/runtime/events.d.ts +22 -0
  70. package/dist/runtime/events.js +131 -0
  71. package/dist/runtime/kernel-capabilities.d.ts +32 -0
  72. package/dist/runtime/kernel-capabilities.js +200 -0
  73. package/dist/runtime/manifests.d.ts +14 -0
  74. package/dist/runtime/manifests.js +117 -0
  75. package/dist/runtime/model.d.ts +20 -0
  76. package/dist/runtime/model.js +241 -0
  77. package/dist/runtime/observability.d.ts +22 -0
  78. package/dist/runtime/observability.js +104 -0
  79. package/dist/runtime/policy.d.ts +8 -0
  80. package/dist/runtime/policy.js +31 -0
  81. package/dist/runtime/profile.d.ts +8 -0
  82. package/dist/runtime/profile.js +52 -0
  83. package/dist/runtime/projects.d.ts +40 -0
  84. package/dist/runtime/projects.js +115 -0
  85. package/dist/runtime/results.d.ts +7 -0
  86. package/dist/runtime/results.js +55 -0
  87. package/dist/runtime/review.d.ts +9 -0
  88. package/dist/runtime/review.js +54 -0
  89. package/dist/runtime/scheduler.d.ts +15 -0
  90. package/dist/runtime/scheduler.js +85 -0
  91. package/dist/runtime/skills.d.ts +2 -0
  92. package/dist/runtime/skills.js +83 -0
  93. package/dist/runtime/tokenizer.d.ts +8 -0
  94. package/dist/runtime/tokenizer.js +30 -0
  95. package/dist/store/database.d.ts +3 -0
  96. package/dist/store/database.js +49 -0
  97. package/dist/store/event-log.d.ts +19 -0
  98. package/dist/store/event-log.js +61 -0
  99. package/dist/store/schema.d.ts +1 -0
  100. package/dist/store/schema.js +347 -0
  101. package/dist/store/store.d.ts +344 -0
  102. package/dist/store/store.js +2554 -0
  103. package/package.json +73 -0
  104. package/proto/executor.proto +314 -0
@@ -0,0 +1,3 @@
1
+ import { type LaunchOptions, type LensRuntime } from './core/host.js';
2
+ export type { LaunchOptions, LensRuntime } from './core/host.js';
3
+ export declare function launch(options?: LaunchOptions): Promise<LensRuntime>;
package/dist/launch.js ADDED
@@ -0,0 +1,4 @@
1
+ import { launchCore } from './core/host.js';
2
+ export function launch(options = {}) {
3
+ return launchCore(options);
4
+ }
@@ -0,0 +1,35 @@
1
+ import type { ConfigRuntime } from '../config/runtime.js';
2
+ import type { Document, IngressCommand, Store } from '../store/store.js';
3
+ import type { CallRuntime } from './calls.js';
4
+ import type { CapabilityRegistry } from './capabilities.js';
5
+ import type { ContextEngine } from './context.js';
6
+ import type { AiModelGateway } from './model.js';
7
+ import type { AutoReviewer } from './review.js';
8
+ import type { EventBus } from './events.js';
9
+ export interface SubagentCreateInput {
10
+ readonly parentAgentId: string;
11
+ readonly name: string;
12
+ readonly forkContext: 'full' | 'compact' | 'none';
13
+ readonly model?: string;
14
+ readonly modelReasoningEffort?: string;
15
+ readonly initialPrompt?: string;
16
+ readonly initialMessage?: string;
17
+ readonly ingress?: IngressCommand;
18
+ }
19
+ export declare class AgentRuntime {
20
+ #private;
21
+ readonly store: Store;
22
+ readonly config: ConfigRuntime;
23
+ readonly context: ContextEngine;
24
+ readonly gateway: AiModelGateway;
25
+ readonly registry: CapabilityRegistry;
26
+ readonly calls: CallRuntime;
27
+ readonly reviewer: AutoReviewer;
28
+ readonly events: EventBus;
29
+ constructor(store: Store, config: ConfigRuntime, context: ContextEngine, gateway: AiModelGateway, registry: CapabilityRegistry, calls: CallRuntime, reviewer: AutoReviewer, events: EventBus);
30
+ wake(projectId: string, agentId: string): void;
31
+ cancel(projectId: string, agentId: string): void;
32
+ close(): Promise<void>;
33
+ compact(projectId: string, agentId: string, expectedContextRevision: number, pivotTurnGroupId: string | undefined, signal: AbortSignal): Promise<Document>;
34
+ createSubagent(projectId: string, input: SubagentCreateInput, signal: AbortSignal): Promise<Document>;
35
+ }