@aibolabs/web-presentation 0.0.0-stage → 0.1.0

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.
Files changed (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +6 -2
  3. package/index.d.ts +11 -0
  4. package/package.json +25 -4
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 chldu2000
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,7 @@
1
- # Temporary Holding Version
1
+ # @aibolabs/web-presentation
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ 可信 Web renderer 的本地类型接口,只用 `import type` 导入。当前包不提供可执行 renderer,也不授权安装包向主 WebView 加载代码。
4
+
5
+ `PresentationProps` 描述本地视图参数和动作回调;`WebPresentationAdapter` 提供 mount,返回 update/dispose 句柄。这里允许 HTMLElement 与函数回调,因此消费者需要 DOM 类型库。它们不属于跨进程 JSON 协议,公共能力 SDK 不重导出这些类型。
6
+
7
+ 依赖方向为 Web 接口 → `@aibolabs/plugin-protocol`;协议包保持纯数据,不能反向依赖本包。Svelte 等具体框架实现留在宿主可信构建中。本包发布为 `@aibolabs/web-presentation`。
package/index.d.ts ADDED
@@ -0,0 +1,11 @@
1
+ import type { Snapshot, ActionMessage } from '@aibolabs/plugin-protocol';
2
+ /** Trusted, in-process Web interfaces. Never serialize these as plugin messages. */
3
+ export type PresentationProps = {
4
+ snapshot:Snapshot;
5
+ layout:'sidebar'|'central';
6
+ onAction:(message:ActionMessage)=>void;
7
+ focusTarget?:string|null;
8
+ detailPresentation?:'plain'|'numbered';
9
+ };
10
+ export type MountedPresentation = {update(snapshot:Snapshot,focusTarget?:string|null):void;dispose():Promise<void>};
11
+ export type WebPresentationAdapter = {mount(target:HTMLElement,props:PresentationProps):Promise<MountedPresentation>};
package/package.json CHANGED
@@ -1,6 +1,27 @@
1
1
  {
2
2
  "name": "@aibolabs/web-presentation",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "license": "MIT",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/chldu2000/aibo.git",
8
+ "directory": "packages/web-presentation"
9
+ },
10
+ "type": "module",
11
+ "files": [
12
+ "index.d.ts",
13
+ "README.md"
14
+ ],
15
+ "exports": {
16
+ ".": {
17
+ "types": "./index.d.ts"
18
+ }
19
+ },
20
+ "dependencies": {
21
+ "@aibolabs/plugin-protocol": "0.1.8"
22
+ },
23
+ "publishConfig": {
24
+ "access": "public",
25
+ "registry": "https://registry.npmjs.org/"
26
+ }
27
+ }