@opentabs-dev/opentabs-plugin-minimax-agent 0.0.75 → 0.0.76
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 +30 -20
- package/dist/adapter.iife.js.map +3 -3
- package/dist/tools.json +4 -4
- package/package.json +3 -3
package/dist/adapter.iife.js
CHANGED
|
@@ -231,18 +231,18 @@
|
|
|
231
231
|
|
|
232
232
|
// node_modules/@opentabs-dev/plugin-sdk/dist/storage.js
|
|
233
233
|
var getLocalStorage = (key) => {
|
|
234
|
-
try {
|
|
235
|
-
return localStorage.getItem(key);
|
|
236
|
-
} catch {
|
|
237
|
-
}
|
|
238
234
|
let storage;
|
|
239
235
|
try {
|
|
240
|
-
storage = localStorage;
|
|
236
|
+
storage = window.localStorage;
|
|
241
237
|
} catch {
|
|
242
238
|
return null;
|
|
243
239
|
}
|
|
244
|
-
if (storage
|
|
245
|
-
|
|
240
|
+
if (storage) {
|
|
241
|
+
try {
|
|
242
|
+
return storage.getItem(key);
|
|
243
|
+
} catch {
|
|
244
|
+
return null;
|
|
245
|
+
}
|
|
246
246
|
}
|
|
247
247
|
try {
|
|
248
248
|
const iframe = document.createElement("iframe");
|
|
@@ -15208,21 +15208,21 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15208
15208
|
};
|
|
15209
15209
|
var src_default = new MinimaxAgentPlugin();
|
|
15210
15210
|
|
|
15211
|
-
// dist/
|
|
15211
|
+
// dist/_adapter_entry_09f5dc6e-e319-4a4b-ad46-6d11359164dc.ts
|
|
15212
15212
|
if (!globalThis.__openTabs) {
|
|
15213
15213
|
globalThis.__openTabs = {};
|
|
15214
15214
|
} else {
|
|
15215
15215
|
const desc = Object.getOwnPropertyDescriptor(globalThis.__openTabs, "adapters");
|
|
15216
15216
|
if (desc && !desc.writable) {
|
|
15217
|
-
const
|
|
15217
|
+
const ot3 = globalThis.__openTabs;
|
|
15218
15218
|
const newAdaptersObj = {};
|
|
15219
|
-
if (
|
|
15220
|
-
for (const key of Object.keys(
|
|
15221
|
-
const d = Object.getOwnPropertyDescriptor(
|
|
15219
|
+
if (ot3.adapters) {
|
|
15220
|
+
for (const key of Object.keys(ot3.adapters)) {
|
|
15221
|
+
const d = Object.getOwnPropertyDescriptor(ot3.adapters, key);
|
|
15222
15222
|
if (d) Object.defineProperty(newAdaptersObj, key, d);
|
|
15223
15223
|
}
|
|
15224
15224
|
}
|
|
15225
|
-
globalThis.__openTabs = Object.assign({},
|
|
15225
|
+
globalThis.__openTabs = Object.assign({}, ot3, { adapters: newAdaptersObj });
|
|
15226
15226
|
}
|
|
15227
15227
|
}
|
|
15228
15228
|
if (!globalThis.__openTabs.adapters) {
|
|
@@ -15260,6 +15260,16 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15260
15260
|
}
|
|
15261
15261
|
};
|
|
15262
15262
|
var restoreTransport = setLogTransport ? setLogTransport(logTransport) : void 0;
|
|
15263
|
+
var ot2 = globalThis.__openTabs;
|
|
15264
|
+
ot2._notifyReadinessChanged = () => {
|
|
15265
|
+
try {
|
|
15266
|
+
const nonce = globalThis.__openTabs?._readinessNonce;
|
|
15267
|
+
if (nonce) {
|
|
15268
|
+
window.postMessage({ type: "opentabs:readiness-changed", plugin: "minimax-agent", nonce }, "*");
|
|
15269
|
+
}
|
|
15270
|
+
} catch {
|
|
15271
|
+
}
|
|
15272
|
+
};
|
|
15263
15273
|
var existing = adapters["minimax-agent"];
|
|
15264
15274
|
if (existing) {
|
|
15265
15275
|
if (typeof existing.teardown === "function") {
|
|
@@ -15271,7 +15281,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15271
15281
|
}
|
|
15272
15282
|
}
|
|
15273
15283
|
if (!Reflect.deleteProperty(adapters, "minimax-agent")) {
|
|
15274
|
-
const
|
|
15284
|
+
const ot3 = globalThis.__openTabs;
|
|
15275
15285
|
const newAdapters = {};
|
|
15276
15286
|
for (const key of Object.keys(adapters)) {
|
|
15277
15287
|
if (key !== "minimax-agent") {
|
|
@@ -15279,7 +15289,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15279
15289
|
if (desc) Object.defineProperty(newAdapters, key, desc);
|
|
15280
15290
|
}
|
|
15281
15291
|
}
|
|
15282
|
-
globalThis.__openTabs = Object.assign({},
|
|
15292
|
+
globalThis.__openTabs = Object.assign({}, ot3, { adapters: newAdapters });
|
|
15283
15293
|
}
|
|
15284
15294
|
var hasLifecycleHooks = typeof src_default.onToolInvocationStart === "function" || typeof src_default.onToolInvocationEnd === "function";
|
|
15285
15295
|
for (const tool of src_default.tools) {
|
|
@@ -15340,12 +15350,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15340
15350
|
}
|
|
15341
15351
|
}
|
|
15342
15352
|
};
|
|
15343
|
-
const
|
|
15344
|
-
if (!
|
|
15353
|
+
const ot3 = globalThis.__openTabs;
|
|
15354
|
+
if (!ot3._navigationInterceptor) {
|
|
15345
15355
|
const origPushState = history.pushState.bind(history);
|
|
15346
15356
|
const origReplaceState = history.replaceState.bind(history);
|
|
15347
15357
|
const callbacks = /* @__PURE__ */ new Map();
|
|
15348
|
-
|
|
15358
|
+
ot3._navigationInterceptor = { callbacks, origPushState, origReplaceState };
|
|
15349
15359
|
history.pushState = function(...args) {
|
|
15350
15360
|
origPushState(...args);
|
|
15351
15361
|
for (const cb of callbacks.values()) {
|
|
@@ -15359,7 +15369,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15359
15369
|
}
|
|
15360
15370
|
};
|
|
15361
15371
|
}
|
|
15362
|
-
const interceptor =
|
|
15372
|
+
const interceptor = ot3._navigationInterceptor;
|
|
15363
15373
|
interceptor.callbacks.set("minimax-agent", checkUrl);
|
|
15364
15374
|
window.addEventListener("popstate", checkUrl);
|
|
15365
15375
|
window.addEventListener("hashchange", checkUrl);
|
|
@@ -15414,5 +15424,5 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15414
15424
|
};
|
|
15415
15425
|
delete src_default.onDeactivate;
|
|
15416
15426
|
}
|
|
15417
|
-
})();(function(){var o=(globalThis).__openTabs;if(o&&o.adapters&&o.adapters["minimax-agent"]){var a=o.adapters["minimax-agent"];a.__adapterHash="
|
|
15427
|
+
})();(function(){var o=(globalThis).__openTabs;if(o&&o.adapters&&o.adapters["minimax-agent"]){var a=o.adapters["minimax-agent"];a.__adapterHash="ccd6e4550caeaedc6c34f30199ea69c7ad007afdfe39d32144da2b80ad0ae767";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,"minimax-agent",{value:a,writable:false,configurable:false,enumerable:true});Object.defineProperty(o,"adapters",{value:o.adapters,writable:false,configurable:false});}})();
|
|
15418
15428
|
//# sourceMappingURL=adapter.iife.js.map
|