@tanzerfe/page-use 0.0.13 → 0.0.15
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/flow.d.mts +1 -1
- package/dist/flow.mjs +1 -1
- package/dist/{index-CzWLOKue.d.mts → index-XRyK_b1h.d.mts} +26 -8
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +3 -3
- package/dist/{options-CS8LsaB8.d.mts → options-BIwnIeed.d.mts} +35 -2
- package/dist/{src-BgrtN4uP.mjs → src-Cus5n_PO.mjs} +128 -33
- package/dist/{tool-B-3dgswr.mjs → tool-C9eKI80l.mjs} +138 -38
- package/dist/vue.d.mts +3 -3
- package/dist/vue.mjs +3 -3
- package/package.json +2 -1
package/dist/flow.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as FlowApiSyncOptions, $t as FlowScope, A as MountPageUseManagerOptions, At as FlowManagerState, B as parseFlowRegion, Bt as FlowRegionContext, Ct as FlowIdentity, D as PAGE_USE_FLOW_TOOL, Dt as FlowKnowledge, Et as FlowInputDefinition, F as PageUseManagerPresentation, Ft as FlowPermissions, G as validateFlowInputs, Gt as FlowRepository, H as parseFlowSceneDraft, Ht as FlowRegionHost, I as FLOW_SEGMENT_MAX_CHARS, It as FlowPresenter, J as FLOW_SCHEMA_VERSION, Jt as FlowRunOptions, K as validateSceneBindings, Kt as FlowRepositorySnapshot, L as newRevision, Lt as FlowRegion, M as mountPageUseManager, Mt as FlowOutputReference, N as PAGE_USE_MANAGER_TAG, Nt as FlowParameter, O as getPageUseFlowCatalog, Ot as FlowKnowledgeRecord, P as PageUseManagerElement, Pt as FlowParameterDefinition, Q as FlowApiResponse, Qt as FlowSceneRecord, R as parseFlowBundle, Rt as FlowRegionAnchor, St as FlowGenerator, Tt as FlowImportStrategy, U as sceneKey, Ut as FlowRegionPage, V as parseFlowScene, Vt as FlowRegionFailure, W as scopeKey, Wt as FlowRegionSelector, X as FlowActionBinding, Xt as FlowRunner, Y as FlowAction, Yt as FlowRunResult, Z as FlowApiRequest, Zt as FlowScene, _t as FlowError, an as FlowStep, at as FlowClient, bt as FlowExecutionPorts, cn as JsonValue, ct as FlowCloudController, dt as FlowCompletionDecision, en as FlowSegment, et as FlowBindings, ft as FlowCompletionEvaluator, gt as FlowDescriptionCheck, ht as FlowContextBinding, in as FlowStatus, it as FlowCheckBinding, j as definePageUseManagerElement, jt as FlowMode, k as runPageUseFlowTool, kt as FlowManager, ln as PageUseFlowHandle, lt as FlowCloudRelease, mt as FlowContext, nn as FlowSessionContext, nt as FlowBundle, o as NormalizedLLMOptions, on as FlowTombstone, ot as FlowCloudAdapter, pt as FlowConfigResponse, q as FLOW_BUNDLE_VERSION, qt as FlowResolvedTarget, rn as FlowSnapshot, rt as FlowCheck, sn as JsonObject, st as FlowCloudCache, tn as FlowSegmentLog, tt as FlowBoundCheck, un as PageUseFlowOptions, ut as FlowCloudState, vt as FlowErrorCode, wt as FlowImportPreview, xt as FlowExportOptions, yt as FlowEvent, z as parseFlowKnowledge, zt as FlowRegionCandidate } from "./options-BIwnIeed.mjs";
|
|
2
2
|
import { z } from "zod/v4";
|
|
3
3
|
//#region src/flow/schema.d.ts
|
|
4
4
|
export declare const FLOW_SCENE_JSON_SCHEMA: z.core.ZodStandardJSONSchemaPayload<z.ZodObject<{
|
package/dist/flow.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as parseFlowBundle,
|
|
1
|
+
import { A as parseFlowBundle, C as createIndexedDbFlowRepository, D as flowSceneDraftSchema, E as flowBundleSchema, F as sceneKey, Ht as FLOW_BUNDLE_VERSION, I as scopeKey, L as validateFlowInputs, M as parseFlowRegion, N as parseFlowScene, O as flowSceneSchema, P as parseFlowSceneDraft, S as previewFlowImport, Ut as FLOW_SCHEMA_VERSION, Wt as FlowError, _ as createFlowApiAdapter, a as mountPageUseManager, b as exportFlowBundle, c as createFlowRegionPicker, d as evaluateFlowCompletion, g as validateRegionPages, i as definePageUseManagerElement, j as parseFlowKnowledge, k as newRevision, l as createFlowRunner, m as locateFlowRegion, n as getPageUseFlowCatalog, o as PAGE_USE_MANAGER_TAG, r as runPageUseFlowTool, s as PageUseManagerElement, t as PAGE_USE_FLOW_TOOL, u as createCompletionEvaluator, w as FLOW_SEGMENT_MAX_CHARS, x as importFlowBundle, y as createFlowCloud, z as validateSceneBindings } from "./tool-C9eKI80l.mjs";
|
|
2
2
|
import { z } from "zod/v4";
|
|
3
3
|
|
|
4
4
|
//#region src/flow/schema.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { _n as PageUseSnapshot, b as PageUseTtsEngine, bn as PageUseTaskSource, gn as PageUseRunOptions, hn as PageUseProgressEvent, ln as PageUseFlowHandle, mn as PageUsePreset, pn as PageUseMenuNode, s as NormalizedPageUseOptions, u as PageUseOptions, vn as PageUseStepLog, yn as PageUseTaskResult } from "./options-BIwnIeed.mjs";
|
|
2
2
|
import { AgentStatus } from "page-agent";
|
|
3
3
|
import { LitElement, PropertyValues, nothing } from "lit";
|
|
4
4
|
//#region src/capability/api.d.ts
|
|
@@ -44,7 +44,7 @@ declare const PAGE_USE_LAUNCHER_TAG = "tz-page-use-launcher";
|
|
|
44
44
|
*/
|
|
45
45
|
type PageUseLauncherLayout = 'desktop' | 'mobile';
|
|
46
46
|
interface PageUseLauncherConfig {
|
|
47
|
-
/**
|
|
47
|
+
/** 入口与面板标题(默认 'Page Use');配置后用于试听,未配置时试听名称为“页面智能体” */
|
|
48
48
|
title?: string;
|
|
49
49
|
/** 面板布局,默认 'desktop'(与未声明该配置的旧版本行为一致) */
|
|
50
50
|
layout?: PageUseLauncherLayout;
|
|
@@ -161,6 +161,10 @@ declare class PageUseLauncherElement extends LitElement {
|
|
|
161
161
|
private fabDrag;
|
|
162
162
|
/** 拖动面板时反推入口位置:面板锚定角即入口所在角,收起后入口停在面板原位置 */
|
|
163
163
|
private panelDrag;
|
|
164
|
+
private unsubscribeSubmit?;
|
|
165
|
+
private submitError;
|
|
166
|
+
private temporaryPanel;
|
|
167
|
+
private panelCommand;
|
|
164
168
|
connectedCallback(): void;
|
|
165
169
|
disconnectedCallback(): void;
|
|
166
170
|
private bindFlow;
|
|
@@ -213,6 +217,7 @@ declare class PageUseLauncherElement extends LitElement {
|
|
|
213
217
|
private onFabClick;
|
|
214
218
|
/** 展开面板(showPageUseLauncher 调用):等入口按新的显示状态渲染后再测量定位 */
|
|
215
219
|
private expand;
|
|
220
|
+
private closeTemporaryPanel;
|
|
216
221
|
/** 关闭调试入口:收起面板并持久化隐藏状态,之后需调用显示方法或 URL 参数调出 */
|
|
217
222
|
private close;
|
|
218
223
|
/** 标题点击计数:滑动窗口内达到次数时打开元信息面板并重新计数 */
|
|
@@ -377,12 +382,21 @@ interface PageUseCommand {
|
|
|
377
382
|
declare function isPageUseCommand(value: unknown): value is PageUseCommand;
|
|
378
383
|
//#endregion
|
|
379
384
|
//#region src/ui/launcherControl.d.ts
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
385
|
+
interface PageUsePanelSnapshot {
|
|
386
|
+
mounted: boolean;
|
|
387
|
+
entryVisible: boolean;
|
|
388
|
+
panelOpen: boolean;
|
|
389
|
+
}
|
|
390
|
+
/** 多面板时取任意可见;通常每个宿主只挂载一个面板。 */
|
|
391
|
+
declare function getPageUsePanelSnapshot(): PageUsePanelSnapshot;
|
|
392
|
+
declare function subscribePageUsePanel(listener: (snapshot: PageUsePanelSnapshot) => void): () => void;
|
|
393
|
+
/** 临时打开面板,不写入设置;未挂载时返回 false,不排队等待挂载。 */
|
|
394
|
+
declare function openPageUsePanel(): Promise<boolean>;
|
|
395
|
+
/** 临时收起面板,保留原有入口设置、输入和任务;可在 onUserSubmit 内调用。 */
|
|
396
|
+
declare function closePageUsePanel(): Promise<void>;
|
|
397
|
+
/** 旧接口:显示入口并展开,持久化设置。 */
|
|
384
398
|
declare function showPageUseLauncher(): void;
|
|
385
|
-
/**
|
|
399
|
+
/** 旧接口:隐藏面板和入口并持久化;不停止页面任务。 */
|
|
386
400
|
declare function hidePageUseLauncher(): void;
|
|
387
401
|
//#endregion
|
|
388
402
|
//#region src/capability/bridge.d.ts
|
|
@@ -395,6 +409,10 @@ interface PageUseGlobal extends PageUseCapability {
|
|
|
395
409
|
showLauncher: typeof showPageUseLauncher;
|
|
396
410
|
/** 隐藏调试入口,状态持久化 */
|
|
397
411
|
hideLauncher: typeof hidePageUseLauncher;
|
|
412
|
+
openPanel: typeof openPageUsePanel;
|
|
413
|
+
closePanel: typeof closePageUsePanel;
|
|
414
|
+
getPanelSnapshot: typeof getPageUsePanelSnapshot;
|
|
415
|
+
subscribePanel: typeof subscribePageUsePanel;
|
|
398
416
|
}
|
|
399
417
|
declare global {
|
|
400
418
|
interface Window {
|
|
@@ -639,4 +657,4 @@ declare const PAGE_USE_MASK_COLORS: {
|
|
|
639
657
|
readonly warning: "#fa8c16";
|
|
640
658
|
};
|
|
641
659
|
//#endregion
|
|
642
|
-
export { PageUseGlobal as A,
|
|
660
|
+
export { createPageUse as $, PageUseGlobal as A, PAGE_USE_TOOL_NAME as B, getElapsedSeconds as C, pageUseStore as D, isRunning as E, openPageUsePanel as F, MountPageUseUIOptions as G, formatPageUseResultForModel as H, showPageUseLauncher as I, PAGE_USE_LAUNCHER_TAG as J, definePageUseElements as K, subscribePageUsePanel as L, closePageUsePanel as M, getPageUsePanelSnapshot as N, ReadonlyStore as O, hidePageUseLauncher as P, PageUseHandle as Q, PAGE_USE_COMMAND_TYPE as R, clearPageUseLog as S, isPageUseConfigured as T, isPageUseCommand as U, PageUseCommand as V, runPageUseTool as W, PageUseLauncherElement as X, PageUseLauncherConfig as Y, PageUseLauncherLayout as Z, pageUseSettings as _, PAGE_USE_ROBOT_ICON_SVG as a, PageUseQuestion as b, PageUseCustomPreset as c, pageUsePresets as d, getPageUseFlow as et, PageUseHistoryEntry as f, PageUseSettings as g, PageUsePoint as h, PageUseGlowElement as i, PageUsePanelSnapshot as j, PAGE_USE_GLOBAL_KEY as k, PageUsePresetSaveResult as l, DEFAULT_PAGE_USE_SETTINGS as m, SIMULATOR_MASK_ID as n, pageUseCapability as nt, PAGE_USE_STATIC_PRESETS as o, pageUseHistory as p, mountPageUseUI as q, PAGE_USE_GLOW_TAG as r, buildMenuPresets as s, PAGE_USE_MASK_COLORS as t, PageUseCapability as tt, PageUsePresetState as u, BROWSER_ENGINE_ID as v, getPageUseConfig as w, PageUseState as x, browserTtsEngine as y, PAGE_USE_TOOL as z };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import { A as PageUseGlobal, B as
|
|
3
|
-
export { BROWSER_ENGINE_ID, DEFAULT_MAX_STEPS, DEFAULT_MODEL, DEFAULT_PAGE_USE_SETTINGS, DEFAULT_SESSION_HEADER, DEFAULT_STORAGE_KEY_PREFIX, DEFAULT_TOUR_MAX_TAB_SWITCHES, DEFAULT_TOUR_STYLES, FLOW_BUNDLE_VERSION, FLOW_SCHEMA_VERSION, FlowAction, FlowActionBinding, FlowApiRequest, FlowApiResponse, FlowApiSyncOptions, FlowBindings, FlowBoundCheck, FlowBundle, FlowCheck, FlowCheckBinding, FlowClient, FlowCloudAdapter, FlowCloudCache, FlowCloudController, FlowCloudRelease, FlowCloudState, FlowCompletionDecision, FlowCompletionEvaluator, FlowConfigResponse, FlowContext, FlowContextBinding, FlowDescriptionCheck, FlowError, FlowErrorCode, FlowEvent, FlowExecutionPorts, FlowExportOptions, FlowGenerator, FlowIdentity, FlowImportPreview, FlowImportStrategy, FlowInputDefinition, FlowKnowledge, FlowKnowledgeRecord, FlowManager, FlowManagerState, FlowMode, FlowOutputReference, FlowParameter, FlowParameterDefinition, FlowPermissions, FlowPresenter, FlowRegion, FlowRegionAnchor, FlowRegionCandidate, FlowRegionContext, FlowRegionFailure, FlowRegionHost, FlowRegionPage, FlowRegionSelector, FlowRepository, FlowRepositorySnapshot, FlowResolvedTarget, FlowRunOptions, FlowRunResult, FlowRunner, FlowScene, FlowSceneRecord, FlowScope, FlowSegment, FlowSegmentLog, FlowSessionContext, FlowSnapshot, FlowStatus, FlowStep, FlowTombstone, JsonObject, JsonValue, type MountPageUseManagerOptions, type MountPageUseUIOptions, type NormalizedPageUseOptions, PAGE_USE_COMMAND_TYPE, PAGE_USE_FLOW_TOOL, PAGE_USE_GLOBAL_KEY, PAGE_USE_GLOW_TAG, PAGE_USE_LAUNCHER_TAG, PAGE_USE_MASK_COLORS, PAGE_USE_ROBOT_ICON_SVG, PAGE_USE_STATIC_PRESETS, PAGE_USE_TOOL, PAGE_USE_TOOL_NAME, type PageUseCapability, type PageUseCommand, type PageUseCustomPreset, type PageUseErrorCode, PageUseFlowHandle, PageUseFlowOptions, type PageUseGlobal, PageUseGlowElement, type PageUseHandle, type PageUseHistoryEntry, type PageUseLLMOptions, type PageUseLLMStreamOptions, type PageUseLauncherConfig, PageUseLauncherElement, type PageUseLauncherLayout, type PageUseMenuNode, type PageUseOptions, type PageUsePoint, type PageUsePreset, type PageUsePresetSaveResult, type PageUsePresetState, type PageUseProgressEvent, type PageUseQuestion, type PageUseRouterMode, type PageUseRunOptions, type PageUseSettings, type PageUseSnapshot, type PageUseState, type PageUseStepLog, type PageUseTaskResult, type PageUseTaskSource, type PageUseTaskStatus, type PageUseTourOptions, type PageUseTourStyle, type PageUseTtsEngine, type PageUseTtsSpeakOptions, type PageUseTtsVoice, type ReadonlyStore, SIMULATOR_MASK_ID, TOUR_STYLE_TRAINER, TOUR_STYLE_USER, browserTtsEngine, buildMenuPresets, clearPageUseLog, createPageUse, definePageUseElements, definePageUseManagerElement, formatPageUseResultForModel, getElapsedSeconds, getPageUseConfig, getPageUseFlow, getPageUseFlowCatalog, hidePageUseLauncher, isPageUseCommand, isPageUseConfigured, isRunning, mountPageUseManager, mountPageUseUI, newRevision, normalizeOptions, pageUseCapability, pageUseHistory, pageUsePresets, pageUseSettings, pageUseStore, parseFlowKnowledge, parseFlowScene, parseFlowSceneDraft, readLauncherSwitch, runPageUseFlowTool, runPageUseTool, sceneKey, showPageUseLauncher };
|
|
1
|
+
import { $ as FlowApiSyncOptions, $t as FlowScope, A as MountPageUseManagerOptions, At as FlowManagerState, Bt as FlowRegionContext, C as DEFAULT_TOUR_STYLES, Ct as FlowIdentity, D as PAGE_USE_FLOW_TOOL, Dt as FlowKnowledge, E as TOUR_STYLE_USER, Et as FlowInputDefinition, Ft as FlowPermissions, Gt as FlowRepository, H as parseFlowSceneDraft, Ht as FlowRegionHost, It as FlowPresenter, J as FLOW_SCHEMA_VERSION, Jt as FlowRunOptions, Kt as FlowRepositorySnapshot, L as newRevision, Lt as FlowRegion, M as mountPageUseManager, Mt as FlowOutputReference, Nt as FlowParameter, O as getPageUseFlowCatalog, Ot as FlowKnowledgeRecord, Pt as FlowParameterDefinition, Q as FlowApiResponse, Qt as FlowSceneRecord, Rt as FlowRegionAnchor, S as PageUseTtsVoice, St as FlowGenerator, T as TOUR_STYLE_TRAINER, Tt as FlowImportStrategy, U as sceneKey, Ut as FlowRegionPage, V as parseFlowScene, Vt as FlowRegionFailure, Wt as FlowRegionSelector, X as FlowActionBinding, Xt as FlowRunner, Y as FlowAction, Yt as FlowRunResult, Z as FlowApiRequest, Zt as FlowScene, _ as PageUseSubmitRequest, _n as PageUseSnapshot, _t as FlowError, a as DEFAULT_TOUR_MAX_TAB_SWITCHES, an as FlowStep, at as FlowClient, b as PageUseTtsEngine, bn as PageUseTaskSource, bt as FlowExecutionPorts, c as PageUseLLMOptions, cn as JsonValue, ct as FlowCloudController, d as PageUseRouterMode, dn as PageUseAskUserContext, dt as FlowCompletionDecision, en as FlowSegment, et as FlowBindings, f as PageUseTourOptions, fn as PageUseErrorCode, ft as FlowCompletionEvaluator, g as PageUseSubmitHandler, gn as PageUseRunOptions, gt as FlowDescriptionCheck, h as PageUseSubmitDecision, hn as PageUseProgressEvent, ht as FlowContextBinding, i as DEFAULT_STORAGE_KEY_PREFIX, in as FlowStatus, it as FlowCheckBinding, j as definePageUseManagerElement, jt as FlowMode, k as runPageUseFlowTool, kt as FlowManager, l as PageUseLLMStreamOptions, ln as PageUseFlowHandle, lt as FlowCloudRelease, m as readLauncherSwitch, mn as PageUsePreset, mt as FlowContext, n as DEFAULT_MODEL, nn as FlowSessionContext, nt as FlowBundle, on as FlowTombstone, ot as FlowCloudAdapter, p as normalizeOptions, pn as PageUseMenuNode, pt as FlowConfigResponse, q as FLOW_BUNDLE_VERSION, qt as FlowResolvedTarget, r as DEFAULT_SESSION_HEADER, rn as FlowSnapshot, rt as FlowCheck, s as NormalizedPageUseOptions, sn as JsonObject, st as FlowCloudCache, t as DEFAULT_MAX_STEPS, tn as FlowSegmentLog, tt as FlowBoundCheck, u as PageUseOptions, un as PageUseFlowOptions, ut as FlowCloudState, v as cancelPageUseSubmit, vn as PageUseStepLog, vt as FlowErrorCode, w as PageUseTourStyle, wt as FlowImportPreview, x as PageUseTtsSpeakOptions, xn as PageUseTaskStatus, xt as FlowExportOptions, y as pageUseSubmitStore, yn as PageUseTaskResult, yt as FlowEvent, z as parseFlowKnowledge, zt as FlowRegionCandidate } from "./options-BIwnIeed.mjs";
|
|
2
|
+
import { $ as createPageUse, A as PageUseGlobal, B as PAGE_USE_TOOL_NAME, C as getElapsedSeconds, D as pageUseStore, E as isRunning, F as openPageUsePanel, G as MountPageUseUIOptions, H as formatPageUseResultForModel, I as showPageUseLauncher, J as PAGE_USE_LAUNCHER_TAG, K as definePageUseElements, L as subscribePageUsePanel, M as closePageUsePanel, N as getPageUsePanelSnapshot, O as ReadonlyStore, P as hidePageUseLauncher, Q as PageUseHandle, R as PAGE_USE_COMMAND_TYPE, S as clearPageUseLog, T as isPageUseConfigured, U as isPageUseCommand, V as PageUseCommand, W as runPageUseTool, X as PageUseLauncherElement, Y as PageUseLauncherConfig, Z as PageUseLauncherLayout, _ as pageUseSettings, a as PAGE_USE_ROBOT_ICON_SVG, b as PageUseQuestion, c as PageUseCustomPreset, d as pageUsePresets, et as getPageUseFlow, f as PageUseHistoryEntry, g as PageUseSettings, h as PageUsePoint, i as PageUseGlowElement, j as PageUsePanelSnapshot, k as PAGE_USE_GLOBAL_KEY, l as PageUsePresetSaveResult, m as DEFAULT_PAGE_USE_SETTINGS, n as SIMULATOR_MASK_ID, nt as pageUseCapability, o as PAGE_USE_STATIC_PRESETS, p as pageUseHistory, q as mountPageUseUI, r as PAGE_USE_GLOW_TAG, s as buildMenuPresets, t as PAGE_USE_MASK_COLORS, tt as PageUseCapability, u as PageUsePresetState, v as BROWSER_ENGINE_ID, w as getPageUseConfig, x as PageUseState, y as browserTtsEngine, z as PAGE_USE_TOOL } from "./index-XRyK_b1h.mjs";
|
|
3
|
+
export { BROWSER_ENGINE_ID, DEFAULT_MAX_STEPS, DEFAULT_MODEL, DEFAULT_PAGE_USE_SETTINGS, DEFAULT_SESSION_HEADER, DEFAULT_STORAGE_KEY_PREFIX, DEFAULT_TOUR_MAX_TAB_SWITCHES, DEFAULT_TOUR_STYLES, FLOW_BUNDLE_VERSION, FLOW_SCHEMA_VERSION, FlowAction, FlowActionBinding, FlowApiRequest, FlowApiResponse, FlowApiSyncOptions, FlowBindings, FlowBoundCheck, FlowBundle, FlowCheck, FlowCheckBinding, FlowClient, FlowCloudAdapter, FlowCloudCache, FlowCloudController, FlowCloudRelease, FlowCloudState, FlowCompletionDecision, FlowCompletionEvaluator, FlowConfigResponse, FlowContext, FlowContextBinding, FlowDescriptionCheck, FlowError, FlowErrorCode, FlowEvent, FlowExecutionPorts, FlowExportOptions, FlowGenerator, FlowIdentity, FlowImportPreview, FlowImportStrategy, FlowInputDefinition, FlowKnowledge, FlowKnowledgeRecord, FlowManager, FlowManagerState, FlowMode, FlowOutputReference, FlowParameter, FlowParameterDefinition, FlowPermissions, FlowPresenter, FlowRegion, FlowRegionAnchor, FlowRegionCandidate, FlowRegionContext, FlowRegionFailure, FlowRegionHost, FlowRegionPage, FlowRegionSelector, FlowRepository, FlowRepositorySnapshot, FlowResolvedTarget, FlowRunOptions, FlowRunResult, FlowRunner, FlowScene, FlowSceneRecord, FlowScope, FlowSegment, FlowSegmentLog, FlowSessionContext, FlowSnapshot, FlowStatus, FlowStep, FlowTombstone, JsonObject, JsonValue, type MountPageUseManagerOptions, type MountPageUseUIOptions, type NormalizedPageUseOptions, PAGE_USE_COMMAND_TYPE, PAGE_USE_FLOW_TOOL, PAGE_USE_GLOBAL_KEY, PAGE_USE_GLOW_TAG, PAGE_USE_LAUNCHER_TAG, PAGE_USE_MASK_COLORS, PAGE_USE_ROBOT_ICON_SVG, PAGE_USE_STATIC_PRESETS, PAGE_USE_TOOL, PAGE_USE_TOOL_NAME, type PageUseAskUserContext, type PageUseCapability, type PageUseCommand, type PageUseCustomPreset, type PageUseErrorCode, PageUseFlowHandle, PageUseFlowOptions, type PageUseGlobal, PageUseGlowElement, type PageUseHandle, type PageUseHistoryEntry, type PageUseLLMOptions, type PageUseLLMStreamOptions, type PageUseLauncherConfig, PageUseLauncherElement, type PageUseLauncherLayout, type PageUseMenuNode, type PageUseOptions, type PageUsePanelSnapshot, type PageUsePoint, type PageUsePreset, type PageUsePresetSaveResult, type PageUsePresetState, type PageUseProgressEvent, type PageUseQuestion, type PageUseRouterMode, type PageUseRunOptions, type PageUseSettings, type PageUseSnapshot, type PageUseState, type PageUseStepLog, type PageUseSubmitDecision, type PageUseSubmitHandler, type PageUseSubmitRequest, type PageUseTaskResult, type PageUseTaskSource, type PageUseTaskStatus, type PageUseTourOptions, type PageUseTourStyle, type PageUseTtsEngine, type PageUseTtsSpeakOptions, type PageUseTtsVoice, type ReadonlyStore, SIMULATOR_MASK_ID, TOUR_STYLE_TRAINER, TOUR_STYLE_USER, browserTtsEngine, buildMenuPresets, cancelPageUseSubmit, clearPageUseLog, closePageUsePanel, createPageUse, definePageUseElements, definePageUseManagerElement, formatPageUseResultForModel, getElapsedSeconds, getPageUseConfig, getPageUseFlow, getPageUseFlowCatalog, getPageUsePanelSnapshot, hidePageUseLauncher, isPageUseCommand, isPageUseConfigured, isRunning, mountPageUseManager, mountPageUseUI, newRevision, normalizeOptions, openPageUsePanel, pageUseCapability, pageUseHistory, pageUsePresets, pageUseSettings, pageUseStore, pageUseSubmitStore, parseFlowKnowledge, parseFlowScene, parseFlowSceneDraft, readLauncherSwitch, runPageUseFlowTool, runPageUseTool, sceneKey, showPageUseLauncher, subscribePageUsePanel };
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { _ as isPageUseCommand, a as PAGE_USE_STATIC_PRESETS, b as
|
|
1
|
+
import { Ct as DEFAULT_MODEL, Dt as normalizeOptions, Et as DEFAULT_TOUR_MAX_TAB_SWITCHES, F as sceneKey, Ft as browserTtsEngine, Ht as FLOW_BUNDLE_VERSION, J as isRunning, Lt as DEFAULT_TOUR_STYLES, Mt as PAGE_USE_MASK_COLORS, N as parseFlowScene, Nt as SIMULATOR_MASK_ID, P as parseFlowSceneDraft, Pt as BROWSER_ENGINE_ID, Rt as TOUR_STYLE_TRAINER, St as DEFAULT_MAX_STEPS, Tt as DEFAULT_STORAGE_KEY_PREFIX, U as getElapsedSeconds, Ut as FLOW_SCHEMA_VERSION, V as clearPageUseLog, W as getPageUseConfig, Wt as FlowError, Y as pageUseStore, a as mountPageUseManager, bt as pageUseSettings, ct as pageUseHistory, i as definePageUseManagerElement, it as cancelPageUseSubmit, j as parseFlowKnowledge, k as newRevision, kt as readLauncherSwitch, n as getPageUseFlowCatalog, ot as pageUseSubmitStore, q as isPageUseConfigured, r as runPageUseFlowTool, st as pageUsePresets, t as PAGE_USE_FLOW_TOOL, wt as DEFAULT_SESSION_HEADER, yt as DEFAULT_PAGE_USE_SETTINGS, zt as TOUR_STYLE_USER } from "./tool-C9eKI80l.mjs";
|
|
2
|
+
import { C as showPageUseLauncher, S as openPageUsePanel, T as pageUseCapability, _ as isPageUseCommand, a as PAGE_USE_STATIC_PRESETS, b as getPageUsePanelSnapshot, c as PAGE_USE_GLOW_TAG, d as getPageUseFlow, f as PAGE_USE_GLOBAL_KEY, g as formatPageUseResultForModel, h as PAGE_USE_TOOL_NAME, i as PageUseLauncherElement, l as PageUseGlowElement, m as PAGE_USE_TOOL, n as mountPageUseUI, o as buildMenuPresets, p as PAGE_USE_COMMAND_TYPE, r as PAGE_USE_LAUNCHER_TAG, s as PAGE_USE_ROBOT_ICON_SVG, t as definePageUseElements, u as createPageUse, v as runPageUseTool, w as subscribePageUsePanel, x as hidePageUseLauncher, y as closePageUsePanel } from "./src-Cus5n_PO.mjs";
|
|
3
3
|
|
|
4
|
-
export { BROWSER_ENGINE_ID, DEFAULT_MAX_STEPS, DEFAULT_MODEL, DEFAULT_PAGE_USE_SETTINGS, DEFAULT_SESSION_HEADER, DEFAULT_STORAGE_KEY_PREFIX, DEFAULT_TOUR_MAX_TAB_SWITCHES, DEFAULT_TOUR_STYLES, FLOW_BUNDLE_VERSION, FLOW_SCHEMA_VERSION, FlowError, PAGE_USE_COMMAND_TYPE, PAGE_USE_FLOW_TOOL, PAGE_USE_GLOBAL_KEY, PAGE_USE_GLOW_TAG, PAGE_USE_LAUNCHER_TAG, PAGE_USE_MASK_COLORS, PAGE_USE_ROBOT_ICON_SVG, PAGE_USE_STATIC_PRESETS, PAGE_USE_TOOL, PAGE_USE_TOOL_NAME, PageUseGlowElement, PageUseLauncherElement, SIMULATOR_MASK_ID, TOUR_STYLE_TRAINER, TOUR_STYLE_USER, browserTtsEngine, buildMenuPresets, clearPageUseLog, createPageUse, definePageUseElements, definePageUseManagerElement, formatPageUseResultForModel, getElapsedSeconds, getPageUseConfig, getPageUseFlow, getPageUseFlowCatalog, hidePageUseLauncher, isPageUseCommand, isPageUseConfigured, isRunning, mountPageUseManager, mountPageUseUI, newRevision, normalizeOptions, pageUseCapability, pageUseHistory, pageUsePresets, pageUseSettings, pageUseStore, parseFlowKnowledge, parseFlowScene, parseFlowSceneDraft, readLauncherSwitch, runPageUseFlowTool, runPageUseTool, sceneKey, showPageUseLauncher };
|
|
4
|
+
export { BROWSER_ENGINE_ID, DEFAULT_MAX_STEPS, DEFAULT_MODEL, DEFAULT_PAGE_USE_SETTINGS, DEFAULT_SESSION_HEADER, DEFAULT_STORAGE_KEY_PREFIX, DEFAULT_TOUR_MAX_TAB_SWITCHES, DEFAULT_TOUR_STYLES, FLOW_BUNDLE_VERSION, FLOW_SCHEMA_VERSION, FlowError, PAGE_USE_COMMAND_TYPE, PAGE_USE_FLOW_TOOL, PAGE_USE_GLOBAL_KEY, PAGE_USE_GLOW_TAG, PAGE_USE_LAUNCHER_TAG, PAGE_USE_MASK_COLORS, PAGE_USE_ROBOT_ICON_SVG, PAGE_USE_STATIC_PRESETS, PAGE_USE_TOOL, PAGE_USE_TOOL_NAME, PageUseGlowElement, PageUseLauncherElement, SIMULATOR_MASK_ID, TOUR_STYLE_TRAINER, TOUR_STYLE_USER, browserTtsEngine, buildMenuPresets, cancelPageUseSubmit, clearPageUseLog, closePageUsePanel, createPageUse, definePageUseElements, definePageUseManagerElement, formatPageUseResultForModel, getElapsedSeconds, getPageUseConfig, getPageUseFlow, getPageUseFlowCatalog, getPageUsePanelSnapshot, hidePageUseLauncher, isPageUseCommand, isPageUseConfigured, isRunning, mountPageUseManager, mountPageUseUI, newRevision, normalizeOptions, openPageUsePanel, pageUseCapability, pageUseHistory, pageUsePresets, pageUseSettings, pageUseStore, pageUseSubmitStore, parseFlowKnowledge, parseFlowScene, parseFlowSceneDraft, readLauncherSwitch, runPageUseFlowTool, runPageUseTool, sceneKey, showPageUseLauncher, subscribePageUsePanel };
|
|
@@ -97,6 +97,10 @@ type PageUseProgressEvent = ({
|
|
|
97
97
|
}) & {
|
|
98
98
|
silent?: boolean;
|
|
99
99
|
};
|
|
100
|
+
interface PageUseAskUserContext {
|
|
101
|
+
taskId: string;
|
|
102
|
+
signal: AbortSignal;
|
|
103
|
+
}
|
|
100
104
|
interface PageUseRunOptions {
|
|
101
105
|
/** 任务来源,默认 'unknown' */
|
|
102
106
|
source?: PageUseTaskSource;
|
|
@@ -107,7 +111,7 @@ interface PageUseRunOptions {
|
|
|
107
111
|
* 模型向用户提问(ask_user 工具)时的回答方式。
|
|
108
112
|
* 不传时:调试面板已挂载则由面板作答;否则自动回复「无法补充信息」让模型自行决策或结束。
|
|
109
113
|
*/
|
|
110
|
-
onAskUser?: (question: string) => Promise<string>;
|
|
114
|
+
onAskUser?: (question: string, context: PageUseAskUserContext) => Promise<string>;
|
|
111
115
|
/**
|
|
112
116
|
* 页面讲解风格 key(如 'user'、'trainer'),仅影响「介绍当前页面」类任务的讲解方式。
|
|
113
117
|
* 优先级:本参数 > 面板设置 > pageTour.defaultStyle;不存在的 key 忽略。
|
|
@@ -1066,6 +1070,31 @@ interface PageUseTtsEngine {
|
|
|
1066
1070
|
speak(text: string, options: PageUseTtsSpeakOptions): Promise<void>;
|
|
1067
1071
|
}
|
|
1068
1072
|
//#endregion
|
|
1073
|
+
//#region src/core/userSubmit.d.ts
|
|
1074
|
+
type PageUseSubmitDecision = {
|
|
1075
|
+
action: 'continue';
|
|
1076
|
+
} | {
|
|
1077
|
+
action: 'handled';
|
|
1078
|
+
} | {
|
|
1079
|
+
action: 'reject';
|
|
1080
|
+
message: string;
|
|
1081
|
+
};
|
|
1082
|
+
interface PageUseSubmitRequest {
|
|
1083
|
+
text: string;
|
|
1084
|
+
requestId: string;
|
|
1085
|
+
signal: AbortSignal;
|
|
1086
|
+
}
|
|
1087
|
+
type PageUseSubmitHandler = (request: PageUseSubmitRequest) => Promise<PageUseSubmitDecision>;
|
|
1088
|
+
declare const pageUseSubmitStore: {
|
|
1089
|
+
get: () => {
|
|
1090
|
+
pending: boolean;
|
|
1091
|
+
};
|
|
1092
|
+
subscribe: (listener: (state: {
|
|
1093
|
+
pending: boolean;
|
|
1094
|
+
}) => void) => () => void;
|
|
1095
|
+
};
|
|
1096
|
+
declare function cancelPageUseSubmit(): void;
|
|
1097
|
+
//#endregion
|
|
1069
1098
|
//#region src/core/options.d.ts
|
|
1070
1099
|
/** 默认模型,仅为示例取值;接入其它端点时应通过 llm.model 显式指定支持 function calling 的模型 */
|
|
1071
1100
|
declare const DEFAULT_MODEL = "deepseek-chat";
|
|
@@ -1141,6 +1170,8 @@ interface PageUseOptions {
|
|
|
1141
1170
|
routeHints?: Record<string, string>;
|
|
1142
1171
|
/** 页面布局描述,替换系统提示中的「页面结构」段落;不传时使用通用描述 */
|
|
1143
1172
|
layoutHint?: string;
|
|
1173
|
+
/** 用户输入提交前由宿主判断;不影响程序化 run 或追问回答。 */
|
|
1174
|
+
onUserSubmit?: PageUseSubmitHandler;
|
|
1144
1175
|
/** 任务开始前的宿主预处理,例如展开折叠的侧栏,使菜单文字对模型可见 */
|
|
1145
1176
|
beforeTask?: () => void | Promise<void>;
|
|
1146
1177
|
/** 调试面板设置中 beforeTask 开关的显示名,默认「任务开始前执行宿主预处理」 */
|
|
@@ -1199,6 +1230,8 @@ interface NormalizedPageUseOptions {
|
|
|
1199
1230
|
resolveRouteName?: (path: string) => string | undefined;
|
|
1200
1231
|
routeHints: Record<string, string>;
|
|
1201
1232
|
layoutHint?: string;
|
|
1233
|
+
/** 用户输入提交前由宿主判断;不影响程序化 run 或追问回答。 */
|
|
1234
|
+
onUserSubmit?: PageUseSubmitHandler;
|
|
1202
1235
|
beforeTask?: () => void | Promise<void>;
|
|
1203
1236
|
beforeTaskLabel: string;
|
|
1204
1237
|
storageKeyPrefix: string;
|
|
@@ -1218,4 +1251,4 @@ declare function normalizeOptions(options: PageUseOptions): NormalizedPageUseOpt
|
|
|
1218
1251
|
*/
|
|
1219
1252
|
declare function readLauncherSwitch(fallback: boolean, storageKeyPrefix?: string): boolean;
|
|
1220
1253
|
//#endregion
|
|
1221
|
-
export {
|
|
1254
|
+
export { FlowApiSyncOptions as $, FlowScope as $t, MountPageUseManagerOptions as A, FlowManagerState as At, parseFlowRegion as B, FlowRegionContext as Bt, DEFAULT_TOUR_STYLES as C, FlowIdentity as Ct, PAGE_USE_FLOW_TOOL as D, FlowKnowledge as Dt, TOUR_STYLE_USER as E, FlowInputDefinition as Et, PageUseManagerPresentation as F, FlowPermissions as Ft, validateFlowInputs as G, FlowRepository as Gt, parseFlowSceneDraft as H, FlowRegionHost as Ht, FLOW_SEGMENT_MAX_CHARS as I, FlowPresenter as It, FLOW_SCHEMA_VERSION as J, FlowRunOptions as Jt, validateSceneBindings as K, FlowRepositorySnapshot as Kt, newRevision as L, FlowRegion as Lt, mountPageUseManager as M, FlowOutputReference as Mt, PAGE_USE_MANAGER_TAG as N, FlowParameter as Nt, getPageUseFlowCatalog as O, FlowKnowledgeRecord as Ot, PageUseManagerElement as P, FlowParameterDefinition as Pt, FlowApiResponse as Q, FlowSceneRecord as Qt, parseFlowBundle as R, FlowRegionAnchor as Rt, PageUseTtsVoice as S, FlowGenerator as St, TOUR_STYLE_TRAINER as T, FlowImportStrategy as Tt, sceneKey as U, FlowRegionPage as Ut, parseFlowScene as V, FlowRegionFailure as Vt, scopeKey as W, FlowRegionSelector as Wt, FlowActionBinding as X, FlowRunner as Xt, FlowAction as Y, FlowRunResult as Yt, FlowApiRequest as Z, FlowScene as Zt, PageUseSubmitRequest as _, PageUseSnapshot as _n, FlowError as _t, DEFAULT_TOUR_MAX_TAB_SWITCHES as a, FlowStep as an, FlowClient as at, PageUseTtsEngine as b, PageUseTaskSource as bn, FlowExecutionPorts as bt, PageUseLLMOptions as c, JsonValue as cn, FlowCloudController as ct, PageUseRouterMode as d, PageUseAskUserContext as dn, FlowCompletionDecision as dt, FlowSegment as en, FlowBindings as et, PageUseTourOptions as f, PageUseErrorCode as fn, FlowCompletionEvaluator as ft, PageUseSubmitHandler as g, PageUseRunOptions as gn, FlowDescriptionCheck as gt, PageUseSubmitDecision as h, PageUseProgressEvent as hn, FlowContextBinding as ht, DEFAULT_STORAGE_KEY_PREFIX as i, FlowStatus as in, FlowCheckBinding as it, definePageUseManagerElement as j, FlowMode as jt, runPageUseFlowTool as k, FlowManager as kt, PageUseLLMStreamOptions as l, PageUseFlowHandle as ln, FlowCloudRelease as lt, readLauncherSwitch as m, PageUsePreset as mn, FlowContext as mt, DEFAULT_MODEL as n, FlowSessionContext as nn, FlowBundle as nt, NormalizedLLMOptions as o, FlowTombstone as on, FlowCloudAdapter as ot, normalizeOptions as p, PageUseMenuNode as pn, FlowConfigResponse as pt, FLOW_BUNDLE_VERSION as q, FlowResolvedTarget as qt, DEFAULT_SESSION_HEADER as r, FlowSnapshot as rn, FlowCheck as rt, NormalizedPageUseOptions as s, JsonObject as sn, FlowCloudCache as st, DEFAULT_MAX_STEPS as t, FlowSegmentLog as tn, FlowBoundCheck as tt, PageUseOptions as u, PageUseFlowOptions as un, FlowCloudState as ut, cancelPageUseSubmit as v, PageUseStepLog as vn, FlowErrorCode as vt, PageUseTourStyle as w, FlowImportPreview as wt, PageUseTtsSpeakOptions as x, PageUseTaskStatus as xn, FlowExportOptions as xt, pageUseSubmitStore as y, PageUseTaskResult as yn, FlowEvent as yt, parseFlowKnowledge as z, FlowRegionCandidate as zt };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as showFlowMask, At as
|
|
1
|
+
import { $ as showFlowMask, At as listTtsEngines, B as acquireFlowExecution, Bt as cancelRegionPicker, C as createIndexedDbFlowRepository, Dt as normalizeOptions, F as sceneKey, G as getPageUseSnapshot, H as configurePageUse, I as scopeKey, It as isSpeechSupported, J as isRunning, K as hideFlowMask, M as parseFlowRegion, N as parseFlowScene, Nt as SIMULATOR_MASK_ID, Ot as readLauncherQuery, P as parseFlowSceneDraft, Pt as BROWSER_ENGINE_ID, Q as runTaskForFlow, R as validateRegionPreviewInputs, S as previewFlowImport, T as cloneJson, U as getElapsedSeconds, V as clearPageUseLog, Vt as hasRegionPicker, W as getPageUseConfig, Wt as FlowError, X as registerQuestionUi, Y as pageUseStore, Z as runTask, _ as createFlowApiAdapter, _t as startPreview, at as decidePageUseSubmit, b as exportFlowBundle, bt as pageUseSettings, ct as pageUseHistory, dt as hideTourHighlight, et as stopTask, f as composedParent, ft as showTourHighlight, g as validateRegionPages, gt as previewStore, h as regionAbortable, ht as registerNarrationPanelName, i as definePageUseManagerElement, it as cancelPageUseSubmit, j as parseFlowKnowledge, jt as resolveTtsEngine, k as newRevision, l as createFlowRunner, lt as completionRequestBody, m as locateFlowRegion, mt as narrationMute, nt as subscribePageUse, ot as pageUseSubmitStore, p as createRegionSelector, pt as narrate, rt as updateFlowExecution, st as pageUsePresets, tt as stopTaskForFlow, u as createCompletionEvaluator, ut as readCompletionResponse, v as validateFlowApiOptions, vt as stopPreview, w as FLOW_SEGMENT_MAX_CHARS, x as importFlowBundle, xt as createStore, y as createFlowCloud, z as validateSceneBindings } from "./tool-C9eKI80l.mjs";
|
|
2
2
|
import { LitElement, css, html, nothing, svg } from "lit";
|
|
3
3
|
import { keyed } from "lit/directives/keyed.js";
|
|
4
4
|
import { unsafeHTML } from "lit/directives/unsafe-html.js";
|
|
@@ -24,35 +24,73 @@ const pageUseCapability = {
|
|
|
24
24
|
|
|
25
25
|
//#endregion
|
|
26
26
|
//#region src/ui/launcherControl.ts
|
|
27
|
-
/**
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
27
|
+
/** 面板运行期控制,不依赖 Lit;旧 show/hide 接口保留持久化语义。 */
|
|
28
|
+
const controllers = /* @__PURE__ */ new Set();
|
|
29
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
30
|
+
let lastSnapshot = {
|
|
31
|
+
mounted: false,
|
|
32
|
+
entryVisible: false,
|
|
33
|
+
panelOpen: false
|
|
34
|
+
};
|
|
35
|
+
/** 多面板时取任意可见;通常每个宿主只挂载一个面板。 */
|
|
36
|
+
function getPageUsePanelSnapshot() {
|
|
37
|
+
const states = [...controllers].map((controller) => controller.snapshot());
|
|
38
|
+
return {
|
|
39
|
+
mounted: controllers.size > 0,
|
|
40
|
+
entryVisible: states.some((state) => state.entryVisible),
|
|
41
|
+
panelOpen: states.some((state) => state.panelOpen)
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
function notifyPageUsePanelState() {
|
|
45
|
+
const snapshot = getPageUsePanelSnapshot();
|
|
46
|
+
if (snapshot.mounted === lastSnapshot.mounted && snapshot.entryVisible === lastSnapshot.entryVisible && snapshot.panelOpen === lastSnapshot.panelOpen) return;
|
|
47
|
+
lastSnapshot = snapshot;
|
|
48
|
+
for (const listener of listeners) try {
|
|
49
|
+
listener({ ...snapshot });
|
|
50
|
+
} catch (error) {
|
|
51
|
+
console.warn("[PageUse] 面板订阅回调异常", error);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
function subscribePageUsePanel(listener) {
|
|
55
|
+
listeners.add(listener);
|
|
37
56
|
return () => {
|
|
38
|
-
|
|
57
|
+
listeners.delete(listener);
|
|
39
58
|
};
|
|
40
59
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
60
|
+
function registerLauncherController(controller) {
|
|
61
|
+
controllers.add(controller);
|
|
62
|
+
notifyPageUsePanelState();
|
|
63
|
+
return () => {
|
|
64
|
+
controllers.delete(controller);
|
|
65
|
+
notifyPageUsePanelState();
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
/** 临时打开面板,不写入设置;未挂载时返回 false,不排队等待挂载。 */
|
|
69
|
+
async function openPageUsePanel() {
|
|
70
|
+
if (!controllers.size) return false;
|
|
71
|
+
await Promise.all([...controllers].map((controller) => controller.open(true)));
|
|
72
|
+
notifyPageUsePanelState();
|
|
73
|
+
return getPageUsePanelSnapshot().panelOpen;
|
|
74
|
+
}
|
|
75
|
+
/** 临时收起面板,保留原有入口设置、输入和任务;可在 onUserSubmit 内调用。 */
|
|
76
|
+
async function closePageUsePanel() {
|
|
77
|
+
await Promise.all([...controllers].map((controller) => controller.close()));
|
|
78
|
+
notifyPageUsePanelState();
|
|
79
|
+
}
|
|
80
|
+
/** 旧接口:显示入口并展开,持久化设置。 */
|
|
45
81
|
function showPageUseLauncher() {
|
|
46
82
|
pageUseSettings.update({ launcherVisible: true });
|
|
47
|
-
if (!
|
|
83
|
+
if (!controllers.size) {
|
|
48
84
|
console.warn("[PageUse] 调试面板未挂载,显示状态已保存,挂载后生效(mountPageUseUI 需传入 launcher)");
|
|
49
85
|
return;
|
|
50
86
|
}
|
|
51
|
-
|
|
87
|
+
for (const controller of controllers) controller.open(false);
|
|
52
88
|
}
|
|
53
|
-
/**
|
|
89
|
+
/** 旧接口:隐藏面板和入口并持久化;不停止页面任务。 */
|
|
54
90
|
function hidePageUseLauncher() {
|
|
91
|
+
cancelPageUseSubmit();
|
|
55
92
|
pageUseSettings.update({ launcherVisible: false });
|
|
93
|
+
closePageUsePanel();
|
|
56
94
|
}
|
|
57
95
|
|
|
58
96
|
//#endregion
|
|
@@ -149,7 +187,11 @@ function installPageUseGlobal() {
|
|
|
149
187
|
tool: PAGE_USE_TOOL,
|
|
150
188
|
runTool: runPageUseTool,
|
|
151
189
|
showLauncher: showPageUseLauncher,
|
|
152
|
-
hideLauncher: hidePageUseLauncher
|
|
190
|
+
hideLauncher: hidePageUseLauncher,
|
|
191
|
+
openPanel: openPageUsePanel,
|
|
192
|
+
closePanel: closePageUsePanel,
|
|
193
|
+
getPanelSnapshot: getPageUsePanelSnapshot,
|
|
194
|
+
subscribePanel: subscribePageUsePanel
|
|
153
195
|
};
|
|
154
196
|
window[PAGE_USE_GLOBAL_KEY] = api;
|
|
155
197
|
return () => {
|
|
@@ -1268,7 +1310,7 @@ var PageUseGlowElement = class extends LitElement {
|
|
|
1268
1310
|
|
|
1269
1311
|
//#endregion
|
|
1270
1312
|
//#region package.json
|
|
1271
|
-
var version = "0.0.
|
|
1313
|
+
var version = "0.0.15";
|
|
1272
1314
|
|
|
1273
1315
|
//#endregion
|
|
1274
1316
|
//#region src/ui/drag.ts
|
|
@@ -2809,7 +2851,12 @@ var PageUseLauncherElement = class extends LitElement {
|
|
|
2809
2851
|
} });
|
|
2810
2852
|
}
|
|
2811
2853
|
});
|
|
2854
|
+
unsubscribeSubmit;
|
|
2855
|
+
submitError = "";
|
|
2856
|
+
temporaryPanel = false;
|
|
2857
|
+
panelCommand = 0;
|
|
2812
2858
|
connectedCallback() {
|
|
2859
|
+
this.unsubscribeSubmit = pageUseSubmitStore.subscribe(() => this.requestUpdate());
|
|
2813
2860
|
super.connectedCallback();
|
|
2814
2861
|
definePageUseManagerElement();
|
|
2815
2862
|
this.wasRunning = isRunning();
|
|
@@ -2831,7 +2878,17 @@ var PageUseLauncherElement = class extends LitElement {
|
|
|
2831
2878
|
pageUsePresets.store.subscribe(() => this.requestUpdate()),
|
|
2832
2879
|
narrationMute.subscribe(() => this.requestUpdate()),
|
|
2833
2880
|
previewStore.subscribe(() => this.requestUpdate()),
|
|
2834
|
-
|
|
2881
|
+
registerLauncherController({
|
|
2882
|
+
open: (temporary) => this.expand(temporary),
|
|
2883
|
+
close: () => this.closeTemporaryPanel(),
|
|
2884
|
+
snapshot: () => {
|
|
2885
|
+
const entryVisible = this.isVisible(pageUseSettings.get());
|
|
2886
|
+
return {
|
|
2887
|
+
entryVisible,
|
|
2888
|
+
panelOpen: entryVisible && this.open
|
|
2889
|
+
};
|
|
2890
|
+
}
|
|
2891
|
+
}),
|
|
2835
2892
|
registerQuestionUi(),
|
|
2836
2893
|
this.watchVoices()
|
|
2837
2894
|
];
|
|
@@ -2840,6 +2897,9 @@ var PageUseLauncherElement = class extends LitElement {
|
|
|
2840
2897
|
window.addEventListener("resize", this.onResize);
|
|
2841
2898
|
}
|
|
2842
2899
|
disconnectedCallback() {
|
|
2900
|
+
++this.panelCommand;
|
|
2901
|
+
this.unsubscribeSubmit?.();
|
|
2902
|
+
cancelPageUseSubmit();
|
|
2843
2903
|
super.disconnectedCallback();
|
|
2844
2904
|
this.cleanups.forEach((off) => off());
|
|
2845
2905
|
this.cleanups = [];
|
|
@@ -2954,6 +3014,7 @@ var PageUseLauncherElement = class extends LitElement {
|
|
|
2954
3014
|
this.measureFab();
|
|
2955
3015
|
}
|
|
2956
3016
|
updated(_changed) {
|
|
3017
|
+
notifyPageUsePanelState();
|
|
2957
3018
|
this.autosizeTextarea();
|
|
2958
3019
|
this.animateFabWidth();
|
|
2959
3020
|
this.animatePanelResize();
|
|
@@ -3077,7 +3138,7 @@ var PageUseLauncherElement = class extends LitElement {
|
|
|
3077
3138
|
}
|
|
3078
3139
|
/** 调试入口是否显示:持久化状态优先,未操作过时跟随宿主 defaultHidden */
|
|
3079
3140
|
isVisible(settings) {
|
|
3080
|
-
return settings.launcherVisible ?? !this._config.defaultHidden;
|
|
3141
|
+
return this.temporaryPanel || (settings.launcherVisible ?? !this._config.defaultHidden);
|
|
3081
3142
|
}
|
|
3082
3143
|
/**
|
|
3083
3144
|
* 入口按下:先清掉上一次手势遗留的拖动标记,本次是否为拖动由 fabDrag 判定。
|
|
@@ -3107,17 +3168,33 @@ var PageUseLauncherElement = class extends LitElement {
|
|
|
3107
3168
|
this.requestUpdate();
|
|
3108
3169
|
};
|
|
3109
3170
|
/** 展开面板(showPageUseLauncher 调用):等入口按新的显示状态渲染后再测量定位 */
|
|
3110
|
-
async expand() {
|
|
3171
|
+
async expand(temporary = false) {
|
|
3172
|
+
const command = ++this.panelCommand;
|
|
3173
|
+
this.temporaryPanel = temporary;
|
|
3174
|
+
this.requestUpdate();
|
|
3111
3175
|
await this.updateComplete;
|
|
3176
|
+
if (!this.isConnected || command !== this.panelCommand) return;
|
|
3112
3177
|
this.measureFab();
|
|
3113
3178
|
this.resolvePanelAnchor();
|
|
3114
3179
|
this.cancelSheetAnimation();
|
|
3115
3180
|
if (this.view === "manager") this.shadowRoot?.querySelector("tz-page-use-manager")?.openSceneManager();
|
|
3116
3181
|
this.open = true;
|
|
3117
3182
|
this.requestUpdate();
|
|
3183
|
+
await this.updateComplete;
|
|
3184
|
+
}
|
|
3185
|
+
async closeTemporaryPanel() {
|
|
3186
|
+
++this.panelCommand;
|
|
3187
|
+
this.cancelSheetAnimation();
|
|
3188
|
+
this.cancelPanelResize();
|
|
3189
|
+
stopPreview();
|
|
3190
|
+
this.open = false;
|
|
3191
|
+
this.temporaryPanel = false;
|
|
3192
|
+
this.requestUpdate();
|
|
3193
|
+
await this.updateComplete;
|
|
3118
3194
|
}
|
|
3119
3195
|
/** 关闭调试入口:收起面板并持久化隐藏状态,之后需调用显示方法或 URL 参数调出 */
|
|
3120
3196
|
close() {
|
|
3197
|
+
cancelPageUseSubmit();
|
|
3121
3198
|
this.cancelPanelResize();
|
|
3122
3199
|
stopPreview();
|
|
3123
3200
|
this.open = false;
|
|
@@ -3344,7 +3421,21 @@ var PageUseLauncherElement = class extends LitElement {
|
|
|
3344
3421
|
/** tourStyle:快捷指令携带的讲解风格;输入框提交时不传,按面板设置与宿主默认 */
|
|
3345
3422
|
async submit(tourStyle) {
|
|
3346
3423
|
const text = this.task.trim();
|
|
3347
|
-
if (isRunning() || !text) return;
|
|
3424
|
+
if (isRunning() || pageUseSubmitStore.get().pending || !text) return;
|
|
3425
|
+
this.submitError = "";
|
|
3426
|
+
const handler = getPageUseConfig()?.onUserSubmit;
|
|
3427
|
+
const decision = handler ? await decidePageUseSubmit(text, handler) : { action: "continue" };
|
|
3428
|
+
if (decision.action === "reject") {
|
|
3429
|
+
this.submitError = decision.message;
|
|
3430
|
+
this.requestUpdate();
|
|
3431
|
+
return;
|
|
3432
|
+
}
|
|
3433
|
+
if (decision.action === "cancelled" || decision.action === "busy") return;
|
|
3434
|
+
if (decision.action === "handled") {
|
|
3435
|
+
this.task = "";
|
|
3436
|
+
this.requestUpdate();
|
|
3437
|
+
return;
|
|
3438
|
+
}
|
|
3348
3439
|
this.task = "";
|
|
3349
3440
|
this.requestUpdate();
|
|
3350
3441
|
if (this.collapseOnRun) this.collapse();
|
|
@@ -3354,6 +3445,7 @@ var PageUseLauncherElement = class extends LitElement {
|
|
|
3354
3445
|
});
|
|
3355
3446
|
}
|
|
3356
3447
|
applyPreset(text, tourStyle) {
|
|
3448
|
+
if (isRunning() || pageUseSubmitStore.get().pending) return;
|
|
3357
3449
|
this.task = text;
|
|
3358
3450
|
this.submit(tourStyle);
|
|
3359
3451
|
}
|
|
@@ -3724,6 +3816,7 @@ var PageUseLauncherElement = class extends LitElement {
|
|
|
3724
3816
|
const voiceName = settings.voiceNames[engine.id] ?? "";
|
|
3725
3817
|
const { playing } = previewStore.get();
|
|
3726
3818
|
const running = isRunning(pageUseStore.get());
|
|
3819
|
+
const previewName = this._config.title?.trim() || "页面智能体";
|
|
3727
3820
|
const previewButton = html`<button
|
|
3728
3821
|
type="button"
|
|
3729
3822
|
class="btn preview-btn"
|
|
@@ -3732,7 +3825,7 @@ var PageUseLauncherElement = class extends LitElement {
|
|
|
3732
3825
|
@click=${() => playing ? stopPreview() : startPreview(engine, {
|
|
3733
3826
|
rate: settings.voiceRate,
|
|
3734
3827
|
voice: voiceName
|
|
3735
|
-
})}
|
|
3828
|
+
}, previewName)}
|
|
3736
3829
|
>
|
|
3737
3830
|
${playing ? "停止" : "试听"}
|
|
3738
3831
|
</button>`;
|
|
@@ -3987,11 +4080,13 @@ var PageUseLauncherElement = class extends LitElement {
|
|
|
3987
4080
|
</div>` : nothing}
|
|
3988
4081
|
${isFlowActive(this.flowSnapshot) ? this.renderFlowControls() : html`
|
|
3989
4082
|
${this.tray && !running ? this.renderTray() : nothing}
|
|
4083
|
+
${this.submitError ? html`<div class="alert warning" role="alert">${this.submitError}</div>` : nothing}
|
|
4084
|
+
${pageUseSubmitStore.get().pending ? html`<button type="button" class="btn tiny" @click=${cancelPageUseSubmit}>取消判断</button>` : nothing}
|
|
3990
4085
|
<textarea
|
|
3991
4086
|
class="textarea"
|
|
3992
4087
|
rows=${TEXTAREA_MIN_ROWS}
|
|
3993
4088
|
placeholder=${running ? "执行中,可点击「终止」中断" : "输入指令,回车执行,Shift+回车换行"}
|
|
3994
|
-
?disabled=${running}
|
|
4089
|
+
?disabled=${running || pageUseSubmitStore.get().pending}
|
|
3995
4090
|
.value=${this.task}
|
|
3996
4091
|
@input=${this.onTaskInput}
|
|
3997
4092
|
@keydown=${this.onTaskKeydown}
|
|
@@ -4000,7 +4095,7 @@ var PageUseLauncherElement = class extends LitElement {
|
|
|
4000
4095
|
<button
|
|
4001
4096
|
type="button"
|
|
4002
4097
|
class="btn tiny ${this.tray === "presets" ? "secondary accent" : "ghost"}"
|
|
4003
|
-
?disabled=${running}
|
|
4098
|
+
?disabled=${running || pageUseSubmitStore.get().pending}
|
|
4004
4099
|
@click=${() => this.toggleTray("presets")}
|
|
4005
4100
|
>
|
|
4006
4101
|
快捷指令
|
|
@@ -4008,7 +4103,7 @@ var PageUseLauncherElement = class extends LitElement {
|
|
|
4008
4103
|
<button
|
|
4009
4104
|
type="button"
|
|
4010
4105
|
class="btn tiny ${this.tray === "history" ? "secondary accent" : "ghost"}"
|
|
4011
|
-
?disabled=${running}
|
|
4106
|
+
?disabled=${running || pageUseSubmitStore.get().pending}
|
|
4012
4107
|
@click=${() => this.toggleTray("history")}
|
|
4013
4108
|
>
|
|
4014
4109
|
历史${historyCount ? `(${historyCount})` : ""}
|
|
@@ -4028,7 +4123,7 @@ var PageUseLauncherElement = class extends LitElement {
|
|
|
4028
4123
|
<button
|
|
4029
4124
|
type="button"
|
|
4030
4125
|
class="btn push-right"
|
|
4031
|
-
?disabled=${!lastTask}
|
|
4126
|
+
?disabled=${!lastTask || pageUseSubmitStore.get().pending}
|
|
4032
4127
|
title=${lastTask ? `重跑:${lastTask}` : "暂无可重跑的指令"}
|
|
4033
4128
|
@click=${() => lastTask && this.applyPreset(lastTask)}
|
|
4034
4129
|
>
|
|
@@ -4037,10 +4132,10 @@ var PageUseLauncherElement = class extends LitElement {
|
|
|
4037
4132
|
<button
|
|
4038
4133
|
type="button"
|
|
4039
4134
|
class="btn primary"
|
|
4040
|
-
?disabled=${!this.task.trim()}
|
|
4135
|
+
?disabled=${!this.task.trim() || pageUseSubmitStore.get().pending}
|
|
4041
4136
|
@click=${() => void this.submit()}
|
|
4042
4137
|
>
|
|
4043
|
-
执行
|
|
4138
|
+
${pageUseSubmitStore.get().pending ? "正在判断…" : "执行"}
|
|
4044
4139
|
</button>
|
|
4045
4140
|
`}
|
|
4046
4141
|
</div>`}
|
|
@@ -4196,4 +4291,4 @@ function mountPageUseUI(options = {}) {
|
|
|
4196
4291
|
}
|
|
4197
4292
|
|
|
4198
4293
|
//#endregion
|
|
4199
|
-
export { isPageUseCommand as _, PAGE_USE_STATIC_PRESETS as a,
|
|
4294
|
+
export { showPageUseLauncher as C, openPageUsePanel as S, pageUseCapability as T, isPageUseCommand as _, PAGE_USE_STATIC_PRESETS as a, getPageUsePanelSnapshot as b, PAGE_USE_GLOW_TAG as c, getPageUseFlow as d, PAGE_USE_GLOBAL_KEY as f, formatPageUseResultForModel as g, PAGE_USE_TOOL_NAME as h, PageUseLauncherElement as i, PageUseGlowElement as l, PAGE_USE_TOOL as m, mountPageUseUI as n, buildMenuPresets as o, PAGE_USE_COMMAND_TYPE as p, PAGE_USE_LAUNCHER_TAG as r, PAGE_USE_ROBOT_ICON_SVG as s, definePageUseElements as t, createPageUse as u, runPageUseTool as v, subscribePageUsePanel as w, hidePageUseLauncher as x, closePageUsePanel as y };
|
|
@@ -368,6 +368,7 @@ function normalizeOptions(options) {
|
|
|
368
368
|
routeHints: options.routeHints ?? {},
|
|
369
369
|
layoutHint: options.layoutHint,
|
|
370
370
|
beforeTask: options.beforeTask,
|
|
371
|
+
onUserSubmit: options.onUserSubmit,
|
|
371
372
|
beforeTaskLabel: options.beforeTaskLabel || "任务开始前执行宿主预处理",
|
|
372
373
|
storageKeyPrefix: options.storageKeyPrefix || "tz-page-use",
|
|
373
374
|
pageAgentOptions: options.pageAgentOptions ?? {},
|
|
@@ -607,19 +608,17 @@ const PRESENT_PAGE_TOOL_NAME = "present_page";
|
|
|
607
608
|
//#endregion
|
|
608
609
|
//#region src/voice/preview.ts
|
|
609
610
|
/**
|
|
610
|
-
*
|
|
611
|
+
* 音色试听:用当前引擎、音色与语速播报助手名称,供设置页选择音色时对比。
|
|
611
612
|
* 不经 speaker 队列:试听是单次、可中止的调用,不参与待播与抢占,也不受本次任务静音影响。
|
|
612
613
|
* 与任务播报互斥:launcher 在任务执行中禁用试听,narration 在任务开始时调用 stopPreview()。
|
|
613
614
|
*/
|
|
614
|
-
/** 试听文本 */
|
|
615
|
-
const PREVIEW_TEXT = "您好,我是页面智能体。";
|
|
616
615
|
const store$3 = createStore({ playing: false });
|
|
617
616
|
/** 试听状态(playing:是否正在试听),供设置页切换「试听 / 停止」按钮 */
|
|
618
617
|
const previewStore = store$3;
|
|
619
618
|
/** 当前试听的中止控制;空闲时为 null */
|
|
620
619
|
let controller = null;
|
|
621
620
|
/** 开始试听:先中止上一次试听;引擎 speak 结束(播完、失败或被中止)后复位状态 */
|
|
622
|
-
function startPreview(engine, options) {
|
|
621
|
+
function startPreview(engine, options, displayName) {
|
|
623
622
|
stopPreview();
|
|
624
623
|
if (!engine.isAvailable()) return;
|
|
625
624
|
const current = new AbortController();
|
|
@@ -627,7 +626,7 @@ function startPreview(engine, options) {
|
|
|
627
626
|
store$3.set({ playing: true });
|
|
628
627
|
let speaking;
|
|
629
628
|
try {
|
|
630
|
-
speaking = engine.speak(
|
|
629
|
+
speaking = engine.speak(`您好,我是${displayName}。`, {
|
|
631
630
|
...options,
|
|
632
631
|
signal: current.signal
|
|
633
632
|
});
|
|
@@ -915,7 +914,7 @@ const SILENT_DWELL_MS = 2500;
|
|
|
915
914
|
/** 讲解词的播报字数上限:高于讲解工具的讲解词上限,正常不截断 */
|
|
916
915
|
const TOUR_SPEECH_MAX_CHARS$1 = 400;
|
|
917
916
|
/** 当前运行的播报(startNarration 期间有效),供页面讲解逐段播报 */
|
|
918
|
-
let active$
|
|
917
|
+
let active$2 = null;
|
|
919
918
|
/**
|
|
920
919
|
* 调试面板名称(PageUseLauncherConfig.title),用于截断提示语「详细内容请查看「名称」」。
|
|
921
920
|
* 由 launcher 挂载时登记、卸载时撤销;未挂载面板时为 null,提示语回退为「详细内容请查看面板」。
|
|
@@ -948,7 +947,7 @@ function startNarration({ subscribe, engines, speaker: injected }) {
|
|
|
948
947
|
speaker,
|
|
949
948
|
enabled
|
|
950
949
|
};
|
|
951
|
-
active$
|
|
950
|
+
active$2 = current;
|
|
952
951
|
const offEvents = subscribe((event) => {
|
|
953
952
|
if (event.silent) return;
|
|
954
953
|
switch (event.type) {
|
|
@@ -977,7 +976,7 @@ function startNarration({ subscribe, engines, speaker: injected }) {
|
|
|
977
976
|
if (muted) speaker.clear();
|
|
978
977
|
});
|
|
979
978
|
return () => {
|
|
980
|
-
if (active$
|
|
979
|
+
if (active$2 === current) active$2 = null;
|
|
981
980
|
offEvents();
|
|
982
981
|
offSettings();
|
|
983
982
|
offMute();
|
|
@@ -1008,7 +1007,7 @@ function dwell(ms, signal) {
|
|
|
1008
1007
|
async function narrate(text, signal) {
|
|
1009
1008
|
if (signal?.aborted) return;
|
|
1010
1009
|
const startedAt = Date.now();
|
|
1011
|
-
const narration = active$
|
|
1010
|
+
const narration = active$2;
|
|
1012
1011
|
if (narration?.enabled()) {
|
|
1013
1012
|
const sentences = toSpeechText(text, { maxChars: TOUR_SPEECH_MAX_CHARS$1 });
|
|
1014
1013
|
await narration.speaker.speakAndWait(sentences, signal);
|
|
@@ -2552,6 +2551,64 @@ function describeActivity(activity) {
|
|
|
2552
2551
|
}
|
|
2553
2552
|
}
|
|
2554
2553
|
|
|
2554
|
+
//#endregion
|
|
2555
|
+
//#region src/core/userSubmit.ts
|
|
2556
|
+
/** 用户输入接管;程序化 run 和 ask_user 回答不经过这里。 */
|
|
2557
|
+
const state = createStore({ pending: false });
|
|
2558
|
+
const pageUseSubmitStore = {
|
|
2559
|
+
get: state.get,
|
|
2560
|
+
subscribe: state.subscribe
|
|
2561
|
+
};
|
|
2562
|
+
let active$1;
|
|
2563
|
+
function cancelPageUseSubmit() {
|
|
2564
|
+
const previous = active$1;
|
|
2565
|
+
active$1 = void 0;
|
|
2566
|
+
state.set({ pending: false });
|
|
2567
|
+
previous?.abort();
|
|
2568
|
+
}
|
|
2569
|
+
async function decidePageUseSubmit(text, handler) {
|
|
2570
|
+
if (active$1) return { action: "busy" };
|
|
2571
|
+
if (!handler) return { action: "continue" };
|
|
2572
|
+
const controller = new AbortController();
|
|
2573
|
+
active$1 = controller;
|
|
2574
|
+
state.set({ pending: true });
|
|
2575
|
+
let onAbort = () => {};
|
|
2576
|
+
try {
|
|
2577
|
+
const cancelled = new Promise((resolve) => {
|
|
2578
|
+
onAbort = () => resolve({ action: "cancelled" });
|
|
2579
|
+
controller.signal.addEventListener("abort", onAbort, { once: true });
|
|
2580
|
+
});
|
|
2581
|
+
const decision = Promise.resolve().then(async () => controller.signal.aborted ? { action: "cancelled" } : handler({
|
|
2582
|
+
text,
|
|
2583
|
+
requestId: crypto.randomUUID(),
|
|
2584
|
+
signal: controller.signal
|
|
2585
|
+
}));
|
|
2586
|
+
const result = await Promise.race([decision, cancelled]);
|
|
2587
|
+
if (controller.signal.aborted || active$1 !== controller) return { action: "cancelled" };
|
|
2588
|
+
if (!result || ![
|
|
2589
|
+
"continue",
|
|
2590
|
+
"handled",
|
|
2591
|
+
"reject"
|
|
2592
|
+
].includes(result.action)) return {
|
|
2593
|
+
action: "reject",
|
|
2594
|
+
message: "输入处理返回无效结果,请重试"
|
|
2595
|
+
};
|
|
2596
|
+
return result;
|
|
2597
|
+
} catch (error) {
|
|
2598
|
+
if (controller.signal.aborted) return { action: "cancelled" };
|
|
2599
|
+
return {
|
|
2600
|
+
action: "reject",
|
|
2601
|
+
message: error instanceof Error ? error.message : "输入处理失败,请重试"
|
|
2602
|
+
};
|
|
2603
|
+
} finally {
|
|
2604
|
+
controller.signal.removeEventListener("abort", onAbort);
|
|
2605
|
+
if (active$1 === controller) {
|
|
2606
|
+
active$1 = void 0;
|
|
2607
|
+
state.set({ pending: false });
|
|
2608
|
+
}
|
|
2609
|
+
}
|
|
2610
|
+
}
|
|
2611
|
+
|
|
2555
2612
|
//#endregion
|
|
2556
2613
|
//#region src/core/service.ts
|
|
2557
2614
|
/** 无人可答时回给模型的固定答复,引导其基于已有信息决策或以未达成结束 */
|
|
@@ -2601,6 +2658,8 @@ let stopNarration = null;
|
|
|
2601
2658
|
let questionUiCount = 0;
|
|
2602
2659
|
/** 当前任务的调用方选项(提问回调、进度回调) */
|
|
2603
2660
|
let activeOptions = null;
|
|
2661
|
+
let activeCancellation = null;
|
|
2662
|
+
let cancelQuestion = null;
|
|
2604
2663
|
/** 整场流程持有执行权,包括暂停与人工等待;内部动作通过 owner 进入。 */
|
|
2605
2664
|
let executionLease = null;
|
|
2606
2665
|
let flowMaskOwner;
|
|
@@ -2668,28 +2727,54 @@ function bindAgentEvents(target) {
|
|
|
2668
2727
|
});
|
|
2669
2728
|
}
|
|
2670
2729
|
/** 模型提问的分发:调用方回调 → 调试面板 → 固定答复 */
|
|
2671
|
-
function handleAskUser(question, signal) {
|
|
2672
|
-
|
|
2673
|
-
type: "question",
|
|
2674
|
-
taskId: store.get().currentTaskId,
|
|
2675
|
-
question
|
|
2676
|
-
});
|
|
2730
|
+
async function handleAskUser(question, signal) {
|
|
2731
|
+
const taskId = store.get().currentTaskId;
|
|
2677
2732
|
const callerHandler = activeOptions?.onAskUser;
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2733
|
+
cancelQuestion?.();
|
|
2734
|
+
const controller = new AbortController();
|
|
2735
|
+
const cancel = () => controller.abort(new DOMException("任务已取消", "AbortError"));
|
|
2736
|
+
const signals = [signal, activeCancellation?.signal].filter((value) => Boolean(value));
|
|
2737
|
+
for (const upstream of signals) {
|
|
2738
|
+
upstream.addEventListener("abort", cancel, { once: true });
|
|
2739
|
+
if (upstream.aborted) cancel();
|
|
2740
|
+
}
|
|
2741
|
+
cancelQuestion = cancel;
|
|
2742
|
+
let questionUi;
|
|
2743
|
+
let onAbort = () => {};
|
|
2744
|
+
try {
|
|
2745
|
+
if (controller.signal.aborted) throw controller.signal.reason;
|
|
2746
|
+
const cancelled = new Promise((_, reject) => {
|
|
2747
|
+
onAbort = () => reject(controller.signal.reason);
|
|
2748
|
+
controller.signal.addEventListener("abort", onAbort, { once: true });
|
|
2749
|
+
});
|
|
2750
|
+
const answer = Promise.resolve().then(() => {
|
|
2751
|
+
if (controller.signal.aborted) throw controller.signal.reason;
|
|
2752
|
+
emit({
|
|
2753
|
+
type: "question",
|
|
2754
|
+
taskId,
|
|
2755
|
+
question
|
|
2756
|
+
});
|
|
2757
|
+
if (controller.signal.aborted) throw controller.signal.reason;
|
|
2758
|
+
if (callerHandler) return callerHandler(question, {
|
|
2759
|
+
taskId,
|
|
2760
|
+
signal: controller.signal
|
|
2761
|
+
});
|
|
2762
|
+
if (questionUiCount <= 0) return NO_ANSWER_REPLY;
|
|
2763
|
+
return new Promise((resolve) => {
|
|
2764
|
+
questionUi = {
|
|
2765
|
+
question,
|
|
2766
|
+
resolve
|
|
2767
|
+
};
|
|
2768
|
+
store.set({ pendingQuestion: questionUi });
|
|
2769
|
+
});
|
|
2770
|
+
});
|
|
2771
|
+
return await Promise.race([answer, cancelled]);
|
|
2772
|
+
} finally {
|
|
2773
|
+
for (const upstream of signals) upstream.removeEventListener("abort", cancel);
|
|
2774
|
+
controller.signal.removeEventListener("abort", onAbort);
|
|
2775
|
+
if (questionUi && store.get().pendingQuestion === questionUi) store.set({ pendingQuestion: null });
|
|
2776
|
+
if (cancelQuestion === cancel) cancelQuestion = null;
|
|
2777
|
+
}
|
|
2693
2778
|
}
|
|
2694
2779
|
/**
|
|
2695
2780
|
* 懒创建单例;蒙层或播报设置变化时重建(enableMask 属构造期选项,系统提示在构造时生成)。
|
|
@@ -2808,6 +2893,8 @@ async function runTaskInternal(task, options, owner) {
|
|
|
2808
2893
|
const taskId = newTaskId();
|
|
2809
2894
|
const selectedConfig = config;
|
|
2810
2895
|
const startedAt = Date.now();
|
|
2896
|
+
const cancellation = new AbortController();
|
|
2897
|
+
activeCancellation = cancellation;
|
|
2811
2898
|
activeOptions = options;
|
|
2812
2899
|
store.set({
|
|
2813
2900
|
errorMessage: "",
|
|
@@ -2833,9 +2920,10 @@ async function runTaskInternal(task, options, owner) {
|
|
|
2833
2920
|
options.signal?.addEventListener("abort", onAbort, { once: true });
|
|
2834
2921
|
let result;
|
|
2835
2922
|
try {
|
|
2923
|
+
if (cancellation.signal.aborted) throw cancellation.signal.reason;
|
|
2836
2924
|
const execution = await ensureAgent(config).execute(normalized);
|
|
2837
2925
|
if (config !== selectedConfig || activeOptions !== options) return rejectedResult(normalized, source, "宿主配置或执行会话已变化", void 0, "stopped");
|
|
2838
|
-
const final = resolveFinalStatus(execution.success);
|
|
2926
|
+
const final = cancellation.signal.aborted ? "stopped" : resolveFinalStatus(execution.success);
|
|
2839
2927
|
const { steps, totalTokens } = store.get();
|
|
2840
2928
|
result = {
|
|
2841
2929
|
taskId,
|
|
@@ -2852,24 +2940,26 @@ async function runTaskInternal(task, options, owner) {
|
|
|
2852
2940
|
if (config !== selectedConfig || activeOptions !== options) return rejectedResult(normalized, source, "宿主配置或执行会话已变化", void 0, "stopped");
|
|
2853
2941
|
const message = err instanceof Error ? err.message : String(err);
|
|
2854
2942
|
const { steps, totalTokens } = store.get();
|
|
2943
|
+
const stopped = cancellation.signal.aborted;
|
|
2855
2944
|
store.set({
|
|
2856
|
-
errorMessage: message,
|
|
2857
|
-
status: "error"
|
|
2945
|
+
errorMessage: stopped ? "" : message,
|
|
2946
|
+
status: stopped ? "stopped" : "error"
|
|
2858
2947
|
});
|
|
2859
2948
|
result = {
|
|
2860
2949
|
taskId,
|
|
2861
2950
|
task: normalized,
|
|
2862
2951
|
source,
|
|
2863
|
-
status: "error",
|
|
2952
|
+
status: stopped ? "stopped" : "error",
|
|
2864
2953
|
success: false,
|
|
2865
|
-
summary: message,
|
|
2866
|
-
errorCode: "AGENT_ERROR",
|
|
2954
|
+
summary: stopped ? "任务已取消" : message,
|
|
2955
|
+
errorCode: stopped ? void 0 : "AGENT_ERROR",
|
|
2867
2956
|
steps,
|
|
2868
2957
|
tokens: totalTokens,
|
|
2869
2958
|
durationMs: Date.now() - startedAt
|
|
2870
2959
|
};
|
|
2871
2960
|
} finally {
|
|
2872
2961
|
options.signal?.removeEventListener("abort", onAbort);
|
|
2962
|
+
if (activeCancellation === cancellation) activeCancellation = null;
|
|
2873
2963
|
if (config === selectedConfig && activeOptions === options) {
|
|
2874
2964
|
store.set({ finishedAt: Date.now() });
|
|
2875
2965
|
if (!executionLease) stopTick();
|
|
@@ -2894,11 +2984,18 @@ async function runTaskInternal(task, options, owner) {
|
|
|
2894
2984
|
}
|
|
2895
2985
|
/** 终止当前任务(无任务时忽略);等待 agent 完全停下后 resolve */
|
|
2896
2986
|
async function stopTask() {
|
|
2987
|
+
cancelPageUseSubmit();
|
|
2988
|
+
activeCancellation?.abort();
|
|
2989
|
+
cancelQuestion?.();
|
|
2897
2990
|
if (executionLease) return executionLease.stop();
|
|
2898
2991
|
await agent?.stop();
|
|
2899
2992
|
}
|
|
2900
2993
|
async function stopTaskForFlow(owner) {
|
|
2901
|
-
if (executionLease?.owner === owner)
|
|
2994
|
+
if (executionLease?.owner === owner) {
|
|
2995
|
+
activeCancellation?.abort();
|
|
2996
|
+
cancelQuestion?.();
|
|
2997
|
+
await agent?.stop();
|
|
2998
|
+
}
|
|
2902
2999
|
}
|
|
2903
3000
|
function acquireFlowExecution(owner, stop) {
|
|
2904
3001
|
if (isRunning() || activeOptions) throw new FlowError("BUSY", "已有任务正在操作页面");
|
|
@@ -2999,6 +3096,9 @@ function clearPageUseLog() {
|
|
|
2999
3096
|
}
|
|
3000
3097
|
/** 释放 agent(清掉高亮与蒙层);宿主销毁(如登出)时调用 */
|
|
3001
3098
|
function disposeAgent() {
|
|
3099
|
+
cancelPageUseSubmit();
|
|
3100
|
+
activeCancellation?.abort();
|
|
3101
|
+
cancelQuestion?.();
|
|
3002
3102
|
const lease = executionLease;
|
|
3003
3103
|
executionLease = null;
|
|
3004
3104
|
if (lease) lease.stop().catch((error) => console.warn("[PageUse] 取消流程失败", error));
|
|
@@ -8670,4 +8770,4 @@ async function runPageUseFlowTool(flow, args, options = {}) {
|
|
|
8670
8770
|
}
|
|
8671
8771
|
|
|
8672
8772
|
//#endregion
|
|
8673
|
-
export { showFlowMask as $, parseFlowBundle as A,
|
|
8773
|
+
export { showFlowMask as $, parseFlowBundle as A, listTtsEngines as At, acquireFlowExecution as B, cancelRegionPicker as Bt, createIndexedDbFlowRepository as C, DEFAULT_MODEL as Ct, flowSceneDraftSchema as D, normalizeOptions as Dt, flowBundleSchema as E, DEFAULT_TOUR_MAX_TAB_SWITCHES as Et, sceneKey as F, browserTtsEngine as Ft, getPageUseSnapshot as G, configurePageUse as H, FLOW_BUNDLE_VERSION as Ht, scopeKey as I, isSpeechSupported as It, isRunning as J, hideFlowMask as K, validateFlowInputs as L, DEFAULT_TOUR_STYLES as Lt, parseFlowRegion as M, PAGE_USE_MASK_COLORS as Mt, parseFlowScene as N, SIMULATOR_MASK_ID as Nt, flowSceneSchema as O, readLauncherQuery as Ot, parseFlowSceneDraft as P, BROWSER_ENGINE_ID as Pt, runTaskForFlow as Q, validateRegionPreviewInputs as R, TOUR_STYLE_TRAINER as Rt, previewFlowImport as S, DEFAULT_MAX_STEPS as St, cloneJson as T, DEFAULT_STORAGE_KEY_PREFIX as Tt, getElapsedSeconds as U, FLOW_SCHEMA_VERSION as Ut, clearPageUseLog as V, hasRegionPicker as Vt, getPageUseConfig as W, FlowError as Wt, registerQuestionUi as X, pageUseStore as Y, runTask as Z, createFlowApiAdapter as _, startPreview as _t, mountPageUseManager as a, decidePageUseSubmit as at, exportFlowBundle as b, pageUseSettings as bt, createFlowRegionPicker as c, pageUseHistory as ct, evaluateFlowCompletion as d, hideTourHighlight as dt, stopTask as et, composedParent as f, showTourHighlight as ft, validateRegionPages as g, previewStore as gt, regionAbortable as h, registerNarrationPanelName as ht, definePageUseManagerElement as i, cancelPageUseSubmit as it, parseFlowKnowledge as j, resolveTtsEngine as jt, newRevision as k, readLauncherSwitch as kt, createFlowRunner as l, completionRequestBody as lt, locateFlowRegion as m, narrationMute as mt, getPageUseFlowCatalog as n, subscribePageUse as nt, PAGE_USE_MANAGER_TAG as o, pageUseSubmitStore as ot, createRegionSelector as p, narrate as pt, isPageUseConfigured as q, runPageUseFlowTool as r, updateFlowExecution as rt, PageUseManagerElement as s, pageUsePresets as st, PAGE_USE_FLOW_TOOL as t, stopTaskForFlow as tt, createCompletionEvaluator as u, readCompletionResponse as ut, validateFlowApiOptions as v, stopPreview as vt, FLOW_SEGMENT_MAX_CHARS as w, DEFAULT_SESSION_HEADER as wt, importFlowBundle as x, createStore as xt, createFlowCloud as y, DEFAULT_PAGE_USE_SETTINGS as yt, validateSceneBindings as z, TOUR_STYLE_USER as zt };
|
package/dist/vue.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import { A as PageUseGlobal, B as
|
|
1
|
+
import { $ as FlowApiSyncOptions, $t as FlowScope, A as MountPageUseManagerOptions, At as FlowManagerState, Bt as FlowRegionContext, C as DEFAULT_TOUR_STYLES, Ct as FlowIdentity, D as PAGE_USE_FLOW_TOOL, Dt as FlowKnowledge, E as TOUR_STYLE_USER, Et as FlowInputDefinition, Ft as FlowPermissions, Gt as FlowRepository, H as parseFlowSceneDraft, Ht as FlowRegionHost, It as FlowPresenter, J as FLOW_SCHEMA_VERSION, Jt as FlowRunOptions, Kt as FlowRepositorySnapshot, L as newRevision, Lt as FlowRegion, M as mountPageUseManager, Mt as FlowOutputReference, Nt as FlowParameter, O as getPageUseFlowCatalog, Ot as FlowKnowledgeRecord, Pt as FlowParameterDefinition, Q as FlowApiResponse, Qt as FlowSceneRecord, Rt as FlowRegionAnchor, S as PageUseTtsVoice, St as FlowGenerator, T as TOUR_STYLE_TRAINER, Tt as FlowImportStrategy, U as sceneKey, Ut as FlowRegionPage, V as parseFlowScene, Vt as FlowRegionFailure, Wt as FlowRegionSelector, X as FlowActionBinding, Xt as FlowRunner, Y as FlowAction, Yt as FlowRunResult, Z as FlowApiRequest, Zt as FlowScene, _ as PageUseSubmitRequest, _n as PageUseSnapshot, _t as FlowError, a as DEFAULT_TOUR_MAX_TAB_SWITCHES, an as FlowStep, at as FlowClient, b as PageUseTtsEngine, bn as PageUseTaskSource, bt as FlowExecutionPorts, c as PageUseLLMOptions, cn as JsonValue, ct as FlowCloudController, d as PageUseRouterMode, dn as PageUseAskUserContext, dt as FlowCompletionDecision, en as FlowSegment, et as FlowBindings, f as PageUseTourOptions, fn as PageUseErrorCode, ft as FlowCompletionEvaluator, g as PageUseSubmitHandler, gn as PageUseRunOptions, gt as FlowDescriptionCheck, h as PageUseSubmitDecision, hn as PageUseProgressEvent, ht as FlowContextBinding, i as DEFAULT_STORAGE_KEY_PREFIX, in as FlowStatus, it as FlowCheckBinding, j as definePageUseManagerElement, jt as FlowMode, k as runPageUseFlowTool, kt as FlowManager, l as PageUseLLMStreamOptions, ln as PageUseFlowHandle, lt as FlowCloudRelease, m as readLauncherSwitch, mn as PageUsePreset, mt as FlowContext, n as DEFAULT_MODEL, nn as FlowSessionContext, nt as FlowBundle, on as FlowTombstone, ot as FlowCloudAdapter, p as normalizeOptions, pn as PageUseMenuNode, pt as FlowConfigResponse, q as FLOW_BUNDLE_VERSION, qt as FlowResolvedTarget, r as DEFAULT_SESSION_HEADER, rn as FlowSnapshot, rt as FlowCheck, s as NormalizedPageUseOptions, sn as JsonObject, st as FlowCloudCache, t as DEFAULT_MAX_STEPS, tn as FlowSegmentLog, tt as FlowBoundCheck, u as PageUseOptions, un as PageUseFlowOptions, ut as FlowCloudState, v as cancelPageUseSubmit, vn as PageUseStepLog, vt as FlowErrorCode, w as PageUseTourStyle, wt as FlowImportPreview, x as PageUseTtsSpeakOptions, xn as PageUseTaskStatus, xt as FlowExportOptions, y as pageUseSubmitStore, yn as PageUseTaskResult, yt as FlowEvent, z as parseFlowKnowledge, zt as FlowRegionCandidate } from "./options-BIwnIeed.mjs";
|
|
2
|
+
import { $ as createPageUse, A as PageUseGlobal, B as PAGE_USE_TOOL_NAME, C as getElapsedSeconds, D as pageUseStore, E as isRunning, F as openPageUsePanel, G as MountPageUseUIOptions, H as formatPageUseResultForModel, I as showPageUseLauncher, J as PAGE_USE_LAUNCHER_TAG, K as definePageUseElements, L as subscribePageUsePanel, M as closePageUsePanel, N as getPageUsePanelSnapshot, O as ReadonlyStore, P as hidePageUseLauncher, Q as PageUseHandle, R as PAGE_USE_COMMAND_TYPE, S as clearPageUseLog, T as isPageUseConfigured, U as isPageUseCommand, V as PageUseCommand, W as runPageUseTool, X as PageUseLauncherElement, Y as PageUseLauncherConfig, Z as PageUseLauncherLayout, _ as pageUseSettings, a as PAGE_USE_ROBOT_ICON_SVG, b as PageUseQuestion, c as PageUseCustomPreset, d as pageUsePresets, et as getPageUseFlow, f as PageUseHistoryEntry, g as PageUseSettings, h as PageUsePoint, i as PageUseGlowElement, j as PageUsePanelSnapshot, k as PAGE_USE_GLOBAL_KEY, l as PageUsePresetSaveResult, m as DEFAULT_PAGE_USE_SETTINGS, n as SIMULATOR_MASK_ID, nt as pageUseCapability, o as PAGE_USE_STATIC_PRESETS, p as pageUseHistory, q as mountPageUseUI, r as PAGE_USE_GLOW_TAG, s as buildMenuPresets, t as PAGE_USE_MASK_COLORS, tt as PageUseCapability, u as PageUsePresetState, v as BROWSER_ENGINE_ID, w as getPageUseConfig, x as PageUseState, y as browserTtsEngine, z as PAGE_USE_TOOL } from "./index-XRyK_b1h.mjs";
|
|
3
3
|
import { PropType, ShallowRef } from "vue";
|
|
4
4
|
import { Router } from "vue-router";
|
|
5
5
|
//#region src/vue.d.ts
|
|
@@ -51,4 +51,4 @@ export declare function usePageUseState(): Readonly<ShallowRef<PageUseState>>;
|
|
|
51
51
|
/** 本地设置的 Vue 响应式引用;修改请调用 pageUseSettings.update */
|
|
52
52
|
export declare function usePageUseSettings(): Readonly<ShallowRef<PageUseSettings>>;
|
|
53
53
|
//#endregion
|
|
54
|
-
export { BROWSER_ENGINE_ID, DEFAULT_MAX_STEPS, DEFAULT_MODEL, DEFAULT_PAGE_USE_SETTINGS, DEFAULT_SESSION_HEADER, DEFAULT_STORAGE_KEY_PREFIX, DEFAULT_TOUR_MAX_TAB_SWITCHES, DEFAULT_TOUR_STYLES, FLOW_BUNDLE_VERSION, FLOW_SCHEMA_VERSION, FlowAction, FlowActionBinding, FlowApiRequest, FlowApiResponse, FlowApiSyncOptions, FlowBindings, FlowBoundCheck, FlowBundle, FlowCheck, FlowCheckBinding, FlowClient, FlowCloudAdapter, FlowCloudCache, FlowCloudController, FlowCloudRelease, FlowCloudState, FlowCompletionDecision, FlowCompletionEvaluator, FlowConfigResponse, FlowContext, FlowContextBinding, FlowDescriptionCheck, FlowError, FlowErrorCode, FlowEvent, FlowExecutionPorts, FlowExportOptions, FlowGenerator, FlowIdentity, FlowImportPreview, FlowImportStrategy, FlowInputDefinition, FlowKnowledge, FlowKnowledgeRecord, FlowManager, FlowManagerState, FlowMode, FlowOutputReference, FlowParameter, FlowParameterDefinition, FlowPermissions, FlowPresenter, FlowRegion, FlowRegionAnchor, FlowRegionCandidate, FlowRegionContext, FlowRegionFailure, FlowRegionHost, FlowRegionPage, FlowRegionSelector, FlowRepository, FlowRepositorySnapshot, FlowResolvedTarget, FlowRunOptions, FlowRunResult, FlowRunner, FlowScene, FlowSceneRecord, FlowScope, FlowSegment, FlowSegmentLog, FlowSessionContext, FlowSnapshot, FlowStatus, FlowStep, FlowTombstone, JsonObject, JsonValue, type MountPageUseManagerOptions, type MountPageUseUIOptions, type NormalizedPageUseOptions, PAGE_USE_COMMAND_TYPE, PAGE_USE_FLOW_TOOL, PAGE_USE_GLOBAL_KEY, PAGE_USE_GLOW_TAG, PAGE_USE_LAUNCHER_TAG, PAGE_USE_MASK_COLORS, PAGE_USE_ROBOT_ICON_SVG, PAGE_USE_STATIC_PRESETS, PAGE_USE_TOOL, PAGE_USE_TOOL_NAME, type PageUseCapability, type PageUseCommand, type PageUseCustomPreset, type PageUseErrorCode, PageUseFlowHandle, PageUseFlowOptions, type PageUseGlobal, PageUseGlowElement, type PageUseHandle, type PageUseHistoryEntry, type PageUseLLMOptions, type PageUseLLMStreamOptions, type PageUseLauncherConfig, PageUseLauncherElement, type PageUseLauncherLayout, type PageUseMenuNode, type PageUseOptions, type PageUsePoint, type PageUsePreset, type PageUsePresetSaveResult, type PageUsePresetState, type PageUseProgressEvent, type PageUseQuestion, type PageUseRouterMode, type PageUseRunOptions, type PageUseSettings, type PageUseSnapshot, type PageUseState, type PageUseStepLog, type PageUseTaskResult, type PageUseTaskSource, type PageUseTaskStatus, type PageUseTourOptions, type PageUseTourStyle, type PageUseTtsEngine, type PageUseTtsSpeakOptions, type PageUseTtsVoice, type ReadonlyStore, SIMULATOR_MASK_ID, TOUR_STYLE_TRAINER, TOUR_STYLE_USER, browserTtsEngine, buildMenuPresets, clearPageUseLog, createPageUse, definePageUseElements, definePageUseManagerElement, formatPageUseResultForModel, getElapsedSeconds, getPageUseConfig, getPageUseFlow, getPageUseFlowCatalog, hidePageUseLauncher, isPageUseCommand, isPageUseConfigured, isRunning, mountPageUseManager, mountPageUseUI, newRevision, normalizeOptions, pageUseCapability, pageUseHistory, pageUsePresets, pageUseSettings, pageUseStore, parseFlowKnowledge, parseFlowScene, parseFlowSceneDraft, readLauncherSwitch, runPageUseFlowTool, runPageUseTool, sceneKey, showPageUseLauncher };
|
|
54
|
+
export { BROWSER_ENGINE_ID, DEFAULT_MAX_STEPS, DEFAULT_MODEL, DEFAULT_PAGE_USE_SETTINGS, DEFAULT_SESSION_HEADER, DEFAULT_STORAGE_KEY_PREFIX, DEFAULT_TOUR_MAX_TAB_SWITCHES, DEFAULT_TOUR_STYLES, FLOW_BUNDLE_VERSION, FLOW_SCHEMA_VERSION, FlowAction, FlowActionBinding, FlowApiRequest, FlowApiResponse, FlowApiSyncOptions, FlowBindings, FlowBoundCheck, FlowBundle, FlowCheck, FlowCheckBinding, FlowClient, FlowCloudAdapter, FlowCloudCache, FlowCloudController, FlowCloudRelease, FlowCloudState, FlowCompletionDecision, FlowCompletionEvaluator, FlowConfigResponse, FlowContext, FlowContextBinding, FlowDescriptionCheck, FlowError, FlowErrorCode, FlowEvent, FlowExecutionPorts, FlowExportOptions, FlowGenerator, FlowIdentity, FlowImportPreview, FlowImportStrategy, FlowInputDefinition, FlowKnowledge, FlowKnowledgeRecord, FlowManager, FlowManagerState, FlowMode, FlowOutputReference, FlowParameter, FlowParameterDefinition, FlowPermissions, FlowPresenter, FlowRegion, FlowRegionAnchor, FlowRegionCandidate, FlowRegionContext, FlowRegionFailure, FlowRegionHost, FlowRegionPage, FlowRegionSelector, FlowRepository, FlowRepositorySnapshot, FlowResolvedTarget, FlowRunOptions, FlowRunResult, FlowRunner, FlowScene, FlowSceneRecord, FlowScope, FlowSegment, FlowSegmentLog, FlowSessionContext, FlowSnapshot, FlowStatus, FlowStep, FlowTombstone, JsonObject, JsonValue, type MountPageUseManagerOptions, type MountPageUseUIOptions, type NormalizedPageUseOptions, PAGE_USE_COMMAND_TYPE, PAGE_USE_FLOW_TOOL, PAGE_USE_GLOBAL_KEY, PAGE_USE_GLOW_TAG, PAGE_USE_LAUNCHER_TAG, PAGE_USE_MASK_COLORS, PAGE_USE_ROBOT_ICON_SVG, PAGE_USE_STATIC_PRESETS, PAGE_USE_TOOL, PAGE_USE_TOOL_NAME, type PageUseAskUserContext, type PageUseCapability, type PageUseCommand, type PageUseCustomPreset, type PageUseErrorCode, PageUseFlowHandle, PageUseFlowOptions, type PageUseGlobal, PageUseGlowElement, type PageUseHandle, type PageUseHistoryEntry, type PageUseLLMOptions, type PageUseLLMStreamOptions, type PageUseLauncherConfig, PageUseLauncherElement, type PageUseLauncherLayout, type PageUseMenuNode, type PageUseOptions, type PageUsePanelSnapshot, type PageUsePoint, type PageUsePreset, type PageUsePresetSaveResult, type PageUsePresetState, type PageUseProgressEvent, type PageUseQuestion, type PageUseRouterMode, type PageUseRunOptions, type PageUseSettings, type PageUseSnapshot, type PageUseState, type PageUseStepLog, type PageUseSubmitDecision, type PageUseSubmitHandler, type PageUseSubmitRequest, type PageUseTaskResult, type PageUseTaskSource, type PageUseTaskStatus, type PageUseTourOptions, type PageUseTourStyle, type PageUseTtsEngine, type PageUseTtsSpeakOptions, type PageUseTtsVoice, type ReadonlyStore, SIMULATOR_MASK_ID, TOUR_STYLE_TRAINER, TOUR_STYLE_USER, browserTtsEngine, buildMenuPresets, cancelPageUseSubmit, clearPageUseLog, closePageUsePanel, createPageUse, definePageUseElements, definePageUseManagerElement, formatPageUseResultForModel, getElapsedSeconds, getPageUseConfig, getPageUseFlow, getPageUseFlowCatalog, getPageUsePanelSnapshot, hidePageUseLauncher, isPageUseCommand, isPageUseConfigured, isRunning, mountPageUseManager, mountPageUseUI, newRevision, normalizeOptions, openPageUsePanel, pageUseCapability, pageUseHistory, pageUsePresets, pageUseSettings, pageUseStore, pageUseSubmitStore, parseFlowKnowledge, parseFlowScene, parseFlowSceneDraft, readLauncherSwitch, runPageUseFlowTool, runPageUseTool, sceneKey, showPageUseLauncher, subscribePageUsePanel };
|
package/dist/vue.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { _ as isPageUseCommand, a as PAGE_USE_STATIC_PRESETS, b as
|
|
1
|
+
import { Ct as DEFAULT_MODEL, Dt as normalizeOptions, Et as DEFAULT_TOUR_MAX_TAB_SWITCHES, F as sceneKey, Ft as browserTtsEngine, Ht as FLOW_BUNDLE_VERSION, J as isRunning, Lt as DEFAULT_TOUR_STYLES, Mt as PAGE_USE_MASK_COLORS, N as parseFlowScene, Nt as SIMULATOR_MASK_ID, P as parseFlowSceneDraft, Pt as BROWSER_ENGINE_ID, Rt as TOUR_STYLE_TRAINER, St as DEFAULT_MAX_STEPS, Tt as DEFAULT_STORAGE_KEY_PREFIX, U as getElapsedSeconds, Ut as FLOW_SCHEMA_VERSION, V as clearPageUseLog, W as getPageUseConfig, Wt as FlowError, Y as pageUseStore, a as mountPageUseManager, bt as pageUseSettings, ct as pageUseHistory, i as definePageUseManagerElement, it as cancelPageUseSubmit, j as parseFlowKnowledge, k as newRevision, kt as readLauncherSwitch, n as getPageUseFlowCatalog, ot as pageUseSubmitStore, q as isPageUseConfigured, r as runPageUseFlowTool, st as pageUsePresets, t as PAGE_USE_FLOW_TOOL, wt as DEFAULT_SESSION_HEADER, yt as DEFAULT_PAGE_USE_SETTINGS, zt as TOUR_STYLE_USER } from "./tool-C9eKI80l.mjs";
|
|
2
|
+
import { C as showPageUseLauncher, S as openPageUsePanel, T as pageUseCapability, _ as isPageUseCommand, a as PAGE_USE_STATIC_PRESETS, b as getPageUsePanelSnapshot, c as PAGE_USE_GLOW_TAG, d as getPageUseFlow, f as PAGE_USE_GLOBAL_KEY, g as formatPageUseResultForModel, h as PAGE_USE_TOOL_NAME, i as PageUseLauncherElement, l as PageUseGlowElement, m as PAGE_USE_TOOL, n as mountPageUseUI, o as buildMenuPresets, p as PAGE_USE_COMMAND_TYPE, r as PAGE_USE_LAUNCHER_TAG, s as PAGE_USE_ROBOT_ICON_SVG, t as definePageUseElements, u as createPageUse, v as runPageUseTool, w as subscribePageUsePanel, x as hidePageUseLauncher, y as closePageUsePanel } from "./src-Cus5n_PO.mjs";
|
|
3
3
|
import { defineComponent, inject, onBeforeUnmount, onScopeDispose, shallowRef } from "vue";
|
|
4
4
|
import { routerKey } from "vue-router";
|
|
5
5
|
|
|
@@ -84,4 +84,4 @@ function usePageUseSettings() {
|
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
//#endregion
|
|
87
|
-
export { BROWSER_ENGINE_ID, DEFAULT_MAX_STEPS, DEFAULT_MODEL, DEFAULT_PAGE_USE_SETTINGS, DEFAULT_SESSION_HEADER, DEFAULT_STORAGE_KEY_PREFIX, DEFAULT_TOUR_MAX_TAB_SWITCHES, DEFAULT_TOUR_STYLES, FLOW_BUNDLE_VERSION, FLOW_SCHEMA_VERSION, FlowError, PAGE_USE_COMMAND_TYPE, PAGE_USE_FLOW_TOOL, PAGE_USE_GLOBAL_KEY, PAGE_USE_GLOW_TAG, PAGE_USE_LAUNCHER_TAG, PAGE_USE_MASK_COLORS, PAGE_USE_ROBOT_ICON_SVG, PAGE_USE_STATIC_PRESETS, PAGE_USE_TOOL, PAGE_USE_TOOL_NAME, PageUseGlowElement, PageUseHost, PageUseLauncherElement, SIMULATOR_MASK_ID, TOUR_STYLE_TRAINER, TOUR_STYLE_USER, browserTtsEngine, buildMenuPresets, clearPageUseLog, createPageUse, definePageUseElements, definePageUseManagerElement, formatPageUseResultForModel, getElapsedSeconds, getPageUseConfig, getPageUseFlow, getPageUseFlowCatalog, hidePageUseLauncher, isPageUseCommand, isPageUseConfigured, isRunning, mountPageUseManager, mountPageUseUI, newRevision, normalizeOptions, pageUseCapability, pageUseHistory, pageUsePresets, pageUseSettings, pageUseStore, parseFlowKnowledge, parseFlowScene, parseFlowSceneDraft, readLauncherSwitch, runPageUseFlowTool, runPageUseTool, sceneKey, showPageUseLauncher, usePageUseSettings, usePageUseState, withVueRouter };
|
|
87
|
+
export { BROWSER_ENGINE_ID, DEFAULT_MAX_STEPS, DEFAULT_MODEL, DEFAULT_PAGE_USE_SETTINGS, DEFAULT_SESSION_HEADER, DEFAULT_STORAGE_KEY_PREFIX, DEFAULT_TOUR_MAX_TAB_SWITCHES, DEFAULT_TOUR_STYLES, FLOW_BUNDLE_VERSION, FLOW_SCHEMA_VERSION, FlowError, PAGE_USE_COMMAND_TYPE, PAGE_USE_FLOW_TOOL, PAGE_USE_GLOBAL_KEY, PAGE_USE_GLOW_TAG, PAGE_USE_LAUNCHER_TAG, PAGE_USE_MASK_COLORS, PAGE_USE_ROBOT_ICON_SVG, PAGE_USE_STATIC_PRESETS, PAGE_USE_TOOL, PAGE_USE_TOOL_NAME, PageUseGlowElement, PageUseHost, PageUseLauncherElement, SIMULATOR_MASK_ID, TOUR_STYLE_TRAINER, TOUR_STYLE_USER, browserTtsEngine, buildMenuPresets, cancelPageUseSubmit, clearPageUseLog, closePageUsePanel, createPageUse, definePageUseElements, definePageUseManagerElement, formatPageUseResultForModel, getElapsedSeconds, getPageUseConfig, getPageUseFlow, getPageUseFlowCatalog, getPageUsePanelSnapshot, hidePageUseLauncher, isPageUseCommand, isPageUseConfigured, isRunning, mountPageUseManager, mountPageUseUI, newRevision, normalizeOptions, openPageUsePanel, pageUseCapability, pageUseHistory, pageUsePresets, pageUseSettings, pageUseStore, pageUseSubmitStore, parseFlowKnowledge, parseFlowScene, parseFlowSceneDraft, readLauncherSwitch, runPageUseFlowTool, runPageUseTool, sceneKey, showPageUseLauncher, subscribePageUsePanel, usePageUseSettings, usePageUseState, withVueRouter };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanzerfe/page-use",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.15",
|
|
5
5
|
"description": "基于 page-agent 的页面操作智能体:自然语言指令驱动页面点击与输入,框架无关,附 Web Component 调试面板与 Vue 适配层",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./dist/index.mjs",
|
|
@@ -73,6 +73,7 @@
|
|
|
73
73
|
"build": "tsdown",
|
|
74
74
|
"dev": "tsdown --watch",
|
|
75
75
|
"test": "vitest run",
|
|
76
|
+
"test:package": "node scripts/verify-local-package.mjs",
|
|
76
77
|
"typecheck": "tsc --noEmit"
|
|
77
78
|
}
|
|
78
79
|
}
|