@opentabs-dev/opentabs-plugin-prescript-test 0.0.9 → 0.0.10
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/adapter.iife.js +164 -163
- package/dist/adapter.iife.js.map +4 -4
- package/dist/pre-script.iife.js +1 -1
- package/dist/pre-script.iife.js.map +1 -1
- package/dist/tools.json +2 -2
- package/package.json +3 -3
package/dist/adapter.iife.js
CHANGED
|
@@ -6,167 +6,6 @@
|
|
|
6
6
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
7
7
|
};
|
|
8
8
|
|
|
9
|
-
// node_modules/@opentabs-dev/plugin-sdk/dist/log.js
|
|
10
|
-
var MAX_DATA_LENGTH = 10;
|
|
11
|
-
var MAX_STRING_LENGTH = 4096;
|
|
12
|
-
var MAX_SERIALIZED_SIZE = 64 * 1024;
|
|
13
|
-
var safeSerializeArg = (value) => {
|
|
14
|
-
try {
|
|
15
|
-
if (value === null || value === void 0)
|
|
16
|
-
return value;
|
|
17
|
-
const type = typeof value;
|
|
18
|
-
if (type === "boolean" || type === "number")
|
|
19
|
-
return value;
|
|
20
|
-
if (type === "string") {
|
|
21
|
-
return value.length > MAX_STRING_LENGTH ? `${value.slice(0, MAX_STRING_LENGTH)}\u2026` : value;
|
|
22
|
-
}
|
|
23
|
-
if (type === "function")
|
|
24
|
-
return `[Function: ${value.name || "anonymous"}]`;
|
|
25
|
-
if (type === "symbol")
|
|
26
|
-
return `[Symbol: ${value.description ?? ""}]`;
|
|
27
|
-
if (type === "bigint")
|
|
28
|
-
return `[BigInt: ${value.toString()}]`;
|
|
29
|
-
if (typeof value.nodeType === "number" && typeof value.nodeName === "string") {
|
|
30
|
-
try {
|
|
31
|
-
const node = value;
|
|
32
|
-
let classStr = "";
|
|
33
|
-
if (typeof node.className === "string") {
|
|
34
|
-
classStr = node.className ? `.${node.className.split(" ")[0] ?? ""}` : "";
|
|
35
|
-
} else if (node.className !== null && typeof node.className === "object") {
|
|
36
|
-
const baseVal = node.className.baseVal;
|
|
37
|
-
if (typeof baseVal === "string") {
|
|
38
|
-
classStr = baseVal ? `.${baseVal.split(" ")[0] ?? ""}` : "";
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
return `[${node.nodeName}${node.id ? `#${node.id}` : ""}${classStr}]`;
|
|
42
|
-
} catch {
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
if (value instanceof Error) {
|
|
46
|
-
return { name: value.name, message: value.message, stack: value.stack };
|
|
47
|
-
}
|
|
48
|
-
if (value instanceof WeakRef)
|
|
49
|
-
return "[WeakRef]";
|
|
50
|
-
if (value instanceof WeakMap)
|
|
51
|
-
return "[WeakMap]";
|
|
52
|
-
if (value instanceof WeakSet)
|
|
53
|
-
return "[WeakSet]";
|
|
54
|
-
if (value instanceof ArrayBuffer)
|
|
55
|
-
return "[ArrayBuffer]";
|
|
56
|
-
if (typeof SharedArrayBuffer !== "undefined" && value instanceof SharedArrayBuffer)
|
|
57
|
-
return "[SharedArrayBuffer]";
|
|
58
|
-
try {
|
|
59
|
-
const seen = /* @__PURE__ */ new WeakSet();
|
|
60
|
-
const json2 = JSON.stringify(value, (_key, v) => {
|
|
61
|
-
if (typeof v === "object" && v !== null) {
|
|
62
|
-
if (seen.has(v))
|
|
63
|
-
return "[Circular]";
|
|
64
|
-
seen.add(v);
|
|
65
|
-
}
|
|
66
|
-
if (typeof v === "function")
|
|
67
|
-
return `[Function: ${v.name || "anonymous"}]`;
|
|
68
|
-
if (typeof v === "bigint")
|
|
69
|
-
return `[BigInt: ${v.toString()}]`;
|
|
70
|
-
if (typeof v === "symbol")
|
|
71
|
-
return `[Symbol: ${v.description ?? ""}]`;
|
|
72
|
-
if (v instanceof WeakRef)
|
|
73
|
-
return "[WeakRef]";
|
|
74
|
-
if (v instanceof WeakMap)
|
|
75
|
-
return "[WeakMap]";
|
|
76
|
-
if (v instanceof WeakSet)
|
|
77
|
-
return "[WeakSet]";
|
|
78
|
-
if (v instanceof ArrayBuffer)
|
|
79
|
-
return "[ArrayBuffer]";
|
|
80
|
-
if (typeof SharedArrayBuffer !== "undefined" && v instanceof SharedArrayBuffer)
|
|
81
|
-
return "[SharedArrayBuffer]";
|
|
82
|
-
return v;
|
|
83
|
-
});
|
|
84
|
-
if (json2.length > MAX_SERIALIZED_SIZE) {
|
|
85
|
-
return `[Object truncated: ${json2.length} chars]`;
|
|
86
|
-
}
|
|
87
|
-
return JSON.parse(json2);
|
|
88
|
-
} catch {
|
|
89
|
-
return `[Unserializable: ${typeof value}]`;
|
|
90
|
-
}
|
|
91
|
-
} catch {
|
|
92
|
-
return `[Unserializable: ${typeof value}]`;
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
var safeSerialize = (args) => {
|
|
96
|
-
const capped = args.length > MAX_DATA_LENGTH ? args.slice(0, MAX_DATA_LENGTH) : args;
|
|
97
|
-
return capped.map(safeSerializeArg);
|
|
98
|
-
};
|
|
99
|
-
var CONSOLE_METHODS = {
|
|
100
|
-
debug: "debug",
|
|
101
|
-
info: "info",
|
|
102
|
-
warning: "warn",
|
|
103
|
-
error: "error"
|
|
104
|
-
};
|
|
105
|
-
var defaultTransport = (entry) => {
|
|
106
|
-
const method = CONSOLE_METHODS[entry.level];
|
|
107
|
-
console[method](`[sdk.log] ${entry.message}`, ...entry.data);
|
|
108
|
-
};
|
|
109
|
-
var activeTransport = defaultTransport;
|
|
110
|
-
var _setLogTransport = (transport) => {
|
|
111
|
-
const previous = activeTransport;
|
|
112
|
-
activeTransport = transport;
|
|
113
|
-
return () => {
|
|
114
|
-
if (activeTransport === transport)
|
|
115
|
-
activeTransport = previous;
|
|
116
|
-
};
|
|
117
|
-
};
|
|
118
|
-
var makeLogMethod = (level) => (message, ...args) => {
|
|
119
|
-
const entry = {
|
|
120
|
-
level,
|
|
121
|
-
message,
|
|
122
|
-
data: safeSerialize(args),
|
|
123
|
-
ts: (/* @__PURE__ */ new Date()).toISOString()
|
|
124
|
-
};
|
|
125
|
-
activeTransport(entry);
|
|
126
|
-
};
|
|
127
|
-
var log = Object.freeze({
|
|
128
|
-
debug: makeLogMethod("debug"),
|
|
129
|
-
info: makeLogMethod("info"),
|
|
130
|
-
warn: makeLogMethod("warning"),
|
|
131
|
-
error: makeLogMethod("error")
|
|
132
|
-
});
|
|
133
|
-
var ot = globalThis.__openTabs ?? {};
|
|
134
|
-
globalThis.__openTabs = ot;
|
|
135
|
-
ot._setLogTransport = _setLogTransport;
|
|
136
|
-
ot.log = log;
|
|
137
|
-
|
|
138
|
-
// node_modules/@opentabs-dev/plugin-sdk/dist/pre-script-reader.js
|
|
139
|
-
var getPreScriptValue = (key) => {
|
|
140
|
-
const ot3 = globalThis.__openTabs;
|
|
141
|
-
const pluginName = ot3?._pluginName;
|
|
142
|
-
if (!pluginName)
|
|
143
|
-
return void 0;
|
|
144
|
-
const bucket = ot3?.preScript?.[pluginName];
|
|
145
|
-
if (!bucket)
|
|
146
|
-
return void 0;
|
|
147
|
-
return bucket[key];
|
|
148
|
-
};
|
|
149
|
-
|
|
150
|
-
// node_modules/@opentabs-dev/plugin-sdk/dist/index.js
|
|
151
|
-
var defineTool = (config2) => config2;
|
|
152
|
-
var OpenTabsPlugin = class {
|
|
153
|
-
/**
|
|
154
|
-
* Chrome match patterns for URLs that should NOT match this plugin.
|
|
155
|
-
* Tabs matching both urlPatterns and excludePatterns are excluded.
|
|
156
|
-
* Useful when a broad urlPattern overlaps with another plugin's domain.
|
|
157
|
-
* @see https://developer.chrome.com/docs/extensions/develop/concepts/match-patterns
|
|
158
|
-
*/
|
|
159
|
-
excludePatterns;
|
|
160
|
-
/**
|
|
161
|
-
* URL to open when no matching tab exists and the user triggers an
|
|
162
|
-
* 'open tab' action from the side panel. Should be a concrete URL
|
|
163
|
-
* (e.g., 'https://github.com'), not a match pattern.
|
|
164
|
-
*/
|
|
165
|
-
homepage;
|
|
166
|
-
/** Typed configuration schema — declares settings that users provide via config.json or the side panel. */
|
|
167
|
-
configSchema;
|
|
168
|
-
};
|
|
169
|
-
|
|
170
9
|
// node_modules/zod/v4/classic/external.js
|
|
171
10
|
var external_exports = {};
|
|
172
11
|
__export(external_exports, {
|
|
@@ -14681,6 +14520,167 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
14681
14520
|
// node_modules/zod/v4/classic/external.js
|
|
14682
14521
|
config(en_default());
|
|
14683
14522
|
|
|
14523
|
+
// node_modules/@opentabs-dev/plugin-sdk/dist/log.js
|
|
14524
|
+
var MAX_DATA_LENGTH = 10;
|
|
14525
|
+
var MAX_STRING_LENGTH = 4096;
|
|
14526
|
+
var MAX_SERIALIZED_SIZE = 64 * 1024;
|
|
14527
|
+
var safeSerializeArg = (value) => {
|
|
14528
|
+
try {
|
|
14529
|
+
if (value === null || value === void 0)
|
|
14530
|
+
return value;
|
|
14531
|
+
const type = typeof value;
|
|
14532
|
+
if (type === "boolean" || type === "number")
|
|
14533
|
+
return value;
|
|
14534
|
+
if (type === "string") {
|
|
14535
|
+
return value.length > MAX_STRING_LENGTH ? `${value.slice(0, MAX_STRING_LENGTH)}\u2026` : value;
|
|
14536
|
+
}
|
|
14537
|
+
if (type === "function")
|
|
14538
|
+
return `[Function: ${value.name || "anonymous"}]`;
|
|
14539
|
+
if (type === "symbol")
|
|
14540
|
+
return `[Symbol: ${value.description ?? ""}]`;
|
|
14541
|
+
if (type === "bigint")
|
|
14542
|
+
return `[BigInt: ${value.toString()}]`;
|
|
14543
|
+
if (typeof value.nodeType === "number" && typeof value.nodeName === "string") {
|
|
14544
|
+
try {
|
|
14545
|
+
const node = value;
|
|
14546
|
+
let classStr = "";
|
|
14547
|
+
if (typeof node.className === "string") {
|
|
14548
|
+
classStr = node.className ? `.${node.className.split(" ")[0] ?? ""}` : "";
|
|
14549
|
+
} else if (node.className !== null && typeof node.className === "object") {
|
|
14550
|
+
const baseVal = node.className.baseVal;
|
|
14551
|
+
if (typeof baseVal === "string") {
|
|
14552
|
+
classStr = baseVal ? `.${baseVal.split(" ")[0] ?? ""}` : "";
|
|
14553
|
+
}
|
|
14554
|
+
}
|
|
14555
|
+
return `[${node.nodeName}${node.id ? `#${node.id}` : ""}${classStr}]`;
|
|
14556
|
+
} catch {
|
|
14557
|
+
}
|
|
14558
|
+
}
|
|
14559
|
+
if (value instanceof Error) {
|
|
14560
|
+
return { name: value.name, message: value.message, stack: value.stack };
|
|
14561
|
+
}
|
|
14562
|
+
if (value instanceof WeakRef)
|
|
14563
|
+
return "[WeakRef]";
|
|
14564
|
+
if (value instanceof WeakMap)
|
|
14565
|
+
return "[WeakMap]";
|
|
14566
|
+
if (value instanceof WeakSet)
|
|
14567
|
+
return "[WeakSet]";
|
|
14568
|
+
if (value instanceof ArrayBuffer)
|
|
14569
|
+
return "[ArrayBuffer]";
|
|
14570
|
+
if (typeof SharedArrayBuffer !== "undefined" && value instanceof SharedArrayBuffer)
|
|
14571
|
+
return "[SharedArrayBuffer]";
|
|
14572
|
+
try {
|
|
14573
|
+
const seen = /* @__PURE__ */ new WeakSet();
|
|
14574
|
+
const json2 = JSON.stringify(value, (_key, v) => {
|
|
14575
|
+
if (typeof v === "object" && v !== null) {
|
|
14576
|
+
if (seen.has(v))
|
|
14577
|
+
return "[Circular]";
|
|
14578
|
+
seen.add(v);
|
|
14579
|
+
}
|
|
14580
|
+
if (typeof v === "function")
|
|
14581
|
+
return `[Function: ${v.name || "anonymous"}]`;
|
|
14582
|
+
if (typeof v === "bigint")
|
|
14583
|
+
return `[BigInt: ${v.toString()}]`;
|
|
14584
|
+
if (typeof v === "symbol")
|
|
14585
|
+
return `[Symbol: ${v.description ?? ""}]`;
|
|
14586
|
+
if (v instanceof WeakRef)
|
|
14587
|
+
return "[WeakRef]";
|
|
14588
|
+
if (v instanceof WeakMap)
|
|
14589
|
+
return "[WeakMap]";
|
|
14590
|
+
if (v instanceof WeakSet)
|
|
14591
|
+
return "[WeakSet]";
|
|
14592
|
+
if (v instanceof ArrayBuffer)
|
|
14593
|
+
return "[ArrayBuffer]";
|
|
14594
|
+
if (typeof SharedArrayBuffer !== "undefined" && v instanceof SharedArrayBuffer)
|
|
14595
|
+
return "[SharedArrayBuffer]";
|
|
14596
|
+
return v;
|
|
14597
|
+
});
|
|
14598
|
+
if (json2.length > MAX_SERIALIZED_SIZE) {
|
|
14599
|
+
return `[Object truncated: ${json2.length} chars]`;
|
|
14600
|
+
}
|
|
14601
|
+
return JSON.parse(json2);
|
|
14602
|
+
} catch {
|
|
14603
|
+
return `[Unserializable: ${typeof value}]`;
|
|
14604
|
+
}
|
|
14605
|
+
} catch {
|
|
14606
|
+
return `[Unserializable: ${typeof value}]`;
|
|
14607
|
+
}
|
|
14608
|
+
};
|
|
14609
|
+
var safeSerialize = (args) => {
|
|
14610
|
+
const capped = args.length > MAX_DATA_LENGTH ? args.slice(0, MAX_DATA_LENGTH) : args;
|
|
14611
|
+
return capped.map(safeSerializeArg);
|
|
14612
|
+
};
|
|
14613
|
+
var CONSOLE_METHODS = {
|
|
14614
|
+
debug: "debug",
|
|
14615
|
+
info: "info",
|
|
14616
|
+
warning: "warn",
|
|
14617
|
+
error: "error"
|
|
14618
|
+
};
|
|
14619
|
+
var defaultTransport = (entry) => {
|
|
14620
|
+
const method = CONSOLE_METHODS[entry.level];
|
|
14621
|
+
console[method](`[sdk.log] ${entry.message}`, ...entry.data);
|
|
14622
|
+
};
|
|
14623
|
+
var activeTransport = defaultTransport;
|
|
14624
|
+
var _setLogTransport = (transport) => {
|
|
14625
|
+
const previous = activeTransport;
|
|
14626
|
+
activeTransport = transport;
|
|
14627
|
+
return () => {
|
|
14628
|
+
if (activeTransport === transport)
|
|
14629
|
+
activeTransport = previous;
|
|
14630
|
+
};
|
|
14631
|
+
};
|
|
14632
|
+
var makeLogMethod = (level) => (message, ...args) => {
|
|
14633
|
+
const entry = {
|
|
14634
|
+
level,
|
|
14635
|
+
message,
|
|
14636
|
+
data: safeSerialize(args),
|
|
14637
|
+
ts: (/* @__PURE__ */ new Date()).toISOString()
|
|
14638
|
+
};
|
|
14639
|
+
activeTransport(entry);
|
|
14640
|
+
};
|
|
14641
|
+
var log = Object.freeze({
|
|
14642
|
+
debug: makeLogMethod("debug"),
|
|
14643
|
+
info: makeLogMethod("info"),
|
|
14644
|
+
warn: makeLogMethod("warning"),
|
|
14645
|
+
error: makeLogMethod("error")
|
|
14646
|
+
});
|
|
14647
|
+
var ot = globalThis.__openTabs ?? {};
|
|
14648
|
+
globalThis.__openTabs = ot;
|
|
14649
|
+
ot._setLogTransport = _setLogTransport;
|
|
14650
|
+
ot.log = log;
|
|
14651
|
+
|
|
14652
|
+
// node_modules/@opentabs-dev/plugin-sdk/dist/pre-script-reader.js
|
|
14653
|
+
var getPreScriptValue = (key) => {
|
|
14654
|
+
const ot3 = globalThis.__openTabs;
|
|
14655
|
+
const pluginName = ot3?._pluginName;
|
|
14656
|
+
if (!pluginName)
|
|
14657
|
+
return void 0;
|
|
14658
|
+
const bucket = ot3?.preScript?.[pluginName];
|
|
14659
|
+
if (!bucket)
|
|
14660
|
+
return void 0;
|
|
14661
|
+
return bucket[key];
|
|
14662
|
+
};
|
|
14663
|
+
|
|
14664
|
+
// node_modules/@opentabs-dev/plugin-sdk/dist/index.js
|
|
14665
|
+
var defineTool = (config2) => config2;
|
|
14666
|
+
var OpenTabsPlugin = class {
|
|
14667
|
+
/**
|
|
14668
|
+
* Chrome match patterns for URLs that should NOT match this plugin.
|
|
14669
|
+
* Tabs matching both urlPatterns and excludePatterns are excluded.
|
|
14670
|
+
* Useful when a broad urlPattern overlaps with another plugin's domain.
|
|
14671
|
+
* @see https://developer.chrome.com/docs/extensions/develop/concepts/match-patterns
|
|
14672
|
+
*/
|
|
14673
|
+
excludePatterns;
|
|
14674
|
+
/**
|
|
14675
|
+
* URL to open when no matching tab exists and the user triggers an
|
|
14676
|
+
* 'open tab' action from the side panel. Should be a concrete URL
|
|
14677
|
+
* (e.g., 'https://github.com'), not a match pattern.
|
|
14678
|
+
*/
|
|
14679
|
+
homepage;
|
|
14680
|
+
/** Typed configuration schema — declares settings that users provide via config.json or the side panel. */
|
|
14681
|
+
configSchema;
|
|
14682
|
+
};
|
|
14683
|
+
|
|
14684
14684
|
// src/tools/echo-auth.ts
|
|
14685
14685
|
var echoAuth = defineTool({
|
|
14686
14686
|
name: "echo_auth",
|
|
@@ -14718,7 +14718,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
14718
14718
|
};
|
|
14719
14719
|
var src_default = new PreScriptTestPlugin();
|
|
14720
14720
|
|
|
14721
|
-
// dist/
|
|
14721
|
+
// dist/_adapter_entry_fcd3aabf-0bd2-4b55-8184-65670188b8c9.ts
|
|
14722
|
+
external_exports.config({ jitless: true });
|
|
14722
14723
|
if (!globalThis.__openTabs) {
|
|
14723
14724
|
globalThis.__openTabs = {};
|
|
14724
14725
|
} else {
|
|
@@ -14936,5 +14937,5 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
14936
14937
|
};
|
|
14937
14938
|
delete src_default.onDeactivate;
|
|
14938
14939
|
}
|
|
14939
|
-
})();(function(){var o=(globalThis).__openTabs;if(o&&o.adapters&&o.adapters["prescript-test"]){var a=o.adapters["prescript-test"];a.__adapterHash="
|
|
14940
|
+
})();(function(){var o=(globalThis).__openTabs;if(o&&o.adapters&&o.adapters["prescript-test"]){var a=o.adapters["prescript-test"];a.__adapterHash="27cfed072a0ecc0369a5c95e3a660cf6719d2847947f4ea9178c9e0b5f4fe8f9";if(a.tools&&Array.isArray(a.tools)){for(var i=0;i<a.tools.length;i++){Object.freeze(a.tools[i]);}Object.freeze(a.tools);}Object.freeze(a);Object.defineProperty(o.adapters,"prescript-test",{value:a,writable:false,configurable:false,enumerable:true});Object.defineProperty(o,"adapters",{value:o.adapters,writable:false,configurable:false});}})();
|
|
14940
14941
|
//# sourceMappingURL=adapter.iife.js.map
|