@webskill/sdk 0.7.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent.d.ts +1 -1
- package/dist/agent.js +1 -1
- package/dist/browser.d.ts +151 -4
- package/dist/browser.js +269 -30
- package/dist/{catalogComponents-Dr5dFMAb-DKH_7VPI.js → catalogComponents-DfxxfUvn-T7Ic8QFV.js} +4026 -997
- package/dist/{dist-DnYG2-eY.js → dist-BQe1uglQ.js} +498 -118
- package/dist/{dist-8oQRa8Xz.js → dist-Bev6i6Ip.js} +102 -7
- package/dist/{dist-D0qW6e40.js → dist-CFmkV45C.js} +234 -27
- package/dist/{eventTypes-DjIQpt8Y-Bj3vghj4.js → eventTypes-DbOpAECr-BjcjZVms.js} +15 -2
- package/dist/governance.d.ts +24 -3
- package/dist/governance.js +30 -11
- package/dist/{index-BwsK9lGk.d.ts → index-DXNTIa-6.d.ts} +163 -6
- package/dist/{index-Ba3xFtfz.d.ts → index-lLcCpHE-.d.ts} +2 -2
- package/dist/{index-DkbABR43.d.ts → index-znZjobkr.d.ts} +144 -76
- package/dist/index.d.ts +11 -3
- package/dist/index.js +13 -4
- package/dist/mcp.d.ts +13 -2
- package/dist/mcp.js +19 -5
- package/dist/{memoryArtifactStore-52Zn9npI-BMPYwvoy.js → memoryArtifactStore-52Zn9npI-LbCQaqyx.js} +1 -1
- package/dist/node.d.ts +3 -3
- package/dist/node.js +6 -6
- package/dist/{openUiLibrary-Bdrji9qK-D2LxmM-a.js → openUiLibrary-DURlAxjk-Do_yqg3u.js} +3 -3
- package/dist/{skillVersionStore-Bl-ElD45-CWPvGvoq.d.ts → skillVersionStore-Bl-ElD45-dMJ8Ybhb.d.ts} +1 -1
- package/dist/{testing-CYTFqkDm.js → testing-Csg5ljNm.js} +2 -2
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +2 -2
- package/dist/{types-CcxRLdJG-DCXyw1US.d.ts → types-B3n0cMZu-BDhheIhX.d.ts} +54 -6
- package/dist/ui-react.d.ts +19 -6
- package/dist/ui-react.js +156 -84
- package/dist/ui-vue.d.ts +1 -1
- package/dist/ui-vue.js +2 -2
- package/dist/ui.d.ts +4 -4
- package/dist/ui.js +3 -3
- package/dist/{webskillLitCatalog-_mugzRHx-B_54vxum.js → webskillLitCatalog-DwTwSBFt-BG7kL-Es.js} +22 -3
- package/package.json +2 -2
package/dist/governance.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as textParts, n as partsToText } from "./memoryArtifactStore-52Zn9npI-
|
|
3
|
-
import { n as AUDIT_EVENT_TYPE_LIST, t as AUDIT_EVENT_TYPES } from "./eventTypes-
|
|
1
|
+
import { M as messageOf, _ as assertSafePathSegment, h as WebSkillError, k as isValidSkillName, v as atomicWriteText } from "./dist-Bev6i6Ip.js";
|
|
2
|
+
import { a as textParts, n as partsToText } from "./memoryArtifactStore-52Zn9npI-LbCQaqyx.js";
|
|
3
|
+
import { n as AUDIT_EVENT_TYPE_LIST, t as AUDIT_EVENT_TYPES } from "./eventTypes-DbOpAECr-BjcjZVms.js";
|
|
4
4
|
|
|
5
5
|
//#region ../governance/dist/index.js
|
|
6
6
|
const invalid = (message, details) => {
|
|
@@ -135,7 +135,7 @@ var CandidateStore = class {
|
|
|
135
135
|
async save(candidate) {
|
|
136
136
|
validateCandidate(candidate);
|
|
137
137
|
assertSafePathSegment(candidate.id, "candidate id");
|
|
138
|
-
await this.#fs
|
|
138
|
+
await atomicWriteText(this.#fs, `${dirOf$1(this.#root)}/${candidate.id}.json`, JSON.stringify(candidate, null, 2));
|
|
139
139
|
}
|
|
140
140
|
async get(id) {
|
|
141
141
|
assertSafePathSegment(id, "candidate id");
|
|
@@ -211,7 +211,7 @@ function createCandidateSink(options) {
|
|
|
211
211
|
};
|
|
212
212
|
await options.store.save(candidate);
|
|
213
213
|
await options.audit?.append({
|
|
214
|
-
type:
|
|
214
|
+
type: AUDIT_EVENT_TYPES.candidateCreated,
|
|
215
215
|
target: candidate.id,
|
|
216
216
|
data: {
|
|
217
217
|
name: candidate.name,
|
|
@@ -275,7 +275,7 @@ var LlmCandidateGenerator = class {
|
|
|
275
275
|
...this.#createId ? { createId: this.#createId } : {}
|
|
276
276
|
});
|
|
277
277
|
await this.#audit?.append({
|
|
278
|
-
type:
|
|
278
|
+
type: AUDIT_EVENT_TYPES.candidateCreated,
|
|
279
279
|
target: candidate.id,
|
|
280
280
|
data: {
|
|
281
281
|
name: candidate.name,
|
|
@@ -443,15 +443,21 @@ var FsAuditLog = class {
|
|
|
443
443
|
/** 按文件行序保留(含解析失败的洞):链校验必须在文件行序上做,不能在筛选结果上做 */
|
|
444
444
|
const records = [];
|
|
445
445
|
let skippedLines = 0;
|
|
446
|
+
let firstMalformedLine = -1;
|
|
446
447
|
for (const line of raw.split("\n")) {
|
|
447
448
|
if (line.trim() === "") continue;
|
|
448
449
|
try {
|
|
449
450
|
records.push(JSON.parse(line));
|
|
450
451
|
} catch {
|
|
452
|
+
if (firstMalformedLine < 0) firstMalformedLine = records.length;
|
|
451
453
|
skippedLines += 1;
|
|
452
454
|
records.push(void 0);
|
|
453
455
|
}
|
|
454
456
|
}
|
|
457
|
+
const malformed = skippedLines > 0 ? {
|
|
458
|
+
count: skippedLines,
|
|
459
|
+
firstLine: firstMalformedLine
|
|
460
|
+
} : void 0;
|
|
455
461
|
if (skippedLines > 0) console.warn(`[webskill] Audit log at ${path} contains ${skippedLines} unparsable line(s) skipped by query; run verifyChain() to check integrity`);
|
|
456
462
|
const matched = [];
|
|
457
463
|
for (let i = 0; i < records.length; i++) {
|
|
@@ -493,7 +499,8 @@ var FsAuditLog = class {
|
|
|
493
499
|
...broken !== void 0 ? {
|
|
494
500
|
chainBrokenAt: broken.at,
|
|
495
501
|
chainReason: broken.reason
|
|
496
|
-
} : {}
|
|
502
|
+
} : {},
|
|
503
|
+
...malformed !== void 0 ? { malformed } : {}
|
|
497
504
|
};
|
|
498
505
|
}
|
|
499
506
|
/** 单行的链自洽:本行 hash 重算相符,且 prevHash 指向前一行的 hash。自洽时返回 undefined */
|
|
@@ -585,7 +592,7 @@ var SkillVersionStore = class {
|
|
|
585
592
|
await this.#fs.writeBinary(archivePath, input.archive);
|
|
586
593
|
version.archivePath = archivePath;
|
|
587
594
|
}
|
|
588
|
-
await this.#fs
|
|
595
|
+
await atomicWriteText(this.#fs, `${dirOf(this.#root, skillName)}/${version.versionId}.json`, JSON.stringify(version, null, 2));
|
|
589
596
|
await this.#prune(skillName);
|
|
590
597
|
return version;
|
|
591
598
|
}
|
|
@@ -780,7 +787,7 @@ var SkillStatePolicy = class {
|
|
|
780
787
|
async #persist() {
|
|
781
788
|
const data = await this.#load();
|
|
782
789
|
const path = fileOf(this.#root);
|
|
783
|
-
await this.#fs
|
|
790
|
+
await atomicWriteText(this.#fs, path, JSON.stringify(data, null, 2));
|
|
784
791
|
try {
|
|
785
792
|
this.#loadedMtimeMs = (await this.#fs.stat(path)).mtimeMs;
|
|
786
793
|
} catch {
|
|
@@ -1025,14 +1032,17 @@ var EvaluationRunner = class {
|
|
|
1025
1032
|
/** 失败 trace → 回归评估任务建议(prompt 复现 + expected 错误模式) */
|
|
1026
1033
|
function suggestFromFailedRun(run) {
|
|
1027
1034
|
const errorPatterns = run.trace.filter((e) => e.type === "tool.failed" || e.type === "run.failed").map((e) => String(e.data?.["code"] ?? e.message ?? "")).filter(Boolean);
|
|
1035
|
+
const failedSkills = [...new Set(run.trace.filter((e) => e.type === "tool.failed").map((e) => e.data?.["skillName"]).filter((name) => typeof name === "string" && name !== ""))];
|
|
1028
1036
|
return {
|
|
1029
1037
|
id: `regression-${run.id}`,
|
|
1030
1038
|
prompt: run.userPrompt,
|
|
1039
|
+
...run.activeSkillNames.length > 0 ? { skillNames: [...run.activeSkillNames] } : {},
|
|
1031
1040
|
expected: (output, rerun) => rerun.status === "completed" && !rerun.trace.some((e) => (e.type === "tool.failed" || e.type === "run.failed") && errorPatterns.includes(String(e.data?.["code"] ?? ""))),
|
|
1032
1041
|
metadata: {
|
|
1033
1042
|
source: "test-suggestion",
|
|
1034
1043
|
failureReason: run.terminationReason ?? "unknown",
|
|
1035
|
-
errorPatterns
|
|
1044
|
+
errorPatterns,
|
|
1045
|
+
failedSkills
|
|
1036
1046
|
}
|
|
1037
1047
|
};
|
|
1038
1048
|
}
|
|
@@ -1168,7 +1178,7 @@ var DocumentSkillExtractor = class {
|
|
|
1168
1178
|
documentHash: input.document.hash
|
|
1169
1179
|
};
|
|
1170
1180
|
await this.#audit?.append({
|
|
1171
|
-
type:
|
|
1181
|
+
type: AUDIT_EVENT_TYPES.candidateCreated,
|
|
1172
1182
|
target: candidate.id,
|
|
1173
1183
|
data: {
|
|
1174
1184
|
name: candidate.name,
|
|
@@ -1208,6 +1218,15 @@ function createMissHook(deps) {
|
|
|
1208
1218
|
source: "runtime-miss"
|
|
1209
1219
|
});
|
|
1210
1220
|
await deps.store.save(candidate);
|
|
1221
|
+
await deps.audit?.append({
|
|
1222
|
+
type: AUDIT_EVENT_TYPES.candidateGenerated,
|
|
1223
|
+
actor: "system",
|
|
1224
|
+
target: candidate.name,
|
|
1225
|
+
data: {
|
|
1226
|
+
source: "runtime-miss",
|
|
1227
|
+
candidateId: candidate.id
|
|
1228
|
+
}
|
|
1229
|
+
});
|
|
1211
1230
|
};
|
|
1212
1231
|
}
|
|
1213
1232
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { E as UiSpecSnapshot,
|
|
2
|
-
import { k as ExternalToolSource } from "./index-
|
|
1
|
+
import { E as UiSpecSnapshot, S as UiSpecActionCapability, c as InteractionResponse, r as ChartSpec, s as InteractionRequest, v as RenderBlock, x as UiBridge, y as RenderResultRequest, yt as UiSpecNode, z as JsonSchema } from "./types-B3n0cMZu-BDhheIhX.js";
|
|
2
|
+
import { k as ExternalToolSource } from "./index-znZjobkr.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { ComponentType, ReactNode } from "react";
|
|
5
5
|
//#region ../ui/dist/index.d.ts
|
|
@@ -15,7 +15,8 @@ interface FormModel {
|
|
|
15
15
|
interface ControlModel {
|
|
16
16
|
name: string;
|
|
17
17
|
label: string;
|
|
18
|
-
|
|
18
|
+
/** `password` 在不支持它的渲染档里必须**不渲染**,退化成文本框等于明文显示 */
|
|
19
|
+
control: 'text' | 'number' | 'boolean' | 'select' | 'textarea' | 'file' | 'password';
|
|
19
20
|
required?: boolean;
|
|
20
21
|
description?: string;
|
|
21
22
|
defaultValue?: unknown;
|
|
@@ -36,10 +37,53 @@ interface ControlModel {
|
|
|
36
37
|
reason?: string;
|
|
37
38
|
};
|
|
38
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* 渲染库不持有字典,文案由调用方注入(设计 16 §2.1)。
|
|
42
|
+
*
|
|
43
|
+
* 缺省值保留英文:`webFormBridge` 这类无宿主场景仍要能跑——
|
|
44
|
+
* 这些英文缺省**不是**漏译,是没有宿主时的兜底。
|
|
45
|
+
*/
|
|
46
|
+
interface InteractionTexts {
|
|
47
|
+
submit?: string;
|
|
48
|
+
cancel?: string;
|
|
49
|
+
confirm?: string;
|
|
50
|
+
select?: string;
|
|
51
|
+
allow?: string;
|
|
52
|
+
deny?: string;
|
|
53
|
+
chooseFile?: string;
|
|
54
|
+
decline?: string;
|
|
55
|
+
/** 必填校验未通过时的提示 */
|
|
56
|
+
required?: string;
|
|
57
|
+
/** 建议值的前缀,如「建议:」 */
|
|
58
|
+
suggested?: string;
|
|
59
|
+
/** 采纳建议值的按钮 */
|
|
60
|
+
useSuggestion?: string;
|
|
61
|
+
}
|
|
62
|
+
declare const DEFAULT_INTERACTION_TEXTS: Required<InteractionTexts>;
|
|
63
|
+
declare function resolveInteractionTexts(texts?: InteractionTexts): Required<InteractionTexts>;
|
|
64
|
+
/**
|
|
65
|
+
* surface 表单的文案契约(设计 22 §2.1)。四档渲染器共用,
|
|
66
|
+
* 其中 a2ui 档是 Lit 实现、在本包内,所以契约落在 `@webskill/ui` 而不是 `ui-react`。
|
|
67
|
+
*/
|
|
68
|
+
interface SurfaceFormTexts {
|
|
69
|
+
required: string;
|
|
70
|
+
submit: string;
|
|
71
|
+
cancel: string;
|
|
72
|
+
/** `FieldArray` 的增 / 删按钮 */
|
|
73
|
+
addItem: string;
|
|
74
|
+
removeItem: string;
|
|
75
|
+
/** 降级档(a2ui / OpenUI / vercel)只渲染重复组第一项时的说明 */
|
|
76
|
+
arrayFirstItemOnly: string;
|
|
77
|
+
/** 历史快照(宿主未接 action)的一次性只读说明 */
|
|
78
|
+
readOnlySnapshot: string;
|
|
79
|
+
}
|
|
80
|
+
/** 可复用的部分取自 DEFAULT_INTERACTION_TEXTS,不另抄一份(AC-G10) */
|
|
81
|
+
declare const DEFAULT_SURFACE_FORM_TEXTS: SurfaceFormTexts;
|
|
82
|
+
declare function resolveSurfaceFormTexts(texts?: Partial<SurfaceFormTexts>): SurfaceFormTexts;
|
|
39
83
|
/** 提交值按请求类型归形(WebFormBridge 与框架组件库共享单一来源) */
|
|
40
84
|
declare function shapeInteractionValue(model: FormModel, values: Record<string, unknown>): unknown;
|
|
41
85
|
/** 五类 InteractionRequest → 统一中间模型(框架无关) */
|
|
42
|
-
declare function interactionToFormModel(request: InteractionRequest): FormModel;
|
|
86
|
+
declare function interactionToFormModel(request: InteractionRequest, texts?: InteractionTexts): FormModel;
|
|
43
87
|
//#endregion
|
|
44
88
|
//#region src/model/collectValues.d.ts
|
|
45
89
|
interface CollectedValues {
|
|
@@ -117,6 +161,8 @@ declare class WebFormBridge implements UiBridge {
|
|
|
117
161
|
mount: HTMLElement;
|
|
118
162
|
document?: Document;
|
|
119
163
|
styles?: boolean;
|
|
164
|
+
/** 不传时用英文缺省:本类的使用场景包括无宿主的裸页面 */
|
|
165
|
+
texts?: InteractionTexts;
|
|
120
166
|
});
|
|
121
167
|
request(input: InteractionRequest): Promise<InteractionResponse>;
|
|
122
168
|
/** 尽力取消等待中的 request(超时后清理遗留表单) */
|
|
@@ -175,6 +221,23 @@ type UiSpecValidation = {
|
|
|
175
221
|
ok: false;
|
|
176
222
|
issues: UiSpecIssue[];
|
|
177
223
|
};
|
|
224
|
+
/** 渲染层逐节点降级的记录(设计 23-01 §1.1)。每条都要能定位到节点与原因 */
|
|
225
|
+
interface UiSpecDegradation {
|
|
226
|
+
/** 与 `UiSpecIssue.path` 同格式 */
|
|
227
|
+
path: string;
|
|
228
|
+
/**
|
|
229
|
+
* `unknown-component` 与其余几类不同:它意味着模型给出了 catalog 之外的组件名,
|
|
230
|
+
* 属于越界而不是「这个档做不到」,呈现上必须保持响亮(见 23-01 §3.1 的中性说明例外)。
|
|
231
|
+
*/
|
|
232
|
+
kind: 'prop-dropped' | 'node-dropped' | 'unknown-component' | 'constraint-ignored' | 'condition-invalid';
|
|
233
|
+
component: string;
|
|
234
|
+
detail: string;
|
|
235
|
+
}
|
|
236
|
+
interface UiSpecSanitization {
|
|
237
|
+
/** `undefined` 表示连根节点都救不回来 */
|
|
238
|
+
node: UiSpecNode | undefined;
|
|
239
|
+
degradations: readonly UiSpecDegradation[];
|
|
240
|
+
}
|
|
178
241
|
interface UiCatalogPromptOptions {
|
|
179
242
|
/** tool-description 模式省略标题层级,直接作为工具描述使用 */
|
|
180
243
|
mode?: 'document' | 'tool-description';
|
|
@@ -198,6 +261,12 @@ interface UiCatalog extends UiCatalogInput {
|
|
|
198
261
|
toPrompt(options?: UiCatalogPromptOptions): string;
|
|
199
262
|
/** 运行时越界拒绝(安全边界) */
|
|
200
263
|
validate(spec: unknown): UiSpecValidation;
|
|
264
|
+
/**
|
|
265
|
+
* 渲染层的逐节点降级投影。与 `validate` 并列而不是取代它:
|
|
266
|
+
* 工具层收到模型的非法输出**应该**整块拒绝(让模型学到正确语法),
|
|
267
|
+
* 而已经进到渲染层的 spec 可能来自快照重放或更早的语法版本,整块拒绝等于整块消失。
|
|
268
|
+
*/
|
|
269
|
+
sanitize(spec: unknown): UiSpecSanitization;
|
|
201
270
|
}
|
|
202
271
|
//#endregion
|
|
203
272
|
//#region src/catalog/defineCatalog.d.ts
|
|
@@ -217,7 +286,7 @@ declare const uiCatalog: UiCatalog;
|
|
|
217
286
|
declare const UI_CATALOG_GROUPS: {
|
|
218
287
|
readonly content: readonly ["Stack", "Card", "Separator", "Heading", "Text", "Markdown", "Badge"];
|
|
219
288
|
readonly data: readonly ["Metric", "Table", "Chart", "Timeline", "FileLink"];
|
|
220
|
-
readonly input: readonly ["Form", "Field", "Button"];
|
|
289
|
+
readonly input: readonly ["Form", "Field", "FieldArray", "Button"];
|
|
221
290
|
};
|
|
222
291
|
/**
|
|
223
292
|
* catalog 系统提示的体积上限(UTF-8 字节,FR-6.6)。
|
|
@@ -264,6 +333,94 @@ declare function qualifyFieldName(name: string, scopeId?: string): string;
|
|
|
264
333
|
*/
|
|
265
334
|
declare function collectScopedValues(values: Readonly<Record<string, unknown>>, scope?: Pick<UiFormScope, 'scopeId' | 'fieldNames'>): Record<string, unknown>;
|
|
266
335
|
//#endregion
|
|
336
|
+
//#region src/catalog/fieldCondition.d.ts
|
|
337
|
+
/**
|
|
338
|
+
* `Field.visibleWhen` 的结构化条件(设计 23 §1.2)。
|
|
339
|
+
*
|
|
340
|
+
* 不用表达式字符串:让模型输出可执行的东西,安全边界就没了。
|
|
341
|
+
*/
|
|
342
|
+
type FieldCondition = {
|
|
343
|
+
field: string;
|
|
344
|
+
equals: string | number | boolean;
|
|
345
|
+
} | {
|
|
346
|
+
field: string;
|
|
347
|
+
in: (string | number)[];
|
|
348
|
+
} | {
|
|
349
|
+
field: string;
|
|
350
|
+
notEmpty: true;
|
|
351
|
+
} | {
|
|
352
|
+
allOf: FieldCondition[];
|
|
353
|
+
} | {
|
|
354
|
+
anyOf: FieldCondition[];
|
|
355
|
+
};
|
|
356
|
+
/**
|
|
357
|
+
* 条件树的语义深度上限。
|
|
358
|
+
* `MAX_JSON_DEPTH` 管的是 props 的 JSON 深度,管不到这里——超它之前就能先把栈打爆。
|
|
359
|
+
*/
|
|
360
|
+
declare const MAX_CONDITION_DEPTH = 8;
|
|
361
|
+
interface FieldConditionResult {
|
|
362
|
+
visible: boolean;
|
|
363
|
+
/** 非法条件不抛异常,降级为「始终显示」并留下记录(FR-23.3) */
|
|
364
|
+
degraded?: Omit<UiSpecDegradation, 'component'>;
|
|
365
|
+
}
|
|
366
|
+
interface EvaluateFieldConditionOptions {
|
|
367
|
+
/** 条件里的字段名 → 值表里的键。多表单时传 `qualifyFieldName` 的结果 */
|
|
368
|
+
resolveField?(field: string): string;
|
|
369
|
+
/** 降级记录里的路径 */
|
|
370
|
+
path?: string;
|
|
371
|
+
}
|
|
372
|
+
/**
|
|
373
|
+
* 全仓唯一的条件求值实现(AC-23.4)。纯函数、无 React 依赖——
|
|
374
|
+
* `useSurfaceForm` 在 ui-react 且是 hook,ui-vue 用不了它。
|
|
375
|
+
*/
|
|
376
|
+
declare function evaluateFieldCondition(condition: unknown, values: Readonly<Record<string, unknown>>, options?: EvaluateFieldConditionOptions): FieldConditionResult;
|
|
377
|
+
//#endregion
|
|
378
|
+
//#region src/catalog/tableColumns.d.ts
|
|
379
|
+
/**
|
|
380
|
+
* 生成式表格的列模型(分册 15-03 定义 `priority`,分册 25 在同一结构上追加 `weight`)。
|
|
381
|
+
*
|
|
382
|
+
* 四个渲染档共用这一份:native / json-render / OpenUI 走 TS,a2ui 是 Lit,
|
|
383
|
+
* 后者读不到 TS 常量,所以最小列宽以 **CSS 变量**交付,两侧引用同一个名字。
|
|
384
|
+
*/
|
|
385
|
+
/** 最小列宽的分档取值。`desktop` 沿用历史值,改它会动所有既有表格的视觉基线 */
|
|
386
|
+
declare const SPEC_TABLE_MIN_COLUMN_WIDTH: {
|
|
387
|
+
readonly desktop: "8rem";
|
|
388
|
+
readonly mobile: "5rem";
|
|
389
|
+
};
|
|
390
|
+
/** CSS 侧的引用名:`surfaces.css` 与 a2ui 的 Lit 样式都只写这个变量,不写字面量 */
|
|
391
|
+
declare const SPEC_TABLE_MIN_COLUMN_VAR = "--webskill-table-min-col";
|
|
392
|
+
interface SpecColumnMeta {
|
|
393
|
+
/** 窄档隐藏 `wide` 列;缺省 `always` */
|
|
394
|
+
priority: 'always' | 'wide';
|
|
395
|
+
/** 列宽权重(`columnWidths` 的单列取值) */
|
|
396
|
+
weight?: number;
|
|
397
|
+
}
|
|
398
|
+
/** `columnWidths` 非法时的原因,进 `ui.degraded` 的载荷 */
|
|
399
|
+
type ColumnWidthsRejection = 'length-mismatch' | 'non-finite' | 'negative' | 'all-zero';
|
|
400
|
+
interface NormalizedColumnWidths {
|
|
401
|
+
weights: number[];
|
|
402
|
+
/** 有值即整项被忽略、已回退等权重 */
|
|
403
|
+
rejected?: ColumnWidthsRejection;
|
|
404
|
+
}
|
|
405
|
+
/**
|
|
406
|
+
* 校验并归一化 `columnWidths`。
|
|
407
|
+
*
|
|
408
|
+
* **整项忽略**是刻意的:部分采纳(例如只丢掉那个负数)会让模型拿到一个
|
|
409
|
+
* 「看起来生效了」的结果,更难发现自己写错了(FR-25.3)。
|
|
410
|
+
*/
|
|
411
|
+
declare function normalizeColumnWidths(raw: readonly number[] | undefined, columnCount: number): NormalizedColumnWidths;
|
|
412
|
+
/**
|
|
413
|
+
* 按权重分配列宽,且每列不低于 `minWidth`。
|
|
414
|
+
*
|
|
415
|
+
* 朴素实现(按权重算一遍、低于下限的抬到下限)会让总宽超出容器,
|
|
416
|
+
* 白白产生本可避免的横滚。这里迭代到不动点:每轮把触底的列钉住,
|
|
417
|
+
* 剩余空间在剩余列间按权重重新分配(FR-25.2)。
|
|
418
|
+
*
|
|
419
|
+
* 容器本身放不下 `columnCount * minWidth` 时无解——此时全部取下限并返回,
|
|
420
|
+
* 由调用方决定横滚(AC-25.4)。
|
|
421
|
+
*/
|
|
422
|
+
declare function resolveColumnWidths(weights: readonly number[], available: number, minWidth: number): number[];
|
|
423
|
+
//#endregion
|
|
267
424
|
//#region src/catalog/presets.d.ts
|
|
268
425
|
/** 场景预设名(FR-6.4) */
|
|
269
426
|
type UiPresetName = 'charts' | 'cards' | 'dashboards' | 'slides' | 'reports';
|
|
@@ -608,4 +765,4 @@ interface LoadedOpenUiPeers {
|
|
|
608
765
|
*/
|
|
609
766
|
declare function loadOpenUiPeers(): Promise<LoadedOpenUiPeers>;
|
|
610
767
|
//#endregion
|
|
611
|
-
export {
|
|
768
|
+
export { UiSpecIssue as $, MAX_CONDITION_DEPTH as A, interactionToUiSpec as At, UI_CATALOG_PROMPT_BUDGET_BYTES as B, resolveColumnWidths as Bt, FieldCondition as C, ensureStyles as Ct, InteractionTexts as D, fromUiSurfaceActionDispatch as Dt, InteractionSpecLabels as E, fromA2uiSurfaceAction as Et, SPEC_TABLE_MIN_COLUMN_VAR as F, qualifyFieldName as Ft, UiCatalogInput as G, toA2uiSurfaceAction as Gt, UI_PRESET_NAMES as H, resolveSurfaceFormTexts as Ht, SPEC_TABLE_MIN_COLUMN_WIDTH as I, renderBlocks as It, UiComponentDef as J, toUiSurfaceActionDispatch as Jt, UiCatalogPromptOptions as K, toJsonRenderSpec as Kt, SpecColumnMeta as L, renderMiniChart as Lt, OpenUiRendererProps as M, loadWebSkillLitCatalog as Mt, OpenUiRuntime as N, mountEchart as Nt, JsonRenderSpec as O, fromVercelToolResult as Ot, RENDER_UI_TOOL as P, normalizeColumnWidths as Pt, UiSpecDegradation as Q, SurfaceFormTexts as R, renderMiniMarkdown as Rt, EvaluateFieldConditionOptions as S, defineUiCatalog as St, FormModel as T, fromA2uiSpecAction as Tt, UiActionDef as U, shapeInteractionValue as Ut, UI_PRESETS as V, resolveInteractionTexts as Vt, UiCatalog as W, toA2uiSpecMessages as Wt, UiPreset as X, uiCatalog as Xt, UiFormScope as Y, toVercelToolInvocation as Yt, UiPresetName as Z, uiPreset as Zt, ControlModel as _, collectFormScopes as _t, A2UI_SURFACE_ACTION as a, VercelUiBridge as at, DESCRIBE_UI_PRESET_TOOL as b, collectValues as bt, A2uiCatalogDefinition as c, WEBSKILL_SURFACE_ACTION as ct, A2uiMessage as d, a2uiComponentSchema as dt, UiSpecSanitization as et, A2uiSpecActionEvent as f, a2uiComponentShapes as ft, ColumnWidthsRejection as g, chartToTable as gt, CollectedValues as h, chartSpecFromProps as ht, A2UI_SPEC_FORM_PATH as i, VercelToolInvocation as it, NormalizedColumnWidths as j, loadOpenUiPeers as jt, LoadedOpenUiPeers as k, interactionToFormModel as kt, A2uiCatalogHandle as l, WebFormBridge as lt, CHART_PALETTE as m, buildA2uiCatalogDefinition as mt, A2UI_COMMON_TYPES as n, UiSurfaceActionDispatch as nt, A2UI_VERSION as o, WEBSKILL_A2UI_CATALOG_ID as ot, A2uiSpecMessageOptions as p, applySuggestion as pt, UiCatalogToolSourceOptions as q, toOpenUiSpecLang as qt, A2UI_SPEC_ACTION as r, VERCEL_INTERACTION_TOOL_NAME as rt, A2uiCatalogComponent as s, WEBSKILL_STYLES_CSS as st, A2UI_BASIC_CATALOG_ID as t, UiSpecValidation as tt, A2uiComponentShape as u, ZodRuntime as ut, DEFAULT_INTERACTION_TEXTS as v, collectScopedValues as vt, FieldConditionResult as w, evaluateFieldCondition as wt, EchartHandle as x, createUiCatalogToolSource as xt, DEFAULT_SURFACE_FORM_TEXTS as y, collectSpecActions as yt, UI_CATALOG_GROUPS as z, renderRenderResult as zt };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as InteractionOrigin, c as InteractionResponse, s as InteractionRequest, x as UiBridge } from "./types-
|
|
2
|
-
import { k as ExternalToolSource } from "./index-
|
|
1
|
+
import { a as InteractionOrigin, c as InteractionResponse, s as InteractionRequest, x as UiBridge } from "./types-B3n0cMZu-BDhheIhX.js";
|
|
2
|
+
import { k as ExternalToolSource } from "./index-znZjobkr.js";
|
|
3
3
|
//#region ../agent/dist/index.d.ts
|
|
4
4
|
//#region src/todo/types.d.ts
|
|
5
5
|
/** 待办条目状态:未开始 / 进行中 / 已完成(FR-3.1) */
|