@pi-oxide/extension-js 0.13.0 → 0.13.3
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/content-script.js +3 -3
- package/extension_js.d.ts +51 -48
- package/extension_js.js +104029 -26174
- package/index.js +1260 -1115
- package/package.json +2 -5
- package/worker.js +483 -474
- package/content-script/action-result.d.ts +0 -4
- package/content-script/dom-tree.d.ts +0 -28
- package/content-script/dom-utils.d.ts +0 -37
- package/content-script/file-resolution.d.ts +0 -22
- package/content-script/form-validation.d.ts +0 -12
- package/content-script/handlers.d.ts +0 -3
- package/content-script/index.d.ts +0 -6
- package/content-script/listbox.d.ts +0 -7
- package/content-script/logger.d.ts +0 -12
- package/content-script/message-router.d.ts +0 -1
- package/content-script/observation-lease.d.ts +0 -55
- package/content-script/registry.d.ts +0 -24
- package/content-script/schemas.d.ts +0 -5
- package/content-script/snapshot.d.ts +0 -3
- package/main/index.d.ts +0 -8
- package/main/runner/chrome/internals.d.ts +0 -9
- package/main/runner/chrome/native.d.ts +0 -6
- package/main/runner/command.d.ts +0 -3
- package/main/runner/dom/snapshot.d.ts +0 -8
- package/main/runner/fetch.d.ts +0 -4
- package/main/runner/host.d.ts +0 -3
- package/main/runner/index.d.ts +0 -2
- package/main/runner/lib/constants.d.ts +0 -14
- package/main/runner/lib/host-registry.d.ts +0 -6
- package/main/runner/lib/network-tracker.d.ts +0 -16
- package/main/runner/lib/params-helpers.d.ts +0 -2
- package/main/runner/lib/params.d.ts +0 -5
- package/main/runner/lib/types.d.ts +0 -116
- package/main/runner/runtime.d.ts +0 -15
- package/main/runner/sidepanel/dom.d.ts +0 -6
- package/main/runner/snapshot-merge.d.ts +0 -8
- package/main/runner/tab/execute.d.ts +0 -24
- package/main/runner/tools/aliases.d.ts +0 -1
- package/main/runner/tools/chrome/action.d.ts +0 -1
- package/main/runner/tools/chrome/alarms.d.ts +0 -1
- package/main/runner/tools/chrome/bookmarks.d.ts +0 -1
- package/main/runner/tools/chrome/browsing-data.d.ts +0 -1
- package/main/runner/tools/chrome/capability.d.ts +0 -30
- package/main/runner/tools/chrome/context-menus.d.ts +0 -1
- package/main/runner/tools/chrome/cookies.d.ts +0 -1
- package/main/runner/tools/chrome/declarative-net-request.d.ts +0 -1
- package/main/runner/tools/chrome/desktop-capture.d.ts +0 -1
- package/main/runner/tools/chrome/downloads.d.ts +0 -1
- package/main/runner/tools/chrome/history.d.ts +0 -1
- package/main/runner/tools/chrome/identity.d.ts +0 -1
- package/main/runner/tools/chrome/idle.d.ts +0 -1
- package/main/runner/tools/chrome/index.d.ts +0 -1
- package/main/runner/tools/chrome/management.d.ts +0 -1
- package/main/runner/tools/chrome/notifications.d.ts +0 -1
- package/main/runner/tools/chrome/offscreen.d.ts +0 -1
- package/main/runner/tools/chrome/page-capture.d.ts +0 -1
- package/main/runner/tools/chrome/permissions.d.ts +0 -1
- package/main/runner/tools/chrome/register-helpers.d.ts +0 -9
- package/main/runner/tools/chrome/runtime.d.ts +0 -1
- package/main/runner/tools/chrome/scripting.d.ts +0 -1
- package/main/runner/tools/chrome/sessions.d.ts +0 -1
- package/main/runner/tools/chrome/side-panel.d.ts +0 -1
- package/main/runner/tools/chrome/system.d.ts +0 -1
- package/main/runner/tools/chrome/tab-groups.d.ts +0 -1
- package/main/runner/tools/chrome/tabs.d.ts +0 -1
- package/main/runner/tools/chrome/top-sites.d.ts +0 -1
- package/main/runner/tools/chrome/windows.d.ts +0 -1
- package/main/runner/tools/chrome-storage.d.ts +0 -1
- package/main/runner/tools/clipboard.d.ts +0 -1
- package/main/runner/tools/dom.d.ts +0 -1
- package/main/runner/tools/host-call.d.ts +0 -1
- package/main/runner/tools/network.d.ts +0 -1
- package/main/runner/tools/page.d.ts +0 -1
- package/main/runner/tools/sidepanel.d.ts +0 -1
- package/main/runner/tools/storage.d.ts +0 -1
- package/main/runner/tools/tab.d.ts +0 -1
- package/main/session/extension-session.d.ts +0 -106
- package/main/tab-context.d.ts +0 -12
- package/shared/array-buffer.d.ts +0 -4
- package/shared/collect-inline-snapshot.d.ts +0 -50
- package/shared/cross/agent-errors.d.ts +0 -28
- package/shared/cross/array-buffer.d.ts +0 -4
- package/shared/cross/collect-inline-snapshot.d.ts +0 -58
- package/shared/cross/content-script-actions.d.ts +0 -7
- package/shared/cross/content-script-tools.d.ts +0 -3
- package/shared/cross/dispatch.d.ts +0 -5
- package/shared/cross/fetch-response.d.ts +0 -12
- package/shared/cross/format-types.d.ts +0 -43
- package/shared/cross/fs-types.d.ts +0 -81
- package/shared/cross/generated.d.ts +0 -328
- package/shared/cross/manifest.d.ts +0 -130
- package/shared/cross/normalize-agent-error.d.ts +0 -17
- package/shared/cross/page-specs.d.ts +0 -7
- package/shared/cross/schemas/chrome.d.ts +0 -56
- package/shared/cross/schemas/clipboard.d.ts +0 -19
- package/shared/cross/schemas/fs.d.ts +0 -65
- package/shared/cross/schemas/helpers.d.ts +0 -71
- package/shared/cross/schemas/host.d.ts +0 -15
- package/shared/cross/schemas/network.d.ts +0 -34
- package/shared/cross/schemas/page.d.ts +0 -494
- package/shared/cross/schemas/returns.d.ts +0 -8791
- package/shared/cross/schemas/sidepanel.d.ts +0 -284
- package/shared/cross/schemas/snapshot.d.ts +0 -272
- package/shared/cross/schemas/storage.d.ts +0 -60
- package/shared/cross/schemas/tab.d.ts +0 -597
- package/shared/cross/schemas.d.ts +0 -12
- package/shared/cross/snapshot-filter.d.ts +0 -15
- package/shared/cross/tab-specs.d.ts +0 -3
- package/shared/cross/types.d.ts +0 -12
- package/shared/cross/zod-to-docs.d.ts +0 -28
- package/shared/cs/ref-id.d.ts +0 -5
- package/shared/cs/snapshot-dom.d.ts +0 -47
- package/shared/fetch-response.d.ts +0 -12
- package/shared/fs-types.d.ts +0 -81
- package/shared/generated.d.ts +0 -241
- package/shared/log-levels.d.ts +0 -5
- package/shared/logger.d.ts +0 -18
- package/shared/main/content-script-response.d.ts +0 -5
- package/shared/main/define-content-script-tool.d.ts +0 -7
- package/shared/main/log-levels.d.ts +0 -5
- package/shared/main/logger.d.ts +0 -18
- package/shared/main/routes.d.ts +0 -14
- package/shared/main/tool-registry.d.ts +0 -19
- package/shared/ref-id.d.ts +0 -5
- package/shared/registry/agent-errors.d.ts +0 -27
- package/shared/registry/content-script-actions.d.ts +0 -7
- package/shared/registry/content-script-response.d.ts +0 -5
- package/shared/registry/content-script-tools.d.ts +0 -13
- package/shared/registry/define-content-script-tool.d.ts +0 -7
- package/shared/registry/dispatch.d.ts +0 -5
- package/shared/registry/manifest.d.ts +0 -130
- package/shared/registry/normalize-agent-error.d.ts +0 -17
- package/shared/registry/routes.d.ts +0 -14
- package/shared/registry/types.d.ts +0 -12
- package/shared/registry/zod-to-docs.d.ts +0 -28
- package/shared/schemas.d.ts +0 -10663
- package/shared/snapshot-dom.d.ts +0 -47
- package/shared/snapshot-filter.d.ts +0 -15
- package/shared/tool-registry.d.ts +0 -19
- package/worker/binary-blob-store.d.ts +0 -12
- package/worker/fetch-store.d.ts +0 -1
- package/worker/resolve-set-files.d.ts +0 -22
- package/worker/vfs-write-cache.d.ts +0 -3
- package/worker/worker.d.ts +0 -84
package/shared/snapshot-dom.d.ts
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/** Shared DOM helpers for inline snapshots (content script + MAIN-world injection). */
|
|
2
|
-
export { allocateRefId, getNextRefId, syncRefIdCounterFromDom, } from './ref-id.js';
|
|
3
|
-
export declare const INTERACTIVE_SELECTOR = "input, textarea, select, button, a, [role=\"button\"], [role=\"link\"]";
|
|
4
|
-
export declare function readFormFields(el: Element): {
|
|
5
|
-
value?: string;
|
|
6
|
-
checked?: boolean;
|
|
7
|
-
disabled?: boolean;
|
|
8
|
-
readOnly?: boolean;
|
|
9
|
-
selected?: boolean;
|
|
10
|
-
required?: boolean;
|
|
11
|
-
valid?: boolean;
|
|
12
|
-
invalid?: boolean;
|
|
13
|
-
validationMessage?: string;
|
|
14
|
-
errorMessage?: string;
|
|
15
|
-
};
|
|
16
|
-
export declare function readErrorMessage(el: Element): string | undefined;
|
|
17
|
-
export declare function enrichFormNode(el: Element, node: {
|
|
18
|
-
value?: string;
|
|
19
|
-
checked?: boolean;
|
|
20
|
-
disabled?: boolean;
|
|
21
|
-
readOnly?: boolean;
|
|
22
|
-
selected?: boolean;
|
|
23
|
-
required?: boolean;
|
|
24
|
-
valid?: boolean;
|
|
25
|
-
invalid?: boolean;
|
|
26
|
-
validationMessage?: string;
|
|
27
|
-
errorMessage?: string;
|
|
28
|
-
}): void;
|
|
29
|
-
export declare function resolveAbsoluteUrl(attr: string | null): string | undefined;
|
|
30
|
-
export declare function resolveContainerRefId(el: Element): string | undefined;
|
|
31
|
-
export declare function resolvePermalinkLink(el: Element): HTMLAnchorElement | null;
|
|
32
|
-
export declare function getAccessibleRole(el: Element): string;
|
|
33
|
-
export declare function hasDirectTextContent(el: Element): boolean;
|
|
34
|
-
export declare function getOwnVisibleText(el: Element, maxLen?: number): string;
|
|
35
|
-
export declare function isSelfOrAncestorHidden(el: Element): boolean;
|
|
36
|
-
/** Include if the element would remain visible in a Markdown rendering. */
|
|
37
|
-
export declare function isMarkdownVisible(el: Element): boolean;
|
|
38
|
-
export declare function getAccessibleName(el: Element): string;
|
|
39
|
-
export declare function shouldInclude(el: Element): boolean;
|
|
40
|
-
/** Detect a hidden validation-shim input inside a combobox wrapper (react-select).
|
|
41
|
-
* These inputs carry required/aria-required for form validation but are not
|
|
42
|
-
* user-visible; they must appear in the snapshot labeled as validation-proxy. */
|
|
43
|
-
export declare function isValidationProxyInput(el: Element): boolean;
|
|
44
|
-
/** Resolve a human-readable field label from <label> element associations.
|
|
45
|
-
* Tries: accessible name → label[for=id] → wrapping <label> → preceding sibling
|
|
46
|
-
* <label> → parent's first <label> child. Falls back to the refId. */
|
|
47
|
-
export declare function resolveFieldLabel(el: Element | null, fallback: string): string;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { InlineSnapshotNode } from './collect-inline-snapshot.js';
|
|
2
|
-
|
|
3
|
-
export type SnapshotRole = "button" | "link" | "textbox" | "checkbox" | "radio" | "combobox" | "img" | "heading" | "listitem" | "list" | "table" | "row" | "cell" | "navigation" | "main" | "article" | "region" | "complementary" | "form" | "dialog" | "figure" | "caption" | "generic";
|
|
4
|
-
export type SnapshotTag = "a" | "button" | "input" | "textarea" | "select" | "img" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "ul" | "ol" | "li" | "table" | "tr" | "td" | "th" | "nav" | "main" | "article" | "section" | "aside" | "form" | "dialog" | "figure" | "figcaption" | "div" | "span" | "p" | "label" | "details" | "summary" | "svg" | "iframe";
|
|
5
|
-
export type SnapshotFilter = {
|
|
6
|
-
role?: SnapshotRole | SnapshotRole[];
|
|
7
|
-
tag?: SnapshotTag | SnapshotTag[];
|
|
8
|
-
text?: string | RegExp;
|
|
9
|
-
name?: string | RegExp;
|
|
10
|
-
interactiveOnly?: boolean;
|
|
11
|
-
href?: string | RegExp;
|
|
12
|
-
src?: string | RegExp;
|
|
13
|
-
limit?: number;
|
|
14
|
-
};
|
|
15
|
-
export declare function filterNodes(nodes: InlineSnapshotNode[], filter: SnapshotFilter): InlineSnapshotNode[];
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { AsyncResponse, JsCallSpec, SerializableJsCallManifestEntry, ToolDefinition, ToolDoc } from './registry/manifest.js';
|
|
2
|
-
|
|
3
|
-
export type { AsyncError, AsyncResponse, CallContext, Command, ExecutionContextId, JsCallSpec, SerializableJsCallManifestEntry, ToolDefinition, ToolDoc, ToolDocParam, } from './registry/manifest.js';
|
|
4
|
-
export { coerceWasmParams, manifestEntryToWasm } from './registry/manifest.js';
|
|
5
|
-
export declare function setRunnerAbortController(controller: AbortController | null): void;
|
|
6
|
-
export declare function getRunnerSignal(): AbortSignal | undefined;
|
|
7
|
-
export declare function throwIfAborted(): void;
|
|
8
|
-
/** Manifest-only registration for actions executed in the content script. */
|
|
9
|
-
export declare function registerContentScriptJsCall<P, R>(spec: Omit<JsCallSpec<P, R>, "owner" | "handler">): void;
|
|
10
|
-
export declare function registerJsCall<P, R>(spec: JsCallSpec<P, R>): void;
|
|
11
|
-
export declare function getTool(action: string): ToolDefinition<unknown, unknown> | undefined;
|
|
12
|
-
/** Test-only helper: remove a tool from the tool registry without touching the JS registry. */
|
|
13
|
-
export declare function removeToolForTest(action: string): boolean;
|
|
14
|
-
export declare function clearRegistry(): void;
|
|
15
|
-
export declare function freezeJsRegistry(): void;
|
|
16
|
-
export declare function clearJsRegistry(): void;
|
|
17
|
-
export declare function getSerializableJsManifest(): SerializableJsCallManifestEntry[];
|
|
18
|
-
export declare function dispatchTool(action: string, params: unknown, callId?: number, runId?: string, signal?: AbortSignal): Promise<AsyncResponse>;
|
|
19
|
-
export declare function listTools(): ToolDoc[];
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export type StoredBlob = {
|
|
2
|
-
bytes: Uint8Array;
|
|
3
|
-
mimeType?: string;
|
|
4
|
-
contentType?: string;
|
|
5
|
-
};
|
|
6
|
-
export declare function storeBlob(runId: string | undefined, bytes: Uint8Array, meta?: {
|
|
7
|
-
mimeType?: string;
|
|
8
|
-
contentType?: string;
|
|
9
|
-
}): string;
|
|
10
|
-
export declare function takeBlob(runId: string | undefined, handle: string): StoredBlob | null;
|
|
11
|
-
export declare function clearRun(runId: string | undefined): void;
|
|
12
|
-
export declare function clearAllBlobStores(): void;
|
package/worker/fetch-store.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function maybeStoreFetchResult(params: unknown, result: unknown, runId: string | undefined): unknown;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export type ResolvedSetFile = {
|
|
2
|
-
kind: "bytes";
|
|
3
|
-
name: string;
|
|
4
|
-
data: string;
|
|
5
|
-
mimeType?: string;
|
|
6
|
-
} | {
|
|
7
|
-
kind: "url";
|
|
8
|
-
url: string;
|
|
9
|
-
name: string;
|
|
10
|
-
mimeType?: string;
|
|
11
|
-
};
|
|
12
|
-
export declare function resolveSetFilesParams(action: string, params: unknown, runId: string | undefined, readBase64: (path: string) => Promise<string>): Promise<{
|
|
13
|
-
ok: true;
|
|
14
|
-
value: Record<string, unknown>;
|
|
15
|
-
} | {
|
|
16
|
-
ok: false;
|
|
17
|
-
error: {
|
|
18
|
-
message: string;
|
|
19
|
-
code: string;
|
|
20
|
-
category?: string;
|
|
21
|
-
};
|
|
22
|
-
}>;
|
package/worker/worker.d.ts
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { CsvCallMessage, PdfCallMessage, XlsxCallMessage, ZipCallMessage } from '../shared/cross/format-types.js';
|
|
3
|
-
import { DispatchContext } from '../shared/cross/types.js';
|
|
4
|
-
import { SerializableJsCallManifestEntry } from '../shared/main/tool-registry.js';
|
|
5
|
-
|
|
6
|
-
type RelayPort = {
|
|
7
|
-
postMessage(message: unknown): void;
|
|
8
|
-
addEventListener: (type: "message", listener: (event: MessageEvent) => void) => void;
|
|
9
|
-
start?: () => void;
|
|
10
|
-
};
|
|
11
|
-
export declare function settleAllPendingRelays(code: string, message: string): void;
|
|
12
|
-
type WorkerHandler = (params: unknown, context?: unknown) => Promise<unknown>;
|
|
13
|
-
export declare function registerWorkerHandler(action: string, handler: WorkerHandler, registry?: Map<string, WorkerHandler>): void;
|
|
14
|
-
export declare function registerWorkerHandlerValidated<P>(action: string, paramsSchema: z.ZodSchema<P>, handler: (params: P, context?: unknown) => Promise<unknown>, registry?: Map<string, WorkerHandler>): void;
|
|
15
|
-
export declare function registerWorkerPort(owner: string, port: RelayPort): void;
|
|
16
|
-
export declare function resolveAsyncRelayResult(id: string, result: unknown): boolean;
|
|
17
|
-
export declare function safePostAsCall(options: {
|
|
18
|
-
owner: string;
|
|
19
|
-
action: string;
|
|
20
|
-
timeoutMs?: number;
|
|
21
|
-
resolveTimeoutMs?: (params: unknown) => number;
|
|
22
|
-
tabPolicy?: string;
|
|
23
|
-
}): (params: unknown, context?: {
|
|
24
|
-
callId?: number;
|
|
25
|
-
runId?: string;
|
|
26
|
-
signal?: AbortSignal;
|
|
27
|
-
}) => Promise<unknown>;
|
|
28
|
-
export declare const DEFAULT_RELAY_TIMEOUT_MS = 30000;
|
|
29
|
-
export declare function resolveRelayTimeoutMs(action: string, params: unknown): number;
|
|
30
|
-
export declare function extensionDispatch(params: unknown, context?: DispatchContext): Promise<unknown>;
|
|
31
|
-
export declare function createExecutableCallback(entry: SerializableJsCallManifestEntry): (params: unknown, context?: {
|
|
32
|
-
callId?: number;
|
|
33
|
-
runId?: string;
|
|
34
|
-
signal?: AbortSignal;
|
|
35
|
-
}) => Promise<unknown>;
|
|
36
|
-
export type WorkerMessage = {
|
|
37
|
-
type: "init";
|
|
38
|
-
manifest: SerializableJsCallManifestEntry[];
|
|
39
|
-
extensionId?: string;
|
|
40
|
-
} | ZipCallMessage | XlsxCallMessage | PdfCallMessage | {
|
|
41
|
-
type: "runCell";
|
|
42
|
-
id: string;
|
|
43
|
-
code: string;
|
|
44
|
-
stdin: string;
|
|
45
|
-
runId?: string;
|
|
46
|
-
} | {
|
|
47
|
-
type: "reset";
|
|
48
|
-
id?: string;
|
|
49
|
-
} | {
|
|
50
|
-
type: "stop";
|
|
51
|
-
id: string;
|
|
52
|
-
} | {
|
|
53
|
-
type: "setFuelLimit";
|
|
54
|
-
id?: string;
|
|
55
|
-
limit: number;
|
|
56
|
-
} | {
|
|
57
|
-
type: "inspectGlobals";
|
|
58
|
-
id: string;
|
|
59
|
-
} | {
|
|
60
|
-
type: "apiDocs";
|
|
61
|
-
id: string;
|
|
62
|
-
format: string;
|
|
63
|
-
} | {
|
|
64
|
-
type: "loadLibrary";
|
|
65
|
-
id: string;
|
|
66
|
-
source: string;
|
|
67
|
-
} | {
|
|
68
|
-
type: "fsCall";
|
|
69
|
-
id: string;
|
|
70
|
-
action: string;
|
|
71
|
-
params: unknown;
|
|
72
|
-
} | CsvCallMessage | {
|
|
73
|
-
type: "setLogLevel";
|
|
74
|
-
level: number;
|
|
75
|
-
} | {
|
|
76
|
-
type: "asyncRelayResult";
|
|
77
|
-
id: string;
|
|
78
|
-
result: unknown;
|
|
79
|
-
callId?: number;
|
|
80
|
-
} | {
|
|
81
|
-
type: "registerWorkerPort";
|
|
82
|
-
owner: string;
|
|
83
|
-
};
|
|
84
|
-
export {};
|