@webskill/sdk 0.0.5 → 0.0.6
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 +33 -2
- package/dist/browser.js +106 -2
- package/dist/{dist-Ixnb-hNR.js → dist-33_zuOCm.js} +82 -2
- package/dist/{dist-BM-VcQ90.js → dist-BQruQ9Hv.js} +212 -2
- package/dist/{dist-D405AlPD.js → dist-nXiR40hi.js} +690 -411
- package/dist/governance.d.ts +4 -3
- package/dist/governance.js +13 -4
- package/dist/{index-BQDc-U1x.d.ts → index-DCifjtJx.d.ts} +105 -4
- package/dist/{index-aEple804.d.ts → index-vi7GPemR.d.ts} +5 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/mcp.d.ts +1 -1
- package/dist/mcp.js +1 -1
- package/dist/node.d.ts +2 -2
- package/dist/node.js +2 -2
- package/dist/ui-react.d.ts +2 -2
- package/dist/ui-react.js +12 -2
- package/dist/ui-vue.d.ts +2 -2
- package/dist/ui-vue.js +9 -2
- package/dist/ui.d.ts +15 -3
- package/dist/ui.js +3 -3
- package/package.json +1 -1
package/dist/governance.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { d as SkillManager } from "./index-
|
|
1
|
+
import { Et as UiBridge, L as LlmClient, Xt as FileSystemProvider, an as SkillCatalogEntry, dn as SkillManifest, kt as WebSkillRuntime, pt as RuntimeRun, sn as SkillDocument, z as LlmMessage } from "./index-DCifjtJx.js";
|
|
2
|
+
import { d as SkillManager } from "./index-vi7GPemR.js";
|
|
3
3
|
//#region ../governance/dist/index.d.ts
|
|
4
4
|
//#region src/types.d.ts
|
|
5
5
|
type CandidateStatus = 'draft' | 'pending-review' | 'approved' | 'published' | 'rejected';
|
|
@@ -374,10 +374,11 @@ declare class SimilarityDetector {
|
|
|
374
374
|
}
|
|
375
375
|
//#endregion
|
|
376
376
|
//#region src/scoring/dependencyGraph.d.ts
|
|
377
|
-
/** 技能引用依赖图(references/ 中引用其他技能的声明关系) */
|
|
378
377
|
declare class DependencyGraph {
|
|
379
378
|
#private;
|
|
380
379
|
addDependency(from: string, to: string): void;
|
|
380
|
+
/** 从 frontmatter dependencies 声明建图(0.0.6 装配函数;只收录 Catalog 内技能之间的边) */
|
|
381
|
+
static buildFromCatalog(entries: SkillCatalogEntry[], documents: SkillDocument[]): DependencyGraph;
|
|
381
382
|
dependenciesOf(name: string): string[];
|
|
382
383
|
dependentsOf(name: string): string[];
|
|
383
384
|
}
|
package/dist/governance.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as NodeFS } from "./dist-
|
|
1
|
+
import { J as WebSkillError, lt as resolveInsideRoot, nt as isValidSkillName, ut as validateSkills } from "./dist-nXiR40hi.js";
|
|
2
|
+
import { i as NodeFS } from "./dist-33_zuOCm.js";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { mkdtemp } from "node:fs/promises";
|
|
5
5
|
import { tmpdir } from "node:os";
|
|
@@ -731,8 +731,7 @@ var SimilarityDetector = class {
|
|
|
731
731
|
for (const skill of existing) if (jaccardSimilarity(description, skill.description) >= this.#threshold) return skill.name;
|
|
732
732
|
}
|
|
733
733
|
};
|
|
734
|
-
|
|
735
|
-
var DependencyGraph = class {
|
|
734
|
+
var DependencyGraph = class DependencyGraph {
|
|
736
735
|
#edges = /* @__PURE__ */ new Map();
|
|
737
736
|
addDependency(from, to) {
|
|
738
737
|
if (from === to) return;
|
|
@@ -740,6 +739,16 @@ var DependencyGraph = class {
|
|
|
740
739
|
set.add(to);
|
|
741
740
|
this.#edges.set(from, set);
|
|
742
741
|
}
|
|
742
|
+
/** 从 frontmatter dependencies 声明建图(0.0.6 装配函数;只收录 Catalog 内技能之间的边) */
|
|
743
|
+
static buildFromCatalog(entries, documents) {
|
|
744
|
+
const names = new Set(entries.map((e) => e.name));
|
|
745
|
+
const graph = new DependencyGraph();
|
|
746
|
+
for (const doc of documents) {
|
|
747
|
+
if (!names.has(doc.metadata.name)) continue;
|
|
748
|
+
for (const dep of doc.metadata.dependencies ?? []) if (names.has(dep)) graph.addDependency(doc.metadata.name, dep);
|
|
749
|
+
}
|
|
750
|
+
return graph;
|
|
751
|
+
}
|
|
743
752
|
dependenciesOf(name) {
|
|
744
753
|
return [...this.#edges.get(name) ?? []].sort();
|
|
745
754
|
}
|
|
@@ -156,6 +156,8 @@ interface SkillMetadata {
|
|
|
156
156
|
description: string;
|
|
157
157
|
license?: string;
|
|
158
158
|
version?: string;
|
|
159
|
+
/** 声明式依赖:精确技能名列表(无版本约束);缺依赖/循环依赖 → error 级校验 */
|
|
160
|
+
dependencies?: string[];
|
|
159
161
|
[key: string]: unknown;
|
|
160
162
|
}
|
|
161
163
|
interface SkillLocation {
|
|
@@ -215,7 +217,46 @@ declare function checkSkillRules(input: {
|
|
|
215
217
|
parseError?: WebSkillError;
|
|
216
218
|
scriptFileNames?: string[];
|
|
217
219
|
existingNames?: Set<string>;
|
|
220
|
+
/** 全库技能名集合(两趟扫描提供);提供时启用 dependencies 存在性校验 */
|
|
221
|
+
knownSkillNames?: Set<string>;
|
|
218
222
|
}): SkillIssue[];
|
|
223
|
+
/**
|
|
224
|
+
* 循环依赖检测(全量邻接表,discovery 两趟扫描第二趟调用)。
|
|
225
|
+
* 每个环只报一次(error 级,阻断进 Catalog);自引用视为长度 1 的环。
|
|
226
|
+
*/
|
|
227
|
+
declare function checkDependencyCycles(adjacency: Map<string, string[]>): {
|
|
228
|
+
issues: SkillIssue[];
|
|
229
|
+
/** 处于环上的技能名(调用方将其排除出 Catalog) */
|
|
230
|
+
involved: Set<string>;
|
|
231
|
+
};
|
|
232
|
+
//#endregion
|
|
233
|
+
//#region src/skill/skillPack.d.ts
|
|
234
|
+
/**
|
|
235
|
+
* 技能包集(skill pack)格式与打包逻辑(node/browser 共用单一来源):
|
|
236
|
+
* webskill.skill-pack.json { schemaVersion: 1, skills: [{ name, digest }] }
|
|
237
|
+
* <skill-a>/SKILL.md … webskill.skill-manifest.json
|
|
238
|
+
* <skill-b>/SKILL.md …
|
|
239
|
+
* fflate 环境无关;文件读取经 FileSystemProvider 抽象。
|
|
240
|
+
*/
|
|
241
|
+
/** 包级清单文件名(位于 zip 根,不参与各技能 digest) */
|
|
242
|
+
declare const SKILL_PACK_FILE = "webskill.skill-pack.json";
|
|
243
|
+
interface SkillPackManifest {
|
|
244
|
+
schemaVersion: 1;
|
|
245
|
+
skills: Array<{
|
|
246
|
+
name: string;
|
|
247
|
+
digest: string;
|
|
248
|
+
}>;
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* 多技能打包为单一 zip(包级清单 + 各技能目录含自身 manifest)。
|
|
252
|
+
* manifestBuilder 负责确保技能目录内 manifest 文件存在并返回之(digest 入包级清单)。
|
|
253
|
+
*/
|
|
254
|
+
declare function exportSkills(fs: FileSystemProvider, input: {
|
|
255
|
+
roots: string[];
|
|
256
|
+
manifestBuilder: (skillRoot: string) => Promise<SkillManifest>;
|
|
257
|
+
}): Promise<Uint8Array>;
|
|
258
|
+
/** 包级清单解析 + 形状校验;损坏 → INSTALL_FAILED(安装侧保证零残留) */
|
|
259
|
+
declare function parseSkillPackManifest(text: string): SkillPackManifest;
|
|
219
260
|
//#endregion
|
|
220
261
|
//#region src/skill/discovery.d.ts
|
|
221
262
|
interface DiscoveryResult {
|
|
@@ -590,6 +631,16 @@ interface InteractionResponse {
|
|
|
590
631
|
value?: unknown;
|
|
591
632
|
cancelled?: boolean;
|
|
592
633
|
}
|
|
634
|
+
/** 图表规格($chart 约定的校验后形态;渲染单一来源在 ui/chart/miniChart) */
|
|
635
|
+
interface ChartSpec {
|
|
636
|
+
kind: 'bar' | 'line' | 'pie';
|
|
637
|
+
title?: string;
|
|
638
|
+
labels: string[];
|
|
639
|
+
series: Array<{
|
|
640
|
+
name?: string;
|
|
641
|
+
data: number[];
|
|
642
|
+
}>;
|
|
643
|
+
}
|
|
593
644
|
type RenderBlock = {
|
|
594
645
|
type: 'markdown';
|
|
595
646
|
text: string;
|
|
@@ -609,6 +660,9 @@ type RenderBlock = {
|
|
|
609
660
|
path: string;
|
|
610
661
|
mimeType?: string;
|
|
611
662
|
size?: number;
|
|
663
|
+
} | {
|
|
664
|
+
type: 'chart';
|
|
665
|
+
chart: ChartSpec;
|
|
612
666
|
};
|
|
613
667
|
interface RenderResultRequest {
|
|
614
668
|
runId: string;
|
|
@@ -717,10 +771,15 @@ interface RunResult {
|
|
|
717
771
|
//#endregion
|
|
718
772
|
//#region src/interaction/renderResult.d.ts
|
|
719
773
|
/**
|
|
720
|
-
*
|
|
721
|
-
*
|
|
774
|
+
* $chart 约定的形状校验:JSON content 的 data 含 $chart 键且形状合法 → ChartSpec;
|
|
775
|
+
* 任何畸形(kind 非法 / labels 非字符串数组 / series 项缺数值 data)→ undefined(忽略不炸)。
|
|
776
|
+
*/
|
|
777
|
+
declare function extractChartSpec(data: unknown): ChartSpec | undefined;
|
|
778
|
+
/**
|
|
779
|
+
* 默认的结果渲染构造:run 内收集的 renderBlocks(chart 等)在前,
|
|
780
|
+
* LLM 最终输出 → markdown block,run.artifacts → file blocks 在后;summary 取 terminationReason。
|
|
722
781
|
*/
|
|
723
|
-
declare function buildRenderResult(run: RuntimeRun, output: string): RenderResultRequest;
|
|
782
|
+
declare function buildRenderResult(run: RuntimeRun, output: string, renderBlocks?: RenderBlock[]): RenderResultRequest;
|
|
724
783
|
//#endregion
|
|
725
784
|
//#region src/interaction/schemaToForm.d.ts
|
|
726
785
|
/**
|
|
@@ -745,6 +804,48 @@ declare class MockUiBridge implements UiBridge {
|
|
|
745
804
|
request(input: InteractionRequest): Promise<InteractionResponse>;
|
|
746
805
|
}
|
|
747
806
|
//#endregion
|
|
807
|
+
//#region src/facade/types.d.ts
|
|
808
|
+
/** 安装结果清单(对齐 README IDL 命名;SkillManifest 的精简投影) */
|
|
809
|
+
interface InstalledSkillManifest {
|
|
810
|
+
name: string;
|
|
811
|
+
version?: string;
|
|
812
|
+
installedAt: string;
|
|
813
|
+
integrity: {
|
|
814
|
+
algorithm: 'sha256';
|
|
815
|
+
digest: string;
|
|
816
|
+
};
|
|
817
|
+
}
|
|
818
|
+
/** navigator.webskill 统一门面(环境无关;浏览器挂载见 browser/navigator.ts) */
|
|
819
|
+
interface WebSkillApi {
|
|
820
|
+
discover(path: string): Promise<SkillCatalog>;
|
|
821
|
+
read(name: string): Promise<SkillDocument>;
|
|
822
|
+
validate(path: string): Promise<ValidationReport>;
|
|
823
|
+
run(prompt: string): Promise<RuntimeRun>;
|
|
824
|
+
install(url: string): Promise<InstalledSkillManifest>;
|
|
825
|
+
uninstall(name: string): Promise<void>;
|
|
826
|
+
}
|
|
827
|
+
//#endregion
|
|
828
|
+
//#region src/facade/webSkillApi.d.ts
|
|
829
|
+
/**
|
|
830
|
+
* navigator.webskill 门面装配层:零新业务逻辑,全部直转
|
|
831
|
+
* SkillDiscovery / validateSkills / WebSkillRuntime / SkillManager。
|
|
832
|
+
*/
|
|
833
|
+
declare function createWebSkillApi(deps: {
|
|
834
|
+
fs: FileSystemProvider;
|
|
835
|
+
roots: string[];
|
|
836
|
+
llm: LlmClient;
|
|
837
|
+
executor?: ScriptExecutor;
|
|
838
|
+
artifactStore?: ArtifactStore;
|
|
839
|
+
/** 技能安装门面(Node SkillManager / BrowserSkillManager 均结构兼容);缺失时 install/uninstall 抛 TOOL_UNSUPPORTED */
|
|
840
|
+
skillManager?: {
|
|
841
|
+
install(source: SkillInstallSource, options?: {
|
|
842
|
+
expectedSha256?: string;
|
|
843
|
+
}): Promise<SkillManifest>;
|
|
844
|
+
uninstall(name: string): Promise<void>;
|
|
845
|
+
};
|
|
846
|
+
loopConfig?: AgentLoopConfig;
|
|
847
|
+
}): WebSkillApi;
|
|
848
|
+
//#endregion
|
|
748
849
|
//#region src/lifecycle/eventBus.d.ts
|
|
749
850
|
type LifecycleListener = (event: LifecycleEvent) => void;
|
|
750
851
|
/** 生命周期事件总线:只读观测,支持按阶段或通配订阅 */
|
|
@@ -1170,4 +1271,4 @@ declare class WebSkillRuntime {
|
|
|
1170
1271
|
resumeRun(runId: string): Promise<RunResult>;
|
|
1171
1272
|
}
|
|
1172
1273
|
//#endregion
|
|
1173
|
-
export {
|
|
1274
|
+
export { OpenAiCompatibleClientConfig as $, SKILLS_LOCKFILE as $t, InteractionPolicy as A, normalizePath as An, WebSkillRuntimeDeps as At, LlmResponse as B, networkUrlHost as Bt, FsMemoryStore as C, checkDependencyCycles as Cn, TraceEvent as Ct, HookRunnerOptions as D, exportSkills as Dn, VercelToolSpec as Dt, HookRunner as E, escapeXml as En, UiBridge as Et, LifecycleHookContext as F, resolveInsideRoot as Fn, extractChartSpec as Ft, MemoryStore as G, toLlmToolSpec as Gt, LlmToolCall as H, parseBridgeRequest as Ht, LifecycleListener as I, validateSkills as In, fromVercelResult as It, MockLlmQueueItem as J, DiscoveryResult as Jt, MockLlmClient as K, toVercelToolSpecs as Kt, LlmClient as L, verifyManifest as Ln, fromVercelStreamPart as Lt, InteractionResponse as M, parseSkillPackManifest as Mn, buildRenderResult as Mt, LifecycleEvent as N, renderAvailableSkillsXml as Nn, createScriptContext as Nt, InMemoryStore as O, isValidSkillName as On, WebSkillApi as Ot, LifecycleHook as P, renderCatalogJson as Pn, createWebSkillApi as Pt, OpenAiCompatibleClient as Q, MemoryFS as Qt, LlmCompleteInput as R, xmlRenderer as Rn, isNetworkAllowed as Rt, FsArtifactStore as S, buildManifest as Sn, TraceClock as St, FullDisclosureRouter as T, computeDigest as Tn, TraceRecorder as Tt, LlmToolSpec as U, resolveToolName as Ut, LlmStreamEvent as V, normalizeToolContent as Vt, MemoryArtifactStore as W, schemaToForm as Wt, MockUiBridge as X, FileSystemProvider as Xt, MockUiAnswer as Y, FileStat as Yt, NetworkPolicy as Z, JsonSchema as Zt, ChartSpec as _, ValidationReport as _n, ScriptExecutor as _t, AgentLoopConfig as a, SkillCatalogEntry as an, RenderBlock as at, ExternalToolSource as b, WebSkillErrorCode as bn, ToolResolution as bt, ApprovalScope as c, SkillInstallSource as cn, RunResult as ct, BridgeCapabilities as d, SkillManifest as dn, RunTerminationReason as dt, SKILL_MANIFEST_FILE as en, ProgressiveRouter as et, BridgeCapability as f, SkillMetadata as fn, RuntimePhase as ft, CapabilityMode as g, SkillsLockfile as gn, ScriptExecutionContext as gt, CapabilityApproval as h, SkillSource as hn, SchemaInferer as ht, AgentLoop as i, SkillCatalog as in, RUN_SNAPSHOT_SCHEMA_VERSION as it, InteractionRequest as j, parseSkillMarkdown as jn, bridgeError as jt, InstalledSkillManifest as k, jsonRenderer as kn, WebSkillRuntime as kt, Artifact as l, SkillIssue as ln, RunSnapshot as lt, BridgeResponse as m, SkillReader as mn, RuntimeSession as mt, ASK_USER_TOOL as n, SKILL_NAME_PATTERN as nn, READ_SKILL_FILE_TOOL as nt, AgentLoopDeps as o, SkillDiscovery as on, RenderResultRequest as ot, BridgeRequest as p, SkillPackManifest as pn, RuntimeRun as pt, MockLlmHandler as q, CatalogRenderer as qt, ASK_USER_TOOL_NAME as r, SKILL_PACK_FILE as rn, READ_SKILL_FILE_TOOL_NAME as rt, ApprovalDecision as s, SkillDocument as sn, RouteResult as st, ASK_USER_INPUT_SCHEMA as t, SKILL_NAME_MAX_LENGTH as tn, READ_SKILL_FILE_INPUT_SCHEMA as tt, ArtifactStore as u, SkillLocation as un, RunSnapshotStore as ut, EventBus as v, VerifyResult as vn, SkillRouter as vt, FsRunSnapshotStore as w, checkSkillRules as wn, TraceEventType as wt, FormField as x, buildCatalog as xn, ToolResult as xt, ExternalSkillProvider as y, WebSkillError as yn, ToolDefinition as yt, LlmMessage as z, mergeCatalogEntries as zt };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { C as FsMemoryStore, Et as UiBridge, M as InteractionResponse, S as FsArtifactStore, Xt as FileSystemProvider, Yt as FileStat, Z as NetworkPolicy, Zt as JsonSchema, _t as ScriptExecutor, c as ApprovalScope, cn as SkillInstallSource, d as BridgeCapabilities, dn as SkillManifest, gn as SkillsLockfile, gt as ScriptExecutionContext, ht as SchemaInferer, j as InteractionRequest, ot as RenderResultRequest, vn as VerifyResult, xt as ToolResult, yt as ToolDefinition } from "./index-DCifjtJx.js";
|
|
2
2
|
import { Readable, Writable } from "node:stream";
|
|
3
3
|
//#region ../node/dist/index.d.ts
|
|
4
4
|
//#region src/fs/nodeFs.d.ts
|
|
@@ -154,6 +154,10 @@ declare class SkillManager {
|
|
|
154
154
|
format: 'zip' | 'tar';
|
|
155
155
|
outPath: string;
|
|
156
156
|
}): Promise<string>;
|
|
157
|
+
/** 多技能包集导出(webskill.skill-pack.json + 各技能目录含 manifest),写 outPath 并返回 */
|
|
158
|
+
exportPack(names: string[], options: {
|
|
159
|
+
outPath: string;
|
|
160
|
+
}): Promise<string>;
|
|
157
161
|
}
|
|
158
162
|
//#endregion
|
|
159
163
|
//#region src/skillManagement/export/archiveExporter.d.ts
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
export { ASK_USER_INPUT_SCHEMA, ASK_USER_TOOL, ASK_USER_TOOL_NAME, AgentLoop, type AgentLoopConfig, type AgentLoopDeps, type ApprovalDecision, type ApprovalScope, type Artifact, type ArtifactStore, type BridgeCapabilities, type BridgeCapability, type BridgeRequest, type BridgeResponse, CapabilityApproval, type CapabilityMode, type CatalogRenderer, type DiscoveryResult, EventBus, type ExternalSkillProvider, type ExternalToolSource, type FileStat, type FileSystemProvider, type FormField, FsArtifactStore, FsMemoryStore, FsRunSnapshotStore, FullDisclosureRouter, HookRunner, type HookRunnerOptions, InMemoryStore, type InteractionPolicy, type InteractionRequest, type InteractionResponse, type JsonSchema, type LifecycleEvent, type LifecycleHook, type LifecycleHookContext, type LifecycleListener, type LlmClient, type LlmCompleteInput, type LlmMessage, type LlmResponse, type LlmStreamEvent, type LlmToolCall, type LlmToolSpec, MemoryArtifactStore, MemoryFS, type MemoryStore, MockLlmClient, type MockLlmHandler, type MockLlmQueueItem, type MockUiAnswer, MockUiBridge, type NetworkPolicy, OpenAiCompatibleClient, type OpenAiCompatibleClientConfig, ProgressiveRouter, READ_SKILL_FILE_INPUT_SCHEMA, READ_SKILL_FILE_TOOL, READ_SKILL_FILE_TOOL_NAME, RUN_SNAPSHOT_SCHEMA_VERSION, type RenderBlock, type RenderResultRequest, type RouteResult, type RunResult, type RunSnapshot, type RunSnapshotStore, type RunTerminationReason, type RuntimePhase, type RuntimeRun, type RuntimeSession, SKILLS_LOCKFILE, SKILL_MANIFEST_FILE, SKILL_NAME_MAX_LENGTH, SKILL_NAME_PATTERN, type SchemaInferer, type ScriptExecutionContext, type ScriptExecutor, type SkillCatalog, type SkillCatalogEntry, SkillDiscovery, type SkillDocument, type SkillInstallSource, type SkillIssue, type SkillLocation, type SkillManifest, type SkillMetadata, SkillReader, type SkillRouter, type SkillSource, type SkillsLockfile, type ToolDefinition, type ToolResolution, type ToolResult, type TraceClock, type TraceEvent, type TraceEventType, TraceRecorder, type UiBridge, type ValidationReport, type VercelToolSpec, type VerifyResult, WebSkillError, type WebSkillErrorCode, WebSkillRuntime, type WebSkillRuntimeDeps, bridgeError, buildCatalog, buildManifest, buildRenderResult, checkSkillRules, computeDigest, createScriptContext, escapeXml, fromVercelResult, fromVercelStreamPart, isNetworkAllowed, isValidSkillName, jsonRenderer, mergeCatalogEntries, networkUrlHost, normalizePath, normalizeToolContent, parseBridgeRequest, parseSkillMarkdown, renderAvailableSkillsXml, renderCatalogJson, resolveInsideRoot, resolveToolName, schemaToForm, toLlmToolSpec, toVercelToolSpecs, validateSkills, verifyManifest, xmlRenderer };
|
|
1
|
+
import { $ as OpenAiCompatibleClientConfig, $t as SKILLS_LOCKFILE, A as InteractionPolicy, An as normalizePath, At as WebSkillRuntimeDeps, B as LlmResponse, Bt as networkUrlHost, C as FsMemoryStore, Cn as checkDependencyCycles, Ct as TraceEvent, D as HookRunnerOptions, Dn as exportSkills, Dt as VercelToolSpec, E as HookRunner, En as escapeXml, Et as UiBridge, F as LifecycleHookContext, Fn as resolveInsideRoot, Ft as extractChartSpec, G as MemoryStore, Gt as toLlmToolSpec, H as LlmToolCall, Ht as parseBridgeRequest, I as LifecycleListener, In as validateSkills, It as fromVercelResult, J as MockLlmQueueItem, Jt as DiscoveryResult, K as MockLlmClient, Kt as toVercelToolSpecs, L as LlmClient, Ln as verifyManifest, Lt as fromVercelStreamPart, M as InteractionResponse, Mn as parseSkillPackManifest, Mt as buildRenderResult, N as LifecycleEvent, Nn as renderAvailableSkillsXml, Nt as createScriptContext, O as InMemoryStore, On as isValidSkillName, Ot as WebSkillApi, P as LifecycleHook, Pn as renderCatalogJson, Pt as createWebSkillApi, Q as OpenAiCompatibleClient, Qt as MemoryFS, R as LlmCompleteInput, Rn as xmlRenderer, Rt as isNetworkAllowed, S as FsArtifactStore, Sn as buildManifest, St as TraceClock, T as FullDisclosureRouter, Tn as computeDigest, Tt as TraceRecorder, U as LlmToolSpec, Ut as resolveToolName, V as LlmStreamEvent, Vt as normalizeToolContent, W as MemoryArtifactStore, Wt as schemaToForm, X as MockUiBridge, Xt as FileSystemProvider, Y as MockUiAnswer, Yt as FileStat, Z as NetworkPolicy, Zt as JsonSchema, _ as ChartSpec, _n as ValidationReport, _t as ScriptExecutor, a as AgentLoopConfig, an as SkillCatalogEntry, at as RenderBlock, b as ExternalToolSource, bn as WebSkillErrorCode, bt as ToolResolution, c as ApprovalScope, cn as SkillInstallSource, ct as RunResult, d as BridgeCapabilities, dn as SkillManifest, dt as RunTerminationReason, en as SKILL_MANIFEST_FILE, et as ProgressiveRouter, f as BridgeCapability, fn as SkillMetadata, ft as RuntimePhase, g as CapabilityMode, gn as SkillsLockfile, gt as ScriptExecutionContext, h as CapabilityApproval, hn as SkillSource, ht as SchemaInferer, i as AgentLoop, in as SkillCatalog, it as RUN_SNAPSHOT_SCHEMA_VERSION, j as InteractionRequest, jn as parseSkillMarkdown, jt as bridgeError, k as InstalledSkillManifest, kn as jsonRenderer, kt as WebSkillRuntime, l as Artifact, ln as SkillIssue, lt as RunSnapshot, m as BridgeResponse, mn as SkillReader, mt as RuntimeSession, n as ASK_USER_TOOL, nn as SKILL_NAME_PATTERN, nt as READ_SKILL_FILE_TOOL, o as AgentLoopDeps, on as SkillDiscovery, ot as RenderResultRequest, p as BridgeRequest, pn as SkillPackManifest, pt as RuntimeRun, q as MockLlmHandler, qt as CatalogRenderer, r as ASK_USER_TOOL_NAME, rn as SKILL_PACK_FILE, rt as READ_SKILL_FILE_TOOL_NAME, s as ApprovalDecision, sn as SkillDocument, st as RouteResult, t as ASK_USER_INPUT_SCHEMA, tn as SKILL_NAME_MAX_LENGTH, tt as READ_SKILL_FILE_INPUT_SCHEMA, u as ArtifactStore, un as SkillLocation, ut as RunSnapshotStore, v as EventBus, vn as VerifyResult, vt as SkillRouter, w as FsRunSnapshotStore, wn as checkSkillRules, wt as TraceEventType, x as FormField, xn as buildCatalog, xt as ToolResult, y as ExternalSkillProvider, yn as WebSkillError, yt as ToolDefinition, z as LlmMessage, zt as mergeCatalogEntries } from "./index-DCifjtJx.js";
|
|
2
|
+
export { ASK_USER_INPUT_SCHEMA, ASK_USER_TOOL, ASK_USER_TOOL_NAME, AgentLoop, type AgentLoopConfig, type AgentLoopDeps, type ApprovalDecision, type ApprovalScope, type Artifact, type ArtifactStore, type BridgeCapabilities, type BridgeCapability, type BridgeRequest, type BridgeResponse, CapabilityApproval, type CapabilityMode, type CatalogRenderer, type ChartSpec, type DiscoveryResult, EventBus, type ExternalSkillProvider, type ExternalToolSource, type FileStat, type FileSystemProvider, type FormField, FsArtifactStore, FsMemoryStore, FsRunSnapshotStore, FullDisclosureRouter, HookRunner, type HookRunnerOptions, InMemoryStore, type InstalledSkillManifest, type InteractionPolicy, type InteractionRequest, type InteractionResponse, type JsonSchema, type LifecycleEvent, type LifecycleHook, type LifecycleHookContext, type LifecycleListener, type LlmClient, type LlmCompleteInput, type LlmMessage, type LlmResponse, type LlmStreamEvent, type LlmToolCall, type LlmToolSpec, MemoryArtifactStore, MemoryFS, type MemoryStore, MockLlmClient, type MockLlmHandler, type MockLlmQueueItem, type MockUiAnswer, MockUiBridge, type NetworkPolicy, OpenAiCompatibleClient, type OpenAiCompatibleClientConfig, ProgressiveRouter, READ_SKILL_FILE_INPUT_SCHEMA, READ_SKILL_FILE_TOOL, READ_SKILL_FILE_TOOL_NAME, RUN_SNAPSHOT_SCHEMA_VERSION, type RenderBlock, type RenderResultRequest, type RouteResult, type RunResult, type RunSnapshot, type RunSnapshotStore, type RunTerminationReason, type RuntimePhase, type RuntimeRun, type RuntimeSession, SKILLS_LOCKFILE, SKILL_MANIFEST_FILE, SKILL_NAME_MAX_LENGTH, SKILL_NAME_PATTERN, SKILL_PACK_FILE, type SchemaInferer, type ScriptExecutionContext, type ScriptExecutor, type SkillCatalog, type SkillCatalogEntry, SkillDiscovery, type SkillDocument, type SkillInstallSource, type SkillIssue, type SkillLocation, type SkillManifest, type SkillMetadata, type SkillPackManifest, SkillReader, type SkillRouter, type SkillSource, type SkillsLockfile, type ToolDefinition, type ToolResolution, type ToolResult, type TraceClock, type TraceEvent, type TraceEventType, TraceRecorder, type UiBridge, type ValidationReport, type VercelToolSpec, type VerifyResult, type WebSkillApi, WebSkillError, type WebSkillErrorCode, WebSkillRuntime, type WebSkillRuntimeDeps, bridgeError, buildCatalog, buildManifest, buildRenderResult, checkDependencyCycles, checkSkillRules, computeDigest, createScriptContext, createWebSkillApi, escapeXml, exportSkills, extractChartSpec, fromVercelResult, fromVercelStreamPart, isNetworkAllowed, isValidSkillName, jsonRenderer, mergeCatalogEntries, networkUrlHost, normalizePath, normalizeToolContent, parseBridgeRequest, parseSkillMarkdown, parseSkillPackManifest, renderAvailableSkillsXml, renderCatalogJson, resolveInsideRoot, resolveToolName, schemaToForm, toLlmToolSpec, toVercelToolSpecs, validateSkills, verifyManifest, xmlRenderer };
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as computeDigest, A as fromVercelStreamPart, B as MemoryFS, C as WebSkillRuntime, D as createWebSkillApi, E as createScriptContext, F as parseBridgeRequest, G as SKILL_PACK_FILE, H as SKILL_MANIFEST_FILE, I as resolveToolName, J as WebSkillError, K as SkillDiscovery, L as schemaToForm, M as mergeCatalogEntries, N as networkUrlHost, O as extractChartSpec, P as normalizeToolContent, Q as checkSkillRules, R as toLlmToolSpec, S as TraceRecorder, T as buildRenderResult, U as SKILL_NAME_MAX_LENGTH, V as SKILLS_LOCKFILE, W as SKILL_NAME_PATTERN, X as buildManifest, Y as buildCatalog, Z as checkDependencyCycles, _ as ProgressiveRouter, a as CapabilityApproval, at as parseSkillMarkdown, b as READ_SKILL_FILE_TOOL_NAME, c as FsMemoryStore, ct as renderCatalogJson, d as HookRunner, dt as verifyManifest, et as escapeXml, f as InMemoryStore, ft as xmlRenderer, g as OpenAiCompatibleClient, h as MockUiBridge, i as AgentLoop, it as normalizePath, j as isNetworkAllowed, k as fromVercelResult, l as FsRunSnapshotStore, lt as resolveInsideRoot, m as MockLlmClient, n as ASK_USER_TOOL, nt as isValidSkillName, o as EventBus, ot as parseSkillPackManifest, p as MemoryArtifactStore, q as SkillReader, r as ASK_USER_TOOL_NAME, rt as jsonRenderer, s as FsArtifactStore, st as renderAvailableSkillsXml, t as ASK_USER_INPUT_SCHEMA, tt as exportSkills, u as FullDisclosureRouter, ut as validateSkills, v as READ_SKILL_FILE_INPUT_SCHEMA, w as bridgeError, x as RUN_SNAPSHOT_SCHEMA_VERSION, y as READ_SKILL_FILE_TOOL, z as toVercelToolSpecs } from "./dist-nXiR40hi.js";
|
|
2
2
|
|
|
3
|
-
export { ASK_USER_INPUT_SCHEMA, ASK_USER_TOOL, ASK_USER_TOOL_NAME, AgentLoop, CapabilityApproval, EventBus, FsArtifactStore, FsMemoryStore, FsRunSnapshotStore, FullDisclosureRouter, HookRunner, InMemoryStore, MemoryArtifactStore, MemoryFS, MockLlmClient, MockUiBridge, OpenAiCompatibleClient, ProgressiveRouter, READ_SKILL_FILE_INPUT_SCHEMA, READ_SKILL_FILE_TOOL, READ_SKILL_FILE_TOOL_NAME, RUN_SNAPSHOT_SCHEMA_VERSION, SKILLS_LOCKFILE, SKILL_MANIFEST_FILE, SKILL_NAME_MAX_LENGTH, SKILL_NAME_PATTERN, SkillDiscovery, SkillReader, TraceRecorder, WebSkillError, WebSkillRuntime, bridgeError, buildCatalog, buildManifest, buildRenderResult, checkSkillRules, computeDigest, createScriptContext, escapeXml, fromVercelResult, fromVercelStreamPart, isNetworkAllowed, isValidSkillName, jsonRenderer, mergeCatalogEntries, networkUrlHost, normalizePath, normalizeToolContent, parseBridgeRequest, parseSkillMarkdown, renderAvailableSkillsXml, renderCatalogJson, resolveInsideRoot, resolveToolName, schemaToForm, toLlmToolSpec, toVercelToolSpecs, validateSkills, verifyManifest, xmlRenderer };
|
|
3
|
+
export { ASK_USER_INPUT_SCHEMA, ASK_USER_TOOL, ASK_USER_TOOL_NAME, AgentLoop, CapabilityApproval, EventBus, FsArtifactStore, FsMemoryStore, FsRunSnapshotStore, FullDisclosureRouter, HookRunner, InMemoryStore, MemoryArtifactStore, MemoryFS, MockLlmClient, MockUiBridge, OpenAiCompatibleClient, ProgressiveRouter, READ_SKILL_FILE_INPUT_SCHEMA, READ_SKILL_FILE_TOOL, READ_SKILL_FILE_TOOL_NAME, RUN_SNAPSHOT_SCHEMA_VERSION, SKILLS_LOCKFILE, SKILL_MANIFEST_FILE, SKILL_NAME_MAX_LENGTH, SKILL_NAME_PATTERN, SKILL_PACK_FILE, SkillDiscovery, SkillReader, TraceRecorder, WebSkillError, WebSkillRuntime, bridgeError, buildCatalog, buildManifest, buildRenderResult, checkDependencyCycles, checkSkillRules, computeDigest, createScriptContext, createWebSkillApi, escapeXml, exportSkills, extractChartSpec, fromVercelResult, fromVercelStreamPart, isNetworkAllowed, isValidSkillName, jsonRenderer, mergeCatalogEntries, networkUrlHost, normalizePath, normalizeToolContent, parseBridgeRequest, parseSkillMarkdown, parseSkillPackManifest, renderAvailableSkillsXml, renderCatalogJson, resolveInsideRoot, resolveToolName, schemaToForm, toLlmToolSpec, toVercelToolSpecs, validateSkills, verifyManifest, xmlRenderer };
|
package/dist/mcp.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { U as LlmToolSpec, Zt as JsonSchema, an as SkillCatalogEntry, b as ExternalToolSource, sn as SkillDocument, xt as ToolResult, y as ExternalSkillProvider, zt as mergeCatalogEntries } from "./index-DCifjtJx.js";
|
|
2
2
|
import { Transport } from "@modelcontextprotocol/sdk/shared/transport.js";
|
|
3
3
|
import { JSONRPCMessage } from "@modelcontextprotocol/sdk/types.js";
|
|
4
4
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
package/dist/mcp.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { J as WebSkillError, M as mergeCatalogEntries, P as normalizeToolContent } from "./dist-nXiR40hi.js";
|
|
2
2
|
import { fromJSONSchema } from "zod";
|
|
3
3
|
|
|
4
4
|
//#region ../mcp/dist/index.js
|
package/dist/node.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as LlmEnvConfig, c as OxcSchemaInferer, d as SkillManager, f as loadLlmConfigFromEnv, i as LlmCapabilities, l as SandboxOptions, m as readArchiveManifest, n as FileArtifactStore, o as NodeFS, p as probeLlmCapabilities, r as FileMemoryStore, s as NodeScriptExecutor, t as CliUiBridge, u as SandboxedScriptExecutor } from "./index-
|
|
1
|
+
import { $t as SKILLS_LOCKFILE, Nt as createScriptContext, cn as SkillInstallSource, dn as SkillManifest, en as SKILL_MANIFEST_FILE, gn as SkillsLockfile, vn as VerifyResult } from "./index-DCifjtJx.js";
|
|
2
|
+
import { a as LlmEnvConfig, c as OxcSchemaInferer, d as SkillManager, f as loadLlmConfigFromEnv, i as LlmCapabilities, l as SandboxOptions, m as readArchiveManifest, n as FileArtifactStore, o as NodeFS, p as probeLlmCapabilities, r as FileMemoryStore, s as NodeScriptExecutor, t as CliUiBridge, u as SandboxedScriptExecutor } from "./index-vi7GPemR.js";
|
|
3
3
|
export { CliUiBridge, FileArtifactStore, FileMemoryStore, type LlmCapabilities, type LlmEnvConfig, NodeFS, NodeScriptExecutor, OxcSchemaInferer, SKILLS_LOCKFILE, SKILL_MANIFEST_FILE, type SandboxOptions, SandboxedScriptExecutor, SkillManager, type SkillManifest, type SkillInstallSource as SkillSource, type SkillsLockfile, type VerifyResult, createScriptContext, loadLlmConfigFromEnv, probeLlmCapabilities, readArchiveManifest };
|
package/dist/node.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as NodeScriptExecutor, c as SkillManager, d as readArchiveManifest, i as NodeFS, l as loadLlmConfigFromEnv, n as FileArtifactStore, o as OxcSchemaInferer, r as FileMemoryStore, s as SandboxedScriptExecutor, t as CliUiBridge, u as probeLlmCapabilities } from "./dist-
|
|
1
|
+
import { E as createScriptContext, H as SKILL_MANIFEST_FILE, V as SKILLS_LOCKFILE } from "./dist-nXiR40hi.js";
|
|
2
|
+
import { a as NodeScriptExecutor, c as SkillManager, d as readArchiveManifest, i as NodeFS, l as loadLlmConfigFromEnv, n as FileArtifactStore, o as OxcSchemaInferer, r as FileMemoryStore, s as SandboxedScriptExecutor, t as CliUiBridge, u as probeLlmCapabilities } from "./dist-33_zuOCm.js";
|
|
3
3
|
|
|
4
4
|
export { CliUiBridge, FileArtifactStore, FileMemoryStore, NodeFS, NodeScriptExecutor, OxcSchemaInferer, SKILLS_LOCKFILE, SKILL_MANIFEST_FILE, SandboxedScriptExecutor, SkillManager, createScriptContext, loadLlmConfigFromEnv, probeLlmCapabilities, readArchiveManifest };
|
package/dist/ui-react.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Et as UiBridge, M as InteractionResponse, j as InteractionRequest, ot as RenderResultRequest } from "./index-DCifjtJx.js";
|
|
2
2
|
//#region ../ui-react/dist/index.d.ts
|
|
3
3
|
//#region src/bridgeState.d.ts
|
|
4
4
|
/**
|
|
@@ -26,7 +26,7 @@ declare function InteractionForm({ bridge }: {
|
|
|
26
26
|
}): import("react").JSX.Element | null;
|
|
27
27
|
//#endregion
|
|
28
28
|
//#region src/components/ResultBlocks.d.ts
|
|
29
|
-
/** 订阅 bridge.latestResult
|
|
29
|
+
/** 订阅 bridge.latestResult 渲染六种 RenderBlock */
|
|
30
30
|
declare function ResultBlocks({ bridge }: {
|
|
31
31
|
bridge: ReactBridgeState;
|
|
32
32
|
}): import("react").JSX.Element | null;
|
package/dist/ui-react.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { S as renderMiniMarkdown, m as collectValues, w as shapeInteractionValue, x as renderMiniChart, y as interactionToFormModel } from "./dist-BQruQ9Hv.js";
|
|
2
2
|
import { useLayoutEffect, useRef, useState, useSyncExternalStore } from "react";
|
|
3
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
|
|
@@ -185,8 +185,18 @@ function MarkdownBlock({ text }) {
|
|
|
185
185
|
}, [text]);
|
|
186
186
|
return /* @__PURE__ */ jsx("div", { ref });
|
|
187
187
|
}
|
|
188
|
+
function ChartBlock({ chart }) {
|
|
189
|
+
const ref = useRef(null);
|
|
190
|
+
useLayoutEffect(() => {
|
|
191
|
+
const el = ref.current;
|
|
192
|
+
if (!el) return;
|
|
193
|
+
el.replaceChildren(renderMiniChart(chart, el.ownerDocument));
|
|
194
|
+
}, [chart]);
|
|
195
|
+
return /* @__PURE__ */ jsx("div", { ref });
|
|
196
|
+
}
|
|
188
197
|
function Block({ block }) {
|
|
189
198
|
switch (block.type) {
|
|
199
|
+
case "chart": return /* @__PURE__ */ jsx(ChartBlock, { chart: block.chart });
|
|
190
200
|
case "markdown": return /* @__PURE__ */ jsx(MarkdownBlock, { text: block.text });
|
|
191
201
|
case "json": return /* @__PURE__ */ jsx("pre", {
|
|
192
202
|
className: "webskill-result__json",
|
|
@@ -206,7 +216,7 @@ function Block({ block }) {
|
|
|
206
216
|
}
|
|
207
217
|
}
|
|
208
218
|
}
|
|
209
|
-
/** 订阅 bridge.latestResult
|
|
219
|
+
/** 订阅 bridge.latestResult 渲染六种 RenderBlock */
|
|
210
220
|
function ResultBlocks({ bridge }) {
|
|
211
221
|
const result = useSyncExternalStore(bridge.subscribe, () => bridge.latestResult);
|
|
212
222
|
if (!result) return null;
|
package/dist/ui-vue.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Et as UiBridge, M as InteractionResponse, j as InteractionRequest, ot as RenderResultRequest } from "./index-DCifjtJx.js";
|
|
2
2
|
import { PropType } from "vue";
|
|
3
3
|
//#region ../ui-vue/dist/index.d.ts
|
|
4
4
|
//#region src/bridgeState.d.ts
|
|
@@ -38,7 +38,7 @@ declare const InteractionForm: import("vue").DefineComponent<import("vue").Extra
|
|
|
38
38
|
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
39
39
|
//#endregion
|
|
40
40
|
//#region src/components/resultBlocks.d.ts
|
|
41
|
-
/** 订阅 bridge.state.latestResult
|
|
41
|
+
/** 订阅 bridge.state.latestResult 渲染六种 RenderBlock */
|
|
42
42
|
declare const ResultBlocks: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
43
43
|
bridge: {
|
|
44
44
|
type: PropType<VueBridgeState>;
|
package/dist/ui-vue.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { S as renderMiniMarkdown, m as collectValues, w as shapeInteractionValue, x as renderMiniChart, y as interactionToFormModel } from "./dist-BQruQ9Hv.js";
|
|
2
2
|
import { defineComponent, h, reactive, ref } from "vue";
|
|
3
3
|
|
|
4
4
|
//#region ../ui-vue/dist/index.js
|
|
@@ -132,6 +132,13 @@ const InteractionForm = defineComponent({
|
|
|
132
132
|
});
|
|
133
133
|
function renderBlock(block, key) {
|
|
134
134
|
switch (block.type) {
|
|
135
|
+
case "chart": return h("div", {
|
|
136
|
+
key,
|
|
137
|
+
onVnodeMounted: (vnode) => {
|
|
138
|
+
const el = vnode.el;
|
|
139
|
+
if (el) el.replaceChildren(renderMiniChart(block.chart, el.ownerDocument));
|
|
140
|
+
}
|
|
141
|
+
});
|
|
135
142
|
case "markdown": return h("div", {
|
|
136
143
|
key,
|
|
137
144
|
onVnodeMounted: (vnode) => {
|
|
@@ -158,7 +165,7 @@ function renderBlock(block, key) {
|
|
|
158
165
|
}
|
|
159
166
|
}
|
|
160
167
|
}
|
|
161
|
-
/** 订阅 bridge.state.latestResult
|
|
168
|
+
/** 订阅 bridge.state.latestResult 渲染六种 RenderBlock */
|
|
162
169
|
const ResultBlocks = defineComponent({
|
|
163
170
|
name: "WebSkillResultBlocks",
|
|
164
171
|
props: { bridge: {
|
package/dist/ui.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Et as UiBridge, M as InteractionResponse, Mt as buildRenderResult, _ as ChartSpec, at as RenderBlock, j as InteractionRequest, ot as RenderResultRequest } from "./index-DCifjtJx.js";
|
|
2
2
|
//#region ../ui/dist/index.d.ts
|
|
3
3
|
//#region src/model/formModel.d.ts
|
|
4
4
|
interface FormModel {
|
|
@@ -47,6 +47,18 @@ declare function collectValues(controls: ControlModel[], container: ParentNode):
|
|
|
47
47
|
*/
|
|
48
48
|
declare function renderMiniMarkdown(text: string, doc: Document): HTMLElement;
|
|
49
49
|
//#endregion
|
|
50
|
+
//#region src/chart/miniChart.d.ts
|
|
51
|
+
/** 固定 8 色循环调色板 */
|
|
52
|
+
declare const CHART_PALETTE: readonly ['#4e79a7', '#f28e2b', '#e15759', '#76b7b2', '#59a14f', '#edc948', '#b07aa1', '#ff9da7'];
|
|
53
|
+
/** ChartSpec → SVG(bar 等宽柱 + 值标签;line 折线 + 点;pie 扇形 + 图例;空数据容错) */
|
|
54
|
+
declare function renderMiniChart(chart: ChartSpec, doc: Document): SVGSVGElement;
|
|
55
|
+
/** A2UI/OpenUI 降级:chart → table(labels 为首列,series 各为一列) */
|
|
56
|
+
declare function chartToTable(chart: ChartSpec): {
|
|
57
|
+
type: 'table';
|
|
58
|
+
columns: string[];
|
|
59
|
+
rows: unknown[][];
|
|
60
|
+
};
|
|
61
|
+
//#endregion
|
|
50
62
|
//#region src/web/webFormBridge.d.ts
|
|
51
63
|
/**
|
|
52
64
|
* 框架无关原生 DOM 的 UiBridge:request 渲染表单并返回 Promise
|
|
@@ -70,7 +82,7 @@ declare class WebFormBridge implements UiBridge {
|
|
|
70
82
|
}
|
|
71
83
|
//#endregion
|
|
72
84
|
//#region src/web/resultRenderer.d.ts
|
|
73
|
-
/** RenderBlock → DOM(markdown/json/table/image/file
|
|
85
|
+
/** RenderBlock → DOM(markdown/json/table/image/file/chart 六种) */
|
|
74
86
|
declare function renderBlocks(container: HTMLElement, blocks: RenderBlock[], doc: Document): void;
|
|
75
87
|
/** 完整 RenderResultRequest → DOM(summary 头 + blocks) */
|
|
76
88
|
declare function renderRenderResult(request: RenderResultRequest, doc: Document): HTMLElement;
|
|
@@ -168,4 +180,4 @@ declare class LitRendererBridge implements UiBridge {
|
|
|
168
180
|
request(input: InteractionRequest): Promise<InteractionResponse>;
|
|
169
181
|
}
|
|
170
182
|
//#endregion
|
|
171
|
-
export { A2UI_BASIC_CATALOG_ID, A2UI_CANCEL_ACTION, A2UI_SUBMIT_ACTION, A2UI_VERSION, type A2uiMessage, type CollectedValues, type ControlModel, type FormModel, LitRendererBridge, OPENUI_CANCEL_ACTION, OPENUI_SUBMIT_ACTION, VERCEL_INTERACTION_TOOL_NAME, type VercelToolInvocation, VercelUiBridge, WEBSKILL_STYLES_CSS, WebFormBridge, buildRenderResult, collectValues, ensureStyles, fromA2uiAction, fromOpenUiAction, fromVercelToolResult, interactionToFormModel, renderBlocks, renderMiniMarkdown, renderRenderResult, shapeInteractionValue, toA2uiMessages, toOpenUiLang, toVercelToolInvocation };
|
|
183
|
+
export { A2UI_BASIC_CATALOG_ID, A2UI_CANCEL_ACTION, A2UI_SUBMIT_ACTION, A2UI_VERSION, type A2uiMessage, CHART_PALETTE, type CollectedValues, type ControlModel, type FormModel, LitRendererBridge, OPENUI_CANCEL_ACTION, OPENUI_SUBMIT_ACTION, VERCEL_INTERACTION_TOOL_NAME, type VercelToolInvocation, VercelUiBridge, WEBSKILL_STYLES_CSS, WebFormBridge, buildRenderResult, chartToTable, collectValues, ensureStyles, fromA2uiAction, fromOpenUiAction, fromVercelToolResult, interactionToFormModel, renderBlocks, renderMiniChart, renderMiniMarkdown, renderRenderResult, shapeInteractionValue, toA2uiMessages, toOpenUiLang, toVercelToolInvocation };
|
package/dist/ui.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { T as buildRenderResult } from "./dist-
|
|
2
|
-
import { C as toOpenUiLang, S as toA2uiMessages, _ as
|
|
1
|
+
import { T as buildRenderResult } from "./dist-nXiR40hi.js";
|
|
2
|
+
import { C as renderRenderResult, D as toVercelToolInvocation, E as toOpenUiLang, S as renderMiniMarkdown, T as toA2uiMessages, _ as fromOpenUiAction, a as CHART_PALETTE, b as renderBlocks, c as OPENUI_SUBMIT_ACTION, d as WEBSKILL_STYLES_CSS, f as WebFormBridge, g as fromA2uiAction, h as ensureStyles, i as A2UI_VERSION, l as VERCEL_INTERACTION_TOOL_NAME, m as collectValues, n as A2UI_CANCEL_ACTION, o as LitRendererBridge, p as chartToTable, r as A2UI_SUBMIT_ACTION, s as OPENUI_CANCEL_ACTION, t as A2UI_BASIC_CATALOG_ID, u as VercelUiBridge, v as fromVercelToolResult, w as shapeInteractionValue, x as renderMiniChart, y as interactionToFormModel } from "./dist-BQruQ9Hv.js";
|
|
3
3
|
|
|
4
|
-
export { A2UI_BASIC_CATALOG_ID, A2UI_CANCEL_ACTION, A2UI_SUBMIT_ACTION, A2UI_VERSION, LitRendererBridge, OPENUI_CANCEL_ACTION, OPENUI_SUBMIT_ACTION, VERCEL_INTERACTION_TOOL_NAME, VercelUiBridge, WEBSKILL_STYLES_CSS, WebFormBridge, buildRenderResult, collectValues, ensureStyles, fromA2uiAction, fromOpenUiAction, fromVercelToolResult, interactionToFormModel, renderBlocks, renderMiniMarkdown, renderRenderResult, shapeInteractionValue, toA2uiMessages, toOpenUiLang, toVercelToolInvocation };
|
|
4
|
+
export { A2UI_BASIC_CATALOG_ID, A2UI_CANCEL_ACTION, A2UI_SUBMIT_ACTION, A2UI_VERSION, CHART_PALETTE, LitRendererBridge, OPENUI_CANCEL_ACTION, OPENUI_SUBMIT_ACTION, VERCEL_INTERACTION_TOOL_NAME, VercelUiBridge, WEBSKILL_STYLES_CSS, WebFormBridge, buildRenderResult, chartToTable, collectValues, ensureStyles, fromA2uiAction, fromOpenUiAction, fromVercelToolResult, interactionToFormModel, renderBlocks, renderMiniChart, renderMiniMarkdown, renderRenderResult, shapeInteractionValue, toA2uiMessages, toOpenUiLang, toVercelToolInvocation };
|