@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.
Files changed (88) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +40 -40
  3. package/dist/actionTimeouts.js +1 -1
  4. package/dist/artifacts.d.ts +1 -1
  5. package/dist/autoUpdate.js +1 -2
  6. package/dist/browserRegistry.d.ts +1 -1
  7. package/dist/check.d.ts +1 -1
  8. package/dist/check.js +4 -3
  9. package/dist/commands.d.ts +12 -12
  10. package/dist/commands.js +15 -14
  11. package/dist/index.d.ts +4 -7
  12. package/dist/index.js +1 -1
  13. package/dist/local.d.ts +3 -1
  14. package/dist/local.js +2 -1
  15. package/dist/pageEvalArguments.d.ts +1 -1
  16. package/dist/pageEvalArguments.js +1 -1
  17. package/dist/plugin.d.ts +1 -0
  18. package/dist/plugin.js +1 -0
  19. package/dist/pluginModelSessionWorker.d.ts +2 -2
  20. package/dist/plugins/clients/pluginHostConnection.d.ts +1 -1
  21. package/dist/plugins/clients/pluginHostConnection.js +1 -1
  22. package/dist/plugins/clients/pluginModels.d.ts +3 -3
  23. package/dist/plugins/clients/pluginPages.d.ts +2 -2
  24. package/dist/plugins/clients/pluginState.d.ts +2 -2
  25. package/dist/plugins/clients/pluginTasks.d.ts +3 -3
  26. package/dist/plugins/clients/pluginTasks.js +1 -1
  27. package/dist/plugins/officialPluginCatalog.d.ts +18 -21
  28. package/dist/plugins/officialPluginCatalog.js +120 -24
  29. package/dist/plugins/officialPluginInstaller.js +6 -1
  30. package/dist/plugins/pluginRegistry.d.ts +1 -1
  31. package/dist/plugins/pluginRegistry.js +2 -2
  32. package/dist/plugins/pluginTaskProtocol.d.ts +1 -1
  33. package/dist/plugins/runtime/pluginDiagnostics.d.ts +3 -3
  34. package/dist/plugins/runtime/pluginDiagnostics.js +2 -2
  35. package/dist/plugins/runtime/pluginExecution.d.ts +2 -2
  36. package/dist/plugins/runtime/pluginExecutor.d.ts +1 -1
  37. package/dist/plugins/runtime/pluginExecutorProtocol.d.ts +2 -2
  38. package/dist/plugins/runtime/pluginHost.d.ts +2 -2
  39. package/dist/plugins/runtime/pluginHostServer.js +1 -1
  40. package/dist/plugins/runtime/pluginModelCatalog.d.ts +1 -1
  41. package/dist/plugins/runtime/pluginPageManager.d.ts +3 -3
  42. package/dist/plugins/runtime/pluginPageManager.js +2 -2
  43. package/dist/plugins/runtime/pluginRevision.js +2 -1
  44. package/dist/plugins/runtime/pluginStateManager.d.ts +1 -1
  45. package/dist/plugins/runtime/pluginStateStore.d.ts +1 -1
  46. package/dist/plugins/runtime/pluginTaskManager.d.ts +10 -10
  47. package/dist/plugins/runtime/pluginTaskManager.js +1 -1
  48. package/dist/plugins/runtime/pluginTaskStore.d.ts +3 -3
  49. package/dist/plugins/runtime/pluginTaskStore.js +1 -1
  50. package/dist/plugins/runtime/pythonPlugin.d.ts +1 -1
  51. package/dist/plugins/sdk/plugin.d.ts +9 -12
  52. package/dist/plugins/sdk/plugin.js +4 -7
  53. package/dist/plugins/sdk/pluginAppProfiles.d.ts +1 -1
  54. package/dist/plugins/sdk/pluginAppProfiles.js +1 -1
  55. package/dist/plugins/sdk/pluginModelDefinition.d.ts +1 -1
  56. package/dist/plugins/sdk/pluginPageDefinition.d.ts +1 -1
  57. package/dist/plugins/sdk/pluginPageDefinition.js +1 -1
  58. package/dist/plugins/sdk/pluginRecoveryDefinition.d.ts +1 -1
  59. package/dist/plugins/sdk/pluginStateDefinition.d.ts +2 -2
  60. package/dist/plugins/skillManifest.d.ts +10 -0
  61. package/dist/plugins/skillManifest.js +56 -0
  62. package/dist/socket.d.ts +2 -0
  63. package/dist/socket.js +13 -3
  64. package/dist/unified.d.ts +1 -1
  65. package/dist/unified.js +1 -1
  66. package/package.json +9 -8
  67. package/dist/generated/app-profile-definition.d.ts +0 -130
  68. package/dist/generated/app-profile-definition.js +0 -458
  69. package/dist/generated/app-profile-runtime-types.d.ts +0 -213
  70. package/dist/generated/app-profile-runtime-types.js +0 -1
  71. package/dist/generated/browser-action-protocol.d.ts +0 -1147
  72. package/dist/generated/browser-action-protocol.js +0 -283
  73. package/dist/generated/plugin-diagnostics.d.ts +0 -110
  74. package/dist/generated/plugin-diagnostics.js +0 -1
  75. package/dist/generated/plugin-execution.d.ts +0 -27
  76. package/dist/generated/plugin-execution.js +0 -1
  77. package/dist/generated/plugin-models.d.ts +0 -64
  78. package/dist/generated/plugin-models.js +0 -1
  79. package/dist/generated/plugin-pages.d.ts +0 -76
  80. package/dist/generated/plugin-pages.js +0 -59
  81. package/dist/generated/plugin-recovery.d.ts +0 -32
  82. package/dist/generated/plugin-recovery.js +0 -1
  83. package/dist/generated/plugin-state.d.ts +0 -50
  84. package/dist/generated/plugin-state.js +0 -1
  85. package/dist/generated/plugin-tasks.d.ts +0 -74
  86. package/dist/generated/plugin-tasks.js +0 -7
  87. package/dist/generated/toolbox-icon.d.ts +0 -10
  88. package/dist/generated/toolbox-icon.js +0 -37
