@webskill/sdk 0.2.6 → 0.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser.d.ts +2 -2
- package/dist/browser.js +1 -1
- package/dist/catalogComponents-C_V39rbF-B94i0fW7.js +129139 -0
- package/dist/{dist-BXpDDZpR.js → dist-BdOW8N4V.js} +398 -14
- package/dist/{dist-DWFDb1Ww.js → dist-CcMIUXeZ.js} +1 -1
- package/dist/{dist-DNSG9FqC.js → dist-CtBLBbEz.js} +1186 -123
- package/dist/dist-DxyxmXPU-DGC-dpXf.js +5621 -0
- package/dist/echarts-DhNm2ene.js +78816 -0
- package/dist/governance.d.ts +3 -3
- package/dist/governance.js +2 -2
- package/dist/{index-DRlYzdr2.d.ts → index-BHL5FWGw.d.ts} +2 -2
- package/dist/index-BNQNSDKg.d.ts +580 -0
- package/dist/{index-DJOha4b6.d.ts → index-BpIK7tJM.d.ts} +23 -5
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -2
- package/dist/jsonRenderRegistry-9GrWP_hE-CMkryt1H.js +2468 -0
- package/dist/mcp.d.ts +2 -2
- package/dist/mcp.js +1 -1
- package/dist/node.d.ts +3 -3
- package/dist/node.js +2 -2
- package/dist/openUiLibrary-B8-Cvou9-Cu1QZqoT.js +3785 -0
- package/dist/rolldown-runtime-BOF7iYI8.js +55 -0
- package/dist/testing.d.ts +1 -1
- package/dist/{types-CKm5G_eQ-krKWW8WV.d.ts → types-7fnqDVrf-BnRQjVU3.d.ts} +127 -2
- package/dist/ui-react.d.ts +138 -2
- package/dist/ui-react.js +6935 -3
- package/dist/ui-vue.d.ts +1 -1
- package/dist/ui-vue.js +1 -1
- package/dist/ui.d.ts +3 -203
- package/dist/ui.js +3 -3
- package/dist/webskillLitCatalog-CNaUpasU-CfSRvqCZ.js +1601 -0
- package/package.json +2 -1
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
|
|
3
|
+
//#region \0rolldown/runtime.js
|
|
4
|
+
var __create = Object.create;
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __esmMin = (fn, res, err) => () => {
|
|
11
|
+
if (err) throw err[0];
|
|
12
|
+
try {
|
|
13
|
+
return fn && (res = fn(fn = 0)), res;
|
|
14
|
+
} catch (e) {
|
|
15
|
+
throw err = [e], e;
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
|
|
19
|
+
var __exportAll = (all, no_symbols) => {
|
|
20
|
+
let target = {};
|
|
21
|
+
for (var name in all) {
|
|
22
|
+
__defProp(target, name, {
|
|
23
|
+
get: all[name],
|
|
24
|
+
enumerable: true
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
if (!no_symbols) {
|
|
28
|
+
__defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
29
|
+
}
|
|
30
|
+
return target;
|
|
31
|
+
};
|
|
32
|
+
var __copyProps = (to, from, except, desc) => {
|
|
33
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
34
|
+
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
35
|
+
key = keys[i];
|
|
36
|
+
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
37
|
+
__defProp(to, key, {
|
|
38
|
+
get: ((k) => from[k]).bind(null, key),
|
|
39
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return to;
|
|
45
|
+
};
|
|
46
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
47
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
48
|
+
value: mod,
|
|
49
|
+
enumerable: true
|
|
50
|
+
}) : target, mod));
|
|
51
|
+
var __toCommonJS = (mod) => __hasOwnProp.call(mod, "module.exports") ? mod["module.exports"] : __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
52
|
+
var __require = /* #__PURE__ */ (() => createRequire(import.meta.url))();
|
|
53
|
+
|
|
54
|
+
//#endregion
|
|
55
|
+
export { __require as a, __reExport as i, __esmMin as n, __toCommonJS as o, __exportAll as r, __toESM as s, __commonJSMin as t };
|
package/dist/testing.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as LlmClient, d as LlmResponse, f as LlmStreamEvent, h as MemoryStore, l as LlmCompleteInput, n as ArtifactStore, o as InteractionRequest, s as InteractionResponse, t as Artifact, v as UiBridge } from "./types-
|
|
1
|
+
import { c as LlmClient, d as LlmResponse, f as LlmStreamEvent, h as MemoryStore, l as LlmCompleteInput, n as ArtifactStore, o as InteractionRequest, s as InteractionResponse, t as Artifact, v as UiBridge } from "./types-7fnqDVrf-BnRQjVU3.js";
|
|
2
2
|
import { a as loadGoogleConfigFromEnv, i as loadAnthropicConfigFromEnv, n as LlmEnvConfig, o as loadLlmConfigFromEnv, r as ProviderEnvConfig } from "./env-BPUBZCwJ-4jat_SVG.js";
|
|
3
3
|
//#region ../runtime/dist/testing.d.ts
|
|
4
4
|
//#region src/llm/mockLlmClient.d.ts
|
|
@@ -405,7 +405,7 @@ declare function escapeXml(text: string): string;
|
|
|
405
405
|
declare function renderAvailableSkillsXml(catalog: SkillCatalog): string;
|
|
406
406
|
declare const xmlRenderer: CatalogRenderer;
|
|
407
407
|
//#endregion
|
|
408
|
-
//#region ../runtime/dist/types-
|
|
408
|
+
//#region ../runtime/dist/types-7fnqDVrf.d.ts
|
|
409
409
|
//#region src/llm/streamTypes.d.ts
|
|
410
410
|
/** 流式 LLM 事件(OpenAI SSE / Vercel fullStream 统一映射) */
|
|
411
411
|
type LlmStreamEvent = {
|
|
@@ -565,6 +565,125 @@ interface RenderResultRequest {
|
|
|
565
565
|
blocks: RenderBlock[];
|
|
566
566
|
artifacts?: Artifact[];
|
|
567
567
|
}
|
|
568
|
+
/** A user action exposed by a generative UI surface. @experimental */
|
|
569
|
+
interface UiSurfaceAction {
|
|
570
|
+
id: string;
|
|
571
|
+
label: string;
|
|
572
|
+
intent: 'submit' | 'cancel' | 'select' | 'download' | 'refresh';
|
|
573
|
+
disabled?: boolean;
|
|
574
|
+
/** Requests that the producing run waits for this action before continuing. @experimental */
|
|
575
|
+
awaitResponse?: boolean;
|
|
576
|
+
/** Runtime-generated action capability; model-provided values are never trusted. @experimental */
|
|
577
|
+
nonce?: string;
|
|
578
|
+
}
|
|
579
|
+
/** A runtime-owned request for a user action on a rendered UI surface. @experimental */
|
|
580
|
+
interface UiSurfaceActionRequest {
|
|
581
|
+
runId: string;
|
|
582
|
+
surfaceId: string;
|
|
583
|
+
actionId: string;
|
|
584
|
+
intent: UiSurfaceAction['intent'];
|
|
585
|
+
nonce: string;
|
|
586
|
+
}
|
|
587
|
+
/** A structured action returned by a renderer to the waiting run. @experimental */
|
|
588
|
+
interface UiSurfaceActionResponse extends UiSurfaceActionRequest {
|
|
589
|
+
value?: Record<string, unknown>;
|
|
590
|
+
cancelled?: boolean;
|
|
591
|
+
}
|
|
592
|
+
/** Serializable draft values for forms that belong to one interrupted run. @experimental */
|
|
593
|
+
type UiSurfaceDrafts = Record<string, Record<string, unknown>>;
|
|
594
|
+
/** A structured form field rendered inside a generative UI surface. @experimental */
|
|
595
|
+
interface UiSurfaceFormField {
|
|
596
|
+
name: string;
|
|
597
|
+
label: string;
|
|
598
|
+
type: 'text' | 'number' | 'date' | 'textarea' | 'select' | 'multi-select' | 'toggle' | 'file';
|
|
599
|
+
required?: boolean;
|
|
600
|
+
description?: string;
|
|
601
|
+
defaultValue?: unknown;
|
|
602
|
+
options?: Array<{
|
|
603
|
+
label: string;
|
|
604
|
+
value: unknown;
|
|
605
|
+
}>;
|
|
606
|
+
}
|
|
607
|
+
/** Framework-neutral generative UI surface. @experimental */
|
|
608
|
+
type UiSurface = {
|
|
609
|
+
kind: 'form';
|
|
610
|
+
id: string;
|
|
611
|
+
title?: string;
|
|
612
|
+
fields: UiSurfaceFormField[];
|
|
613
|
+
actions: UiSurfaceAction[];
|
|
614
|
+
} | {
|
|
615
|
+
kind: 'chart';
|
|
616
|
+
id: string;
|
|
617
|
+
chart: ChartSpec;
|
|
618
|
+
actions?: UiSurfaceAction[];
|
|
619
|
+
} | {
|
|
620
|
+
kind: 'table';
|
|
621
|
+
id: string;
|
|
622
|
+
columns: string[];
|
|
623
|
+
rows: unknown[][];
|
|
624
|
+
actions?: UiSurfaceAction[];
|
|
625
|
+
} | {
|
|
626
|
+
kind: 'metric';
|
|
627
|
+
id: string;
|
|
628
|
+
label: string;
|
|
629
|
+
value: string | number;
|
|
630
|
+
trend?: 'up' | 'down' | 'neutral';
|
|
631
|
+
} | {
|
|
632
|
+
kind: 'file';
|
|
633
|
+
id: string;
|
|
634
|
+
path: string;
|
|
635
|
+
mimeType?: string;
|
|
636
|
+
size?: number;
|
|
637
|
+
actions?: UiSurfaceAction[];
|
|
638
|
+
} | {
|
|
639
|
+
kind: 'custom';
|
|
640
|
+
id: string;
|
|
641
|
+
component: string;
|
|
642
|
+
props: unknown;
|
|
643
|
+
actions?: UiSurfaceAction[];
|
|
644
|
+
};
|
|
645
|
+
/** A bounded mutation applied to an existing UI surface. @experimental */
|
|
646
|
+
interface UiSurfacePatch {
|
|
647
|
+
op: 'replace' | 'merge' | 'append';
|
|
648
|
+
path: string;
|
|
649
|
+
value: unknown;
|
|
650
|
+
}
|
|
651
|
+
/** Incremental lifecycle event for a framework-neutral generative UI surface. @experimental */
|
|
652
|
+
type UiSurfaceEvent = {
|
|
653
|
+
runId?: string;
|
|
654
|
+
} & ({
|
|
655
|
+
type: 'open';
|
|
656
|
+
surface: UiSurface;
|
|
657
|
+
} | {
|
|
658
|
+
type: 'patch';
|
|
659
|
+
id: string;
|
|
660
|
+
revision: number;
|
|
661
|
+
operations: UiSurfacePatch[];
|
|
662
|
+
} | {
|
|
663
|
+
type: 'complete';
|
|
664
|
+
id: string;
|
|
665
|
+
revision: number;
|
|
666
|
+
} | {
|
|
667
|
+
type: 'error';
|
|
668
|
+
id: string;
|
|
669
|
+
code: string;
|
|
670
|
+
message: string;
|
|
671
|
+
} | {
|
|
672
|
+
type: 'cancel';
|
|
673
|
+
id: string;
|
|
674
|
+
});
|
|
675
|
+
/** Persisted state of a generative UI surface. @experimental */
|
|
676
|
+
interface UiSurfaceSnapshot {
|
|
677
|
+
surface: UiSurface;
|
|
678
|
+
revision: number;
|
|
679
|
+
status: 'active' | 'complete' | 'error' | 'cancelled';
|
|
680
|
+
/** Immutable producing run; supplied on open to support session persistence and replay. */
|
|
681
|
+
runId?: string;
|
|
682
|
+
error?: {
|
|
683
|
+
code: string;
|
|
684
|
+
message: string;
|
|
685
|
+
};
|
|
686
|
+
}
|
|
568
687
|
/** @stable */
|
|
569
688
|
interface UiBridge {
|
|
570
689
|
request(input: InteractionRequest): Promise<InteractionResponse>;
|
|
@@ -577,6 +696,12 @@ interface UiBridge {
|
|
|
577
696
|
}): Promise<void>;
|
|
578
697
|
/** 定义即可,阶段 7 消费 */
|
|
579
698
|
renderResult?(input: RenderResultRequest): Promise<void>;
|
|
699
|
+
/** Framework-neutral generative UI surface stream. @experimental */
|
|
700
|
+
renderSurface?(event: UiSurfaceEvent): Promise<void>;
|
|
701
|
+
/** Waits for an action declared with awaitResponse; optional for compatibility with legacy bridges. @experimental */
|
|
702
|
+
requestSurfaceAction?(input: UiSurfaceActionRequest): Promise<UiSurfaceActionResponse>;
|
|
703
|
+
/** Best-effort cleanup when a surface action wait times out or is cancelled. @experimental */
|
|
704
|
+
cancelSurfaceAction?(nonce: string): void | Promise<void>;
|
|
580
705
|
/** 流式文本增量(流式 LLM 路径下由 AgentLoop 转发) */
|
|
581
706
|
onTextDelta?(runId: string, delta: string): Promise<void> | void;
|
|
582
707
|
}
|
|
@@ -616,4 +741,4 @@ interface MemoryStore {
|
|
|
616
741
|
transaction?<T>(scope: string, fn: (inner: MemoryStore) => Promise<T>): Promise<T>;
|
|
617
742
|
}
|
|
618
743
|
//#endregion
|
|
619
|
-
export {
|
|
744
|
+
export { SkillSource as $, DEFAULT_ARCHIVE_LIMITS as A, SKILL_NAME_PATTERN as B, UiSurfaceDrafts as C, renderCatalogJson as Ct, UiSurfaceSnapshot as D, validateSkills as Dt, UiSurfacePatch as E, unzipWithLimits as Et, MemoryFS as F, SkillDocument as G, SkillCatalog as H, RemoteUrlPolicy as I, SkillLocation as J, SkillInstallSource as K, SKILLS_LOCKFILE as L, FileStat as M, FileSystemProvider as N, ArchiveLimits as O, verifyManifest as Ot, JsonSchema as P, SkillReader as Q, SKILL_MANIFEST_FILE as R, UiSurfaceActionResponse as S, renderAvailableSkillsXml as St, UiSurfaceFormField as T, resolveInsideRoot as Tt, SkillCatalogEntry as U, SKILL_PACK_FILE as V, SkillDiscovery as W, SkillMetadata as X, SkillManifest as Y, SkillPackManifest as Z, RenderResultRequest as _, messageOf as _t, InteractionPolicy as a, assertRemoteUrlAllowed as at, UiSurfaceAction as b, parseSkillPackManifest as bt, LlmClient as c, buildCatalog as ct, LlmResponse as d, checkSkillRules as dt, SkillsLockfile as et, LlmStreamEvent as f, computeDigest as ft, RenderBlock as g, jsonRenderer as gt, MemoryStore as h, isValidSkillName as ht, FormField as i, WebSkillErrorCode as it, DiscoveryResult as j, CatalogRenderer as k, xmlRenderer as kt, LlmCompleteInput as l, buildManifest as lt, LlmToolSpec as m, exportSkills as mt, ArtifactStore as n, VerifyResult as nt, InteractionRequest as o, assertSafePathSegment as ot, LlmToolCall as p, escapeXml as pt, SkillIssue as q, ChartSpec as r, WebSkillError as rt, InteractionResponse as s, atomicWriteText as st, Artifact as t, ValidationReport as tt, LlmMessage as u, checkDependencyCycles as ut, UiBridge as v, normalizePath as vt, UiSurfaceEvent as w, resolveArchiveLimits as wt, UiSurfaceActionRequest as x, readResponseWithLimit as xt, UiSurface as y, parseSkillMarkdown as yt, SKILL_NAME_MAX_LENGTH as z };
|
package/dist/ui-react.d.ts
CHANGED
|
@@ -1,6 +1,21 @@
|
|
|
1
|
-
import { _ as RenderResultRequest, o as InteractionRequest, s as InteractionResponse, v as UiBridge } from "./types-
|
|
1
|
+
import { C as UiSurfaceDrafts, D as UiSurfaceSnapshot, S as UiSurfaceActionResponse, _ as RenderResultRequest, b as UiSurfaceAction, o as InteractionRequest, s as InteractionResponse, v as UiBridge, w as UiSurfaceEvent, x as UiSurfaceActionRequest } from "./types-7fnqDVrf-BnRQjVU3.js";
|
|
2
|
+
import { R as UiSpecNode } from "./index-BNQNSDKg.js";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import { ComponentType, ReactNode } from "react";
|
|
2
5
|
//#region ../ui-react/dist/index.d.ts
|
|
6
|
+
//#region src/surfaceStore.d.ts
|
|
7
|
+
/** Observable, revision-checked snapshot store for framework-neutral UI surfaces. @experimental */
|
|
8
|
+
declare class UiSurfaceStore {
|
|
9
|
+
#private;
|
|
10
|
+
subscribe: (listener: () => void) => (() => void);
|
|
11
|
+
get snapshots(): readonly UiSurfaceSnapshot[];
|
|
12
|
+
apply(event: UiSurfaceEvent): void;
|
|
13
|
+
}
|
|
14
|
+
//#endregion
|
|
3
15
|
//#region src/bridgeState.d.ts
|
|
16
|
+
interface ReactBridgeStateOptions {
|
|
17
|
+
onSurfaceDraftChange?(runId: string, surfaceId: string, value: Record<string, unknown>): Promise<void> | void;
|
|
18
|
+
}
|
|
4
19
|
/**
|
|
5
20
|
* React 桥接状态:UiBridge 实现 + useSyncExternalStore 兼容订阅。
|
|
6
21
|
* 应用创建实例传给 Runtime 与组件:<InteractionForm bridge={bridge} />。
|
|
@@ -8,10 +23,17 @@ import { _ as RenderResultRequest, o as InteractionRequest, s as InteractionResp
|
|
|
8
23
|
declare class ReactBridgeState implements UiBridge {
|
|
9
24
|
#private;
|
|
10
25
|
pending: InteractionRequest | null;
|
|
26
|
+
pendingSurfaceAction: UiSurfaceActionRequest | null;
|
|
11
27
|
latestResult: RenderResultRequest | null;
|
|
28
|
+
readonly surfaceStore: UiSurfaceStore;
|
|
12
29
|
/** 当前流式 runId(并发 run 隔离:新 runId 重置文本) */
|
|
13
30
|
streamingRunId: string | null;
|
|
14
31
|
streamingText: string;
|
|
32
|
+
constructor(options?: ReactBridgeStateOptions);
|
|
33
|
+
get surfaceSnapshots(): readonly UiSurfaceSnapshot[];
|
|
34
|
+
surfaceDrafts(runId: string): UiSurfaceDrafts;
|
|
35
|
+
restoreSurfaceDrafts(runId: string, drafts: UiSurfaceDrafts | undefined): void;
|
|
36
|
+
setSurfaceDraft(runId: string, surfaceId: string, value: Record<string, unknown>): void;
|
|
15
37
|
/** React useSyncExternalStore 兼容订阅 */
|
|
16
38
|
subscribe: (listener: () => void) => (() => void);
|
|
17
39
|
request(input: InteractionRequest): Promise<InteractionResponse>;
|
|
@@ -20,6 +42,11 @@ declare class ReactBridgeState implements UiBridge {
|
|
|
20
42
|
/** runtime 交互超时/取消:卸载表单并以 cancelled resolve pending Promise(防悬挂 + 残留) */
|
|
21
43
|
cancel(id: string): void;
|
|
22
44
|
renderResult(input: RenderResultRequest): Promise<void>;
|
|
45
|
+
renderSurface(event: UiSurfaceEvent): Promise<void>;
|
|
46
|
+
requestSurfaceAction(input: UiSurfaceActionRequest): Promise<UiSurfaceActionResponse>;
|
|
47
|
+
/** Resolves exactly one pending action capability; stale or duplicate nonces are ignored. */
|
|
48
|
+
resolveSurfaceAction(response: UiSurfaceActionResponse): boolean;
|
|
49
|
+
cancelSurfaceAction(nonce: string): void;
|
|
23
50
|
onTextDelta(runId: string, delta: string): Promise<void>;
|
|
24
51
|
}
|
|
25
52
|
//#endregion
|
|
@@ -41,4 +68,113 @@ declare function StreamingText({ bridge }: {
|
|
|
41
68
|
bridge: ReactBridgeState;
|
|
42
69
|
}): import("react").JSX.Element | null;
|
|
43
70
|
//#endregion
|
|
44
|
-
|
|
71
|
+
//#region src/surfaceRegistry.d.ts
|
|
72
|
+
interface CustomSurfaceActionEvent {
|
|
73
|
+
surfaceId: string;
|
|
74
|
+
actionId: string;
|
|
75
|
+
intent: UiSurfaceAction['intent'];
|
|
76
|
+
nonce?: string;
|
|
77
|
+
value?: Record<string, unknown>;
|
|
78
|
+
}
|
|
79
|
+
interface RegisteredSurfaceProps<Props> {
|
|
80
|
+
surfaceId: string;
|
|
81
|
+
props: Props;
|
|
82
|
+
actions: readonly UiSurfaceAction[];
|
|
83
|
+
onAction?(event: CustomSurfaceActionEvent): void;
|
|
84
|
+
}
|
|
85
|
+
interface SurfaceRegistration<Props> {
|
|
86
|
+
schema: z.ZodType<Props>;
|
|
87
|
+
component: ComponentType<RegisteredSurfaceProps<Props>>;
|
|
88
|
+
}
|
|
89
|
+
interface RegisteredSurface<Props> {
|
|
90
|
+
schema: z.ZodType<Props>;
|
|
91
|
+
component: ComponentType<RegisteredSurfaceProps<Props>>;
|
|
92
|
+
}
|
|
93
|
+
/** Explicit allowlist for Native custom surfaces. @experimental */
|
|
94
|
+
declare class SurfaceRegistry {
|
|
95
|
+
#private;
|
|
96
|
+
register<Props>(name: string, registration: SurfaceRegistration<Props>): this;
|
|
97
|
+
get(name: string): RegisteredSurface<unknown> | undefined;
|
|
98
|
+
}
|
|
99
|
+
//#endregion
|
|
100
|
+
//#region src/components/UiSurfaceList.d.ts
|
|
101
|
+
interface UiSurfaceActionEvent {
|
|
102
|
+
runId?: string;
|
|
103
|
+
surfaceId: string;
|
|
104
|
+
actionId: string;
|
|
105
|
+
intent: UiSurfaceAction['intent'];
|
|
106
|
+
nonce?: string;
|
|
107
|
+
value?: Record<string, unknown>;
|
|
108
|
+
}
|
|
109
|
+
interface UiSurfaceListProps {
|
|
110
|
+
bridge: ReactBridgeState;
|
|
111
|
+
/** Limits the live renderer to a producing run; omit to render the full store. */
|
|
112
|
+
runId?: string;
|
|
113
|
+
registry?: SurfaceRegistry;
|
|
114
|
+
onAction?(event: UiSurfaceActionEvent): void;
|
|
115
|
+
}
|
|
116
|
+
interface UiSurfaceSnapshotListProps {
|
|
117
|
+
snapshots: readonly UiSurfaceSnapshot[];
|
|
118
|
+
registry?: SurfaceRegistry;
|
|
119
|
+
onAction?(event: UiSurfaceActionEvent): void;
|
|
120
|
+
drafts?: UiSurfaceDrafts;
|
|
121
|
+
onDraftChange?(event: {
|
|
122
|
+
runId: string;
|
|
123
|
+
surfaceId: string;
|
|
124
|
+
value: Record<string, unknown>;
|
|
125
|
+
}): void;
|
|
126
|
+
}
|
|
127
|
+
/** Renders Native surface snapshots, including persisted assistant-message history. @experimental */
|
|
128
|
+
declare function UiSurfaceSnapshotList({ snapshots, registry, onAction, drafts, onDraftChange }: UiSurfaceSnapshotListProps): import("react").JSX.Element | null;
|
|
129
|
+
/** Renders the current Native surface snapshots exposed by a React bridge. @experimental */
|
|
130
|
+
declare function UiSurfaceList({ bridge, runId, registry, onAction }: UiSurfaceListProps): import("react").JSX.Element;
|
|
131
|
+
//#endregion
|
|
132
|
+
//#region src/catalog/NativeSpecSurface.d.ts
|
|
133
|
+
/** native registry 覆盖的组件名;与 catalog 的一致性由测试强制(21 号文档 §5.2) */
|
|
134
|
+
declare const NATIVE_SPEC_COMPONENTS: readonly string[];
|
|
135
|
+
interface NativeSpecSurfaceProps {
|
|
136
|
+
surfaceId: string;
|
|
137
|
+
spec: UiSpecNode;
|
|
138
|
+
actions: readonly UiSurfaceAction[];
|
|
139
|
+
registry?: SurfaceRegistry;
|
|
140
|
+
onAction?(event: CustomSurfaceActionEvent): void;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Native 档的 catalog registry:把声明树渲染成 ui-kit 组件。
|
|
144
|
+
* 越界组件名不静默降级,渲染成英文错误行(21 号文档 §8 第 5 条)。
|
|
145
|
+
*/
|
|
146
|
+
declare function NativeSpecSurface({ surfaceId, spec, actions, registry, onAction }: NativeSpecSurfaceProps): import("react").JSX.Element;
|
|
147
|
+
//#endregion
|
|
148
|
+
//#region src/catalog/JsonRenderSpecSurface.d.ts
|
|
149
|
+
interface JsonRenderSpecSurfaceProps {
|
|
150
|
+
spec: UiSpecNode;
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* `vercel` 档:同一份 catalog 声明树交给 json-render 的 Registry 渲染。
|
|
154
|
+
* `@json-render/*` 是 optional peer,未安装时给出英文说明而不是空白。
|
|
155
|
+
*/
|
|
156
|
+
declare function JsonRenderSpecSurface({ spec }: JsonRenderSpecSurfaceProps): import("react").JSX.Element | null;
|
|
157
|
+
//#endregion
|
|
158
|
+
//#region src/catalog/OpenUiSpecSurface.d.ts
|
|
159
|
+
interface OpenUiSpecSurfaceProps {
|
|
160
|
+
spec: UiSpecNode;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* `openui` 档:同一份 catalog 声明树经 openui-lang 交给 OpenUI 的 Renderer。
|
|
164
|
+
* `@openuidev/react-lang` 是 optional peer,未安装时给出英文说明而不是空白。
|
|
165
|
+
*/
|
|
166
|
+
declare function OpenUiSpecSurface({ spec }: OpenUiSpecSurfaceProps): import("react").JSX.Element | null;
|
|
167
|
+
//#endregion
|
|
168
|
+
//#region src/catalog/catalogComponents.d.ts
|
|
169
|
+
type CatalogNodeProps = {
|
|
170
|
+
props: Record<string, unknown>;
|
|
171
|
+
children?: ReactNode;
|
|
172
|
+
};
|
|
173
|
+
/**
|
|
174
|
+
* catalog 16 个组件的展示实现:json-render 与 OpenUI 两档共用同一份,
|
|
175
|
+
* 避免"一个 catalog、多套 registry"退化成多套各自演进的视觉。
|
|
176
|
+
* 交互(表单值收集 / action 回传)由各档的宿主组件负责。
|
|
177
|
+
*/
|
|
178
|
+
declare const catalogComponentImpls: Record<string, (input: CatalogNodeProps) => ReactNode>;
|
|
179
|
+
//#endregion
|
|
180
|
+
export { type CatalogNodeProps, type CustomSurfaceActionEvent, InteractionForm, JsonRenderSpecSurface, type JsonRenderSpecSurfaceProps, NATIVE_SPEC_COMPONENTS, NativeSpecSurface, type NativeSpecSurfaceProps, OpenUiSpecSurface, type OpenUiSpecSurfaceProps, ReactBridgeState, type RegisteredSurfaceProps, ResultBlocks, StreamingText, type SurfaceRegistration, SurfaceRegistry, type UiSurfaceActionEvent, UiSurfaceList, type UiSurfaceListProps, UiSurfaceSnapshotList, type UiSurfaceSnapshotListProps, UiSurfaceStore, catalogComponentImpls };
|