Skip to content

Commit 8200c2a

Browse files
committed
Rename ai-ui-vue package to ai-foundation-sdk
Rename the publishable Vue/UI package from @halo-dev/ai-ui-vue to @halo-dev/ai-foundation-sdk across the repo. Updated imports in UI code, tests, README, and dev docs (dev/ui-message-stream.md); updated OpenSpec files and task lists to reference the new package name; adjusted ui/package.json workspace dependency and tsconfig path alias; and updated pnpm lock entries to reflect the workspace package rename. The package source location and runtime APIs remain the same—this change is a repo-wide rename of the package identity and references.
1 parent 9210d27 commit 8200c2a

24 files changed

Lines changed: 88 additions & 48 deletions

File tree

dev/ui-message-stream.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,10 @@ Map<String, Object> requestMap =
156156

157157
## Vue 前端接入
158158

159-
Vue 前端可以使用 `@halo-dev/ai-ui-vue` 直接消费 Halo UIMessage SSE 协议:
159+
Vue 前端可以使用 `@halo-dev/ai-foundation-sdk` 直接消费 Halo UIMessage SSE 协议:
160160

161161
```ts
162-
import { DefaultChatTransport, useChat } from '@halo-dev/ai-ui-vue'
162+
import { DefaultChatTransport, useChat } from '@halo-dev/ai-foundation-sdk'
163163

164164
const chat = useChat({
165165
id: 'conversation-1',
@@ -202,7 +202,7 @@ X-Halo-AI-UI-Message-Stream: v1
202202
前端可以为流式接收阶段配置运行时 schema 钩子:
203203

204204
```ts
205-
import { DefaultChatTransport, useChat } from '@halo-dev/ai-ui-vue'
205+
import { DefaultChatTransport, useChat } from '@halo-dev/ai-foundation-sdk'
206206

