@ouhuang/pi-web-ui 0.65.1 → 0.65.2
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 +22 -19
- package/example/package.json +23 -23
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## [0.65.2] - 2026-04-06
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## [0.65.1] - 2026-04-05
|
|
8
8
|
|
|
9
9
|
## [0.65.0] - 2026-04-03
|
|
10
10
|
|
|
@@ -290,8 +290,8 @@
|
|
|
290
290
|
- **`createStreamFn`**: Creates a stream function with CORS proxy support. Reads proxy settings on each call for dynamic configuration.
|
|
291
291
|
|
|
292
292
|
- **Default `streamFn` and `getApiKey`**: `AgentInterface` now sets sensible defaults if not provided:
|
|
293
|
-
|
|
294
|
-
|
|
293
|
+
- `streamFn`: Uses `createStreamFn` with proxy settings from storage
|
|
294
|
+
- `getApiKey`: Reads from `providerKeys` storage
|
|
295
295
|
|
|
296
296
|
- **Proxy utilities exported**: `applyProxyIfNeeded`, `shouldUseProxyForProvider`, `isCorsError`, `createStreamFn`
|
|
297
297
|
|
|
@@ -308,6 +308,7 @@
|
|
|
308
308
|
### Migration Guide
|
|
309
309
|
|
|
310
310
|
**Before (0.30.x):**
|
|
311
|
+
|
|
311
312
|
```typescript
|
|
312
313
|
import { Agent, ProviderTransport, type AppMessage } from '@mariozechner/pi-web-ui';
|
|
313
314
|
|
|
@@ -318,32 +319,34 @@ const agent = new Agent({
|
|
|
318
319
|
```
|
|
319
320
|
|
|
320
321
|
**After:**
|
|
322
|
+
|
|
321
323
|
```typescript
|
|
322
|
-
import { Agent, type AgentMessage } from '@mariozechner/pi-agent-core'
|
|
323
|
-
import { defaultConvertToLlm } from '@mariozechner/pi-web-ui'
|
|
324
|
+
import { Agent, type AgentMessage } from '@mariozechner/pi-agent-core'
|
|
325
|
+
import { defaultConvertToLlm } from '@mariozechner/pi-web-ui'
|
|
324
326
|
|
|
325
327
|
const agent = new Agent({
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
})
|
|
328
|
+
convertToLlm: (messages: AgentMessage[]) => {
|
|
329
|
+
// Extend defaultConvertToLlm for custom types
|
|
330
|
+
return defaultConvertToLlm(messages)
|
|
331
|
+
},
|
|
332
|
+
})
|
|
331
333
|
// AgentInterface will set streamFn and getApiKey defaults automatically
|
|
332
334
|
```
|
|
333
335
|
|
|
334
336
|
**Custom message types:**
|
|
337
|
+
|
|
335
338
|
```typescript
|
|
336
339
|
// Before: declaration merging on CustomMessages
|
|
337
|
-
declare module
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
340
|
+
declare module '@mariozechner/pi-web-ui' {
|
|
341
|
+
interface CustomMessages {
|
|
342
|
+
'my-message': MyMessage
|
|
343
|
+
}
|
|
341
344
|
}
|
|
342
345
|
|
|
343
346
|
// After: declaration merging on CustomAgentMessages
|
|
344
|
-
declare module
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
347
|
+
declare module '@mariozechner/pi-agent-core' {
|
|
348
|
+
interface CustomAgentMessages {
|
|
349
|
+
'my-message': MyMessage
|
|
350
|
+
}
|
|
348
351
|
}
|
|
349
352
|
```
|
package/example/package.json
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
2
|
+
"name": "pi-web-ui-example",
|
|
3
|
+
"version": "0.65.2",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "vite",
|
|
8
|
+
"build": "vite build",
|
|
9
|
+
"preview": "vite preview",
|
|
10
|
+
"check": "tsgo --noEmit",
|
|
11
|
+
"clean": "shx rm -rf dist"
|
|
12
|
+
},
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"@mariozechner/mini-lit": "^0.2.0",
|
|
15
|
+
"@ouhuang/pi-ai": "file:../../ai",
|
|
16
|
+
"@ouhuang/pi-web-ui": "file:../",
|
|
17
|
+
"@tailwindcss/vite": "^4.1.17",
|
|
18
|
+
"lit": "^3.3.1",
|
|
19
|
+
"lucide": "^0.544.0"
|
|
20
|
+
},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"typescript": "^5.7.3",
|
|
23
|
+
"vite": "^7.1.6"
|
|
24
|
+
}
|
|
25
25
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ouhuang/pi-web-ui",
|
|
3
|
-
"version": "0.65.
|
|
3
|
+
"version": "0.65.2",
|
|
4
4
|
"description": "Reusable web UI components for AI chat interfaces powered by @ouhuang/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
|
-
"@ouhuang/pi-ai": "^0.65.
|
|
22
|
-
"@ouhuang/pi-tui": "^0.65.
|
|
21
|
+
"@ouhuang/pi-ai": "^0.65.2",
|
|
22
|
+
"@ouhuang/pi-tui": "^0.65.2",
|
|
23
23
|
"docx-preview": "^0.3.7",
|
|
24
24
|
"jszip": "^3.10.1",
|
|
25
25
|
"lucide": "^0.544.0",
|