@@ -1,50 +0,0 @@
1
- export type PluginStateScope = 'installation' | 'host' | 'browser-session' | 'instance';
2
- export interface PluginStateCollection {
3
- scope: PluginStateScope;
4
- storage: 'persistent' | 'cache' | 'memory';
5
- schemaVersion: number;
6
- schema: Record<string, unknown>;
7
- maxEntries?: number;
8
- maxBytes?: number;
9
- ttlMs?: number;
10
- }
11
- export interface PluginStateDeclaration {
12
- version: 1;
13
- collections: Record<string, PluginStateCollection>;
14
- }
15
- export interface PluginStateEntry {
16
- key: string;
17
- exists: boolean;
18
- /** Live entry revision, or the collection revision for absence; opaque to callers. */
19
- version: string;
20
- value?: unknown;
21
- expiresAt?: number;
22
- }
23
- export interface PluginStateSnapshot extends PluginStateEntry {
24
- revision: number;
25
- schemaVersion: number;
26
- }
27
- export interface PluginStateList {
28
- entries: PluginStateEntry[];
29
- revision: number;
30
- schemaVersion: number;
31
- nextCursor?: string;
32
- }
33
- export type PluginStateMutation = {
34
- type: 'put';
35
- key: string;
36
- expectedVersion: string;
37
- value: unknown;
38
- ttlMs?: number;
39
- } | {
40
- type: 'delete';
41
- key: string;
42
- expectedVersion: string;
43
- };
44
- export interface PluginStateTransaction {
45
- operations: PluginStateMutation[];
46
- expectedRevision?: number;
47
- migrateFromVersion?: number;
48
- idempotencyKey?: string;
49
- }
50
- export type PluginStateOperation = 'get' | 'get-many' | 'list' | 'transact';
@@ -1 +0,0 @@
1
- export {};
@@ -1,74 +0,0 @@
1
- import type { PluginExecutionError, PluginExecutionHost, PluginInvocationSource } from './plugin-execution.js';
2
- import type { PluginTaskCheckpointReference } from './plugin-recovery.js';
3
- export declare const PLUGIN_TASK_PROTOCOL_VERSION = 5;
4
- export type PluginTaskState = 'queued' | 'running' | 'cancelling' | 'success' | 'error' | 'cancelled' | 'interrupted';
5
- export interface PluginTaskResultReference {
6
- bytes: number;
7
- sha256: string;
8
- chunks: number;
9
- }
10
- export interface PluginTask {
11
- taskId: string;
12
- host: PluginExecutionHost;
13
- plugin: string;
14
- installationId: string;
15
- revision: string;
16
- command: string;
17
- kind?: 'command' | 'model';
18
- parentTaskId?: string;
19
- resumedFrom?: {
20
- taskId: string;
21
- revision: string;
22
- checkpointSequence: number;
23
- checkpointVersion: number;
24
- };
25
- checkpoint?: PluginTaskCheckpointReference;
26
- input: Record<string, unknown>;
27
- source: PluginInvocationSource;
28
- cwd: string;
29
- state: PluginTaskState;
30
- sequence: number;
31
- createdAt: number;
32
- updatedAt: number;
33
- progress?: string | {
34
- message: string;
35
- data?: Record<string, unknown>;
36
- };
37
- result?: PluginTaskResultReference;
38
- error?: PluginExecutionError;
39
- }
40
- export interface PluginTaskEvent {
41
- sequence: number;
42
- time: number;
43
- type: 'state' | 'progress' | 'checkpoint' | 'diagnostic';
44
- checkpoint?: PluginTaskCheckpointReference;
45
- state: PluginTaskState;
46
- progress?: PluginTask['progress'];
47
- }
48
- export interface PluginTaskEvents {
49
- task: PluginTask;
50
- events: PluginTaskEvent[];
51
- firstAvailableSequence: number;
52
- nextCursor: number;
53
- gap: boolean;
54
- }
55
- export interface PluginTaskStartResult {
56
- taskId: string;
57
- state: PluginTaskState;
58
- host: PluginExecutionHost;
59
- reused?: true;
60
- }
61
- export interface PluginTaskListResult {
62
- tasks: PluginTask[];
63
- nextCursor?: string;
64
- }
65
- export interface PluginTaskResultChunk {
66
- taskId: string;
67
- index: number;
68
- data: string;
69
- bytes: number;
70
- sha256: string;
71
- chunks: number;
72
- }
73
- export declare function isPluginTaskActive(state: PluginTaskState): boolean;
74
- export declare function isPluginTaskId(value: unknown): value is string;
@@ -1,7 +0,0 @@
1
- export const PLUGIN_TASK_PROTOCOL_VERSION = 5;
2
- export function isPluginTaskActive(state) {
3
- return state === 'queued' || state === 'running' || state === 'cancelling';
4
- }
5
- export function isPluginTaskId(value) {
6
- return typeof value === 'string' && /^pt_[0-9a-f-]{36}_[0-9a-f-]{36}$/i.test(value);
7
- }
@@ -1,10 +0,0 @@
1
- export type ParsedToolboxIcon = {
2
- kind: 'name';
3
- name: string;
4
- } | {
5
- kind: 'image';
6
- src: string;
7
- monochrome?: true;
8
- };
9
- /** SVG is an image source so its markup never becomes executable extension DOM. */
10
- export declare function parseToolboxIcon(value: unknown): ParsedToolboxIcon | undefined;
@@ -1,37 +0,0 @@
1
- /** SVG is an image source so its markup never becomes executable extension DOM. */
2
- export function parseToolboxIcon(value) {
3
- if (typeof value !== 'string')
4
- return;
5
- const icon = value.trim();
6
- if (!icon || icon.length > 32 * 1024)
7
- return;
8
- if (/^[a-z][a-z0-9-]{0,39}$/.test(icon))
9
- return { kind: 'name', name: icon };
10
- if (/^(?:<\?xml\s[^>]*\?>\s*)?<svg\b[^>]*(?:\/>|>[\s\S]*<\/svg\s*>)$/i.test(icon)) {
11
- const svg = /<svg\b[^>]*\sxmlns\s*=/i.test(icon)
12
- ? icon
13
- : icon.replace(/<svg\b/i, '<svg xmlns="http://www.w3.org/2000/svg"');
14
- try {
15
- return {
16
- kind: 'image',
17
- src: `data:image/svg+xml,${encodeURIComponent(svg)}`,
18
- ...(/\bcurrentColor\b/i.test(svg) ? { monochrome: true } : {}),
19
- };
20
- }
21
- catch {
22
- return;
23
- }
24
- }
25
- const dataHeader = /^data:image\/(?:svg\+xml|png|jpeg|gif|webp|avif)(?:;charset=utf-8|;utf8)?(?:;base64)?,/i.exec(icon);
26
- if (dataHeader && icon.length > dataHeader[0].length)
27
- return { kind: 'image', src: icon };
28
- try {
29
- const url = new URL(icon);
30
- if (['http:', 'https:'].includes(url.protocol) && !url.username && !url.password) {
31
- return { kind: 'image', src: url.href };
32
- }
33
- }
34
- catch {
35
- /* Non-URL values cannot be image sources. */
36
- }
37
- }