@hyperspaceng/neural-web-ui 0.64.1 → 0.65.1

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/CHANGELOG.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.65.0] - 2026-04-03
6
+
5
7
  ## [0.64.0] - 2026-03-29
6
8
 
7
9
  ## [0.63.2] - 2026-03-29
package/README.md CHANGED
@@ -202,10 +202,10 @@ await agent.prompt({ role: 'user-with-attachments', content: 'Check this', attac
202
202
 
203
203
  // Control
204
204
  agent.abort();
205
- agent.setModel(newModel);
206
- agent.setThinkingLevel('medium');
207
- agent.setTools([...]);
208
- agent.queueMessage(customMessage);
205
+ agent.state.model = newModel;
206
+ agent.state.thinkingLevel = 'medium';
207
+ agent.state.tools = [...];
208
+ agent.followUp(customMessage);
209
209
  ```
210
210
 
211
211
  ## Message Types
@@ -312,7 +312,7 @@ replTool.runtimeProvidersFactory = () => [
312
312
  new ArtifactsRuntimeProvider(artifactsPanel, agent, true), // read-write
313
313
  ];
314
314
 
315
- agent.setTools([replTool]);
315
+ agent.state.tools = [replTool];
316
316
  ```
317
317
 
318
318
  ### Extract Document
@@ -325,7 +325,7 @@ import { createExtractDocumentTool } from '@mariozechner/pi-web-ui';
325
325
  const extractTool = createExtractDocumentTool();
326
326
  extractTool.corsProxyUrl = 'https://corsproxy.io/?';
327
327
 
328
- agent.setTools([extractTool]);
328
+ agent.state.tools = [extractTool];
329
329
  ```
330
330
 
331
331
  ### Artifacts Tool
@@ -337,7 +337,7 @@ const artifactsPanel = new ArtifactsPanel();
337
337
  artifactsPanel.agent = agent;
338
338
 
339
339
  // The tool is available as artifactsPanel.tool
340
- agent.setTools([artifactsPanel.tool]);
340
+ agent.state.tools = [artifactsPanel.tool];
341
341
  ```
342
342
 
343
343
  ### Custom Tool Renderers
@@ -551,7 +551,7 @@ const success = await ApiKeyPromptDialog.prompt('anthropic');
551
551
  import { ModelSelector } from '@mariozechner/pi-web-ui';
552
552
 
553
553
  ModelSelector.open(currentModel, (selectedModel) => {
554
- agent.setModel(selectedModel);
554
+ agent.state.model = selectedModel;
555
555
  });
556
556
  ```
557
557
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-web-ui-example",
3
- "version": "1.52.1",
3
+ "version": "1.53.1",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "scripts": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyperspaceng/neural-web-ui",
3
- "version": "0.64.1",
3
+ "version": "0.65.1",
4
4
  "description": "Reusable web UI components for AI chat interfaces powered by @mariozechner/pi-ai",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -18,8 +18,8 @@
18
18
  },
19
19
  "dependencies": {
20
20
  "@lmstudio/sdk": "^1.5.0",
21
- "@hyperspaceng/neural-ai": "^0.64.1",
22
- "@hyperspaceng/neural-tui": "^0.64.1",
21
+ "@hyperspaceng/neural-ai": "^0.65.1",
22
+ "@hyperspaceng/neural-tui": "^0.65.1",
23
23
  "docx-preview": "^0.3.7",
24
24
  "jszip": "^3.10.1",
25
25
  "lucide": "^0.544.0",
package/src/ChatPanel.ts CHANGED
@@ -141,7 +141,7 @@ export class ChatPanel extends LitElement {
141
141
  const additionalTools =
142
142
  config?.toolsFactory?.(agent, this.agentInterface, this.artifactsPanel, runtimeProvidersFactory) || [];
143
143
  const tools = [this.artifactsPanel.tool, ...additionalTools];
144
- this.agent.setTools(tools);
144
+ this.agent.state.tools = tools;
145
145
 
146
146
  // Reconstruct artifacts from existing messages
147
147
  // Temporarily disable the onArtifactsChange callback to prevent auto-opening on load
@@ -376,13 +376,15 @@ export class AgentInterface extends LitElement {
376
376
  if (this.onModelSelect) {
377
377
  this.onModelSelect();
378
378
  } else {
379
- ModelSelector.open(state.model, (model) => session.setModel(model));
379
+ ModelSelector.open(state.model, (model) => {
380
+ session.state.model = model;
381
+ });
380
382
  }
381
383
  }}
382
384
  .onThinkingChange=${
383
385
  this.enableThinkingSelector
384
386
  ? (level: "off" | "minimal" | "low" | "medium" | "high") => {
385
- session.setThinkingLevel(level);
387
+ session.state.thinkingLevel = level;
386
388
  }
387
389
  : undefined
388
390
  }
@@ -11,7 +11,7 @@ import { renderMessage } from "./message-renderer-registry.js";
11
11
  export class MessageList extends LitElement {
12
12
  @property({ type: Array }) messages: AgentMessage[] = [];
13
13
  @property({ type: Array }) tools: AgentTool[] = [];
14
- @property({ type: Object }) pendingToolCalls?: Set<string>;
14
+ @property({ type: Object }) pendingToolCalls?: ReadonlySet<string>;
15
15
  @property({ type: Boolean }) isStreaming: boolean = false;
16
16
  @property({ attribute: false }) onCostClick?: () => void;
17
17
 
@@ -85,7 +85,7 @@ export class UserMessage extends LitElement {
85
85
  export class AssistantMessage extends LitElement {
86
86
  @property({ type: Object }) message!: AssistantMessageType;
87
87
  @property({ type: Array }) tools?: AgentTool<any>[];
88
- @property({ type: Object }) pendingToolCalls?: Set<string>;
88
+ @property({ type: Object }) pendingToolCalls?: ReadonlySet<string>;
89
89
  @property({ type: Boolean }) hideToolCalls = false;
90
90
  @property({ type: Object }) toolResultsById?: Map<string, ToolResultMessageType>;
91
91
  @property({ type: Boolean }) isStreaming: boolean = false;
@@ -6,7 +6,7 @@ import { property, state } from "lit/decorators.js";
6
6
  export class StreamingMessageContainer extends LitElement {
7
7
  @property({ type: Array }) tools: AgentTool[] = [];
8
8
  @property({ type: Boolean }) isStreaming = false;
9
- @property({ type: Object }) pendingToolCalls?: Set<string>;
9
+ @property({ type: Object }) pendingToolCalls?: ReadonlySet<string>;
10
10
  @property({ type: Object }) toolResultsById?: Map<string, ToolResultMessage>;
11
11
  @property({ attribute: false }) onCostClick?: () => void;
12
12
 
@@ -1,3 +1,4 @@
1
+ import type { AgentMessage } from "@mariozechner/pi-agent-core";
1
2
  import {
2
3
  ARTIFACTS_RUNTIME_PROVIDER_DESCRIPTION_RO,
3
4
  ARTIFACTS_RUNTIME_PROVIDER_DESCRIPTION_RW,
@@ -13,7 +14,7 @@ interface ArtifactsPanelLike {
13
14
  }
14
15
 
15
16
  interface AgentLike {
16
- appendMessage(message: any): void;
17
+ state: { messages: AgentMessage[] };
17
18
  }
18
19
 
19
20
  /**
@@ -171,7 +172,7 @@ export class ArtifactsRuntimeProvider implements SandboxRuntimeProvider {
171
172
  filename,
172
173
  content,
173
174
  });
174
- this.agent?.appendMessage({
175
+ this.agent?.state.messages.push({
175
176
  role: "artifact",
176
177
  action,
177
178
  filename,
@@ -192,7 +193,7 @@ export class ArtifactsRuntimeProvider implements SandboxRuntimeProvider {
192
193
  command: "delete",
193
194
  filename,
194
195
  });
195
- this.agent?.appendMessage({
196
+ this.agent?.state.messages.push({
196
197
  role: "artifact",
197
198
  action: "delete",
198
199
  filename,