diff --git a/.gitignore b/.gitignore index 498293339a..a5fa33ceee 100644 --- a/.gitignore +++ b/.gitignore @@ -130,10 +130,36 @@ src/apps/mobile/android/.kotlin/ /resources/flashgrep/flashgrep-* /resources/flashgrep/*.download-* +# Local HarmonyOS PC scaffold build output and signing material under +# src/apps/ohos. Written per-directory for the same reason as the Gradle block +# above: a bare `.hvigor/` or `build/` would hide checked-in files elsewhere. +# Hvigor copies frontend bundles and build metadata into the entry resfile. +/src/apps/ohos/entry/src/main/resources/resfile/THIRD_PARTY_NOTICES.md +/src/apps/ohos/entry/src/main/resources/resfile/ohos-build.json +/src/apps/ohos/entry/src/main/resources/resfile/resources/ext-host/extension-host.js +/src/apps/ohos/entry/src/main/resources/resfile/resources/worker_host.js +/src/apps/ohos/.hvigor/ +/src/apps/ohos/**/.hvigor/ +/src/apps/ohos/oh_modules/ +/src/apps/ohos/**/oh_modules/ +/src/apps/ohos/*/build/ +/src/apps/ohos/**/build/ +/src/apps/ohos/*/libs/ +# hvigor writes a BuildProfile.ets next to each module during the build. +/src/apps/ohos/*/BuildProfile.ets +# Same policy as src/apps/mobile/harmonyos/.gitignore: signing credentials and +# installable artifacts never leave the machine. +/src/apps/ohos/signing.local.json* +/src/apps/ohos/*.cer +/src/apps/ohos/*.p12 +/src/apps/ohos/*.p7b +/src/apps/ohos/*.hap +/src/apps/ohos/*.app + # Local generated workspace output. /output/ # Retired implementation-process notes stay local; durable docs live with their owner. /docs/superpowers/ -AGENTS.override.md \ No newline at end of file +AGENTS.override.md diff --git a/Cargo.lock b/Cargo.lock index dbcaed04a5..a71dc8b581 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -622,16 +622,6 @@ version = "0.23.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac07cdecf99051d9a5238b80f35af32cdeba5b336e55d957b318b50137e18da5" -[[package]] -name = "base64-simd" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "339abbe78e73178762e23bea9dfd08e697eb3f3301cd4be981c0f78ba5859195" -dependencies = [ - "outref", - "vsimd", -] - [[package]] name = "base64ct" version = "1.8.3" @@ -1160,15 +1150,6 @@ dependencies = [ "error-code", ] -[[package]] -name = "cobs" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa961b519f0b462e3a3b4a34b64d119eeaca1d59af726fe450bbba07a9fc0a1" -dependencies = [ - "thiserror 2.0.19", -] - [[package]] name = "color_quant" version = "1.1.0" @@ -2269,18 +2250,6 @@ version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ef6b89e5b37196644d8796de5268852ff179b44e96276cf4290264843743bb7" -[[package]] -name = "embedded-io" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef1a6892d9eef45c8fa6b9e0086428a2cca8491aca8f787c534a3d6d0bcb3ced" - -[[package]] -name = "embedded-io" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" - [[package]] name = "encoding_rs" version = "0.8.35" @@ -2511,7 +2480,7 @@ dependencies = [ "bit_field", "half", "lebe", - "miniz_oxide 0.8.9", + "miniz_oxide", "num-complex", "pulp", "rayon-core", @@ -2638,7 +2607,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "843fba2746e448b37e26a819579957415c8cef339bf08564fe8b7ddbd959573c" dependencies = [ "crc32fast", - "miniz_oxide 0.8.9", + "miniz_oxide", "zlib-rs", ] @@ -3509,12 +3478,6 @@ dependencies = [ "digest 0.10.7", ] -[[package]] -name = "hmac-sha1-compact" -version = "1.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0b3ba31f6dc772cc8221ce81dbbbd64fa1e668255a6737d95eeace59b5a8823" - [[package]] name = "home" version = "0.5.12" @@ -4120,15 +4083,6 @@ dependencies = [ "either", ] -[[package]] -name = "itertools" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b4baf93f58d4425749ca49a51c50ebab072c5df6994d08fed93541c331481dc" -dependencies = [ - "either", -] - [[package]] name = "itoa" version = "1.0.18" @@ -4315,12 +4269,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "json-escape-simd" -version = "3.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c22a2041e3874a055a4eb03ea2395aaccdefa84ce75b31d542d72a741c3c6ad3" - [[package]] name = "json-patch" version = "3.0.1" @@ -4984,15 +4932,6 @@ dependencies = [ "simd-adler32", ] -[[package]] -name = "miniz_oxide" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b63fbc4a50860e98e7b2aa7804ded1db5cbc3aff9193adaff57a6931bf7c4b4c" -dependencies = [ - "adler2", -] - [[package]] name = "mio" version = "1.2.2" @@ -6781,7 +6720,6 @@ dependencies = [ "openbitfun-product-domains", "openbitfun-runtime-ports", "openbitfun-services-core", - "oxc", "pulldown-cmark", "qrcode", "rand 0.8.7", @@ -6990,12 +6928,6 @@ dependencies = [ "thiserror 2.0.19", ] -[[package]] -name = "outref" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a80800c0488c3a21695ea981a54918fbb37abf04f4d0720c453632255e2ff0e" - [[package]] name = "owo-colors" version = "4.3.0" @@ -7011,27 +6943,10 @@ dependencies = [ "oxc_allocator", "oxc_ast", "oxc_ast_visit", - "oxc_codegen", "oxc_diagnostics", "oxc_parser", - "oxc_semantic", "oxc_span", "oxc_syntax", - "oxc_transformer", - "oxc_transformer_plugins", -] - -[[package]] -name = "oxc-browserslist" -version = "3.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6967692b4c51de292573c3f5eed236b6df29ac47d122379ad3a9d209776a9cf3" -dependencies = [ - "miniz_oxide 0.9.1", - "postcard", - "rustc-hash 2.1.3", - "serde", - "thiserror 2.0.19", ] [[package]] @@ -7115,49 +7030,11 @@ dependencies = [ "oxc_syntax", ] -[[package]] -name = "oxc_codegen" -version = "0.138.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b9feb869721e14ab8484c697372c468a3df3cb96ca8c02bfe34981fc8d614e9" -dependencies = [ - "bitflags 2.11.1", - "cow-utils", - "dragonbox_ecma", - "itoa", - "oxc_allocator", - "oxc_ast", - "oxc_data_structures", - "oxc_index", - "oxc_semantic", - "oxc_sourcemap", - "oxc_span", - "oxc_str", - "oxc_syntax", - "rustc-hash 2.1.3", -] - -[[package]] -name = "oxc_compat" -version = "0.138.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad6fd43a0b19ee2f8c190c4ff4918b1f22e2af605cd3a032eea9099ba5ec6f3f" -dependencies = [ - "cow-utils", - "oxc-browserslist", - "oxc_syntax", - "rustc-hash 2.1.3", - "serde", -] - [[package]] name = "oxc_data_structures" version = "0.138.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "30c920b812d5c7cd2c6b914dbeda4a7e6720e1de7869119b6de833ae39bedac9" -dependencies = [ - "ropey", -] [[package]] name = "oxc_diagnostics" @@ -7243,42 +7120,6 @@ dependencies = [ "unicode-id-start", ] -[[package]] -name = "oxc_semantic" -version = "0.138.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7074088f38672fbafd4aa79f516835661ff539175858323f287775e2d9c89449" -dependencies = [ - "itertools 0.15.0", - "memchr", - "oxc_allocator", - "oxc_ast", - "oxc_ast_visit", - "oxc_data_structures", - "oxc_diagnostics", - "oxc_ecmascript", - "oxc_index", - "oxc_span", - "oxc_str", - "oxc_syntax", - "rustc-hash 2.1.3", - "self_cell 1.3.0", - "smallvec", -] - -[[package]] -name = "oxc_sourcemap" -version = "8.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b415102a94b483bbd76d13e850fe87961197e5795c79a8523ebec5d82025f94f" -dependencies = [ - "base64-simd", - "json-escape-simd", - "rustc-hash 2.1.3", - "serde", - "serde_json", -] - [[package]] name = "oxc_span" version = "0.138.0" @@ -7325,78 +7166,6 @@ dependencies = [ "unicode-id-start", ] -[[package]] -name = "oxc_transformer" -version = "0.138.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87a71b406724d9e1b3bdf8c700207524268a232af7e13302aeea53f98168e05d" -dependencies = [ - "base64 0.22.1", - "compact_str 0.9.1", - "hmac-sha1-compact", - "indexmap 2.14.0", - "itoa", - "memchr", - "oxc_allocator", - "oxc_ast", - "oxc_ast_visit", - "oxc_compat", - "oxc_data_structures", - "oxc_diagnostics", - "oxc_ecmascript", - "oxc_regular_expression", - "oxc_semantic", - "oxc_span", - "oxc_str", - "oxc_syntax", - "oxc_traverse", - "rustc-hash 2.1.3", - "serde", - "serde_json", -] - -[[package]] -name = "oxc_transformer_plugins" -version = "0.138.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c56f5cec2db3cdfc8268cb29a267a0c7927e065f431575caf63457609e26fcd" -dependencies = [ - "cow-utils", - "itoa", - "oxc_allocator", - "oxc_ast", - "oxc_ast_visit", - "oxc_diagnostics", - "oxc_ecmascript", - "oxc_parser", - "oxc_semantic", - "oxc_span", - "oxc_str", - "oxc_syntax", - "oxc_transformer", - "oxc_traverse", - "rustc-hash 2.1.3", -] - -[[package]] -name = "oxc_traverse" -version = "0.138.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c380b884f59c1f974f7ab966d758c31f3a765278d0348e6ec012c07fefd9da07" -dependencies = [ - "itoa", - "oxc_allocator", - "oxc_ast", - "oxc_ast_visit", - "oxc_data_structures", - "oxc_ecmascript", - "oxc_semantic", - "oxc_span", - "oxc_str", - "oxc_syntax", - "rustc-hash 2.1.3", -] - [[package]] name = "p256" version = "0.13.2" @@ -7808,7 +7577,7 @@ dependencies = [ "crc32fast", "fdeflate", "flate2", - "miniz_oxide 0.8.9", + "miniz_oxide", ] [[package]] @@ -7821,7 +7590,7 @@ dependencies = [ "crc32fast", "fdeflate", "flate2", - "miniz_oxide 0.8.9", + "miniz_oxide", ] [[package]] @@ -7927,18 +7696,6 @@ dependencies = [ "winreg 0.10.1", ] -[[package]] -name = "postcard" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6764c3b5dd454e283a30e6dfe78e9b31096d9e32036b5d1eaac7a6119ccb9a24" -dependencies = [ - "cobs", - "embedded-io 0.4.0", - "embedded-io 0.6.1", - "serde", -] - [[package]] name = "potential_utf" version = "0.1.5" @@ -8566,16 +8323,6 @@ dependencies = [ "syn 2.0.119", ] -[[package]] -name = "ropey" -version = "1.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93411e420bcd1a75ddd1dc3caf18c23155eda2c090631a85af21ba19e97093b5" -dependencies = [ - "smallvec", - "str_indices", -] - [[package]] name = "roxmltree" version = "0.21.1" @@ -10045,12 +9792,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" -[[package]] -name = "str_indices" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d08889ec5408683408db66ad89e0e1f93dff55c73a4ccc71c427d5b277ee47e6" - [[package]] name = "strict-num" version = "0.1.1" @@ -11825,12 +11566,6 @@ version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" -[[package]] -name = "vsimd" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c3082ca00d5a5ef149bb8b555a72ae84c9c59f7250f013ac822ac2e49b19c64" - [[package]] name = "vswhom" version = "0.1.0" diff --git a/docs/architecture/agent-runtime-services-design.md b/docs/architecture/agent-runtime-services-design.md index f27549b55e..1f624aacf7 100644 --- a/docs/architecture/agent-runtime-services-design.md +++ b/docs/architecture/agent-runtime-services-design.md @@ -698,7 +698,7 @@ agent-workflows - 当前没有第二个可执行 provider,因此不建立通用 workflow trait、registry、descriptor 或 step engine。 - 工作流策略保持无 I/O;需要编排 Runtime / Tool 时,只增加当前生产调用链所需的窄接口。 - 产品命令只映射到工作流能力,不把命令展示逻辑下沉。 -- MiniApp、Canvas 是产品产物与呈现能力,不进入该 crate。 +- MiniApp、GenUI 是产品产物与呈现能力,不进入该 crate。 - DeepReview 仍有兼容逻辑位于 `agent-runtime` 与 `assembly/core`;只有真实调用方切换、行为等价测试通过且旧写入方删除后,才算迁移完成。 ## 4. 产品组装与扩展 diff --git a/docs/architecture/appearance-package-system.md b/docs/architecture/appearance-package-system.md index 56904ddd2f..b70d22edbe 100644 --- a/docs/architecture/appearance-package-system.md +++ b/docs/architecture/appearance-package-system.md @@ -349,7 +349,7 @@ Portal 必须挂载到统一 `AppearanceOverlayHost`,Portal 内组件仍使用 ## 独立渲染器 -Monaco、xterm、canvas、mermaid、生成式 widget 等不依赖普通 DOM CSS 的渲染器通过 +Monaco、xterm、mermaid、生成式 widget 等不依赖普通 DOM CSS 的渲染器通过 `AppearanceRendererAdapter` 注册: ```ts @@ -357,8 +357,7 @@ interface AppearanceRendererSettingsMap { monaco: MonacoAppearanceSettings; xterm: XtermAppearanceSettings; mermaid: MermaidAppearanceSettings; - canvas: CanvasAppearanceSettings; - widget: WidgetAppearanceSettings; + 'generative-widget': WidgetAppearanceSettings; } interface AppearanceRendererAdapter { diff --git a/docs/architecture/generative-ui-architecture.md b/docs/architecture/generative-ui-architecture.md new file mode 100644 index 0000000000..b650a331db --- /dev/null +++ b/docs/architecture/generative-ui-architecture.md @@ -0,0 +1,188 @@ +# GenUI 双路径应用架构 + +本文定义 GenUI 的目标产品和运行时边界。迁移未完成前,已接线代码仍是生产事实;本文中的目标能力不得据此描述为已交付。产品架构索引链接到本文件,本文件是 GenUI 架构的唯一专题设计文档。 + +## 产品决定 + +GenUI 提供两种源码表达,共用应用身份、版本、状态、宿主能力、持久化、候选验收和远程归属: + +| 路径 | 模型生成的源码 | 适用范围 | +| --- | --- | --- | +| 组件应用 | OpenUI Lang 描述 | 表单、列表、看板、数据应用及可信组件可表达的交互 | +| 自由文档 | HTML、CSS、SVG,可选受控 JavaScript | 特殊排版、可视化、动画和组件库难以表达的交互 | + +创建应用时,用户选择组件库及其绑定的 UI 规范配置。规范配置同时适用于两种源码类型,不是只供模型参考的风格 prompt。它定义可用组件库、样式资源、设计规则、支持的源码类型、目标视口、宿主绘制的外壳区域和必需验收项。自由文档必须在该视口中真实渲染、检查并根据可测诊断修正;不能从提示词或静态源码扫描推断其符合规范。 + +默认 `openui` profile 复现 Open Intelligent UI 的即时回答路径:模型流式输出 OpenUI Lang,Renderer 直接在 FlowChat 内联渲染,本地状态和声明动作立即生效,也不自动打开右侧工作台。只有显式选择 `harmony` profile 时,才进入 profile → design spec → viewport/shell → checker 的交付分层并提供侧栏展开;这套交付分层吸收 `harmony-genui` 的做法,把组件库选择绑定到可持久化、可执行验收的生成目标。OpenBitFun 将 Harmony 交付模式收敛到自己的应用 owner、权限和远程执行边界内。 + +组件路径直接采用 OpenUI `lang-core` 和 `react-lang` 的语言运行时。产品可以注册和扩展可信组件库;模板提供可选的起始结构和生成提示,不能限制模型自由组合现有组件。组件能力不足时,或用户明确要求自由设计时,使用自由文档路径。生成失败本身不是切换路径的理由;描述错误应携带诊断修复,只有组件表达能力不足才改用自由文档。旧的语义消息图已经退役;`source` 缺省的记录不可执行,必须由用户显式重新生成 OpenUI/HTML source。新组件生成只写入 `source.kind = openui-lang`。 + +模型不得生成 TSX、React 源码或其他需按应用编译的代码。不得恢复 Canvas TSX 编译链。可信组件的实现可以由产品开发者用 React/TSX 编写并随应用构建发布;这不属于模型生成执行路径。 + +MiniApp 保持自己的源码、打包、安装、权限及运行生命周期。GenUI 使用已有宿主和 Runtime 能力时通过其稳定接口,不把 MiniApp 改造成另一种 GenUI 源码格式。 + +## 系统边界 + +```mermaid +flowchart TD + L[可信产品组件库与可选模板] --> O[OpenUI Lang 源码] + O --> OR[OpenUI 解析、绑定、状态与组件渲染] + D[HTML / CSS / SVG / 受控 JS 源码] --> DR[隔离文档渲染器] + OR --> A[共同 GenUI 应用 owner] + DR --> A + A --> H[有权限的宿主能力适配器] + A --> V[候选检查与证据] + V --> C[按 owner revision 原子接受] + A --> S[源码、用户状态和修订持久化] + H --> R[现有 Agent Runtime / 平台能力] +``` + +语言解析和渲染留在各自运行时;产品数据与交付生命周期只由一个应用 owner 管理。禁止把 OpenUI 源码翻译到旧节点图或流程解释器后再执行,也禁止把两种源码都转换成任意 HTML/JS 后失去各自的类型和信任边界。 + +| 所有者 | 职责 | 禁止事项 | +| --- | --- | --- | +| Agent 工具与 Assembly | 选择生成类型、固定组件库与 UI 规范 ID/修订、生成提示和候选身份 | 实现组件、文件 IO、浏览器沙箱或持久化 | +| OpenUI 产品库 | 组件契约、组合、提示、renderer、纯函数和受信任动作声明 | 访问会话 store、平台 API 或直接写用户数据 | +| 自由文档运行时 | 静态文档渲染、隔离脚本执行、桥接消息协议 | 暴露 Tauri、Node、宿主凭据或任意未经授权的接口 | +| GenUI 应用 owner | 源码/状态修订、候选、CAS、保存重开、证据和来源归属 | 解析或重新实现 OpenUI Lang 语义 | +| 平台与 Runtime adapter | 对文件、工具、Agent、网络和其他宿主能力做授权执行 | 使用控制端本地上下文代替目标 owner 的归属 | +| 候选 checker | 在隔离实例中检查源码、实际渲染和声明交互 | 触碰正式用户状态或产生真实外部副作用 | + +## OpenUI 组件路径 + +### Library Registry 与组件库适配器 + +OpenUI 提供共同的 Lang/parser/state/Renderer 运行时,同时注册三套可独立选择的 profile:`openui` 使用上游 `openui.v1` native library,`openbitfun` 使用 `openbitfun.composable.v1`,`harmony` 使用 `openbitfun.harmony.v1`。每套 profile 都绑定自己的 adapter、prompt、CSS/style resources、design spec 和 revision;只读契约是同一 adapter 的明确权限变体,不能改变其来源身份。 + +`openbitfun` adapter 用 `@openbitfun/ui` 承载 Button、IconButton、Input、Textarea、Select、SegmentedControl、Checkbox、Radio 和 Card 等基础控件,再用 `oiComponents` 保留 Chart、Map、Svg、HtmlView、Table 和媒体等 GenUI 专用 renderer;所有实现都先绑定 OpenBitFun 的 contract 和 positional signature,再经过 adapter 自己的 DOM inspector、action/query bridge、CSS/token scope 和 revision 校验。`openui` profile 则直接使用 vendored `open-intelligent-ui/src/lib/library.ts`、其 `components/*` 和 CSS;它不经过 `oiComponents`。任何 profile 都不会携带第二套 parser、state 或旧 graph runtime。 + +应用保存 `libraryId` 与 `libraryRevision`,并在 owner readback、candidate evidence、远程请求和重开时逐字段校验。设置页只改变下一次生成使用的 registry entry;已接受应用由保存的 identity 解析 schema、prompt、designSpec、renderer 和 bridge,不能通过 template 或全局配置重新推断组件库。未知或缺少 identity 的记录保留原始内容并显示不可运行状态,禁止换成 OpenUI、OpenBitFun 或 graph fallback。 + +HOS7 暂不属于受支持的 GenUI 目标,不进入当前 library registry、生成 schema 或交付路径。后续如重新支持,必须以独立 adapter、明确许可、目标端能力协商和单独验收契约重新接入。Harmony-genui 只提取 design-system、token 和 Plot 能力,不嵌入旧 graph/schema/action runtime。 + +### 组件库与模板 + +以 OpenUI 的 `defineComponent`、`createLibrary` 和 `library.extend` 作为组件描述、schema、说明、renderer、函数、动作与组合规则的定义机制。产品注册可信实现;模型只能引用当前构建和产品配置实际提供的组件。添加、替换和移除组件必须同步影响生成提示及运行时校验,不能另外手写一份模型专用组件目录。 + +模型上下文必须同时包含 OpenUI Lang 的最小语法和当前 profile 的可执行提示。`openui` 使用上游生成的 system prompt 和上游 library spec;`openbitfun`、`harmony` 则从各自 catalog library 派生位置参数签名和 worked examples。Rust 工具 schema 只暴露当前 profile 的 template、library、revision 和 design spec,系统提示也只注入当前 profile 的 library。组件路径中的 `createRecord`、`patchRecord` 等旧兼容图动作不应被提示为 OpenUI `@` 动作。 + +同一产品可以提供多个有明确版本的组件库或扩展。组件库 ID 和修订在候选创建时固定,设置变化只作用于新候选。已有应用按它保存的库契约解析;未知库、运行时或组件版本应保留原始数据并显示不可用状态,不静默换库。 + +模板是可选的初始示例和任务约束。没有适合模板时仍可从所选库的合法根组件开始自由组合。组件库、模板、生成提示和检查器共享一份构建期产品定义;Rust 边界只验证通用 envelope、源码格式标识和 owner 约束,不复制 OpenUI parser 或运行语义。 + +组件作者提供实际 renderer、限于组件拥有 DOM 的 `inspect`,以及声明事件的隔离 `exercise`。探针只生成隔离状态,不得调用正式保存、权限接口或外部工具。任何外部副作用均通过 OpenBitFun 注册的宿主能力,遵守现有权限、取消、deadline、重试及远程 mailbox 语义。需要原子性的多步操作由一个 owner mutation 完成;OpenUI 顺序动作不自动等于事务。 + +### UI 规范配置与目标身份 + +产品配置以同一个版本化清单声明组件库 profile 与 `designSpec` 的绑定。规范至少包含 `componentLibraries`、`styleResources`、`rules`、`sourceKinds`、`viewport`、`shell` 和 `acceptance.checks`;构建校验确保 profile 的每个模板只使用规范允许的组件库。模型上下文收到选中规范的完整约束和资源 ID,模型不能自行选择或覆盖该身份。Rust owner 从受信任 profile/既有 owner 解析它,并在候选 app 中写入 `{ id, revision }`。 + +`designSpec` 是应用目标身份的一部分,与源码修订和状态分开持久化,但在候选 CAS、保存、重开和远程执行期间固定。修改既有 app(相同 app ID)继承 owner 已接受的规范,即使当前全局设置已改变;设置只决定新 app。显式更换规范必须是可检查的新 app 修订,检查组件库兼容性与用户数据迁移,不能在打开应用时跟随设置漂移。旧记录缺少该字段时显示不可运行,不再按模板推断或改写身份;未知/已移除规范保留原值并显示不可运行。 + +Owner 的读取和状态保存请求必须回显 `libraryId`、`libraryRevision`、`designSpec` 与 `sourceKind`;目标 owner 会把它们与已接受修订逐字段比较,缺失或不一致都返回 unsupported/error,不允许另一套 adapter 或源码类型的响应冒充当前应用。 + +规范的 `shell` 区分宿主绘制与生成内容。Harmony 手机规范固定 360 x 764 CSS px 视口,36 px 状态栏和设备外壳由宿主绘制,内容左右 inset 为 16 px,目标内容宽度 328 px。模型只能生成屏幕内容。OpenUI 组件路径使用规范绑定的 Harmony OpenUI library;HTML/CSS/SVG 路径收到同一身份、资源与规则,在相同宿主 shell 和固定视口验收。实际 DOM/几何检查至少验证视口尺寸、宿主 shell 部件、内容边界和横向溢出,并将精确诊断返回候选修正。若自由文档仍违规,修正后必须重跑同一规范检查;提示词本身不是通过证据。 + +### 流式和交互 + +从 Agent 工具参数事件中增量提取 OpenUI Lang 文本,使用 OpenUI 流式 parser 投影逐步完成的语句。传输 adapter 只负责解包、解转义、识别重置和追加,不解析语言、不重新实现语句缓存。组件预览使用固定的库修订;首屏允许本地状态交互,但会产生外部副作用的 action 仍须经过 owner、权限和交付层。候选结束后,完整原文必须经同一 OpenUI library 终态解析,且不得有未完成语法、未解析引用或阻断性 schema 错误。 + +React 组件身份和列表 key 必须经过真实插入、删除、重排测试。OpenUI statement ID 不等于所有数组渲染都具有稳定项身份;不能仅凭 parser 缓存断言焦点、输入状态或局部组件状态不会错位。确有上游缺口时优先以可追踪补丁修复或向上游提交,不复制 parser。 + +持久化的 OpenUI 用户状态使用版本化 JSON 数据,恢复后交给 `Renderer.initialState`,更新交给 `onStateUpdate` 与应用 owner。前端编辑态可以立即更新,只有 owner 确认写入后才能报告保存成功。外部查询和 mutation 必须进入宿主能力;状态更新不能绕过 owner CAS。 + +## HTML / SVG 自由生成路径 + +自由文档将 HTML、CSS 和 SVG 作为文档源码保存;交互脚本是独立、可选的源码字段。页面源码可以组织自己的 DOM、图形和动画,不能内嵌 TSX 构建器、远程脚本包或隐式模块加载器。模型不能通过脚本直接调用文件系统、Shell、内部 API、用户凭据或正式持久化。 + +隔离文档使用独立的 sandboxed iframe 和不透明 origin。允许执行脚本时使用 `sandbox="allow-scripts"`,不授予 `allow-same-origin`、表单提交、弹窗或顶层导航权限。宿主不通过 `contentDocument.write` 执行候选;以受控 `srcdoc`/文档更新通道交付源码,并在目标平台确认嵌入 API 不会把 Tauri 能力注入子文档。 + +内容策略默认拒绝网络、子框架、对象、表单目标、外部字体和外部脚本。候选检查和流式预览阶段不执行脚本;只在源码封存后的隔离检查实例启动脚本。HTML 预处理必须使用支持 SVG 的结构化 parser/sanitizer,删除脚本元素、内联事件属性、危险 URL 和不支持的嵌入资源;最终受控脚本从独立字段装载。拒绝 `eval`/`new Function`、动态 import 和远程模块。确有资源需要时,通过目标 owner 上明确定义并经授权的资源能力提供,不直接放开通用网络访问。 + +当前实现已经接通 `source.kind = openui-lang` 和静态自由文档 `source.kind = html-document`:前者交给 `@openuidev/react-lang` 的 OpenUI parser/renderer,并由产品 catalog 适配可信组件;后者把 HTML/CSS/SVG 以源码字段持久化,经过当前 HTML sanitizer 后放入不透明 origin 的全限制 sandbox iframe。脚本策略由宿主显式控制;检查模式使用一次性 nonce CSP,并在检查时禁用候选脚本。两者共用 designSpec、宿主外壳、布局检查、候选 CAS 和保存重开流程。自由文档 iframe 接收 designSpec/style-resource 元数据,并在宿主可提供 token 时复制受控的 OpenBitFun CSS token 基线,使 Harmony 的实际屏幕背景、文字和 SVG 默认使用同一套宿主资源;生成文档仍可显式覆盖自己的内容样式,规范检查继续以实际几何和宿主边界为准。OpenUI 的表单状态回调已经接入 owner 保存,组件声明的 action 通过 `Renderer.onAction` 传给 owner,`Query`/`Mutation` 通过 `GenUIAsyncRuntimeController` 适配成 OpenUI 的 `toolProvider`;它保留 OpenUI 的 cache/loading/error/retry 语义,并额外携带 AbortSignal、request identity、permission、target 和 targetId。已授权的 `ChatMcpCatalog` 通过 `createGenUIMcpProvider` 映射为同一 provider:只允许 catalog 中的 server/tool,JSON-RPC `result`/`error`、structured content 和 text content 在边界层解包,Mutation 必须由宿主显式列入声明。`Image`/`SearchImage` 的图片搜索、显式 URL 失败后的候选回退、`Map` 的异步 marker 查询和可选路线查询也使用同一 capability registry;宿主内置 provider 通过 `gen_ui_provider_call` 统一承接 360 图搜、百度图搜、Wikipedia/Commons、Nominatim、OSRM 和 Valhalla,组件不直接访问外部 `/api`。已授权的 MCP 同名 capability 优先,内置 provider 填充缺口;当宿主命令或目标端确实不可用时才保持显式 unsupported。source 替换、组件查询变化和卸载都会取消请求,迟到结果不能回写旧文档。自由文档的 `script` 默认仍不执行;只有宿主显式传入命名 `htmlBridge` 时才使用 `sandbox="allow-scripts"`,脚本通过 `window.openbitfunWidget.request` 发消息,父层校验 frame 来源、capability 名称并带 app/source/designSpec 身份调用 handler,再把结果返回。脚本入口会阻断 `eval`、`new Function` 和动态 `import`,CSP、opaque origin、无 same-origin/网络/表单/导航权限继续有效。产品仍需为每个宿主能力注册参数 schema、权限、取消和远程归属;iframe 不能被当作 CPU/内存级沙箱。生成脚本可以随自由文档源码保存,但在尚未协商出受控桥接能力的 host 上保持禁用。 + +自由文档的实际交付检查还会由宿主向 opaque iframe 注入一次性的只读 inspection probe。probe 不执行候选脚本,也不读取宿主凭据;它只报告可验证的视口、可见元素数量、内容边界和滚动尺寸,父层据此检查空白文档、固定屏幕宽度、横向溢出和目标内容边界。报告缺失、几何为零或内容越界都使候选失败,不能把 iframe `load` 或模型自报成功当作渲染通过。这个 probe 是 checker 的实现细节,产品宿主仍需在无法证明消息来源和 iframe 隔离时禁用自由文档脚本。 + +由于自由文档 iframe 使用不透明 origin,父页面的通用 DOM 截图工具可能只捕获宿主外壳而遗漏 iframe 像素。当前交付证据因此只把自由文档的真实加载、固定视口和宿主布局作为确定性检查,并将视觉截图标为 `unverified`;只有目标 host 提供可信的 iframe 截图适配器后,才可把图像交给视觉复核。 + +隔离页面仅通过按应用和实例绑定的宿主桥接请求允许的能力。宿主依据调用来源、应用 ID、源码修订和当前 owner 校验请求,消息按大小、频率、类型和参数 schema 限制;页面提供的 session、workspace、路径或设备标识一律不能决定执行目标。读文件、Agent 消息、外部工具和状态保存分别使用既有 owner 与权限流程。用户操作需要远程回答时必须走现有权限 mailbox。 + +iframe 和 CSP 是纵深防护,不是通用恶意代码 VM。浏览器可能无法在同一 WebView 内强制终止同步死循环或限定内存;不能宣称已获得进程级 CPU/内存隔离。启用模型生成 JavaScript 前,必须在 Desktop 的 WebView2、WKWebView、Linux WebKitGTK 及实际受支持 host 上验证 host API 不可见、网络/导航受限、消息可取消且 renderer 可恢复。某个 host 无法证明这些约束时,必须明确禁用该 host 的脚本执行并仍允许静态 HTML/CSS/SVG,不得静默用宿主权限执行。 + +## 共同应用与持久化契约 + +应用身份绑定目标设备/runtime、workspace、session 和应用 ID。每个接受版本保存源码及状态的独立修订;解析树、DOM 和截图是可丢弃的派生数据,不是权威存储。逻辑记录至少包含: + +| 字段 | 语义 | +| --- | --- | +| `appId` | 跨修订稳定的应用身份 | +| `source.kind` | `openui-lang` 或 `html-document` | +| `source.formatVersion` | 源码语法或文档策略版本 | +| `libraryId` / `libraryRevision` | 两种源码路径都保存创建时绑定的 library contract;HTML 路径的样式和脚本能力仍由 designSpec 与 host runtime 共同约束 | +| `designSpec.id` / `designSpec.revision` | 两种源码类型共用、由 owner 固定的设计目标配置 | +| `htmlRuntime` | HTML 应用由 owner 写入的 runtime、sanitizer、inspector 和 bridge revision;组件路径不需要该字段 | +| `source.revision` / `source.content` | 源码修订与原始内容 | +| `state.revision` / `state.value` | 独立的用户数据修订 | +| `ownerRevision` | owner 并发控制版本 | +| `verification` | 精确绑定源码、状态、运行时、checker 和能力版本的证据 | + +实际 wire/存储命名可以遵循现有领域契约,但须保留这些语义。Rust `Value` envelope 不解释源码;owner 不需要在 `app` 和 `widget_code` 间维护两份权威源码。每次编辑从已接受版本创建候选,源码和状态分别记修订,候选按 `baseOwnerRevision` 原子接受。过期、丢失确认的幂等重试、并发修改和未知字段由 owner 处理。 + +候选检查使用已接受状态的隔离副本,绝不覆写正式用户数据。检查可测试候选如何处理用户操作,但只有接受后用户界面才切换到它。保存失败时保留本地输入并显示失败状态;关闭重开从目标 owner 读取已接受源码和状态。格式或库切换是新修订;状态转换必须显式迁移并检查,失败时保留此前应用与数据。 + +## 统一实现约束与完成门槛 + +按可验证的纵向能力迁移,避免两条新路径各自建立一套应用 owner: + +1. **固定源码边界并退役 TSX 执行链。** 新生成请求只接受 `openui-lang` 或 `html-document`。删除旧 Canvas 的模型 TSX 输入、逐应用编译和执行入口;旧记录保留为不可执行数据,可由用户显式导出或导入为待检查候选。 +2. **建立共同 owner 与规范身份契约。** 引入版本化组件库/profile 和 `designSpec` 清单,将 `{id, revision}` 写入 app;引入带 `source.kind` 的源码修订、独立状态修订、owner revision 和候选接受语义。覆盖并发冲突、同 app ID 在设置改变后的规范继承和 source payload 往返,再让新路径以此作为唯一权威存储;旧 graph payload 不进入新 owner。 +3. **完成 OpenUI 组件纵向切片。** 现在已用绑定规范的产品组件库打通 `source.kind = openui-lang` 的解析、渲染、流式输入、状态回调、action/query owner bridge 和 owner 保存/重开;async capability 层已补齐 Query/Mutation、图片、地图、取消、权限、远程 target 与 target event。宿主仍需为实际外部能力注册参数 schema、deadline、重试和远程 mailbox。没有合适模板时验证自由组合;库或语法诊断必须留在 OpenUI 语言语义内修复,不能转译到旧 JSON 图。 +4. **完成自由文档静态纵向切片并收敛脚本门槛。** 已完成不执行脚本的 HTML/CSS/SVG 渲染、当前 sanitizer、style-resource token 基线和共同 owner 保存重开;每个规范在实际目标视口运行 DOM/几何验收,违规诊断交回修正并重验。当前证据带有 HTML runtime 的 revision;白名单式 sanitizer、参数化 bridge registry 以及各原生 WebView 的隔离证明仍是后续交付门槛。受控 JavaScript 仍按 host 单独开放;每个 host 先证明桥接权限、导航/网络限制、取消和恢复,再启用生成脚本。 +5. **迁移候选验收与远程执行。** 组件和自由文档都由 owner 所在 runtime 按持久化的组件库及规范版本检查和接受。逐一验证 Remote Workspace、Remote Control、Peer Device 和 Detached Dispatch;能力缺失时明确 unsupported,不用本地渲染或 checker 代替目标端证据。 + +完成以行为证据为准,不以模块已创建或代码已编译为准。旧 graph 存储不进入新 owner,只有带 source 的候选才可接受;未验证的 host 或远程场景必须保持显式禁用或 unsupported。 + +## 候选验收与证据 + +组件和自由文档共用一条 owner 级交付门: + +1. 固定 owner、应用 ID、源码类型和源版本;创建不覆盖已接受数据的候选。 +2. 对原始完整源码做格式、语言/文档策略、组件库与 UI 规范版本校验,记录内容 hash。 +3. 在目标执行端按规范的 viewport 和 host shell 启动隔离实例,检查实际挂载、运行异常、关键可见内容、布局、规范验收项和候选声明的交互。失败诊断绑定到该规范修订并用于修正;提示文本、schema 通过或截图单独均不构成规范通过。 +4. 通过同一 owner 保存隔离检查状态,重读精确修订,再启动并断言恢复结果。 +5. 将用户原始需求与实际 DOM/交互/保存证据一起做独立需求复核;有视觉模型时检查实际宿主截图。截图是临时检查输入,不保留为应用源码。 +6. 只有全部必需阶段通过,且候选仍匹配基础 owner revision,才原子接受;否则保留旧版本并把具体诊断交还生成模型修复。 + +接受证据本身也必须带回候选的 `designSpec {id, revision}`;自由文档和 +OpenUI 文档还必须带回相同的 `sourceKind`。owner 会逐字段比较这些身份, +所以远程 checker、过期的前端或另一套规范产生的证据不能被写入当前应用。 + +页面代码自报成功、Rust 结构校验通过或 React 已挂载都不能单独构成交付成功。模型审查不能代替运行器证据;无图像能力的检查器应把视觉项记录为 `unverified`,不伪称通过。检查设施不可用、超时或 owner 冲突与源码缺陷分开报告;可重试的检查阶段应重试同一候选,不要求模型无端改写源码。 + +组件作者提供的检查探针覆盖组件事件和 mounted inspect;应用级检查场景验证用户需求。自由文档检查器观察真实隔离实例并驱动受控测试事件,不能只采信页面向父级发送的“测试通过”消息。两种路径都保存精确源版本、状态版本、renderer/checker 版本和结果引用;HTML 路径还要记录 runtime、sanitizer、inspector 和 bridge revision。 + +## 远程与多入口 + +保存、检查、脚本宿主桥接和候选接受始终属于应用 owner 所在 runtime。控制端只呈现状态和发送命令,不代理文件系统、渲染权限或用户状态。运行和检查依赖的能力必须在目标端通告并协商;缺失时在准入或交付阶段明确返回 unsupported,不能静默在控制端本地执行。 + +| 场景 | 必须成立的行为 | +| --- | --- | +| Remote Workspace | workspace 路径与文件访问由远程 runtime 解释;不能把控制端路径转给目标端 | +| Remote Control | 断开后 owner 保留候选和可恢复阶段;远程权限请求可经现有 mailbox 回答 | +| Peer Device | 目标 peer 提供对应语言库、renderer、隔离脚本与 checker 能力;按 peer owner 修订 CAS | +| Detached Dispatch | 目标端可在无人值守条件下完成验证;缺 renderer/checker/脚本隔离能力时明确不接受候选 | +| CLI / Headless | 无交互 renderer 时允许明确报告 unsupported,不能伪造渲染/视觉证据 | + +组件检查和自由文档检查使用同一远程生命周期,不要求每个客户端都安装或运行 renderer。Desktop 当前事件驱动的前端 checker 是一种 adapter,不是架构 owner;目标执行端需要能力,而不是持续连接的 controller window。 + +## 升级、历史数据与退役边界 + +存储新增字段必须可选并容忍旧记录。未知字段、未知 source format、损坏源码和未知组件库都原样保留;旧 graph 记录直接显示为不可运行,不进入 renderer、checker 或 acceptance,也不自动迁移。旧 HTML Widget 可以作为显式导入的 HTML 文档候选,导入后先应用新隔离策略和检查;TSX/Canvas 编译产物不得被自动执行或冒充 OpenUI。 + +当前实现中,OpenUI Lang 是组件路径唯一的生成语言和 parser;OpenBitFun 私有 graph 消息、表达式解释器、兼容 renderer 和组件专用 workflow 已从生成与交付链删除。自由文档是明确的 HTML/CSS/SVG 加可选受控 JS 类型,不是组件运行时的 fallback。旧 Canvas TSX compiler 与模型生成 TSX 执行链退役。产品边界不应保留 widget 和组件应用各自独立的身份、状态、验收或远程归属。 + +架构验证须覆盖两种表达不同的组件应用、无模板自由组合、真实工具参数流的渐进渲染、规范随 owner 保存重开与设置切换后的身份继承、Harmony 固定手机视口和 host shell、违反规则时实际诊断/修正/复验、自由文档 JS 隔离、状态修订、候选失败时旧版本保留、版本冲突,以及上述四类远程场景。Mock/DOM 测试不能证明原生 WebView 沙箱、远程执行或 Detached Dispatch;对应报告必须明确实际覆盖的 host 和场景。 + +GenUI 当前作为 FlowChat 中的 transient 结果呈现,不提供 owner/CAS 保存、 +重开或交付验收。该范围内的测试应覆盖 OpenUI action、状态回传、受限渲染、 +设置切换与原生/deferred 流式 DOM 增长;远程与 Detached Dispatch 场景不应 +宣称支持持久化 GenUI 状态。 diff --git a/docs/architecture/product-architecture.md b/docs/architecture/product-architecture.md index 4917d2be9a..d00d7b5081 100644 --- a/docs/architecture/product-architecture.md +++ b/docs/architecture/product-architecture.md @@ -8,6 +8,7 @@ | 扩展体系 | [Plugin Runtime](extensions/plugin-runtime-design.md)、[能力集成](extensions/capability-runtime-integration-design.md)、[外部来源](extensions/external-ai-work-sources-design.md)、[OpenCode 兼容](extensions/opencode-extension-compatibility.md) | | 产品交付 | [产品定制](product-customization-blueprint.md)、[CLI 产品线](cli-product-line-design.md)、[Agent SDK](agent-sdk-product-architecture.md)、[平台可移植性](platform-portability-design.md) | | 产品控制面 | [Product Control](product-control-plane.md) | +| 生成式 UI | [双路径应用与宿主生命周期](generative-ui-architecture.md) | | 模型与订阅 | [订阅多账号与额度路由集成设计](subscription-account-routing-design.md)(提案) | | 架构演进 | [Core 拆分](../plans/core-decomposition-plan.md)、[演进计划](../plans/product-architecture-evolution-plan.md)、[Rust 依赖边界](rust-build-dependency-boundaries.md) | @@ -115,7 +116,7 @@ block-beta Application → Extension Dimension 表示产品入口消费受控扩展;Extension Dimension → Cross-platform 表示扩展的发现与执行受平台能力约束。两项依赖均不改变 Agent Core → Tools & Execution → Cross-platform 的主分层关系。 -Application 表达产品领域对象;Conversation 与 Task 分别区别于运行时的 Session 与 Scheduling。Code Agent、Deep Review、Deep Research 属于由多个逻辑职责组合而成的场景;Mini Apps 与 Canvas 是 Artifact 的呈现机制;Desktop、CLI、Web、Mobile 是产品交付形态。`Agent Runtime`、contract、port、adapter 和外部系统不构成 Level 0 逻辑模块。DFX 在本视图中表示诊断、Tracing、指标、审计和运行质量反馈,不包含测试工程或开发流程。 +Application 表达产品领域对象;Conversation 与 Task 分别区别于运行时的 Session 与 Scheduling。Code Agent、Deep Review、Deep Research 属于由多个逻辑职责组合而成的场景;Mini Apps 与 GenUI 是 Artifact 的呈现机制;Desktop、CLI、Web、Mobile 是产品交付形态。`Agent Runtime`、contract、port、adapter 和外部系统不构成 Level 0 逻辑模块。DFX 在本视图中表示诊断、Tracing、指标、审计和运行质量反馈,不包含测试工程或开发流程。 当前生产代码与验证证据支持以下成熟度判定: @@ -236,14 +237,14 @@ Computer Use 的控制会话、系统共享提示、后台输入边界与 macOS 以下内容不属于 Agent Runtime: - Deep Review、Deep Research 等按名称定义的产品工作流、提示词和报告策略; -- MiniApp、Canvas 等产物产品及其发布、市场或界面生命周期; +- MiniApp、GenUI 等产物产品及其发布、市场或界面生命周期; - CLI、ACP、SDK Host、Tauri、HTTP/WebSocket 等入口和协议; - 文件系统、Git、终端、网络、MCP、远端与 AI 提供方的具体实现; - Delivery Profile 和某个产品应该装载哪些 Agent / Tool 的选择。 命名工作流的无 I/O 决策归 `agent-workflows`;具体 I/O 归 Services;`product-capabilities` 只选择工作流能力、Agent ID 和原子工具组。依赖方向固定为 `Assembly → agent-workflows → agent-runtime / contracts`,`agent-runtime` 禁止反向依赖 `agent-workflows`。当前 `agent-workflows` 的 DeepResearch 报告后处理不需要 Runtime 类型,因此直接依赖基础库;这不改变上述长期方向。 -原子逻辑模块应满足三个条件:一个明确 owner、一个可独立测试的输入输出契约、一个变化原因。`core.basic`、`core.agent`、`core.session`、`core.git`、`core.web`、`core.mcp`、`core.computer-use`、`core.review`、`core.miniapp`、`core.creation`、`core.canvas` 分别表达实际工具职责;其中 `core.creation` 只承载创造模式的产品创作入口,不吸收 MiniApp runtime/market owner。不得重新合成 `core.integration` 这类同时包含网络、Git、MCP、产品工具和平台能力的大组。 +原子逻辑模块应满足三个条件:一个明确 owner、一个可独立测试的输入输出契约、一个变化原因。`core.basic`、`core.agent`、`core.session`、`core.git`、`core.web`、`core.mcp`、`core.computer-use`、`core.review`、`core.miniapp`、`core.creation` 分别表达实际工具职责;其中 `core.creation` 只承载创造模式的产品创作入口,不吸收 MiniApp runtime/market owner。不得重新合成 `core.integration` 这类同时包含网络、Git、MCP、产品工具和平台能力的大组。 当前生产循环仍由 `assembly/core` 的 `ConversationCoordinator → Scheduler → ExecutionEngine → RoundExecutor → ToolPipeline` 持有;`agent-runtime` 已拥有可移植决策与 Rust preview facade,但尚未独立拥有完整循环。`assembly/core` 因此仍是过渡期兼容组装与实际 owner,不能被描述成只有 wiring。后续迁移必须逐条切换真实调用方、保留行为等价测试并删除旧写入方;移动 DTO、增加 feature 或 re-export 均不算 owner 迁移。当前仍位于 Runtime/Core 的 DeepReview 兼容逻辑只允许迁出和修复,不继续承接新的产品行为。 @@ -849,9 +850,9 @@ flowchart LR | 当前入口 | 已有能力 | 明确边界 | |---|---|---| | Desktop | 使用 `product-full`,包含 Creative Agent 与 `core.creation`;Settings 从现有来源目录和 integration policy 生成简短应用概览,具体审批与冲突仍进入 Tool、Agent、MCP 或 Hook owner | 可执行能力在事实所在 Host 运行;Safe Mode 只阻止新调用,不改来源、不取消正在运行的调用 | -| CLI / TUI | 使用 `DeliveryProfile::Cli` 和显式 Core owner closure;Runtime 只注册 Code Agent 清单及 `basic / agent / session / git / web / mcp / computer-use` 七个原子工具组,外部来源、插件和 Remote/SSH 仍由各自 owner 按入口需要装配 | 不注册 DeepReview、DeepResearch、MiniApp、Creation 或 Canvas Agent / Tool;非交互不等待权限输入,远程能力未接入时不回退本机 | +| CLI / TUI | 使用 `DeliveryProfile::Cli` 和显式 Core owner closure;Runtime 只注册 Code Agent 清单及 `basic / agent / session / git / web / mcp / computer-use` 七个原子工具组,外部来源、插件和 Remote/SSH 仍由各自 owner 按入口需要装配 | 不注册 DeepReview、DeepResearch、MiniApp、Creation 或 GenUI Agent / Tool;非交互不等待权限输入,远程能力未接入时不回退本机 | | ACP | 使用 `DeliveryProfile::Acp`、Runtime Parts、Code Agent 清单与同一组七个原子工具组,不选择 CLI 的 plugin runtime 和 Remote Connect owner | load 成功后才发布活动状态;完整历史和兼容配置仍由 Core/ACP 管理;未选择的产品工作流不得借 Cargo feature union 偶然注册 | -| SDK Host(preview) | 使用 `DeliveryProfile::Sdk`、Runtime Parts、Code Agent 清单和七个原子工具组;TLS provider 由 Host 进程入口安装 | 不注册 DeepReview、DeepResearch、MiniApp、Creation 或 Canvas;当前协议也不暴露远程 workspace/SSH,未来远程 SDK 必须复用 Server/Remote 的认证和执行域 | +| SDK Host(preview) | 使用 `DeliveryProfile::Sdk`、Runtime Parts、Code Agent 清单和七个原子工具组;TLS provider 由 Host 进程入口安装 | 不注册 DeepReview、DeepResearch、MiniApp、Creation 或 GenUI;当前协议也不暴露远程 workspace/SSH,未来远程 SDK 必须复用 Server/Remote 的认证和执行域 | | Peer / Server | Peer Host 执行真实工作区操作;通用 HTTP Server 未绑定可信 workspace owner 时明确返回不支持 | 控制端不替远端发现或执行;loopback 单用户边界不扩展到远程/多用户;SSH Remote 未接入时返回不支持 | | Web / Mobile Web | 依赖现有后端入口 | 不持有插件执行单元,也不能据空 profile 宣称独立能力 | | HarmonyOS 手机 Remote | phone-only ArkTS 远程入口 | 不等于 HarmonyOS PC 本地 Runtime、CLI/TUI 或 GUI | diff --git a/docs/architecture/theme-token-optimization.md b/docs/architecture/theme-token-optimization.md index f3a20f0180..d8a6555afc 100644 --- a/docs/architecture/theme-token-optimization.md +++ b/docs/architecture/theme-token-optimization.md @@ -58,7 +58,7 @@ Desktop bootstrap 和产品前端也不能反向定义公共主题值。 组件差异;必须在 `appearanceTokenContract.ts` 中登记。 3. **Product domain**:`--openbitfun-domain-*`。用于 Git lane、语言身份、syntax、inspector、工具类别等明确的 专用语义;不得当作普通 UI 的备用色板。 -4. **Renderer payload**:Monaco、xterm、Mermaid、OpenBitFun Canvas 等第三方或专用渲染器的显式配置。 +4. **Renderer payload**:Monaco、xterm、Mermaid、GenUI 等第三方或专用渲染器的显式配置。 它们有各自格式,不进入普通组件 CSS。 Primitive/reference 色值只存在于主题 authoring、明确的主题 preset 或专用 renderer owner 中。普通组件 diff --git a/docs/interactive-capabilities/README.md b/docs/interactive-capabilities/README.md index 2d7cc72c60..ed8b9542e2 100644 --- a/docs/interactive-capabilities/README.md +++ b/docs/interactive-capabilities/README.md @@ -1,9 +1,9 @@ # OpenBitFun 功能与设置目录 / OpenBitFun Features & Settings -OpenBitFun Playbook 当前包含 **22 个功能**和 **22 个设置页**,共 **44 个**用户可理解的条目、**339 项**有源码证据的子能力。每个条目有独立 Markdown,并直接服务于说明书网站、OpenBitFun 全局搜索和 `OpenBitFunControl` 智能体工具。 +OpenBitFun Playbook 当前包含 **22 个功能**和 **22 个设置页**,共 **44 个**用户可理解的条目、**333 项**有源码证据的子能力。每个条目有独立 Markdown,并直接服务于说明书网站、OpenBitFun 全局搜索和 `OpenBitFunControl` 智能体工具。 -OpenBitFun Playbook currently contains **22 features**, **22 settings pages**, and **339** source-backed sub-capabilities across **44** user-facing entries. Every entry has its own Markdown page and directly powers the website, in-app global search, and the `OpenBitFunControl` agent tool. +OpenBitFun Playbook currently contains **22 features**, **22 settings pages**, and **333** source-backed sub-capabilities across **44** user-facing entries. Every entry has its own Markdown page and directly powers the website, in-app global search, and the `OpenBitFunControl` agent tool. ## 唯一事实源 / Single source of truth @@ -27,20 +27,20 @@ OpenBitFun Playbook currently contains **22 features**, **22 settings pages**, a - Generated per-item interaction audit: `docs/interactive-capabilities/technical/product-control-open-audit.json` - Generated low-level audit map: `docs/interactive-capabilities/technical/tauri-command-map.json` -说明书、网站、搜索和智能体只看“功能 + 设置 + 子能力”。每项子能力都必须引用已注册 Tauri Command 或可解析的源码标记;这些证据不会进入公开目录。当前 **709** 个 Tauri 命令只用于实现覆盖审计。产品 UI 交互源码会在生成和检查时扫描并校验,但不会保存成随普通 UI 改动频繁变化的版本化快照。 +说明书、网站、搜索和智能体只看“功能 + 设置 + 子能力”。每项子能力都必须引用已注册 Tauri Command 或可解析的源码标记;这些证据不会进入公开目录。当前 **705** 个 Tauri 命令只用于实现覆盖审计。产品 UI 交互源码会在生成和检查时扫描并校验,但不会保存成随普通 UI 改动频繁变化的版本化快照。 -Docs, website, search, and agents see only features, settings, and documented sub-capabilities. Every sub-capability must reference a registered Tauri command or a resolvable source marker; evidence is stripped from public projections. The **709** Tauri commands remain implementation-audit evidence only. Product UI interaction sources are scanned and validated during generation and checks, but are not stored as a versioned snapshot that churns with ordinary UI changes. +Docs, website, search, and agents see only features, settings, and documented sub-capabilities. Every sub-capability must reference a registered Tauri command or a resolvable source marker; evidence is stripped from public projections. The **705** Tauri commands remain implementation-audit evidence only. Product UI interaction sources are scanned and validated during generation and checks, but are not stored as a versioned snapshot that churns with ordinary UI changes. ## 控制边界 / Control boundary -- 每个子能力都明确标记为直接控制、委托给专用智能体工具、需交互打开或不支持;“打开页面”不会再被统计成“智能体已控制”。当前覆盖:直接 **62**、委托 **72**、需交互 **205**、不支持 **0**。 +- 每个子能力都明确标记为直接控制、委托给专用智能体工具、需交互打开或不支持;“打开页面”不会再被统计成“智能体已控制”。当前覆盖:直接 **63**、委托 **70**、需交互 **200**、不支持 **0**。 - 稳定行为声明为带 JSON 输入契约的 `operations` 或 `options`,并绑定原生产品控制 Provider;智能体不接触原始 Tauri Command。 -- `OpenBitFunControl list` 和 `search` 都返回带 `nextCursor` 的精简分页结果;目录可持续增长,不靠固定总量上限。完整目录和 339 项子能力都不会写入 system prompt。 +- `OpenBitFunControl list` 和 `search` 都返回带 `nextCursor` 的精简分页结果;目录可持续增长,不靠固定总量上限。完整目录和 333 项子能力都不会写入 system prompt。 - 目录发现与契约读取不依赖 React 或可见窗口。普通配置型 option 统一由 Product Assembly 的共享 ConfigService 执行器读、写并回读,因此 Desktop、CLI 与 Headless 表面走同一份实现;只有宿主原生 operation/provider option 和界面导航按表面注册适配器,缺失时必须明确返回不可用,禁止静默回退本机。只读智能体只能发现和读取目录。 -- Every documented item is classified as direct control, delegated Agent control, interactive opening, or unsupported; opening a page is never counted as direct control. Current coverage is **62 direct**, **72 delegated**, **205 interactive**, and **0 unsupported**. +- Every documented item is classified as direct control, delegated Agent control, interactive opening, or unsupported; opening a page is never counted as direct control. Current coverage is **63 direct**, **70 delegated**, **200 interactive**, and **0 unsupported**. - Stable behavior becomes a typed `operation` or `option` with a JSON input contract and a native product-control provider. Agents never receive raw Tauri commands. -- `OpenBitFunControl list` and `search` return compact pages with a `nextCursor`; the catalog can grow without a fixed total-size ceiling. Neither the full catalog nor its 339 documented items enters the system prompt. +- `OpenBitFunControl list` and `search` return compact pages with a `nextCursor`; the catalog can grow without a fixed total-size ceiling. Neither the full catalog nor its 333 documented items enters the system prompt. - Discovery and contract lookup do not depend on React or a visible window. Ordinary config-backed options are read, written, and read back by one Product Assembly ConfigService executor shared by Desktop, CLI, and headless surfaces. Only host-native operations/provider options and presentation routes install surface adapters; missing adapters return explicit unavailability without local fallback. Read-only agents may only discover and inspect entries. ## 防腐化门禁 / Anti-drift gates diff --git a/docs/interactive-capabilities/capabilities.json b/docs/interactive-capabilities/capabilities.json index f31137a169..eb43e0d269 100644 --- a/docs/interactive-capabilities/capabilities.json +++ b/docs/interactive-capabilities/capabilities.json @@ -4,8 +4,8 @@ "title": "OpenBitFun Playbook", "origin": "https://playbook.openbitfun.com", "source": "src/shared/interactive-capabilities/catalog.json", - "digest": "9b42d8bd570aa1f371e2ddfbb4c6d8384e97492e7987c774eef00c1f087db6dc", - "ownerDigest": "3cc6d7d869b2c90c2161494a854b5ff7eb72ea69a1a28e40ccd42065fb3382e2", + "digest": "17f5700a9faf966a376680ae8480c1ce1cf06d69caab971e88c33e1c96a1802a", + "ownerDigest": "31d6371f7765bde7bee88e22a6a4f03c2c5370e138cf49975bdc88f3c5eeb052", "searchAcceptance": [ { "id": "native-image-generation", @@ -175,11 +175,11 @@ "features": 22, "settings": 22, "userFacing": 44, - "documentedItems": 339, + "documentedItems": 333, "controlCoverage": { - "direct": 62, - "delegated": 72, - "interactive": 205, + "direct": 63, + "delegated": 70, + "interactive": 200, "unsupported": 0 } }, @@ -6924,426 +6924,6 @@ "actionId": "surface.miniapps.open" } }, - { - "id": "feature.canvas:query", - "capabilityId": "feature.canvas", - "itemIds": [ - "artifact-open", - "html-react", - "inline-generative-ui", - "state", - "source-inspection", - "element-context", - "runtime-errors", - "export-html" - ], - "kind": "query", - "risk": "read", - "executionHost": "productHost", - "availability": { - "desktop": { - "available": true - }, - "cli": { - "available": true - }, - "peer": { - "available": true, - "requiredCapabilities": [ - "product_control_v1" - ] - }, - "remoteControl": { - "available": true - }, - "detachedDispatch": { - "available": true - } - }, - "inputSchema": { - "type": "object", - "additionalProperties": false - }, - "outputSchema": { - "type": "object", - "additionalProperties": true - }, - "valueSource": { - "kind": "static" - }, - "presentationTarget": { - "kind": "scene", - "sceneId": "session" - } - }, - { - "id": "feature.canvas:open:artifact-open", - "capabilityId": "feature.canvas", - "itemIds": [ - "artifact-open" - ], - "kind": "open", - "risk": "ui", - "executionHost": "presentationSurface", - "availability": { - "desktop": { - "available": true - }, - "cli": { - "available": false, - "reason": "This delivery profile has no live presentation surface" - }, - "peer": { - "available": true, - "requiredCapabilities": [ - "product_control_v1", - "product_control_presentation_v1" - ] - }, - "remoteControl": { - "available": true - }, - "detachedDispatch": { - "available": false, - "reason": "This delivery profile has no live presentation surface" - } - }, - "inputSchema": { - "type": "object", - "additionalProperties": false - }, - "outputSchema": { - "type": "object", - "additionalProperties": true - }, - "openReason": "unstructuredInteraction", - "presentationTarget": { - "kind": "scene", - "sceneId": "session" - } - }, - { - "id": "feature.canvas:delegate:html-react", - "capabilityId": "feature.canvas", - "itemIds": [ - "html-react" - ], - "kind": "delegate", - "risk": "execute", - "executionHost": "workspaceHost", - "availability": { - "desktop": { - "available": true - }, - "cli": { - "available": true - }, - "peer": { - "available": true, - "requiredCapabilities": [ - "product_control_v1" - ] - }, - "remoteControl": { - "available": true - }, - "detachedDispatch": { - "available": true - } - }, - "inputSchema": { - "type": "object", - "additionalProperties": true - }, - "outputSchema": { - "type": "object", - "additionalProperties": true - }, - "delegateTools": [ - "CreateCanvas", - "ReadCanvas", - "PatchCanvas", - "UpdateCanvas" - ], - "presentationTarget": { - "kind": "scene", - "sceneId": "session" - } - }, - { - "id": "feature.canvas:delegate:inline-generative-ui", - "capabilityId": "feature.canvas", - "itemIds": [ - "inline-generative-ui" - ], - "kind": "delegate", - "risk": "execute", - "executionHost": "workspaceHost", - "availability": { - "desktop": { - "available": true - }, - "cli": { - "available": true - }, - "peer": { - "available": true, - "requiredCapabilities": [ - "product_control_v1" - ] - }, - "remoteControl": { - "available": true - }, - "detachedDispatch": { - "available": true - } - }, - "inputSchema": { - "type": "object", - "additionalProperties": true - }, - "outputSchema": { - "type": "object", - "additionalProperties": true - }, - "delegateTools": [ - "GenerativeUI" - ], - "presentationTarget": { - "kind": "scene", - "sceneId": "session" - } - }, - { - "id": "feature.canvas:open:state", - "capabilityId": "feature.canvas", - "itemIds": [ - "state" - ], - "kind": "open", - "risk": "ui", - "executionHost": "presentationSurface", - "availability": { - "desktop": { - "available": true - }, - "cli": { - "available": false, - "reason": "This delivery profile has no live presentation surface" - }, - "peer": { - "available": true, - "requiredCapabilities": [ - "product_control_v1", - "product_control_presentation_v1" - ] - }, - "remoteControl": { - "available": true - }, - "detachedDispatch": { - "available": false, - "reason": "This delivery profile has no live presentation surface" - } - }, - "inputSchema": { - "type": "object", - "additionalProperties": false - }, - "outputSchema": { - "type": "object", - "additionalProperties": true - }, - "openReason": "unstructuredInteraction", - "presentationTarget": { - "kind": "scene", - "sceneId": "session" - } - }, - { - "id": "feature.canvas:delegate:source-inspection", - "capabilityId": "feature.canvas", - "itemIds": [ - "source-inspection" - ], - "kind": "delegate", - "risk": "execute", - "executionHost": "workspaceHost", - "availability": { - "desktop": { - "available": true - }, - "cli": { - "available": true - }, - "peer": { - "available": true, - "requiredCapabilities": [ - "product_control_v1" - ] - }, - "remoteControl": { - "available": true - }, - "detachedDispatch": { - "available": true - } - }, - "inputSchema": { - "type": "object", - "additionalProperties": true - }, - "outputSchema": { - "type": "object", - "additionalProperties": true - }, - "delegateTools": [ - "ReadCanvas" - ], - "presentationTarget": { - "kind": "scene", - "sceneId": "session" - } - }, - { - "id": "feature.canvas:open:element-context", - "capabilityId": "feature.canvas", - "itemIds": [ - "element-context" - ], - "kind": "open", - "risk": "ui", - "executionHost": "presentationSurface", - "availability": { - "desktop": { - "available": true - }, - "cli": { - "available": false, - "reason": "This delivery profile has no live presentation surface" - }, - "peer": { - "available": true, - "requiredCapabilities": [ - "product_control_v1", - "product_control_presentation_v1" - ] - }, - "remoteControl": { - "available": true - }, - "detachedDispatch": { - "available": false, - "reason": "This delivery profile has no live presentation surface" - } - }, - "inputSchema": { - "type": "object", - "additionalProperties": false - }, - "outputSchema": { - "type": "object", - "additionalProperties": true - }, - "openReason": "unstructuredInteraction", - "presentationTarget": { - "kind": "scene", - "sceneId": "session" - } - }, - { - "id": "feature.canvas:open:runtime-errors", - "capabilityId": "feature.canvas", - "itemIds": [ - "runtime-errors" - ], - "kind": "open", - "risk": "ui", - "executionHost": "presentationSurface", - "availability": { - "desktop": { - "available": true - }, - "cli": { - "available": false, - "reason": "This delivery profile has no live presentation surface" - }, - "peer": { - "available": true, - "requiredCapabilities": [ - "product_control_v1", - "product_control_presentation_v1" - ] - }, - "remoteControl": { - "available": true - }, - "detachedDispatch": { - "available": false, - "reason": "This delivery profile has no live presentation surface" - } - }, - "inputSchema": { - "type": "object", - "additionalProperties": false - }, - "outputSchema": { - "type": "object", - "additionalProperties": true - }, - "openReason": "unstructuredInteraction", - "presentationTarget": { - "kind": "scene", - "sceneId": "session" - } - }, - { - "id": "feature.canvas:open:export-html", - "capabilityId": "feature.canvas", - "itemIds": [ - "export-html" - ], - "kind": "open", - "risk": "ui", - "executionHost": "presentationSurface", - "availability": { - "desktop": { - "available": true - }, - "cli": { - "available": false, - "reason": "This delivery profile has no live presentation surface" - }, - "peer": { - "available": true, - "requiredCapabilities": [ - "product_control_v1", - "product_control_presentation_v1" - ] - }, - "remoteControl": { - "available": true - }, - "detachedDispatch": { - "available": false, - "reason": "This delivery profile has no live presentation surface" - } - }, - "inputSchema": { - "type": "object", - "additionalProperties": false - }, - "outputSchema": { - "type": "object", - "additionalProperties": true - }, - "openReason": "unstructuredInteraction", - "presentationTarget": { - "kind": "scene", - "sceneId": "session" - } - }, { "id": "feature.tasks-automation:query", "capabilityId": "feature.tasks-automation", @@ -16809,7 +16389,8 @@ "computer-use-permissions", "browser-auto-connect", "browser-setup", - "json-repair" + "json-repair", + "genui-library" ], "kind": "query", "risk": "read", @@ -17267,7 +16848,51 @@ "id": "setting.tools.execution:option:tool-json-repair", "capabilityId": "setting.tools.execution", "itemIds": [ - "json-repair" + "json-repair" + ], + "kind": "option", + "risk": "write", + "executionHost": "productHost", + "availability": { + "desktop": { + "available": true + }, + "cli": { + "available": true + }, + "peer": { + "available": true, + "requiredCapabilities": [ + "product_control_v1" + ] + }, + "remoteControl": { + "available": true + }, + "detachedDispatch": { + "available": true + } + }, + "inputSchema": { + "type": "boolean" + }, + "outputSchema": { + "type": "object", + "additionalProperties": true + }, + "valueSource": { + "kind": "static" + }, + "presentationTarget": { + "kind": "settings", + "pageId": "tools.execution" + } + }, + { + "id": "setting.tools.execution:option:genui-library", + "capabilityId": "setting.tools.execution", + "itemIds": [ + "genui-library" ], "kind": "option", "risk": "write", @@ -17293,7 +16918,11 @@ } }, "inputSchema": { - "type": "boolean" + "type": "string", + "enum": [ + "openbitfun", + "openui" + ] }, "outputSchema": { "type": "object", @@ -20749,6 +20378,96 @@ "kind": "settings", "pageId": "data.diagnostics" } + }, + { + "id": "feature.generative-ui:query", + "capabilityId": "feature.generative-ui", + "itemIds": [ + "app-generation" + ], + "kind": "query", + "risk": "read", + "executionHost": "productHost", + "availability": { + "desktop": { + "available": true + }, + "cli": { + "available": true + }, + "peer": { + "available": true, + "requiredCapabilities": [ + "product_control_v1" + ] + }, + "remoteControl": { + "available": true + }, + "detachedDispatch": { + "available": true + } + }, + "inputSchema": { + "type": "object", + "additionalProperties": false + }, + "outputSchema": { + "type": "object", + "additionalProperties": true + }, + "valueSource": { + "kind": "static" + }, + "presentationTarget": { + "kind": "scene", + "sceneId": "session" + } + }, + { + "id": "feature.generative-ui:delegate:app-generation", + "capabilityId": "feature.generative-ui", + "itemIds": [ + "app-generation" + ], + "kind": "delegate", + "risk": "execute", + "executionHost": "workspaceHost", + "availability": { + "desktop": { + "available": true + }, + "cli": { + "available": true + }, + "peer": { + "available": true, + "requiredCapabilities": [ + "product_control_v1" + ] + }, + "remoteControl": { + "available": true + }, + "detachedDispatch": { + "available": true + } + }, + "inputSchema": { + "type": "object", + "additionalProperties": true + }, + "outputSchema": { + "type": "object", + "additionalProperties": true + }, + "delegateTools": [ + "GenerativeUI" + ], + "presentationTarget": { + "kind": "scene", + "sceneId": "session" + } } ], "capabilities": [ @@ -24423,237 +24142,6 @@ ], "docsUrl": "https://playbook.openbitfun.com/capabilities/feature.miniapps/" }, - { - "id": "feature.canvas", - "kind": "feature", - "categoryId": "automation", - "titleZh": "Canvas 与交互产物", - "titleEn": "Canvas & interactive artifacts", - "summaryZh": "在会话旁展示和保存智能体生成的可视化、交互页面与结构化产物。", - "summaryEn": "Display and save visualizations, interactive pages, and structured artifacts generated beside a session.", - "keywordsZh": [ - "Canvas", - "画布", - "可视化", - "交互产物", - "Artifact" - ], - "keywordsEn": [ - "canvas", - "visualization", - "interactive artifact", - "artifact", - "preview" - ], - "highlightsZh": [ - "在会话中打开交互内容", - "保留画布状态", - "在面板中查看运行错误" - ], - "highlightsEn": [ - "Open interactive content from a session", - "Persist canvas state", - "Inspect runtime errors in the panel" - ], - "items": [ - { - "id": "artifact-open", - "titleZh": "从会话工具结果加载并打开持久化 Canvas 产物", - "titleEn": "Load and open persistent Canvas artifacts from session tool results", - "control": { - "kind": "open", - "reasonCode": "unstructuredInteraction", - "reasonZh": "“从会话工具结果加载并打开持久化 Canvas 产物”由多个实时状态相关步骤组成,目前没有一个能确定完成整个流程的单一结构化 Command;智能体会打开精确入口,并把后续交互保留在用户可见界面。", - "reasonEn": "“Load and open persistent Canvas artifacts from session tool results” spans multiple live-state-dependent steps and currently has no single structured Command that can deterministically complete the whole workflow; the Agent opens the exact entry and keeps the remaining interaction visible to the user." - } - }, - { - "id": "html-react", - "titleZh": "渲染并持续编辑 HTML 或 React 交互界面、图表和可视化", - "titleEn": "Render and iteratively edit HTML or React interfaces, charts, and interactive visualizations", - "control": { - "kind": "delegate", - "tools": [ - "CreateCanvas", - "ReadCanvas", - "PatchCanvas", - "UpdateCanvas" - ], - "workflowZh": [ - "用 CreateCanvas 提交单文件 TSX,并仅从 openbitfun/canvas 导入允许的运行时组件", - "保留返回的 openbitfun-canvas 引用,先 ReadCanvas 获取当前版本,再用 PatchCanvas 做局部改动或 UpdateCanvas 完整更新" - ], - "workflowEn": [ - "Use CreateCanvas with a single TSX file and import runtime components only from openbitfun/canvas", - "Keep the returned openbitfun-canvas reference, inspect it with ReadCanvas, then use PatchCanvas for focused changes or UpdateCanvas for a full update" - ] - } - }, - { - "id": "inline-generative-ui", - "titleZh": "在会话中生成紧凑的 HTML/SVG 图表、说明器或交互组件", - "titleEn": "Generate compact HTML/SVG charts, explainers, or interactive widgets inline in a session", - "control": { - "kind": "delegate", - "tools": [ - "GenerativeUI" - ], - "workflowZh": [ - "仅在可视化或交互能明显帮助理解时使用 GenerativeUI,并输出紧凑、自包含且适配明暗外观的组件", - "需要持久编辑或独立产物时改用 Canvas;纯文本足够时不创建组件" - ], - "workflowEn": [ - "Use GenerativeUI only when visualization or interaction materially improves understanding, producing a compact self-contained widget that supports light and dark appearances", - "Use Canvas for persistent editable artifacts, and skip widget generation when text is sufficient" - ] - } - }, - { - "id": "state", - "titleZh": "在重新打开或刷新 Canvas 时加载和保存交互状态", - "titleEn": "Load and save interactive state when a Canvas is reopened or refreshed", - "control": { - "kind": "open", - "reasonCode": "unstructuredInteraction", - "reasonZh": "“在重新打开或刷新 Canvas 时加载和保存交互状态”由多个实时状态相关步骤组成,目前没有一个能确定完成整个流程的单一结构化 Command;智能体会打开精确入口,并把后续交互保留在用户可见界面。", - "reasonEn": "“Load and save interactive state when a Canvas is reopened or refreshed” spans multiple live-state-dependent steps and currently has no single structured Command that can deterministically complete the whole workflow; the Agent opens the exact entry and keeps the remaining interaction visible to the user." - } - }, - { - "id": "source-inspection", - "titleZh": "查看 Canvas 源码、编译版本和最后可用版本", - "titleEn": "Inspect Canvas source, compiled revisions, and the last known good revision", - "control": { - "kind": "delegate", - "tools": [ - "ReadCanvas" - ], - "workflowZh": [ - "用 ReadCanvas 按 artifact_reference 或 canvas_id 读取源码、状态、诊断与编译信息" - ], - "workflowEn": [ - "Use ReadCanvas with artifact_reference or canvas_id to inspect source, status, diagnostics, and compiled information" - ] - } - }, - { - "id": "element-context", - "titleZh": "选择 Canvas 内的元素并把元素引用加入会话上下文", - "titleEn": "Select an element inside Canvas and add its reference to session context", - "control": { - "kind": "open", - "reasonCode": "unstructuredInteraction", - "reasonZh": "“选择 Canvas 内的元素并把元素引用加入会话上下文”由多个实时状态相关步骤组成,目前没有一个能确定完成整个流程的单一结构化 Command;智能体会打开精确入口,并把后续交互保留在用户可见界面。", - "reasonEn": "“Select an element inside Canvas and add its reference to session context” spans multiple live-state-dependent steps and currently has no single structured Command that can deterministically complete the whole workflow; the Agent opens the exact entry and keeps the remaining interaction visible to the user." - } - }, - { - "id": "runtime-errors", - "titleZh": "捕获运行错误、上报诊断并请求智能体自动修复", - "titleEn": "Capture runtime errors, report diagnostics, and ask the agent to repair them", - "control": { - "kind": "open", - "reasonCode": "unstructuredInteraction", - "reasonZh": "“捕获运行错误、上报诊断并请求智能体自动修复”由多个实时状态相关步骤组成,目前没有一个能确定完成整个流程的单一结构化 Command;智能体会打开精确入口,并把后续交互保留在用户可见界面。", - "reasonEn": "“Capture runtime errors, report diagnostics, and ask the agent to repair them” spans multiple live-state-dependent steps and currently has no single structured Command that can deterministically complete the whole workflow; the Agent opens the exact entry and keeps the remaining interaction visible to the user." - } - }, - { - "id": "export-html", - "titleZh": "把当前 Canvas 导出为可独立打开的 HTML 文件", - "titleEn": "Export the current Canvas as a standalone HTML file", - "control": { - "kind": "open", - "reasonCode": "unstructuredInteraction", - "reasonZh": "“把当前 Canvas 导出为可独立打开的 HTML 文件”由多个实时状态相关步骤组成,目前没有一个能确定完成整个流程的单一结构化 Command;智能体会打开精确入口,并把后续交互保留在用户可见界面。", - "reasonEn": "“Export the current Canvas as a standalone HTML file” spans multiple live-state-dependent steps and currently has no single structured Command that can deterministically complete the whole workflow; the Agent opens the exact entry and keeps the remaining interaction visible to the user." - } - } - ], - "stepsZh": [ - "打开一个 AI 会话", - "让智能体创建可视化或交互工具", - "从工具结果打开 Canvas" - ], - "stepsEn": [ - "Open an AI session", - "Ask the agent for a visualization or interactive tool", - "Open the Canvas from the tool result" - ], - "agentExamplesZh": [ - "打开 AI 助手,我想做一个交互可视化", - "创建一个可交互的 Canvas" - ], - "agentExamplesEn": [ - "Open the AI assistant; I want an interactive visualization", - "Create an interactive Canvas" - ], - "destination": { - "kind": "scene", - "sceneId": "session" - }, - "operations": [], - "options": [], - "searchTerms": [ - "feature.canvas", - "Canvas 与交互产物", - "Canvas & interactive artifacts", - "扩展与自动化", - "Extensions & automation", - "Canvas", - "画布", - "可视化", - "交互产物", - "Artifact", - "canvas", - "visualization", - "interactive artifact", - "artifact", - "preview", - "在会话中打开交互内容", - "保留画布状态", - "在面板中查看运行错误", - "Open interactive content from a session", - "Persist canvas state", - "Inspect runtime errors in the panel", - "从会话工具结果加载并打开持久化 Canvas 产物", - "Load and open persistent Canvas artifacts from session tool results", - "渲染并持续编辑 HTML 或 React 交互界面、图表和可视化", - "Render and iteratively edit HTML or React interfaces, charts, and interactive visualizations", - "在会话中生成紧凑的 HTML/SVG 图表、说明器或交互组件", - "Generate compact HTML/SVG charts, explainers, or interactive widgets inline in a session", - "在重新打开或刷新 Canvas 时加载和保存交互状态", - "Load and save interactive state when a Canvas is reopened or refreshed", - "查看 Canvas 源码、编译版本和最后可用版本", - "Inspect Canvas source, compiled revisions, and the last known good revision", - "选择 Canvas 内的元素并把元素引用加入会话上下文", - "Select an element inside Canvas and add its reference to session context", - "捕获运行错误、上报诊断并请求智能体自动修复", - "Capture runtime errors, report diagnostics, and ask the agent to repair them", - "把当前 Canvas 导出为可独立打开的 HTML 文件", - "Export the current Canvas as a standalone HTML file", - "打开 AI 助手,我想做一个交互可视化", - "创建一个可交互的 Canvas", - "Open the AI assistant; I want an interactive visualization", - "Create an interactive Canvas", - "CreateCanvas", - "ReadCanvas", - "PatchCanvas", - "UpdateCanvas", - "用 CreateCanvas 提交单文件 TSX,并仅从 openbitfun/canvas 导入允许的运行时组件", - "保留返回的 openbitfun-canvas 引用,先 ReadCanvas 获取当前版本,再用 PatchCanvas 做局部改动或 UpdateCanvas 完整更新", - "Use CreateCanvas with a single TSX file and import runtime components only from openbitfun/canvas", - "Keep the returned openbitfun-canvas reference, inspect it with ReadCanvas, then use PatchCanvas for focused changes or UpdateCanvas for a full update", - "GenerativeUI", - "仅在可视化或交互能明显帮助理解时使用 GenerativeUI,并输出紧凑、自包含且适配明暗外观的组件", - "需要持久编辑或独立产物时改用 Canvas;纯文本足够时不创建组件", - "Use GenerativeUI only when visualization or interaction materially improves understanding, producing a compact self-contained widget that supports light and dark appearances", - "Use Canvas for persistent editable artifacts, and skip widget generation when text is sufficient", - "用 ReadCanvas 按 artifact_reference 或 canvas_id 读取源码、状态、诊断与编译信息", - "Use ReadCanvas with artifact_reference or canvas_id to inspect source, status, diagnostics, and compiled information" - ], - "docsUrl": "https://playbook.openbitfun.com/capabilities/feature.canvas/" - }, { "id": "feature.tasks-automation", "kind": "feature", @@ -30381,6 +29869,25 @@ } ] } + }, + { + "id": "genui-library", + "titleZh": "选择生成式 UI 组件库及关联 UI 规范并操作预览", + "titleEn": "Select a GenUI component library, its UI specification and preview", + "destination": { + "kind": "settings", + "pageId": "tools.execution", + "viewId": "advanced" + }, + "control": { + "kind": "direct", + "operations": [], + "options": [ + { + "id": "genui-library" + } + ] + } } ], "stepsZh": [ @@ -30525,6 +30032,20 @@ "valueSchema": { "type": "boolean" } + }, + { + "id": "genui-library", + "titleZh": "生成式 UI 组件库及 UI 规范", + "titleEn": "GenUI component library and UI specification", + "descriptionZh": "选择后续生成使用的组件库及其关联的设计规则、资源、视口、宿主外壳和验收检查;已有应用保留自己的目标身份。", + "descriptionEn": "Choose the component library and its bound design rules, resources, viewport, host shell and acceptance checks. Existing apps retain their target identity.", + "valueSchema": { + "type": "string", + "enum": [ + "openbitfun", + "openui" + ] + } } ], "searchTerms": [ @@ -30589,6 +30110,8 @@ "Discover and choose a browser, configure default CDP, or restart it when needed", "控制是否在安全边界内修复模型生成的非法工具参数 JSON", "Choose whether malformed model-generated tool-argument JSON may be repaired within safety boundaries", + "选择生成式 UI 组件库及关联 UI 规范并操作预览", + "Select a GenUI component library, its UI specification and preview", "启用 Computer Use", "把子智能体最大并发改为 8", "打开权限设置", @@ -32613,6 +32136,130 @@ "Take me to export a diagnostic bundle" ], "docsUrl": "https://playbook.openbitfun.com/capabilities/setting.data.diagnostics/" + }, + { + "id": "feature.generative-ui", + "kind": "feature", + "categoryId": "automation", + "titleZh": "Generative UI 生成式界面", + "titleEn": "Generative UI", + "summaryZh": "由智能体按组件库及关联 UI 规范生成 OpenUI 组件应用或 HTML/CSS/SVG 自由文档,经目标视口实际渲染、宿主验收与需求复核后接受并保存。", + "summaryEn": "Generate OpenUI component apps or free HTML/CSS/SVG documents under a bound UI specification; accept and persist only after target-viewport rendering, host checks and requirement review.", + "keywordsZh": [ + "Generative UI", + "生成式界面", + "交互应用", + "宿主组件", + "应用状态" + ], + "keywordsEn": [ + "generative UI", + "interactive app", + "component contracts", + "application state", + "structured widget" + ], + "highlightsZh": [ + "按组件库及其 UI 规范的设计规则、资源、视口和宿主外壳约束生成结果", + "组件路径使用 OpenUI 描述和可信 renderer;自由路径保留 HTML/CSS/SVG", + "支持生成、交互、保存和重开", + "可注册自定义宿主组件" + ], + "highlightsEn": [ + "Constrain generated results with the selected library's UI rules, resources, viewport and host shell", + "Use OpenUI descriptions and trusted renderers for components; retain HTML/CSS/SVG for free documents", + "Support generation, interaction, save and reopen", + "Register custom host components" + ], + "items": [ + { + "id": "app-generation", + "titleZh": "生成可交互的 GenUI 应用并由宿主渲染", + "titleEn": "Generate interactive GenUI applications rendered by the host", + "control": { + "kind": "delegate", + "tools": [ + "GenerativeUI" + ], + "workflowZh": [ + "按所选 UI 规范选择 OpenUI 组件描述或 HTML/CSS/SVG 自由文档;规范身份随候选固定。", + "宿主按所选 UI 规范渲染 OpenUI 描述或 HTML/CSS/SVG 自由文档,并支持本地交互。" + ], + "workflowEn": [ + "Use OpenUI descriptions or free HTML/CSS/SVG under the selected UI specification; pin that identity to the candidate.", + "Render OpenUI descriptions or free HTML/CSS/SVG under the selected UI specification and support local interaction." + ] + } + } + ], + "stepsZh": [ + "打开 AI 会话", + "让智能体生成一个 GenUI 应用", + "在宿主中完成交互并保存,随后重开应用" + ], + "stepsEn": [ + "Open an AI session", + "Ask the agent to generate a GenUI application", + "Interact and save it in the host, then reopen the application" + ], + "agentExamplesZh": [ + "生成一个可保存的记账应用", + "生成一个带预算设置和支出汇总的 dashboard 应用", + "生成一个阅读目录并支持收藏", + "生成一个带完成状态的日计划" + ], + "agentExamplesEn": [ + "Generate a saveable accounting app", + "Generate a dashboard with budget settings and an expense summary", + "Generate a reading catalog with favorites", + "Generate a daily plan with completion state" + ], + "destination": { + "kind": "scene", + "sceneId": "session" + }, + "operations": [], + "options": [], + "searchTerms": [ + "feature.generative-ui", + "Generative UI 生成式界面", + "Generative UI", + "扩展与自动化", + "Extensions & automation", + "生成式界面", + "交互应用", + "宿主组件", + "应用状态", + "generative UI", + "interactive app", + "component contracts", + "application state", + "structured widget", + "按组件库及其 UI 规范的设计规则、资源、视口和宿主外壳约束生成结果", + "组件路径使用 OpenUI 描述和可信 renderer;自由路径保留 HTML/CSS/SVG", + "支持生成、交互、保存和重开", + "可注册自定义宿主组件", + "Constrain generated results with the selected library's UI rules, resources, viewport and host shell", + "Use OpenUI descriptions and trusted renderers for components; retain HTML/CSS/SVG for free documents", + "Support generation, interaction, save and reopen", + "Register custom host components", + "生成可交互的 GenUI 应用并由宿主渲染", + "Generate interactive GenUI applications rendered by the host", + "生成一个可保存的记账应用", + "生成一个带预算设置和支出汇总的 dashboard 应用", + "生成一个阅读目录并支持收藏", + "生成一个带完成状态的日计划", + "Generate a saveable accounting app", + "Generate a dashboard with budget settings and an expense summary", + "Generate a reading catalog with favorites", + "Generate a daily plan with completion state", + "GenerativeUI", + "按所选 UI 规范选择 OpenUI 组件描述或 HTML/CSS/SVG 自由文档;规范身份随候选固定。", + "宿主按所选 UI 规范渲染 OpenUI 描述或 HTML/CSS/SVG 自由文档,并支持本地交互。", + "Use OpenUI descriptions or free HTML/CSS/SVG under the selected UI specification; pin that identity to the candidate.", + "Render OpenUI descriptions or free HTML/CSS/SVG under the selected UI specification and support local interaction." + ], + "docsUrl": "https://playbook.openbitfun.com/capabilities/feature.generative-ui/" } ] } diff --git a/docs/interactive-capabilities/capabilities/feature.canvas.md b/docs/interactive-capabilities/capabilities/feature.canvas.md deleted file mode 100644 index 83628ad7c8..0000000000 --- a/docs/interactive-capabilities/capabilities/feature.canvas.md +++ /dev/null @@ -1,69 +0,0 @@ - ---- -id: feature.canvas -kind: feature -category: automation -title_zh: "Canvas 与交互产物" -title_en: "Canvas & interactive artifacts" ---- - -# Canvas 与交互产物 / Canvas & interactive artifacts - -> 功能 / Feature - -在会话旁展示和保存智能体生成的可视化、交互页面与结构化产物。 - -Display and save visualizations, interactive pages, and structured artifacts generated beside a session. - -## 完整功能清单 / Everything included - -- **智能体可定位入口,需交互完成 / Agent opens; interaction required** · 从会话工具结果加载并打开持久化 Canvas 产物 - - Load and open persistent Canvas artifacts from session tool results -- **由专用智能体工具控制 / Delegated Agent tool** · `CreateCanvas` / `ReadCanvas` / `PatchCanvas` / `UpdateCanvas` · 渲染并持续编辑 HTML 或 React 交互界面、图表和可视化 - - Render and iteratively edit HTML or React interfaces, charts, and interactive visualizations -- **由专用智能体工具控制 / Delegated Agent tool** · `GenerativeUI` · 在会话中生成紧凑的 HTML/SVG 图表、说明器或交互组件 - - Generate compact HTML/SVG charts, explainers, or interactive widgets inline in a session -- **智能体可定位入口,需交互完成 / Agent opens; interaction required** · 在重新打开或刷新 Canvas 时加载和保存交互状态 - - Load and save interactive state when a Canvas is reopened or refreshed -- **由专用智能体工具控制 / Delegated Agent tool** · `ReadCanvas` · 查看 Canvas 源码、编译版本和最后可用版本 - - Inspect Canvas source, compiled revisions, and the last known good revision -- **智能体可定位入口,需交互完成 / Agent opens; interaction required** · 选择 Canvas 内的元素并把元素引用加入会话上下文 - - Select an element inside Canvas and add its reference to session context -- **智能体可定位入口,需交互完成 / Agent opens; interaction required** · 捕获运行错误、上报诊断并请求智能体自动修复 - - Capture runtime errors, report diagnostics, and ask the agent to repair them -- **智能体可定位入口,需交互完成 / Agent opens; interaction required** · 把当前 Canvas 导出为可独立打开的 HTML 文件 - - Export the current Canvas as a standalone HTML file - -## 怎么用 / How to use it - -1. 打开一个 AI 会话 - Open an AI session -2. 让智能体创建可视化或交互工具 - Ask the agent for a visualization or interactive tool -3. 从工具结果打开 Canvas - Open the Canvas from the tool result - -入口 / Entry: OpenBitFun 对应场景 - -## 智能体可替你做什么 / What an agent can do for you - -| 操作 / Action | 中文说明 | English description | -| --- | --- | --- | -| 打开对应界面 / Open the UI | 进入 OpenBitFun 中对应的功能界面。 | Open the matching feature in OpenBitFun. | - -## 可配置选项 / Configurable options - -| 选项 / Option | 可用值 / Values | 中文说明 | English description | -| --- | --- | --- | --- | -| 在界面中配置 / Configure in the UI | — | 此页面的设置在对应界面中完成。 | Configure this page in its matching UI. | - -## 可以直接对智能体说 / Try saying - -- “打开 AI 助手,我想做一个交互可视化” - - “Open the AI assistant; I want an interactive visualization” -- “创建一个可交互的 Canvas” - - “Create an interactive Canvas” - -智能体会先查找相关功能或设置,确认目标后再替你打开、执行或修改。完整能力目录不会预先塞进对话上下文。 - -The agent first finds the relevant feature or setting, confirms the target, and then opens, runs, or changes it for you. The full catalog is never embedded in the conversation context. diff --git a/docs/interactive-capabilities/capabilities/feature.generative-ui.md b/docs/interactive-capabilities/capabilities/feature.generative-ui.md new file mode 100644 index 0000000000..ea90305bee --- /dev/null +++ b/docs/interactive-capabilities/capabilities/feature.generative-ui.md @@ -0,0 +1,59 @@ + +--- +id: feature.generative-ui +kind: feature +category: automation +title_zh: "Generative UI 生成式界面" +title_en: "Generative UI" +--- + +# Generative UI 生成式界面 / Generative UI + +> 功能 / Feature + +由智能体按组件库及关联 UI 规范生成 OpenUI 组件应用或 HTML/CSS/SVG 自由文档,经目标视口实际渲染、宿主验收与需求复核后接受并保存。 + +Generate OpenUI component apps or free HTML/CSS/SVG documents under a bound UI specification; accept and persist only after target-viewport rendering, host checks and requirement review. + +## 完整功能清单 / Everything included + +- **由专用智能体工具控制 / Delegated Agent tool** · `GenerativeUI` · 生成可交互的 GenUI 应用并由宿主渲染 + - Generate interactive GenUI applications rendered by the host + +## 怎么用 / How to use it + +1. 打开 AI 会话 + Open an AI session +2. 让智能体生成一个 GenUI 应用 + Ask the agent to generate a GenUI application +3. 在宿主中完成交互并保存,随后重开应用 + Interact and save it in the host, then reopen the application + +入口 / Entry: OpenBitFun 对应场景 + +## 智能体可替你做什么 / What an agent can do for you + +| 操作 / Action | 中文说明 | English description | +| --- | --- | --- | +| 打开对应界面 / Open the UI | 进入 OpenBitFun 中对应的功能界面。 | Open the matching feature in OpenBitFun. | + +## 可配置选项 / Configurable options + +| 选项 / Option | 可用值 / Values | 中文说明 | English description | +| --- | --- | --- | --- | +| 在界面中配置 / Configure in the UI | — | 此页面的设置在对应界面中完成。 | Configure this page in its matching UI. | + +## 可以直接对智能体说 / Try saying + +- “生成一个可保存的记账应用” + - “Generate a saveable accounting app” +- “生成一个带预算设置和支出汇总的 dashboard 应用” + - “Generate a dashboard with budget settings and an expense summary” +- “生成一个阅读目录并支持收藏” + - “Generate a reading catalog with favorites” +- “生成一个带完成状态的日计划” + - “Generate a daily plan with completion state” + +智能体会先查找相关功能或设置,确认目标后再替你打开、执行或修改。完整能力目录不会预先塞进对话上下文。 + +The agent first finds the relevant feature or setting, confirms the target, and then opens, runs, or changes it for you. The full catalog is never embedded in the conversation context. diff --git a/docs/interactive-capabilities/capabilities/setting.tools.execution.md b/docs/interactive-capabilities/capabilities/setting.tools.execution.md index b83f1db61c..508a59d10d 100644 --- a/docs/interactive-capabilities/capabilities/setting.tools.execution.md +++ b/docs/interactive-capabilities/capabilities/setting.tools.execution.md @@ -45,6 +45,8 @@ Manage agent tool permissions, presentation mode, concurrency, timeouts, deferre - Discover and choose a browser, configure default CDP, or restart it when needed - **智能体可直接控制 / Direct Agent control** · 控制是否在安全边界内修复模型生成的非法工具参数 JSON - Choose whether malformed model-generated tool-argument JSON may be repaired within safety boundaries +- **智能体可直接控制 / Direct Agent control** · 选择生成式 UI 组件库及关联 UI 规范并操作预览 + - Select a GenUI component library, its UI specification and preview ## 怎么用 / How to use it @@ -77,6 +79,7 @@ Manage agent tool permissions, presentation mode, concurrency, timeouts, deferre | Computer Use 桌面控制 / Computer Use | `boolean` | 允许智能体使用已授权的桌面控制能力。 | Allow agents to use authorized desktop-control capabilities. | | 启动时连接浏览器 / Connect browser on startup | `boolean` | OpenBitFun 启动后自动尝试连接浏览器控制。 | Automatically try to connect browser control after OpenBitFun starts. | | 工具参数 JSON 修复 / Tool-argument JSON repair | `boolean` | 允许在安全边界内修复模型生成的轻微 JSON 格式错误。 | Allow minor model-generated JSON formatting errors to be repaired within the safety boundary. | +| 生成式 UI 组件库及 UI 规范 / GenUI component library and UI specification | `openbitfun` / `openui` | 选择后续生成使用的组件库及其关联的设计规则、资源、视口、宿主外壳和验收检查;已有应用保留自己的目标身份。 | Choose the component library and its bound design rules, resources, viewport, host shell and acceptance checks. Existing apps retain their target identity. | ## 可以直接对智能体说 / Try saying diff --git a/docs/interactive-capabilities/technical/product-control-open-audit.json b/docs/interactive-capabilities/technical/product-control-open-audit.json index 09f9ea2252..ca2ea91d86 100644 --- a/docs/interactive-capabilities/technical/product-control-open-audit.json +++ b/docs/interactive-capabilities/technical/product-control-open-audit.json @@ -1,12 +1,12 @@ { "schemaVersion": 1, "generatedFrom": "src/shared/interactive-capabilities/catalog.json", - "catalogDigest": "9b42d8bd570aa1f371e2ddfbb4c6d8384e97492e7987c774eef00c1f087db6dc", - "count": 205, + "catalogDigest": "17f5700a9faf966a376680ae8480c1ce1cf06d69caab971e88c33e1c96a1802a", + "count": 200, "reasonCounts": { "externalAuth": 4, "secretEntry": 5, - "unstructuredInteraction": 170, + "unstructuredInteraction": 165, "visualSelection": 26 }, "entries": [ @@ -1374,88 +1374,6 @@ "command:miniapp_render_slide_page" ] }, - { - "capabilityId": "feature.canvas", - "itemId": "artifact-open", - "titleZh": "从会话工具结果加载并打开持久化 Canvas 产物", - "titleEn": "Load and open persistent Canvas artifacts from session tool results", - "reasonCode": "unstructuredInteraction", - "reasonZh": "“从会话工具结果加载并打开持久化 Canvas 产物”由多个实时状态相关步骤组成,目前没有一个能确定完成整个流程的单一结构化 Command;智能体会打开精确入口,并把后续交互保留在用户可见界面。", - "reasonEn": "“Load and open persistent Canvas artifacts from session tool results” spans multiple live-state-dependent steps and currently has no single structured Command that can deterministically complete the whole workflow; the Agent opens the exact entry and keeps the remaining interaction visible to the user.", - "presentationTarget": { - "kind": "scene", - "sceneId": "session" - }, - "evidence": [ - "command:load_canvas_artifact" - ] - }, - { - "capabilityId": "feature.canvas", - "itemId": "state", - "titleZh": "在重新打开或刷新 Canvas 时加载和保存交互状态", - "titleEn": "Load and save interactive state when a Canvas is reopened or refreshed", - "reasonCode": "unstructuredInteraction", - "reasonZh": "“在重新打开或刷新 Canvas 时加载和保存交互状态”由多个实时状态相关步骤组成,目前没有一个能确定完成整个流程的单一结构化 Command;智能体会打开精确入口,并把后续交互保留在用户可见界面。", - "reasonEn": "“Load and save interactive state when a Canvas is reopened or refreshed” spans multiple live-state-dependent steps and currently has no single structured Command that can deterministically complete the whole workflow; the Agent opens the exact entry and keeps the remaining interaction visible to the user.", - "presentationTarget": { - "kind": "scene", - "sceneId": "session" - }, - "evidence": [ - "command:load_canvas_state", - "command:save_canvas_state" - ] - }, - { - "capabilityId": "feature.canvas", - "itemId": "element-context", - "titleZh": "选择 Canvas 内的元素并把元素引用加入会话上下文", - "titleEn": "Select an element inside Canvas and add its reference to session context", - "reasonCode": "unstructuredInteraction", - "reasonZh": "“选择 Canvas 内的元素并把元素引用加入会话上下文”由多个实时状态相关步骤组成,目前没有一个能确定完成整个流程的单一结构化 Command;智能体会打开精确入口,并把后续交互保留在用户可见界面。", - "reasonEn": "“Select an element inside Canvas and add its reference to session context” spans multiple live-state-dependent steps and currently has no single structured Command that can deterministically complete the whole workflow; the Agent opens the exact entry and keeps the remaining interaction visible to the user.", - "presentationTarget": { - "kind": "scene", - "sceneId": "session" - }, - "evidence": [ - "source:src/web-ui/src/tools/openbitfun-canvas/OpenBitFunCanvasPanel.tsx#createCanvasElementContext" - ] - }, - { - "capabilityId": "feature.canvas", - "itemId": "runtime-errors", - "titleZh": "捕获运行错误、上报诊断并请求智能体自动修复", - "titleEn": "Capture runtime errors, report diagnostics, and ask the agent to repair them", - "reasonCode": "unstructuredInteraction", - "reasonZh": "“捕获运行错误、上报诊断并请求智能体自动修复”由多个实时状态相关步骤组成,目前没有一个能确定完成整个流程的单一结构化 Command;智能体会打开精确入口,并把后续交互保留在用户可见界面。", - "reasonEn": "“Capture runtime errors, report diagnostics, and ask the agent to repair them” spans multiple live-state-dependent steps and currently has no single structured Command that can deterministically complete the whole workflow; the Agent opens the exact entry and keeps the remaining interaction visible to the user.", - "presentationTarget": { - "kind": "scene", - "sceneId": "session" - }, - "evidence": [ - "command:report_canvas_runtime_error", - "source:src/web-ui/src/tools/openbitfun-canvas/OpenBitFunCanvasPanel.tsx#canvas-runtime-auto-repair" - ] - }, - { - "capabilityId": "feature.canvas", - "itemId": "export-html", - "titleZh": "把当前 Canvas 导出为可独立打开的 HTML 文件", - "titleEn": "Export the current Canvas as a standalone HTML file", - "reasonCode": "unstructuredInteraction", - "reasonZh": "“把当前 Canvas 导出为可独立打开的 HTML 文件”由多个实时状态相关步骤组成,目前没有一个能确定完成整个流程的单一结构化 Command;智能体会打开精确入口,并把后续交互保留在用户可见界面。", - "reasonEn": "“Export the current Canvas as a standalone HTML file” spans multiple live-state-dependent steps and currently has no single structured Command that can deterministically complete the whole workflow; the Agent opens the exact entry and keeps the remaining interaction visible to the user.", - "presentationTarget": { - "kind": "scene", - "sceneId": "session" - }, - "evidence": [ - "source:src/web-ui/src/tools/openbitfun-canvas/canvasHtmlExportService.ts#export async function exportCanvasHtml" - ] - }, { "capabilityId": "feature.tasks-automation", "itemId": "board-views", diff --git a/docs/interactive-capabilities/technical/tauri-command-map.json b/docs/interactive-capabilities/technical/tauri-command-map.json index 4803cc4b80..2f75592388 100644 --- a/docs/interactive-capabilities/technical/tauri-command-map.json +++ b/docs/interactive-capabilities/technical/tauri-command-map.json @@ -1,13 +1,13 @@ { "schemaVersion": 2, "generatedFrom": "src/shared/interactive-capabilities/catalog.json", - "catalogDigest": "9b42d8bd570aa1f371e2ddfbb4c6d8384e97492e7987c774eef00c1f087db6dc", - "commandCount": 709, + "catalogDigest": "17f5700a9faf966a376680ae8480c1ce1cf06d69caab971e88c33e1c96a1802a", + "commandCount": 705, "coverage": { - "commandCount": 709, - "documentedCommandCount": 649, - "implementationCommandCount": 60, - "implementationDigest": "5047b674e890f899e65baf9235e9df4bd912fa28f44eb10a656e079a1b89974d" + "commandCount": 705, + "documentedCommandCount": 644, + "implementationCommandCount": 61, + "implementationDigest": "fdb6f78b009b95270d26834349aade36e0987553167f325a9c674a085b876a2d" }, "commands": [ { @@ -2839,6 +2839,20 @@ "signature": "fn frontend_update_candidate_ready( state: tauri::State<'_, Arc>, webview: tauri::Webview, request: FrontendUpdateDecisionRequest, ) -> Result", "remoteWorkspacePolicy": "LocalOnly" }, + { + "id": "gen_ui_provider_call", + "moduleId": "generative_ui", + "capabilityId": "feature.generative-ui", + "capabilityIds": [ + "feature.generative-ui" + ], + "documentedItemIds": [], + "visibility": "implementation", + "rustPath": "api::generative_ui_api::gen_ui_provider_call", + "sourceFile": "src/apps/desktop/src/api/generative_ui_api.rs", + "signature": "fn gen_ui_provider_call(request: GenUIProviderRequest) -> Result", + "remoteWorkspacePolicy": "WorkspaceAgnostic" + }, { "id": "generate_commit_message", "moduleId": "git_agent", @@ -5722,38 +5736,6 @@ "signature": "fn load_agent_companion_pet_spritesheet( state: State<'_, AppState>, request: LoadAgentCompanionPetSpritesheetRequest, ) -> Result", "remoteWorkspacePolicy": "LocalOnly" }, - { - "id": "load_canvas_artifact", - "moduleId": "canvas", - "capabilityId": "feature.canvas", - "capabilityIds": [ - "feature.canvas" - ], - "documentedItemIds": [ - "feature.canvas:artifact-open" - ], - "visibility": "documented", - "rustPath": "api::canvas_api::load_canvas_artifact", - "sourceFile": "src/apps/desktop/src/api/canvas_api.rs", - "signature": "fn load_canvas_artifact( state: State<'_, AppState>, request: CanvasStateRequest, ) -> Result", - "remoteWorkspacePolicy": "WorkspaceAgnostic" - }, - { - "id": "load_canvas_state", - "moduleId": "canvas", - "capabilityId": "feature.canvas", - "capabilityIds": [ - "feature.canvas" - ], - "documentedItemIds": [ - "feature.canvas:state" - ], - "visibility": "documented", - "rustPath": "api::canvas_api::load_canvas_state", - "sourceFile": "src/apps/desktop/src/api/canvas_api.rs", - "signature": "fn load_canvas_state( state: State<'_, AppState>, request: CanvasStateRequest, ) -> Result", - "remoteWorkspacePolicy": "WorkspaceAgnostic" - }, { "id": "load_git_repo_history", "moduleId": "git", @@ -8039,38 +8021,6 @@ "signature": "fn replace_mode_skill_selection( state: State<'_, AppState>, request: ReplaceModeSkillSelectionRequest, ) -> Result", "remoteWorkspacePolicy": "LegacyUnaudited" }, - { - "id": "report_canvas_runtime_error", - "moduleId": "canvas", - "capabilityId": "feature.canvas", - "capabilityIds": [ - "feature.canvas" - ], - "documentedItemIds": [ - "feature.canvas:runtime-errors" - ], - "visibility": "documented", - "rustPath": "api::canvas_api::report_canvas_runtime_error", - "sourceFile": "src/apps/desktop/src/api/canvas_api.rs", - "signature": "fn report_canvas_runtime_error( state: State<'_, AppState>, request: ReportCanvasRuntimeErrorRequest, ) -> Result", - "remoteWorkspacePolicy": "WorkspaceAgnostic" - }, - { - "id": "report_canvas_runtime_ready", - "moduleId": "canvas", - "capabilityId": "feature.canvas", - "capabilityIds": [ - "feature.canvas" - ], - "documentedItemIds": [ - "feature.canvas:html-react" - ], - "visibility": "documented", - "rustPath": "api::canvas_api::report_canvas_runtime_ready", - "sourceFile": "src/apps/desktop/src/api/canvas_api.rs", - "signature": "fn report_canvas_runtime_ready( state: State<'_, AppState>, request: ReportCanvasRuntimeReadyRequest, ) -> Result", - "remoteWorkspacePolicy": "WorkspaceAgnostic" - }, { "id": "report_ide_control_result", "moduleId": "commands", @@ -8738,22 +8688,6 @@ "signature": "fn save_acp_json_config( state: State<'_, AppState>, json_config: String, ) -> Result<(), String>", "remoteWorkspacePolicy": "LegacyUnaudited" }, - { - "id": "save_canvas_state", - "moduleId": "canvas", - "capabilityId": "feature.canvas", - "capabilityIds": [ - "feature.canvas" - ], - "documentedItemIds": [ - "feature.canvas:state" - ], - "visibility": "documented", - "rustPath": "api::canvas_api::save_canvas_state", - "sourceFile": "src/apps/desktop/src/api/canvas_api.rs", - "signature": "fn save_canvas_state( state: State<'_, AppState>, request: SaveCanvasStateRequest, ) -> Result", - "remoteWorkspacePolicy": "WorkspaceAgnostic" - }, { "id": "save_cloud_speech_config", "moduleId": "config", diff --git a/package.json b/package.json index 642fde295d..ed61cc2430 100644 --- a/package.json +++ b/package.json @@ -19,8 +19,6 @@ "generate-startup-appearance-bootstrap": "node scripts/generate-startup-appearance-bootstrap.mjs", "miniapp:appearance:generate": "node scripts/generate-miniapp-appearance-contract.mjs", "miniapp:appearance:check": "node scripts/generate-miniapp-appearance-contract.mjs --check", - "canvas:sdk:generate": "node scripts/generate-canvas-sdk-contract.mjs", - "canvas:sdk:check": "node scripts/generate-canvas-sdk-contract.mjs --check", "generate-all": "pnpm run generate-version && pnpm run generate-startup-appearance-bootstrap", "postinstall": "pnpm run copy-assets", "dev": "node scripts/dev.cjs web", @@ -32,7 +30,7 @@ "preview:mobile-web": "pnpm --dir src/mobile-web preview", "lint:web": "pnpm --dir src/web-ui run lint", "lint:web:fix": "pnpm --dir src/web-ui run lint:fix", - "check:web": "pnpm run canvas:sdk:check && pnpm run check:web:appearance && pnpm run type-check:web", + "check:web": "pnpm run check:web:appearance && pnpm run type-check:web", "check:web:appearance": "pnpm run typography:audit:test && pnpm run typography:audit && pnpm run appearance:contract-audit && pnpm run theme:color-audit:test && pnpm run theme:color-audit:all && pnpm run theme:visual-contract", "type-check:mobile-web": "pnpm --dir src/mobile-web run type-check", "i18n:generate": "node scripts/generate-i18n-contract.mjs", diff --git a/packages/flow-chat-presentation/src/registry.ts b/packages/flow-chat-presentation/src/registry.ts index 0749f664f2..d9ce1905d3 100644 --- a/packages/flow-chat-presentation/src/registry.ts +++ b/packages/flow-chat-presentation/src/registry.ts @@ -64,10 +64,6 @@ export const toolPresentationRegistry = { GenerativeUI: { owner: 'product', component: null }, ComputerUse: { owner: 'product', component: null }, OpenBitFunControl: { owner: 'product', component: null }, - CreateCanvas: { owner: 'product', component: null }, - ReadCanvas: { owner: 'product', component: null }, - UpdateCanvas: { owner: 'product', component: null }, - PatchCanvas: { owner: 'product', component: null }, } as const satisfies Record; export type RegisteredToolName = keyof typeof toolPresentationRegistry; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index db6f8399a1..e06086811a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -445,6 +445,12 @@ importers: '@openbitfun/ui': specifier: workspace:^ version: link:../../design-system/packages/ui + '@openuidev/lang-core': + specifier: 1.0.2 + version: 1.0.2(zod@4.6.7) + '@openuidev/react-lang': + specifier: 1.0.2 + version: 1.0.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(zod@4.6.7) '@tanstack/react-virtual': specifier: ^3.13.23 version: 3.13.23(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -538,6 +544,9 @@ importers: lucide-react: specifier: ^0.560.0 version: 0.560.0(react@18.3.1) + maplibre-gl: + specifier: ^6.16.0 + version: 6.16.0 markstream-react: specifier: 2.0.13 version: 2.0.13(katex@0.16.28)(mermaid@11.12.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -631,6 +640,9 @@ importers: yaml: specifier: ^2.8.2 version: 2.8.2 + zod: + specifier: ^4.6.7 + version: 4.6.7 zustand: specifier: ^5.0.10 version: 5.0.11(@types/react@18.3.27)(immer@11.1.4)(react@18.3.1)(use-sync-external-store@1.6.0(react@18.3.1)) @@ -1245,105 +1257,89 @@ packages: resolution: {integrity: sha512-excjX8DfsIcJ10x1Kzr4RcWe1edC9PquDRRPx3YVCvQv+U5p7Yin2s32ftzikXojb1PIFc/9Mt28/y+iRklkrw==} cpu: [arm64] os: [linux] - libc: [glibc] '@img/sharp-libvips-linux-arm@1.2.4': resolution: {integrity: sha512-bFI7xcKFELdiNCVov8e44Ia4u2byA+l3XtsAj+Q8tfCwO6BQ8iDojYdvoPMqsKDkuoOo+X6HZA0s0q11ANMQ8A==} cpu: [arm] os: [linux] - libc: [glibc] '@img/sharp-libvips-linux-ppc64@1.2.4': resolution: {integrity: sha512-FMuvGijLDYG6lW+b/UvyilUWu5Ayu+3r2d1S8notiGCIyYU/76eig1UfMmkZ7vwgOrzKzlQbFSuQfgm7GYUPpA==} cpu: [ppc64] os: [linux] - libc: [glibc] '@img/sharp-libvips-linux-riscv64@1.2.4': resolution: {integrity: sha512-oVDbcR4zUC0ce82teubSm+x6ETixtKZBh/qbREIOcI3cULzDyb18Sr/Wcyx7NRQeQzOiHTNbZFF1UwPS2scyGA==} cpu: [riscv64] os: [linux] - libc: [glibc] '@img/sharp-libvips-linux-s390x@1.2.4': resolution: {integrity: sha512-qmp9VrzgPgMoGZyPvrQHqk02uyjA0/QrTO26Tqk6l4ZV0MPWIW6LTkqOIov+J1yEu7MbFQaDpwdwJKhbJvuRxQ==} cpu: [s390x] os: [linux] - libc: [glibc] '@img/sharp-libvips-linux-x64@1.2.4': resolution: {integrity: sha512-tJxiiLsmHc9Ax1bz3oaOYBURTXGIRDODBqhveVHonrHJ9/+k89qbLl0bcJns+e4t4rvaNBxaEZsFtSfAdquPrw==} cpu: [x64] os: [linux] - libc: [glibc] '@img/sharp-libvips-linuxmusl-arm64@1.2.4': resolution: {integrity: sha512-FVQHuwx1IIuNow9QAbYUzJ+En8KcVm9Lk5+uGUQJHaZmMECZmOlix9HnH7n1TRkXMS0pGxIJokIVB9SuqZGGXw==} cpu: [arm64] os: [linux] - libc: [musl] '@img/sharp-libvips-linuxmusl-x64@1.2.4': resolution: {integrity: sha512-+LpyBk7L44ZIXwz/VYfglaX/okxezESc6UxDSoyo2Ks6Jxc4Y7sGjpgU9s4PMgqgjj1gZCylTieNamqA1MF7Dg==} cpu: [x64] os: [linux] - libc: [musl] '@img/sharp-linux-arm64@0.34.5': resolution: {integrity: sha512-bKQzaJRY/bkPOXyKx5EVup7qkaojECG6NLYswgktOZjaXecSAeCWiZwwiFf3/Y+O1HrauiE3FVsGxFg8c24rZg==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [arm64] os: [linux] - libc: [glibc] '@img/sharp-linux-arm@0.34.5': resolution: {integrity: sha512-9dLqsvwtg1uuXBGZKsxem9595+ujv0sJ6Vi8wcTANSFpwV/GONat5eCkzQo/1O6zRIkh0m/8+5BjrRr7jDUSZw==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [arm] os: [linux] - libc: [glibc] '@img/sharp-linux-ppc64@0.34.5': resolution: {integrity: sha512-7zznwNaqW6YtsfrGGDA6BRkISKAAE1Jo0QdpNYXNMHu2+0dTrPflTLNkpc8l7MUP5M16ZJcUvysVWWrMefZquA==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [ppc64] os: [linux] - libc: [glibc] '@img/sharp-linux-riscv64@0.34.5': resolution: {integrity: sha512-51gJuLPTKa7piYPaVs8GmByo7/U7/7TZOq+cnXJIHZKavIRHAP77e3N2HEl3dgiqdD/w0yUfiJnII77PuDDFdw==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [riscv64] os: [linux] - libc: [glibc] '@img/sharp-linux-s390x@0.34.5': resolution: {integrity: sha512-nQtCk0PdKfho3eC5MrbQoigJ2gd1CgddUMkabUj+rBevs8tZ2cULOx46E7oyX+04WGfABgIwmMC0VqieTiR4jg==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [s390x] os: [linux] - libc: [glibc] '@img/sharp-linux-x64@0.34.5': resolution: {integrity: sha512-MEzd8HPKxVxVenwAa+JRPwEC7QFjoPWuS5NZnBt6B3pu7EG2Ge0id1oLHZpPJdn3OQK+BQDiw9zStiHBTJQQQQ==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [x64] os: [linux] - libc: [glibc] '@img/sharp-linuxmusl-arm64@0.34.5': resolution: {integrity: sha512-fprJR6GtRsMt6Kyfq44IsChVZeGN97gTD331weR1ex1c1rypDEABN6Tm2xa1wE6lYb5DdEnk03NZPqA7Id21yg==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [arm64] os: [linux] - libc: [musl] '@img/sharp-linuxmusl-x64@0.34.5': resolution: {integrity: sha512-Jg8wNT1MUzIvhBFxViqrEhWDGzqymo3sV7z7ZsaWbZNDLXRJZoRGrjulp60YYtV4wfY8VIKcWidjojlLcWrd8Q==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [x64] os: [linux] - libc: [musl] '@img/sharp-wasm32@0.34.5': resolution: {integrity: sha512-OdWTEiVkY2PHwqkbBI8frFxQQFekHaSSkUIJkwzclWZe64O1X4UlUjqqqLaPbUpMOQk6FBu/HtlGXNblIs0huw==} @@ -1577,6 +1573,35 @@ packages: resolution: {integrity: sha512-9I2Zn6+NJLfaGoz9jN3lpwDgAYvfGeNYdbAIjJOqzs4Tpc+VU3Jqq4IofSUBKajiDS8k9fZIg18/z13mpk1bsA==} engines: {node: '>=8'} + '@mapbox/jsonlint-lines-primitives@2.0.3': + resolution: {integrity: sha512-0SElaV0uMxEnxzBhhX9WTuPyUeMsAN/SS0i16tjuba4/mio63MG9khjC1a0JAiPGXAwvwm4UfHJURCN7nyudQg==} + engines: {node: '>= 22'} + + '@mapbox/point-geometry@1.1.0': + resolution: {integrity: sha512-YGcBz1cg4ATXDCM/71L9xveh4dynfGmcLDqufR+nQQy3fKwsAZsWd/x4621/6uJaeB9mwOHE6hPeDgXz9uViUQ==} + + '@mapbox/tiny-sdf@2.3.0': + resolution: {integrity: sha512-gBvcNDBBB66bgQYvnaJ6Jk+VCaMmVq5+IZR2kWPisT88Z8s0kBQt6hfVi8QgRW8Vpg0UWZzBA4ZSyzHHC+VeRA==} + + '@mapbox/unitbezier@1.0.0': + resolution: {integrity: sha512-fqd515fjBmANKGGsQ286E2Wvj/XvDFpGzwJxq4CI6jMQue6Oy04uCKp+JWKF00xRTmk6cEu1jPJ9p3xqH8YWqQ==} + + '@mapbox/vector-tile@3.0.0': + resolution: {integrity: sha512-Qf10S1uIHMk20ri/IVBnpS+esUEkVaR5Hftmz88jTInrpmWgPGJfPe3LVjjlE77trLx8tH6qjTG7uWH9hIq/0Q==} + + '@maplibre/geojson-vt@6.3.0': + resolution: {integrity: sha512-3Zw2jsU9pIJG3G2CQFbLjWj2MlAHodhD7cSY+15iywUuLmmkgzcKRnueVRZ4AcC/5wOtfhidcJAAzBpoBNs3Xg==} + + '@maplibre/maplibre-gl-style-spec@26.5.0': + resolution: {integrity: sha512-Tli0Mi9rF3117uVFkqsysXu9TPLx3AODPmWklUjbDhR4jJ849vGT5/EqWM3dBjIQgU6xxj5SZQ9ONjibqjEP+Q==} + hasBin: true + + '@maplibre/mlt@1.3.0': + resolution: {integrity: sha512-7M2O7ABM80Oi8XPkfkrjKB8mOBIxGoVgkA52Mu4RMWoBvvMdagQ522+WxVYujZsMpqIr3BpzrTbXrm4k8lCzCQ==} + + '@maplibre/vt-pbf@4.3.3': + resolution: {integrity: sha512-dEe5XUd64RQbxNxy2OzIkJnwNDWjVmSXjCd0A7zLirm7QJ/WWbmtDFIkfsiM4yt1cplqzG6oSivRYeWx1SM1yg==} + '@marijn/find-cluster-break@1.0.2': resolution: {integrity: sha512-l0h88YhZFyKdXIFNfSWpyjStDjGHwZ/U7iobcK1cQQD8sejsONdQtTVU+1wVN1PBw40PiiHB1vA5S7VTfQiP9g==} @@ -1622,35 +1647,30 @@ packages: engines: {node: '>= 10'} cpu: [arm64] os: [linux] - libc: [glibc] '@napi-rs/canvas-linux-arm64-musl@0.1.100': resolution: {integrity: sha512-K3mDW66N+xT2/V439u1alFANiBUjdEx2gLiNYnCmUsva5jZMxWTjafBYwTzYK+EMFMHrUoabuU+T1BIP5CgbYQ==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] - libc: [musl] '@napi-rs/canvas-linux-riscv64-gnu@0.1.100': resolution: {integrity: sha512-mooqUBTIsccZpnoQC4NgrC1v6C1vof39etLNMnBwCY+p0gajWJvAHLGQ6g/gGyS5YrpDW+GefSN4+Cvcr08UWw==} engines: {node: '>= 10'} cpu: [riscv64] os: [linux] - libc: [glibc] '@napi-rs/canvas-linux-x64-gnu@0.1.100': resolution: {integrity: sha512-1eCvkDCazm7FFhsT7DfGOdSaHgZVK3bt/dSBl5EWHOWmnz+I7j8tPseJqqD81NF+MH21jKUK4wQSDjN0mdhnTg==} engines: {node: '>= 10'} cpu: [x64] os: [linux] - libc: [glibc] '@napi-rs/canvas-linux-x64-musl@0.1.100': resolution: {integrity: sha512-20arT6lnI19S68qNlii73TSEDbECNgzMz2EpldC1V3mZFuRkeujXkcebRk0LRJe9SEUAooYiLokfMViY8IX7yA==} engines: {node: '>= 10'} cpu: [x64] os: [linux] - libc: [musl] '@napi-rs/canvas-win32-arm64-msvc@0.1.100': resolution: {integrity: sha512-DZFFT1wIAg37LJw37yhMRFfjATd3vTQzjZ1Yki8u2vhO6Hi5VE6BVaGQ1aaDu7xb4iMErz+9EOwjpS7xcxFeBw==} @@ -1680,6 +1700,45 @@ packages: resolution: {integrity: sha512-XlOlEbQcE9fmuXxrVTXCTlG2nlRXa9Rj3rr5Ue/+tX+nmkgbX720YHh0VR3hBF9xDvwnb8D2shVGOwNx+ulArw==} engines: {node: '>= 20.19.0'} + '@openuidev/devtools@0.3.1': + resolution: {integrity: sha512-kOCCsRGwY0w6xL1rVL1zOa9CO97ZrG6YGasRZyCv7FXaDAzbFkEgFy+FhYx6EP7sPKhkgr/jBqunADzhevpBDw==} + peerDependencies: + '@openuidev/observability': '>=0.0.4 <0.1.0' + '@openuidev/react-lang': '>=1.0.0 <2.0.0' + react: ^18.3.1 || ^19.0.0 + react-dom: ^18.0.0 || ^19.0.0 + peerDependenciesMeta: + '@openuidev/react-lang': + optional: true + + '@openuidev/lang-core@1.0.2': + resolution: {integrity: sha512-mxrWXgSmGx9N8ZHFiRgvqCmCH8j3x0PTHJVRvtRPlucxDAihthgMR4W6RXJN5KnCl/5fk1SzcT9JHrvGTKcBFw==} + peerDependencies: + '@modelcontextprotocol/sdk': '>=1.0.0' + zod: ^3.25.0 || ^4.0.0 + peerDependenciesMeta: + '@modelcontextprotocol/sdk': + optional: true + + '@openuidev/observability@0.0.4': + resolution: {integrity: sha512-4fjIrWu3TqTlfDE/m7cG10CH1vV7wQk5GPwMOmXeF9vJtkg92dg4Bdk3AjKgud7H7Xypwwjgt52VcLGZCE2CJQ==} + + '@openuidev/react-lang@1.0.2': + resolution: {integrity: sha512-nCNALKj71GmKo5x0dR10hr3LKf88MHxlkVgnsbYQdJTxBd3TbD9wqlgJkBcAZNFD4kPHINJ0iTdUAbR871XWBw==} + peerDependencies: + '@modelcontextprotocol/sdk': '>=1.0.0' + react: '*' + react-dom: '*' + react-native: '*' + zod: ^3.25.0 || ^4.0.0 + peerDependenciesMeta: + '@modelcontextprotocol/sdk': + optional: true + react-dom: + optional: true + react-native: + optional: true + '@parcel/watcher-android-arm64@2.5.6': resolution: {integrity: sha512-YQxSS34tPF/6ZG7r/Ih9xy+kP/WwediEUsqmtf0cuCV5TPPKw/PQHRhueUo6JdeFJaqV3pyjm0GdYjZotbRt/A==} engines: {node: '>= 10.0.0'} @@ -1709,42 +1768,36 @@ packages: engines: {node: '>= 10.0.0'} cpu: [arm] os: [linux] - libc: [glibc] '@parcel/watcher-linux-arm-musl@2.5.6': resolution: {integrity: sha512-Ve3gUCG57nuUUSyjBq/MAM0CzArtuIOxsBdQ+ftz6ho8n7s1i9E1Nmk/xmP323r2YL0SONs1EuwqBp2u1k5fxg==} engines: {node: '>= 10.0.0'} cpu: [arm] os: [linux] - libc: [musl] '@parcel/watcher-linux-arm64-glibc@2.5.6': resolution: {integrity: sha512-f2g/DT3NhGPdBmMWYoxixqYr3v/UXcmLOYy16Bx0TM20Tchduwr4EaCbmxh1321TABqPGDpS8D/ggOTaljijOA==} engines: {node: '>= 10.0.0'} cpu: [arm64] os: [linux] - libc: [glibc] '@parcel/watcher-linux-arm64-musl@2.5.6': resolution: {integrity: sha512-qb6naMDGlbCwdhLj6hgoVKJl2odL34z2sqkC7Z6kzir8b5W65WYDpLB6R06KabvZdgoHI/zxke4b3zR0wAbDTA==} engines: {node: '>= 10.0.0'} cpu: [arm64] os: [linux] - libc: [musl] '@parcel/watcher-linux-x64-glibc@2.5.6': resolution: {integrity: sha512-kbT5wvNQlx7NaGjzPFu8nVIW1rWqV780O7ZtkjuWaPUgpv2NMFpjYERVi0UYj1msZNyCzGlaCWEtzc+exjMGbQ==} engines: {node: '>= 10.0.0'} cpu: [x64] os: [linux] - libc: [glibc] '@parcel/watcher-linux-x64-musl@2.5.6': resolution: {integrity: sha512-1JRFeC+h7RdXwldHzTsmdtYR/Ku8SylLgTU/reMuqdVD7CtLwf0VR1FqeprZ0eHQkO0vqsbvFLXUmYm/uNKJBg==} engines: {node: '>= 10.0.0'} cpu: [x64] os: [linux] - libc: [musl] '@parcel/watcher-win32-arm64@2.5.6': resolution: {integrity: sha512-3ukyebjc6eGlw9yRt678DxVF7rjXatWiHvTXqphZLvo7aC5NdEgFufVwjFfY51ijYEWpXbqF5jtrK275z52D4Q==} @@ -1841,79 +1894,66 @@ packages: resolution: {integrity: sha512-F8sWbhZ7tyuEfsmOxwc2giKDQzN3+kuBLPwwZGyVkLlKGdV1nvnNwYD0fKQ8+XS6hp9nY7B+ZeK01EBUE7aHaw==} cpu: [arm] os: [linux] - libc: [glibc] '@rollup/rollup-linux-arm-musleabihf@4.57.1': resolution: {integrity: sha512-rGfNUfn0GIeXtBP1wL5MnzSj98+PZe/AXaGBCRmT0ts80lU5CATYGxXukeTX39XBKsxzFpEeK+Mrp9faXOlmrw==} cpu: [arm] os: [linux] - libc: [musl] '@rollup/rollup-linux-arm64-gnu@4.57.1': resolution: {integrity: sha512-MMtej3YHWeg/0klK2Qodf3yrNzz6CGjo2UntLvk2RSPlhzgLvYEB3frRvbEF2wRKh1Z2fDIg9KRPe1fawv7C+g==} cpu: [arm64] os: [linux] - libc: [glibc] '@rollup/rollup-linux-arm64-musl@4.57.1': resolution: {integrity: sha512-1a/qhaaOXhqXGpMFMET9VqwZakkljWHLmZOX48R0I/YLbhdxr1m4gtG1Hq7++VhVUmf+L3sTAf9op4JlhQ5u1Q==} cpu: [arm64] os: [linux] - libc: [musl] '@rollup/rollup-linux-loong64-gnu@4.57.1': resolution: {integrity: sha512-QWO6RQTZ/cqYtJMtxhkRkidoNGXc7ERPbZN7dVW5SdURuLeVU7lwKMpo18XdcmpWYd0qsP1bwKPf7DNSUinhvA==} cpu: [loong64] os: [linux] - libc: [glibc] '@rollup/rollup-linux-loong64-musl@4.57.1': resolution: {integrity: sha512-xpObYIf+8gprgWaPP32xiN5RVTi/s5FCR+XMXSKmhfoJjrpRAjCuuqQXyxUa/eJTdAE6eJ+KDKaoEqjZQxh3Gw==} cpu: [loong64] os: [linux] - libc: [musl] '@rollup/rollup-linux-ppc64-gnu@4.57.1': resolution: {integrity: sha512-4BrCgrpZo4hvzMDKRqEaW1zeecScDCR+2nZ86ATLhAoJ5FQ+lbHVD3ttKe74/c7tNT9c6F2viwB3ufwp01Oh2w==} cpu: [ppc64] os: [linux] - libc: [glibc] '@rollup/rollup-linux-ppc64-musl@4.57.1': resolution: {integrity: sha512-NOlUuzesGauESAyEYFSe3QTUguL+lvrN1HtwEEsU2rOwdUDeTMJdO5dUYl/2hKf9jWydJrO9OL/XSSf65R5+Xw==} cpu: [ppc64] os: [linux] - libc: [musl] '@rollup/rollup-linux-riscv64-gnu@4.57.1': resolution: {integrity: sha512-ptA88htVp0AwUUqhVghwDIKlvJMD/fmL/wrQj99PRHFRAG6Z5nbWoWG4o81Nt9FT+IuqUQi+L31ZKAFeJ5Is+A==} cpu: [riscv64] os: [linux] - libc: [glibc] '@rollup/rollup-linux-riscv64-musl@4.57.1': resolution: {integrity: sha512-S51t7aMMTNdmAMPpBg7OOsTdn4tySRQvklmL3RpDRyknk87+Sp3xaumlatU+ppQ+5raY7sSTcC2beGgvhENfuw==} cpu: [riscv64] os: [linux] - libc: [musl] '@rollup/rollup-linux-s390x-gnu@4.57.1': resolution: {integrity: sha512-Bl00OFnVFkL82FHbEqy3k5CUCKH6OEJL54KCyx2oqsmZnFTR8IoNqBF+mjQVcRCT5sB6yOvK8A37LNm/kPJiZg==} cpu: [s390x] os: [linux] - libc: [glibc] '@rollup/rollup-linux-x64-gnu@4.57.1': resolution: {integrity: sha512-ABca4ceT4N+Tv/GtotnWAeXZUZuM/9AQyCyKYyKnpk4yoA7QIAuBt6Hkgpw8kActYlew2mvckXkvx0FfoInnLg==} cpu: [x64] os: [linux] - libc: [glibc] '@rollup/rollup-linux-x64-musl@4.57.1': resolution: {integrity: sha512-HFps0JeGtuOR2convgRRkHCekD7j+gdAuXM+/i6kGzQtFhlCtQkpwtNzkNj6QhCDp7DRJ7+qC/1Vg2jt5iSOFw==} cpu: [x64] os: [linux] - libc: [musl] '@rollup/rollup-openbsd-x64@4.57.1': resolution: {integrity: sha512-H+hXEv9gdVQuDTgnqD+SQffoWoc0Of59AStSzTEj/feWTBAnSfSD3+Dql1ZruJQxmykT/JVY0dE8Ka7z0DH1hw==} @@ -1999,35 +2039,30 @@ packages: engines: {node: '>= 10'} cpu: [arm64] os: [linux] - libc: [glibc] '@tauri-apps/cli-linux-arm64-musl@2.11.4': resolution: {integrity: sha512-v277UnT/fB64xAfSroL5N3Km3tLmvATWqJJw/wRI+g6o+HkeD0slyE7gOhNs1MbjE41R7bQOTxMVoL3aomUJmw==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] - libc: [musl] '@tauri-apps/cli-linux-riscv64-gnu@2.11.4': resolution: {integrity: sha512-qqgNkQ2u1yZHxjhxsZaxUtRDW8dIqIYm33rx/mzwQv0SfY9x1B+iraj8vWeFiXjjSVVhEMepXSOts1TqPzvXNQ==} engines: {node: '>= 10'} cpu: [riscv64] os: [linux] - libc: [glibc] '@tauri-apps/cli-linux-x64-gnu@2.11.4': resolution: {integrity: sha512-2VRNWl84FOH0m2giiDkO2h0QXlcMJeX+zJDpI5kDIQAx6s+geF3v48F4DXfJez4GS/FdoDGnPnw1C2iYGbQ7bQ==} engines: {node: '>= 10'} cpu: [x64] os: [linux] - libc: [glibc] '@tauri-apps/cli-linux-x64-musl@2.11.4': resolution: {integrity: sha512-o9GyhYor/nc7xarmwDE3ka2szuW3uuZzXjHWh64Q8YX5AtSgxdQkFWzrY4O8KiGtVNvFBI14H3Q49Qj5TOIP/A==} engines: {node: '>= 10'} cpu: [x64] os: [linux] - libc: [musl] '@tauri-apps/cli-win32-arm64-msvc@2.11.4': resolution: {integrity: sha512-ld5Ehb598m0VkYyylRPNeCFsBe/km0jxis6KgMpl3IGY6I/i1RwQXO05I1AsXUXO2WC6AvB/Lw4qTf/asiuEiQ==} @@ -2902,6 +2937,9 @@ packages: bidi-js@1.0.3: resolution: {integrity: sha512-RKshQI1R3YQ+n9YJz2QQ147P66ELpa1FQEg20Dk8oW9t2KgLbpDLLp9aGZ7y8WHSshDknG0bknqGw5/tyCs5tw==} + bidi-js@1.1.0: + resolution: {integrity: sha512-fX1Onk0tdVPC7obPWB5EbJ1z7NVhLq4m2xZLq2YXBkxzMXIGRpNMU88n0EPgWseKl12J7zXs7qrDxPK4sRs2fg==} + big-integer@1.6.52: resolution: {integrity: sha512-QxD8cf2eVqJOOz63z6JIN9BzvVs/dlySa5HGSBH5xtR8dPteIRQnBxxKqkNTiT6jbDTF6jAfrd4oMcND9RGbQg==} engines: {node: '>=0.6'} @@ -3483,6 +3521,9 @@ packages: duplexify@4.1.3: resolution: {integrity: sha512-M3BmBhwJRZsSx38lZyhE53Csddgzl5R7xGJNk7CVddZD6CcmwMCH8J+7AprIrQKH7TonKxaCjcv27Qmf+sQ+oA==} + earcut@3.2.4: + resolution: {integrity: sha512-FHc6yNpnTORB0tM5kmZ03iD2mDuNakDE2lvf4Hw1XkfxtEHIGVi01B/GqUSwx+NcC1WGjidAfpTXzeALtPtfpg==} + eastasianwidth@0.2.0: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} @@ -3862,6 +3903,9 @@ packages: resolution: {integrity: sha512-b1O07XYq8eRuVzBNgJLstU6FYc1tS6wnMtF1I1D9lE8LxZSOGZ7LhxN54yPP6mGw5f2CkXY2BQUL9Fx41qvcIg==} engines: {node: '>= 14'} + gl-matrix@3.4.4: + resolution: {integrity: sha512-latSnyDNt/8zYUB6VIJ6PCh2jBjJX6gnDsoCZ7LyW7GkqrD51EWwa9qCoGixj8YqBtETQK/xY7OmpTF8xz1DdQ==} + glob-parent@5.1.2: resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} engines: {node: '>= 6'} @@ -3881,12 +3925,12 @@ packages: glob@7.2.3: resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} - deprecated: Glob versions prior to v9 are no longer supported + deprecated: Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me glob@8.1.0: resolution: {integrity: sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==} engines: {node: '>=12'} - deprecated: Glob versions prior to v9 are no longer supported + deprecated: Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me globals@14.0.0: resolution: {integrity: sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==} @@ -4279,6 +4323,9 @@ packages: json-stable-stringify-without-jsonify@1.0.1: resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} + json-stringify-pretty-compact@4.0.0: + resolution: {integrity: sha512-3CNZ2DnrpByG9Nqj6Xo8vqbjT4F6N+tb4Gb28ESAZjYZ5yqvmc56J+/kuIwkaAMOyblTQhUW7PxMkUb8Q36N3Q==} + json5@2.2.3: resolution: {integrity: sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==} engines: {node: '>=6'} @@ -4291,6 +4338,9 @@ packages: resolution: {integrity: sha512-YHzO7721WbmAL6Ov1uzN/l5mY5WWWhJBSW+jq4tkfZfsxmo1hu6frS0EOswvjBUnWE6NtjEs48SFn5CQESRLZg==} hasBin: true + kdbush@4.1.0: + resolution: {integrity: sha512-e9vurzrXJQrFX6ckpHP3bvj5l+9CnYzkxDNnNQ1h2QTqdWsUAJgXiKdGNcOa1EY85dU8KbQ+z/FdQdB7P+9yfQ==} + keyv@4.5.4: resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==} @@ -4427,12 +4477,21 @@ packages: peerDependencies: react: ^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0 + lucide-react@0.575.0: + resolution: {integrity: sha512-VuXgKZrk0uiDlWjGGXmKV6MSk9Yy4l10qgVvzGn2AWBx1Ylt0iBexKOAoA6I7JO3m+M9oeovJd3yYENfkUbOeg==} + peerDependencies: + react: ^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0 + magic-string@0.30.21: resolution: {integrity: sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==} make-error@1.3.6: resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==} + maplibre-gl@6.16.0: + resolution: {integrity: sha512-gApO66EMtoDZuio680RUBvskR7ahFd/NNhLN4tBAs+Y7FeT4gQV8zVFgYVMRmFxQznOEzecW19w6xOd9XjZjiA==} + engines: {node: '>=16.14.0', npm: '>=8.1.0'} + markdown-it-container@4.0.0: resolution: {integrity: sha512-HaNccxUH0l7BNGYbFbjmGpf5aLHAMTinqRZQAEQbMr2cdD3z91Q6kIo1oUn1CQndkT03jat6ckrdRYuwwqLlQw==} @@ -4718,6 +4777,9 @@ packages: ms@2.1.3: resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} + murmurhash-js@1.0.0: + resolution: {integrity: sha512-TvmkNhkv8yct0SVBSy+o8wYzXjE4Zz3PCesbfs8HiCXXdcTuocApFv11UWlNFWKYsP2okqrhb7JNlSm9InBhIw==} + mute-stream@2.0.0: resolution: {integrity: sha512-WWdIxpyjEn+FhQJQQv9aQAYlHoNVdzIzUySNV1gHUPDSdZJ3yZn7pAAbQcV7B56Mvu881q9FZV+0Vx2xC44VWA==} engines: {node: ^18.17.0 || >=20.5.0} @@ -4910,6 +4972,10 @@ packages: pathe@2.0.3: resolution: {integrity: sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==} + pbf@5.1.2: + resolution: {integrity: sha512-mnvGdvOrIvJOBGUEdGkrVXjN8E/VkIJCkf2eS1DH2yv82ORUlLttmDt0rWY38yYZmVwciZwBUvHM20qxBZf40w==} + hasBin: true + pdf-lib@1.17.1: resolution: {integrity: sha512-V/mpyJAoTsN4cnP31vc0wfNA1+p20evqqnap0KLoRUN0Yk/p3wN52DOEsL4oBFcLdb76hlpKPtzJIgo67j/XLw==} @@ -4965,6 +5031,9 @@ packages: resolution: {integrity: sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==} engines: {node: ^10 || ^12 || >=14} + potpack@2.1.0: + resolution: {integrity: sha512-pcaShQc1Shq0y+E7GqJqvZj8DTthWV1KeHGdi0Z6IAin2Oi3JnLCOfwnCo84qc+HAp52wT9nK9H7FAJp5a44GQ==} + pptxgenjs@4.0.1: resolution: {integrity: sha512-TeJISr8wouAuXw4C1F/mC33xbZs/FuEG6nH9FG1Zj+nuPcGMP5YRHl6X+j3HSUnS1f3at6k75ZZXPMZlA5Lj9A==} @@ -5072,6 +5141,9 @@ packages: prosemirror-view@1.41.7: resolution: {integrity: sha512-jUwKNCEIGiqdvhlS91/2QAg21e4dfU5bH2iwmSDQeosXJgKF7smG0YSplOWK0cjSNgIqXe7VXqo7EIfUFJdt3w==} + protocol-buffers-schema@3.6.1: + resolution: {integrity: sha512-VG2K63Igkiv9p76tk1lilczEK1cT+kCjKtkdhw1dQZV3k3IXJbd3o6Ho8b9zJZaHSnT2hKe4I+ObmX9w6m5SmQ==} + proxy-agent@6.3.1: resolution: {integrity: sha512-Rb5RVBy1iyqOtNl15Cw/llpeLH8bsb37gM1FUfKQ+Wck6xHlbAhWGUFiTRHtkjqGTA5pSHz6+0hrPW/oECihPQ==} engines: {node: '>= 14'} @@ -5112,6 +5184,9 @@ packages: quick-format-unescaped@4.0.4: resolution: {integrity: sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg==} + quickselect@3.0.0: + resolution: {integrity: sha512-XdjUArbK4Bm5fLLvlm5KpTFOiOThgfWWI4axAZDWg4E/0mKdZyI9tNEfds27qCi1ze/vwTR16kvmmGhRra3c2g==} + randombytes@2.1.0: resolution: {integrity: sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==} @@ -5247,6 +5322,9 @@ packages: resolve-pkg-maps@1.0.0: resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==} + resolve-protobuf-schema@2.1.0: + resolution: {integrity: sha512-kI5ffTiZWmJaS/huM8wZfEMer1eRd7oJQhDuxeCLe3t7N7mX3z94CN0xPxBQxFYQTSNz9T0i+v6inKqSdK8xrQ==} + resq@1.11.0: resolution: {integrity: sha512-G10EBz+zAAy3zUd/CDoBbXRL6ia9kOo3xRHrMDsHljI0GDkhYlyjwoCx5+3eCC4swi1uCoZQhskuJkj7Gp57Bw==} @@ -5590,6 +5668,9 @@ packages: resolution: {integrity: sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==} engines: {node: '>=12.0.0'} + tinyqueue@3.0.0: + resolution: {integrity: sha512-gRa9gwYU3ECmQYv3lslts5hxuIa90veaEcxDYuu3QGOIAEM2mOZkVHp48ANJuu1CURtRdHKUBY5Lm1tHV+sD4g==} + tinyrainbow@1.2.0: resolution: {integrity: sha512-weEDEq7Z5eTHPDh4xjX789+fHfF+P8boiFB+0vbWzpbnbsEr/GRaohi/uMKxg8RZMXnl1ItAi/IUHWMsjDV7kQ==} engines: {node: '>=14.0.0'} @@ -5795,6 +5876,7 @@ packages: uuid@10.0.0: resolution: {integrity: sha512-8XkAphELsDnEGrDxUOHB3RGvXz6TeuYSGEZBOjtTtPm2lwhGBjLgOzLHB63IUWfBpNucQjND6d3AOudO+H3RWQ==} + deprecated: uuid@10 and below is no longer supported. For ESM codebases, update to uuid@latest. For CommonJS codebases, use uuid@11 (but be aware this version will likely be deprecated in 2028). hasBin: true uuid@11.1.0: @@ -6145,6 +6227,9 @@ packages: resolution: {integrity: sha512-zK7YHHz4ZXpW89AHXUPbQVGKI7uvkd3hzusTdotCg1UxyaVtg0zFJSTfW/Dq5f7OBBVnq6cZIaC8Ti4hb6dtCA==} engines: {node: '>= 14'} + zod@4.6.7: + resolution: {integrity: sha512-g8W2D2kU6a8untc053fX1uVBKzM7yqAxW/3zwk83+6RyF2+SKOuV+c0wBDhUwzV1PaGapmZH+rmcUzPf+3CGwg==} + zustand@5.0.11: resolution: {integrity: sha512-fdZY+dk7zn/vbWNCYmzZULHRrss0jx5pPFiOuMZ/5HJN6Yv3u+1Wswy/4MpZEkEGhtNH+pwxZB8OKgUBPzYAGg==} engines: {node: '>=12.20.0'} @@ -6967,6 +7052,43 @@ snapshots: '@lukeed/ms@2.0.2': {} + '@mapbox/jsonlint-lines-primitives@2.0.3': {} + + '@mapbox/point-geometry@1.1.0': {} + + '@mapbox/tiny-sdf@2.3.0': {} + + '@mapbox/unitbezier@1.0.0': {} + + '@mapbox/vector-tile@3.0.0': + dependencies: + '@mapbox/point-geometry': 1.1.0 + '@types/geojson': 7946.0.16 + pbf: 5.1.2 + + '@maplibre/geojson-vt@6.3.0': + dependencies: + kdbush: 4.1.0 + + '@maplibre/maplibre-gl-style-spec@26.5.0': + dependencies: + '@mapbox/jsonlint-lines-primitives': 2.0.3 + '@mapbox/unitbezier': 1.0.0 + json-stringify-pretty-compact: 4.0.0 + minimist: 1.2.8 + quickselect: 3.0.0 + tinyqueue: 3.0.0 + + '@maplibre/mlt@1.3.0': + dependencies: + '@mapbox/point-geometry': 1.1.0 + + '@maplibre/vt-pbf@4.3.3': + dependencies: + '@mapbox/point-geometry': 1.1.0 + '@types/geojson': 7946.0.16 + pbf: 5.1.2 + '@marijn/find-cluster-break@1.0.2': {} '@mermaid-js/parser@0.6.3': @@ -7040,6 +7162,32 @@ snapshots: '@noble/hashes@2.0.1': {} + '@openuidev/devtools@0.3.1(@openuidev/observability@0.0.4)(@openuidev/react-lang@1.0.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(zod@4.6.7))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': + dependencies: + '@openuidev/observability': 0.0.4 + lucide-react: 0.575.0(react@18.3.1) + react: 18.3.1 + react-dom: 18.3.1(react@18.3.1) + optionalDependencies: + '@openuidev/react-lang': 1.0.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(zod@4.6.7) + + '@openuidev/lang-core@1.0.2(zod@4.6.7)': + dependencies: + ci-info: 4.4.0 + zod: 4.6.7 + + '@openuidev/observability@0.0.4': {} + + '@openuidev/react-lang@1.0.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(zod@4.6.7)': + dependencies: + '@openuidev/devtools': 0.3.1(@openuidev/observability@0.0.4)(@openuidev/react-lang@1.0.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(zod@4.6.7))(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + '@openuidev/lang-core': 1.0.2(zod@4.6.7) + '@openuidev/observability': 0.0.4 + react: 18.3.1 + zod: 4.6.7 + optionalDependencies: + react-dom: 18.3.1(react@18.3.1) + '@parcel/watcher-android-arm64@2.5.6': optional: true @@ -8458,6 +8606,10 @@ snapshots: dependencies: require-from-string: 2.0.2 + bidi-js@1.1.0: + dependencies: + require-from-string: 2.0.2 + big-integer@1.6.52: {} binary-extensions@2.3.0: {} @@ -9097,6 +9249,8 @@ snapshots: readable-stream: 3.6.2 stream-shift: 1.0.3 + earcut@3.2.4: {} + eastasianwidth@0.2.0: {} easy-table@1.2.0: @@ -9572,6 +9726,8 @@ snapshots: transitivePeerDependencies: - supports-color + gl-matrix@3.4.4: {} + glob-parent@5.1.2: dependencies: is-glob: 4.0.3 @@ -10054,6 +10210,8 @@ snapshots: json-stable-stringify-without-jsonify@1.0.1: {} + json-stringify-pretty-compact@4.0.0: {} + json5@2.2.3: {} jszip@3.10.1: @@ -10067,6 +10225,8 @@ snapshots: dependencies: commander: 8.3.0 + kdbush@4.1.0: {} + keyv@4.5.4: dependencies: json-buffer: 3.0.1 @@ -10207,12 +10367,37 @@ snapshots: dependencies: react: 18.3.1 + lucide-react@0.575.0(react@18.3.1): + dependencies: + react: 18.3.1 + magic-string@0.30.21: dependencies: '@jridgewell/sourcemap-codec': 1.5.5 make-error@1.3.6: {} + maplibre-gl@6.16.0: + dependencies: + '@mapbox/point-geometry': 1.1.0 + '@mapbox/tiny-sdf': 2.3.0 + '@mapbox/unitbezier': 1.0.0 + '@mapbox/vector-tile': 3.0.0 + '@maplibre/geojson-vt': 6.3.0 + '@maplibre/maplibre-gl-style-spec': 26.5.0 + '@maplibre/mlt': 1.3.0 + '@maplibre/vt-pbf': 4.3.3 + '@types/geojson': 7946.0.16 + bidi-js: 1.1.0 + earcut: 3.2.4 + gl-matrix: 3.4.4 + kdbush: 4.1.0 + murmurhash-js: 1.0.0 + pbf: 5.1.2 + potpack: 2.1.0 + quickselect: 3.0.0 + tinyqueue: 3.0.0 + markdown-it-container@4.0.0: {} markdown-it-footnote@4.0.0: {} @@ -10739,6 +10924,8 @@ snapshots: ms@2.1.3: {} + murmurhash-js@1.0.0: {} + mute-stream@2.0.0: {} nanoid@3.3.11: {} @@ -10936,6 +11123,10 @@ snapshots: pathe@2.0.3: {} + pbf@5.1.2: + dependencies: + resolve-protobuf-schema: 2.1.0 + pdf-lib@1.17.1: dependencies: '@pdf-lib/standard-fonts': 1.0.0 @@ -11001,6 +11192,8 @@ snapshots: picocolors: 1.1.1 source-map-js: 1.2.1 + potpack@2.1.0: {} + pptxgenjs@4.0.1: dependencies: '@types/node': 22.19.7 @@ -11145,6 +11338,8 @@ snapshots: prosemirror-state: 1.4.4 prosemirror-transform: 1.11.0 + protocol-buffers-schema@3.6.1: {} + proxy-agent@6.3.1: dependencies: agent-base: 7.1.4 @@ -11211,6 +11406,8 @@ snapshots: quick-format-unescaped@4.0.4: {} + quickselect@3.0.0: {} + randombytes@2.1.0: dependencies: safe-buffer: 5.1.2 @@ -11411,6 +11608,10 @@ snapshots: resolve-pkg-maps@1.0.0: {} + resolve-protobuf-schema@2.1.0: + dependencies: + protocol-buffers-schema: 3.6.1 + resq@1.11.0: dependencies: fast-deep-equal: 2.0.1 @@ -11823,6 +12024,8 @@ snapshots: fdir: 6.5.0(picomatch@4.0.3) picomatch: 4.0.3 + tinyqueue@3.0.0: {} + tinyrainbow@1.2.0: {} tinyrainbow@3.0.3: {} @@ -12390,6 +12593,8 @@ snapshots: compress-commons: 6.0.2 readable-stream: 4.7.0 + zod@4.6.7: {} + zustand@5.0.11(@types/react@18.3.27)(immer@11.1.4)(react@18.3.1)(use-sync-external-store@1.6.0(react@18.3.1)): optionalDependencies: '@types/react': 18.3.27 diff --git a/scripts/audit-appearance-contracts.mjs b/scripts/audit-appearance-contracts.mjs index 4ad000e7b5..f540138665 100644 --- a/scripts/audit-appearance-contracts.mjs +++ b/scripts/audit-appearance-contracts.mjs @@ -21,8 +21,6 @@ const crossBoundaryRoots = [ path.join(repoRoot, 'tests', 'e2e', 'specs'), path.join(repoRoot, 'tests', 'e2e', 'helpers'), path.join(repoRoot, 'src', 'crates', 'contracts', 'product-domains', 'src', 'miniapp'), - path.join(repoRoot, 'src', 'crates', 'services', 'services-integrations', 'src', 'canvas'), - path.join(repoRoot, 'src', 'crates', 'assembly', 'core', 'builtin_skills', 'openbitfun-canvas'), path.join(repoRoot, 'src', 'crates', 'assembly', 'core', 'builtin_skills', 'miniapp-dev'), ]; const failures = []; @@ -116,6 +114,17 @@ function relative(file) { return path.relative(repoRoot, file); } +// OpenUI and Harmony component sources are vendored renderer resources. They +// carry their upstream theme DOM and CSS vocabulary inside the GenUI renderer +// boundary, where the host scopes delivery separately from product Appearance +// surfaces. Do not treat those upstream contracts as product-owned surfaces. +function isVendoredGenUISource(file) { + const normalized = relative(file).replaceAll('\\', '/'); + return normalized.startsWith('src/web-ui/src/tools/generative-ui/components/openui/') + || normalized.startsWith('src/web-ui/src/tools/generative-ui/components/vendor/') + || normalized === 'src/web-ui/src/tools/generative-ui/components/openuiLibrary.tsx'; +} + function extractObject(source, start) { const open = source.indexOf('{', start); if (open < 0) return null; @@ -385,7 +394,9 @@ function analyzeStyledOwnerContract(file, source, visualClassIds) { const sourceFiles = walk(sourceRoot); const sources = new Map(sourceFiles.map(file => [file, fs.readFileSync(file, 'utf8')])); -const productionSources = [...sources.entries()].filter(([file]) => !/\.(?:test|spec)\.[jt]sx?$/.test(file)); +const productionSources = [...sources.entries()].filter(([file]) => ( + !/\.(?:test|spec)\.[jt]sx?$/.test(file) && !isVendoredGenUISource(file) +)); const productionCodeSources = productionSources.filter(([file]) => /\.(?:ts|tsx)$/.test(file)); const externalAppearanceContractSources = externalAppearanceContractFiles .filter(file => fs.existsSync(file)) @@ -686,10 +697,7 @@ for (const sceneFile of walk(sceneRoot).filter(file => file.endsWith('Scene.tsx' } } -const visualEntryPoints = new Set([ - 'main.tsx', - 'tools/openbitfun-canvas/runtime/entry.tsx', -]); +const visualEntryPoints = new Set(['main.tsx']); const styledProductionTsx = productionCodeSources.filter(([file, source]) => { if (!file.endsWith('.tsx')) return false; const sourceRelative = path.relative(sourceRoot, file).replaceAll(path.sep, '/'); @@ -853,8 +861,6 @@ for (const [file, source] of productionSources) { const crossBoundaryForbiddenContracts = [ ['hostTheme', /\bhostTheme\b/], - ['CanvasHostTheme', /\bCanvasHostTheme\b/], - ['openbitfun-canvas-theme', /openbitfun-canvas-theme/], ['onThemeChange', /\bonThemeChange\b/], ['data-theme-type', /data-theme-type/], ['openbitfun/request-theme', /openbitfun\/request-theme/], diff --git a/scripts/audit-theme-colors.mjs b/scripts/audit-theme-colors.mjs index 8a52ba2318..8620ef3470 100644 --- a/scripts/audit-theme-colors.mjs +++ b/scripts/audit-theme-colors.mjs @@ -108,6 +108,11 @@ const GENERATED_WIDGET_APPEARANCE_PAYLOAD_PATH = 'infrastructure/appearance/adap const REPORT_ROW_LIMIT = 100; const COLOR_DOMAIN_CONTRACT_BY_KEY = new Map(COLOR_DOMAIN_CONTRACTS.map(contract => [contract.key, contract])); const FALLBACK_VAR_CONTRACT_BY_KEY = new Map(FALLBACK_VAR_CONTRACTS.map(contract => [contract.key, contract])); +const VENDORED_GENUI_EXCLUSIONS = [ + 'src/tools/generative-ui/components/openui', + 'src/tools/generative-ui/components/openuiLibrary.tsx', + 'src/tools/generative-ui/components/vendor', +]; const TOKEN_COMPATIBILITY_ALIAS_BY_KEY = new Map( TOKEN_COMPATIBILITY_ALIAS_CONTRACTS.map(contract => [contract.key, contract]), ); @@ -214,6 +219,16 @@ function parseArgs(argv) { } } + // The checked-in OpenUI/Harmony resources are vendored renderer payloads; + // their upstream palette and fallback variables are audited by their own + // source boundary rather than Web UI app-token budgets. Apply this only to + // the repository's real Web UI root so fixture roots remain explicit. + if (path.resolve(options.root) === path.resolve(DEFAULT_ROOT)) { + for (const exclusion of VENDORED_GENUI_EXCLUSIONS) { + if (!options.excludePaths.includes(exclusion)) options.excludePaths.push(exclusion); + } + } + return options; } diff --git a/scripts/audit-typography-tokens.mjs b/scripts/audit-typography-tokens.mjs index 0dc8a54b8a..71bc424cd6 100644 --- a/scripts/audit-typography-tokens.mjs +++ b/scripts/audit-typography-tokens.mjs @@ -55,6 +55,15 @@ const COMPLETE_PRODUCT_STYLE_ROOTS = [ 'OpenBitFun-Installer/src/', ]; +// These files are intentionally vendored style resources. Their typography is +// part of the upstream renderer contract and is scoped by the GenUI host before +// it reaches the product surface. Keep this allowlist narrow: product-owned +// GenUI styles continue to use the canonical OpenBitFun type roles below. +const VENDORED_TYPOGRAPHY_OWNER_ROOTS = [ + 'src/web-ui/src/tools/generative-ui/components/openui/', + 'src/web-ui/src/tools/generative-ui/components/vendor/', +]; + const TYPOGRAPHY_PROPERTIES = new Set([ 'font', 'fontFamily', @@ -415,6 +424,10 @@ function isBuildOwnedWebFontDeclaration(relativePath, source, offset, property, )); } +function hasVendoredTypographyOwner(relativePath) { + return VENDORED_TYPOGRAPHY_OWNER_ROOTS.some(root => relativePath.startsWith(root)); +} + function isStructuralZero(property, value) { return (property === 'fontSize' || property === 'lineHeight') && /^0(?:\.0+)?$/.test(value); } @@ -729,6 +742,7 @@ export function auditTypographyText(text, relativePath, options = {}) { const issues = auditRetiredReferences(text, normalizedPath); if (options.retiredOnly) return issues; + if (hasVendoredTypographyOwner(normalizedPath)) return issues; if (STYLE_EXTENSIONS.has(extension) && productionSource) { issues.push(...auditCssDeclarations(text, normalizedPath)); issues.push(...auditSemanticRoleConsumption(text, normalizedPath)); diff --git a/scripts/check-core-boundaries.test.mjs b/scripts/check-core-boundaries.test.mjs index 027d0b75f5..e5483c5f3d 100644 --- a/scripts/check-core-boundaries.test.mjs +++ b/scripts/check-core-boundaries.test.mjs @@ -1085,7 +1085,6 @@ test('contract and AI adapter tests keep reviewed feature and failure-domain top name: 'product_domain_contracts', path: 'tests/product_domain_contracts.rs', leaves: [ - 'tests/product_domain_contracts/canvas_contracts.rs', 'tests/product_domain_contracts/tool_permission_contracts.rs', ], forbidRequiredFeatures: true, @@ -1528,7 +1527,6 @@ test('Core product-full explicitly assembles service and tool capability owners' 'tools-image-analysis', 'tools-image-generation', 'tools-miniapp', - 'tools-canvas', 'tools-agent-control', ]) { assert.ok( @@ -2124,13 +2122,13 @@ test('App Server reviewed Core capability closure remains independently valid', ); }); -test('ACP Core capability closure rejects the Canvas product tool owner', () => { +test('ACP Core capability closure rejects the unreviewed MiniApp tool owner', () => { const core = packageAt('openbitfun-core', 'src/crates/assembly/core/Cargo.toml'); const acp = packageAt('openbitfun-acp', 'src/crates/interfaces/acp/Cargo.toml', [ pathDependency('src/crates/assembly/core', { name: 'openbitfun-core', usesDefaultFeatures: false, - features: [...ACP_REVIEWED_CORE_FEATURES, 'tools-canvas'], + features: [...ACP_REVIEWED_CORE_FEATURES, 'tools-miniapp'], }), ]); @@ -2140,7 +2138,7 @@ test('ACP Core capability closure rejects the Canvas product tool owner', () => ); assert.equal(violations.length, 1); - assert.match(violations[0].message, /must not include unreviewed feature tools-canvas/); + assert.match(violations[0].message, /must not include unreviewed feature tools-miniapp/); }); test('ACP Core capability closure validation cannot be disabled by removing an owner', () => { @@ -2219,7 +2217,7 @@ test('CLI openbitfun-core dev-dependency cannot widen the product capability clo name: 'openbitfun-core', kind: 'dev', usesDefaultFeatures: false, - features: ['test-support', 'tools-canvas'], + features: ['test-support', 'tools-miniapp'], }), ]); @@ -2231,7 +2229,7 @@ test('CLI openbitfun-core dev-dependency cannot widen the product capability clo assert.equal(violations.length, 1); assert.match( violations[0].message, - /openbitfun-core dev-dependency may select only test-support, not \[test-support, tools-canvas\]/, + /openbitfun-core dev-dependency may select only test-support, not \[test-support, tools-miniapp\]/, ); }); diff --git a/scripts/core-boundaries/cargo-dependency-boundaries.mjs b/scripts/core-boundaries/cargo-dependency-boundaries.mjs index b0faaf0a38..8f45cd2e80 100644 --- a/scripts/core-boundaries/cargo-dependency-boundaries.mjs +++ b/scripts/core-boundaries/cargo-dependency-boundaries.mjs @@ -149,7 +149,6 @@ const SERVICES_INTEGRATIONS_TOKIO_FEATURES = new Map([ ['models-dev', ['fs', 'rt', 'sync', 'time']], // Browser profile files and process probes use spawn_blocking off async IO workers. ['browser-control', ['rt', 'time']], - ['canvas-runtime', ['fs']], ['deep-research', []], ['git', ['fs', 'io-util', 'macros', 'rt', 'time']], ['file-watch', ['rt', 'sync']], @@ -1495,7 +1494,6 @@ export function findProductEntrypointCoreFeatureViolations( 'agent-runtime', 'ai-adapter-runtime', 'browser-control', - 'canvas-runtime', 'deep-research', 'document-read', 'external-sources', @@ -1518,7 +1516,6 @@ export function findProductEntrypointCoreFeatureViolations( 'tools-agent-control', 'tools-basic', 'tools-browser-web', - 'tools-canvas', 'tools-computer-use', 'tools-creation', 'tools-git', diff --git a/scripts/core-boundaries/explicit-test-topology.mjs b/scripts/core-boundaries/explicit-test-topology.mjs index 2cf1f4f7f9..8f8749983a 100644 --- a/scripts/core-boundaries/explicit-test-topology.mjs +++ b/scripts/core-boundaries/explicit-test-topology.mjs @@ -180,7 +180,6 @@ export const productDomainsIntegrationTestTargets = [ name: 'product_domain_contracts', path: 'tests/product_domain_contracts.rs', leaves: [ - 'tests/product_domain_contracts/canvas_contracts.rs', 'tests/product_domain_contracts/tool_permission_contracts.rs', ], forbidRequiredFeatures: true, diff --git a/scripts/core-boundaries/rules/feature-rules.mjs b/scripts/core-boundaries/rules/feature-rules.mjs index 052e0d6b11..fc13e5f281 100644 --- a/scripts/core-boundaries/rules/feature-rules.mjs +++ b/scripts/core-boundaries/rules/feature-rules.mjs @@ -189,7 +189,6 @@ export const optionalDependencyFeatureOwnerRules = [ depName: 'openbitfun-product-domains', ownerFeatures: [ 'agent-runtime', - 'canvas-runtime', 'function-agents', 'plugin-source', 'product-search', @@ -201,7 +200,6 @@ export const optionalDependencyFeatureOwnerRules = [ { depName: 'openbitfun-services-integrations', ownerFeatures: [ - 'canvas-runtime', 'browser-control', 'deep-research', 'external-sources', @@ -230,7 +228,6 @@ export const optionalDependencyFeatureOwnerRules = [ 'tools-agent-control', 'tools-basic', 'tools-browser-web', - 'tools-canvas', 'tools-computer-use', 'tools-creation', 'tools-git', @@ -293,7 +290,7 @@ export const optionalDependencyFeatureOwnerRules = [ depName: 'openbitfun-core-types', ownerFeatures: ['deep-research', 'ptc-runtime', 'remote-connect', 'remote-ssh-concrete', 'speech'], }, - { depName: 'openbitfun-product-domains', ownerFeatures: ['account-identity', 'canvas-runtime', 'function-agents', 'hook-import', 'miniapp-market', 'miniapp-runtime', 'miniapp-storage', 'plugin-source', 'remote-connect'] }, + { depName: 'openbitfun-product-domains', ownerFeatures: ['account-identity', 'function-agents', 'hook-import', 'miniapp-market', 'miniapp-runtime', 'miniapp-storage', 'plugin-source', 'remote-connect'] }, { depName: 'openbitfun-runtime-ports', ownerFeatures: ['deep-research', 'git', 'ptc-runtime', 'remote-connect', 'remote-ssh', 'remote-ssh-concrete', 'script-tool-runtime', 'web-tools'] }, { depName: 'openbitfun-services-core', @@ -335,7 +332,6 @@ export const optionalDependencyFeatureOwnerRules = [ { depName: 'mac_address', ownerFeatures: ['remote-connect'] }, { depName: 'md5', ownerFeatures: ['remote-connect'] }, { depName: 'notify', ownerFeatures: ['file-watch'] }, - { depName: 'oxc', ownerFeatures: ['canvas-runtime'] }, { depName: 'qrcode', ownerFeatures: ['remote-connect'] }, { depName: 'rand', ownerFeatures: ['mcp', 'remote-connect', 'remote-persistence', 'remote-ssh-concrete'] }, // remote-ssh-concrete: one-click relay deploy fetches the signed release @@ -349,7 +345,7 @@ export const optionalDependencyFeatureOwnerRules = [ { depName: 'rustls', ownerFeatures: ['remote-connect'] }, { depName: 'rustls-native-certs', ownerFeatures: ['remote-connect'] }, { depName: 'schannel', ownerFeatures: ['remote-connect'] }, - { depName: 'sha2', ownerFeatures: ['canvas-runtime', 'hook-import', 'mcp', 'miniapp-market', 'models-dev', 'plugin-source', 'remote-connect', 'remote-persistence', 'remote-ssh', 'review-platform', 'speech'] }, + { depName: 'sha2', ownerFeatures: ['hook-import', 'mcp', 'miniapp-market', 'models-dev', 'plugin-source', 'remote-connect', 'remote-persistence', 'remote-ssh', 'review-platform', 'speech'] }, { depName: 'sherpa-onnx', ownerFeatures: ['speech'] }, { depName: 'shellexpand', ownerFeatures: ['remote-ssh-concrete'] }, { depName: 'sse-stream', ownerFeatures: ['mcp'] }, @@ -358,8 +354,8 @@ export const optionalDependencyFeatureOwnerRules = [ { depName: 'thiserror', ownerFeatures: ['account-identity', 'browser-control', 'git', 'hook-import', 'miniapp-market', 'plugin-source', 'remote-connect', 'remote-ssh', 'remote-ssh-concrete', 'review-platform', 'speech', 'web-tools', 'workspace-search'] }, { depName: 'tokio-tungstenite', ownerFeatures: ['remote-connect', 'speech-realtime'] }, { depName: 'tokio-util', ownerFeatures: ['remote-ssh', 'speech'] }, - { depName: 'urlencoding', ownerFeatures: ['canvas-runtime', 'miniapp-market', 'remote-connect', 'review-platform'] }, - { depName: 'uuid', ownerFeatures: ['canvas-runtime', 'hook-import', 'miniapp-runtime', 'miniapp-storage', 'plugin-source', 'remote-connect', 'remote-ssh-concrete', 'speech'] }, + { depName: 'urlencoding', ownerFeatures: ['miniapp-market', 'remote-connect', 'review-platform'] }, + { depName: 'uuid', ownerFeatures: ['hook-import', 'miniapp-runtime', 'miniapp-storage', 'plugin-source', 'remote-connect', 'remote-ssh-concrete', 'speech'] }, { depName: 'which', ownerFeatures: ['miniapp-runtime', 'ptc-runtime', 'remote-connect', 'script-tool-runtime', 'workspace-search'] }, { depName: 'windows', ownerFeatures: ['models-dev', 'plugin-source', 'remote-connect', 'remote-persistence', 'remote-ssh-concrete', 'review-platform'] }, { depName: 'x25519-dalek', ownerFeatures: ['remote-connect'] }, @@ -746,7 +742,6 @@ export const coreProductFullFeatureAssemblyRule = { 'tools-agent-control', 'tools-basic', 'tools-browser-web', - 'tools-canvas', 'tools-computer-use', 'tools-creation', 'tools-git', @@ -757,7 +752,6 @@ export const coreProductFullFeatureAssemblyRule = { 'tools-pages', 'web-tools', 'workspace-search', - 'canvas-runtime', 'dispatch-store', 'file-watch', 'filesystem', @@ -1434,16 +1428,6 @@ export const coreClosedFeatureProfileRules = [ exact: true, reason: 'tools-creation must own only Creative product-authoring tools', }, - { - manifestPath: 'src/crates/assembly/core/Cargo.toml', - featureName: 'tools-canvas', - requiredFeatureRefs: [ - 'openbitfun-tool-packs/canvas', - 'canvas-runtime', - ], - exact: true, - reason: 'tools-canvas must compose only Canvas tools and runtime IO', - }, { manifestPath: 'src/crates/assembly/core/Cargo.toml', featureName: 'tools-agent-control', @@ -1468,17 +1452,6 @@ export const coreClosedFeatureProfileRules = [ reason: 'openbitfun-core function-agents must own only function-agent contracts and concrete Git/AI adapters', }, - { - manifestPath: 'src/crates/assembly/core/Cargo.toml', - featureName: 'canvas-runtime', - requiredFeatureRefs: [ - 'dep:openbitfun-product-domains', - 'openbitfun-services-integrations/canvas-runtime', - ], - exact: true, - reason: - 'openbitfun-core canvas-runtime must extend only the product domain surface with Canvas runtime IO', - }, { manifestPath: 'src/crates/services/services-core/Cargo.toml', featureName: 'default', @@ -1863,7 +1836,6 @@ export const ownerCrateFeatureAssemblyRules = [ 'miniapp', 'pages', 'creation', - 'canvas', 'agent-control', ], }, @@ -1880,7 +1852,6 @@ export const ownerCrateFeatureAssemblyRules = [ ], requiredProductFullFeatures: [ 'browser-control', - 'canvas-runtime', 'deep-research', 'file-watch', 'function-agents', diff --git a/scripts/core-boundaries/rules/source/forbidden-rules.mjs b/scripts/core-boundaries/rules/source/forbidden-rules.mjs index f0690aa8fc..f81f7b9cef 100644 --- a/scripts/core-boundaries/rules/source/forbidden-rules.mjs +++ b/scripts/core-boundaries/rules/source/forbidden-rules.mjs @@ -4006,14 +4006,6 @@ export const rustWebUiSourceBoundaryRule = { path: 'src/crates/execution/agent-runtime/src/deep_review/manifest.rs', text: '"src/web-ui/src/locales/en-US/flow-chat.json"', }, - { - path: 'src/crates/services/services-integrations/src/canvas/compiler/tests.rs', - text: "nodes: [{ id: 'web-ui' }, { id: 'core' }],", - }, - { - path: 'src/crates/services/services-integrations/src/canvas/compiler/tests.rs', - text: "edges: [{ from: 'web-ui', to: 'core' }],", - }, ], message: 'non-comment Rust source must not spell the web-ui path token outside reviewed fixture lines', diff --git a/scripts/core-boundaries/rules/source/required-rules.mjs b/scripts/core-boundaries/rules/source/required-rules.mjs index c575b66548..954760870c 100644 --- a/scripts/core-boundaries/rules/source/required-rules.mjs +++ b/scripts/core-boundaries/rules/source/required-rules.mjs @@ -3742,17 +3742,6 @@ export const requiredContentRules = [ regex: /tools-miniapp = \[[^\]]*"openbitfun-product-domains\/miniapp"[^\]]*\]/, message: 'core MiniApp tool owner must select its product-domain slice explicitly', }, - { - regex: /canvas-runtime = \[[^\]]*"openbitfun-services-integrations\/canvas-runtime"[^\]]*\]/, - message: - 'core canvas-runtime facade must enable the Canvas service owner feature it imports', - }, - { - regex: - /canvas-runtime = \[[\s\S]*"dep:openbitfun-product-domains"[\s\S]*"openbitfun-services-integrations\/canvas-runtime"[\s\S]*\]/, - message: - 'core canvas-runtime feature must explicitly aggregate the domain contract and canvas service owner', - }, { regex: /openbitfun-product-domains = \{ path = "\.\.\/\.\.\/contracts\/product-domains", optional = true \}/, diff --git a/scripts/core-boundaries/self-test.mjs b/scripts/core-boundaries/self-test.mjs index 93804e6636..3ce1d510a1 100644 --- a/scripts/core-boundaries/self-test.mjs +++ b/scripts/core-boundaries/self-test.mjs @@ -372,7 +372,6 @@ export function runManifestParserSelfTest({ 'agent-runtime', 'diagnostics', 'diff', - 'canvas-runtime', 'dispatch-store', 'file-watch', 'filesystem', @@ -557,11 +556,6 @@ export function runManifestParserSelfTest({ 'openbitfun-services-integrations/remote-ssh', ], ], - [ - coreManifest, - 'canvas-runtime', - ['dep:openbitfun-product-domains', 'openbitfun-services-integrations/canvas-runtime'], - ], [coreManifest, 'file-watch', ['openbitfun-services-integrations/file-watch']], [coreManifest, 'git', ['openbitfun-services-integrations/git']], [coreManifest, 'review-platform', ['openbitfun-services-integrations/review-platform']], @@ -4493,8 +4487,6 @@ export function runManifestParserSelfTest({ 'openbitfun-product-domains = \\{ path = "\\.\\.\\/\\.\\.\\/contracts\\/product-domains", optional = true \\}', 'dep:openbitfun-ai-adapters', 'ai-adapter-runtime', - 'canvas-runtime', - 'openbitfun-services-integrations\\/canvas-runtime', 'openbitfun-services-integrations\\/function-agents', 'openbitfun-services-integrations\\/miniapp-runtime', 'dep:openbitfun-product-capabilities', diff --git a/scripts/frontend-color-surface-registry.json b/scripts/frontend-color-surface-registry.json index 687ff7e05b..ca3a32bc3e 100644 --- a/scripts/frontend-color-surface-registry.json +++ b/scripts/frontend-color-surface-registry.json @@ -54,7 +54,10 @@ "src/flow_chat/assets/subagent-avatars/robot-17.svg", "src/flow_chat/assets/subagent-avatars/robot-18.svg", "src/flow_chat/assets/subagent-avatars/robot-19.svg", - "src/flow_chat/assets/subagent-avatars/robot-20.svg" + "src/flow_chat/assets/subagent-avatars/robot-20.svg", + "src/tools/generative-ui/components/openui", + "src/tools/generative-ui/components/openuiLibrary.tsx", + "src/tools/generative-ui/components/vendor" ] } }, diff --git a/scripts/generate-canvas-sdk-contract.mjs b/scripts/generate-canvas-sdk-contract.mjs deleted file mode 100644 index 05855e6c3a..0000000000 --- a/scripts/generate-canvas-sdk-contract.mjs +++ /dev/null @@ -1,93 +0,0 @@ -import fs from 'node:fs'; -import path from 'node:path'; -import process from 'node:process'; -import { spawnSync } from 'node:child_process'; -import { fileURLToPath } from 'node:url'; - -const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..'); -const sourcePath = path.join(root, 'src/shared/canvas/sdk-contract.json'); -const check = process.argv.includes('--check'); -const contract = JSON.parse(fs.readFileSync(sourcePath, 'utf8')); - -const componentNames = Object.keys(contract.components); -const runtimeExports = [...componentNames, ...contract.nonComponentExports]; - -function rustString(value) { - return JSON.stringify(value); -} - -function rustSlice(values) { - return `&[${values.map(rustString).join(', ')}]`; -} - -function generateRust() { - const componentArms = componentNames - .map(name => ` ${rustString(name)} => Some(${rustSlice(contract.components[name].props)}),`) - .join('\n'); - const backingArms = componentNames - .map(name => ` ${rustString(name)} => Some(${rustString(contract.components[name].backing)}),`) - .join('\n'); - const appearanceArms = Object.entries(contract.appearanceTokenGroups) - .map(([group, values]) => ` ${rustString(group)} => (${rustSlice(values)}).contains(&token),`) - .join('\n'); - return `// Generated by scripts/generate-canvas-sdk-contract.mjs. Do not edit.\n\n` + - `pub const OPENBITFUN_CANVAS_SDK_VERSION: &str = ${rustString(contract.sdkVersion)};\n` + - `pub const OPENBITFUN_CANVAS_RUNTIME_VERSION: &str = ${rustString(contract.runtimeVersion)};\n` + - `pub const CANVAS_SDK_RUNTIME_EXPORTS: &[&str] = ${rustSlice(runtimeExports)};\n` + - `pub const CANVAS_SDK_COMMON_PROPS: &[&str] = ${rustSlice(contract.commonProps)};\n\n` + - `pub fn canvas_sdk_component_props(component: &str) -> Option<&'static [&'static str]> {\n match component {\n${componentArms}\n _ => None,\n }\n}\n\n` + - `pub fn canvas_sdk_component_backing(component: &str) -> Option<&'static str> {\n match component {\n${backingArms}\n _ => None,\n }\n}\n\n` + - `pub fn canvas_appearance_token_group_allows(group: &str, token: &str) -> bool {\n match group {\n${appearanceArms}\n _ => false,\n }\n}\n`; -} - -function formatRust(source) { - const result = spawnSync('rustfmt', ['--emit', 'stdout', '--edition', '2021'], { - encoding: 'utf8', - input: source, - }); - if (result.status !== 0) { - throw new Error(`rustfmt failed while generating the Canvas SDK contract: ${result.stderr || result.stdout}`); - } - return result.stdout; -} - -function generateTypeScript() { - return `// Generated by scripts/generate-canvas-sdk-contract.mjs. Do not edit.\n` + - `export const canvasSdkContract = ${JSON.stringify({ ...contract, runtimeExports }, null, 2)} as const;\n\n` + - `export const CANVAS_SDK_VERSION = canvasSdkContract.sdkVersion;\n` + - `export const CANVAS_RUNTIME_VERSION = canvasSdkContract.runtimeVersion;\n` + - `export const CANVAS_SDK_RUNTIME_EXPORTS = canvasSdkContract.runtimeExports;\n`; -} - -const outputs = [ - { - path: 'src/crates/contracts/product-domains/src/canvas/sdk_contract.generated.rs', - content: formatRust(generateRust()), - }, - { - path: 'src/web-ui/src/tools/openbitfun-canvas/runtime/sdk/contract.generated.ts', - content: generateTypeScript(), - }, - { - path: 'src/crates/assembly/core/builtin_skills/openbitfun-canvas/sdk/sdk-contract.generated.json', - content: `${JSON.stringify({ ...contract, runtimeExports }, null, 2)}\n`, - }, -]; - -let stale = false; -for (const output of outputs) { - const absolutePath = path.join(root, output.path); - const current = fs.existsSync(absolutePath) ? fs.readFileSync(absolutePath, 'utf8').replaceAll('\r\n', '\n') : ''; - const expected = output.content.replaceAll('\r\n', '\n'); - if (current === expected) continue; - if (check) { - console.error(`[canvas-sdk:check] stale generated file: ${output.path}`); - stale = true; - continue; - } - fs.mkdirSync(path.dirname(absolutePath), { recursive: true }); - fs.writeFileSync(absolutePath, expected); - console.log(`[canvas-sdk:generate] wrote ${output.path}`); -} - -if (stale) process.exitCode = 1; diff --git a/scripts/generate-genui-contract.mjs b/scripts/generate-genui-contract.mjs new file mode 100644 index 0000000000..bc6139e355 --- /dev/null +++ b/scripts/generate-genui-contract.mjs @@ -0,0 +1,8 @@ +import { readFileSync, writeFileSync } from 'node:fs'; +import { compileCatalog } from '../src/shared/generative-ui/library.mjs'; +const path = new URL('../src/shared/generative-ui/', import.meta.url); +const output = JSON.stringify(compileCatalog(JSON.parse(readFileSync(new URL('library.json', path), 'utf8'))), null, 2) + '\n'; +const target = new URL('catalog.json', path); +if (process.argv.includes('--check')) { + if (readFileSync(target, 'utf8') !== output) throw new Error('GenUI catalog is stale; run node scripts/generate-genui-contract.mjs'); +} else writeFileSync(target, output); diff --git a/scripts/generate-startup-appearance-bootstrap.mjs b/scripts/generate-startup-appearance-bootstrap.mjs index e43a764070..29d864e70d 100644 --- a/scripts/generate-startup-appearance-bootstrap.mjs +++ b/scripts/generate-startup-appearance-bootstrap.mjs @@ -13,10 +13,6 @@ const outputPath = path.join( repoRoot, 'src/apps/desktop/src/generated/startup_appearance_bootstrap.json', ); -const appearancePromptSnapshotOutputPath = path.join( - repoRoot, - 'src/crates/assembly/core/src/agentic/tools/implementations/generated/appearance_prompt_snapshots.json', -); const desktopBootstrapThemeOutputPath = path.join( repoRoot, 'src/apps/desktop/src/generated/bootstrap_theme.css', @@ -59,12 +55,10 @@ try { const [ { builtinAppearancePalettes }, { createStartupAppearanceBootstrapManifest }, - { createAppearancePromptSnapshotManifest }, { themes, themeCssVariables }, ] = await Promise.all([ server.ssrLoadModule('/src/infrastructure/appearance/builtins/palettes.ts'), server.ssrLoadModule('/src/infrastructure/appearance/builtins/startupAppearanceBootstrap.ts'), - server.ssrLoadModule('/src/infrastructure/appearance/builtins/appearancePromptSnapshots.ts'), import(pathToFileURL(themePackageEntryPath).href), ]); @@ -74,11 +68,6 @@ try { outputPath, content: `${JSON.stringify(createStartupAppearanceBootstrapManifest(builtinAppearancePalettes), null, 2)}\n`, }, - { - label: 'Appearance prompt snapshot manifest', - outputPath: appearancePromptSnapshotOutputPath, - content: `${JSON.stringify(createAppearancePromptSnapshotManifest(builtinAppearancePalettes), null, 2)}\n`, - }, { label: 'Desktop bootstrap theme projection', outputPath: desktopBootstrapThemeOutputPath, diff --git a/scripts/test-genui-browser.mjs b/scripts/test-genui-browser.mjs new file mode 100644 index 0000000000..f3d24d5f51 --- /dev/null +++ b/scripts/test-genui-browser.mjs @@ -0,0 +1,240 @@ +// Real browser rendering/events; storage and locale use explicit fixture ports. +// Native owner durability is verified separately by the Rust service tests. +import assert from 'node:assert/strict'; +import { createRequire } from 'node:module'; +import { writeFile, mkdir } from 'node:fs/promises'; +import { join } from 'node:path'; + +const requireE2e = createRequire(new URL('../tests/e2e/package.json', import.meta.url)); +const requireWdio = createRequire(requireE2e.resolve('@wdio/cli')); +const puppeteer = requireWdio('puppeteer-core'); +const url = process.env.OPENBITFUN_GENUI_TEST_URL; +if (!url) throw new Error('Set OPENBITFUN_GENUI_TEST_URL to this checkout Vite /tests/e2e/generative-ui.html'); +const browser = await puppeteer.launch({ + ...(process.env.CHROME_PATH ? { executablePath: process.env.CHROME_PATH } : { channel: 'chrome' }), + headless: 'new', +}); +try { + const page = await browser.newPage(); + await page.setViewport({ width: 1280, height: 900 }); + const errors = []; + page.on('pageerror', error => errors.push(String(error))); + page.on('console', message => { if (message.type() === 'error') errors.push(message.text()); }); + const setInputValue = async (selector, value) => page.evaluate((target, next) => { + const element = [...document.querySelectorAll(target)].find(candidate => { + const rect = candidate.getBoundingClientRect(); + return rect.width > 0 && rect.height > 0 && !candidate.closest('[inert]'); + }); + if (!element) throw new Error('Visible input not found: ' + target); + const input = element; + const prototype = input instanceof HTMLTextAreaElement ? HTMLTextAreaElement.prototype : HTMLInputElement.prototype; + const setter = Object.getOwnPropertyDescriptor(prototype, 'value')?.set; + if (!setter) throw new Error('Input has no writable value setter'); + setter.call(input, next); + input.dispatchEvent(new Event('input', { bubbles: true })); + input.dispatchEvent(new Event('change', { bubbles: true })); + }, selector, value); + const waitForReactiveText = value => page.waitForFunction(expected => [...document.querySelectorAll('.gen-ui-oi-text,.iui-text')].some(element => element.textContent === expected && !element.closest('[inert]')), {}, value); + const verify = async () => { + await page.waitForSelector('html[data-genui-result]', { timeout: 60000 }); + await page.waitForSelector('[data-testid="genui-evidence"]', { timeout: 60000 }); + const reports = await page.$eval('[data-testid="genui-evidence"]', element => JSON.parse(element.textContent)); + assert.equal(await page.$eval('html', element => element.dataset.genuiResult), 'passed', JSON.stringify(reports)); + for (const name of ['openui', 'harmony', 'openui-source', 'free']) { + for (const stage of ['preflight', 'checks', 'render', 'reopen', 'probeReopen', 'layout']) assert.equal(reports[name][stage], 'passed', name + '.' + stage); + assert.deepEqual(reports[name].layoutWidths, ['harmony', 'free', 'openui-source'].includes(name) ? [360] : [360, 960]); + if (name === 'harmony' || name === 'free' || name === 'openui-source') { + assert.deepEqual(reports[name].designSpec, { id: 'harmony.phone.v1', revision: 1 }); + assert.equal(reports[name].viewport, '360x764'); + assert.equal(reports[name].hostShell, 'passed'); + } + if (name === 'free') assert.equal(reports[name].screenshotBytes, undefined); + else assert(reports[name].screenshotBytes > 100); + } + }; + await page.goto(url); + await verify(); + const harmonyProbe = await page.$eval('[data-testid="harmony-style-probe"]', element => { + const app = element.querySelector('[data-gen-ui-app="harmony-style-probe"]'); + const card = app?.querySelector('.gen-ui-oi-card'); + const button = app?.querySelector('button.gen-ui-oi-button'); + const input = app?.querySelector('.gen-ui-oi-field input'); + const slider = app?.querySelector('.gen-ui-oi-slider input[type="range"]'); + const icon = app?.querySelector('.hm-icon'); + const frame = element.querySelector('.gen-ui-phone-device'); + return { + theme: app?.getAttribute('data-hm-theme'), + font: app?.getAttribute('data-hm-font'), + scheme: app?.getAttribute('data-hm-scheme'), + frameTheme: frame?.getAttribute('data-hm-theme'), + cardRadius: card ? getComputedStyle(card).borderRadius : '', + buttonRadius: button ? getComputedStyle(button).borderRadius : '', + inputRadius: input ? getComputedStyle(input).borderRadius : '', + track: slider ? getComputedStyle(slider).getPropertyValue('--hm-track').trim() : '', + iconName: icon?.getAttribute('data-icon'), + iconFont: icon ? getComputedStyle(icon).fontFamily : '', + }; + }); + assert.deepEqual(harmonyProbe, { + theme: 'green', font: 'sans', scheme: 'light', frameTheme: 'green', + cardRadius: '24px', buttonRadius: '999px', inputRadius: '20px', track: '4px', + iconName: 'house', iconFont: '"HM Symbol"', + }); + const harmonyHtmlFrameElement = await page.$('[data-testid="harmony-html-style-probe"] iframe[data-gen-ui-html-frame]'); + assert(harmonyHtmlFrameElement, 'Harmony HTML style probe iframe did not mount'); + const harmonyHtmlFrame = await harmonyHtmlFrameElement.contentFrame(); + assert(harmonyHtmlFrame, 'Harmony HTML style probe did not expose a browser frame'); + await harmonyHtmlFrame.waitForSelector('.hero-ring, .list-item, .progress'); + const harmonyHtmlProbe = await harmonyHtmlFrame.evaluate(() => { + const root = document.documentElement; + const card = document.querySelector('.card'); + const ring = document.querySelector('.hero-ring'); + const progress = document.querySelector('.progress'); + const toggle = document.querySelector('.switch'); + const chip = document.querySelector('.chip.active'); + return { + theme: root.getAttribute('data-hm-theme'), + font: root.getAttribute('data-hm-font'), + cardRadius: card ? getComputedStyle(card).borderRadius : '', + ringSize: ring ? getComputedStyle(ring).width : '', + progressHeight: progress ? getComputedStyle(progress).height : '', + switchWidth: toggle ? getComputedStyle(toggle).width : '', + switchColor: toggle ? getComputedStyle(toggle).backgroundColor : '', + chipRadius: chip ? getComputedStyle(chip).borderRadius : '', + }; + }); + assert.deepEqual(harmonyHtmlProbe, { + theme: 'green', font: 'sans', cardRadius: '24px', ringSize: '176px', + progressHeight: '4px', switchWidth: '36px', switchColor: 'rgb(58, 131, 87)', chipRadius: '14px', + }); + const harmonyDarkProbe = await page.$eval('[data-testid="harmony-dark-style-probe"]', element => { + const app = element.querySelector('[data-gen-ui-app="harmony-dark-style-probe"]'); + const card = app?.querySelector('.gen-ui-oi-card'); + const frame = element.querySelector('.gen-ui-phone-device'); + return { + theme: app?.getAttribute('data-hm-theme'), + font: app?.getAttribute('data-hm-font'), + scheme: app?.getAttribute('data-hm-scheme'), + frameScheme: frame?.getAttribute('data-hm-scheme'), + cardBackground: card ? getComputedStyle(card).backgroundColor : '', + frameBackground: frame ? getComputedStyle(frame).backgroundColor : '', + }; + }); + assert.deepEqual(harmonyDarkProbe, { + theme: 'purple', font: 'handwritten', scheme: 'dark', frameScheme: 'dark', + cardBackground: 'rgba(255, 255, 255, 0.1)', frameBackground: 'rgb(50, 46, 54)', + }); + const freeFrameElement = await page.$('[data-testid="free-live-document"] iframe[data-gen-ui-html-frame]'); + assert(freeFrameElement, 'Free document iframe did not mount in the live host'); + const freeFrame = await freeFrameElement.contentFrame(); + assert(freeFrame, 'Free document iframe did not expose a browser frame'); + await freeFrame.waitForSelector('svg[aria-label="Decorative chart"]'); + assert.match(await freeFrame.$eval('body', element => element.textContent ?? ''), /Free SVG/); + assert.equal(await freeFrame.$eval('meta[name="openbitfun-design-spec"]', element => element.content), 'Harmony phone@1'); + assert.equal(await freeFrame.$eval('meta[name="openbitfun-style-resources"]', element => element.content), 'openbitfun-theme-tokens,openbitfun-harmony-components'); + const scriptFrameElement = await page.$('[data-testid="script-live-document"] iframe[data-gen-ui-html-frame]'); + assert(scriptFrameElement, 'Controlled script iframe did not mount'); + const scriptFrame = await scriptFrameElement.contentFrame(); + assert(scriptFrame, 'Controlled script iframe did not expose a browser frame'); + await scriptFrame.waitForFunction(() => document.querySelector('[data-bridge-result]')?.textContent === 'bridge-ok'); + const scriptContext = await page.evaluate(() => JSON.parse(sessionStorage.getItem('genui-script-context'))); + assert.deepEqual(scriptContext.payload, { value: 'bridge-ok' }); + assert.equal(scriptContext.context.appId, 'script-phone'); + assert.equal(scriptContext.context.designSpec.id, 'harmony.phone.v1'); + assert.equal(scriptContext.context.designSpec.revision, 1); + assert.equal(typeof scriptContext.context.sourceKey, 'string'); + const noteSelector = '[aria-label="Shared note"]'; + await setInputValue(noteSelector, 'Updated browser note'); + await waitForReactiveText('Updated browser note'); + assert.notEqual(await page.$eval('[data-gen-ui-save]', element => element.getAttribute('data-gen-ui-save')), 'saved'); + assert.equal(await page.evaluate(() => sessionStorage.getItem('genui-browser-state')), null); + await page.reload(); + await verify(); + await page.waitForFunction(() => ![...document.querySelectorAll('.gen-ui-oi-text')].some(element => element.textContent === 'Updated browser note')); + assert.deepEqual(errors, []); + if (process.env.OPENBITFUN_GENUI_SCREENSHOT_DIR) { + await mkdir(process.env.OPENBITFUN_GENUI_SCREENSHOT_DIR, { recursive: true }); + for (const name of ['openui', 'harmony', 'openui-source', 'free']) { + const image = await page.$('[data-testid="genui-screenshot-' + name + '"]'); + if (!image) continue; + const src = await image.evaluate(element => element.src); + if (src) await writeFile(join(process.env.OPENBITFUN_GENUI_SCREENSHOT_DIR, name + '.png'), Buffer.from(src.split(',')[1], 'base64')); + } + } + const settingsUrl = new URL(url); settingsUrl.searchParams.set('settings', ''); + await page.goto(settingsUrl.href); await verify(); + await page.waitForSelector('.gen-ui-library-preview'); + await page.click('[role="combobox"]'); + await page.waitForSelector('[role="option"]'); + assert.deepEqual(await page.$$eval('[role="option"]', elements => elements.map(element => element.textContent)), ['Open Intelligent UI', 'OpenBitFun', 'Harmony']); + for (const option of await page.$$('[role="option"]')) { + if (await option.evaluate(element => element.textContent?.includes('Harmony') ?? false)) { await option.click(); break; } + } + await page.waitForSelector('[data-gen-ui-app="library-preview-harmony"]'); + assert.equal(await page.evaluate(() => sessionStorage.getItem('genui-browser-library')), 'harmony'); + await setInputValue('[aria-label="Shared note"]', 'Temporary demo'); + await waitForReactiveText('Temporary demo'); + assert.equal(await page.evaluate(() => sessionStorage.getItem('genui-browser-state')), null); + if (process.env.OPENBITFUN_GENUI_SCREENSHOT_DIR) { + await page.$eval('[data-testid="genui-evidence"]', element => { element.hidden = true; }); + await page.screenshot({ path: join(process.env.OPENBITFUN_GENUI_SCREENSHOT_DIR, 'settings-harmony.png'), fullPage: true }); + } + await page.reload(); await verify(); + await page.waitForSelector('[data-gen-ui-app="library-preview-harmony"]'); + assert.notEqual(await page.$eval('[aria-label="Shared note"]', element => element.value), 'Temporary demo'); + assert.equal(await page.$eval('select', element => element.value), 'harmony'); + assert.deepEqual(errors, []); + for (const scenario of [ + { deferred: false, harmony: false }, + { deferred: true, harmony: false }, + { deferred: false, harmony: true }, + { deferred: true, harmony: true }, + ]) { + const { deferred, harmony } = scenario; + const streamUrl = new URL(url); streamUrl.searchParams.set('streaming', ''); + if (deferred) streamUrl.searchParams.set('deferred', ''); + if (harmony) streamUrl.searchParams.set('harmony', ''); + streamUrl.searchParams.set('profile', harmony ? 'harmony' : 'openui'); + await page.goto(streamUrl.href); await verify(); + if (harmony) { + await page.waitForSelector('.gen-ui-phone-loading[aria-busy="true"]'); + assert.equal(await page.$('[data-gen-ui-host-shell="phone"]') !== null, true); + assert(await page.$eval('.gen-ui-phone-loading__preview', element => element.getBoundingClientRect().height <= 460)); + } else { + await page.waitForSelector('.openbitfun-generative-widget-panel__skeleton'); + assert.equal(await page.$('.gen-ui-phone-loading'), null); + } + const next = async stage => { + await page.click('[data-testid="stream-advance"]'); + await page.waitForSelector('[data-testid="genui-stream"][data-stage="' + stage + '"]'); + }; + await next(1); + if (!harmony) await page.waitForSelector('[data-gen-ui-app]'); + await next(2); + assert.equal(await page.$('.gen-ui-phone-skeleton') !== null, harmony); + assert.equal(await page.$('[data-gen-ui-app]') !== null, !harmony); + assert(await page.$eval('[data-testid="genui-stream"]', element => Number(element.dataset.sent) < Number(element.dataset.total))); + if (harmony && process.env.OPENBITFUN_GENUI_SCREENSHOT_DIR) { + await mkdir(process.env.OPENBITFUN_GENUI_SCREENSHOT_DIR, { recursive: true }); + await page.screenshot({ path: join(process.env.OPENBITFUN_GENUI_SCREENSHOT_DIR, `harmony-phone-skeleton-${deferred ? 'deferred' : 'native'}.png`), fullPage: true }); + } + await next(3); + if (harmony) await page.waitForSelector('.gen-ui-phone-skeleton'); + else await page.waitForSelector('[data-gen-ui-app]'); + if (!harmony) assert.match(await page.$eval('[data-gen-ui-app]', element => element.textContent ?? ''), /Streaming source/); + await next(4); + if (harmony) { + await page.waitForSelector('[data-gen-ui-app]'); + assert.equal(await page.$('.gen-ui-phone-loading'), null); + assert.equal(await page.$('[data-gen-ui-host-shell="phone"]') !== null, true); + } + await page.waitForSelector('[data-gen-ui-postcheck="passed"]'); + assert.equal(await page.$$eval('[role="alert"]', elements => elements.length), 0); + } + assert.deepEqual(errors, []); + console.log('PASS GenUI mounted checks, layout, transient interaction, settings and native/deferred incremental streaming with stable DOM'); +} finally { + const child = browser.process(); + try { await browser.close(); } + finally { child?.stdin?.destroy(); child?.stdout?.destroy(); child?.stderr?.destroy(); } +} diff --git a/scripts/theme-color-governance-baseline.json b/scripts/theme-color-governance-baseline.json index 853604baa9..fde438b47d 100644 --- a/scripts/theme-color-governance-baseline.json +++ b/scripts/theme-color-governance-baseline.json @@ -87,7 +87,7 @@ "max": 0 }, "colorDomainContracts.registeredUnique": { - "max": 15 + "max": 14 }, "colorDomainContracts.missingRegisteredUnique": { "max": 0 @@ -197,12 +197,6 @@ "colorDomainNearPairs.generatedWidget.nearTotal": { "max": 0 }, - "colorDomainNearPairs.openbitfunCanvas.indistinguishableTotal": { - "max": 0 - }, - "colorDomainNearPairs.openbitfunCanvas.nearTotal": { - "max": 0 - }, "colorDomainNearPairs.mermaid.indistinguishableTotal": { "max": 0 }, @@ -278,12 +272,6 @@ "colorDomainScopes.generatedWidget.uniqueColors": { "max": 0 }, - "colorDomainScopes.openbitfunCanvas.occurrences": { - "max": 0 - }, - "colorDomainScopes.openbitfunCanvas.uniqueColors": { - "max": 0 - }, "colorDomainScopes.editor.occurrences": { "max": 0 }, diff --git a/scripts/theme-css-var-contract.mjs b/scripts/theme-css-var-contract.mjs index 28140c2927..63b8a79ffa 100644 --- a/scripts/theme-css-var-contract.mjs +++ b/scripts/theme-css-var-contract.mjs @@ -115,7 +115,6 @@ export const CONTRACT_VAR_DEFINITION_PATH_PARTS = [ 'design-system/packages/theme-openbitfun/src', 'infrastructure/appearance', 'src/mobile-web/src/styles/global.scss', - 'tools/openbitfun-canvas/runtime/styles', 'tools/generative-widget/appearancePayload.ts', ]; @@ -170,11 +169,6 @@ export const COLOR_DOMAIN_RULES = [ label: 'Generated widget', pathParts: ['tools/generative-widget'], }, - { - key: 'openbitfunCanvas', - label: 'OpenBitFun Canvas', - pathParts: ['tools/openbitfun-canvas'], - }, { key: 'mermaid', label: 'Mermaid', @@ -267,12 +261,6 @@ export const COLOR_DOMAIN_CONTRACTS = [ reason: 'Generated widgets run in an isolated iframe boundary and need an explicit payload instead of scraping host CSS variables.', mergePolicy: 'Derive fallback values from a builtin Appearance package and keep iframe payload keys canonical.', }, - { - key: 'openbitfunCanvas', - owner: 'src/web-ui/src/tools/openbitfun-canvas', - reason: 'OpenBitFun Canvas renders generated TSX inside a dedicated iframe runtime with an SDK palette that must stay isolated from app chrome tokens.', - mergePolicy: 'Keep Canvas iframe and SDK colors in the Canvas Appearance contract; promote only reusable host chrome roles to shared app tokens.', - }, { key: 'mermaid', owner: 'src/web-ui/src/tools/mermaid-editor', @@ -337,11 +325,6 @@ export const DYNAMIC_VAR_FAMILY_CONTRACTS = [ owner: 'src/web-ui/src/infrastructure/appearance/compiler/AppearanceCompiler.ts; src/web-ui/src/infrastructure/appearance/runtime/AppearanceRuntime.ts', reason: 'Appearance package image ids are validated by the package schema, then projected to host-created blob URL variables for registered component parts.', }, - { - prefix: '--openbitfun-canvas-', - owner: 'src/web-ui/src/tools/openbitfun-canvas/runtime/canvasRuntimeInstaller.ts; src/web-ui/src/tools/openbitfun-canvas/runtime/styles/canvas-runtime.scss', - reason: 'OpenBitFun Canvas iframe runtime receives host Appearance values through a scoped CSS variable family that must stay isolated from app root tokens.', - }, { prefix: '--openbitfun-font-size-', owner: 'src/web-ui/src/infrastructure/font-preference/core/FontPreferenceService.ts', diff --git a/src/apps/desktop/Cargo.toml b/src/apps/desktop/Cargo.toml index 499cdca5be..5ccc9a20c3 100644 --- a/src/apps/desktop/Cargo.toml +++ b/src/apps/desktop/Cargo.toml @@ -27,7 +27,7 @@ openbitfun-relay-service = { path = "../../crates/services/relay-service" } openbitfun-agent-runtime = { path = "../../crates/execution/agent-runtime", features = ["agent-runtime"] } openbitfun-runtime-ports = { path = "../../crates/contracts/runtime-ports", features = ["agent-api", "permission", "workspace-ports"] } openbitfun-product-domains = { path = "../../crates/contracts/product-domains", features = ["appearance-market"] } -openbitfun-services-integrations = { path = "../../crates/services/services-integrations", features = ["canvas-runtime", "miniapp-market", "skillhub", "remote-ssh-concrete", "speech-realtime"] } +openbitfun-services-integrations = { path = "../../crates/services/services-integrations", features = ["miniapp-market", "skillhub", "remote-ssh-concrete", "speech-realtime"] } openbitfun-core-types = { path = "../../crates/contracts/core-types" } openbitfun-agent-tools = { path = "../../crates/execution/tool-contracts", features = ["element-token", "computer-use-contract"] } openbitfun-transport = { path = "../../crates/adapters/transport", features = ["tauri-adapter"] } diff --git a/src/apps/desktop/src/api/canvas_api.rs b/src/apps/desktop/src/api/canvas_api.rs deleted file mode 100644 index 2d4743ac81..0000000000 --- a/src/apps/desktop/src/api/canvas_api.rs +++ /dev/null @@ -1,341 +0,0 @@ -//! Canvas artifact Tauri commands. - -use crate::api::app_state::AppState; -use openbitfun_product_domains::canvas::{ - parse_canvas_artifact_ref, CanvasDiagnostic, CanvasDiagnosticCategory, - CanvasDiagnosticSeverity, CanvasRevision, CanvasSnapshot, CanvasState, CanvasStoragePort, -}; -use openbitfun_runtime_ports::SessionStorePort; -use openbitfun_services_integrations::canvas::CanvasService; -use serde::{Deserialize, Serialize}; -use serde_json::Value; -use std::collections::BTreeMap; -use tauri::State; - -#[derive(Debug, Clone, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct CanvasStateRequest { - pub artifact_reference: String, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub workspace_path: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub workspace_id: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub remote_connection_id: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub remote_ssh_host: Option, -} - -#[derive(Debug, Clone, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct SaveCanvasStateRequest { - pub artifact_reference: String, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub source_revision_seen: Option, - #[serde(default)] - pub values: BTreeMap, - #[serde(default)] - pub value_versions: BTreeMap, - pub updated_at: i64, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub workspace_path: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub workspace_id: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub remote_connection_id: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub remote_ssh_host: Option, -} - -#[derive(Debug, Clone, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct ReportCanvasRuntimeErrorRequest { - pub artifact_reference: String, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub source_revision_seen: Option, - pub message: String, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub stack: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub filename: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub line: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub column: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub component_stack: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub workspace_path: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub workspace_id: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub remote_connection_id: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub remote_ssh_host: Option, -} - -#[derive(Debug, Clone, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct ReportCanvasRuntimeReadyRequest { - pub artifact_reference: String, - pub source_revision_seen: String, - pub runtime_version: String, - pub sdk_version: String, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub workspace_path: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub workspace_id: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub remote_connection_id: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub remote_ssh_host: Option, -} - -#[derive(Debug, Clone, Serialize)] -#[serde(rename_all = "camelCase")] -pub struct CanvasStateResponse { - pub state: Option, -} - -#[derive(Debug, Clone, Serialize)] -#[serde(rename_all = "camelCase")] -pub struct CanvasArtifactResponse { - pub canvas: CanvasSnapshot, - pub artifact_reference: String, -} - -#[tauri::command] -pub async fn load_canvas_artifact( - state: State<'_, AppState>, - request: CanvasStateRequest, -) -> Result { - let reference = parse_canvas_artifact_ref(&request.artifact_reference) - .map_err(|error| format!("Invalid Canvas artifact reference: {:?}", error))?; - let service = canvas_service_for_request(&state, request_workspace(&request), &request).await?; - let snapshot = service - .load_snapshot(reference.session_id, reference.canvas_id) - .await - .map_err(|error| error.message)?; - Ok(CanvasArtifactResponse { - canvas: snapshot, - artifact_reference: request.artifact_reference, - }) -} - -#[tauri::command] -pub async fn load_canvas_state( - state: State<'_, AppState>, - request: CanvasStateRequest, -) -> Result { - let reference = parse_canvas_artifact_ref(&request.artifact_reference) - .map_err(|error| format!("Invalid Canvas artifact reference: {:?}", error))?; - let service = canvas_service_for_request(&state, request_workspace(&request), &request).await?; - let state = service - .load_state(reference.session_id, reference.canvas_id) - .await - .map_err(|error| error.message)?; - Ok(CanvasStateResponse { state }) -} - -#[tauri::command] -pub async fn save_canvas_state( - state: State<'_, AppState>, - request: SaveCanvasStateRequest, -) -> Result { - let reference = parse_canvas_artifact_ref(&request.artifact_reference) - .map_err(|error| format!("Invalid Canvas artifact reference: {:?}", error))?; - let service = canvas_service_for_save_request(&state, &request).await?; - let canvas_state = CanvasState { - canvas_id: reference.canvas_id, - source_revision_seen: request.source_revision_seen.map(CanvasRevision::new), - values: request.values, - value_versions: request.value_versions, - updated_at: request.updated_at, - schema_version: openbitfun_product_domains::canvas::CANVAS_CURRENT_STATE_SCHEMA_VERSION, - }; - let saved = service - .save_state(reference.session_id, canvas_state) - .await - .map_err(|error| error.message)?; - Ok(CanvasStateResponse { state: Some(saved) }) -} - -#[tauri::command] -pub async fn report_canvas_runtime_error( - state: State<'_, AppState>, - request: ReportCanvasRuntimeErrorRequest, -) -> Result { - let reference = parse_canvas_artifact_ref(&request.artifact_reference) - .map_err(|error| format!("Invalid Canvas artifact reference: {:?}", error))?; - let service = canvas_service_for_runtime_error_request(&state, &request).await?; - let message = if let Some(name) = request.name.as_deref().filter(|value| !value.is_empty()) { - format!("{}: {}", name, request.message) - } else { - request.message.clone() - }; - let mut diagnostic = CanvasDiagnostic { - severity: CanvasDiagnosticSeverity::Error, - category: CanvasDiagnosticCategory::Runtime, - message, - code: Some("canvas.runtime.error".to_string()), - line: request.line, - column: request.column, - suggested_fix: Some( - "Open the Canvas source and fix the runtime exception, then update the Canvas." - .to_string(), - ), - }; - if let Some(source_revision) = request.source_revision_seen.as_deref() { - diagnostic - .message - .push_str(&format!(" (source revision: {})", source_revision)); - } - if let Some(stack) = request.stack.as_deref().filter(|value| !value.is_empty()) { - diagnostic.message.push('\n'); - diagnostic.message.push_str(stack); - } - if let Some(component_stack) = request - .component_stack - .as_deref() - .filter(|value| !value.is_empty()) - { - diagnostic.message.push_str("\nReact component stack:"); - diagnostic.message.push_str(component_stack); - } - if let Some(filename) = request - .filename - .as_deref() - .filter(|value| !value.is_empty()) - { - diagnostic.message.push_str("\nRuntime source: "); - diagnostic.message.push_str(filename); - } - let snapshot = service - .report_runtime_diagnostic( - reference.session_id, - reference.canvas_id, - request.source_revision_seen.map(CanvasRevision::new), - diagnostic, - ) - .await - .map_err(|error| error.message)?; - Ok(CanvasArtifactResponse { - canvas: snapshot, - artifact_reference: request.artifact_reference, - }) -} - -#[tauri::command] -pub async fn report_canvas_runtime_ready( - state: State<'_, AppState>, - request: ReportCanvasRuntimeReadyRequest, -) -> Result { - let reference = parse_canvas_artifact_ref(&request.artifact_reference) - .map_err(|error| format!("Invalid Canvas artifact reference: {:?}", error))?; - let service = canvas_service_for_workspace( - &state, - request.workspace_id.as_deref(), - request.workspace_path.as_deref(), - request.remote_connection_id.as_deref(), - request.remote_ssh_host.as_deref(), - ) - .await?; - let snapshot = service - .mark_runtime_ready( - reference.session_id, - reference.canvas_id, - CanvasRevision::new(request.source_revision_seen), - request.runtime_version, - request.sdk_version, - ) - .await - .map_err(|error| error.message)?; - Ok(CanvasArtifactResponse { - canvas: snapshot, - artifact_reference: request.artifact_reference, - }) -} - -fn request_workspace(request: &CanvasStateRequest) -> Option<&str> { - request.workspace_path.as_deref() -} - -async fn canvas_service_for_runtime_error_request( - state: &AppState, - request: &ReportCanvasRuntimeErrorRequest, -) -> Result { - canvas_service_for_workspace( - state, - request.workspace_id.as_deref(), - request.workspace_path.as_deref(), - request.remote_connection_id.as_deref(), - request.remote_ssh_host.as_deref(), - ) - .await -} - -async fn canvas_service_for_save_request( - state: &AppState, - request: &SaveCanvasStateRequest, -) -> Result { - canvas_service_for_workspace( - state, - request.workspace_id.as_deref(), - request.workspace_path.as_deref(), - request.remote_connection_id.as_deref(), - request.remote_ssh_host.as_deref(), - ) - .await -} - -async fn canvas_service_for_request( - state: &AppState, - workspace_path: Option<&str>, - request: &CanvasStateRequest, -) -> Result { - canvas_service_for_workspace( - state, - request.workspace_id.as_deref(), - workspace_path, - request.remote_connection_id.as_deref(), - request.remote_ssh_host.as_deref(), - ) - .await -} - -async fn canvas_service_for_workspace( - state: &AppState, - workspace_id: Option<&str>, - legacy_workspace_path: Option<&str>, - remote_connection_id: Option<&str>, - remote_ssh_host: Option<&str>, -) -> Result { - let workspace = if let Some(id) = workspace_id { - state - .workspace_service - .require_workspace(id) - .await - .map_err(|e| e.to_string())? - } else if let Some(path) = legacy_workspace_path.filter(|path| !path.is_empty()) { - state - .workspace_service - .resolve_legacy_workspace_reference(None, path, remote_connection_id, remote_ssh_host) - .await - .map_err(|e| e.to_string())? - .ok_or("Legacy Canvas workspace cannot be resolved")? - } else { - // Canvas state is keyed by the owning workspace. Falling through to the - // active workspace would silently store a session's Canvas under the - // wrong workspace, so reject requests that carry neither an ID nor a - // legacy path. - return Err("Canvas requests must identify the owning workspace".to_string()); - }; - let sessions_dir = openbitfun_core::agentic::session::CoreSessionStorePort::default() - .resolve_workspace_storage(&workspace.id) - .await - .map_err(|e| e.to_string())? - .effective_storage_path; - Ok(CanvasService::persistent(sessions_dir)) -} diff --git a/src/apps/desktop/src/api/generative_ui_api.rs b/src/apps/desktop/src/api/generative_ui_api.rs new file mode 100644 index 0000000000..8065e03985 --- /dev/null +++ b/src/apps/desktop/src/api/generative_ui_api.rs @@ -0,0 +1,431 @@ +//! Source-bound application state; never accept controller filesystem paths. +use serde::Deserialize; +use serde_json::Value; + +const WIKIPEDIA_SUMMARY: &str = "https://en.wikipedia.org/api/rest_v1/page/summary/"; +const WIKIMEDIA_API: &str = "https://commons.wikimedia.org/w/api.php"; +const SO_IMAGE_API: &str = "https://image.so.com/j"; +const BAIDU_IMAGE_API: &str = "https://image.baidu.com/search/acjson"; +const NOMINATIM_API: &str = "https://nominatim.openstreetmap.org/search"; +const OSRM_API: &str = "https://router.project-osrm.org/route/v1/driving/"; +const VALHALLA_API: &str = "https://valhalla1.openstreetmap.de/route"; +const GENUI_NETWORK_TIMEOUT_SECS: u64 = 12; +const DOMESTIC_IMAGE_TIMEOUT_SECS: u64 = 6; +const OPEN_IMAGE_TIMEOUT_SECS: u64 = 8; + +#[derive(Debug, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct GenUIProviderRequest { + capability: String, + #[serde(default)] + args: Value, +} + +fn provider_client() -> Result { + provider_client_with_timeout(GENUI_NETWORK_TIMEOUT_SECS) +} + +fn provider_client_with_timeout(timeout_secs: u64) -> Result { + reqwest::Client::builder() + .user_agent("OpenBitFun/1.0 (GenUI host provider)") + .timeout(std::time::Duration::from_secs(timeout_secs)) + .build() + .map_err(|error| format!("GenUI provider HTTP client unavailable: {error}")) +} + +fn query_arg(args: &Value) -> Result { + let query = args + .get("query") + .and_then(Value::as_str) + .unwrap_or_default() + .trim(); + if !(2..=200).contains(&query.chars().count()) { + return Err("GenUI provider query must contain 2 to 200 characters".into()); + } + Ok(query.to_string()) +} + +fn push_image_url(images: &mut Vec, value: Option<&Value>) { + let Some(url) = value.and_then(Value::as_str).map(str::trim) else { + return; + }; + if !(url.starts_with("https://") || url.starts_with("http://")) + || url.to_ascii_lowercase().contains(".svg") + || url.to_ascii_lowercase().contains("logo") + || url.to_ascii_lowercase().contains("icon") + || images.iter().any(|item| item == url) + { + return; + } + images.push(url.to_string()); +} + +fn collect_image_urls(value: &Value, images: &mut Vec) { + match value { + Value::Array(items) => items + .iter() + .for_each(|item| collect_image_urls(item, images)), + Value::Object(record) => { + for key in [ + "src", + "url", + "thumb", + "img", + "link", + "thumbURL", + "middleURL", + "objURL", + "hoverURL", + ] { + push_image_url(images, record.get(key)); + } + for value in record.values() { + if images.len() >= 8 { + break; + } + if value.is_array() || value.is_object() { + collect_image_urls(value, images); + } + } + } + _ => {} + } +} + +async fn so_image_search(query: &str) -> Vec { + let Ok(client) = provider_client_with_timeout(DOMESTIC_IMAGE_TIMEOUT_SECS) else { + return Vec::new(); + }; + let Ok(response) = client + .get(SO_IMAGE_API) + .query(&[ + ("q", query), + ("pn", "0"), + ("sn", "0"), + ("pd", "1"), + ("correct", query), + ]) + .send() + .await + else { + return Vec::new(); + }; + if !response.status().is_success() { + return Vec::new(); + } + let Ok(value) = response.json::().await else { + return Vec::new(); + }; + let mut images = Vec::new(); + collect_image_urls(&value, &mut images); + images.truncate(4); + images +} + +async fn baidu_image_search(query: &str) -> Vec { + let Ok(client) = provider_client_with_timeout(DOMESTIC_IMAGE_TIMEOUT_SECS) else { + return Vec::new(); + }; + let Ok(response) = client + .get(BAIDU_IMAGE_API) + .query(&[ + ("tn", "resultjson_com"), + ("word", query), + ("ie", "utf-8"), + ("pn", "0"), + ("rn", "10"), + ]) + .send() + .await + else { + return Vec::new(); + }; + if !response.status().is_success() { + return Vec::new(); + } + let Ok(value) = response.json::().await else { + return Vec::new(); + }; + let mut images = Vec::new(); + collect_image_urls(&value, &mut images); + images.truncate(4); + images +} + +async fn open_image_search(query: &str) -> Vec { + let Ok(client) = provider_client_with_timeout(OPEN_IMAGE_TIMEOUT_SECS) else { + return Vec::new(); + }; + let mut images = Vec::new(); + + // OI uses Wikipedia + Commons because they return stable, openly licensed + // image URLs. Keep the same ordering and run both requests concurrently. + let wiki_url = format!("{}{}", WIKIPEDIA_SUMMARY, urlencoding::encode(query)); + let wiki = client.get(wiki_url).send(); + let commons = client + .get(WIKIMEDIA_API) + .query(&[ + ("action", "query"), + ("format", "json"), + ("formatversion", "2"), + ("generator", "search"), + ("gsrsearch", query), + ("gsrnamespace", "6"), + ("gsrlimit", "8"), + ("prop", "imageinfo"), + ("iiprop", "url|mime"), + ("iiurlwidth", "960"), + ]) + .send(); + let (wiki, commons) = tokio::join!(wiki, commons); + if let Ok(response) = wiki { + if response.status().is_success() { + if let Ok(value) = response.json::().await { + push_image_url(&mut images, value.pointer("/thumbnail/source")); + } + } + } + if let Ok(response) = commons { + if response.status().is_success() { + if let Ok(value) = response.json::().await { + collect_image_urls(&value, &mut images); + } + } + } + images.truncate(4); + images +} + +async fn native_image_search(query: &str) -> Result { + // Query the domestic sources together. If neither returns anything, use + // the open fallback; the combined worst case stays below the frontend's + // 20-second invoke timeout. + let search = async { + let (so, baidu) = tokio::join!(so_image_search(query), baidu_image_search(query)); + let mut images = so; + images.extend(baidu); + images.truncate(4); + if images.is_empty() { + open_image_search(query).await + } else { + images + } + }; + let images = tokio::time::timeout(std::time::Duration::from_secs(16), search) + .await + .unwrap_or_default(); + Ok(serde_json::json!({ "images": images })) +} + +async fn native_map_lookup(query: &str) -> Result { + let client = provider_client()?; + let response = client + .get(NOMINATIM_API) + .query(&[("q", query), ("format", "jsonv2"), ("limit", "8")]) + .header("accept-language", "zh-CN,zh;q=0.9,en;q=0.7") + .send() + .await + .map_err(|error| format!("Map lookup failed: {error}"))?; + if !response.status().is_success() { + return Err(format!("Map lookup returned HTTP {}", response.status())); + } + let results = response + .json::>() + .await + .map_err(|error| format!("Map lookup response was invalid: {error}"))?; + let markers = results + .into_iter() + .filter_map(|item| { + let lat = item.get("lat")?.as_str()?.parse::().ok()?; + let lng = item.get("lon")?.as_str()?.parse::().ok()?; + Some(serde_json::json!({ + "label": item.get("display_name").and_then(Value::as_str).unwrap_or("Place"), + "lat": lat, + "lng": lng, + "category": item.get("type").and_then(Value::as_str), + })) + }) + .collect::>(); + Ok(serde_json::json!({ "markers": markers })) +} + +async fn native_map_route(args: &Value) -> Result { + let markers = args + .get("markers") + .and_then(Value::as_array) + .ok_or("Map route requires a markers array")?; + if markers.len() < 2 || markers.len() > 100 { + return Err("Map route requires between 2 and 100 markers".into()); + } + let mut coordinates = Vec::with_capacity(markers.len()); + for marker in markers { + let lat = marker + .get("lat") + .and_then(Value::as_f64) + .ok_or("Map marker latitude is invalid")?; + let lng = marker + .get("lng") + .and_then(Value::as_f64) + .ok_or("Map marker longitude is invalid")?; + if !lat.is_finite() + || !lng.is_finite() + || !(-90.0..=90.0).contains(&lat) + || !(-180.0..=180.0).contains(&lng) + { + return Err("Map marker coordinates are out of range".into()); + } + coordinates.push(format!("{lng},{lat}")); + } + let client = provider_client_with_timeout(8)?; + let osrm = client + .get(format!("{}{}", OSRM_API, coordinates.join(";"))) + .query(&[("overview", "full"), ("geometries", "geojson")]) + .send() + .await; + if let Ok(response) = osrm { + if response.status().is_success() { + if let Ok(value) = response.json::().await { + if value + .pointer("/routes/0/geometry/coordinates") + .and_then(Value::as_array) + .is_some_and(|points| points.len() > 1) + { + return Ok(value); + } + } + } + } + + // The public OSRM endpoint is frequently unreachable from mainland + // networks. Valhalla's OpenStreetMap deployment is a compatible fallback; + // normalize its encoded polyline into the same GeoJSON shape consumed by + // the OpenUI map renderer. + let locations = markers + .iter() + .map(|marker| { + serde_json::json!({ + "lat": marker.get("lat").and_then(Value::as_f64), + "lon": marker.get("lng").and_then(Value::as_f64), + }) + }) + .collect::>(); + let response = client + .post(VALHALLA_API) + .json(&serde_json::json!({ + "locations": locations, + "costing": "auto", + "units": "kilometers", + })) + .send() + .await + .map_err(|error| format!("Street route failed: {error}"))?; + if !response.status().is_success() { + return Err(format!("Street route returned HTTP {}", response.status())); + } + let value = response + .json::() + .await + .map_err(|error| format!("Street route response was invalid: {error}"))?; + let mut coordinates = Vec::::new(); + if let Some(legs) = value.pointer("/trip/legs").and_then(Value::as_array) { + for shape in legs + .iter() + .filter_map(|leg| leg.get("shape").and_then(Value::as_str)) + { + coordinates.extend(decode_valhalla_polyline(shape)?); + } + } + if coordinates.len() < 2 { + return Err("Street route provider returned no usable geometry".into()); + } + Ok(serde_json::json!({ + "routes": [{ "geometry": { "type": "LineString", "coordinates": coordinates } }] + })) +} + +fn decode_valhalla_polyline(encoded: &str) -> Result, String> { + let bytes = encoded.as_bytes(); + let mut index = 0; + let mut latitude = 0_i64; + let mut longitude = 0_i64; + let mut points = Vec::new(); + while index < bytes.len() { + let delta_latitude = decode_polyline_value(bytes, &mut index)?; + let delta_longitude = decode_polyline_value(bytes, &mut index)?; + latitude += delta_latitude; + longitude += delta_longitude; + points.push(serde_json::json!([ + longitude as f64 / 1_000_000.0, + latitude as f64 / 1_000_000.0, + ])); + } + Ok(points) +} + +fn decode_polyline_value(bytes: &[u8], index: &mut usize) -> Result { + let mut result = 0_i64; + let mut shift = 0_u32; + loop { + let byte = *bytes + .get(*index) + .ok_or("Street route geometry was truncated")?; + *index += 1; + let value = i64::from(byte.saturating_sub(63)); + result |= (value & 0x1f) << shift; + if value < 0x20 { + break; + } + shift += 5; + if shift > 60 { + return Err("Street route geometry was invalid".into()); + } + } + Ok(if result & 1 != 0 { + !(result >> 1) + } else { + result >> 1 + }) +} + +#[tauri::command] +pub async fn gen_ui_provider_call(request: GenUIProviderRequest) -> Result { + match request.capability.trim() { + "image.search" | "SearchImage" => native_image_search(&query_arg(&request.args)?).await, + "map.lookup" | "Map" => native_map_lookup(&query_arg(&request.args)?).await, + "map.route" => native_map_route(&request.args).await, + capability => Err(format!( + "GenUI capability {capability} is unavailable on this host" + )), + } +} +#[cfg(test)] +mod tests { + use super::*; + use serde_json::json; + + #[test] + fn normalizes_domestic_image_search_payloads() { + let payload = json!({ + "list": [ + {"thumb": "https://images.example/photo.jpg"}, + {"img": "http://images.example/logo-icon.jpg"}, + {"link": "https://images.example/photo.jpg"} + ] + }); + let mut images = Vec::new(); + collect_image_urls(&payload, &mut images); + assert_eq!(images, vec!["https://images.example/photo.jpg"]); + } + + #[test] + fn decodes_valhalla_polyline6_to_geojson_coordinates() { + let points = decode_valhalla_polyline( + "c{cqz@eidufFsByEuFgMyCyGkKuVy\\}v@uK}XqJuWoGyPsDcJ{Pmb@aHyQgGmQ}E{MaEyLcFyPy@aGsF{_@{Fw\\eBmIs@iEqAwLe@wESaJZkKrAmYzH}o@`EcNlFcBbPoCj^gEzt@kIzLaBtA|JPnAhGnUxE`NbDpKvHdZrHlXzDlM`IzOlG|KhCxDtCzDzRvO`PzKpG`EnDvGbGtRxBhH|Nte@lStp@pGvSbYn~@nBnGhQsF`^}KvUoHpP_G~a@uMdH{BhMkBnm@kFzFa@", + ) + .unwrap(); + assert!(points.len() > 2); + let first = points.first().unwrap().as_array().unwrap(); + assert!((first[0].as_f64().unwrap() - 121.4737).abs() < 0.001); + assert!((first[1].as_f64().unwrap() - 31.2304).abs() < 0.001); + } +} diff --git a/src/apps/desktop/src/api/mod.rs b/src/apps/desktop/src/api/mod.rs index dbb4e3584b..7b8fc15cf6 100644 --- a/src/apps/desktop/src/api/mod.rs +++ b/src/apps/desktop/src/api/mod.rs @@ -9,7 +9,6 @@ pub mod browser_api; pub mod browser_control_api; pub mod browser_file_drop_api; pub mod btw_api; -pub mod canvas_api; pub mod clipboard_file_api; pub mod commands; pub mod computer_use_api; @@ -28,6 +27,7 @@ pub mod external_hooks_api; pub mod external_session_import_api; pub mod external_sources_api; pub mod file_drop_preview_api; +pub mod generative_ui_api; pub mod git_agent_api; pub mod git_api; pub mod html_preview_api; diff --git a/src/apps/desktop/src/api/remote_connect_api/page_tool_tests.rs b/src/apps/desktop/src/api/remote_connect_api/page_tool_tests.rs index 53d6d84220..4c6898f2c2 100644 --- a/src/apps/desktop/src/api/remote_connect_api/page_tool_tests.rs +++ b/src/apps/desktop/src/api/remote_connect_api/page_tool_tests.rs @@ -110,6 +110,7 @@ async fn desktop_page_manage_registration_reaches_the_executing_account() { custom_data: HashMap::new(), computer_use_host: None, runtime_tool_restrictions: Default::default(), + model_client: None, runtime_handles: Default::default(), }; assert!(tool.is_available_in_context(Some(&context)).await); diff --git a/src/apps/desktop/src/lib.rs b/src/apps/desktop/src/lib.rs index 22193341cb..b10e3f36c4 100644 --- a/src/apps/desktop/src/lib.rs +++ b/src/apps/desktop/src/lib.rs @@ -1498,6 +1498,7 @@ pub async fn run() { openbitfun_control_host::mark_openbitfun_control_surface_ready, openbitfun_control_host::mark_openbitfun_control_surface_unready, openbitfun_control_host::product_control_invoke, + api::generative_ui_api::gen_ui_provider_call, openbitfun_control_host::report_openbitfun_control_result, miniapp_web_host::mark_miniapp_web_surface_ready, miniapp_web_host::report_miniapp_web_result, @@ -1943,11 +1944,6 @@ pub async fn run() { api::miniapp_api::miniapp_runtime_status, api::miniapp_api::miniapp_worker_call, api::miniapp_api::miniapp_host_call, - api::canvas_api::load_canvas_artifact, - api::canvas_api::load_canvas_state, - api::canvas_api::report_canvas_runtime_error, - api::canvas_api::report_canvas_runtime_ready, - api::canvas_api::save_canvas_state, api::miniapp_api::miniapp_worker_stop, api::miniapp_api::miniapp_worker_list_running, api::miniapp_api::miniapp_install_deps, diff --git a/src/apps/desktop/src/openbitfun_control_host.rs b/src/apps/desktop/src/openbitfun_control_host.rs index 4d2279494b..01afdc1141 100644 --- a/src/apps/desktop/src/openbitfun_control_host.rs +++ b/src/apps/desktop/src/openbitfun_control_host.rs @@ -97,6 +97,14 @@ async fn dispatch_surface_event( ); let (sender, receiver) = oneshot::channel(); lock_pending_responses().insert(request_id.clone(), sender); + // Cancellation drops the pending sender as well as the receiver. + struct PendingGuard(String); + impl Drop for PendingGuard { + fn drop(&mut self) { + lock_pending_responses().remove(&self.0); + } + } + let _pending = PendingGuard(request_id.clone()); let Some(payload) = payload.as_object_mut() else { lock_pending_responses().remove(&request_id); @@ -1287,8 +1295,10 @@ mod tests { let legacy: super::ProductControlSurfaceReadyRequest = serde_json::from_value(serde_json::json!({})).unwrap(); assert_eq!(legacy.creation_api_version, None); - let current: super::ProductControlSurfaceReadyRequest = - serde_json::from_value(serde_json::json!({"creationApiVersion": 1})).unwrap(); + let current: super::ProductControlSurfaceReadyRequest = serde_json::from_value( + serde_json::json!({"creationApiVersion": 1, "genUiApiVersion": 1}), + ) + .unwrap(); assert_eq!(current.creation_api_version, Some(1)); } use super::*; diff --git a/src/apps/miniapp-shell/src/generated/chat-styles.css b/src/apps/miniapp-shell/src/generated/chat-styles.css index f93b2e9a0e..15008dcf06 100644 --- a/src/apps/miniapp-shell/src/generated/chat-styles.css +++ b/src/apps/miniapp-shell/src/generated/chat-styles.css @@ -2215,6 +2215,13 @@ gap: var(--openbitfun-control-flow-chat-inline-gap); } +.user-message-item__host-evidence { + margin: 0; + color: var(--openbitfun-color-content-secondary); + font-size: var(--openbitfun-type-flow-meta-font-size); + line-height: var(--openbitfun-type-flow-meta-line-height); +} + .user-message-item__main-contents-bridge { display: contents; } diff --git a/src/apps/mobile/harmonyos/AppScope/app.json5 b/src/apps/mobile/harmonyos/AppScope/app.json5 index 8697ed1307..75bf7f95e1 100644 --- a/src/apps/mobile/harmonyos/AppScope/app.json5 +++ b/src/apps/mobile/harmonyos/AppScope/app.json5 @@ -4,7 +4,7 @@ // upgrades retain encrypted sessions, preferences, and watch handoff data. "bundleName": "com.bitfun.app", "vendor": "OpenBitFun", - "versionCode": 8, + "versionCode": 9, "versionName": "1.0.0", // x-release-please-version "buildVersion": "1", "icon": "$media:openbitfun_app_icon", diff --git a/src/crates/adapters/ai-adapters/src/providers/openai/codex_chatgpt.rs b/src/crates/adapters/ai-adapters/src/providers/openai/codex_chatgpt.rs index ae9c918ae1..3be52ac245 100644 --- a/src/crates/adapters/ai-adapters/src/providers/openai/codex_chatgpt.rs +++ b/src/crates/adapters/ai-adapters/src/providers/openai/codex_chatgpt.rs @@ -216,6 +216,17 @@ fn try_build_request_body_with_context( } } + // Request-scoped output contracts must survive custom body merging on + // this Responses route too (including independent review calls). + if let Some(schema) = request_context.and_then(|context| context.output_schema.as_ref()) { + body["text"]["format"] = json!({ + "type": "json_schema", + "name": "openbitfun_output", + "strict": true, + "schema": schema + }); + } + shared::log_request_body( TARGET, "Codex ChatGPT request body (excluding tools):", @@ -287,6 +298,41 @@ pub(crate) async fn send_stream( #[cfg(test)] mod tests { use super::*; + #[test] + fn request_output_schema_survives_custom_body_without_leaking_to_next_request() { + let client = AIClient::new( + serde_json::from_value(json!({ + "name": "test", "base_url": "https://chatgpt.com/backend-api/codex", + "request_url": "https://chatgpt.com/backend-api/codex/responses", + "api_key": "synthetic", "model": "gpt-5.5", "format": "responses", + "context_window": 128000, "inline_think_in_text": false, "skip_ssl_verify": false + })) + .unwrap(), + ); + let schema = json!({"type":"object","properties":{"issues":{"type":"array","items":{"type":"string"}}},"required":["issues"],"additionalProperties":false}); + let context = ModelRequestContext { + output_schema: Some(schema.clone()), + ..Default::default() + }; + let custom = json!({"text":{"format":{"type":"text"},"verbosity":"low"}}); + let body = try_build_request_body_with_context( + &client, + None, + vec![], + None, + Some(custom.clone()), + Some(&context), + ) + .unwrap(); + assert_eq!(body["text"]["format"]["schema"], schema); + assert_eq!(body["text"]["format"]["type"], "json_schema"); + assert_eq!(body["text"]["format"]["strict"], true); + assert_eq!(body["text"]["verbosity"], "low"); + let next = + try_build_request_body_with_context(&client, None, vec![], None, Some(custom), None) + .unwrap(); + assert_eq!(next["text"]["format"]["type"], "text"); + } #[test] fn ordinary_api_codex_endpoint_preserves_custom_body_and_does_not_gain_affinity() { diff --git a/src/crates/assembly/core/Cargo.toml b/src/crates/assembly/core/Cargo.toml index b6b24bbdb9..6036df67c0 100644 --- a/src/crates/assembly/core/Cargo.toml +++ b/src/crates/assembly/core/Cargo.toml @@ -174,10 +174,8 @@ product-full = [ "tools-miniapp", "tools-pages", "tools-creation", - "tools-canvas", "tools-agent-control", "function-agents", - "canvas-runtime", "external-sources", "plugin-runtime", "opencode-plugin-host", @@ -403,10 +401,6 @@ tools-pages = [ tools-creation = [ "openbitfun-tool-packs/creation", ] -tools-canvas = [ - "openbitfun-tool-packs/canvas", - "canvas-runtime", -] tools-agent-control = [ "openbitfun-tool-packs/agent-control", "scheduled-jobs", @@ -445,10 +439,6 @@ function-agents = [ "openbitfun-services-integrations/function-agents", "runtime-services", ] -canvas-runtime = [ - "dep:openbitfun-product-domains", - "openbitfun-services-integrations/canvas-runtime", -] runtime-services = ["dep:openbitfun-runtime-services"] legacy-migration = ["dep:openbitfun-legacy-migration-adapters"] file-watch = ["openbitfun-services-integrations/file-watch"] diff --git a/src/crates/assembly/core/builtin_skills/agent-eval-canvas/SKILL.md b/src/crates/assembly/core/builtin_skills/agent-eval-canvas/SKILL.md deleted file mode 100644 index f2ee564014..0000000000 --- a/src/crates/assembly/core/builtin_skills/agent-eval-canvas/SKILL.md +++ /dev/null @@ -1,218 +0,0 @@ ---- -name: agent-eval-canvas -description: >- - Create a OpenBitFun Canvas for single-case agent evaluation and trajectory - diagnosis. Use when the user asks to analyze one agent run, trace, case, - benchmark item, failure trajectory, eval result, or critical failure step, - and wants an incident-review style report covering verdict, step timeline, - root cause, error propagation, tool/evidence analysis, efficiency, safety, - and repair recommendations. ---- - -# Agent Eval Canvas - -Use this skill to produce a session-scoped OpenBitFun Canvas for a **single agent -case**. The report should read like an incident review or clinical diagnosis, -not like an aggregate benchmark summary. Its job is to explain what happened in -one run, which step determined success or failure, why, and what to fix next. - -Read and follow `openbitfun-canvas` first. It defines the Canvas tool workflow, -source rules, SDK surface, design constraints, and final response requirements. - -## Inputs - -Gather the case evidence before writing TSX: - -- Case ID, task type, original user request, expected result, actual result, - final verdict, score, model, prompt version, tools, max steps, timeout, and - environment facts when available. -- Full or summarized trajectory: LLM calls, tool calls, handoffs, guardrail - events, custom events, observations, retries, and final answer. -- Tool call details: tool name, call timing, arguments, raw or summarized - result, error state, whether the result was used, and recovery behavior. -- Evidence artifacts: files, retrieved sources, code snippets, tables, judge - output, screenshots, or execution logs that support the verdict. -- Cost facts: total latency, steps, LLM calls, tool calls, tokens, repeated - calls, invalid steps, budget/timeout status. -- Safety facts: risky commands, permission prompts, sensitive data, production - side effects, prompt injection exposure, and guardrail behavior. - -If the trace or expected result is missing, ask for it unless the user clearly -wants a best-effort report from partial evidence. In a best-effort report, mark -unsupported fields as unavailable and keep root-cause claims conservative. - -## Canvas Structure - -Lead with diagnosis, then evidence. The first screen should answer: did the -case pass, what was the decisive step, and what should change next. - -1. **Case header**: Case ID, task type, verdict, score, run configuration, and - a one-sentence conclusion. -2. **Diagnostic summary**: final outcome, critical failure or success step, - primary root cause, downstream propagation, confidence, and top repair. -3. **Trajectory timeline**: compact step table or swimlane showing behavior - type, agent action, input/observation, reasonableness, tag, and issue. -4. **Step-level evaluation**: per-step cards or rows with labels: - `OK`, `WARN`, `ERROR`, `ROOT_CAUSE`, and `PROPAGATED`. -5. **Critical step deep dive**: why this step changed the run, what evidence - proves it, why later errors are downstream, and what should have happened. -6. **Root cause and propagation**: category breakdown plus a clear chain from - first error to final result. -7. **Tool and evidence analysis**: tool choice, parameters, results, result - use, recovery behavior, unsupported claims, stale evidence, and source fit. -8. **Cost, efficiency, and safety**: latency, tokens, duplicate work, invalid - steps, risky actions, sensitive data, and confirmation/guardrail handling. -9. **Repair plan and regression**: fixes grouped by Prompt, Planner, Tool - schema, Tool result, Memory/RAG, Runtime, Evaluator, and Guardrail; include - next-run pass criteria and steps to watch. - -For successful cases, replace the failure emphasis with the **critical success -step**: the moment the agent made the run robust, such as verifying evidence, -recovering from an empty result, narrowing a query, or correcting a plan. - -## Diagnostic Rules - -- Separate **root-cause errors** from **propagated errors**. A later bad answer - is not the root cause if it merely follows from earlier wrong evidence. -- Do not write "model hallucination" as the only cause. Classify concrete - failure modes: task understanding, planning, tool choice, tool parameters, - observation understanding, retrieval, evidence use, memory contamination, - reflection/recovery, output format, resource limit, environment, or safety. -- Tie every critical claim to trace evidence. If the trace does not support a - root cause, label it as a hypothesis and show what evidence is missing. -- Preserve the user's wording for the original request. Redact secrets, access - tokens, private personal data, and credentials before rendering. -- Treat tool errors carefully: distinguish wrong tool choice, wrong arguments, - noisy/empty results, tool/runtime failure, and correct result misread by the - agent. -- Include "what should have happened" for the critical step. Make it concrete: - expected constraint extraction, query rewrite, retry policy, validation, - human confirmation, or final evidence check. -- For partial-success cases, show which user requirements passed, which failed, - and whether remaining failures are independent or downstream of one root - cause. - -## Useful Representations - -Pick the layout that makes the diagnosis fastest to understand: - -- A verdict strip with score, pass/fail, confidence, critical step, and primary - failure category. -- A horizontal timeline or vertical trace table for step-by-step behavior. -- A dependency or propagation graph: `Step 3 -> Step 4 -> Step 6 -> Final`. -- A root-cause matrix separating primary cause, secondary contributors, and - downstream symptoms. -- A tool-call audit table with arguments, result quality, result use, and - recovery. -- An evidence ledger mapping final claims to observations, with unsupported or - stale claims highlighted. -- A repair backlog grouped by system layer and tagged with expected impact. - -Use `computeDAGLayout` plus inline SVG for propagation graphs when it is clearer -than text. Use `DiffView` only when the case is code-review-like and the exact -hunk is part of the evidence. - -## Report Template - -Cover these fields when the evidence supports them: - -```text -Case information: -- Case ID -- Task type -- Original user request -- Expected result -- Actual result -- Verdict: success / partial success / failure / timeout -- Agent configuration -- Overall score - -One-sentence conclusion: -- Direct statement of why the case passed or failed. - -Trajectory summary: -- Step -- Behavior type -- Agent behavior -- Tool / observation result -- Judgment -- Issue - -Critical step: -- Critical failure step / critical success step -- Failure or success type -- Concrete behavior -- Why this step is decisive -- What should have happened - -Root cause: -- Primary category -- Secondary category -- Root cause vs propagated symptom -- Confidence and missing evidence - -Propagation: -- Step X -> Step Y -> Step Z -> Final - -Tool analysis: -- Selection -- Timing -- Parameters -- Return quality -- Observation use -- Retry or fallback - -Evidence analysis: -- Supported claims -- Unsupported claims -- Misread, stale, irrelevant, or missing evidence - -Cost and safety: -- Latency, steps, calls, tokens, duplicate work, invalid steps -- Risky actions, sensitive data, prompt injection, guardrails, confirmations - -Repair and regression: -- Prompt -- Planner -- Tool schema / result -- Memory / RAG -- Runtime -- Evaluator -- Guardrail -- Regression inclusion and pass criteria -``` - -## Do Not - -- Do not turn a single case into an aggregate benchmark dashboard. -- Do not paste the complete raw trace. Summarize the trajectory and quote only - the spans needed to justify the diagnosis. -- Do not invent missing metrics, traces, CI status, tool results, or model - configuration. Mark unavailable facts as unavailable. -- Do not bury the verdict under metadata. The first screen must show outcome, - critical step, root cause, and next fix. -- Do not make every section a uniform card stack. Use cards for high-signal - summaries and deep dives; use open sections, tables, compact callouts, and - diagrams for the rest. -- Do not expose credentials, secrets, private data, or unnecessarily verbose - user content in the canvas. - -## Output Self-Check - -Before calling `CreateCanvas`, verify: - -- The report answers the five core questions: outcome, trajectory, critical - step, root cause category, and next repair. -- The critical step is justified by trace evidence, not only final outcome. -- Root-cause and propagated errors are separated. -- Tool, evidence, cost, and safety sections are present when relevant. -- The repair plan is specific enough to implement or test. -- The first screen is diagnostic, not just descriptive metadata. -- The design passes the `openbitfun-canvas` slop-pattern check. - -## Output - -Call `CreateCanvas` with a concise title and the complete TSX source. In the -final response, mention the Canvas title and trace or case source used, but do -not print the internal `openbitfun-canvas://...` reference; OpenBitFun renders its -openable card automatically below the response. diff --git a/src/crates/assembly/core/builtin_skills/create-agent/references/tool-catalog.md b/src/crates/assembly/core/builtin_skills/create-agent/references/tool-catalog.md index ac54600aeb..47a2b552d6 100644 --- a/src/crates/assembly/core/builtin_skills/create-agent/references/tool-catalog.md +++ b/src/crates/assembly/core/builtin_skills/create-agent/references/tool-catalog.md @@ -61,16 +61,12 @@ Use these tables to select tools for the user's tasks, then put their exact name | `analyze_image` | Analyze an image file with the configured vision model. | | `view_image` | Attach an image file for the current model to inspect visually. | -## Interaction and canvas +## Interaction and generated UI | Tool name | Purpose | | --- | --- | | `AskUserQuestion` | Ask the user focused follow-up questions during execution. | | `GenerativeUI` | Render HTML or SVG visualizations and lightweight interactive widgets in chat. | -| `CreateCanvas` | Create a Canvas artifact scoped to the session. | -| `ReadCanvas` | Read Canvas metadata, diagnostics, and source. | -| `PatchCanvas` | Apply targeted patches to an existing Canvas artifact. | -| `UpdateCanvas` | Update an existing Canvas artifact. | ## Computer use and automation diff --git a/src/crates/assembly/core/builtin_skills/create-openbitfun-skin/examples/cinematic-animated-wallpaper/scripts/cinematic_recipe.py b/src/crates/assembly/core/builtin_skills/create-openbitfun-skin/examples/cinematic-animated-wallpaper/scripts/cinematic_recipe.py index 1de47e3b4c..7139733198 100644 --- a/src/crates/assembly/core/builtin_skills/create-openbitfun-skin/examples/cinematic-animated-wallpaper/scripts/cinematic_recipe.py +++ b/src/crates/assembly/core/builtin_skills/create-openbitfun-skin/examples/cinematic-animated-wallpaper/scripts/cinematic_recipe.py @@ -357,23 +357,6 @@ def build_renderers(colors: Mapping[str, str], appearance_id: str) -> dict[str, "vars": widget_tokens, }, }, - "openbitfun-canvas": { - "version": 1, - "settings": { - "id": appearance_id, - "mode": "dark", - "bg": background, - "panel": elevated, - "fg": colors["text"], - "muted": colors["textMuted"], - "border": colors["textDisabled"], - "accent": accent, - "success": colors["success"], - "warning": colors["warning"], - "danger": colors["danger"], - "info": colors["info"], - }, - }, } diff --git a/src/crates/assembly/core/builtin_skills/create-openbitfun-skin/references/appearance-registry.json b/src/crates/assembly/core/builtin_skills/create-openbitfun-skin/references/appearance-registry.json index efdadf3908..842915611a 100644 --- a/src/crates/assembly/core/builtin_skills/create-openbitfun-skin/references/appearance-registry.json +++ b/src/crates/assembly/core/builtin_skills/create-openbitfun-skin/references/appearance-registry.json @@ -15708,8 +15708,7 @@ "monaco", "xterm", "mermaid", - "generative-widget", - "openbitfun-canvas" + "generative-widget" ], "defaultForceableProperties": [ "backgroundColor", diff --git a/src/crates/assembly/core/builtin_skills/create-openbitfun-skin/references/renderer-contracts.md b/src/crates/assembly/core/builtin_skills/create-openbitfun-skin/references/renderer-contracts.md index f22a880474..0087301a81 100644 --- a/src/crates/assembly/core/builtin_skills/create-openbitfun-skin/references/renderer-contracts.md +++ b/src/crates/assembly/core/builtin_skills/create-openbitfun-skin/references/renderer-contracts.md @@ -48,9 +48,3 @@ Accepted settings: `id`, `mode`, and `vars`. Query accepted variable names with: ```powershell python scripts/openbitfun_appearance.py contract tokens widget ``` - -## openbitfun-canvas - -Accepted settings: `id`, `mode`, `bg`, `panel`, `fg`, `muted`, `border`, `accent`, `success`, `warning`, `danger`, and `info`. - -Run package validation for the exact value constraints and required fields. diff --git a/src/crates/assembly/core/builtin_skills/create-openbitfun-skin/scripts/openbitfun_appearance.py b/src/crates/assembly/core/builtin_skills/create-openbitfun-skin/scripts/openbitfun_appearance.py index 9ba25ec109..df2f4ba1e7 100644 --- a/src/crates/assembly/core/builtin_skills/create-openbitfun-skin/scripts/openbitfun_appearance.py +++ b/src/crates/assembly/core/builtin_skills/create-openbitfun-skin/scripts/openbitfun_appearance.py @@ -201,7 +201,6 @@ "activationStroke", "success", "warning", "error", "errorBackground", "info", "highlight", "pieColors", ] -CANVAS_COLOR_KEYS = ["bg", "panel", "fg", "muted", "border", "accent", "success", "warning", "danger", "info"] MIME_BY_EXTENSION = { ".png": "image/png", ".jpg": "image/jpeg", ".jpeg": "image/jpeg", ".webp": "image/webp", ".gif": "image/gif", ".mp4": "video/mp4", ".webm": "video/webm", @@ -810,8 +809,6 @@ def validate_renderer_settings(self, renderer_id: str, settings: Mapping[str, An return self.validate_mermaid(settings) if renderer_id == "generative-widget": return self.validate_widget(settings) - if renderer_id == "openbitfun-canvas": - return self.validate_canvas(settings) return [f"Unsupported renderer: {renderer_id}"] def validate_theme_token_map( @@ -969,22 +966,6 @@ def validate_widget(self, settings: Mapping[str, Any]) -> list[str]: errors.append(f"vars.{key} has an unsafe value") return errors - def validate_canvas(self, settings: Mapping[str, Any]) -> list[str]: - errors: list[str] = [] - known = {"id", "mode", *CANVAS_COLOR_KEYS} - for key in settings: - if key not in known: - errors.append(f"Unknown setting: {key}") - if not isinstance(settings.get("id"), str) or not re.fullmatch(r"[a-z][a-z0-9.-]{0,95}", settings["id"]): - errors.append("id is invalid") - if settings.get("mode") not in ("light", "dark"): - errors.append("mode must be light or dark") - for key in CANVAS_COLOR_KEYS: - color = settings.get(key) - if not isinstance(color, str) or not COLOR_STRING_PATTERN.fullmatch(color): - errors.append(f"{key} is not a supported color") - return errors - def validate_assets(self, value: Any) -> None: if value is None: return diff --git a/src/crates/assembly/core/builtin_skills/docs-canvas/SKILL.md b/src/crates/assembly/core/builtin_skills/docs-canvas/SKILL.md deleted file mode 100644 index 18cc684a72..0000000000 --- a/src/crates/assembly/core/builtin_skills/docs-canvas/SKILL.md +++ /dev/null @@ -1,54 +0,0 @@ ---- -name: docs-canvas -description: >- - Render a documentation-style OpenBitFun Canvas that organizes architecture - notes, API references, walkthroughs, runbooks, and how-tos into a navigable - layout with sections, tables of contents, diagrams, and cross-references. - Use when the user asks for a docs canvas, documentation overview, - architecture walkthrough, API reference page, codebase map, runbook, - or wants to render structured documentation as an interactive canvas. ---- - -# Docs Canvas - -Build a canvas that presents documentation — architecture notes, API references, design docs, runbooks, or codebase walkthroughs — as an interactive, navigable surface rather than as a flat markdown file. - -> **Status:** placeholder. The skill structure is in place so the canvas -> welcome page can surface this plugin via the marketplace query, but the -> full skill body still needs to be written. Treat the steps below as a -> starting outline and refine as the docs canvas pattern matures. - -## Prerequisites - -Read `openbitfun-canvas` first. It contains the generation policy, design guidance, slop rules, self-check, Canvas runtime rules, and SDK usage notes. - -## Gather the source material - -Accept any of: a directory of markdown files, a single doc URL, an inline outline, or a question to answer from the codebase. Collect headings, code blocks, diagrams, and any cross-references between documents. - -## Plan the canvas layout - -Decide the top-level structure before writing any components. A docs canvas usually has: - -1. **Overview** — A short summary card with the purpose of the doc, scope, and audience. -2. **Table of contents** — Navigable list of sections, ideally pinned or sticky so the reader can jump around. -3. **Body sections** — One section per logical unit (architecture, API, examples, gotchas). Each section can mix prose, code blocks, diagrams, and callouts. -4. **References** — Links to related docs, source files, RFCs, and external material. - -## Render with canvas primitives - -Prefer built-in canvas components over raw HTML: - -- Use cards/sections to group related content visually. -- Use code blocks with syntax highlighting for snippets. -- Use diagrams (DAG layout, mermaid) for architecture. -- Use callouts for "Important", "Warning", "Note", "Deprecated". -- Use tables for API parameter lists and option matrices. - -## Tone and content - -Write reader-facing prose. Lead with the answer or the headline, then explain. Keep examples small and runnable. Cite source files with `code references` so readers can jump in. - -## Be creative - -The sections above are a floor, not a ceiling. The goal is the fastest possible path for the reader to understand the topic — so look at the source material in front of you and ask what representation would actually help. A diagram, a sequence chart, a side-by-side comparison, a decision tree, a glossary, a curated FAQ, a single large worked example — whatever fits. diff --git a/src/crates/assembly/core/builtin_skills/openbitfun-canvas/SKILL.md b/src/crates/assembly/core/builtin_skills/openbitfun-canvas/SKILL.md deleted file mode 100644 index d053e43507..0000000000 --- a/src/crates/assembly/core/builtin_skills/openbitfun-canvas/SKILL.md +++ /dev/null @@ -1,108 +0,0 @@ ---- -name: openbitfun-canvas -description: >- - A OpenBitFun Canvas is a live React app that the user can open beside the chat. - You MUST use a canvas when the agent produces a standalone analytical artifact - — quantitative analyses, billing investigations, security audits, architecture - reviews, data-heavy content, timelines, charts, tables, interactive - explorations, repeatable tools, or any response that benefits from visual - layout. Especially prefer a canvas when presenting structured tool or service - results where the data is the deliverable — render it in a rich canvas rather - than dumping it into a markdown table or code block. If you catch yourself - about to write a markdown table, stop and use a canvas instead. You MUST also - read this skill whenever you create, edit, or debug a OpenBitFun Canvas artifact. -metadata: - surfaces: - - ide ---- -A canvas is a single TSX source artifact that OpenBitFun compiles so the user can open it beside the chat. Follow the workflow below in order. - -## Workflow - -### 1. Decide whether to use a canvas - -The trigger is **user intent**, not response shape. Ask: would the user benefit from viewing this output as its **own standalone artifact**, separate from the chat? If the output is a means to an end (a drafted message, a code fix, a dashboard in another tool), skip the canvas. - -**Use a canvas when the agent produces new standalone analytical output:** -- Quantitative analyses and metrics breakdowns (e.g. "send 500 requests and tell me how many fail") -- Billing or account investigations that surface structured findings from database queries -- Security audits or architecture reviews with categorized findings -- Cross-system data analyses and overlap reports -- Structured data from tools or services where the data IS the deliverable -- Financial analyses, margin decompositions, usage trend reports -- Tables with more than a handful of rows that the user asked to see - -**Do NOT use a canvas when:** -- The user asks for work in a **specific tool** — "create a Datadog dashboard" means give them a Datadog dashboard, not a canvas -- The user has a **specific deliverable** — "draft a support response", "fix this code", "make this PR" -- The user is **working within an existing artifact** — improving an HTML dashboard, editing an existing file -- The user is doing **targeted debugging** or active development, even if structured findings emerge along the way -- Short factual answers, one-off file edits, or quick clarifying questions -- Tools are queried as an **intermediate step** for a different deliverable (e.g. querying Stripe to draft a support reply) - -### 2. Write the canvas - -**Location.** OpenBitFun Canvases are session-scoped artifacts created with `CreateCanvas`. For a new canvas, always call `CreateCanvas` with a concise title and complete TSX source; do not stop after telling the user what the source would be or showing code in chat. For small targeted revisions, use `PatchCanvas` with exact unique text replacements. Use `ReadCanvas` first when you do not have the latest source in context. Use `UpdateCanvas` only for large rewrites that need a complete replacement TSX source. - -**File rules:** -- Exactly one TSX source per canvas. Never create helper files, style files, or supporting modules. -- Import **only** from `openbitfun/canvas`. No relative imports, no npm packages, no Node built-ins. -- Default-export the top-level component. -- Embed all data inline. **No `fetch()`, no network calls.** -- Do not locally redeclare names imported from `openbitfun/canvas` such as `Grid`, `Code`, `Stack`, `Text`, `Row`, or `Card`. Use the SDK component directly, or choose a distinct helper name such as `LayerGrid` or `InlineCodeText`. - -**Never render empty states.** A canvas exists to show real content. If a section, chart, table, or component has no data to display, **omit it** — do not render it with placeholder text ("Add header here", "TODO", "Example"), a "No data" message, an empty array, zeroed rows, or an empty chart frame. If the entire canvas would be empty because you don't have the underlying data, do not produce a canvas — tell the user what's missing and ask for it instead. - -**Label every plot.** Charts and tables must be self-describing — a reader looking at the canvas alone should know exactly what they're seeing. For every plot include: -- A title naming the **specific metric** (not "Metrics" — "API error rate by service"). -- **Axis labels with units** on both axes (e.g. "Date", "Latency (ms)"). -- A **legend** when more than one series is shown, with the exact series names from the source data. -- The **source and time range** in a small caption (e.g. "Source: Datadog · last 7 days"). If a value is a transformation (mean, p95, normalized, smoothed), say so in the label. - -**Component discovery:** prefer built-in `openbitfun/canvas` components over hand-rolled markup. Read `sdk/sdk-contract.generated.json` first: it is the generated, versioned source of truth for runtime exports and accepted component props. Use `sdk/index.d.ts` and its sibling `.d.ts` files for richer type documentation and examples, but never invent an export or prop that is absent from the generated contract. - -Apply the Canvas generation policy below as you write, and complete its pre-delivery self-check (section 6) before returning the canvas. - -## Design guidance - -Be creative. The SDK gives you expressive building blocks — use them in whatever combination best serves the content. But avoid slop: no gradients, no emojis, no box-shadows, no rainbow coloring. OpenBitFun canvases are flat, minimal, and purposeful. - -### Visual hierarchy - -Not everything deserves equal treatment. Primary content gets more space, larger headings, and accent color. Supporting content stays compact. Squint test: blur your eyes — can you tell what matters? - -**Color.** All colors from `useHostAppearance()` tokens — read its JSDoc in the SDK declarations for the return shape and usage pattern. No hardcoded hex. Use accent color deliberately, not on everything. - -### Slop patterns — forbidden - -These specific patterns produce low-quality output. If 2+ are present, redesign. - -- **Gradients** — no `linear-gradient`, `radial-gradient`, `background-clip: text`. -- **Emojis** — no emoji as icons, status indicators, bullets, or section markers. -- **Box shadows** — no `box-shadow`. Flat surfaces only. -- **Wall of identical cards** — every section wrapped in the same card style with no variation. Mix open sections with cards. -- **Rainbow coloring** — a different color on every element. Most elements are neutral; color is used sparingly with purpose. -- **Giant text** — font sizes above H1 (24px), or bold text stuffed in CardHeader. -- **Decorative borders** — colored borders on every element. Borders are structural (subtle stroke tokens), not decorative. - -### Pre-delivery self-check - -Before returning canvas code, verify: -1. Does the layout have visual hierarchy? One thing should stand out. -2. Is there variety in the composition? Not just a single column of uniform blocks. -3. Slop check: scan for the forbidden patterns above. - -## Introducing the canvas - -The `openbitfun-canvas://...` artifact reference is an internal resource identifier. **Never copy it into the chat response or format it as a link.** OpenBitFun automatically collects successful Canvas tool results and renders openable Canvas cards below the completed response. Keep the returned reference only for subsequent `ReadCanvas`, `PatchCanvas`, or `UpdateCanvas` calls. - -When you create a canvas, add a short note in your chat response telling the user they can open it from the Canvas card below: - -- **First canvas** — include one sentence explaining what a canvas is. -- **Unsolicited canvas** — if the user didn't ask for a canvas, include one sentence explaining why you chose it over plain text. - -Both can apply at once; one or two sentences total is enough. Skip the intro for subsequent canvases unless you need to describe what changed. Refer to a canvas by title, never by its internal URI. - -## Troubleshooting - -If a canvas appears blank or missing, first inspect the Canvas tool result diagnostics and runtime diagnostics. `CreateCanvas`, `PatchCanvas`, and `UpdateCanvas` save the source first, then compile it. Compilation means the source was accepted and transformed; `Preview ready` is reported only after the same revision completes a real first render. If compilation or policy validation fails, the tool reports failure with diagnostics and preserves the previous render-validated payload when one exists. Runtime errors are reported back to the host as Canvas diagnostics; open the source view, fix the exception, then call `PatchCanvas` for a small exact edit or `UpdateCanvas` for a full rewrite. diff --git a/src/crates/assembly/core/builtin_skills/openbitfun-canvas/sdk/appearance.d.ts b/src/crates/assembly/core/builtin_skills/openbitfun-canvas/sdk/appearance.d.ts deleted file mode 100644 index cbe47672e2..0000000000 --- a/src/crates/assembly/core/builtin_skills/openbitfun-canvas/sdk/appearance.d.ts +++ /dev/null @@ -1,61 +0,0 @@ -export type { CanvasPalette, CanvasTokens } from "./canvas-tokens.js"; -export { canvasPaletteDark, canvasPaletteLight, canvasTokens, canvasTokensLight, } from "./canvas-tokens.js"; -/** Typography presets used by the built-in `openbitfun/canvas` components. */ -export declare const canvasTypography: { - readonly h1: { - readonly fontSize: "24px"; - readonly lineHeight: "30px"; - readonly fontWeight: 590; - }; - readonly h2: { - readonly fontSize: "18px"; - readonly lineHeight: "24px"; - readonly fontWeight: 590; - }; - readonly h3: { - readonly fontSize: "16px"; - readonly lineHeight: "22px"; - readonly fontWeight: 590; - }; - readonly body: { - readonly fontSize: "14px"; - readonly lineHeight: "20px"; - readonly fontWeight: 400; - }; - readonly small: { - readonly fontSize: "12px"; - readonly lineHeight: "16px"; - readonly fontWeight: 400; - }; -}; -/** Spacing scale (px). */ -export declare const canvasSpacing: { - readonly "0.5": 2; - readonly "1": 4; - readonly "1.5": 6; - readonly "2": 8; - readonly "2.5": 10; - readonly "3": 12; - readonly "3.5": 14; - readonly "4": 16; - readonly "4.5": 18; - readonly "5": 20; - readonly "6": 24; - readonly "7": 28; - readonly "8": 32; - readonly "9": 36; - readonly "10": 40; -}; -export type CanvasSpacing = typeof canvasSpacing; -/** Border radius (px). */ -export declare const canvasRadius: { - readonly none: 0; - readonly xs: 2; - readonly sm: 4; - readonly md: 6; - readonly lg: 8; - readonly xl: 12; - readonly full: 9999; -}; -export type CanvasRadius = typeof canvasRadius; -//# sourceMappingURL=appearance.d.ts.map diff --git a/src/crates/assembly/core/builtin_skills/openbitfun-canvas/sdk/callout-tone-icons.d.ts b/src/crates/assembly/core/builtin_skills/openbitfun-canvas/sdk/callout-tone-icons.d.ts deleted file mode 100644 index b57919b572..0000000000 --- a/src/crates/assembly/core/builtin_skills/openbitfun-canvas/sdk/callout-tone-icons.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { JSX } from "react"; -type CalloutToneIconGlyph = "info" | "warning" | "circles-check" | "exclamation-circle"; -type CalloutToneForIcon = "info" | "success" | "warning" | "danger" | "neutral"; -/** Maps `Callout` tone to the same status icons used by `OpenBitFun UI` toasts. */ -export declare const calloutToneIconGlyph: Record, CalloutToneIconGlyph>; -export declare function CalloutToneIcon({ tone, color }: { - tone: CalloutToneForIcon; - color: string; -}): JSX.Element; -export {}; -//# sourceMappingURL=callout-tone-icons.d.ts.map \ No newline at end of file diff --git a/src/crates/assembly/core/builtin_skills/openbitfun-canvas/sdk/canvas-tokens.d.ts b/src/crates/assembly/core/builtin_skills/openbitfun-canvas/sdk/canvas-tokens.d.ts deleted file mode 100644 index c5153e911b..0000000000 --- a/src/crates/assembly/core/builtin_skills/openbitfun-canvas/sdk/canvas-tokens.d.ts +++ /dev/null @@ -1,96 +0,0 @@ -/** - * Design-token contract for `openbitfun/canvas`. - * - * Canvas uses host-provided OpenBitFun semantic CSS variables instead of declaring - * an independent hardcoded color palette. Treat exported colors as token - * references or host-resolved strings; do not depend on concrete hex values. - */ -export interface CanvasPalette { - readonly foreground: string; - readonly foregroundSecondary: string; - readonly foregroundTertiary: string; - readonly foregroundQuaternary: string; - readonly editor: string; - readonly chrome: string; - readonly sidebar: string; - readonly elevated: string; - readonly fillPrimary: string; - readonly fillSecondary: string; - readonly fillTertiary: string; - readonly fillQuaternary: string; - readonly strokePrimary: string; - readonly strokeSecondary: string; - readonly strokeTertiary: string; - readonly strokeFocused: string; - readonly accent: string; - readonly buttonBackground: string; - readonly buttonForeground: string; - readonly buttonHoverBackground: string; - readonly link: string; - readonly diffInsertedLine: string; - readonly diffRemovedLine: string; - readonly diffStripAdded: string; - readonly diffStripRemoved: string; -} -export interface CanvasHostAppearanceOverrides { - readonly primary?: string; - readonly editorBackground?: string; - readonly editorForeground?: string; -} -export type Color = "gray" | "purple" | "green" | "yellow" | "cyan" | "pink" | "blue" | "orange"; -export type CategoryPalette = Readonly>; -export declare const canvasPaletteDark: CanvasPalette; -export declare const canvasPaletteLight: CanvasPalette; -export declare function applyWorkbenchSurfaces(palette: CanvasPalette, surfaces: Pick): CanvasPalette; -export declare function applyPrimaryColor(palette: CanvasPalette, primary: string): CanvasPalette; -export declare const categoryPaletteDark: CategoryPalette; -export declare const categoryPaletteLight: CategoryPalette; -export declare const usageColorSequence: readonly Color[]; -export declare const chartColorSequence: readonly string[]; -export interface CanvasTokens { - readonly bg: { - readonly editor: string; - readonly chrome: string; - readonly elevated: string; - }; - readonly text: { - readonly primary: string; - readonly secondary: string; - readonly tertiary: string; - readonly quaternary: string; - readonly link: string; - readonly onAccent: string; - }; - readonly stroke: { - readonly primary: string; - readonly secondary: string; - readonly tertiary: string; - readonly focused: string; - }; - readonly fill: { - readonly primary: string; - readonly secondary: string; - readonly tertiary: string; - readonly quaternary: string; - }; - readonly accent: { - readonly primary: string; - readonly control: string; - readonly controlHover: string; - }; - readonly diff: { - readonly insertedLine: string; - readonly removedLine: string; - readonly stripAdded: string; - readonly stripRemoved: string; - }; - readonly category: CategoryPalette; -} -/** Semantic colors for components. Spacing and radius live in `appearance.ts`. */ -export declare const canvasTokens: CanvasTokens; -export declare const canvasTokensLight: CanvasTokens; -export declare function buildHostTokens(kind: string, overrides?: CanvasHostAppearanceOverrides): { - tokens: CanvasTokens; - palette: CanvasPalette; -}; -//# sourceMappingURL=canvas-tokens.d.ts.map diff --git a/src/crates/assembly/core/builtin_skills/openbitfun-canvas/sdk/chart-primitives.d.ts b/src/crates/assembly/core/builtin_skills/openbitfun-canvas/sdk/chart-primitives.d.ts deleted file mode 100644 index 49331327a3..0000000000 --- a/src/crates/assembly/core/builtin_skills/openbitfun-canvas/sdk/chart-primitives.d.ts +++ /dev/null @@ -1,272 +0,0 @@ -/** - * Chart primitives for `openbitfun/canvas` — multi-series, stacked, and pie charts - * rendered as pure inline SVG with zero external dependencies. - * - * Distilled from the portal-website Highcharts analytics charting layer. - */ -import type { CSSProperties, JSX } from "react"; -/** - * Semantic tone for a chart series or slice. Mirrors the tone vocabulary - * used by `Stat`, `Pill`, `Table`, and other SDK primitives so colors - * match across a canvas — e.g. a `Stat tone="success"` and a - * `ChartSeries tone="success"` render in the same green. - * - * Omit `tone` to let the chart auto-assign a distinct color from the - * chart palette; supply `tone` only when the value carries semantic - * meaning that should match other tonal elements on the page. - */ -export type ChartTone = "success" | "danger" | "warning" | "info" | "neutral"; -/** A single labeled value, used by `PieChart`. */ -export type ChartDataPoint = { - label: string; - /** Non-negative numeric value. */ - value: number; -}; -/** - * A named data series for `BarChart` and `LineChart`. - * The `data` array aligns by index with the parent component's `categories`. - * If `tone` is omitted, a color is auto-assigned from the chart palette. - */ -export type ChartSeries = { - name: string; - data: number[]; - tone?: ChartTone; -}; -/** - * A dashed marker line drawn across the plot at a fixed value — for targets, - * SLOs, budgets, means, or limits. Drawn horizontally on line / vertical-bar - * charts and vertically on `horizontal` bar charts; either way it marks the - * value axis and is folded into the auto domain so it stays on-canvas. - */ -export type ChartReferenceLine = { - /** Position on the value axis, in the same units as the series data. */ - value: number; - /** Short label drawn in a chip at the line's end. */ - label?: string; - /** Line color. Omit for a muted neutral; set to match other tonal elements. */ - tone?: ChartTone; -}; -/** - * Shared value-axis controls (the y-axis, or the x-axis on `horizontal` bar - * charts). By default the axis starts at zero; override to zoom into a tight - * range. On stacked / normalized bars these are ignored — those always start - * at zero. - */ -type ValueAxisProps = { - /** - * Start the value axis at zero. Defaults to `true`. Set `false` to - * auto-fit the axis to the data range — useful for tightly-clustered - * series (e.g. uptime 99.0–99.9%) that a zero baseline would flatten. - */ - beginAtZero?: boolean; - /** Explicit axis minimum. Overrides `beginAtZero`. */ - yMin?: number; - /** Explicit axis maximum. */ - yMax?: number; - /** Horizontal marker lines for targets / thresholds / means. */ - referenceLines?: ChartReferenceLine[]; -}; -export type BarChartProps = ValueAxisProps & { - /** Category labels along the independent axis. */ - categories: string[]; - /** One or more data series. Values align by index with `categories`. */ - series: ChartSeries[]; - height?: number; - /** Stack series on top of each other instead of grouping side-by-side. */ - stacked?: boolean; - /** Render horizontal bars instead of vertical columns. */ - horizontal?: boolean; - /** Show as 100% stacked (implies `stacked`). */ - normalized?: boolean; - /** Suffix for value labels (e.g. "%", " ms"). */ - valueSuffix?: string; - /** Prefix for value labels (e.g. "$"). Ignored in `normalized` mode. */ - valuePrefix?: string; - /** - * Print each bar's value as a label. Defaults to auto: on for a single - * series with ≤8 categories, off otherwise. Set `true` to force labels on - * (e.g. grouped multi-series), or `false` to force them off. No effect on - * `stacked` / `normalized` charts — use the hover tooltip there. - */ - showValues?: boolean; - style?: CSSProperties; -}; -export type LineChartProps = ValueAxisProps & { - categories: string[]; - series: ChartSeries[]; - height?: number; - /** Fill the area under each line with a soft tint. */ - fill?: boolean; - /** Suffix for value labels (e.g. "%", " ms"). */ - valueSuffix?: string; - /** Prefix for value labels (e.g. "$"). */ - valuePrefix?: string; - /** Print the value next to every data point (≤20 categories). */ - showValues?: boolean; - /** Draw a vertical guide through the cursor while hovering. Defaults to `true`. */ - showHoverGuide?: boolean; - style?: CSSProperties; -}; -export type PieChartProps = { - data: Array; - /** Diameter in px. Defaults to 200. */ - size?: number; - /** Render as a donut with the summed total shown in the hollow center. */ - donut?: boolean; - style?: CSSProperties; -}; -/** - * Multi-series bar/column chart with optional stacking and normalization. - * Distilled from the portal-website Highcharts analytics charts. - * - * Pass `categories` for x-axis labels and one or more `series` whose `data` - * arrays align by index. With a single series you get simple bars; with - * multiple series the default is grouped (side-by-side) — set `stacked` for - * stacked columns or `normalized` for 100%-stacked share-mode. - * - * Colors are auto-assigned from the chart palette. With a **single series**, - * each bar gets a different color by category (so a chart of 5 categories - * shows 5 colors out of the box). With **multiple series**, each series gets - * its own color. A legend appears when there are 2+ series. - * - * For semantic coloring, pass `tone` on a series — it maps to the same - * palette entries used by `Stat`, `Pill`, and `Table` so your chart matches - * tonal elements elsewhere on the page. - * - * @example - * ```tsx - * // Simple single-series - * - * - * // Stacked multi-series (like portal AI commit chart) - * - * - * // Semantic tones — "accepted" renders in the same green as - * // elsewhere on the page. - * - * - * // Mark a target with a reference line. Grouped/single bars also accept - * // `yMin` / `yMax` to frame the axis (stacked bars stay zero-based). - * - * ``` - */ -export declare function BarChart({ categories, series, height, stacked, horizontal, normalized, valueSuffix, valuePrefix, showValues, beginAtZero, yMin, yMax, referenceLines, style }: BarChartProps): JSX.Element; -/** - * Multi-series line chart with optional area fill. Distilled from the - * portal-website Highcharts analytics charts. - * - * Each series draws a polyline with dot markers at each data point. - * Set `fill` to shade the area under every line. Hover over any category - * column to see a tooltip with all series values and a vertical cursor guide. - * - * This is **not** a time-series component — it does not parse dates. - * Pass pre-formatted date strings as `categories` if plotting over time. - * - * Colors are auto-assigned from the chart palette. For semantic coloring, - * pass `tone` on a series — it maps to the same palette entries used by - * `Stat`, `Pill`, and `Table`. - * - * @example - * ```tsx - * // Single line - * - * - * // Multi-series with area fill - * - * - * // Semantic tones — "errors" renders in the same red as a - * // elsewhere on the page. - * - * - * // Zoom into a tight range and mark an SLO. `beginAtZero={false}` - * // auto-fits the axis; `referenceLines` draws the target. - * - * ``` - */ -export declare function LineChart({ categories, series, height, fill, valueSuffix, valuePrefix, showValues, showHoverGuide, beginAtZero, yMin, yMax, referenceLines, style }: LineChartProps): JSX.Element; -/** - * Pie (or donut) chart with hover highlighting. Distilled from the - * portal-website Highcharts analytics charts. - * - * Unlike `BarChart` and `LineChart`, `PieChart` takes a flat `data` array of - * `{ label, value }` points — each slice is its own category. Colors are - * auto-assigned from the chart palette; pass `tone` on a point to give a - * slice a semantic color that matches other tonal elements on the page. - * - * Hovering a slice expands it outward and dims the others; hovering a legend - * item does the same. A tooltip with value and percentage appears below the - * chart. Set `donut` for a hollow center that shows the summed total. - * - * **Do not** use for bar-style comparisons — use `BarChart` instead. - * - * @example - * ```tsx - * // Basic pie - * - * - * // Donut with semantic tones - * - * ``` - */ -export declare function PieChart({ data, size, donut, style }: PieChartProps): JSX.Element; -export {}; -//# sourceMappingURL=chart-primitives.d.ts.map \ No newline at end of file diff --git a/src/crates/assembly/core/builtin_skills/openbitfun-canvas/sdk/collapsible-section.d.ts b/src/crates/assembly/core/builtin_skills/openbitfun-canvas/sdk/collapsible-section.d.ts deleted file mode 100644 index 87b0ed9099..0000000000 --- a/src/crates/assembly/core/builtin_skills/openbitfun-canvas/sdk/collapsible-section.d.ts +++ /dev/null @@ -1,67 +0,0 @@ -/** - * Borderless disclosure row — chevron + structured header (title, optional - * leading slot, count, trailing slot) with a body that toggles open. Distilled - * from baby-glass `ContextTreeRow`'s lightweight list-row chrome (no card - * border, no background fill). - * - * For a bordered surface that collapses, use `` instead. - */ -import { type CSSProperties, type JSX, type ReactNode } from "react"; -export type CollapsibleSectionProps = { - /** Plain-text title rendered next to the disclosure chevron. */ - title: string; - /** - * Optional leading visual (e.g. ``) shown between the chevron and - * the title. - */ - leading?: ReactNode; - /** - * Optional small count rendered after the title (e.g. number of children). - */ - count?: number; - /** - * Optional trailing node, right-aligned (e.g. token readout, badge, button). - * Rendered with `t.text.tertiary` color hint via the wrapper; the slot can - * override. - */ - trailing?: ReactNode; - /** Body shown when expanded. */ - children?: ReactNode; - /** When true, the section starts expanded (uncontrolled). */ - defaultOpen?: boolean; - style?: CSSProperties; -}; -/** - * Borderless collapsible row with a structured header. Starts closed unless - * `defaultOpen` is set. - * - * Compose with `` in the `leading` slot for a colored category icon, - * and put a token readout / pill / button in `trailing`. Body content is - * indented under the row so nested `CollapsibleSection`s read as a tree. - * - * For a bordered, card-shaped collapsible surface, use `` - * instead — `CollapsibleSection` has no border or background and is meant to - * sit in a list of similar rows. - * - * @example - * ```tsx - * // Basic - * - * Messages go here. - * - * - * // With a colored category swatch + count + trailing token readout - * } - * trailing={12.3k} - * > - * - * Search results. - * - * - * ``` - */ -export declare function CollapsibleSection({ title, leading, count, trailing, children, defaultOpen, style }: CollapsibleSectionProps): JSX.Element; -//# sourceMappingURL=collapsible-section.d.ts.map \ No newline at end of file diff --git a/src/crates/assembly/core/builtin_skills/openbitfun-canvas/sdk/dag-layout.d.ts b/src/crates/assembly/core/builtin_skills/openbitfun-canvas/sdk/dag-layout.d.ts deleted file mode 100644 index 722e1a01a8..0000000000 --- a/src/crates/assembly/core/builtin_skills/openbitfun-canvas/sdk/dag-layout.d.ts +++ /dev/null @@ -1,102 +0,0 @@ -/** - * Pure layout math for directed acyclic graphs. Returns positioned node - * coordinates, edge anchor points, rank bounding boxes, and back-edge flags. - * Rendering is the caller's responsibility. - * - * Handles cycles gracefully: back-edges are detected via DFS, excluded from - * ranking, and flagged in the output so the caller can render them differently - * (e.g. dashed arcs). - */ -export type DAGLayoutOptions = { - /** Nodes to lay out. Only `id` is required. */ - nodes: Array<{ - id: string; - }>; - /** Directed edges. */ - edges: Array<{ - from: string; - to: string; - }>; - /** Flow direction. Default `"vertical"` (top-to-bottom). */ - direction?: "vertical" | "horizontal"; - /** Node box width in px. Default 160. */ - nodeWidth?: number; - /** Node box height in px. Default 40. */ - nodeHeight?: number; - /** Gap between ranks (layers) in px. Default 64. */ - rankGap?: number; - /** Gap between sibling nodes in the same rank in px. Default 48. */ - nodeGap?: number; - /** Padding around the bounding box in px. Default 24. */ - padding?: number; -}; -export type DAGLayoutNode = { - id: string; - /** Left edge of the node box. */ - x: number; - /** Top edge of the node box. */ - y: number; - /** Layer index (0 = root). */ - rank: number; - /** Position within the rank (0-indexed). */ - order: number; -}; -export type DAGLayoutEdge = { - from: string; - to: string; - /** Suggested source anchor point (center of the outgoing side). */ - sourceX: number; - sourceY: number; - /** Suggested target anchor point (center of the incoming side). */ - targetX: number; - targetY: number; - /** True when this edge was identified as a back-edge (part of a cycle). */ - isBackEdge: boolean; -}; -export type DAGLayoutRank = { - /** Rank index (0 = root). */ - rank: number; - /** Left edge of the rank bounding box. */ - x: number; - /** Top edge of the rank bounding box. */ - y: number; - /** Width of the rank bounding box. */ - width: number; - /** Height of the rank bounding box. */ - height: number; - /** Node ids in this rank, in order. */ - nodeIds: string[]; -}; -export type DAGLayoutResult = { - nodes: DAGLayoutNode[]; - edges: DAGLayoutEdge[]; - /** Bounding box per rank — useful for drawing layer bands. */ - ranks: DAGLayoutRank[]; - /** The direction used for this layout. */ - direction: "vertical" | "horizontal"; - /** Total width of the bounding box. */ - width: number; - /** Total height of the bounding box. */ - height: number; -}; -/** - * Compute a hierarchical layout for a directed graph. - * - * Returns node positions, edge anchor points, rank bounding boxes, and - * back-edge flags. The caller handles all rendering. - * - * @example - * ```ts - * const layout = computeDAGLayout({ - * nodes: [{ id: "a" }, { id: "b" }, { id: "c" }], - * edges: [{ from: "a", to: "b" }, { from: "b", to: "c" }], - * }); - * - * // layout.nodes[i].x / .y → position your own SVG/HTML elements - * // layout.edges[i].sourceX/Y, targetX/Y → draw lines between them - * // layout.edges[i].isBackEdge → style cycle edges differently - * // layout.ranks[i] → draw layer bands behind each rank - * ``` - */ -export declare function computeDAGLayout(options: DAGLayoutOptions): DAGLayoutResult; -//# sourceMappingURL=dag-layout.d.ts.map \ No newline at end of file diff --git a/src/crates/assembly/core/builtin_skills/openbitfun-canvas/sdk/diff-view.d.ts b/src/crates/assembly/core/builtin_skills/openbitfun-canvas/sdk/diff-view.d.ts deleted file mode 100644 index 8457bcd8a6..0000000000 --- a/src/crates/assembly/core/builtin_skills/openbitfun-canvas/sdk/diff-view.d.ts +++ /dev/null @@ -1,130 +0,0 @@ -/** - * Low-level diff primitives for the canvas SDK. - * - * The canvas diff surface is intentionally minimal — two components that - * compose with the generic `Card` / `CardHeader` / `CardBody` / `Pill` / - * `Text` primitives to build any diff layout an agent can imagine: - * - * - `DiffView` — a monospaced, syntax-highlighted unified diff renderer. - * Drops into any container (a `Card`, a table cell, a bare layout, - * nothing at all). No card chrome, no header, no path display. Pass - * `path` to auto-detect the language for highlighting, or `language` - * to override. - * - * - `DiffStats` — the canonical `+N` green / `-N` red glyph pair. Use - * it anywhere a small "added/deleted" summary makes sense — in a - * `CardHeader`'s `trailing` slot, next to a filename in a file tree, - * inside a status row, etc. - * - * For file-level metadata the preferred composition is to use the - * generic `Card` family: - * - * ```tsx - * - * }> - * src/utils.ts - * - * - * - * - * - * ``` - */ -import type { CSSProperties, JSX } from "react"; -export type DiffStatsProps = { - additions?: number; - deletions?: number; - style?: CSSProperties; -}; -/** - * Inline `+N` / `-N` glyph pair. Green additions, red deletions, with - * tabular numerals so columns of stats line up. Renders nothing when - * both counts are zero. - * - * @example - * ```tsx - * }> - * src/utils.ts - * - * - * - * Refactor pass - * - * - * ``` - */ -export declare function DiffStats({ additions, deletions, style }: DiffStatsProps): JSX.Element | null; -export type DiffLineType = "added" | "removed" | "unchanged"; -export type DiffLineData = { - type: DiffLineType; - content: string; - lineNumber?: number; -}; -export type DiffViewProps = { - lines: DiffLineData[]; - /** - * File path used to infer the syntax-highlighting language from the - * extension (e.g. `"src/utils.ts"` → `typescript`). The most ergonomic - * way to enable highlighting — pass the same path you show in the - * enclosing card header. Unknown extensions silently render as plain - * text. - * - * If both `path` and `language` are provided, `language` wins. - */ - path?: string; - /** - * Explicit language override for syntax highlighting (e.g. - * `"typescript"`, `"python"`, `"tsx"`). Use this when no file path is - * available, when the path's extension is misleading, or when the - * content is a snippet rather than a real file. Accepts common - * aliases (`ts`, `py`, `rs`, `md`, etc.). Unknown languages silently - * fall back to plain text. - * - * Highlighting is applied per line, so multi-line constructs (block - * comments, template literals) may not colorize perfectly across line - * boundaries. For typical diff-sized inputs this is fine. - */ - language?: string; - /** Show line numbers in the gutter. Default `true`. */ - showLineNumbers?: boolean; - /** Color line numbers green/red for added/removed lines. Default `true`. */ - coloredLineNumbers?: boolean; - /** Show a 3px accent strip on the left edge for changed lines. Default `true`. */ - showAccentStrip?: boolean; - style?: CSSProperties; -}; -/** - * Unified diff body renderer with monospaced type, colored line - * backgrounds, line-number gutter, accent strip, and optional Shiki - * syntax highlighting. - * - * `DiffView` does not provide any surrounding chrome — place it inside - * a `Card` + `CardBody` (with `padding: 0`) when you want the standard - * bordered "file diff" look, or drop it anywhere else if you want the - * bare renderer. - * - * Pass `path` to enable syntax highlighting from the file extension. - * - * @example - * ```tsx - * - * }> - * src/utils.ts - * - * - * - * - * - * ``` - */ -export declare function DiffView({ lines, path, language, showLineNumbers, coloredLineNumbers, showAccentStrip, style }: DiffViewProps): JSX.Element; -//# sourceMappingURL=diff-view.d.ts.map \ No newline at end of file diff --git a/src/crates/assembly/core/builtin_skills/openbitfun-canvas/sdk/form-primitives.d.ts b/src/crates/assembly/core/builtin_skills/openbitfun-canvas/sdk/form-primitives.d.ts deleted file mode 100644 index 7b30654c27..0000000000 --- a/src/crates/assembly/core/builtin_skills/openbitfun-canvas/sdk/form-primitives.d.ts +++ /dev/null @@ -1,195 +0,0 @@ -/** - * Form primitives for `openbitfun/canvas`. Provides themed, controlled form controls - * for interactive canvas apps with persistent state. All `onChange` callbacks - * receive the **value directly** (not a DOM event), so they pair naturally - * with `useCanvasState`: - * - * ```tsx - * const [name, setName] = useCanvasState("name", ""); - * - * ``` - */ -import { type CSSProperties, type JSX, type ReactNode } from "react"; -export type TextInputProps = { - value?: string; - /** Called with the new string value on every keystroke. */ - onChange?: (value: string) => void; - placeholder?: string; - disabled?: boolean; - type?: "text" | "email" | "password" | "number" | "url" | "search"; - style?: CSSProperties; -}; -/** - * Single-line text input (28px height). Use for names, titles, search - * queries, and short text fields. - * - * `onChange` receives the **string value**, not a DOM event — this pairs - * directly with `useCanvasState` setters. - * - * @example - * ```tsx - * const [name, setName] = useCanvasState("name", ""); - * - * - * ``` - */ -export declare function TextInput({ value, onChange, placeholder, disabled, type, style }: TextInputProps): JSX.Element; -export type TextAreaProps = { - value?: string; - /** Called with the new string value on every keystroke. */ - onChange?: (value: string) => void; - placeholder?: string; - disabled?: boolean; - /** Minimum visible rows. Defaults to 3. */ - rows?: number; - style?: CSSProperties; -}; -/** - * Multi-line text input that auto-resizes to fit its content. - * Use for notes, descriptions, comments, and multi-line text fields. - * - * The textarea grows as the user types. Set `rows` for the minimum visible - * height (defaults to 3). Override with `style={{ height: "100px" }}` for a - * fixed size. - * - * @example - * ```tsx - * const [notes, setNotes] = useCanvasState("notes", ""); - * - *