@agenr/agenr-plugin 1.6.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/README.md +12 -0
- package/dist/anthropic-RE4XNAKE.js +5515 -0
- package/dist/azure-openai-responses-IQLXOCZS.js +190 -0
- package/dist/chunk-6DQXEU2A.js +32306 -0
- package/dist/chunk-EAQYK3U2.js +41 -0
- package/dist/chunk-HNWLZUWE.js +31 -0
- package/dist/chunk-JRUUYSFL.js +262 -0
- package/dist/chunk-OLOUBEE5.js +14022 -0
- package/dist/chunk-P5HNPYGQ.js +174 -0
- package/dist/chunk-RD7BUOBD.js +416 -0
- package/dist/chunk-RWWH2U4W.js +7056 -0
- package/dist/chunk-SEOMNQGB.js +86 -0
- package/dist/chunk-SQLXP7LT.js +4792 -0
- package/dist/chunk-URGOKODJ.js +17 -0
- package/dist/dist-R6ESEJ6P.js +1244 -0
- package/dist/google-NAVXTQLO.js +371 -0
- package/dist/google-gemini-cli-NKYJWHX2.js +712 -0
- package/dist/google-vertex-ZBJ2EDRH.js +414 -0
- package/dist/index.js +15942 -0
- package/dist/mistral-SBQYC4J5.js +38407 -0
- package/dist/multipart-parser-DV373IRF.js +371 -0
- package/dist/openai-codex-responses-XN3T3DEN.js +712 -0
- package/dist/openai-completions-75ZFOFU6.js +657 -0
- package/dist/openai-responses-DCK4BVNT.js +198 -0
- package/dist/src-T5RRS2HN.js +1408 -0
- package/openclaw.plugin.json +86 -0
- package/package.json +31 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
8
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
9
|
+
}) : x)(function(x) {
|
|
10
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
11
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
12
|
+
});
|
|
13
|
+
var __esm = (fn, res) => function __init() {
|
|
14
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
15
|
+
};
|
|
16
|
+
var __commonJS = (cb, mod) => function __require2() {
|
|
17
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
18
|
+
};
|
|
19
|
+
var __copyProps = (to, from, except, desc) => {
|
|
20
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
21
|
+
for (let key of __getOwnPropNames(from))
|
|
22
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
23
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
24
|
+
}
|
|
25
|
+
return to;
|
|
26
|
+
};
|
|
27
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
28
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
29
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
30
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
31
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
32
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
33
|
+
mod
|
|
34
|
+
));
|
|
35
|
+
|
|
36
|
+
export {
|
|
37
|
+
__require,
|
|
38
|
+
__esm,
|
|
39
|
+
__commonJS,
|
|
40
|
+
__toESM
|
|
41
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// ../../node_modules/.pnpm/@mariozechner+pi-ai@0.63.2_@modelcontextprotocol+sdk@1.27.1_zod@4.3.6__ws@8.20.0_zod@4.3.6/node_modules/@mariozechner/pi-ai/dist/providers/github-copilot-headers.js
|
|
2
|
+
function inferCopilotInitiator(messages) {
|
|
3
|
+
const last = messages[messages.length - 1];
|
|
4
|
+
return last && last.role !== "user" ? "agent" : "user";
|
|
5
|
+
}
|
|
6
|
+
function hasCopilotVisionInput(messages) {
|
|
7
|
+
return messages.some((msg) => {
|
|
8
|
+
if (msg.role === "user" && Array.isArray(msg.content)) {
|
|
9
|
+
return msg.content.some((c) => c.type === "image");
|
|
10
|
+
}
|
|
11
|
+
if (msg.role === "toolResult" && Array.isArray(msg.content)) {
|
|
12
|
+
return msg.content.some((c) => c.type === "image");
|
|
13
|
+
}
|
|
14
|
+
return false;
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
function buildCopilotDynamicHeaders(params) {
|
|
18
|
+
const headers = {
|
|
19
|
+
"X-Initiator": inferCopilotInitiator(params.messages),
|
|
20
|
+
"Openai-Intent": "conversation-edits"
|
|
21
|
+
};
|
|
22
|
+
if (params.hasImages) {
|
|
23
|
+
headers["Copilot-Vision-Request"] = "true";
|
|
24
|
+
}
|
|
25
|
+
return headers;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export {
|
|
29
|
+
hasCopilotVisionInput,
|
|
30
|
+
buildCopilotDynamicHeaders
|
|
31
|
+
};
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__commonJS,
|
|
3
|
+
__toESM
|
|
4
|
+
} from "./chunk-EAQYK3U2.js";
|
|
5
|
+
|
|
6
|
+
// ../../node_modules/.pnpm/partial-json@0.1.7/node_modules/partial-json/dist/options.js
|
|
7
|
+
var require_options = __commonJS({
|
|
8
|
+
"../../node_modules/.pnpm/partial-json@0.1.7/node_modules/partial-json/dist/options.js"(exports) {
|
|
9
|
+
"use strict";
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.Allow = exports.ALL = exports.COLLECTION = exports.ATOM = exports.SPECIAL = exports.INF = exports._INFINITY = exports.INFINITY = exports.NAN = exports.BOOL = exports.NULL = exports.OBJ = exports.ARR = exports.NUM = exports.STR = void 0;
|
|
12
|
+
exports.STR = 1;
|
|
13
|
+
exports.NUM = 2;
|
|
14
|
+
exports.ARR = 4;
|
|
15
|
+
exports.OBJ = 8;
|
|
16
|
+
exports.NULL = 16;
|
|
17
|
+
exports.BOOL = 32;
|
|
18
|
+
exports.NAN = 64;
|
|
19
|
+
exports.INFINITY = 128;
|
|
20
|
+
exports._INFINITY = 256;
|
|
21
|
+
exports.INF = exports.INFINITY | exports._INFINITY;
|
|
22
|
+
exports.SPECIAL = exports.NULL | exports.BOOL | exports.INF | exports.NAN;
|
|
23
|
+
exports.ATOM = exports.STR | exports.NUM | exports.SPECIAL;
|
|
24
|
+
exports.COLLECTION = exports.ARR | exports.OBJ;
|
|
25
|
+
exports.ALL = exports.ATOM | exports.COLLECTION;
|
|
26
|
+
exports.Allow = { STR: exports.STR, NUM: exports.NUM, ARR: exports.ARR, OBJ: exports.OBJ, NULL: exports.NULL, BOOL: exports.BOOL, NAN: exports.NAN, INFINITY: exports.INFINITY, _INFINITY: exports._INFINITY, INF: exports.INF, SPECIAL: exports.SPECIAL, ATOM: exports.ATOM, COLLECTION: exports.COLLECTION, ALL: exports.ALL };
|
|
27
|
+
exports.default = exports.Allow;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
// ../../node_modules/.pnpm/partial-json@0.1.7/node_modules/partial-json/dist/index.js
|
|
32
|
+
var require_dist = __commonJS({
|
|
33
|
+
"../../node_modules/.pnpm/partial-json@0.1.7/node_modules/partial-json/dist/index.js"(exports) {
|
|
34
|
+
"use strict";
|
|
35
|
+
var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
36
|
+
if (k2 === void 0) k2 = k;
|
|
37
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
38
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
39
|
+
desc = { enumerable: true, get: function() {
|
|
40
|
+
return m[k];
|
|
41
|
+
} };
|
|
42
|
+
}
|
|
43
|
+
Object.defineProperty(o, k2, desc);
|
|
44
|
+
}) : (function(o, m, k, k2) {
|
|
45
|
+
if (k2 === void 0) k2 = k;
|
|
46
|
+
o[k2] = m[k];
|
|
47
|
+
}));
|
|
48
|
+
var __exportStar = exports && exports.__exportStar || function(m, exports2) {
|
|
49
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p)) __createBinding(exports2, m, p);
|
|
50
|
+
};
|
|
51
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
52
|
+
exports.Allow = exports.MalformedJSON = exports.PartialJSON = exports.parseJSON = exports.parse = void 0;
|
|
53
|
+
var options_1 = require_options();
|
|
54
|
+
Object.defineProperty(exports, "Allow", { enumerable: true, get: function() {
|
|
55
|
+
return options_1.Allow;
|
|
56
|
+
} });
|
|
57
|
+
__exportStar(require_options(), exports);
|
|
58
|
+
var PartialJSON = class extends Error {
|
|
59
|
+
};
|
|
60
|
+
exports.PartialJSON = PartialJSON;
|
|
61
|
+
var MalformedJSON = class extends Error {
|
|
62
|
+
};
|
|
63
|
+
exports.MalformedJSON = MalformedJSON;
|
|
64
|
+
function parseJSON(jsonString, allowPartial = options_1.Allow.ALL) {
|
|
65
|
+
if (typeof jsonString !== "string") {
|
|
66
|
+
throw new TypeError(`expecting str, got ${typeof jsonString}`);
|
|
67
|
+
}
|
|
68
|
+
if (!jsonString.trim()) {
|
|
69
|
+
throw new Error(`${jsonString} is empty`);
|
|
70
|
+
}
|
|
71
|
+
return _parseJSON(jsonString.trim(), allowPartial);
|
|
72
|
+
}
|
|
73
|
+
exports.parseJSON = parseJSON;
|
|
74
|
+
var _parseJSON = (jsonString, allow) => {
|
|
75
|
+
const length = jsonString.length;
|
|
76
|
+
let index = 0;
|
|
77
|
+
const markPartialJSON = (msg) => {
|
|
78
|
+
throw new PartialJSON(`${msg} at position ${index}`);
|
|
79
|
+
};
|
|
80
|
+
const throwMalformedError = (msg) => {
|
|
81
|
+
throw new MalformedJSON(`${msg} at position ${index}`);
|
|
82
|
+
};
|
|
83
|
+
const parseAny = () => {
|
|
84
|
+
skipBlank();
|
|
85
|
+
if (index >= length)
|
|
86
|
+
markPartialJSON("Unexpected end of input");
|
|
87
|
+
if (jsonString[index] === '"')
|
|
88
|
+
return parseStr();
|
|
89
|
+
if (jsonString[index] === "{")
|
|
90
|
+
return parseObj();
|
|
91
|
+
if (jsonString[index] === "[")
|
|
92
|
+
return parseArr();
|
|
93
|
+
if (jsonString.substring(index, index + 4) === "null" || options_1.Allow.NULL & allow && length - index < 4 && "null".startsWith(jsonString.substring(index))) {
|
|
94
|
+
index += 4;
|
|
95
|
+
return null;
|
|
96
|
+
}
|
|
97
|
+
if (jsonString.substring(index, index + 4) === "true" || options_1.Allow.BOOL & allow && length - index < 4 && "true".startsWith(jsonString.substring(index))) {
|
|
98
|
+
index += 4;
|
|
99
|
+
return true;
|
|
100
|
+
}
|
|
101
|
+
if (jsonString.substring(index, index + 5) === "false" || options_1.Allow.BOOL & allow && length - index < 5 && "false".startsWith(jsonString.substring(index))) {
|
|
102
|
+
index += 5;
|
|
103
|
+
return false;
|
|
104
|
+
}
|
|
105
|
+
if (jsonString.substring(index, index + 8) === "Infinity" || options_1.Allow.INFINITY & allow && length - index < 8 && "Infinity".startsWith(jsonString.substring(index))) {
|
|
106
|
+
index += 8;
|
|
107
|
+
return Infinity;
|
|
108
|
+
}
|
|
109
|
+
if (jsonString.substring(index, index + 9) === "-Infinity" || options_1.Allow._INFINITY & allow && 1 < length - index && length - index < 9 && "-Infinity".startsWith(jsonString.substring(index))) {
|
|
110
|
+
index += 9;
|
|
111
|
+
return -Infinity;
|
|
112
|
+
}
|
|
113
|
+
if (jsonString.substring(index, index + 3) === "NaN" || options_1.Allow.NAN & allow && length - index < 3 && "NaN".startsWith(jsonString.substring(index))) {
|
|
114
|
+
index += 3;
|
|
115
|
+
return NaN;
|
|
116
|
+
}
|
|
117
|
+
return parseNum();
|
|
118
|
+
};
|
|
119
|
+
const parseStr = () => {
|
|
120
|
+
const start = index;
|
|
121
|
+
let escape = false;
|
|
122
|
+
index++;
|
|
123
|
+
while (index < length && (jsonString[index] !== '"' || escape && jsonString[index - 1] === "\\")) {
|
|
124
|
+
escape = jsonString[index] === "\\" ? !escape : false;
|
|
125
|
+
index++;
|
|
126
|
+
}
|
|
127
|
+
if (jsonString.charAt(index) == '"') {
|
|
128
|
+
try {
|
|
129
|
+
return JSON.parse(jsonString.substring(start, ++index - Number(escape)));
|
|
130
|
+
} catch (e) {
|
|
131
|
+
throwMalformedError(String(e));
|
|
132
|
+
}
|
|
133
|
+
} else if (options_1.Allow.STR & allow) {
|
|
134
|
+
try {
|
|
135
|
+
return JSON.parse(jsonString.substring(start, index - Number(escape)) + '"');
|
|
136
|
+
} catch (e) {
|
|
137
|
+
return JSON.parse(jsonString.substring(start, jsonString.lastIndexOf("\\")) + '"');
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
markPartialJSON("Unterminated string literal");
|
|
141
|
+
};
|
|
142
|
+
const parseObj = () => {
|
|
143
|
+
index++;
|
|
144
|
+
skipBlank();
|
|
145
|
+
const obj = {};
|
|
146
|
+
try {
|
|
147
|
+
while (jsonString[index] !== "}") {
|
|
148
|
+
skipBlank();
|
|
149
|
+
if (index >= length && options_1.Allow.OBJ & allow)
|
|
150
|
+
return obj;
|
|
151
|
+
const key = parseStr();
|
|
152
|
+
skipBlank();
|
|
153
|
+
index++;
|
|
154
|
+
try {
|
|
155
|
+
const value = parseAny();
|
|
156
|
+
obj[key] = value;
|
|
157
|
+
} catch (e) {
|
|
158
|
+
if (options_1.Allow.OBJ & allow)
|
|
159
|
+
return obj;
|
|
160
|
+
else
|
|
161
|
+
throw e;
|
|
162
|
+
}
|
|
163
|
+
skipBlank();
|
|
164
|
+
if (jsonString[index] === ",")
|
|
165
|
+
index++;
|
|
166
|
+
}
|
|
167
|
+
} catch (e) {
|
|
168
|
+
if (options_1.Allow.OBJ & allow)
|
|
169
|
+
return obj;
|
|
170
|
+
else
|
|
171
|
+
markPartialJSON("Expected '}' at end of object");
|
|
172
|
+
}
|
|
173
|
+
index++;
|
|
174
|
+
return obj;
|
|
175
|
+
};
|
|
176
|
+
const parseArr = () => {
|
|
177
|
+
index++;
|
|
178
|
+
const arr = [];
|
|
179
|
+
try {
|
|
180
|
+
while (jsonString[index] !== "]") {
|
|
181
|
+
arr.push(parseAny());
|
|
182
|
+
skipBlank();
|
|
183
|
+
if (jsonString[index] === ",") {
|
|
184
|
+
index++;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
} catch (e) {
|
|
188
|
+
if (options_1.Allow.ARR & allow) {
|
|
189
|
+
return arr;
|
|
190
|
+
}
|
|
191
|
+
markPartialJSON("Expected ']' at end of array");
|
|
192
|
+
}
|
|
193
|
+
index++;
|
|
194
|
+
return arr;
|
|
195
|
+
};
|
|
196
|
+
const parseNum = () => {
|
|
197
|
+
if (index === 0) {
|
|
198
|
+
if (jsonString === "-")
|
|
199
|
+
throwMalformedError("Not sure what '-' is");
|
|
200
|
+
try {
|
|
201
|
+
return JSON.parse(jsonString);
|
|
202
|
+
} catch (e) {
|
|
203
|
+
if (options_1.Allow.NUM & allow)
|
|
204
|
+
try {
|
|
205
|
+
return JSON.parse(jsonString.substring(0, jsonString.lastIndexOf("e")));
|
|
206
|
+
} catch (e2) {
|
|
207
|
+
}
|
|
208
|
+
throwMalformedError(String(e));
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
const start = index;
|
|
212
|
+
if (jsonString[index] === "-")
|
|
213
|
+
index++;
|
|
214
|
+
while (jsonString[index] && ",]}".indexOf(jsonString[index]) === -1)
|
|
215
|
+
index++;
|
|
216
|
+
if (index == length && !(options_1.Allow.NUM & allow))
|
|
217
|
+
markPartialJSON("Unterminated number literal");
|
|
218
|
+
try {
|
|
219
|
+
return JSON.parse(jsonString.substring(start, index));
|
|
220
|
+
} catch (e) {
|
|
221
|
+
if (jsonString.substring(start, index) === "-")
|
|
222
|
+
markPartialJSON("Not sure what '-' is");
|
|
223
|
+
try {
|
|
224
|
+
return JSON.parse(jsonString.substring(start, jsonString.lastIndexOf("e")));
|
|
225
|
+
} catch (e2) {
|
|
226
|
+
throwMalformedError(String(e2));
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
};
|
|
230
|
+
const skipBlank = () => {
|
|
231
|
+
while (index < length && " \n\r ".includes(jsonString[index])) {
|
|
232
|
+
index++;
|
|
233
|
+
}
|
|
234
|
+
};
|
|
235
|
+
return parseAny();
|
|
236
|
+
};
|
|
237
|
+
var parse = parseJSON;
|
|
238
|
+
exports.parse = parse;
|
|
239
|
+
}
|
|
240
|
+
});
|
|
241
|
+
|
|
242
|
+
// ../../node_modules/.pnpm/@mariozechner+pi-ai@0.63.2_@modelcontextprotocol+sdk@1.27.1_zod@4.3.6__ws@8.20.0_zod@4.3.6/node_modules/@mariozechner/pi-ai/dist/utils/json-parse.js
|
|
243
|
+
var import_partial_json = __toESM(require_dist(), 1);
|
|
244
|
+
function parseStreamingJson(partialJson) {
|
|
245
|
+
if (!partialJson || partialJson.trim() === "") {
|
|
246
|
+
return {};
|
|
247
|
+
}
|
|
248
|
+
try {
|
|
249
|
+
return JSON.parse(partialJson);
|
|
250
|
+
} catch {
|
|
251
|
+
try {
|
|
252
|
+
const result = (0, import_partial_json.parse)(partialJson);
|
|
253
|
+
return result ?? {};
|
|
254
|
+
} catch {
|
|
255
|
+
return {};
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
export {
|
|
261
|
+
parseStreamingJson
|
|
262
|
+
};
|