@mearl/client 2.22.0 → 3.0.0-beta.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/LICENSE +201 -0
- package/README.md +40 -40
- package/dist/actionTimeouts.js +1 -1
- package/dist/artifacts.d.ts +1 -1
- package/dist/autoUpdate.js +1 -2
- package/dist/browserRegistry.d.ts +1 -1
- package/dist/check.d.ts +1 -1
- package/dist/check.js +4 -3
- package/dist/commands.d.ts +12 -12
- package/dist/commands.js +15 -14
- package/dist/index.d.ts +4 -7
- package/dist/index.js +1 -1
- package/dist/local.d.ts +3 -1
- package/dist/local.js +2 -1
- package/dist/pageEvalArguments.d.ts +1 -1
- package/dist/pageEvalArguments.js +1 -1
- package/dist/plugin.d.ts +1 -0
- package/dist/plugin.js +1 -0
- package/dist/pluginModelSessionWorker.d.ts +2 -2
- package/dist/plugins/clients/pluginHostConnection.d.ts +1 -1
- package/dist/plugins/clients/pluginHostConnection.js +1 -1
- package/dist/plugins/clients/pluginModels.d.ts +3 -3
- package/dist/plugins/clients/pluginPages.d.ts +2 -2
- package/dist/plugins/clients/pluginState.d.ts +2 -2
- package/dist/plugins/clients/pluginTasks.d.ts +3 -3
- package/dist/plugins/clients/pluginTasks.js +1 -1
- package/dist/plugins/officialPluginCatalog.d.ts +18 -21
- package/dist/plugins/officialPluginCatalog.js +120 -24
- package/dist/plugins/officialPluginInstaller.js +6 -1
- package/dist/plugins/pluginRegistry.d.ts +1 -1
- package/dist/plugins/pluginRegistry.js +2 -2
- package/dist/plugins/pluginTaskProtocol.d.ts +1 -1
- package/dist/plugins/runtime/pluginDiagnostics.d.ts +3 -3
- package/dist/plugins/runtime/pluginDiagnostics.js +2 -2
- package/dist/plugins/runtime/pluginExecution.d.ts +2 -2
- package/dist/plugins/runtime/pluginExecutor.d.ts +1 -1
- package/dist/plugins/runtime/pluginExecutorProtocol.d.ts +2 -2
- package/dist/plugins/runtime/pluginHost.d.ts +2 -2
- package/dist/plugins/runtime/pluginHostServer.js +1 -1
- package/dist/plugins/runtime/pluginModelCatalog.d.ts +1 -1
- package/dist/plugins/runtime/pluginPageManager.d.ts +3 -3
- package/dist/plugins/runtime/pluginPageManager.js +2 -2
- package/dist/plugins/runtime/pluginRevision.js +2 -1
- package/dist/plugins/runtime/pluginStateManager.d.ts +1 -1
- package/dist/plugins/runtime/pluginStateStore.d.ts +1 -1
- package/dist/plugins/runtime/pluginTaskManager.d.ts +10 -10
- package/dist/plugins/runtime/pluginTaskManager.js +1 -1
- package/dist/plugins/runtime/pluginTaskStore.d.ts +3 -3
- package/dist/plugins/runtime/pluginTaskStore.js +1 -1
- package/dist/plugins/runtime/pythonPlugin.d.ts +1 -1
- package/dist/plugins/sdk/plugin.d.ts +9 -12
- package/dist/plugins/sdk/plugin.js +4 -7
- package/dist/plugins/sdk/pluginAppProfiles.d.ts +1 -1
- package/dist/plugins/sdk/pluginAppProfiles.js +1 -1
- package/dist/plugins/sdk/pluginModelDefinition.d.ts +1 -1
- package/dist/plugins/sdk/pluginPageDefinition.d.ts +1 -1
- package/dist/plugins/sdk/pluginPageDefinition.js +1 -1
- package/dist/plugins/sdk/pluginRecoveryDefinition.d.ts +1 -1
- package/dist/plugins/sdk/pluginStateDefinition.d.ts +2 -2
- package/dist/plugins/skillManifest.d.ts +10 -0
- package/dist/plugins/skillManifest.js +56 -0
- package/dist/socket.d.ts +2 -0
- package/dist/socket.js +13 -3
- package/dist/unified.d.ts +1 -1
- package/dist/unified.js +1 -1
- package/package.json +9 -8
- package/dist/generated/app-profile-definition.d.ts +0 -130
- package/dist/generated/app-profile-definition.js +0 -458
- package/dist/generated/app-profile-runtime-types.d.ts +0 -213
- package/dist/generated/app-profile-runtime-types.js +0 -1
- package/dist/generated/browser-action-protocol.d.ts +0 -1147
- package/dist/generated/browser-action-protocol.js +0 -283
- package/dist/generated/plugin-diagnostics.d.ts +0 -110
- package/dist/generated/plugin-diagnostics.js +0 -1
- package/dist/generated/plugin-execution.d.ts +0 -27
- package/dist/generated/plugin-execution.js +0 -1
- package/dist/generated/plugin-models.d.ts +0 -64
- package/dist/generated/plugin-models.js +0 -1
- package/dist/generated/plugin-pages.d.ts +0 -76
- package/dist/generated/plugin-pages.js +0 -59
- package/dist/generated/plugin-recovery.d.ts +0 -32
- package/dist/generated/plugin-recovery.js +0 -1
- package/dist/generated/plugin-state.d.ts +0 -50
- package/dist/generated/plugin-state.js +0 -1
- package/dist/generated/plugin-tasks.d.ts +0 -74
- package/dist/generated/plugin-tasks.js +0 -7
- package/dist/generated/toolbox-icon.d.ts +0 -10
- package/dist/generated/toolbox-icon.js +0 -37
|
@@ -2,7 +2,7 @@ import { randomUUID } from 'node:crypto';
|
|
|
2
2
|
import { createServer } from 'node:net';
|
|
3
3
|
import { chmodSync, rmSync } from 'node:fs';
|
|
4
4
|
import { claimRecord, isProcessOwnerAlive, processIdentity, readRecord, removeInvalidRecord, removeRecordIfPid, writeRecordIfPid, } from '@mearl/daemon-core';
|
|
5
|
-
import { PLUGIN_TASK_PROTOCOL_VERSION } from '
|
|
5
|
+
import { PLUGIN_TASK_PROTOCOL_VERSION } from '@mearl/browser-core';
|
|
6
6
|
import { pluginHostPaths } from './pluginHostPaths.js';
|
|
7
7
|
import { PluginHost } from './pluginHost.js';
|
|
8
8
|
import { readPluginTaskMessages, writePluginTaskMessage } from '../pluginTaskWire.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PluginModelList, PluginModelOption } from '
|
|
1
|
+
import type { PluginModelList, PluginModelOption } from '@mearl/browser-core';
|
|
2
2
|
/** A bounded shared lookup avoids starting a discovery process for each open tool. */
|
|
3
3
|
export declare class PluginModelCatalog {
|
|
4
4
|
private readonly discover;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { PluginDiagnosticPage } from '
|
|
1
|
+
import type { PluginDiagnosticPage } from '@mearl/browser-core';
|
|
2
2
|
import type { PluginStateManager } from './pluginStateManager.js';
|
|
3
|
-
import type { PluginInvocationIdentity } from '
|
|
3
|
+
import type { PluginInvocationIdentity } from '@mearl/browser-core';
|
|
4
4
|
import type { PluginRevision } from './pluginRevision.js';
|
|
5
5
|
import type { PluginOptions } from '../sdk/plugin.js';
|
|
6
|
-
import type { PluginPageTarget } from '
|
|
6
|
+
import type { PluginPageTarget } from '@mearl/browser-core';
|
|
7
7
|
import type { PluginTaskBridge, PluginTaskManager } from './pluginTaskManager.js';
|
|
8
8
|
interface Execution {
|
|
9
9
|
cwd: string;
|
|
@@ -9,8 +9,8 @@ import { compilePluginPageSchema } from '../sdk/pluginPageDefinition.js';
|
|
|
9
9
|
import { UnifiedClient, decodeBrowserTarget } from '../../unified.js';
|
|
10
10
|
import { pluginHostPaths } from './pluginHostPaths.js';
|
|
11
11
|
import { serializePluginExecutionError, pluginExecutionError } from './pluginExecutorProtocol.js';
|
|
12
|
-
import { isPluginTaskActive } from '
|
|
13
|
-
import { isPluginPageInstanceId, matchesPluginPageURL, isPluginPageInvalidation, isPluginPageUnavailable, pluginPageUnavailable, PLUGIN_PAGE_LEASE_MS, } from '
|
|
12
|
+
import { isPluginTaskActive } from '@mearl/browser-core';
|
|
13
|
+
import { isPluginPageInstanceId, matchesPluginPageURL, isPluginPageInvalidation, isPluginPageUnavailable, pluginPageUnavailable, PLUGIN_PAGE_LEASE_MS, } from '@mearl/browser-core';
|
|
14
14
|
function failure(code, message) {
|
|
15
15
|
return Object.assign(new Error(message), { code });
|
|
16
16
|
}
|
|
@@ -5,6 +5,7 @@ import { claimRecord, readRecord, writeRecord } from '@mearl/daemon-core';
|
|
|
5
5
|
import { isBuiltin } from 'node:module';
|
|
6
6
|
import { parse } from 'acorn';
|
|
7
7
|
import { pluginHostPaths } from './pluginHostPaths.js';
|
|
8
|
+
import { skillManifestPath } from '../skillManifest.js';
|
|
8
9
|
import { findPluginRegistration, PluginError } from '../pluginRegistry.js';
|
|
9
10
|
const MAX_REVISION_BYTES = 64 * 1024 * 1024;
|
|
10
11
|
const validatedSources = new Set();
|
|
@@ -15,7 +16,7 @@ function within(root, file) {
|
|
|
15
16
|
function sourceRoot(entry) {
|
|
16
17
|
let candidate = dirname(entry);
|
|
17
18
|
for (let depth = 0; depth < 6; depth++) {
|
|
18
|
-
if (
|
|
19
|
+
if (skillManifestPath(candidate))
|
|
19
20
|
return candidate;
|
|
20
21
|
const parent = dirname(candidate);
|
|
21
22
|
if (parent === candidate)
|
|
@@ -2,7 +2,7 @@ import type { PluginRevision } from './pluginRevision.js';
|
|
|
2
2
|
import { PluginStateStore } from './pluginStateStore.js';
|
|
3
3
|
import type { PluginTaskManager, PluginTaskBridge } from './pluginTaskManager.js';
|
|
4
4
|
import type { PluginOptions } from '../sdk/plugin.js';
|
|
5
|
-
import type { PluginPageTarget } from '
|
|
5
|
+
import type { PluginPageTarget } from '@mearl/browser-core';
|
|
6
6
|
export declare class PluginStateManager {
|
|
7
7
|
private readonly tasks;
|
|
8
8
|
readonly store: PluginStateStore;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PluginStateCollection, PluginStateEntry, PluginStateTransaction } from '
|
|
1
|
+
import type { PluginStateCollection, PluginStateEntry, PluginStateTransaction } from '@mearl/browser-core';
|
|
2
2
|
export interface PluginStateNamespace {
|
|
3
3
|
installationId: string;
|
|
4
4
|
collection: string;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import type { PluginModelCatalog } from './pluginModelCatalog.js';
|
|
2
2
|
import type { PluginStateManager } from './pluginStateManager.js';
|
|
3
3
|
import type { PluginPageManager } from './pluginPageManager.js';
|
|
4
|
-
import type { PluginStateDeclaration } from '
|
|
5
|
-
import type { PluginTaskCheckpoint, PluginTaskRecoveryContext, PluginTaskRecoveryDeclaration } from '
|
|
4
|
+
import type { PluginStateDeclaration } from '@mearl/browser-core';
|
|
5
|
+
import type { PluginTaskCheckpoint, PluginTaskRecoveryContext, PluginTaskRecoveryDeclaration } from '@mearl/browser-core';
|
|
6
6
|
import { executeRegisteredPlugin } from './pluginExecutor.js';
|
|
7
7
|
import { capturePluginRevision } from './pluginRevision.js';
|
|
8
8
|
import type { PluginRevision } from './pluginRevision.js';
|
|
9
9
|
import { PluginTaskStore } from './pluginTaskStore.js';
|
|
10
|
-
import type { PluginTask, PluginTaskStartResult, PluginTaskListResult } from '
|
|
10
|
+
import type { PluginTask, PluginTaskStartResult, PluginTaskListResult } from '@mearl/browser-core';
|
|
11
11
|
import type { PluginTaskScope, PluginTaskStartRequest, PluginTaskResumeRequest } from '../pluginTaskProtocol.js';
|
|
12
|
-
import type { PluginInvocationIdentity } from '
|
|
13
|
-
import type { PluginPageTarget } from '
|
|
12
|
+
import type { PluginInvocationIdentity } from '@mearl/browser-core';
|
|
13
|
+
import type { PluginPageTarget } from '@mearl/browser-core';
|
|
14
14
|
import type { PluginOptions } from '../sdk/plugin.js';
|
|
15
|
-
import type { PluginPageBinding } from '
|
|
16
|
-
import type { PluginPageRuntime } from '
|
|
15
|
+
import type { PluginPageBinding } from '@mearl/browser-core';
|
|
16
|
+
import type { PluginPageRuntime } from '@mearl/browser-core';
|
|
17
17
|
export interface PluginTaskBridge {
|
|
18
18
|
id: string;
|
|
19
19
|
scope: PluginTaskScope;
|
|
@@ -37,7 +37,7 @@ export interface PluginTaskServices {
|
|
|
37
37
|
export declare class PluginTaskManager {
|
|
38
38
|
private readonly configuration;
|
|
39
39
|
private readonly services?;
|
|
40
|
-
readonly host: import("
|
|
40
|
+
readonly host: import("@mearl/browser-core").PluginExecutionHost;
|
|
41
41
|
readonly store: PluginTaskStore;
|
|
42
42
|
private readonly changes;
|
|
43
43
|
private readonly queue;
|
|
@@ -78,8 +78,8 @@ export declare class PluginTaskManager {
|
|
|
78
78
|
private resumeAttempt;
|
|
79
79
|
private assertExecutionTreeStopped;
|
|
80
80
|
cancel(taskId: string, scope: PluginTaskScope): PluginTask;
|
|
81
|
-
events(taskId: string, scope: PluginTaskScope, cursor: number, waitMs?: number, signal?: AbortSignal): Promise<import("
|
|
82
|
-
resultChunk(taskId: string, scope: PluginTaskScope, index: number): import("
|
|
81
|
+
events(taskId: string, scope: PluginTaskScope, cursor: number, waitMs?: number, signal?: AbortSignal): Promise<import("@mearl/browser-core").PluginTaskEvents>;
|
|
82
|
+
resultChunk(taskId: string, scope: PluginTaskScope, index: number): import("@mearl/browser-core").PluginTaskResultChunk;
|
|
83
83
|
private update;
|
|
84
84
|
private drain;
|
|
85
85
|
private execute;
|
|
@@ -12,7 +12,7 @@ import { serializePluginExecutionError, pluginExecutionError } from './pluginExe
|
|
|
12
12
|
import { capturePluginRevision, prunePluginRevisions, restorePluginRevision, } from './pluginRevision.js';
|
|
13
13
|
import { pluginHostPaths } from './pluginHostPaths.js';
|
|
14
14
|
import { PluginTaskStore, pluginTaskExecutionUnconfirmed } from './pluginTaskStore.js';
|
|
15
|
-
import { isPluginTaskActive } from '
|
|
15
|
+
import { isPluginTaskActive } from '@mearl/browser-core';
|
|
16
16
|
import { UnifiedClient, decodeBrowserTarget } from '../../unified.js';
|
|
17
17
|
import { COMMAND_MAP } from '../../commands.js';
|
|
18
18
|
function error(code, message) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { PluginTaskDiagnosticMetadata } from '
|
|
2
|
-
import type { PluginTask, PluginTaskEvent, PluginTaskEvents, PluginTaskResultChunk } from '
|
|
3
|
-
import type { PluginTaskCheckpoint } from '
|
|
1
|
+
import type { PluginTaskDiagnosticMetadata } from '@mearl/browser-core';
|
|
2
|
+
import type { PluginTask, PluginTaskEvent, PluginTaskEvents, PluginTaskResultChunk } from '@mearl/browser-core';
|
|
3
|
+
import type { PluginTaskCheckpoint } from '@mearl/browser-core';
|
|
4
4
|
import type { PluginOptions } from '../sdk/plugin.js';
|
|
5
5
|
export declare const PLUGIN_TASK_RESULT_CHUNK_BYTES: number;
|
|
6
6
|
export interface PluginTaskRecord {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createHash } from 'node:crypto';
|
|
2
2
|
import { closeSync, openSync, opendirSync, readFileSync, readSync, readdirSync, rmSync, statSync, } from 'node:fs';
|
|
3
3
|
import { join } from 'node:path';
|
|
4
|
-
import { isPluginTaskActive, isPluginTaskId } from '
|
|
4
|
+
import { isPluginTaskActive, isPluginTaskId } from '@mearl/browser-core';
|
|
5
5
|
import { writePluginHostFile } from './pluginHostFiles.js';
|
|
6
6
|
import { pluginHostPaths } from './pluginHostPaths.js';
|
|
7
7
|
import { isProcessGroupAlive, isProcessOwnerAlive } from '@mearl/daemon-core';
|
|
@@ -28,4 +28,4 @@ export interface PythonPluginApp {
|
|
|
28
28
|
progress(message: string): void;
|
|
29
29
|
}
|
|
30
30
|
export declare function describePythonPlugin(entry: string, options: Readonly<PluginOptions>): Promise<PythonPluginDescriptor>;
|
|
31
|
-
export declare function runPythonPluginCommand(entry: string, command: string, input: Record<string, any> | import('
|
|
31
|
+
export declare function runPythonPluginCommand(entry: string, command: string, input: Record<string, any> | import('@mearl/browser-core').PluginCheckpointMigrationInput, app: PythonPluginApp, context: PluginCommandContext, recovery?: boolean | 'migration', expectedDescriptor?: PythonPluginDescriptor, runtimeOnly?: boolean): Promise<unknown>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { PluginTaskRecoveryDeclaration, PluginTaskCheckpoint, PluginCheckpointMigrationInput } from '
|
|
2
|
-
import type { PluginStateDeclaration } from '
|
|
3
|
-
import type { PluginModelRequest, PluginModelResult } from '
|
|
4
|
-
import type { PluginPageRuntime } from '
|
|
5
|
-
import type { AppProfileContribution } from '
|
|
6
|
-
export type { AppProfileContribution, AppProfileDefinition, } from '
|
|
1
|
+
import type { PluginTaskRecoveryDeclaration, PluginTaskCheckpoint, PluginCheckpointMigrationInput } from '@mearl/browser-core';
|
|
2
|
+
import type { PluginStateDeclaration } from '@mearl/browser-core';
|
|
3
|
+
import type { PluginModelRequest, PluginModelResult } from '@mearl/browser-core';
|
|
4
|
+
import type { PluginPageRuntime } from '@mearl/browser-core';
|
|
5
|
+
import type { AppProfileContribution } from '@mearl/browser-core';
|
|
6
|
+
export type { AppProfileContribution, AppProfileDefinition, } from '@mearl/browser-core';
|
|
7
7
|
export { invokePageEvalWithArgs } from '../../pageEvalArguments.js';
|
|
8
8
|
import { type OfficialPluginInstaller } from '../officialPluginInstaller.js';
|
|
9
9
|
import { type PluginToolboxContribution, type PluginRegistration } from '../pluginRegistry.js';
|
|
@@ -14,8 +14,8 @@ export { executeRegisteredPlugin, type PluginExecutorOptions, type PluginExecuto
|
|
|
14
14
|
export { PluginTaskClient } from '../clients/pluginTasks.js';
|
|
15
15
|
export { cleanupPluginRuntime } from '../runtime/pluginRuntimeCleanup.js';
|
|
16
16
|
export { PluginPageClient } from '../clients/pluginPages.js';
|
|
17
|
-
export { assertPluginName, findPluginDirectoryEntry, findPluginEntry, findPluginRegistration, listPluginNames, pluginDirectory, registerPlugin, resolvePluginEntry, unregisterPlugin, PluginError, readPluginPageBundleChunk, type PluginRegistration, type PluginRegistrationOptions, type PluginToolboxAgentConfig, type PluginPageBundleRegistration, type PluginToolboxContribution, type PluginToolboxLocale, type PluginToolboxSandboxPage, } from '../pluginRegistry.js';
|
|
18
|
-
export { findOfficialPlugin, listOfficialPluginNames, OFFICIAL_PLUGIN_MANAGER, OFFICIAL_PLUGINS, type OfficialPluginDefinition, type OfficialPluginName, } from '../officialPluginCatalog.js';
|
|
17
|
+
export { assertPluginName, findPluginDirectoryEntry, findPluginEntry, findPluginRegistration, pluginRegistrationNeedsRefresh, listPluginNames, pluginDirectory, registerPlugin, resolvePluginEntry, unregisterPlugin, PluginError, readPluginPageBundleChunk, type PluginRegistration, type PluginRegistrationOptions, type PluginToolboxAgentConfig, type PluginPageBundleRegistration, type PluginToolboxContribution, type PluginToolboxLocale, type PluginToolboxSandboxPage, } from '../pluginRegistry.js';
|
|
18
|
+
export { findOfficialPlugin, listOfficialPluginNames, OFFICIAL_PLUGIN_MANAGER, OFFICIAL_PLUGINS, readOfficialPluginCatalog, replaceOfficialPluginCatalog, validateOfficialPluginCatalog, type PluginCatalogSelection, type PluginCatalog, type OfficialPluginDefinition, type OfficialPluginName, } from '../officialPluginCatalog.js';
|
|
19
19
|
export type PluginOptions = UnifiedInvokeOptions;
|
|
20
20
|
export interface StructuredPluginProgress {
|
|
21
21
|
message: string;
|
|
@@ -112,7 +112,4 @@ export declare function invokeRegisteredRuntimePlugin(name: string, invocation:
|
|
|
112
112
|
export declare function invokeRegisteredRecoveryPlugin(name: string, invocation: PluginInvocation, context: PluginExecutionContext, options?: PluginInvokeOptions): Promise<unknown>;
|
|
113
113
|
export { PluginStateClient } from '../clients/pluginState.js';
|
|
114
114
|
export { PluginModelClient } from '../clients/pluginModels.js';
|
|
115
|
-
export type * from '
|
|
116
|
-
export type * from '../../generated/plugin-models.js';
|
|
117
|
-
export type * from '../../generated/plugin-recovery.js';
|
|
118
|
-
export type * from '../../generated/plugin-diagnostics.js';
|
|
115
|
+
export type * from '@mearl/browser-core';
|
|
@@ -3,7 +3,7 @@ import { normalizePluginTaskRecovery, pluginRecoverySignature, } from './pluginR
|
|
|
3
3
|
import { normalizePluginPageRuntime } from './pluginPageDefinition.js';
|
|
4
4
|
import { loadPluginAppProfiles } from './pluginAppProfiles.js';
|
|
5
5
|
export { invokePageEvalWithArgs } from '../../pageEvalArguments.js';
|
|
6
|
-
import {
|
|
6
|
+
import { readInstalledSkillMetadata } from '../skillManifest.js';
|
|
7
7
|
import { dirname, extname, resolve } from 'node:path';
|
|
8
8
|
import { pathToFileURL } from 'node:url';
|
|
9
9
|
import { Command } from 'commander';
|
|
@@ -18,14 +18,11 @@ export { executeRegisteredPlugin, } from '../runtime/pluginExecutor.js';
|
|
|
18
18
|
export { PluginTaskClient } from '../clients/pluginTasks.js';
|
|
19
19
|
export { cleanupPluginRuntime } from '../runtime/pluginRuntimeCleanup.js';
|
|
20
20
|
export { PluginPageClient } from '../clients/pluginPages.js';
|
|
21
|
-
export { assertPluginName, findPluginDirectoryEntry, findPluginEntry, findPluginRegistration, listPluginNames, pluginDirectory, registerPlugin, resolvePluginEntry, unregisterPlugin, PluginError, readPluginPageBundleChunk, } from '../pluginRegistry.js';
|
|
22
|
-
export { findOfficialPlugin, listOfficialPluginNames, OFFICIAL_PLUGIN_MANAGER, OFFICIAL_PLUGINS, } from '../officialPluginCatalog.js';
|
|
21
|
+
export { assertPluginName, findPluginDirectoryEntry, findPluginEntry, findPluginRegistration, pluginRegistrationNeedsRefresh, listPluginNames, pluginDirectory, registerPlugin, resolvePluginEntry, unregisterPlugin, PluginError, readPluginPageBundleChunk, } from '../pluginRegistry.js';
|
|
22
|
+
export { findOfficialPlugin, listOfficialPluginNames, OFFICIAL_PLUGIN_MANAGER, OFFICIAL_PLUGINS, readOfficialPluginCatalog, replaceOfficialPluginCatalog, validateOfficialPluginCatalog, } from '../officialPluginCatalog.js';
|
|
23
23
|
function readPluginVersion(entry) {
|
|
24
24
|
try {
|
|
25
|
-
|
|
26
|
-
const frontmatter = content.match(/^---\r?\n([\s\S]*?)\r?\n---/)?.[1];
|
|
27
|
-
const versionLine = frontmatter?.split(/\r?\n/).find(line => /^version:\s*/.test(line));
|
|
28
|
-
return versionLine?.match(/^version:\s*["']?([^"'#\s]+)["']?\s*$/)?.[1];
|
|
25
|
+
return readInstalledSkillMetadata(resolve(dirname(entry), '..'))?.version;
|
|
29
26
|
}
|
|
30
27
|
catch {
|
|
31
28
|
return undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type AppProfileContribution } from '
|
|
1
|
+
import { type AppProfileContribution } from '@mearl/browser-core';
|
|
2
2
|
/** Profile resources share the Skill root and metadata refresh rules of toolbox resources. */
|
|
3
3
|
export declare function loadPluginAppProfiles(entry: string, value: unknown): {
|
|
4
4
|
appProfiles?: AppProfileContribution;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { readFileSync, realpathSync } from 'node:fs';
|
|
2
2
|
import { basename, dirname, isAbsolute, relative, resolve } from 'node:path';
|
|
3
|
-
import { validateAppProfileContribution, } from '
|
|
3
|
+
import { validateAppProfileContribution, } from '@mearl/browser-core';
|
|
4
4
|
import { pluginFileVersion } from '../pluginSource.js';
|
|
5
5
|
/** Profile resources share the Skill root and metadata refresh rules of toolbox resources. */
|
|
6
6
|
export function loadPluginAppProfiles(entry, value) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PluginModelCapability, PluginModelRequest, PluginModelResult } from '
|
|
1
|
+
import type { PluginModelCapability, PluginModelRequest, PluginModelResult } from '@mearl/browser-core';
|
|
2
2
|
export declare function pluginModelCapabilities(): {
|
|
3
3
|
providers: PluginModelCapability[];
|
|
4
4
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { PluginPageRuntime } from '
|
|
1
|
+
import type { PluginPageRuntime } from '@mearl/browser-core';
|
|
2
2
|
export declare function normalizePluginPageRuntime(value: unknown): PluginPageRuntime | undefined;
|
|
3
3
|
export declare function compilePluginPageSchema(schema: Record<string, unknown>): import("ajv/dist/core.js").AnyValidateFunction<unknown>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { parse } from 'acorn';
|
|
2
2
|
import { Ajv } from 'ajv';
|
|
3
|
-
import { isPluginPageMatchPattern } from '
|
|
3
|
+
import { isPluginPageMatchPattern } from '@mearl/browser-core';
|
|
4
4
|
const validators = new WeakMap();
|
|
5
5
|
export function normalizePluginPageRuntime(value) {
|
|
6
6
|
if (value === undefined)
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { PluginTaskRecoveryDeclaration } from '
|
|
1
|
+
import type { PluginTaskRecoveryDeclaration } from '@mearl/browser-core';
|
|
2
2
|
export declare function normalizePluginTaskRecovery(value: unknown): PluginTaskRecoveryDeclaration | undefined;
|
|
3
3
|
export declare function pluginRecoverySignature(value: unknown): string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PluginStateDeclaration } from '
|
|
1
|
+
import type { PluginStateDeclaration } from '@mearl/browser-core';
|
|
2
2
|
export declare function compilePluginStateSchema(schema: Record<string, unknown>): import("ajv/dist/core.js").AnyValidateFunction<unknown>;
|
|
3
3
|
export declare function normalizePluginState(value: unknown): PluginStateDeclaration | undefined;
|
|
4
|
-
export declare function pluginStateSignature(collection: import('
|
|
4
|
+
export declare function pluginStateSignature(collection: import('@mearl/browser-core').PluginStateCollection): string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const DISABLED_SKILL_MANIFEST = "SKILL.md.mearl-disabled";
|
|
2
|
+
/** Read the identity fields used by the runtime, including disabled Skills. */
|
|
3
|
+
export declare function readInstalledSkillMetadata(directory: string): {
|
|
4
|
+
name?: string;
|
|
5
|
+
version?: string;
|
|
6
|
+
} | undefined;
|
|
7
|
+
/** 保留的清单供工具运行时读取,但不参与 Agent 的 SKILL.md 发现。 */
|
|
8
|
+
export declare function skillManifestPath(directory: string): string | undefined;
|
|
9
|
+
export declare function getSkillEnabled(directory: string): boolean | undefined;
|
|
10
|
+
export declare function setSkillEnabled(directory: string, enabled: boolean): void;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { existsSync, lstatSync, readFileSync, renameSync, statSync } from 'node:fs';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
export const DISABLED_SKILL_MANIFEST = 'SKILL.md.mearl-disabled';
|
|
4
|
+
/** Read the identity fields used by the runtime, including disabled Skills. */
|
|
5
|
+
export function readInstalledSkillMetadata(directory) {
|
|
6
|
+
if (existsSync(join(directory, 'SKILL.md')) && existsSync(join(directory, DISABLED_SKILL_MANIFEST)))
|
|
7
|
+
throw new Error('Conflicting installed Skill manifests');
|
|
8
|
+
const file = skillManifestPath(directory);
|
|
9
|
+
if (!file)
|
|
10
|
+
return undefined;
|
|
11
|
+
const info = statSync(file);
|
|
12
|
+
if (!info.isFile() || info.size > 1024 * 1024)
|
|
13
|
+
throw new Error('Invalid installed Skill manifest');
|
|
14
|
+
const frontmatter = readFileSync(file, 'utf8').match(/^---\r?\n([\s\S]*?)\r?\n---/)?.[1];
|
|
15
|
+
if (!frontmatter)
|
|
16
|
+
return {};
|
|
17
|
+
const scalar = (key) => {
|
|
18
|
+
const lines = frontmatter.split(/\r?\n/).filter(line => line.startsWith(key + ':'));
|
|
19
|
+
if (lines.length !== 1)
|
|
20
|
+
return undefined;
|
|
21
|
+
return lines[0].match(/^[\w-]+:\s*(?:"([^"\r\n]*)"|'([^'\r\n]*)'|([^\s#"']+))\s*(?:#.*)?$/)?.slice(1).find(value => value !== undefined);
|
|
22
|
+
};
|
|
23
|
+
return { name: scalar('name'), version: scalar('version') };
|
|
24
|
+
}
|
|
25
|
+
/** 保留的清单供工具运行时读取,但不参与 Agent 的 SKILL.md 发现。 */
|
|
26
|
+
export function skillManifestPath(directory) {
|
|
27
|
+
for (const name of ['SKILL.md', DISABLED_SKILL_MANIFEST]) {
|
|
28
|
+
const file = join(directory, name);
|
|
29
|
+
if (existsSync(file))
|
|
30
|
+
return file;
|
|
31
|
+
}
|
|
32
|
+
return undefined;
|
|
33
|
+
}
|
|
34
|
+
export function getSkillEnabled(directory) {
|
|
35
|
+
const manifest = skillManifestPath(directory);
|
|
36
|
+
return manifest ? manifest === join(directory, 'SKILL.md') : undefined;
|
|
37
|
+
}
|
|
38
|
+
export function setSkillEnabled(directory, enabled) {
|
|
39
|
+
const active = join(directory, 'SKILL.md');
|
|
40
|
+
const disabled = join(directory, DISABLED_SKILL_MANIFEST);
|
|
41
|
+
const source = enabled ? disabled : active;
|
|
42
|
+
const destination = enabled ? active : disabled;
|
|
43
|
+
const sourceStatus = lstatSync(source, { throwIfNoEntry: false });
|
|
44
|
+
const destinationStatus = lstatSync(destination, { throwIfNoEntry: false });
|
|
45
|
+
if (sourceStatus && destinationStatus) {
|
|
46
|
+
throw new Error('Skill 清单存在冲突,请检查 SKILL.md 和 SKILL.md.mearl-disabled');
|
|
47
|
+
}
|
|
48
|
+
if (!sourceStatus) {
|
|
49
|
+
if (destinationStatus?.isFile())
|
|
50
|
+
return;
|
|
51
|
+
throw new Error('找不到 Skill 清单');
|
|
52
|
+
}
|
|
53
|
+
if (!sourceStatus.isFile())
|
|
54
|
+
throw new Error('Skill 清单必须是普通文件');
|
|
55
|
+
renameSync(source, destination);
|
|
56
|
+
}
|
package/dist/socket.d.ts
CHANGED
|
@@ -47,3 +47,5 @@ export declare function resolveLocalActionTarget(action: string, data: Record<st
|
|
|
47
47
|
* legacy well-known socket,并在 socket 不存在或已残留时自动拉起 native host。
|
|
48
48
|
*/
|
|
49
49
|
export declare function invoke(action: string, data?: Record<string, any>, options?: InvokeOptions): Promise<any>;
|
|
50
|
+
/** Infrastructure calls stay on this machine even when an Agent has selected an external browser. */
|
|
51
|
+
export declare function invokeLocalHost(action: string, data?: Record<string, any>, options?: Pick<InvokeOptions, 'timeoutSec' | 'socketPath'>): Promise<any>;
|
package/dist/socket.js
CHANGED
|
@@ -19,7 +19,7 @@ import { readLiveProvider } from '@mearl/provider/runtime';
|
|
|
19
19
|
import { resolveFileRefs } from './fileRefs.js';
|
|
20
20
|
import { listLiveBrowsers, findBrowser, describeBrowser, } from './browserRegistry.js';
|
|
21
21
|
import { resolveActionTimeoutSec } from './actionTimeouts.js';
|
|
22
|
-
import { isBrowserCapabilityAction } from '
|
|
22
|
+
import { isBrowserCapabilityAction } from '@mearl/browser-core';
|
|
23
23
|
export { CLIENT_VERSION };
|
|
24
24
|
const MAX_SOCKET_BUFFER_SIZE = 64 * 1024 * 1024;
|
|
25
25
|
/**
|
|
@@ -380,6 +380,15 @@ export function invoke(action, data = {}, options = {}) {
|
|
|
380
380
|
const selector = browser ?? defaultBrowser ?? process.env.MEARL_BROWSER ?? undefined;
|
|
381
381
|
return dispatchInvoke(action, resolvedData, timeoutSec, transport, selector, controlSource, options.socketPath);
|
|
382
382
|
}
|
|
383
|
+
/** Infrastructure calls stay on this machine even when an Agent has selected an external browser. */
|
|
384
|
+
export function invokeLocalHost(action, data = {}, options = {}) {
|
|
385
|
+
const timeoutSec = options.timeoutSec ?? resolveActionTimeoutSec(action, data);
|
|
386
|
+
const socketPath = options.socketPath ?? process.env.MEARL_SOCKET_PATH?.trim();
|
|
387
|
+
const accepted = resolveFileRefs(data);
|
|
388
|
+
return socketPath
|
|
389
|
+
? invokeOnce(action, accepted, timeoutSec, undefined, socketPath, 'local')
|
|
390
|
+
: invokeViaLegacy(action, accepted, timeoutSec, undefined, 'local', false, true);
|
|
391
|
+
}
|
|
383
392
|
/** Session ownership lives in the control hosts and survives individual CLI connections. */
|
|
384
393
|
async function resolveControlSession(sessionId, timeoutSec, controlSource) {
|
|
385
394
|
const browsers = listLiveBrowsers();
|
|
@@ -545,7 +554,7 @@ async function dispatchInvoke(action, data, timeoutSec, transport, selector, con
|
|
|
545
554
|
return invokeViaLegacy(action, data, timeoutSec, transport, controlSource, /* isRetry */ false);
|
|
546
555
|
}
|
|
547
556
|
/** Legacy well-known socket, repairing a missing or stale endpoint and retrying once. */
|
|
548
|
-
async function invokeViaLegacy(action, data, timeoutSec, transport, controlSource, isRetry) {
|
|
557
|
+
async function invokeViaLegacy(action, data, timeoutSec, transport, controlSource, isRetry, localOnly = false) {
|
|
549
558
|
const legacySocketIdentity = readOwnedLegacySocketIdentity();
|
|
550
559
|
try {
|
|
551
560
|
return await invokeOnce(action, data, timeoutSec, transport, SOCKET_PATH, controlSource);
|
|
@@ -561,13 +570,14 @@ async function invokeViaLegacy(action, data, timeoutSec, transport, controlSourc
|
|
|
561
570
|
await new Promise(r => setTimeout(r, 1200));
|
|
562
571
|
const browsers = listLiveBrowsers();
|
|
563
572
|
const target = browsers.find(browser => isConnectedBrowser(browser) &&
|
|
573
|
+
(!localOnly || browser.transport !== 'provider') &&
|
|
564
574
|
!(transport === 'cdp' && browser.transport === 'provider') &&
|
|
565
575
|
supportsAction(browser, action, data));
|
|
566
576
|
if (target) {
|
|
567
577
|
return invokeOnce(action, data, timeoutSec, transport, target.socketPath, controlSource, target.transport === 'provider' ? target.browserId : undefined);
|
|
568
578
|
}
|
|
569
579
|
return invokeViaLegacy(action, data, timeoutSec, transport, controlSource,
|
|
570
|
-
/* isRetry */ true);
|
|
580
|
+
/* isRetry */ true, localOnly);
|
|
571
581
|
}
|
|
572
582
|
}
|
|
573
583
|
if (err instanceof Error && !isConnError(err) && !isSocketSandboxError(err))
|
package/dist/unified.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BrowserArtifact } from '
|
|
1
|
+
import type { BrowserArtifact } from '@mearl/browser-core';
|
|
2
2
|
import { type CloudConnectorListResult } from '@mearl/cloud-types';
|
|
3
3
|
import type { PluginInvocation, PluginInvokeOptions } from './plugins/sdk/plugin.js';
|
|
4
4
|
export interface UnifiedInvokeOptions {
|
package/dist/unified.js
CHANGED
|
@@ -3,7 +3,7 @@ import { stageFile, exportArtifact } from './artifacts.js';
|
|
|
3
3
|
import WebSocket from 'ws';
|
|
4
4
|
import { DEFAULT_CONNECT_TIMEOUT, DEFAULT_HEARTBEAT_INTERVAL, DEFAULT_REQUEST_TIMEOUT, MAX_BUFFER_SIZE, isHeartbeatMessage, resolveCloudConnectorSelector, } from '@mearl/cloud-types';
|
|
5
5
|
import { resolveActionTimeoutSec } from './actionTimeouts.js';
|
|
6
|
-
import { validateRequiredActionTabId, } from '
|
|
6
|
+
import { validateRequiredActionTabId, } from '@mearl/browser-core';
|
|
7
7
|
import { invoke as invokeLocalBrowser, resolveLocalActionTarget } from './socket.js';
|
|
8
8
|
import { loadCloudServerConfig, loadLocalConnectorId } from './unifiedConfig.js';
|
|
9
9
|
const RESPONSE_GRACE_MS = 1_000;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mearl/client",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0-beta.0",
|
|
4
4
|
"description": "Unified Mearl SDK & CLI for local and remote browsers",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"devtools",
|
|
53
53
|
"socket-client"
|
|
54
54
|
],
|
|
55
|
-
"license": "
|
|
55
|
+
"license": "Apache-2.0",
|
|
56
56
|
"engines": {
|
|
57
57
|
"node": ">=22.12.0"
|
|
58
58
|
},
|
|
@@ -65,10 +65,11 @@
|
|
|
65
65
|
"commander": "^15.0.0",
|
|
66
66
|
"fastest-levenshtein": "^1.0.16",
|
|
67
67
|
"ws": "^8.18.0",
|
|
68
|
-
"@mearl/daemon-core": "
|
|
69
|
-
"@mearl/cloud-types": "
|
|
70
|
-
"@mearl/provider": "
|
|
71
|
-
"@mearl/agent-runtime": "
|
|
68
|
+
"@mearl/daemon-core": "3.0.0-beta.0",
|
|
69
|
+
"@mearl/cloud-types": "3.0.0-beta.0",
|
|
70
|
+
"@mearl/provider": "3.0.0-beta.0",
|
|
71
|
+
"@mearl/agent-runtime": "3.0.0-beta.0",
|
|
72
|
+
"@mearl/browser-core": "3.0.0-beta.0"
|
|
72
73
|
},
|
|
73
74
|
"devDependencies": {
|
|
74
75
|
"@types/node": "^24.9.1",
|
|
@@ -76,9 +77,9 @@
|
|
|
76
77
|
"typescript": "^5.8.3"
|
|
77
78
|
},
|
|
78
79
|
"scripts": {
|
|
79
|
-
"build": "
|
|
80
|
+
"build": "rm -rf dist/ && tsc && chmod +x dist/bin.js",
|
|
80
81
|
"dev": "tsc --watch",
|
|
81
|
-
"typecheck": "
|
|
82
|
+
"typecheck": "tsc --noEmit",
|
|
82
83
|
"test": "vitest run"
|
|
83
84
|
}
|
|
84
85
|
}
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
import type { BrowserDevicePresetName, AppBridgeConfig } from './browser-action-protocol.js';
|
|
2
|
-
import type { AppBridgeSpec, AppImagePickerConfig, AppLayerUrlProxyConfig, AppMiniProgramConfig, AppNativeBackConfig, AppOverlayConfig, AppSchemeRule, AppTitleBarHostStyle, BridgeActionMap } from './app-profile-runtime-types.js';
|
|
3
|
-
export interface AppProfilePolicies {
|
|
4
|
-
titleBar?: 'default' | 'taobao' | 'fliggy' | 'alipay' | 'wechat';
|
|
5
|
-
navigatorLanguage?: boolean;
|
|
6
|
-
networkResult?: 'default' | 'alipay';
|
|
7
|
-
languages?: string[];
|
|
8
|
-
defaultLanguage?: string;
|
|
9
|
-
}
|
|
10
|
-
export interface AppProfileSetting {
|
|
11
|
-
id: string;
|
|
12
|
-
label: string;
|
|
13
|
-
type: 'select' | 'boolean' | 'number' | 'text' | 'json';
|
|
14
|
-
target: {
|
|
15
|
-
option: 'language';
|
|
16
|
-
} | {
|
|
17
|
-
method: string;
|
|
18
|
-
field?: string;
|
|
19
|
-
};
|
|
20
|
-
choices?: Array<{
|
|
21
|
-
label: string;
|
|
22
|
-
value: string;
|
|
23
|
-
}>;
|
|
24
|
-
minimum?: number;
|
|
25
|
-
maximum?: number;
|
|
26
|
-
}
|
|
27
|
-
export interface AppProfileOptions {
|
|
28
|
-
/** Keep this definition across document navigations until explicitly refreshed. */
|
|
29
|
-
lockDefinition?: boolean;
|
|
30
|
-
os?: 'ios' | 'android';
|
|
31
|
-
appVersion?: string;
|
|
32
|
-
language?: string;
|
|
33
|
-
deviceModel?: string;
|
|
34
|
-
devicePreset?: BrowserDevicePresetName;
|
|
35
|
-
orientation?: 'portrait' | 'landscape';
|
|
36
|
-
bridgeConfig?: AppBridgeConfig;
|
|
37
|
-
}
|
|
38
|
-
export interface AppProfileBinding {
|
|
39
|
-
version: 1;
|
|
40
|
-
revision: string;
|
|
41
|
-
definition: AppProfileDefinition;
|
|
42
|
-
options: AppProfileOptions;
|
|
43
|
-
/** Explicit scalar choices; method overrides are always explicit and live in options.bridgeConfig. */
|
|
44
|
-
explicitOptions?: Omit<AppProfileOptions, 'bridgeConfig'>;
|
|
45
|
-
}
|
|
46
|
-
export interface AppProfileContribution {
|
|
47
|
-
version: 1;
|
|
48
|
-
profiles: AppProfileDefinition[];
|
|
49
|
-
}
|
|
50
|
-
export interface AppProfileCatalogEntry {
|
|
51
|
-
id: string;
|
|
52
|
-
label: string;
|
|
53
|
-
source: 'builtin' | 'plugin';
|
|
54
|
-
available?: boolean;
|
|
55
|
-
plugin?: string;
|
|
56
|
-
revision: string;
|
|
57
|
-
definition: AppProfileDefinition;
|
|
58
|
-
}
|
|
59
|
-
/** 单容器档案(纯数据) */
|
|
60
|
-
export interface AppProfileDefinition {
|
|
61
|
-
name: string;
|
|
62
|
-
label: string;
|
|
63
|
-
/** 容器的应用标识,如 LX / TB / AP / WeChat */
|
|
64
|
-
appName: string;
|
|
65
|
-
defaultAppVersion: string;
|
|
66
|
-
/** UA 主体格式;默认使用 AliApp(appName/version) */
|
|
67
|
-
uaFamily?: 'aliapp' | 'wechatMiniProgram';
|
|
68
|
-
uaTemplate?: {
|
|
69
|
-
ios: string;
|
|
70
|
-
android: string;
|
|
71
|
-
};
|
|
72
|
-
policies?: AppProfilePolicies;
|
|
73
|
-
settings?: AppProfileSetting[];
|
|
74
|
-
settingsGroup?: 'fliggy' | 'alipay';
|
|
75
|
-
/** AliApp UA 主体之后追加的 token,{v} 占位会被替换为 appVersion */
|
|
76
|
-
uaTokens: string[];
|
|
77
|
-
/** 额外注入到 window 的变量(公共变量由 resolve 统一生成) */
|
|
78
|
-
globals: Record<string, string>;
|
|
79
|
-
bridges: AppBridgeSpec[];
|
|
80
|
-
/** 页面回到前台时分发到 document 的事件名(如 WV.Event.APP.Active) */
|
|
81
|
-
activeEvents: string[];
|
|
82
|
-
actions: BridgeActionMap;
|
|
83
|
-
schemes: AppSchemeRule[];
|
|
84
|
-
/** 小程序原生页面与 WebView 通信规则。 */
|
|
85
|
-
miniProgram?: AppMiniProgramConfig;
|
|
86
|
-
/** 原生图片页 scheme 的浏览器选图与上传配置 */
|
|
87
|
-
imagePicker?: AppImagePickerConfig;
|
|
88
|
-
geolocation?: {
|
|
89
|
-
reverseGeocodeApi: string;
|
|
90
|
-
version: string;
|
|
91
|
-
};
|
|
92
|
-
/**
|
|
93
|
-
* 地址栏借位同步的可选 host 白名单:容器栈顶 URL 的 host 命中时,地址栏借 top
|
|
94
|
-
* 域名同步其 path+query+hash(pushState 同源约束下保持域名不变只改 path);
|
|
95
|
-
* 不配置则同步所有 HTTP(S) 业务层 URL。
|
|
96
|
-
*/
|
|
97
|
-
urlSyncHostSuffixes?: string[];
|
|
98
|
-
/** URL / pageParams 浮层协议 */
|
|
99
|
-
overlay?: AppOverlayConfig;
|
|
100
|
-
/** URL 参数为真时以新 WebView 替换当前业务层。 */
|
|
101
|
-
popBeforeOpenParam?: string;
|
|
102
|
-
/** 跨 WebView 消息抵达 opener 时分发的 document 事件。 */
|
|
103
|
-
messageEvent?: string;
|
|
104
|
-
/** 原生返回键的页面接管协议。 */
|
|
105
|
-
nativeBack?: AppNativeBackConfig;
|
|
106
|
-
/** 开发代理 origin 下的业务层 URL 映射 */
|
|
107
|
-
layerUrlProxy?: AppLayerUrlProxyConfig;
|
|
108
|
-
/** App 框架的根 WebView 与自绘标题栏协议。 */
|
|
109
|
-
rootContainer?: {
|
|
110
|
-
statusBarHeightCookie?: {
|
|
111
|
-
name: string;
|
|
112
|
-
domain?: string;
|
|
113
|
-
path?: string;
|
|
114
|
-
};
|
|
115
|
-
};
|
|
116
|
-
/** 页面自行绘制导航区域时,不渲染模拟标题栏。 */
|
|
117
|
-
titleBarHiddenPathnames?: string[];
|
|
118
|
-
/** 页面级状态栏背景色,key 为业务 pathname。 */
|
|
119
|
-
statusBarBackgroundColors?: Record<string, string>;
|
|
120
|
-
/** 按业务根域配置标题栏与状态栏样式。 */
|
|
121
|
-
titleBarHostStyles?: AppTitleBarHostStyle[];
|
|
122
|
-
/** 桥存在时仍将 MTOP 传输固定在浏览器 H5 通道 */
|
|
123
|
-
forceH5Mtop?: boolean;
|
|
124
|
-
}
|
|
125
|
-
export declare const APP_BRIDGE_BEHAVIORS: readonly ["navigate", "closeAll", "closeBackData", "postMessage", "notifySubscribe", "notifyUnsubscribe", "notifyPost", "sharedFileRead", "sharedFileWrite", "sharedDataGet", "sharedDataSet", "legacyBroadcastCreate", "legacyBroadcastPost", "legacyBroadcastClose", "memoryGet", "memorySet", "memoryDelete", "availabilityMap", "userInfo", "authCode", "networkInfo", "geolocation", "permission", "imagePicker", "prefetch", "fptTrack", "mtopStream", "previewFile", "toast", "unsupportedNativeInput", "payment", "userTrack", "calendar", "networkQualityMonitor", "beaconRequest", "voiceRecognition"];
|
|
126
|
-
/** Validate plain data before registration or compiling a document-start configuration. */
|
|
127
|
-
export declare function validateAppProfileDefinition(value: unknown): AppProfileDefinition;
|
|
128
|
-
export declare function validateAppProfileContribution(value: unknown): AppProfileContribution | undefined;
|
|
129
|
-
/** Deterministic identity for immutable definitions; this identifier grants no host permissions. */
|
|
130
|
-
export declare function appProfileRevision(definition: AppProfileDefinition): string;
|