@soederpop/luca 0.0.15 → 0.0.17

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.
@@ -1,7 +1,7 @@
1
1
  import { setBuildTimeData, setContainerBuildTimeData } from './index.js';
2
2
 
3
3
  // Auto-generated introspection registry data
4
- // Generated at: 2026-03-20T05:45:32.173Z
4
+ // Generated at: 2026-03-20T16:25:10.945Z
5
5
 
6
6
  setBuildTimeData('features.containerLink', {
7
7
  "id": "features.containerLink",
@@ -75,12 +75,19 @@ export class Repl<
75
75
  * ```
76
76
  */
77
77
  async start(options: { historyPath?: string, context?: any } = {}) {
78
+ const { prompt = "> " } = this.options;
79
+
80
+ // If already started, resume with a fresh readline but reuse the VM context
78
81
  if (this.isStarted) {
79
- return this;
82
+ // Merge any new context into the existing VM context
83
+ if (options.context) {
84
+ for (const [k, v] of Object.entries(options.context)) {
85
+ this._vmContext![k] = v
86
+ }
87
+ }
88
+ return this._resume(prompt)
80
89
  }
81
90
 
82
- const { prompt = "> " } = this.options;
83
-
84
91
  // Set up history file — per-project history keyed by cwd hash
85
92
  const userHistoryPath = options.historyPath || this.options.historyPath
86
93
  if (typeof userHistoryPath === 'string') {
@@ -107,8 +114,16 @@ export class Repl<
107
114
  client: (...args: any[]) => this.container.client(...args),
108
115
  })
109
116
 
110
- // Completer for tab autocomplete
117
+ this.state.set('started', true)
118
+
119
+ return this._resume(prompt)
120
+ }
121
+
122
+ /** Open a fresh readline and enter the REPL loop using the existing VM context. */
123
+ private _resume(prompt: string) {
111
124
  const ctx = this._vmContext!
125
+
126
+ // Completer for tab autocomplete
112
127
  const completer = (line: string): [string[], string] => {
113
128
  // Dot-notation: e.g. container.fea<tab>
114
129
  const dotMatch = line.match(/([a-zA-Z_$][\w$]*(?:\.[a-zA-Z_$][\w$]*)*)\.([a-zA-Z_$][\w$]*)?$/)
@@ -146,8 +161,6 @@ export class Repl<
146
161
  completer,
147
162
  })
148
163
 
149
- this.state.set('started', true)
150
-
151
164
  // REPL loop
152
165
  let lastResult: any
153
166
  const ask = (): void => {
@@ -1,5 +1,5 @@
1
1
  // Auto-generated scaffold and MCP readme content
2
- // Generated at: 2026-03-20T05:45:33.043Z
2
+ // Generated at: 2026-03-20T16:25:11.839Z
3
3
  // Source: docs/scaffolds/*.md, docs/examples/assistant/, and docs/mcp/readme.md
4
4
  //
5
5
  // Do not edit manually. Run: luca build-scaffolds
@@ -209,6 +209,29 @@ export class ExpressServer<T extends ServerState = ServerState, K extends Expres
209
209
  return this
210
210
  }
211
211
 
212
+ async useEndpointModules(modules: EndpointModule[]): Promise<this> {
213
+ for (const mod of modules) {
214
+ try {
215
+ const endpointModule: EndpointModule = (mod as any).default || mod
216
+
217
+ if (!endpointModule.path) {
218
+ continue
219
+ }
220
+
221
+ const endpoint = new Endpoint(
222
+ { path: endpointModule.path },
223
+ this.container.context
224
+ )
225
+ await endpoint.load(endpointModule)
226
+ this.useEndpoint(endpoint)
227
+ } catch (err) {
228
+ console.error(`Failed to load endpoint module (${(mod as any).path || 'unknown'}):`, err)
229
+ }
230
+ }
231
+
232
+ return this
233
+ }
234
+
212
235
  serveOpenAPISpec(options: { title?: string; version?: string; description?: string } = {}): this {
213
236
  const server = this
214
237
  this.app.get('/openapi.json', (_req: any, res: any) => {