@lace-cloud/chat-core 0.0.1-bootstrap.0 → 0.6.4-next.25705814731
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 +19 -0
- package/README.md +75 -8
- package/dist/index.cjs +803 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.mts +321 -0
- package/dist/index.d.ts +321 -0
- package/dist/index.mjs +764 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +33 -8
- package/index.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/exhaustive.ts","../src/history.ts","../src/telemetry.ts","../src/agent-controller.ts","../src/proactivity/index.ts","../src/proactivity/rules.ts","../src/system-prompt.ts","../src/tool-registry.ts","../src/utils/canvas-summary.ts"],"sourcesContent":["/** Compile-time exhaustiveness guard. See apps/api/src/lib/helpers.ts. */\nexport function assertNever(value: never): never {\n throw new Error(`Unhandled closed-enum branch: ${JSON.stringify(value)}`);\n}\n","// History helpers.\n//\n// `ChatMessage[]` is JSON-safe by construction — every `Part`\n// variant is plain data. There is deliberately no codec here: the\n// adapter persists whatever core gives it and loads it back\n// unchanged. The single concern is keeping persisted history\n// bounded so it doesn't grow without end.\n\nimport type { ChatMessage } from './types';\n\nconst DEFAULT_TURN_CAP = 50;\n\n/**\n * Trim message history to the most recent `turnCap` turns. A turn\n * is one user message followed by one assistant message (plus any\n * interleaved tool traffic the assistant emits). Keeping the last\n * `turnCap` turns is approximated by keeping `turnCap * 2` messages\n * — exact turn boundaries aren't worth tracking for a bounded cap.\n */\nexport function capRecentMessages(\n messages: ChatMessage[],\n turnCap = DEFAULT_TURN_CAP,\n): ChatMessage[] {\n const limit = turnCap * 2;\n if (messages.length <= limit) return messages;\n return messages.slice(messages.length - limit);\n}\n","// Structured telemetry for a chat session.\n//\n// Pure TS: session state is a plain object, formatting is deterministic,\n// log output is routed through a caller-supplied `log(msg)` function\n// (typically `ChatHostAdapter.log`). Nothing here imports vscode or\n// requires a specific log sink — unit tests can pass a buffer-backed\n// function and assert on the emitted lines.\n\nexport type ToolInvocationRecord = {\n name: string;\n params: unknown;\n durationMs: number;\n isError: boolean;\n resultPreview: string;\n};\n\nexport type SessionMetadata = {\n sessionId: string;\n prompt: string;\n command?: string;\n toolCalls: ToolInvocationRecord[];\n rounds: number;\n startTime: number;\n endTime?: number;\n};\n\nexport type Telemetry = {\n startSession(prompt: string, command?: string): SessionMetadata;\n logToolInvocation(\n session: SessionMetadata,\n name: string,\n params: unknown,\n result: { content: string; isError?: boolean },\n durationMs: number,\n ): void;\n endSession(session: SessionMetadata, maxToolRounds?: number): void;\n};\n\nconst MAX_SESSIONS = 100;\n\nexport function createTelemetry(log: (message: string) => void): Telemetry {\n const sessionBuffer: SessionMetadata[] = [];\n let sessionCounter = 0;\n\n function recordSession(session: SessionMetadata): void {\n if (sessionBuffer.length >= MAX_SESSIONS) sessionBuffer.shift();\n sessionBuffer.push(session);\n }\n\n return {\n startSession(prompt, command) {\n sessionCounter += 1;\n const session: SessionMetadata = {\n sessionId: `s${sessionCounter}`,\n prompt,\n command,\n toolCalls: [],\n rounds: 0,\n startTime: Date.now(),\n };\n recordSession(session);\n\n log('');\n log(`[${ts()}] ── session ${session.sessionId} ──`);\n log(` prompt: \"${truncate(prompt, 120)}\"`);\n if (command) log(` command: /${command}`);\n return session;\n },\n\n logToolInvocation(session, name, params, result, durationMs) {\n const maxPreview = result.isError ? 500 : 200;\n const preview = truncate(result.content, maxPreview);\n session.toolCalls.push({\n name,\n params,\n durationMs,\n isError: result.isError ?? false,\n resultPreview: preview,\n });\n\n const status = result.isError ? 'ERR' : 'OK';\n log(`[${ts()}] [${session.sessionId}] tool ${name} (${durationMs}ms) ${status}`);\n log(` params: ${JSON.stringify(params)}`);\n log(result.isError ? ` error: ${preview}` : ` result: ${preview}`);\n },\n\n endSession(session, maxToolRounds) {\n session.endTime = Date.now();\n const totalMs = session.endTime - session.startTime;\n const errorCount = session.toolCalls.filter((t) => t.isError).length;\n const toolNames = session.toolCalls.map((t) => t.name);\n\n const toolCounts: Record<string, number> = {};\n for (const name of toolNames) {\n toolCounts[name] = (toolCounts[name] ?? 0) + 1;\n }\n\n log(`[${ts()}] [${session.sessionId}] session end (${totalMs}ms)`);\n log(` rounds: ${session.rounds}`);\n log(` tools: ${session.toolCalls.length} call(s), ${errorCount} error(s)`);\n if (Object.keys(toolCounts).length > 0) {\n const breakdown = Object.entries(toolCounts)\n .map(([n, c]) => `${n}×${c}`)\n .join(', ');\n log(` breakdown: ${breakdown}`);\n }\n\n if (maxToolRounds !== undefined && session.rounds >= maxToolRounds) {\n log(\n ` ⚠ session hit maxToolRounds (${maxToolRounds}) — possible stuck loop. Tool sequence: ${toolNames.join(' → ')}`,\n );\n }\n\n if (session.toolCalls.length === 0 && session.prompt.trim().length > 10) {\n log(` ⚠ unmatched intent: no tools called for \"${truncate(session.prompt, 100)}\"`);\n }\n },\n };\n}\n\nfunction ts(): string {\n return new Date().toISOString();\n}\n\nfunction truncate(s: string, max: number): string {\n return s.length > max ? `${s.slice(0, max)}...` : s;\n}\n","// Agentic loop, IDE-agnostic.\n//\n// Owns: message history, completed-turn log, in-flight cancellation,\n// the send→stream→tool-call→tool-result→repeat cycle, and the\n// stuck/limit/error handlers that prevent runaway loops. Everything\n// IDE-specific is reached through the injected `ChatHostAdapter`,\n// `WebviewTransport`, and `ToolRegistry` — each of which has a\n// single well-defined shape defined elsewhere in this package.\n//\n// `runTurn` is the only non-trivial method. It's intentionally long\n// and linear: the agentic loop's control flow (break on no-tools,\n// break on stuck, break on all-errored, continue otherwise) is\n// easiest to read top-to-bottom without fragmenting into helpers\n// that would be called from exactly one place. Accumulated state\n// lives in clearly-scoped locals; the only things mutated outside\n// the function scope are `this.history`, `this.completedTurns`, and\n// the transport.\n\nimport type { CanvasView } from '@lace-cloud/host';\nimport { assertNever } from './exhaustive';\nimport { capRecentMessages } from './history';\nimport type { ChatHostAdapter } from './host-adapter';\nimport type { CompletedTurn, ContextSummary, ProactiveSuggestion, WebviewToHost } from './protocol';\nimport { createTelemetry, type Telemetry } from './telemetry';\nimport type { ToolRegistry } from './tool-registry';\nimport type {\n ChatMessage,\n Disposable,\n Part,\n TextPart,\n ToolCallPart,\n ToolResultPart,\n} from './types';\nimport type { WebviewTransport } from './webview-transport';\n\nexport type AgentControllerOptions = {\n adapter: ChatHostAdapter;\n transport: WebviewTransport;\n toolRegistry: ToolRegistry;\n buildSystemPrompt: (availableSystems: string[]) => string;\n getAvailableSystems: () => string[];\n getCanvasView: () => CanvasView | null;\n historyKey: string;\n maxToolRounds?: number;\n completedTurnCap?: number;\n};\n\nconst DEFAULT_MAX_TOOL_ROUNDS = 25;\nconst DEFAULT_COMPLETED_TURN_CAP = 50;\n\nexport class AgentController {\n private history: ChatMessage[] = [];\n private completedTurns: CompletedTurn[] = [];\n private activeTurn: AbortController | null = null;\n private transportSubscription: Disposable | null = null;\n private readonly telemetry: Telemetry;\n\n constructor(private readonly opts: AgentControllerOptions) {\n this.telemetry = createTelemetry((msg) => opts.adapter.log(msg));\n }\n\n /** Load persisted history and start listening for webview messages. */\n async init(): Promise<void> {\n try {\n this.history = (await this.opts.adapter.loadHistory(this.opts.historyKey)) ?? [];\n } catch (err) {\n this.opts.adapter.log(`[Chat] history load failed, starting fresh: ${String(err)}`);\n this.history = [];\n }\n this.transportSubscription = this.opts.transport.onMessage((msg) =>\n this.handleWebviewMessage(msg),\n );\n }\n\n /** Cancel any active turn and unsubscribe from the webview. */\n dispose(): void {\n this.activeTurn?.abort();\n this.activeTurn = null;\n this.transportSubscription?.dispose();\n this.transportSubscription = null;\n }\n\n /** Drop in-memory and persisted history. */\n async clearHistory(): Promise<void> {\n this.history = [];\n this.completedTurns = [];\n await this.opts.adapter.saveHistory(this.opts.historyKey, []);\n this.opts.transport.postMessage({ type: 'history-cleared' });\n }\n\n /** Push a context-summary banner into the chat UI. */\n postContextSummary(summary: ContextSummary): void {\n this.opts.transport.postMessage({ type: 'context-summary', summary });\n }\n\n /** Forward a proactive suggestion from the watcher to the chat UI. */\n postProactiveSuggestion(suggestion: ProactiveSuggestion): void {\n this.opts.transport.postMessage({ type: 'proactive-suggestion', suggestion });\n }\n\n /** Notify the chat UI that the engine is unavailable for this session. */\n postEngineUnavailable(): void {\n this.opts.transport.postMessage({ type: 'engine-unavailable' });\n }\n\n private async handleWebviewMessage(msg: WebviewToHost): Promise<void> {\n switch (msg.type) {\n case 'webview-ready':\n this.opts.transport.postMessage({ type: 'history', turns: this.completedTurns });\n break;\n case 'user-turn':\n await this.runTurn(msg.text);\n break;\n case 'cancel-turn':\n this.activeTurn?.abort();\n break;\n case 'accept-proactive-suggestion':\n this.opts.adapter.log(`[Chat] proactive suggestion accepted: ${msg.id}`);\n break;\n default:\n assertNever(msg);\n }\n }\n\n private async runTurn(userText: string): Promise<void> {\n const model = await this.opts.adapter.selectModel();\n if (!model) {\n this.opts.transport.postMessage({ type: 'no-model' });\n return;\n }\n\n this.activeTurn = new AbortController();\n const signal = this.activeTurn.signal;\n const session = this.telemetry.startSession(userText);\n\n const systemPrompt = this.opts.buildSystemPrompt(this.opts.getAvailableSystems());\n const canvasView = this.opts.getCanvasView();\n const canvasContext = canvasView\n ? `Canvas: ${canvasView.nodes.length} node(s), ${canvasView.errors.length} error(s).`\n : 'Canvas: (state not yet loaded)';\n\n const messages: ChatMessage[] = [\n { role: 'user', content: [{ kind: 'text', value: systemPrompt }] },\n {\n role: 'assistant',\n content: [\n {\n kind: 'text',\n value: 'Understood. I am Lace, your Terraform infrastructure assistant.',\n },\n ],\n },\n ...this.history,\n { role: 'user', content: [{ kind: 'text', value: `[Canvas state]\\n${canvasContext}` }] },\n { role: 'assistant', content: [{ kind: 'text', value: 'Got it.' }] },\n { role: 'user', content: [{ kind: 'text', value: userText }] },\n ];\n\n // Persist the user message in history right away so a cancel\n // preserves it rather than losing the turn outright.\n this.history.push({ role: 'user', content: [{ kind: 'text', value: userText }] });\n\n const turnToolCalls: CompletedTurn['toolCalls'] = [];\n let assistantAccumulated = '';\n const messageId = `msg-${Date.now()}`;\n const failSignatureCount = new Map<string, number>();\n const tools = this.opts.toolRegistry.listSchemas();\n const maxRounds = this.opts.maxToolRounds ?? DEFAULT_MAX_TOOL_ROUNDS;\n\n try {\n for (let round = 0; round < maxRounds; round++) {\n if (signal.aborted) break;\n session.rounds = round + 1;\n\n const textParts: string[] = [];\n const toolCalls: Array<{ name: string; callId: string; input: Record<string, unknown> }> =\n [];\n\n try {\n for await (const event of this.opts.adapter.sendRequest(model, messages, tools, signal)) {\n if (signal.aborted) break;\n if (event.type === 'text') {\n textParts.push(event.value);\n assistantAccumulated += event.value;\n this.opts.transport.postMessage({ type: 'token', text: event.value });\n } else if (event.type === 'tool-call') {\n toolCalls.push({\n name: event.name,\n callId: event.callId,\n input: event.input as Record<string, unknown>,\n });\n }\n }\n } catch (err: unknown) {\n const msg = err instanceof Error ? err.message : String(err);\n this.opts.adapter.log(`[Chat] sendRequest failed: ${msg}`);\n const line = `\\n_Model request failed: ${msg}_`;\n this.opts.transport.postMessage({ type: 'token', text: line });\n assistantAccumulated += line;\n break;\n }\n\n if (toolCalls.length === 0) break;\n\n const assistantContent: Part[] = [\n ...textParts.map((t): TextPart => ({ kind: 'text', value: t })),\n ...toolCalls.map(\n (tc): ToolCallPart => ({\n kind: 'tool-call',\n callId: tc.callId,\n name: tc.name,\n input: tc.input,\n }),\n ),\n ];\n messages.push({ role: 'assistant', content: assistantContent });\n this.history.push({ role: 'assistant', content: assistantContent });\n\n const toolResultParts: ToolResultPart[] = [];\n let allToolsErrored = true;\n\n for (const tc of toolCalls) {\n if (signal.aborted) break;\n\n this.opts.transport.postMessage({\n type: 'tool-call',\n callId: tc.callId,\n name: tc.name,\n input: tc.input,\n });\n\n const handler = this.opts.toolRegistry.getHandler(tc.name);\n const startedAt = Date.now();\n let result: { content: string; isError?: boolean };\n if (!handler) {\n result = { content: `Unknown tool: ${tc.name}`, isError: true };\n } else {\n try {\n result = await handler(tc.input);\n } catch (err: unknown) {\n result = {\n content: `Tool error: ${err instanceof Error ? err.message : String(err)}`,\n isError: true,\n };\n }\n }\n const durationMs = Date.now() - startedAt;\n this.telemetry.logToolInvocation(session, tc.name, tc.input, result, durationMs);\n\n turnToolCalls.push({\n name: tc.name,\n input: tc.input,\n resultContent: result.content,\n isError: result.isError,\n });\n\n if (!result.isError) {\n allToolsErrored = false;\n failSignatureCount.delete(signatureFor(tc));\n } else {\n const sig = signatureFor(tc);\n failSignatureCount.set(sig, (failSignatureCount.get(sig) ?? 0) + 1);\n }\n\n this.opts.transport.postMessage({\n type: 'tool-result',\n callId: tc.callId,\n name: tc.name,\n content: result.content,\n isError: result.isError,\n });\n\n toolResultParts.push({\n kind: 'tool-result',\n callId: tc.callId,\n content: [\n {\n kind: 'text',\n value: result.isError\n ? `Tool [${tc.name}] failed: ${result.content}`\n : result.content,\n },\n ],\n isError: result.isError,\n });\n }\n\n messages.push({ role: 'user', content: toolResultParts });\n this.history.push({ role: 'user', content: toolResultParts });\n\n if (allToolsErrored && toolCalls.length > 0) {\n const errorDetails = toolResultParts\n .flatMap((p) => p.content.map((c) => c.value))\n .filter(Boolean);\n const msg = `\\n_All tool calls failed:\\n${errorDetails.map((e) => `- ${e}`).join('\\n')}_`;\n this.opts.transport.postMessage({ type: 'token', text: msg });\n assistantAccumulated += msg;\n break;\n }\n\n const stuck = [...failSignatureCount.entries()].find(([, count]) => count >= 2);\n if (stuck) {\n const msg = `\\n_I'm stuck — required fields cannot be inferred. Please provide the missing values._`;\n this.opts.transport.postMessage({ type: 'token', text: msg });\n assistantAccumulated += msg;\n break;\n }\n\n if (round === maxRounds - 1) {\n const msg = `\\n_Reached operation limit (${maxRounds} rounds). Ask me to continue if needed._`;\n this.opts.transport.postMessage({ type: 'token', text: msg });\n assistantAccumulated += msg;\n }\n }\n } finally {\n this.telemetry.endSession(session, maxRounds);\n this.activeTurn = null;\n\n if (signal.aborted) {\n this.opts.transport.postMessage({ type: 'turn-cancelled' });\n } else {\n this.completedTurns.push({\n messageId,\n userText,\n assistantText: assistantAccumulated,\n toolCalls: turnToolCalls,\n });\n const cap = this.opts.completedTurnCap ?? DEFAULT_COMPLETED_TURN_CAP;\n if (this.completedTurns.length > cap) {\n this.completedTurns = this.completedTurns.slice(-cap);\n }\n await this.opts.adapter.saveHistory(this.opts.historyKey, capRecentMessages(this.history));\n this.opts.transport.postMessage({ type: 'turn-complete', messageId });\n }\n }\n }\n}\n\nfunction signatureFor(tc: { name: string; input: unknown }): string {\n return `${tc.name}:${JSON.stringify(tc.input)}`;\n}\n","// Engine-stream proactivity watcher.\n//\n// Subscribes to the engine event stream and applies pure rule\n// functions (see `./rules`) to propose between-turn suggestions. The\n// only configurable surface is whether suggestions are emitted; even\n// when disabled we still advance internal state so transitions\n// aren't lost if the setting flips back on mid-session.\n//\n// All IDE-specific concerns (reading config, writing to the chat\n// webview) are reached through the `ChatHostAdapter` and a user-\n// supplied callback — nothing in this file imports vscode or any\n// other editor API.\n\nimport type { BundleStateEvent, LaceTransport } from '@lace-cloud/host';\nimport { parseModuleKey, projectCanvasView } from '@lace-cloud/proto';\nimport type { ChatHostAdapter } from '../host-adapter';\nimport type { ProactiveSuggestion } from '../protocol';\nimport {\n advanceState,\n type EngineEventLike,\n initialRuleState,\n matchAll,\n type RuleState,\n} from './rules';\n\nconst RETRY_DELAY_MS = 1000;\nconst CONFIG_KEY = 'proactivity';\nconst CONFIG_ENABLED_VALUE = 'on';\n\nexport type ProactivityWatcherOptions = {\n transport: LaceTransport;\n sessionId: string;\n adapter: Pick<ChatHostAdapter, 'getConfig' | 'log'>;\n onSuggestion: (suggestion: ProactiveSuggestion) => void;\n};\n\nexport class ProactivityWatcher {\n private stream: ReturnType<LaceTransport['subscribeStream']> | null = null;\n private ruleState: RuleState = initialRuleState();\n private retried = false;\n private stopped = false;\n\n constructor(private readonly opts: ProactivityWatcherOptions) {}\n\n start(): void {\n if (this.stopped) return;\n this.stream = this.opts.transport.subscribeStream(this.opts.sessionId);\n\n this.stream.on('data', (event: BundleStateEvent) => this.handleEvent(event));\n this.stream.on('end', () => {\n this.opts.adapter.log('[Proactivity] stream ended');\n this.stream = null;\n });\n this.stream.on('error', (err: Error) => {\n this.opts.adapter.log(`[Proactivity] stream error: ${err.message}`);\n this.stream = null;\n if (!this.retried && !this.stopped) {\n this.retried = true;\n setTimeout(() => {\n if (!this.stopped) this.start();\n }, RETRY_DELAY_MS);\n }\n });\n }\n\n stop(): void {\n this.stopped = true;\n this.stream?.cancel();\n this.stream = null;\n }\n\n private handleEvent(event: BundleStateEvent): void {\n const converted = toEngineEventLike(event);\n const enabled =\n this.opts.adapter.getConfig(CONFIG_KEY, CONFIG_ENABLED_VALUE) === CONFIG_ENABLED_VALUE;\n\n if (enabled) {\n const suggestion = matchAll(converted, this.ruleState);\n if (suggestion) this.opts.onSuggestion(suggestion);\n }\n this.ruleState = advanceState(converted, this.ruleState);\n }\n}\n\nfunction toEngineEventLike(event: BundleStateEvent): EngineEventLike {\n const result: EngineEventLike = {};\n if (event.state?.bundle) {\n const { id: moduleName } = parseModuleKey(event.state.bundle.entry);\n const view = projectCanvasView(event.state.bundle, event.state.layouts ?? {}, {\n moduleName,\n canUndo: event.state.can_undo,\n canRedo: event.state.can_redo,\n isDirty: event.state.is_dirty,\n });\n result.state_updated = { view };\n }\n if (event.generate_progress) {\n result.generate_progress = {\n stage: event.generate_progress.stage,\n message: event.generate_progress.message,\n };\n }\n if (event.generate_success) {\n result.generate_success = {\n files_written: event.generate_success.files_written,\n files: event.generate_success.files,\n };\n }\n if (event.generate_error) {\n result.generate_error = {\n message: event.generate_error.message,\n diagnostics: event.generate_error.diagnostics.map((d) => ({ message: d.message })),\n };\n }\n return result;\n}\n\nexport * from './rules';\n","// Pure rule functions for between-turn proactivity suggestions.\n// No vscode imports, no side effects — easy to unit test.\n//\n// Each rule: (event, prevState) => Suggestion | null\n// Returning null means \"nothing to suggest for this event.\"\n\nimport type { CanvasView, NodePin, RenderNode } from '@lace-cloud/proto';\nimport type { ProactiveSuggestion } from '../protocol';\n\n// ── Proto-shaped inputs ──\n// Matches the shape of EngineEvent fields from packages/host/src/generated/service.ts.\n// We accept plain objects so rules can be tested without importing gRPC types.\n\nexport type StateUpdatedLike = {\n view: CanvasView | undefined;\n};\n\nexport type GenerateProgressLike = {\n stage: string;\n message: string;\n};\n\nexport type GenerateSuccessLike = {\n files_written: string[];\n files: Record<string, string>;\n};\n\nexport type GenerateErrorLike = {\n message: string;\n diagnostics: Array<{ message: string; instance_id?: string; address?: string }>;\n};\n\nexport type EngineEventLike = {\n state_updated?: StateUpdatedLike;\n generate_progress?: GenerateProgressLike;\n generate_success?: GenerateSuccessLike;\n generate_error?: GenerateErrorLike;\n};\n\nexport type RuleState = {\n prevErrorCount: number;\n prevNodeIds: Set<string>;\n};\n\nexport function initialRuleState(): RuleState {\n return { prevErrorCount: 0, prevNodeIds: new Set() };\n}\n\n// ── Rule 1: unwired required input on newly added node ──\n//\n// Trigger: StateUpdated introduces a new node (id not in prevNodeIds).\n// If that node has a required input with mode:'empty' and type_family matching\n// some sibling's output type_family, suggest wiring.\n\nexport function matchUnwiredRequiredInput(\n event: EngineEventLike,\n state: RuleState,\n): ProactiveSuggestion | null {\n const view = event.state_updated?.view;\n if (!view) return null;\n\n const newNodes = view.nodes.filter((n) => !state.prevNodeIds.has(n.id));\n if (newNodes.length === 0) return null;\n\n // Look at the first new node only — avoid suggestion spam on bulk drops.\n const newNode = newNodes[0];\n\n const unwiredRequiredInput = findUnwiredRequiredInput(newNode);\n if (!unwiredRequiredInput) return null;\n\n const candidate = findSiblingOutputMatch(view, newNode, unwiredRequiredInput);\n if (!candidate) return null;\n\n return {\n id: `unwired-${newNode.id}-${unwiredRequiredInput.name}`,\n text: `The new \\`${newNode.id}\\` has an unwired required input \\`${unwiredRequiredInput.name}\\`. Want me to wire it to \\`${candidate.instanceId}.${candidate.outputName}\\`?`,\n };\n}\n\nfunction findUnwiredRequiredInput(node: RenderNode): NodePin | null {\n for (const pin of node.inputs) {\n if (pin.required && !pin.wired) return pin;\n }\n return null;\n}\n\nfunction findSiblingOutputMatch(\n view: CanvasView,\n target: RenderNode,\n targetInput: NodePin,\n): { instanceId: string; outputName: string } | null {\n const family = targetInput.type_family;\n if (!family) return null;\n\n for (const node of view.nodes) {\n if (node.id === target.id) continue;\n for (const output of node.outputs) {\n if (output.type_family === family) {\n return { instanceId: node.id, outputName: output.name };\n }\n }\n }\n return null;\n}\n\n// ── Rule 2: generation failed with diagnostics ──\n\nexport function matchGenerateError(event: EngineEventLike): ProactiveSuggestion | null {\n const err = event.generate_error;\n if (!err || err.diagnostics.length === 0) return null;\n\n const first = err.diagnostics[0];\n const location = first.instance_id\n ? `\\`${first.instance_id}\\`${first.address ? `.\\`${first.address}\\`` : ''}`\n : '';\n const locSuffix = location ? ` at ${location}` : '';\n return {\n id: `gen-error-${Date.now()}`,\n text: `Generation failed: ${first.message}${locSuffix}. Want me to look at it?`,\n };\n}\n\n// ── Rule 3: validation errors appeared (crossed 0 → N) ──\n\nexport function matchErrorsAppeared(\n event: EngineEventLike,\n state: RuleState,\n): ProactiveSuggestion | null {\n const view = event.state_updated?.view;\n if (!view) return null;\n\n const curr = view.errors.length;\n if (state.prevErrorCount !== 0 || curr === 0) return null;\n\n const first = view.errors[0];\n const summary =\n first.message + (view.errors.length > 1 ? ` (+${view.errors.length - 1} more)` : '');\n return {\n id: `errors-appeared-${Date.now()}`,\n text: `${curr} validation error${curr === 1 ? '' : 's'} appeared — ${summary}. Investigate?`,\n };\n}\n\n// ── Dispatch ──\n\nexport function matchAll(event: EngineEventLike, state: RuleState): ProactiveSuggestion | null {\n return (\n matchUnwiredRequiredInput(event, state) ??\n matchGenerateError(event) ??\n matchErrorsAppeared(event, state)\n );\n}\n\nexport function advanceState(event: EngineEventLike, state: RuleState): RuleState {\n const view = event.state_updated?.view;\n if (!view) return state;\n return {\n prevErrorCount: view.errors.length,\n prevNodeIds: new Set(view.nodes.map((n) => n.id)),\n };\n}\n","// src/chat/system-prompt.ts\n//\n// System prompt factory for the Lace chat participant.\n// Dynamic context (canvas state, engine status) is injected per-request in participant.ts.\n\nexport function buildSystemPrompt(systems: string[] = ['aws', 'azure', 'google']): string {\n const systemList = systems.join('/');\n return PROMPT_TEMPLATE.replace('{{SYSTEMS}}', systemList);\n}\n\nconst PROMPT_TEMPLATE = `You are Lace, an AI assistant that is the primary interface for composing Terraform infrastructure. Users describe what they need in natural language, and you compose it on a visual canvas. The canvas is an inspection and verification layer — you drive the composition.\n\n## Canvas State\n\nBefore each response, you receive a fresh snapshot of the current canvas (instances, connections, errors). This is your ground truth. Use it for instance IDs — never guess. The snapshot reflects all changes, including manual edits the user made on the canvas between messages.\n\n## When the Engine Is Not Running\n\nTell the user to start it with **Lace: Start Engine** from the Command Palette. Do not call any tools.\n\n## When No Canvas Is Open\n\nTell the user to open one with **Lace: Open Canvas** from the Command Palette. Do not call any write tools.\n\n## Core Concepts\n\n**Instances**: When a module is added to the canvas it becomes an instance with a unique ID (e.g., \"vpc\", \"subnet_1\"). All write tools use instance IDs.\n\n**Input bindings** — each module input can be:\n- **empty** — not set (must be filled before generating)\n- **literal** — a hardcoded value: string, number, bool, object, or array\n- **variable** — a \\`var.NAME\\` reference, configurable at deploy time\n- **expression** — raw HCL: e.g., \\`local.region\\`, \\`cidrsubnet(var.vpc_cidr, 8, 0)\\`\n- **wired** — connected from another instance's output (via lace_connect or lace_auto_connect)\n\n## Available Tools\n\n**Read tools** (gather information first):\n- lace_search_registry: Search the module registry by keyword, system ({{SYSTEMS}}), or category.\n- lace_inspect_module: Get full input/output schema for a registry module (before adding).\n- lace_describe_graph: Get the current canvas state — instances, connections, errors.\n- lace_validate_graph: Run validation — returns auto-resolvable vs. user-required errors.\n- lace_inspect_node: Get the live input bindings and outputs of a placed instance.\n- lace_get_settings: Read terraform block, providers, locals, and environments.\n- lace_workspace_context: Analyze project files — returns a structured ProjectProfile + raw content.\n\n**Write tools** (modify the canvas):\n- lace_add_module: Add a module to the canvas.\n- lace_remove_module: Remove an instance.\n- lace_connect: Wire a source output to a target input.\n- lace_auto_connect: Best-effort wiring between two instances.\n- lace_disconnect: Remove a wire from a specific input.\n- lace_set_input: Set a literal value, variable reference, or HCL expression.\n- lace_rename_instance: Rename an instance (cascades to all references).\n- lace_set_variable: Add or update a canvas-level variable (var.NAME).\n- lace_set_local: Add or update a local value (literal or expression).\n- lace_set_environment: Set environment-specific variable overrides.\n- lace_create_group: Group instances visually on the canvas.\n- lace_ungroup: Remove a visual group (instances stay on canvas).\n- lace_undo: Undo the last canvas change.\n- lace_generate: Generate Terraform .tf files from the canvas.\n\n## Workflow Rules\n\n1. **Use the canvas snapshot** for instance IDs and error flags. Call lace_inspect_node for exact port names. Never guess port names.\n2. **Search before adding**: lace_search_registry first, then lace_add_module. One search per module.\n3. **Inspect before connecting**: lace_inspect_node on both source and target for exact output/input names.\n4. **Auto-connect for common patterns**: lace_auto_connect first, fall back to lace_connect.\n5. **Validate once at the end**: After all changes, call lace_validate_graph. Not after every step.\n6. **Act on confirmation**: When the user says \"yes\", \"go ahead\", \"do it\" — execute immediately without re-asking.\n7. **Never guess ambiguous values**: If a required input needs a value you cannot infer (DNS names, zone IDs, resource names, secrets), list the fields and ask. Never set placeholders.\n8. **Respect version requests**: Pass the user's exact version to lace_add_module.\n9. **Organize as you go**: After adding a batch of related modules, group them with lace_create_group. Keep the canvas readable without being asked.\n\n## Starting a New Composition\n\n1. Call lace_workspace_context to analyze the project.\n2. Review the **ProjectProfile** (languages, frameworks, databases, cloud_hints). Ask 1-2 clarifying questions if needed:\n - If cloud provider is unclear: \"Which cloud provider are you targeting?\"\n - If project type is ambiguous: \"Is this a web API, data pipeline, or static site?\"\n - If they have a Dockerfile but no cloud hints: \"How do you want to deploy — containers, serverless, or VMs?\"\n3. Based on answers + profile, suggest 2-3 module combinations. One sentence per suggestion.\n4. Ask: \"Want me to set these up?\" — then STOP.\n5. On confirmation, execute everything without re-asking.\n\n**CRITICAL: If the user confirmed in a previous message, do not ask again. Proceed immediately.**\n\n## Understanding the Project\n\nWhen lace_workspace_context returns a ProjectProfile:\n- Match language + framework to infrastructure patterns (e.g., Express + Docker → ECS or Lambda)\n- Check cloud_hints for provider selection\n- Check existing_modules to avoid adding duplicates\n- Use databases array to suggest managed database services (postgres → RDS, mongodb → DocumentDB)\n\n## Handling Validation Errors\n\nWhen the user mentions errors, says \"fix it\", \"what's wrong\", or \"check for issues\":\n1. Call lace_validate_graph.\n2. The response classifies errors as **auto-resolvable** vs. **requires user input**.\n3. Fix all auto-resolvable errors (wire connections, set defaults) without asking.\n4. For user-required values: list them clearly and ask. Never guess.\n5. Summarize what you fixed and what you still need from the user.\n\n## Input Value Guidance\n\nWhen setting inputs, use these heuristics for common types:\n- **CIDR blocks**: Suggest 10.0.0.0/16 for VPC. For subnets, use cidrsubnet(var.vpc_cidr, 8, N).\n- **Boolean flags**: Set sensible defaults (enable_dns_support=true, enable_dns_hostnames=true).\n- **Regions**: Ask the user, or use cloud_hints from ProjectProfile.\n- **Instance types**: Suggest cost-effective defaults (t3.medium, Standard_B2ms) but note the user can change them.\n- **Names, IDs, ARNs, passwords, secrets**: NEVER guess. Always ask.\n\n## Using Locals and Environment Variables\n\n- Call lace_get_settings to see existing locals and environments.\n- Use lace_set_local to create reusable values (e.g., local.region, local.environment).\n- Use lace_set_environment to define per-environment overrides (staging vs production).\n- Reference locals in module inputs via expression: \"local.NAME\".\n\n## Canvas Organization\n\nGroups are visual containers that organize related instances on the canvas. They don't affect Terraform generation — they're purely for readability.\n\n**Proactive grouping:** As you build a composition, organize it into groups so the canvas stays readable. Group by logical function:\n- Networking: VPCs, subnets, route tables, NAT gateways, security groups\n- Compute: EC2 instances, ASGs, launch templates, load balancers\n- Data: RDS, DynamoDB, S3, ElastiCache\n- Identity: IAM roles, policies, instance profiles\n- Monitoring: CloudWatch alarms, log groups, dashboards\n\n**When to group:**\n- After adding 3+ related modules in a batch, group them immediately.\n- After the canvas exceeds ~8 instances, review and organize ungrouped nodes.\n- When the user asks to \"add another X\" to an existing cluster of related modules, add the new module and include it in the relevant group.\n\n**Naming:** Use short functional labels: \"Network\", \"Compute\", \"Database\", \"Auth\", \"Monitoring\". Not instance IDs or module names.\n\n## Error Recovery\n\n- Tool returns \"not found\": call lace_describe_graph for current instance IDs.\n- Module not in registry: try broader search terms or remove the system filter.\n- Auto-connect finds no matches: it shows available ports — use lace_connect manually.\n- Wrong change: call lace_undo immediately.\n\n## Conventions\n\n- Instance IDs are Terraform identifiers (e.g., \"vpc\", \"subnet_1\"), auto-generated on add.\n- Module names follow \"system/name\" (e.g., \"aws/vpc\", \"azure/resource-group\").\n- Each input has one binding. Setting a new one replaces the previous.\n\n## Response Style\n\n- Be concise — one or two sentences to confirm what was done.\n- After changes, summarize the final state.\n- Execute all steps before responding. Do not narrate each step.\n- Only ask for clarification when genuinely ambiguous and not answerable from context or conversation history.\n- **Never ask the same question twice.** If answered in a prior turn, act on it.\n`;\n","// Registry of tool schemas + handlers.\n//\n// Handlers are pure async functions: input object → ToolResult.\n// Schemas are plain data. The registry itself is a tiny in-memory\n// Map with no IDE coupling — every caller (VS Code adapter,\n// JetBrains adapter, unit tests) constructs one and registers the\n// tools their environment provides.\n//\n// Instance-per-session rather than a module singleton: a global\n// registry would leak tool handlers between adapters in any future\n// in-process multi-host scenario (e.g. testing), and buys nothing\n// over explicit construction.\n\nimport type { ToolResult, ToolSchema } from './types';\n\nexport type ToolHandler = (input: Record<string, unknown>) => Promise<ToolResult>;\n\nexport type ToolRegistration = {\n schema: ToolSchema;\n handler: ToolHandler;\n};\n\nexport interface ToolRegistry {\n register(schema: ToolSchema, handler: ToolHandler): void;\n getHandler(name: string): ToolHandler | undefined;\n listSchemas(): ToolSchema[];\n listNames(): string[];\n}\n\nexport function createToolRegistry(): ToolRegistry {\n const entries = new Map<string, ToolRegistration>();\n\n return {\n register(schema, handler) {\n entries.set(schema.name, { schema, handler });\n },\n\n getHandler(name) {\n return entries.get(name)?.handler;\n },\n\n listSchemas() {\n return [...entries.values()].map((e) => e.schema);\n },\n\n listNames() {\n return [...entries.keys()];\n },\n };\n}\n","import type { CanvasView } from '@lace-cloud/host';\n\ntype FormatOptions = {\n /** Compact: single-line lists. Detailed (default): markdown headers and bullets. */\n compact?: boolean;\n};\n\n/**\n * Format a CanvasView as a text summary.\n *\n * - compact mode: terse one-liner lists (used for chat context injection)\n * - detailed mode: markdown with headers (used for describe_graph tool output)\n */\nexport function formatCanvasState(view: CanvasView | undefined, opts: FormatOptions = {}): string {\n if (!view) {\n return 'No canvas is open. Tell the user to open one with **Lace: Open Canvas** from the Command Palette before making any canvas changes.';\n }\n\n if (view.nodes.length === 0) {\n return 'Canvas is open but empty — no modules added yet.';\n }\n\n if (opts.compact) return formatCompact(view);\n return formatDetailed(view);\n}\n\nfunction formatCompact(view: CanvasView): string {\n const groupCount = view.groups.length ?? 0;\n const groupSuffix = groupCount > 0 ? `, ${groupCount} group(s)` : '';\n const parts: string[] = [\n `Canvas snapshot: ${view.nodes.length} instance(s), ${view.edges.length} connection(s)${groupSuffix}.`,\n ];\n\n if (groupCount > 0) {\n const groupList = view.groups\n .map((g) => {\n const collapsed = g.collapsed ? ' (collapsed)' : '';\n return `${g.label} [${g.node_ids.join(', ')}]${collapsed}`;\n })\n .join(', ');\n parts.push(`Groups: ${groupList}`);\n }\n\n const nodeList = view.nodes\n .map((n) => `${n.id} (${n.label})${n.has_errors ? ' \\u26a0' : ''}`)\n .join(', ');\n parts.push(`Instances: ${nodeList}`);\n\n if (view.edges.length > 0) {\n const edgeList = view.edges\n .map((e) => `${e.source}.${e.source_output}\\u2192${e.target}.${e.target_input}`)\n .join(', ');\n parts.push(`Connections: ${edgeList}`);\n }\n\n if (view.errors.length > 0) {\n parts.push(`Errors: ${view.errors.length} validation error(s) present.`);\n }\n\n return parts.join('\\n');\n}\n\nfunction formatDetailed(view: CanvasView): string {\n const lines: string[] = [];\n\n lines.push(`**Canvas: ${view.nodes.length} instance(s), ${view.edges.length} connection(s)**`);\n\n if (view.groups.length > 0) {\n lines.push('');\n lines.push('### Groups');\n for (const g of view.groups) {\n const collapsed = g.collapsed ? ' (collapsed)' : '';\n lines.push(`- **${g.label}** \\u2014 ${g.node_ids.join(', ')}${collapsed}`);\n }\n }\n\n lines.push('');\n lines.push('### Instances');\n for (const node of view.nodes) {\n const errFlag = node.has_errors ? ' \\u26a0 has errors' : '';\n lines.push(`- **${node.id}** (${node.label})${errFlag}`);\n }\n\n if (view.edges.length > 0) {\n lines.push('');\n lines.push('### Connections');\n for (const edge of view.edges) {\n lines.push(\n `- ${edge.source}.${edge.source_output} \\u2192 ${edge.target}.${edge.target_input}`,\n );\n }\n }\n\n if (view.errors.length > 0) {\n lines.push('');\n lines.push('### Errors');\n for (const err of view.errors) {\n const loc = [err.instance_id, err.input_name].filter(Boolean).join('.');\n lines.push(`- ${loc ? `[${loc}] ` : ''}${err.message}`);\n }\n }\n\n return lines.join('\\n');\n}\n"],"mappings":";AACO,SAAS,YAAY,OAAqB;AAC/C,QAAM,IAAI,MAAM,iCAAiC,KAAK,UAAU,KAAK,CAAC,EAAE;AAC1E;;;ACOA,IAAM,mBAAmB;AASlB,SAAS,kBACd,UACA,UAAU,kBACK;AACf,QAAM,QAAQ,UAAU;AACxB,MAAI,SAAS,UAAU,MAAO,QAAO;AACrC,SAAO,SAAS,MAAM,SAAS,SAAS,KAAK;AAC/C;;;ACYA,IAAM,eAAe;AAEd,SAAS,gBAAgB,KAA2C;AACzE,QAAM,gBAAmC,CAAC;AAC1C,MAAI,iBAAiB;AAErB,WAAS,cAAc,SAAgC;AACrD,QAAI,cAAc,UAAU,aAAc,eAAc,MAAM;AAC9D,kBAAc,KAAK,OAAO;AAAA,EAC5B;AAEA,SAAO;AAAA,IACL,aAAa,QAAQ,SAAS;AAC5B,wBAAkB;AAClB,YAAM,UAA2B;AAAA,QAC/B,WAAW,IAAI,cAAc;AAAA,QAC7B;AAAA,QACA;AAAA,QACA,WAAW,CAAC;AAAA,QACZ,QAAQ;AAA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S,GAAG;AACzB,UAAM,KAAK,EAAE;AACb,UAAM,KAAK,iBAAiB;AAC5B,eAAW,QAAQ,KAAK,OAAO;AAC7B,YAAM;AAAA,QACJ,KAAK,KAAK,MAAM,IAAI,KAAK,aAAa,WAAW,KAAK,MAAM,IAAI,KAAK,YAAY;AAAA,MACnF;AAAA,IACF;AAAA,EACF;AAEA,MAAI,KAAK,OAAO,SAAS,GAAG;AAC1B,UAAM,KAAK,EAAE;AACb,UAAM,KAAK,YAAY;AACvB,eAAW,OAAO,KAAK,QAAQ;AAC7B,YAAM,MAAM,CAAC,IAAI,aAAa,IAAI,UAAU,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AACtE,YAAM,KAAK,KAAK,MAAM,IAAI,GAAG,OAAO,EAAE,GAAG,IAAI,OAAO,EAAE;AAAA,IACxD;AAAA,EACF;AAEA,SAAO,MAAM,KAAK,IAAI;AACxB;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,16 +1,41 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lace-cloud/chat-core",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"
|
|
3
|
+
"version": "0.6.4-next.25705814731",
|
|
4
|
+
"main": "./dist/index.cjs",
|
|
5
|
+
"types": "./dist/index.d.ts",
|
|
6
|
+
"dependencies": {
|
|
7
|
+
"@lace-cloud/host": "0.6.4-next.25705814731",
|
|
8
|
+
"@lace-cloud/proto": "0.6.4-next.25705814731"
|
|
9
|
+
},
|
|
10
|
+
"devDependencies": {
|
|
11
|
+
"tsup": "^8.5.0",
|
|
12
|
+
"typescript": "^5.6.3"
|
|
13
|
+
},
|
|
14
|
+
"publishConfig": {
|
|
15
|
+
"registry": "https://registry.npmjs.org",
|
|
16
|
+
"access": "public"
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"dist",
|
|
20
|
+
"README.md"
|
|
21
|
+
],
|
|
7
22
|
"repository": {
|
|
8
23
|
"type": "git",
|
|
9
24
|
"url": "https://github.com/lace-cloud/lace.git",
|
|
10
25
|
"directory": "packages/chat-core"
|
|
11
26
|
},
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
27
|
+
"scripts": {
|
|
28
|
+
"build": "tsup",
|
|
29
|
+
"clean": "rm -rf dist",
|
|
30
|
+
"test": "vitest run"
|
|
31
|
+
},
|
|
32
|
+
"module": "./dist/index.mjs",
|
|
33
|
+
"exports": {
|
|
34
|
+
".": {
|
|
35
|
+
"types": "./dist/index.d.ts",
|
|
36
|
+
"import": "./dist/index.mjs",
|
|
37
|
+
"require": "./dist/index.cjs"
|
|
38
|
+
},
|
|
39
|
+
"./package.json": "./package.json"
|
|
15
40
|
}
|
|
16
|
-
}
|
|
41
|
+
}
|
package/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = {};
|