207207
const chat = useChat({
208208
id: 'conversation-1',
@@ -245,7 +245,7 @@ HTTP 请求、消息状态、Pinia 状态存储、Web Worker 或其他非 Vue
245245
UIMessage SSE 并聚合 assistant 消息,可以使用 `readUIMessageStream`
246246

247247
```ts
248-
import { readUIMessageStream, type UIMessage } from '@halo-dev/ai-ui-vue'
248+
import { readUIMessageStream, type UIMessage } from '@halo-dev/ai-foundation-sdk'
249249

250250
const response = await fetch('/apis/example.halo.run/v1alpha1/chat/stream', {
251251
method: 'POST',
@@ -316,10 +316,10 @@ assistant 的文本消息片段,但不会提供工具、reasoning、data、来
316316

317317
## Completion 与对象流
318318

319-
`@halo-dev/ai-ui-vue` 还提供两个文本流组合式函数:
319+
`@halo-dev/ai-foundation-sdk` 还提供两个文本流组合式函数:
320320

321321
```ts
322-
import { experimental_useObject, jsonSchema, useCompletion } from '@halo-dev/ai-ui-vue'
322+
import { experimental_useObject, jsonSchema, useCompletion } from '@halo-dev/ai-foundation-sdk'
323323

324324
const completion = useCompletion({
325325
api: '/apis/example.halo.run/v1alpha1/completion/stream',
@@ -367,15 +367,15 @@ OpenAPI 生成客户端适合生成类型、路径、headers 和请求体,但
367367
响应抽象成 `Promise`,不适合作为浏览器端 `ReadableStream` / SSE 的消费入口。推荐模式是:
368368

369369
1. 使用 OpenAPI 生成的参数构造器构造请求参数。
370-
2. 使用 `fromOpenAPIRequestArgs(...)` 转成 `@halo-dev/ai-ui-vue` 的预处理请求。
370+
2. 使用 `fromOpenAPIRequestArgs(...)` 转成 `@halo-dev/ai-foundation-sdk` 的预处理请求。
371371
3. 仍由 `DefaultChatTransport``useCompletion``experimental_useObject` 负责读取流。
372372

373373
```ts
374374
import {
375375
DefaultChatTransport,
376376
fromOpenAPIRequestArgs,
377377
useChat,
378-
} from '@halo-dev/ai-ui-vue'
378+
} from '@halo-dev/ai-foundation-sdk'
379379
import { ConsoleApiAifoundationHaloRunV1alpha1ModelApiAxiosParamCreator } from './api/generated'
380380

381381
const paramCreator = ConsoleApiAifoundationHaloRunV1alpha1ModelApiAxiosParamCreator()

openspec/changes/archive/2026-06-09-add-ai-ui-vue-package/design.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ The new package must be publishable for external Vue users and reusable by the c
1010

1111
**Goals:**
1212

13-
- Add `@halo-dev/ai-ui-vue` as a publishable Vue runtime package at `ui/packages/ai-ui-vue`.
13+
- Add `@halo-dev/ai-foundation-sdk` as a publishable Vue runtime package at `ui/packages/ai-ui-vue`.
1414
- Implement `useChat`, `useCompletion`, and `experimental_useObject` for Vue.
1515
- Include framework-neutral runtime primitives in the package: `Chat`, transports, stream readers, reducers, shared stores, tool continuation helpers, and TypeScript wire-contract types.
1616
- Make `Chat` independent from Vue by using a state adapter and callbacks; Vue composables provide refs and lifecycle cleanup.
@@ -22,7 +22,7 @@ The new package must be publishable for external Vue users and reusable by the c
2222

2323
**Non-Goals:**
2424

25-
- Do not add visual UI components to `@halo-dev/ai-ui-vue`.
25+
- Do not add visual UI components to `@halo-dev/ai-foundation-sdk`.
2626
- Do not depend on Halo Console-only packages or the generated console API client from the package.
2727
- Do not implement Vercel/AI SDK data-stream compatibility in the first release.
2828
- Do not add direct server-side Java SDK transports.
@@ -33,7 +33,7 @@ The new package must be publishable for external Vue users and reusable by the c
3333

3434
### Package Layout
3535

36-
Create `ui/packages/ai-ui-vue` and extend `ui/pnpm-workspace.yaml` to include packages. The package name is `@halo-dev/ai-ui-vue`, version `0.1.0`, ESM-only, with explicit `exports`, generated `.d.ts`, and `files: ["dist"]`.
36+
Create `ui/packages/ai-ui-vue` and extend `ui/pnpm-workspace.yaml` to include packages. The package name is `@halo-dev/ai-foundation-sdk`, version `0.1.0`, ESM-only, with explicit `exports`, generated `.d.ts`, and `files: ["dist"]`.
3737

3838
Rationale: this keeps npm-package code separate from plugin console code while allowing the console UI to consume it through the workspace. It also follows the package shape used by other `@halo-dev` frontend packages.
3939

openspec/changes/archive/2026-06-09-add-ai-ui-vue-package/proposal.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Halo AI Foundation already provides backend UI message streams and structured ou
44

55
## What Changes
66

7-
- Add a publishable `@halo-dev/ai-ui-vue` package under `ui/packages/ai-ui-vue`.
7+
- Add a publishable `@halo-dev/ai-foundation-sdk` package under `ui/packages/ai-ui-vue`.
88
- Provide Vue composables and supporting runtime APIs equivalent in scope to AI SDK UI for Vue: `useChat`, `useCompletion`, and `experimental_useObject`.
99
- Provide framework-neutral chat core primitives inside the package, including `Chat`, Halo chat transports, stream readers, message reducers, tool continuation helpers, and public TypeScript types for Halo UI messages.
1010
- Support Halo UIMessage SSE streams and text streams as the package transport protocols.

openspec/changes/archive/2026-06-09-add-ai-ui-vue-package/specs/ai-ui-vue-package/spec.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
## ADDED Requirements
22

33
### Requirement: Publishable Vue runtime package
4-
The system SHALL provide a publishable `@halo-dev/ai-ui-vue` package that is separate from the plugin console UI.
4+
The system SHALL provide a publishable `@halo-dev/ai-foundation-sdk` package that is separate from the plugin console UI.
55

66
#### Scenario: Package is separate from console source
77
- **WHEN** the frontend workspace is installed

openspec/changes/archive/2026-06-09-add-ai-ui-vue-package/specs/model-test-workbench/spec.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
## ADDED Requirements
22

33
### Requirement: Workbench dogfoods ai-ui-vue chat runtime
4-
The model test workbench SHALL use `@halo-dev/ai-ui-vue` for its UIMessage chat stream state and parsing path while preserving the existing console UI.
4+
The model test workbench SHALL use `@halo-dev/ai-foundation-sdk` for its UIMessage chat stream state and parsing path while preserving the existing console UI.
55

66
#### Scenario: Workbench uses package chat transport
77
- **WHEN** the administrator sends a chat test message through the workbench

openspec/changes/archive/2026-06-09-add-ai-ui-vue-package/specs/structured-output-generation/spec.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
## ADDED Requirements
22

33
### Requirement: Object streaming endpoint contract
4-
The system SHALL support frontend object generation endpoints that consume `@halo-dev/ai-ui-vue` object requests and stream JSON text.
4+
The system SHALL support frontend object generation endpoints that consume `@halo-dev/ai-foundation-sdk` object requests and stream JSON text.
55

66
#### Scenario: Endpoint derives object output from schema
77
- **WHEN** an object streaming request contains `schema` and omits `output`

openspec/changes/archive/2026-06-09-add-ai-ui-vue-package/specs/ui-message-stream/spec.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
## ADDED Requirements
22

33
### Requirement: Frontend package can consume UI message streams
4-
The Halo UI message stream protocol SHALL be consumable by the `@halo-dev/ai-ui-vue` default chat transport without backend-specific adapters in the frontend.
4+
The Halo UI message stream protocol SHALL be consumable by the `@halo-dev/ai-foundation-sdk` default chat transport without backend-specific adapters in the frontend.
55

66
#### Scenario: SSE events contain UI message chunks
77
- **WHEN** a backend endpoint returns a Halo UI message stream response
@@ -19,7 +19,7 @@ The Halo UI message stream protocol SHALL be consumable by the `@halo-dev/ai-ui-
1919
- **AND** the trigger values SHALL include `submit-message` and `regenerate-message`
2020

2121
### Requirement: Frontend package documentation for UI message streams
22-
Consumer documentation SHALL explain how Halo plugin authors expose endpoints for `@halo-dev/ai-ui-vue`.
22+
Consumer documentation SHALL explain how Halo plugin authors expose endpoints for `@halo-dev/ai-foundation-sdk`.
2323

2424
#### Scenario: Chat endpoint example
2525
- **WHEN** a plugin author reads `dev/ui-message-stream.md`

openspec/changes/archive/2026-06-09-add-ai-ui-vue-package/tasks.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
## 1. Package Setup
22

33
- [x] 1.1 Extend `ui/pnpm-workspace.yaml` to include `ui/packages/*`.
4-
- [x] 1.2 Create `ui/packages/ai-ui-vue` with package metadata for `@halo-dev/ai-ui-vue@0.1.0`.
4+
- [x] 1.2 Create `ui/packages/ai-ui-vue` with package metadata for `@halo-dev/ai-foundation-sdk@0.1.0`.
55
- [x] 1.3 Configure package TypeScript, build, exports, declaration output, and test setup.
66
- [x] 1.4 Verify the selected build tool can produce ESM and `.d.ts` output without console-only dependencies.
77

@@ -43,7 +43,7 @@
4343

4444
## 6. Workbench Dogfood
4545

46-
- [x] 6.1 Add the local workspace dependency from the console UI to `@halo-dev/ai-ui-vue`.
46+
- [x] 6.1 Add the local workspace dependency from the console UI to `@halo-dev/ai-foundation-sdk`.
4747
- [x] 6.2 Migrate the model test workbench chat UIMessage stream state and parsing path to the package runtime.
4848
- [x] 6.3 Preserve existing console layout, Chinese UI text, Markdown rendering, model attribution, parameter handling, and Halo components.
4949
- [x] 6.4 Preserve stop behavior, reasoning display separation, external tool result/error continuation, and approval response continuation.
@@ -52,7 +52,7 @@
5252
## 7. Documentation
5353

5454
- [x] 7.1 Write the package README with install instructions, exports, `useChat`, `useCompletion`, `experimental_useObject`, transports, and backend protocol examples.
55-
- [x] 7.2 Update `dev/ui-message-stream.md` with `@halo-dev/ai-ui-vue` chat endpoint integration guidance.
55+
- [x] 7.2 Update `dev/ui-message-stream.md` with `@halo-dev/ai-foundation-sdk` chat endpoint integration guidance.
5656
- [x] 7.3 Document object streaming request shape and final validation responsibilities in `dev/ui-message-stream.md`.
5757
- [x] 7.4 Ensure docs use Halo-owned wording and avoid presenting the package as an AI SDK-branded wrapper.
5858

@@ -62,4 +62,4 @@
6262
- [x] 8.2 Run frontend type-check and relevant workbench tests.
6363
- [x] 8.3 Run backend tests for changed endpoint behavior when backend code changes.
6464
- [x] 8.4 Run `git diff --check` (raw check reports regenerated client whitespace; non-generated diff check passes).
65-
- [x] 8.5 Review package dependency tree to confirm no console-only dependencies are bundled into `@halo-dev/ai-ui-vue`.
65+
- [x] 8.5 Review package dependency tree to confirm no console-only dependencies are bundled into `@halo-dev/ai-foundation-sdk`.

openspec/changes/archive/2026-06-11-add-ui-message-stream-reader/proposal.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Callers that do not want to use `Chat` or `useChat` currently have to manually c
44

55
## What Changes
66

7-
- Add a public `readUIMessageStream` helper to `@halo-dev/ai-ui-vue` for reading an existing Halo UIMessage stream into an assistant message result.
7+
- Add a public `readUIMessageStream` helper to `@halo-dev/ai-foundation-sdk` for reading an existing Halo UIMessage stream into an assistant message result.
88
- Support `AsyncIterable<UIMessageChunk>`, UIMessage SSE `ReadableStream<Uint8Array>`, and `Response` inputs.
99
- Reuse the existing reducer, runtime schema hooks, data callback semantics, and one-time tool-call notification semantics.
1010
- Return structured lifecycle results including final message, terminal information, status, error flags, and optional errors.

openspec/changes/archive/2026-06-11-add-ui-message-stream-reader/specs/ai-ui-vue-package/spec.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ The package SHALL expose a public `readUIMessageStream` helper for callers that
2121
- **AND** it SHALL NOT parse non-stream HTTP error bodies
2222

2323
#### Scenario: Reader is exported
24-
- **WHEN** a caller imports from `@halo-dev/ai-ui-vue`
24+
- **WHEN** a caller imports from `@halo-dev/ai-foundation-sdk`
2525
- **THEN** `readUIMessageStream` and its public option/result/status types SHALL be exported from the package entrypoint
2626

2727
### Requirement: Reader message creation options

0 commit comments

Comments
 (0)