@webskill/chatbot 0.24.0 → 0.24.2
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/config.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +28 -2
- package/dist/{parse-BaIF8Nm5.js → parse-B6YPceVb.js} +3 -1
- package/dist/vite.js +1 -1
- package/package.json +2 -2
package/dist/config.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as mergeRuntimeConfigDefaults } from "./types-DzBMgDa6.js";
|
|
2
|
-
import { a as NON_CONFIGURABLE_RUNTIME_PATHS, i as CONFIG_FIELDS, n as parseWebSkillConfig, o as WebSkillConfigError, r as CONFIGURED_RUNTIME_PATHS, t as CONFIG_TOP_LEVEL_SECTIONS } from "./parse-
|
|
2
|
+
import { a as NON_CONFIGURABLE_RUNTIME_PATHS, i as CONFIG_FIELDS, n as parseWebSkillConfig, o as WebSkillConfigError, r as CONFIGURED_RUNTIME_PATHS, t as CONFIG_TOP_LEVEL_SECTIONS } from "./parse-B6YPceVb.js";
|
|
3
3
|
|
|
4
4
|
//#region ../ui-kit/src/runtime-config/siteAccess.ts
|
|
5
5
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -3494,6 +3494,6 @@ declare function ErrorCard({ code, message, loopLimits, onOpenSettings, onDismis
|
|
|
3494
3494
|
* Version of the published `@webskill/chatbot` package, injected at build time.
|
|
3495
3495
|
* @stable
|
|
3496
3496
|
*/
|
|
3497
|
-
declare const CHATBOT_VERSION = "0.24.
|
|
3497
|
+
declare const CHATBOT_VERSION = "0.24.2";
|
|
3498
3498
|
//#endregion
|
|
3499
3499
|
export { A2uiSurfaceHost, type A2uiSurfaceHostProps, A2uiSurfaceSnapshotHost, type A2uiSurfaceSnapshotHostProps, type AppearanceChange, CHATBOT_VERSION, type ChatAttachmentInput, type ChatAttachmentMeta, type ChatComponent, type ChatComponentCallRecord, type ChatComponentConfirmation, type ChatComponentCredentialField, type ChatComponentInvokeContext, type ChatComponentOutcome, type ChatComponentStore, type ChatComponentText, type ChatContentPart, ChatEngine, type ChatEngineOptions, type ChatEvent, type ChatInteractionRecord, type ChatLayout, type ChatMessage, type ChatRunPhase, type ChatSessionListResult, type ChatSessionMeta, type ChatTheme, type ChatThinking, type ChatTokenUsage, type ChatToolCall, Chatbot, type ChatbotConfig, type ChatbotGovernancePorts, type ChatbotHostAdapter, type ChatbotProps, ChatbotVisionDelegate, type ChatbotVisionDelegateOptions, CompositeUiBridge, type CompositeUiBridgeDeps, DEFAULT_RENDERER_CAPABILITIES, DEFAULT_RUNTIME_CONFIG_STORAGE_KEY, type DownloadableFile, type DwgHost, ErrorCard, type ErrorCardProps, type HttpMessageComponentOptions, InteractionCard, type InteractionCardProps, InterruptedBanner, type InterruptedBannerProps, type Locale, type LocalizedText, OpenUiSurfaceHost, type OpenUiSurfaceHostProps, OpenUiSurfaceSnapshotHost, type OpenUiSurfaceSnapshotHostProps, type QuickPrompt, type QuickPromptIconName, type RendererCapability, type RendererKind, type ResolvedChatLayout, ResultBlockList, type ResultBlockListProps, ResultBlocksPro, type ResultBlocksProProps, type RunSnapshot, type RuntimeAppearanceConfig, type RuntimeConfig, type RuntimeConfigStore, type RuntimeQuickPrompt, type RuntimeRendererId, type SandboxExecutorDeps, type SettingsSectionId, SkillBadges, SpecInteraction, type SpecInteractionProps, VercelPayloadPreview, type VercelPayloadPreviewProps, VercelSurfaceHost, type VercelSurfaceHostProps, VercelSurfaceSnapshotHost, type VercelSurfaceSnapshotHostProps, type VisionDelegationConsent, type VisionDelegationEndpoint, WEB_OFFICE_TEMPLATE_PREFIX, chatbotDictionary, configureA2uiMarkdown, createHttpMessageComponent, createLocalStorageRuntimeConfigStore, createMemoryRuntimeConfigStore, isLlmEntryUsable, pickUsableLlmEntry, probeA2uiAvailability, probeOpenUiAvailability, sandboxExecutorDeps, useT };
|
package/dist/index.js
CHANGED
|
@@ -28767,6 +28767,28 @@ var ChatEngine = class {
|
|
|
28767
28767
|
}
|
|
28768
28768
|
}
|
|
28769
28769
|
/**
|
|
28770
|
+
* 本 run 的附件与 run 所属会话里较早消息的附件字节,id 与文件名都认(模板工具用)。
|
|
28771
|
+
*
|
|
28772
|
+
* 范围与 `#loadTable` 相同:只查这个会话,别的会话的 id 取不到;路径取自附件记录,一寸都不来自模型。
|
|
28773
|
+
* 会话取 run 所属的那个而不是界面选中的:run 进行中用户可能已切走。
|
|
28774
|
+
*/
|
|
28775
|
+
async #sessionAttachmentBytes(id, runId) {
|
|
28776
|
+
let hit = findAttachmentByRef(this.#runAttachments, id);
|
|
28777
|
+
if (hit === void 0) {
|
|
28778
|
+
const sessionId = (runId !== void 0 ? await this.#sessionOfRun(runId) : void 0) ?? this.#currentSessionId;
|
|
28779
|
+
const messages = sessionId === void 0 ? [] : (await this.#sessions.get(sessionId).catch(() => void 0))?.messages ?? [];
|
|
28780
|
+
for (let i = messages.length - 1; i >= 0 && hit === void 0; i -= 1) {
|
|
28781
|
+
const message = messages[i];
|
|
28782
|
+
if (message?.role === "user") hit = findAttachmentByRef(message.attachments ?? [], id);
|
|
28783
|
+
}
|
|
28784
|
+
}
|
|
28785
|
+
if (hit === void 0) return void 0;
|
|
28786
|
+
return {
|
|
28787
|
+
name: hit.name,
|
|
28788
|
+
bytes: await this.#adapter.storage.readBinary(resolveInsideRoot(this.attachmentsRoot, hit.path))
|
|
28789
|
+
};
|
|
28790
|
+
}
|
|
28791
|
+
/**
|
|
28770
28792
|
* `skill:<技能名>/<路径>` 的取件(0.23.0 分册 23 FR-23.1)。
|
|
28771
28793
|
*
|
|
28772
28794
|
* 这条通路**不经过** `DownloadedFilePolicy`,所以既不弹授权卡也不列下载目录——
|
|
@@ -30136,6 +30158,10 @@ var ChatEngine = class {
|
|
|
30136
30158
|
* `weboffice:` 在接了下载端口的宿主里就是这么失效的(设计 24 §1 实测)。
|
|
30137
30159
|
*
|
|
30138
30160
|
* 不回落同样是硬的:带前缀的号是指名的那一份,回落等于拿另一份文档冒充它。
|
|
30161
|
+
*
|
|
30162
|
+
* 附件不限本轮:「先传表、下一句再叫它填」是最常见的顺序,只认本轮附件,第二句话就读不到
|
|
30163
|
+
* (`query_table` 早已如此,FR-10.14)。本会话里没有的才回落到 `readDocumentBytes`,
|
|
30164
|
+
* 去查本 run 的页面字节与下载目录。
|
|
30139
30165
|
*/
|
|
30140
30166
|
const readTemplateBytes = async (id, context) => {
|
|
30141
30167
|
if (id.startsWith("skill:")) return await this.#readSkillTemplate(id, fs);
|
|
@@ -30144,7 +30170,7 @@ var ChatEngine = class {
|
|
|
30144
30170
|
if (!online) throw new WebSkillError("TOOL_UNSUPPORTED", `Cannot read "${id}": this conversation has no online document source attached.`);
|
|
30145
30171
|
return await online.read(id.slice(10), context);
|
|
30146
30172
|
}
|
|
30147
|
-
return await readDocumentBytes(id, context);
|
|
30173
|
+
return await this.#sessionAttachmentBytes(id, context?.runId) ?? await readDocumentBytes(id, context);
|
|
30148
30174
|
};
|
|
30149
30175
|
/**
|
|
30150
30176
|
* 模板取件号里那些**宿主接了才存在**的说法(0.22.0 FR-42.12、0.23.0 FR-23.3)。
|
|
@@ -46794,7 +46820,7 @@ function VercelPayloadPreview({ bridge }) {
|
|
|
46794
46820
|
* Version of the published `@webskill/chatbot` package, injected at build time.
|
|
46795
46821
|
* @stable
|
|
46796
46822
|
*/
|
|
46797
|
-
const CHATBOT_VERSION = "0.24.
|
|
46823
|
+
const CHATBOT_VERSION = "0.24.2";
|
|
46798
46824
|
|
|
46799
46825
|
//#endregion
|
|
46800
46826
|
export { A2uiSurfaceHost, A2uiSurfaceSnapshotHost, CHATBOT_VERSION, ChatEngine, Chatbot, ChatbotVisionDelegate, CompositeUiBridge, DEFAULT_RENDERER_CAPABILITIES, DEFAULT_RUNTIME_CONFIG_STORAGE_KEY, ErrorCard, InteractionCard, InterruptedBanner, OpenUiSurfaceHost, OpenUiSurfaceSnapshotHost, ResultBlockList, ResultBlocksPro, SkillBadges, SpecInteraction, VercelPayloadPreview, VercelSurfaceHost, VercelSurfaceSnapshotHost, WEB_OFFICE_TEMPLATE_PREFIX, chatbotDictionary, configureA2uiMarkdown, createHttpMessageComponent, createLocalStorageRuntimeConfigStore, createMemoryRuntimeConfigStore, isLlmEntryUsable, pickUsableLlmEntry, probeA2uiAvailability, probeOpenUiAvailability, sandboxExecutorDeps, useT };
|
|
@@ -480,7 +480,8 @@ function parseModels(raw, secrets, root) {
|
|
|
480
480
|
"model",
|
|
481
481
|
"requestTimeoutMs",
|
|
482
482
|
"capabilities",
|
|
483
|
-
"thinkingBudgetTokens"
|
|
483
|
+
"thinkingBudgetTokens",
|
|
484
|
+
"contextWindow"
|
|
484
485
|
], path);
|
|
485
486
|
const id = readString(source["id"], `${path}.id`);
|
|
486
487
|
if (seen.has(id)) fail("CONFIG_REFERENCE", `${path}.id`, `${path}.id duplicates an earlier entry: ${id}`);
|
|
@@ -495,6 +496,7 @@ function parseModels(raw, secrets, root) {
|
|
|
495
496
|
if (source["baseUrl"] !== void 0) entry.baseUrl = readString(source["baseUrl"], `${path}.baseUrl`);
|
|
496
497
|
if (source["requestTimeoutMs"] !== void 0) entry.requestTimeoutMs = readInt(source["requestTimeoutMs"], `${path}.requestTimeoutMs`, LLM_ENTRY_BOUNDS.requestTimeoutMs);
|
|
497
498
|
if (source["thinkingBudgetTokens"] !== void 0) entry.thinkingBudgetTokens = readInt(source["thinkingBudgetTokens"], `${path}.thinkingBudgetTokens`);
|
|
499
|
+
if (source["contextWindow"] !== void 0) entry.contextWindow = readInt(source["contextWindow"], `${path}.contextWindow`, LLM_ENTRY_BOUNDS.contextWindow);
|
|
498
500
|
if (source["capabilities"] !== void 0) {
|
|
499
501
|
const caps = expectObject(source["capabilities"], `${path}.capabilities`);
|
|
500
502
|
rejectUnknownKeys(caps, ["tools", "image"], `${path}.capabilities`);
|
package/dist/vite.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webskill/chatbot",
|
|
3
|
-
"version": "0.24.
|
|
3
|
+
"version": "0.24.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@a2ui/web_core": "^0.10.5",
|
|
39
39
|
"@lit/context": "^1.1.0",
|
|
40
40
|
"@openuidev/react-lang": "0.2.8",
|
|
41
|
-
"@webskill/sdk": "^0.
|
|
41
|
+
"@webskill/sdk": "^0.27.0",
|
|
42
42
|
"mermaid": "^12.0.0",
|
|
43
43
|
"react": ">=19.0.0",
|
|
44
44
|
"react-dom": ">=19.0.0",
|