@opentiny/next-remoter 0.3.0-alpha.0 → 0.3.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/dist/composable/useBuiltinMcpServer.d.ts +28 -0
- package/dist/next-remoter-runtime.es.js +11770 -11705
- package/dist/next-remoter.cjs.js +14 -14
- package/dist/next-remoter.css +1 -1
- package/dist/next-remoter.es.js +758 -744
- package/dist/style.css +1 -1
- package/package.json +2 -2
package/dist/next-remoter.es.js
CHANGED
|
@@ -1447,7 +1447,7 @@ const Ff = /* @__PURE__ */ Q("$ZodObject", (t, r) => {
|
|
|
1447
1447
|
const F = A.shape;
|
|
1448
1448
|
for (const J of A.keys) {
|
|
1449
1449
|
const Y = F[J], z = Y._zod.run({ value: N[J], issues: [] }, D), U = Y._zod.optin === "optional" && Y._zod.optout === "optional";
|
|
1450
|
-
z instanceof Promise ? R.push(z.then((
|
|
1450
|
+
z instanceof Promise ? R.push(z.then((ee) => U ? oa(ee, _, J, N) : Pi(ee, _, J))) : U ? oa(z, _, J, N) : Pi(z, _, J);
|
|
1451
1451
|
}
|
|
1452
1452
|
}
|
|
1453
1453
|
if (!x)
|
|
@@ -2953,7 +2953,7 @@ function ce(t, r) {
|
|
|
2953
2953
|
return jh(Rp, t, r);
|
|
2954
2954
|
}
|
|
2955
2955
|
const Mp = /* @__PURE__ */ Q("ZodObject", (t, r) => {
|
|
2956
|
-
Ff.init(t, r), wt.init(t, r), ot(t, "shape", () => r.shape), t.keyof = () =>
|
|
2956
|
+
Ff.init(t, r), wt.init(t, r), ot(t, "shape", () => r.shape), t.keyof = () => Se(Object.keys(t._zod.def.shape)), t.catchall = (o) => t.clone({ ...t._zod.def, catchall: o }), t.passthrough = () => t.clone({ ...t._zod.def, catchall: Mn() }), t.loose = () => t.clone({ ...t._zod.def, catchall: Mn() }), t.strict = () => t.clone({ ...t._zod.def, catchall: kp() }), t.strip = () => t.clone({ ...t._zod.def, catchall: void 0 }), t.extend = (o) => a0(t, o), t.merge = (o) => l0(t, o), t.pick = (o) => o0(t, o), t.omit = (o) => s0(t, o), t.partial = (...o) => c0(iu, t, o[0]), t.required = (...o) => u0(ou, t, o[0]);
|
|
2957
2957
|
});
|
|
2958
2958
|
function S(t, r) {
|
|
2959
2959
|
const o = {
|
|
@@ -3038,7 +3038,7 @@ const Go = /* @__PURE__ */ Q("ZodEnum", (t, r) => {
|
|
|
3038
3038
|
});
|
|
3039
3039
|
};
|
|
3040
3040
|
});
|
|
3041
|
-
function
|
|
3041
|
+
function Se(t, r) {
|
|
3042
3042
|
const o = Array.isArray(t) ? Object.fromEntries(t.map((c) => [c, c])) : t;
|
|
3043
3043
|
return new Go({
|
|
3044
3044
|
type: "enum",
|
|
@@ -3981,29 +3981,29 @@ var Dg = class {
|
|
|
3981
3981
|
),
|
|
3982
3982
|
abortSignal: t.abortSignal,
|
|
3983
3983
|
fetch: this.config.fetch
|
|
3984
|
-
}),
|
|
3985
|
-
|
|
3986
|
-
const
|
|
3987
|
-
if (
|
|
3984
|
+
}), ee = z.choices[0], I = [], Te = ee.message.content;
|
|
3985
|
+
Te != null && Te.length > 0 && I.push({ type: "text", text: Te });
|
|
3986
|
+
const ye = (r = ee.message.reasoning_content) != null ? r : ee.message.reasoning;
|
|
3987
|
+
if (ye != null && ye.length > 0 && I.push({
|
|
3988
3988
|
type: "reasoning",
|
|
3989
|
-
text:
|
|
3990
|
-
}),
|
|
3991
|
-
for (const Me of
|
|
3989
|
+
text: ye
|
|
3990
|
+
}), ee.message.tool_calls != null)
|
|
3991
|
+
for (const Me of ee.message.tool_calls)
|
|
3992
3992
|
I.push({
|
|
3993
3993
|
type: "tool-call",
|
|
3994
3994
|
toolCallId: (o = Me.id) != null ? o : Li(),
|
|
3995
3995
|
toolName: Me.function.name,
|
|
3996
3996
|
input: Me.function.arguments
|
|
3997
3997
|
});
|
|
3998
|
-
const
|
|
3998
|
+
const ne = {
|
|
3999
3999
|
[this.providerOptionsName]: {},
|
|
4000
4000
|
...await ((u = (c = this.config.metadataExtractor) == null ? void 0 : c.extractMetadata) == null ? void 0 : u.call(c, {
|
|
4001
4001
|
parsedBody: U
|
|
4002
4002
|
}))
|
|
4003
4003
|
}, me = (f = z.usage) == null ? void 0 : f.completion_tokens_details;
|
|
4004
|
-
return me?.accepted_prediction_tokens != null && (
|
|
4004
|
+
return me?.accepted_prediction_tokens != null && (ne[this.providerOptionsName].acceptedPredictionTokens = me?.accepted_prediction_tokens), me?.rejected_prediction_tokens != null && (ne[this.providerOptionsName].rejectedPredictionTokens = me?.rejected_prediction_tokens), {
|
|
4005
4005
|
content: I,
|
|
4006
|
-
finishReason: Na(
|
|
4006
|
+
finishReason: Na(ee.finish_reason),
|
|
4007
4007
|
usage: {
|
|
4008
4008
|
inputTokens: (m = (g = z.usage) == null ? void 0 : g.prompt_tokens) != null ? m : void 0,
|
|
4009
4009
|
outputTokens: (x = (v = z.usage) == null ? void 0 : v.completion_tokens) != null ? x : void 0,
|
|
@@ -4011,7 +4011,7 @@ var Dg = class {
|
|
|
4011
4011
|
reasoningTokens: (R = (N = (D = z.usage) == null ? void 0 : D.completion_tokens_details) == null ? void 0 : N.reasoning_tokens) != null ? R : void 0,
|
|
4012
4012
|
cachedInputTokens: (j = (P = (M = z.usage) == null ? void 0 : M.prompt_tokens_details) == null ? void 0 : P.cached_tokens) != null ? j : void 0
|
|
4013
4013
|
},
|
|
4014
|
-
providerMetadata:
|
|
4014
|
+
providerMetadata: ne,
|
|
4015
4015
|
request: { body: J },
|
|
4016
4016
|
response: {
|
|
4017
4017
|
...Ta(z),
|
|
@@ -4067,7 +4067,7 @@ var Dg = class {
|
|
|
4067
4067
|
},
|
|
4068
4068
|
// TODO we lost type safety on Chunk, most likely due to the error schema. MUST FIX
|
|
4069
4069
|
transform(M, P) {
|
|
4070
|
-
var j, Z, F, J, Y, z, U,
|
|
4070
|
+
var j, Z, F, J, Y, z, U, ee, I, Te, ye, ne, me;
|
|
4071
4071
|
if (t.includeRawChunks && P.enqueue({ type: "raw", rawValue: M.rawValue }), !M.success) {
|
|
4072
4072
|
x = "error", P.enqueue({ type: "error", error: M.error });
|
|
4073
4073
|
return;
|
|
@@ -4085,24 +4085,24 @@ var Dg = class {
|
|
|
4085
4085
|
prompt_tokens: K,
|
|
4086
4086
|
completion_tokens: pe,
|
|
4087
4087
|
total_tokens: de,
|
|
4088
|
-
prompt_tokens_details:
|
|
4088
|
+
prompt_tokens_details: re,
|
|
4089
4089
|
completion_tokens_details: he
|
|
4090
4090
|
} = Me.usage;
|
|
4091
|
-
A.promptTokens = K ?? void 0, A.completionTokens = pe ?? void 0, A.totalTokens = de ?? void 0, he?.reasoning_tokens != null && (A.completionTokensDetails.reasoningTokens = he?.reasoning_tokens), he?.accepted_prediction_tokens != null && (A.completionTokensDetails.acceptedPredictionTokens = he?.accepted_prediction_tokens), he?.rejected_prediction_tokens != null && (A.completionTokensDetails.rejectedPredictionTokens = he?.rejected_prediction_tokens),
|
|
4091
|
+
A.promptTokens = K ?? void 0, A.completionTokens = pe ?? void 0, A.totalTokens = de ?? void 0, he?.reasoning_tokens != null && (A.completionTokensDetails.reasoningTokens = he?.reasoning_tokens), he?.accepted_prediction_tokens != null && (A.completionTokensDetails.acceptedPredictionTokens = he?.accepted_prediction_tokens), he?.rejected_prediction_tokens != null && (A.completionTokensDetails.rejectedPredictionTokens = he?.rejected_prediction_tokens), re?.cached_tokens != null && (A.promptTokensDetails.cachedTokens = re?.cached_tokens);
|
|
4092
4092
|
}
|
|
4093
4093
|
const $ = Me.choices[0];
|
|
4094
4094
|
if ($?.finish_reason != null && (x = Na(
|
|
4095
4095
|
$.finish_reason
|
|
4096
4096
|
)), $?.delta == null)
|
|
4097
4097
|
return;
|
|
4098
|
-
const ge = $.delta,
|
|
4099
|
-
if (
|
|
4098
|
+
const ge = $.delta, te = (j = ge.reasoning_content) != null ? j : ge.reasoning;
|
|
4099
|
+
if (te && (N || (P.enqueue({
|
|
4100
4100
|
type: "reasoning-start",
|
|
4101
4101
|
id: "reasoning-0"
|
|
4102
4102
|
}), N = !0), P.enqueue({
|
|
4103
4103
|
type: "reasoning-delta",
|
|
4104
4104
|
id: "reasoning-0",
|
|
4105
|
-
delta:
|
|
4105
|
+
delta: te
|
|
4106
4106
|
})), ge.content && (R || (P.enqueue({ type: "text-start", id: "txt-0" }), R = !0), P.enqueue({
|
|
4107
4107
|
type: "text-delta",
|
|
4108
4108
|
id: "txt-0",
|
|
@@ -4134,28 +4134,28 @@ var Dg = class {
|
|
|
4134
4134
|
},
|
|
4135
4135
|
hasFinished: !1
|
|
4136
4136
|
};
|
|
4137
|
-
const
|
|
4138
|
-
((J =
|
|
4137
|
+
const re = v[pe];
|
|
4138
|
+
((J = re.function) == null ? void 0 : J.name) != null && ((Y = re.function) == null ? void 0 : Y.arguments) != null && (re.function.arguments.length > 0 && P.enqueue({
|
|
4139
4139
|
type: "tool-input-delta",
|
|
4140
|
-
id:
|
|
4141
|
-
delta:
|
|
4142
|
-
}), Ea(
|
|
4140
|
+
id: re.id,
|
|
4141
|
+
delta: re.function.arguments
|
|
4142
|
+
}), Ea(re.function.arguments) && (P.enqueue({
|
|
4143
4143
|
type: "tool-input-end",
|
|
4144
|
-
id:
|
|
4144
|
+
id: re.id
|
|
4145
4145
|
}), P.enqueue({
|
|
4146
4146
|
type: "tool-call",
|
|
4147
|
-
toolCallId: (z =
|
|
4148
|
-
toolName:
|
|
4149
|
-
input:
|
|
4150
|
-
}),
|
|
4147
|
+
toolCallId: (z = re.id) != null ? z : Li(),
|
|
4148
|
+
toolName: re.function.name,
|
|
4149
|
+
input: re.function.arguments
|
|
4150
|
+
}), re.hasFinished = !0));
|
|
4151
4151
|
continue;
|
|
4152
4152
|
}
|
|
4153
4153
|
const de = v[pe];
|
|
4154
|
-
de.hasFinished || (((U = K.function) == null ? void 0 : U.arguments) != null && (de.function.arguments += (I = (
|
|
4154
|
+
de.hasFinished || (((U = K.function) == null ? void 0 : U.arguments) != null && (de.function.arguments += (I = (ee = K.function) == null ? void 0 : ee.arguments) != null ? I : ""), P.enqueue({
|
|
4155
4155
|
type: "tool-input-delta",
|
|
4156
4156
|
id: de.id,
|
|
4157
|
-
delta: (
|
|
4158
|
-
}), ((
|
|
4157
|
+
delta: (Te = K.function.arguments) != null ? Te : ""
|
|
4158
|
+
}), ((ye = de.function) == null ? void 0 : ye.name) != null && ((ne = de.function) == null ? void 0 : ne.arguments) != null && Ea(de.function.arguments) && (P.enqueue({
|
|
4159
4159
|
type: "tool-input-end",
|
|
4160
4160
|
id: de.id
|
|
4161
4161
|
}), P.enqueue({
|
|
@@ -4170,7 +4170,7 @@ var Dg = class {
|
|
|
4170
4170
|
var P, j, Z, F, J, Y;
|
|
4171
4171
|
N && M.enqueue({ type: "reasoning-end", id: "reasoning-0" }), R && M.enqueue({ type: "text-end", id: "txt-0" });
|
|
4172
4172
|
for (const U of v.filter(
|
|
4173
|
-
(
|
|
4173
|
+
(ee) => !ee.hasFinished
|
|
4174
4174
|
))
|
|
4175
4175
|
M.enqueue({
|
|
4176
4176
|
type: "tool-input-end",
|
|
@@ -4249,7 +4249,7 @@ var Dg = class {
|
|
|
4249
4249
|
choices: ce(
|
|
4250
4250
|
S({
|
|
4251
4251
|
delta: S({
|
|
4252
|
-
role:
|
|
4252
|
+
role: Se(["assistant"]).nullish(),
|
|
4253
4253
|
content: w().nullish(),
|
|
4254
4254
|
// Most openai-compatible models set `reasoning_content`, but some
|
|
4255
4255
|
// providers serving `gpt-oss` set `reasoning`. See #7866
|
|
@@ -6732,7 +6732,7 @@ var A2 = Le(
|
|
|
6732
6732
|
choices: ce(
|
|
6733
6733
|
S({
|
|
6734
6734
|
delta: S({
|
|
6735
|
-
role:
|
|
6735
|
+
role: Se(["assistant"]).nullish(),
|
|
6736
6736
|
content: w().nullish(),
|
|
6737
6737
|
tool_calls: ce(
|
|
6738
6738
|
S({
|
|
@@ -6824,7 +6824,7 @@ var A2 = Le(
|
|
|
6824
6824
|
/**
|
|
6825
6825
|
* Reasoning effort for reasoning models. Defaults to `medium`.
|
|
6826
6826
|
*/
|
|
6827
|
-
reasoningEffort:
|
|
6827
|
+
reasoningEffort: Se(["none", "minimal", "low", "medium", "high", "xhigh"]).optional(),
|
|
6828
6828
|
/**
|
|
6829
6829
|
* Maximum number of completion tokens to generate. Useful for reasoning models.
|
|
6830
6830
|
*/
|
|
@@ -6851,7 +6851,7 @@ var A2 = Le(
|
|
|
6851
6851
|
*
|
|
6852
6852
|
* @default 'auto'
|
|
6853
6853
|
*/
|
|
6854
|
-
serviceTier:
|
|
6854
|
+
serviceTier: Se(["auto", "flex", "priority", "default"]).optional(),
|
|
6855
6855
|
/**
|
|
6856
6856
|
* Whether to use strict JSON schema validation.
|
|
6857
6857
|
*
|
|
@@ -6862,7 +6862,7 @@ var A2 = Le(
|
|
|
6862
6862
|
* Controls the verbosity of the model's responses.
|
|
6863
6863
|
* Lower values will result in more concise responses, while higher values will result in more verbose responses.
|
|
6864
6864
|
*/
|
|
6865
|
-
textVerbosity:
|
|
6865
|
+
textVerbosity: Se(["low", "medium", "high"]).optional(),
|
|
6866
6866
|
/**
|
|
6867
6867
|
* A cache key for prompt caching. Allows manual control over prompt caching behavior.
|
|
6868
6868
|
* Useful for improving cache hit rates and working around automatic caching issues.
|
|
@@ -6876,7 +6876,7 @@ var A2 = Le(
|
|
|
6876
6876
|
*
|
|
6877
6877
|
* @default 'in_memory'
|
|
6878
6878
|
*/
|
|
6879
|
-
promptCacheRetention:
|
|
6879
|
+
promptCacheRetention: Se(["in_memory", "24h"]).optional(),
|
|
6880
6880
|
/**
|
|
6881
6881
|
* A stable identifier used to help detect users of your application
|
|
6882
6882
|
* that may be violating OpenAI's usage policies. The IDs should be a
|
|
@@ -6893,7 +6893,7 @@ var A2 = Le(
|
|
|
6893
6893
|
*
|
|
6894
6894
|
* If not specified, the mode is automatically determined based on the model.
|
|
6895
6895
|
*/
|
|
6896
|
-
systemMessageMode:
|
|
6896
|
+
systemMessageMode: Se(["system", "developer", "remove"]).optional(),
|
|
6897
6897
|
/**
|
|
6898
6898
|
* Force treating this model as a reasoning model.
|
|
6899
6899
|
*
|
|
@@ -7001,7 +7001,7 @@ var T2 = class {
|
|
|
7001
7001
|
}
|
|
7002
7002
|
);
|
|
7003
7003
|
Z.push(...U);
|
|
7004
|
-
const
|
|
7004
|
+
const ee = (P = F.strictJsonSchema) != null ? P : !0, I = {
|
|
7005
7005
|
// model id:
|
|
7006
7006
|
model: this.modelId,
|
|
7007
7007
|
// model specific settings:
|
|
@@ -7020,7 +7020,7 @@ var T2 = class {
|
|
|
7020
7020
|
type: "json_schema",
|
|
7021
7021
|
json_schema: {
|
|
7022
7022
|
schema: v.schema,
|
|
7023
|
-
strict:
|
|
7023
|
+
strict: ee,
|
|
7024
7024
|
name: (j = v.name) != null ? j : "response",
|
|
7025
7025
|
description: v.description
|
|
7026
7026
|
}
|
|
@@ -7081,9 +7081,9 @@ var T2 = class {
|
|
|
7081
7081
|
details: "priority processing is only available for supported models (gpt-4, gpt-5, gpt-5-mini, o3, o4-mini) and requires Enterprise access. gpt-5-nano is not supported"
|
|
7082
7082
|
}), I.service_tier = void 0);
|
|
7083
7083
|
const {
|
|
7084
|
-
tools:
|
|
7085
|
-
toolChoice:
|
|
7086
|
-
toolWarnings:
|
|
7084
|
+
tools: Te,
|
|
7085
|
+
toolChoice: ye,
|
|
7086
|
+
toolWarnings: ne
|
|
7087
7087
|
} = S2({
|
|
7088
7088
|
tools: A,
|
|
7089
7089
|
toolChoice: _
|
|
@@ -7091,10 +7091,10 @@ var T2 = class {
|
|
|
7091
7091
|
return {
|
|
7092
7092
|
args: {
|
|
7093
7093
|
...I,
|
|
7094
|
-
tools:
|
|
7095
|
-
tool_choice:
|
|
7094
|
+
tools: Te,
|
|
7095
|
+
tool_choice: ye
|
|
7096
7096
|
},
|
|
7097
|
-
warnings: [...Z, ...
|
|
7097
|
+
warnings: [...Z, ...ne]
|
|
7098
7098
|
};
|
|
7099
7099
|
}
|
|
7100
7100
|
async doGenerate(t) {
|
|
@@ -7186,7 +7186,7 @@ var T2 = class {
|
|
|
7186
7186
|
D.enqueue({ type: "stream-start", warnings: o });
|
|
7187
7187
|
},
|
|
7188
7188
|
transform(D, N) {
|
|
7189
|
-
var R, M, P, j, Z, F, J, Y, z, U,
|
|
7189
|
+
var R, M, P, j, Z, F, J, Y, z, U, ee, I, Te, ye, ne, me, Me;
|
|
7190
7190
|
if (t.includeRawChunks && N.enqueue({ type: "raw", rawValue: D.rawValue }), !D.success) {
|
|
7191
7191
|
m = { unified: "error", raw: void 0 }, N.enqueue({ type: "error", error: D.error });
|
|
7192
7192
|
return;
|
|
@@ -7210,13 +7210,13 @@ var T2 = class {
|
|
|
7210
7210
|
raw: ge.finish_reason
|
|
7211
7211
|
}), ((Z = ge?.logprobs) == null ? void 0 : Z.content) != null && (_.openai.logprobs = ge.logprobs.content), ge?.delta == null)
|
|
7212
7212
|
return;
|
|
7213
|
-
const
|
|
7214
|
-
if (
|
|
7213
|
+
const te = ge.delta;
|
|
7214
|
+
if (te.content != null && (A || (N.enqueue({ type: "text-start", id: "0" }), A = !0), N.enqueue({
|
|
7215
7215
|
type: "text-delta",
|
|
7216
7216
|
id: "0",
|
|
7217
|
-
delta:
|
|
7218
|
-
})),
|
|
7219
|
-
for (const K of
|
|
7217
|
+
delta: te.content
|
|
7218
|
+
})), te.tool_calls != null)
|
|
7219
|
+
for (const K of te.tool_calls) {
|
|
7220
7220
|
const pe = K.index;
|
|
7221
7221
|
if (g[pe] == null) {
|
|
7222
7222
|
if (K.type != null && K.type !== "function")
|
|
@@ -7247,28 +7247,28 @@ var T2 = class {
|
|
|
7247
7247
|
},
|
|
7248
7248
|
hasFinished: !1
|
|
7249
7249
|
};
|
|
7250
|
-
const
|
|
7251
|
-
((Y =
|
|
7250
|
+
const re = g[pe];
|
|
7251
|
+
((Y = re.function) == null ? void 0 : Y.name) != null && ((z = re.function) == null ? void 0 : z.arguments) != null && (re.function.arguments.length > 0 && N.enqueue({
|
|
7252
7252
|
type: "tool-input-delta",
|
|
7253
|
-
id:
|
|
7254
|
-
delta:
|
|
7255
|
-
}), sl(
|
|
7253
|
+
id: re.id,
|
|
7254
|
+
delta: re.function.arguments
|
|
7255
|
+
}), sl(re.function.arguments) && (N.enqueue({
|
|
7256
7256
|
type: "tool-input-end",
|
|
7257
|
-
id:
|
|
7257
|
+
id: re.id
|
|
7258
7258
|
}), N.enqueue({
|
|
7259
7259
|
type: "tool-call",
|
|
7260
|
-
toolCallId: (U =
|
|
7261
|
-
toolName:
|
|
7262
|
-
input:
|
|
7263
|
-
}),
|
|
7260
|
+
toolCallId: (U = re.id) != null ? U : on(),
|
|
7261
|
+
toolName: re.function.name,
|
|
7262
|
+
input: re.function.arguments
|
|
7263
|
+
}), re.hasFinished = !0));
|
|
7264
7264
|
continue;
|
|
7265
7265
|
}
|
|
7266
7266
|
const de = g[pe];
|
|
7267
|
-
de.hasFinished || (((
|
|
7267
|
+
de.hasFinished || (((ee = K.function) == null ? void 0 : ee.arguments) != null && (de.function.arguments += (Te = (I = K.function) == null ? void 0 : I.arguments) != null ? Te : ""), N.enqueue({
|
|
7268
7268
|
type: "tool-input-delta",
|
|
7269
7269
|
id: de.id,
|
|
7270
|
-
delta: (
|
|
7271
|
-
}), ((
|
|
7270
|
+
delta: (ye = K.function.arguments) != null ? ye : ""
|
|
7271
|
+
}), ((ne = de.function) == null ? void 0 : ne.name) != null && ((me = de.function) == null ? void 0 : me.arguments) != null && sl(de.function.arguments) && (N.enqueue({
|
|
7272
7272
|
type: "tool-input-end",
|
|
7273
7273
|
id: de.id
|
|
7274
7274
|
}), N.enqueue({
|
|
@@ -7278,8 +7278,8 @@ var T2 = class {
|
|
|
7278
7278
|
input: de.function.arguments
|
|
7279
7279
|
}), de.hasFinished = !0));
|
|
7280
7280
|
}
|
|
7281
|
-
if (
|
|
7282
|
-
for (const K of
|
|
7281
|
+
if (te.annotations != null)
|
|
7282
|
+
for (const K of te.annotations)
|
|
7283
7283
|
N.enqueue({
|
|
7284
7284
|
type: "source",
|
|
7285
7285
|
sourceType: "url",
|
|
@@ -7850,7 +7850,7 @@ var U2 = class {
|
|
|
7850
7850
|
}), g != null && Y.push({ type: "unsupported", feature: "seed" });
|
|
7851
7851
|
const z = (D = (_ = (A = this.config._internal) == null ? void 0 : A.currentDate) == null ? void 0 : _.call(A)) != null ? D : /* @__PURE__ */ new Date();
|
|
7852
7852
|
if (r != null) {
|
|
7853
|
-
const { value: I, responseHeaders:
|
|
7853
|
+
const { value: I, responseHeaders: Te } = await Gu({
|
|
7854
7854
|
url: this.config.url({
|
|
7855
7855
|
path: "/images/edits",
|
|
7856
7856
|
modelId: this.modelId
|
|
@@ -7861,16 +7861,16 @@ var U2 = class {
|
|
|
7861
7861
|
prompt: t,
|
|
7862
7862
|
image: await Promise.all(
|
|
7863
7863
|
r.map(
|
|
7864
|
-
(
|
|
7864
|
+
(ye) => ye.type === "file" ? new Blob(
|
|
7865
7865
|
[
|
|
7866
|
-
|
|
7867
|
-
type:
|
|
7868
|
-
}) : new Blob([As(
|
|
7869
|
-
type:
|
|
7866
|
+
ye.data instanceof Uint8Array ? new Blob([ye.data], {
|
|
7867
|
+
type: ye.mediaType
|
|
7868
|
+
}) : new Blob([As(ye.data)], {
|
|
7869
|
+
type: ye.mediaType
|
|
7870
7870
|
})
|
|
7871
7871
|
],
|
|
7872
|
-
{ type:
|
|
7873
|
-
) : Uu(
|
|
7872
|
+
{ type: ye.mediaType }
|
|
7873
|
+
) : Uu(ye.url)
|
|
7874
7874
|
)
|
|
7875
7875
|
),
|
|
7876
7876
|
mask: o != null ? await z2(o) : void 0,
|
|
@@ -7886,7 +7886,7 @@ var U2 = class {
|
|
|
7886
7886
|
fetch: this.config.fetch
|
|
7887
7887
|
});
|
|
7888
7888
|
return {
|
|
7889
|
-
images: I.data.map((
|
|
7889
|
+
images: I.data.map((ye) => ye.b64_json),
|
|
7890
7890
|
warnings: Y,
|
|
7891
7891
|
usage: I.usage != null ? {
|
|
7892
7892
|
inputTokens: (R = I.usage.input_tokens) != null ? R : void 0,
|
|
@@ -7896,22 +7896,22 @@ var U2 = class {
|
|
|
7896
7896
|
response: {
|
|
7897
7897
|
timestamp: z,
|
|
7898
7898
|
modelId: this.modelId,
|
|
7899
|
-
headers:
|
|
7899
|
+
headers: Te
|
|
7900
7900
|
},
|
|
7901
7901
|
providerMetadata: {
|
|
7902
7902
|
openai: {
|
|
7903
|
-
images: I.data.map((
|
|
7904
|
-
var me, Me, $, ge,
|
|
7903
|
+
images: I.data.map((ye, ne) => {
|
|
7904
|
+
var me, Me, $, ge, te, K;
|
|
7905
7905
|
return {
|
|
7906
|
-
...
|
|
7906
|
+
...ye.revised_prompt ? { revisedPrompt: ye.revised_prompt } : {},
|
|
7907
7907
|
created: (me = I.created) != null ? me : void 0,
|
|
7908
7908
|
size: (Me = I.size) != null ? Me : void 0,
|
|
7909
7909
|
quality: ($ = I.quality) != null ? $ : void 0,
|
|
7910
7910
|
background: (ge = I.background) != null ? ge : void 0,
|
|
7911
|
-
outputFormat: (
|
|
7911
|
+
outputFormat: (te = I.output_format) != null ? te : void 0,
|
|
7912
7912
|
...pl(
|
|
7913
7913
|
(K = I.usage) == null ? void 0 : K.input_tokens_details,
|
|
7914
|
-
|
|
7914
|
+
ne,
|
|
7915
7915
|
I.data.length
|
|
7916
7916
|
)
|
|
7917
7917
|
};
|
|
@@ -7920,7 +7920,7 @@ var U2 = class {
|
|
|
7920
7920
|
}
|
|
7921
7921
|
};
|
|
7922
7922
|
}
|
|
7923
|
-
const { value: U, responseHeaders:
|
|
7923
|
+
const { value: U, responseHeaders: ee } = await Qn({
|
|
7924
7924
|
url: this.config.url({
|
|
7925
7925
|
path: "/images/generations",
|
|
7926
7926
|
modelId: this.modelId
|
|
@@ -7952,22 +7952,22 @@ var U2 = class {
|
|
|
7952
7952
|
response: {
|
|
7953
7953
|
timestamp: z,
|
|
7954
7954
|
modelId: this.modelId,
|
|
7955
|
-
headers:
|
|
7955
|
+
headers: ee
|
|
7956
7956
|
},
|
|
7957
7957
|
providerMetadata: {
|
|
7958
7958
|
openai: {
|
|
7959
|
-
images: U.data.map((I,
|
|
7960
|
-
var
|
|
7959
|
+
images: U.data.map((I, Te) => {
|
|
7960
|
+
var ye, ne, me, Me, $, ge;
|
|
7961
7961
|
return {
|
|
7962
7962
|
...I.revised_prompt ? { revisedPrompt: I.revised_prompt } : {},
|
|
7963
|
-
created: (
|
|
7964
|
-
size: (
|
|
7963
|
+
created: (ye = U.created) != null ? ye : void 0,
|
|
7964
|
+
size: (ne = U.size) != null ? ne : void 0,
|
|
7965
7965
|
quality: (me = U.quality) != null ? me : void 0,
|
|
7966
7966
|
background: (Me = U.background) != null ? Me : void 0,
|
|
7967
7967
|
outputFormat: ($ = U.output_format) != null ? $ : void 0,
|
|
7968
7968
|
...pl(
|
|
7969
7969
|
(ge = U.usage) == null ? void 0 : ge.input_tokens_details,
|
|
7970
|
-
|
|
7970
|
+
Te,
|
|
7971
7971
|
U.data.length
|
|
7972
7972
|
)
|
|
7973
7973
|
};
|
|
@@ -8023,7 +8023,7 @@ var Yu = Le(
|
|
|
8023
8023
|
), Ku = Le(
|
|
8024
8024
|
() => Be(
|
|
8025
8025
|
S({
|
|
8026
|
-
status:
|
|
8026
|
+
status: Se(["completed", "failed"]),
|
|
8027
8027
|
output: w().optional()
|
|
8028
8028
|
})
|
|
8029
8029
|
)
|
|
@@ -8072,7 +8072,7 @@ var Yu = Le(
|
|
|
8072
8072
|
format: nt([
|
|
8073
8073
|
S({
|
|
8074
8074
|
type: G("grammar"),
|
|
8075
|
-
syntax:
|
|
8075
|
+
syntax: Se(["regex", "lark"]),
|
|
8076
8076
|
definition: w()
|
|
8077
8077
|
}),
|
|
8078
8078
|
S({
|
|
@@ -8086,10 +8086,10 @@ var Yu = Le(
|
|
|
8086
8086
|
inputSchema: q2
|
|
8087
8087
|
}), K2 = (t) => Y2(t), Ju = S({
|
|
8088
8088
|
key: w(),
|
|
8089
|
-
type:
|
|
8089
|
+
type: Se(["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"]),
|
|
8090
8090
|
value: nt([w(), W(), Ft(), ce(w())])
|
|
8091
8091
|
}), Qu = S({
|
|
8092
|
-
type:
|
|
8092
|
+
type: Se(["and", "or"]),
|
|
8093
8093
|
filters: ce(
|
|
8094
8094
|
nt([Ju, Cs(() => Qu)])
|
|
8095
8095
|
)
|
|
@@ -8127,19 +8127,19 @@ var Yu = Le(
|
|
|
8127
8127
|
}), tx = Le(
|
|
8128
8128
|
() => Be(
|
|
8129
8129
|
S({
|
|
8130
|
-
background:
|
|
8131
|
-
inputFidelity:
|
|
8130
|
+
background: Se(["auto", "opaque", "transparent"]).optional(),
|
|
8131
|
+
inputFidelity: Se(["low", "high"]).optional(),
|
|
8132
8132
|
inputImageMask: S({
|
|
8133
8133
|
fileId: w().optional(),
|
|
8134
8134
|
imageUrl: w().optional()
|
|
8135
8135
|
}).optional(),
|
|
8136
8136
|
model: w().optional(),
|
|
8137
|
-
moderation:
|
|
8137
|
+
moderation: Se(["auto"]).optional(),
|
|
8138
8138
|
outputCompression: W().int().min(0).max(100).optional(),
|
|
8139
|
-
outputFormat:
|
|
8139
|
+
outputFormat: Se(["png", "jpeg", "webp"]).optional(),
|
|
8140
8140
|
partialImages: W().int().min(0).max(3).optional(),
|
|
8141
|
-
quality:
|
|
8142
|
-
size:
|
|
8141
|
+
quality: Se(["auto", "low", "medium", "high"]).optional(),
|
|
8142
|
+
size: Se(["1024x1024", "1024x1536", "1536x1024", "auto"]).optional()
|
|
8143
8143
|
}).strict()
|
|
8144
8144
|
)
|
|
8145
8145
|
), nx = Le(() => Be(S({}))), rx = Le(
|
|
@@ -8217,7 +8217,7 @@ var Yu = Le(
|
|
|
8217
8217
|
S({
|
|
8218
8218
|
type: G("containerAuto"),
|
|
8219
8219
|
fileIds: ce(w()).optional(),
|
|
8220
|
-
memoryLimit:
|
|
8220
|
+
memoryLimit: Se(["1g", "4g", "16g", "64g"]).optional(),
|
|
8221
8221
|
networkPolicy: gt("type", [
|
|
8222
8222
|
S({ type: G("disabled") }),
|
|
8223
8223
|
S({
|
|
@@ -8258,7 +8258,7 @@ var Yu = Le(
|
|
|
8258
8258
|
}), ux = Le(
|
|
8259
8259
|
() => Be(
|
|
8260
8260
|
S({
|
|
8261
|
-
execution:
|
|
8261
|
+
execution: Se(["server", "client"]).optional(),
|
|
8262
8262
|
description: w().optional(),
|
|
8263
8263
|
parameters: yt(w(), Mn()).optional()
|
|
8264
8264
|
})
|
|
@@ -8285,7 +8285,7 @@ var Yu = Le(
|
|
|
8285
8285
|
S({
|
|
8286
8286
|
externalWebAccess: Ft().optional(),
|
|
8287
8287
|
filters: S({ allowedDomains: ce(w()).optional() }).optional(),
|
|
8288
|
-
searchContextSize:
|
|
8288
|
+
searchContextSize: Se(["low", "medium", "high"]).optional(),
|
|
8289
8289
|
userLocation: S({
|
|
8290
8290
|
type: G("approximate"),
|
|
8291
8291
|
country: w().optional(),
|
|
@@ -8328,7 +8328,7 @@ var Yu = Le(
|
|
|
8328
8328
|
}), xx = (t = {}) => mx(t), yx = Le(
|
|
8329
8329
|
() => Be(
|
|
8330
8330
|
S({
|
|
8331
|
-
searchContextSize:
|
|
8331
|
+
searchContextSize: Se(["low", "medium", "high"]).optional(),
|
|
8332
8332
|
userLocation: S({
|
|
8333
8333
|
type: G("approximate"),
|
|
8334
8334
|
country: w().optional(),
|
|
@@ -8388,7 +8388,7 @@ var Yu = Le(
|
|
|
8388
8388
|
connectorId: w().optional(),
|
|
8389
8389
|
headers: yt(w(), w()).optional(),
|
|
8390
8390
|
requireApproval: nt([
|
|
8391
|
-
|
|
8391
|
+
Se(["always", "never"]),
|
|
8392
8392
|
S({
|
|
8393
8393
|
never: S({
|
|
8394
8394
|
toolNames: ce(w()).optional()
|
|
@@ -8582,19 +8582,19 @@ async function Tx({
|
|
|
8582
8582
|
hasApplyPatchTool: x = !1,
|
|
8583
8583
|
customProviderToolNames: A
|
|
8584
8584
|
}) {
|
|
8585
|
-
var _, D, N, R, M, P, j, Z, F, J, Y, z, U,
|
|
8586
|
-
let
|
|
8585
|
+
var _, D, N, R, M, P, j, Z, F, J, Y, z, U, ee, I, Te, ye;
|
|
8586
|
+
let ne = [];
|
|
8587
8587
|
const me = [], Me = /* @__PURE__ */ new Set();
|
|
8588
8588
|
for (const { role: $, content: ge } of t)
|
|
8589
8589
|
switch ($) {
|
|
8590
8590
|
case "system": {
|
|
8591
8591
|
switch (o) {
|
|
8592
8592
|
case "system": {
|
|
8593
|
-
|
|
8593
|
+
ne.push({ role: "system", content: ge });
|
|
8594
8594
|
break;
|
|
8595
8595
|
}
|
|
8596
8596
|
case "developer": {
|
|
8597
|
-
|
|
8597
|
+
ne.push({ role: "developer", content: ge });
|
|
8598
8598
|
break;
|
|
8599
8599
|
}
|
|
8600
8600
|
case "remove": {
|
|
@@ -8605,46 +8605,46 @@ async function Tx({
|
|
|
8605
8605
|
break;
|
|
8606
8606
|
}
|
|
8607
8607
|
default: {
|
|
8608
|
-
const
|
|
8608
|
+
const te = o;
|
|
8609
8609
|
throw new Error(
|
|
8610
|
-
`Unsupported system message mode: ${
|
|
8610
|
+
`Unsupported system message mode: ${te}`
|
|
8611
8611
|
);
|
|
8612
8612
|
}
|
|
8613
8613
|
}
|
|
8614
8614
|
break;
|
|
8615
8615
|
}
|
|
8616
8616
|
case "user": {
|
|
8617
|
-
|
|
8617
|
+
ne.push({
|
|
8618
8618
|
role: "user",
|
|
8619
|
-
content: ge.map((
|
|
8620
|
-
var pe, de,
|
|
8621
|
-
switch (
|
|
8619
|
+
content: ge.map((te, K) => {
|
|
8620
|
+
var pe, de, re;
|
|
8621
|
+
switch (te.type) {
|
|
8622
8622
|
case "text":
|
|
8623
|
-
return { type: "input_text", text:
|
|
8623
|
+
return { type: "input_text", text: te.text };
|
|
8624
8624
|
case "file":
|
|
8625
|
-
if (
|
|
8626
|
-
const he =
|
|
8625
|
+
if (te.mediaType.startsWith("image/")) {
|
|
8626
|
+
const he = te.mediaType === "image/*" ? "image/jpeg" : te.mediaType;
|
|
8627
8627
|
return {
|
|
8628
8628
|
type: "input_image",
|
|
8629
|
-
...
|
|
8630
|
-
image_url: `data:${he};base64,${zr(
|
|
8629
|
+
...te.data instanceof URL ? { image_url: te.data.toString() } : typeof te.data == "string" && ml(te.data, u) ? { file_id: te.data } : {
|
|
8630
|
+
image_url: `data:${he};base64,${zr(te.data)}`
|
|
8631
8631
|
},
|
|
8632
|
-
detail: (de = (pe =
|
|
8632
|
+
detail: (de = (pe = te.providerOptions) == null ? void 0 : pe[c]) == null ? void 0 : de.imageDetail
|
|
8633
8633
|
};
|
|
8634
8634
|
} else {
|
|
8635
|
-
if (
|
|
8636
|
-
return
|
|
8635
|
+
if (te.mediaType === "application/pdf")
|
|
8636
|
+
return te.data instanceof URL ? {
|
|
8637
8637
|
type: "input_file",
|
|
8638
|
-
file_url:
|
|
8638
|
+
file_url: te.data.toString()
|
|
8639
8639
|
} : {
|
|
8640
8640
|
type: "input_file",
|
|
8641
|
-
...typeof
|
|
8642
|
-
filename: (
|
|
8643
|
-
file_data: `data:application/pdf;base64,${zr(
|
|
8641
|
+
...typeof te.data == "string" && ml(te.data, u) ? { file_id: te.data } : {
|
|
8642
|
+
filename: (re = te.filename) != null ? re : `part-${K}.pdf`,
|
|
8643
|
+
file_data: `data:application/pdf;base64,${zr(te.data)}`
|
|
8644
8644
|
}
|
|
8645
8645
|
};
|
|
8646
8646
|
throw new Kn({
|
|
8647
|
-
functionality: `file part media type ${
|
|
8647
|
+
functionality: `file part media type ${te.mediaType}`
|
|
8648
8648
|
});
|
|
8649
8649
|
}
|
|
8650
8650
|
}
|
|
@@ -8653,22 +8653,22 @@ async function Tx({
|
|
|
8653
8653
|
break;
|
|
8654
8654
|
}
|
|
8655
8655
|
case "assistant": {
|
|
8656
|
-
const
|
|
8656
|
+
const te = {};
|
|
8657
8657
|
for (const K of ge)
|
|
8658
8658
|
switch (K.type) {
|
|
8659
8659
|
case "text": {
|
|
8660
|
-
const pe = (_ = K.providerOptions) == null ? void 0 : _[c], de = pe?.itemId,
|
|
8660
|
+
const pe = (_ = K.providerOptions) == null ? void 0 : _[c], de = pe?.itemId, re = pe?.phase;
|
|
8661
8661
|
if (g && de != null)
|
|
8662
8662
|
break;
|
|
8663
8663
|
if (f && de != null) {
|
|
8664
|
-
|
|
8664
|
+
ne.push({ type: "item_reference", id: de });
|
|
8665
8665
|
break;
|
|
8666
8666
|
}
|
|
8667
|
-
|
|
8667
|
+
ne.push({
|
|
8668
8668
|
role: "assistant",
|
|
8669
8669
|
content: [{ type: "output_text", text: K.text }],
|
|
8670
8670
|
id: de,
|
|
8671
|
-
...
|
|
8671
|
+
...re != null && { phase: re }
|
|
8672
8672
|
});
|
|
8673
8673
|
break;
|
|
8674
8674
|
}
|
|
@@ -8681,88 +8681,88 @@ async function Tx({
|
|
|
8681
8681
|
);
|
|
8682
8682
|
if (de === "tool_search") {
|
|
8683
8683
|
if (f && pe != null) {
|
|
8684
|
-
|
|
8684
|
+
ne.push({ type: "item_reference", id: pe });
|
|
8685
8685
|
break;
|
|
8686
8686
|
}
|
|
8687
|
-
const
|
|
8687
|
+
const re = typeof K.input == "string" ? await Wu({
|
|
8688
8688
|
text: K.input,
|
|
8689
8689
|
schema: ns
|
|
8690
8690
|
}) : await Lt({
|
|
8691
8691
|
value: K.input,
|
|
8692
8692
|
schema: ns
|
|
8693
|
-
}), he =
|
|
8694
|
-
|
|
8693
|
+
}), he = re.call_id != null ? "client" : "server";
|
|
8694
|
+
ne.push({
|
|
8695
8695
|
type: "tool_search_call",
|
|
8696
8696
|
id: pe ?? K.toolCallId,
|
|
8697
8697
|
execution: he,
|
|
8698
|
-
call_id: (j =
|
|
8698
|
+
call_id: (j = re.call_id) != null ? j : null,
|
|
8699
8699
|
status: "completed",
|
|
8700
|
-
arguments:
|
|
8700
|
+
arguments: re.arguments
|
|
8701
8701
|
});
|
|
8702
8702
|
break;
|
|
8703
8703
|
}
|
|
8704
8704
|
if (K.providerExecuted) {
|
|
8705
|
-
f && pe != null &&
|
|
8705
|
+
f && pe != null && ne.push({ type: "item_reference", id: pe });
|
|
8706
8706
|
break;
|
|
8707
8707
|
}
|
|
8708
8708
|
if (f && pe != null) {
|
|
8709
|
-
|
|
8709
|
+
ne.push({ type: "item_reference", id: pe });
|
|
8710
8710
|
break;
|
|
8711
8711
|
}
|
|
8712
8712
|
if (m && de === "local_shell") {
|
|
8713
|
-
const
|
|
8713
|
+
const re = await Lt({
|
|
8714
8714
|
value: K.input,
|
|
8715
8715
|
schema: ed
|
|
8716
8716
|
});
|
|
8717
|
-
|
|
8717
|
+
ne.push({
|
|
8718
8718
|
type: "local_shell_call",
|
|
8719
8719
|
call_id: K.toolCallId,
|
|
8720
8720
|
id: pe,
|
|
8721
8721
|
action: {
|
|
8722
8722
|
type: "exec",
|
|
8723
|
-
command:
|
|
8724
|
-
timeout_ms:
|
|
8725
|
-
user:
|
|
8726
|
-
working_directory:
|
|
8727
|
-
env:
|
|
8723
|
+
command: re.action.command,
|
|
8724
|
+
timeout_ms: re.action.timeoutMs,
|
|
8725
|
+
user: re.action.user,
|
|
8726
|
+
working_directory: re.action.workingDirectory,
|
|
8727
|
+
env: re.action.env
|
|
8728
8728
|
}
|
|
8729
8729
|
});
|
|
8730
8730
|
break;
|
|
8731
8731
|
}
|
|
8732
8732
|
if (v && de === "shell") {
|
|
8733
|
-
const
|
|
8733
|
+
const re = await Lt({
|
|
8734
8734
|
value: K.input,
|
|
8735
8735
|
schema: nd
|
|
8736
8736
|
});
|
|
8737
|
-
|
|
8737
|
+
ne.push({
|
|
8738
8738
|
type: "shell_call",
|
|
8739
8739
|
call_id: K.toolCallId,
|
|
8740
8740
|
id: pe,
|
|
8741
8741
|
status: "completed",
|
|
8742
8742
|
action: {
|
|
8743
|
-
commands:
|
|
8744
|
-
timeout_ms:
|
|
8745
|
-
max_output_length:
|
|
8743
|
+
commands: re.action.commands,
|
|
8744
|
+
timeout_ms: re.action.timeoutMs,
|
|
8745
|
+
max_output_length: re.action.maxOutputLength
|
|
8746
8746
|
}
|
|
8747
8747
|
});
|
|
8748
8748
|
break;
|
|
8749
8749
|
}
|
|
8750
8750
|
if (x && de === "apply_patch") {
|
|
8751
|
-
const
|
|
8751
|
+
const re = await Lt({
|
|
8752
8752
|
value: K.input,
|
|
8753
8753
|
schema: Yu
|
|
8754
8754
|
});
|
|
8755
|
-
|
|
8755
|
+
ne.push({
|
|
8756
8756
|
type: "apply_patch_call",
|
|
8757
|
-
call_id:
|
|
8757
|
+
call_id: re.callId,
|
|
8758
8758
|
id: pe,
|
|
8759
8759
|
status: "completed",
|
|
8760
|
-
operation:
|
|
8760
|
+
operation: re.operation
|
|
8761
8761
|
});
|
|
8762
8762
|
break;
|
|
8763
8763
|
}
|
|
8764
8764
|
if (A?.has(de)) {
|
|
8765
|
-
|
|
8765
|
+
ne.push({
|
|
8766
8766
|
type: "custom_tool_call",
|
|
8767
8767
|
call_id: K.toolCallId,
|
|
8768
8768
|
name: de,
|
|
@@ -8771,7 +8771,7 @@ async function Tx({
|
|
|
8771
8771
|
});
|
|
8772
8772
|
break;
|
|
8773
8773
|
}
|
|
8774
|
-
|
|
8774
|
+
ne.push({
|
|
8775
8775
|
type: "function_call",
|
|
8776
8776
|
call_id: K.toolCallId,
|
|
8777
8777
|
name: de,
|
|
@@ -8790,19 +8790,19 @@ async function Tx({
|
|
|
8790
8790
|
if (pe === "tool_search") {
|
|
8791
8791
|
const de = (J = (F = (Z = K.providerOptions) == null ? void 0 : Z[c]) == null ? void 0 : F.itemId) != null ? J : K.toolCallId;
|
|
8792
8792
|
if (f)
|
|
8793
|
-
|
|
8793
|
+
ne.push({ type: "item_reference", id: de });
|
|
8794
8794
|
else if (K.output.type === "json") {
|
|
8795
|
-
const
|
|
8795
|
+
const re = await Lt({
|
|
8796
8796
|
value: K.output.value,
|
|
8797
8797
|
schema: rs
|
|
8798
8798
|
});
|
|
8799
|
-
|
|
8799
|
+
ne.push({
|
|
8800
8800
|
type: "tool_search_output",
|
|
8801
8801
|
id: de,
|
|
8802
8802
|
execution: "server",
|
|
8803
8803
|
call_id: null,
|
|
8804
8804
|
status: "completed",
|
|
8805
|
-
tools:
|
|
8805
|
+
tools: re.tools
|
|
8806
8806
|
});
|
|
8807
8807
|
}
|
|
8808
8808
|
break;
|
|
@@ -8813,15 +8813,15 @@ async function Tx({
|
|
|
8813
8813
|
value: K.output.value,
|
|
8814
8814
|
schema: ts
|
|
8815
8815
|
});
|
|
8816
|
-
|
|
8816
|
+
ne.push({
|
|
8817
8817
|
type: "shell_call_output",
|
|
8818
8818
|
call_id: K.toolCallId,
|
|
8819
|
-
output: de.output.map((
|
|
8820
|
-
stdout:
|
|
8821
|
-
stderr:
|
|
8822
|
-
outcome:
|
|
8819
|
+
output: de.output.map((re) => ({
|
|
8820
|
+
stdout: re.stdout,
|
|
8821
|
+
stderr: re.stderr,
|
|
8822
|
+
outcome: re.outcome.type === "timeout" ? { type: "timeout" } : {
|
|
8823
8823
|
type: "exit",
|
|
8824
|
-
exit_code:
|
|
8824
|
+
exit_code: re.outcome.exitCode
|
|
8825
8825
|
}
|
|
8826
8826
|
}))
|
|
8827
8827
|
});
|
|
@@ -8830,7 +8830,7 @@ async function Tx({
|
|
|
8830
8830
|
}
|
|
8831
8831
|
if (f) {
|
|
8832
8832
|
const de = (U = (z = (Y = K.providerOptions) == null ? void 0 : Y[c]) == null ? void 0 : z.itemId) != null ? U : K.toolCallId;
|
|
8833
|
-
|
|
8833
|
+
ne.push({ type: "item_reference", id: de });
|
|
8834
8834
|
} else
|
|
8835
8835
|
me.push({
|
|
8836
8836
|
type: "other",
|
|
@@ -8847,9 +8847,9 @@ async function Tx({
|
|
|
8847
8847
|
if (g && de != null)
|
|
8848
8848
|
break;
|
|
8849
8849
|
if (de != null) {
|
|
8850
|
-
const
|
|
8850
|
+
const re = te[de];
|
|
8851
8851
|
if (f)
|
|
8852
|
-
|
|
8852
|
+
re === void 0 && (ne.push({ type: "item_reference", id: de }), te[de] = {
|
|
8853
8853
|
type: "reasoning",
|
|
8854
8854
|
id: de,
|
|
8855
8855
|
summary: []
|
|
@@ -8859,26 +8859,26 @@ async function Tx({
|
|
|
8859
8859
|
K.text.length > 0 ? he.push({
|
|
8860
8860
|
type: "summary_text",
|
|
8861
8861
|
text: K.text
|
|
8862
|
-
}) :
|
|
8862
|
+
}) : re !== void 0 && me.push({
|
|
8863
8863
|
type: "other",
|
|
8864
8864
|
message: `Cannot append empty reasoning part to existing reasoning sequence. Skipping reasoning part: ${JSON.stringify(K)}.`
|
|
8865
|
-
}),
|
|
8865
|
+
}), re === void 0 ? (te[de] = {
|
|
8866
8866
|
type: "reasoning",
|
|
8867
8867
|
id: de,
|
|
8868
8868
|
encrypted_content: pe?.reasoningEncryptedContent,
|
|
8869
8869
|
summary: he
|
|
8870
|
-
},
|
|
8870
|
+
}, ne.push(te[de])) : (re.summary.push(...he), pe?.reasoningEncryptedContent != null && (re.encrypted_content = pe.reasoningEncryptedContent));
|
|
8871
8871
|
}
|
|
8872
8872
|
} else {
|
|
8873
|
-
const
|
|
8874
|
-
if (
|
|
8873
|
+
const re = pe?.reasoningEncryptedContent;
|
|
8874
|
+
if (re != null) {
|
|
8875
8875
|
const he = [];
|
|
8876
8876
|
K.text.length > 0 && he.push({
|
|
8877
8877
|
type: "summary_text",
|
|
8878
8878
|
text: K.text
|
|
8879
|
-
}),
|
|
8879
|
+
}), ne.push({
|
|
8880
8880
|
type: "reasoning",
|
|
8881
|
-
encrypted_content:
|
|
8881
|
+
encrypted_content: re,
|
|
8882
8882
|
summary: he
|
|
8883
8883
|
});
|
|
8884
8884
|
} else
|
|
@@ -8893,62 +8893,62 @@ async function Tx({
|
|
|
8893
8893
|
break;
|
|
8894
8894
|
}
|
|
8895
8895
|
case "tool": {
|
|
8896
|
-
for (const
|
|
8897
|
-
if (
|
|
8898
|
-
const
|
|
8899
|
-
if (Me.has(
|
|
8896
|
+
for (const te of ge) {
|
|
8897
|
+
if (te.type === "tool-approval-response") {
|
|
8898
|
+
const re = te;
|
|
8899
|
+
if (Me.has(re.approvalId))
|
|
8900
8900
|
continue;
|
|
8901
|
-
Me.add(
|
|
8901
|
+
Me.add(re.approvalId), f && ne.push({
|
|
8902
8902
|
type: "item_reference",
|
|
8903
|
-
id:
|
|
8904
|
-
}),
|
|
8903
|
+
id: re.approvalId
|
|
8904
|
+
}), ne.push({
|
|
8905
8905
|
type: "mcp_approval_response",
|
|
8906
|
-
approval_request_id:
|
|
8907
|
-
approve:
|
|
8906
|
+
approval_request_id: re.approvalId,
|
|
8907
|
+
approve: re.approved
|
|
8908
8908
|
});
|
|
8909
8909
|
continue;
|
|
8910
8910
|
}
|
|
8911
|
-
const K =
|
|
8912
|
-
if (K.type === "execution-denied" && ((I = (
|
|
8911
|
+
const K = te.output;
|
|
8912
|
+
if (K.type === "execution-denied" && ((I = (ee = K.providerOptions) == null ? void 0 : ee.openai) == null ? void 0 : I.approvalId))
|
|
8913
8913
|
continue;
|
|
8914
8914
|
const pe = r.toProviderToolName(
|
|
8915
|
-
|
|
8915
|
+
te.toolName
|
|
8916
8916
|
);
|
|
8917
8917
|
if (pe === "tool_search" && K.type === "json") {
|
|
8918
|
-
const
|
|
8918
|
+
const re = await Lt({
|
|
8919
8919
|
value: K.value,
|
|
8920
8920
|
schema: rs
|
|
8921
8921
|
});
|
|
8922
|
-
|
|
8922
|
+
ne.push({
|
|
8923
8923
|
type: "tool_search_output",
|
|
8924
8924
|
execution: "client",
|
|
8925
|
-
call_id:
|
|
8925
|
+
call_id: te.toolCallId,
|
|
8926
8926
|
status: "completed",
|
|
8927
|
-
tools:
|
|
8927
|
+
tools: re.tools
|
|
8928
8928
|
});
|
|
8929
8929
|
continue;
|
|
8930
8930
|
}
|
|
8931
8931
|
if (m && pe === "local_shell" && K.type === "json") {
|
|
8932
|
-
const
|
|
8932
|
+
const re = await Lt({
|
|
8933
8933
|
value: K.value,
|
|
8934
8934
|
schema: td
|
|
8935
8935
|
});
|
|
8936
|
-
|
|
8936
|
+
ne.push({
|
|
8937
8937
|
type: "local_shell_call_output",
|
|
8938
|
-
call_id:
|
|
8939
|
-
output:
|
|
8938
|
+
call_id: te.toolCallId,
|
|
8939
|
+
output: re.output
|
|
8940
8940
|
});
|
|
8941
8941
|
continue;
|
|
8942
8942
|
}
|
|
8943
8943
|
if (v && pe === "shell" && K.type === "json") {
|
|
8944
|
-
const
|
|
8944
|
+
const re = await Lt({
|
|
8945
8945
|
value: K.value,
|
|
8946
8946
|
schema: ts
|
|
8947
8947
|
});
|
|
8948
|
-
|
|
8948
|
+
ne.push({
|
|
8949
8949
|
type: "shell_call_output",
|
|
8950
|
-
call_id:
|
|
8951
|
-
output:
|
|
8950
|
+
call_id: te.toolCallId,
|
|
8951
|
+
output: re.output.map((he) => ({
|
|
8952
8952
|
stdout: he.stdout,
|
|
8953
8953
|
stderr: he.stderr,
|
|
8954
8954
|
outcome: he.outcome.type === "timeout" ? { type: "timeout" } : {
|
|
@@ -8959,35 +8959,35 @@ async function Tx({
|
|
|
8959
8959
|
});
|
|
8960
8960
|
continue;
|
|
8961
8961
|
}
|
|
8962
|
-
if (x &&
|
|
8963
|
-
const
|
|
8962
|
+
if (x && te.toolName === "apply_patch" && K.type === "json") {
|
|
8963
|
+
const re = await Lt({
|
|
8964
8964
|
value: K.value,
|
|
8965
8965
|
schema: Ku
|
|
8966
8966
|
});
|
|
8967
|
-
|
|
8967
|
+
ne.push({
|
|
8968
8968
|
type: "apply_patch_call_output",
|
|
8969
|
-
call_id:
|
|
8970
|
-
status:
|
|
8971
|
-
output:
|
|
8969
|
+
call_id: te.toolCallId,
|
|
8970
|
+
status: re.status,
|
|
8971
|
+
output: re.output
|
|
8972
8972
|
});
|
|
8973
8973
|
continue;
|
|
8974
8974
|
}
|
|
8975
8975
|
if (A?.has(pe)) {
|
|
8976
|
-
let
|
|
8976
|
+
let re;
|
|
8977
8977
|
switch (K.type) {
|
|
8978
8978
|
case "text":
|
|
8979
8979
|
case "error-text":
|
|
8980
|
-
|
|
8980
|
+
re = K.value;
|
|
8981
8981
|
break;
|
|
8982
8982
|
case "execution-denied":
|
|
8983
|
-
|
|
8983
|
+
re = (Te = K.reason) != null ? Te : "Tool execution denied.";
|
|
8984
8984
|
break;
|
|
8985
8985
|
case "json":
|
|
8986
8986
|
case "error-json":
|
|
8987
|
-
|
|
8987
|
+
re = JSON.stringify(K.value);
|
|
8988
8988
|
break;
|
|
8989
8989
|
case "content":
|
|
8990
|
-
|
|
8990
|
+
re = K.value.map((he) => {
|
|
8991
8991
|
var It;
|
|
8992
8992
|
switch (he.type) {
|
|
8993
8993
|
case "text":
|
|
@@ -9008,6 +9008,11 @@ async function Tx({
|
|
|
9008
9008
|
filename: (It = he.filename) != null ? It : "data",
|
|
9009
9009
|
file_data: `data:${he.mediaType};base64,${he.data}`
|
|
9010
9010
|
};
|
|
9011
|
+
case "file-url":
|
|
9012
|
+
return {
|
|
9013
|
+
type: "input_file",
|
|
9014
|
+
file_url: he.url
|
|
9015
|
+
};
|
|
9011
9016
|
default:
|
|
9012
9017
|
me.push({
|
|
9013
9018
|
type: "other",
|
|
@@ -9018,12 +9023,12 @@ async function Tx({
|
|
|
9018
9023
|
}).filter(nl);
|
|
9019
9024
|
break;
|
|
9020
9025
|
default:
|
|
9021
|
-
|
|
9026
|
+
re = "";
|
|
9022
9027
|
}
|
|
9023
|
-
|
|
9028
|
+
ne.push({
|
|
9024
9029
|
type: "custom_tool_call_output",
|
|
9025
|
-
call_id:
|
|
9026
|
-
output:
|
|
9030
|
+
call_id: te.toolCallId,
|
|
9031
|
+
output: re
|
|
9027
9032
|
});
|
|
9028
9033
|
continue;
|
|
9029
9034
|
}
|
|
@@ -9034,38 +9039,43 @@ async function Tx({
|
|
|
9034
9039
|
de = K.value;
|
|
9035
9040
|
break;
|
|
9036
9041
|
case "execution-denied":
|
|
9037
|
-
de = (
|
|
9042
|
+
de = (ye = K.reason) != null ? ye : "Tool execution denied.";
|
|
9038
9043
|
break;
|
|
9039
9044
|
case "json":
|
|
9040
9045
|
case "error-json":
|
|
9041
9046
|
de = JSON.stringify(K.value);
|
|
9042
9047
|
break;
|
|
9043
9048
|
case "content":
|
|
9044
|
-
de = K.value.map((
|
|
9049
|
+
de = K.value.map((re) => {
|
|
9045
9050
|
var he;
|
|
9046
|
-
switch (
|
|
9051
|
+
switch (re.type) {
|
|
9047
9052
|
case "text":
|
|
9048
|
-
return { type: "input_text", text:
|
|
9053
|
+
return { type: "input_text", text: re.text };
|
|
9049
9054
|
case "image-data":
|
|
9050
9055
|
return {
|
|
9051
9056
|
type: "input_image",
|
|
9052
|
-
image_url: `data:${
|
|
9057
|
+
image_url: `data:${re.mediaType};base64,${re.data}`
|
|
9053
9058
|
};
|
|
9054
9059
|
case "image-url":
|
|
9055
9060
|
return {
|
|
9056
9061
|
type: "input_image",
|
|
9057
|
-
image_url:
|
|
9062
|
+
image_url: re.url
|
|
9058
9063
|
};
|
|
9059
9064
|
case "file-data":
|
|
9060
9065
|
return {
|
|
9061
9066
|
type: "input_file",
|
|
9062
|
-
filename: (he =
|
|
9063
|
-
file_data: `data:${
|
|
9067
|
+
filename: (he = re.filename) != null ? he : "data",
|
|
9068
|
+
file_data: `data:${re.mediaType};base64,${re.data}`
|
|
9069
|
+
};
|
|
9070
|
+
case "file-url":
|
|
9071
|
+
return {
|
|
9072
|
+
type: "input_file",
|
|
9073
|
+
file_url: re.url
|
|
9064
9074
|
};
|
|
9065
9075
|
default: {
|
|
9066
9076
|
me.push({
|
|
9067
9077
|
type: "other",
|
|
9068
|
-
message: `unsupported tool content part type: ${
|
|
9078
|
+
message: `unsupported tool content part type: ${re.type}`
|
|
9069
9079
|
});
|
|
9070
9080
|
return;
|
|
9071
9081
|
}
|
|
@@ -9073,27 +9083,27 @@ async function Tx({
|
|
|
9073
9083
|
}).filter(nl);
|
|
9074
9084
|
break;
|
|
9075
9085
|
}
|
|
9076
|
-
|
|
9086
|
+
ne.push({
|
|
9077
9087
|
type: "function_call_output",
|
|
9078
|
-
call_id:
|
|
9088
|
+
call_id: te.toolCallId,
|
|
9079
9089
|
output: de
|
|
9080
9090
|
});
|
|
9081
9091
|
}
|
|
9082
9092
|
break;
|
|
9083
9093
|
}
|
|
9084
9094
|
default: {
|
|
9085
|
-
const
|
|
9086
|
-
throw new Error(`Unsupported role: ${
|
|
9095
|
+
const te = $;
|
|
9096
|
+
throw new Error(`Unsupported role: ${te}`);
|
|
9087
9097
|
}
|
|
9088
9098
|
}
|
|
9089
|
-
return !f &&
|
|
9099
|
+
return !f && ne.some(
|
|
9090
9100
|
($) => "type" in $ && $.type === "reasoning" && $.encrypted_content == null
|
|
9091
9101
|
) && (me.push({
|
|
9092
9102
|
type: "other",
|
|
9093
9103
|
message: "Reasoning parts without encrypted content are not supported when store is false. Skipping reasoning parts."
|
|
9094
|
-
}),
|
|
9104
|
+
}), ne = ne.filter(
|
|
9095
9105
|
($) => !("type" in $) || $.type !== "reasoning" || $.encrypted_content != null
|
|
9096
|
-
)), { input:
|
|
9106
|
+
)), { input: ne, warnings: me };
|
|
9097
9107
|
}
|
|
9098
9108
|
var Nx = S({
|
|
9099
9109
|
itemId: w().nullish(),
|
|
@@ -9145,7 +9155,7 @@ var gi = Cs(
|
|
|
9145
9155
|
).nullish()
|
|
9146
9156
|
}),
|
|
9147
9157
|
S({
|
|
9148
|
-
type:
|
|
9158
|
+
type: Se(["response.completed", "response.incomplete"]),
|
|
9149
9159
|
response: S({
|
|
9150
9160
|
incomplete_details: S({ reason: w() }).nullish(),
|
|
9151
9161
|
usage: S({
|
|
@@ -9190,7 +9200,7 @@ var gi = Cs(
|
|
|
9190
9200
|
S({
|
|
9191
9201
|
type: G("message"),
|
|
9192
9202
|
id: w(),
|
|
9193
|
-
phase:
|
|
9203
|
+
phase: Se(["commentary", "final_answer"]).nullish()
|
|
9194
9204
|
}),
|
|
9195
9205
|
S({
|
|
9196
9206
|
type: G("reasoning"),
|
|
@@ -9253,7 +9263,7 @@ var gi = Cs(
|
|
|
9253
9263
|
type: G("apply_patch_call"),
|
|
9254
9264
|
id: w(),
|
|
9255
9265
|
call_id: w(),
|
|
9256
|
-
status:
|
|
9266
|
+
status: Se(["in_progress", "completed"]),
|
|
9257
9267
|
operation: gt("type", [
|
|
9258
9268
|
S({
|
|
9259
9269
|
type: G("create_file"),
|
|
@@ -9282,7 +9292,7 @@ var gi = Cs(
|
|
|
9282
9292
|
type: G("shell_call"),
|
|
9283
9293
|
id: w(),
|
|
9284
9294
|
call_id: w(),
|
|
9285
|
-
status:
|
|
9295
|
+
status: Se(["in_progress", "completed", "incomplete"]),
|
|
9286
9296
|
action: S({
|
|
9287
9297
|
commands: ce(w())
|
|
9288
9298
|
})
|
|
@@ -9291,7 +9301,7 @@ var gi = Cs(
|
|
|
9291
9301
|
type: G("shell_call_output"),
|
|
9292
9302
|
id: w(),
|
|
9293
9303
|
call_id: w(),
|
|
9294
|
-
status:
|
|
9304
|
+
status: Se(["in_progress", "completed", "incomplete"]),
|
|
9295
9305
|
output: ce(
|
|
9296
9306
|
S({
|
|
9297
9307
|
stdout: w(),
|
|
@@ -9309,17 +9319,17 @@ var gi = Cs(
|
|
|
9309
9319
|
S({
|
|
9310
9320
|
type: G("tool_search_call"),
|
|
9311
9321
|
id: w(),
|
|
9312
|
-
execution:
|
|
9322
|
+
execution: Se(["server", "client"]),
|
|
9313
9323
|
call_id: w().nullable(),
|
|
9314
|
-
status:
|
|
9324
|
+
status: Se(["in_progress", "completed", "incomplete"]),
|
|
9315
9325
|
arguments: Mn()
|
|
9316
9326
|
}),
|
|
9317
9327
|
S({
|
|
9318
9328
|
type: G("tool_search_output"),
|
|
9319
9329
|
id: w(),
|
|
9320
|
-
execution:
|
|
9330
|
+
execution: Se(["server", "client"]),
|
|
9321
9331
|
call_id: w().nullable(),
|
|
9322
|
-
status:
|
|
9332
|
+
status: Se(["in_progress", "completed", "incomplete"]),
|
|
9323
9333
|
tools: ce(yt(w(), gi.optional()))
|
|
9324
9334
|
})
|
|
9325
9335
|
])
|
|
@@ -9331,7 +9341,7 @@ var gi = Cs(
|
|
|
9331
9341
|
S({
|
|
9332
9342
|
type: G("message"),
|
|
9333
9343
|
id: w(),
|
|
9334
|
-
phase:
|
|
9344
|
+
phase: Se(["commentary", "final_answer"]).nullish()
|
|
9335
9345
|
}),
|
|
9336
9346
|
S({
|
|
9337
9347
|
type: G("reasoning"),
|
|
@@ -9483,7 +9493,7 @@ var gi = Cs(
|
|
|
9483
9493
|
type: G("apply_patch_call"),
|
|
9484
9494
|
id: w(),
|
|
9485
9495
|
call_id: w(),
|
|
9486
|
-
status:
|
|
9496
|
+
status: Se(["in_progress", "completed"]),
|
|
9487
9497
|
operation: gt("type", [
|
|
9488
9498
|
S({
|
|
9489
9499
|
type: G("create_file"),
|
|
@@ -9505,7 +9515,7 @@ var gi = Cs(
|
|
|
9505
9515
|
type: G("shell_call"),
|
|
9506
9516
|
id: w(),
|
|
9507
9517
|
call_id: w(),
|
|
9508
|
-
status:
|
|
9518
|
+
status: Se(["in_progress", "completed", "incomplete"]),
|
|
9509
9519
|
action: S({
|
|
9510
9520
|
commands: ce(w())
|
|
9511
9521
|
})
|
|
@@ -9514,7 +9524,7 @@ var gi = Cs(
|
|
|
9514
9524
|
type: G("shell_call_output"),
|
|
9515
9525
|
id: w(),
|
|
9516
9526
|
call_id: w(),
|
|
9517
|
-
status:
|
|
9527
|
+
status: Se(["in_progress", "completed", "incomplete"]),
|
|
9518
9528
|
output: ce(
|
|
9519
9529
|
S({
|
|
9520
9530
|
stdout: w(),
|
|
@@ -9532,17 +9542,17 @@ var gi = Cs(
|
|
|
9532
9542
|
S({
|
|
9533
9543
|
type: G("tool_search_call"),
|
|
9534
9544
|
id: w(),
|
|
9535
|
-
execution:
|
|
9545
|
+
execution: Se(["server", "client"]),
|
|
9536
9546
|
call_id: w().nullable(),
|
|
9537
|
-
status:
|
|
9547
|
+
status: Se(["in_progress", "completed", "incomplete"]),
|
|
9538
9548
|
arguments: Mn()
|
|
9539
9549
|
}),
|
|
9540
9550
|
S({
|
|
9541
9551
|
type: G("tool_search_output"),
|
|
9542
9552
|
id: w(),
|
|
9543
|
-
execution:
|
|
9553
|
+
execution: Se(["server", "client"]),
|
|
9544
9554
|
call_id: w().nullable(),
|
|
9545
|
-
status:
|
|
9555
|
+
status: Se(["in_progress", "completed", "incomplete"]),
|
|
9546
9556
|
tools: ce(yt(w(), gi.optional()))
|
|
9547
9557
|
})
|
|
9548
9558
|
])
|
|
@@ -9672,7 +9682,7 @@ var gi = Cs(
|
|
|
9672
9682
|
type: G("message"),
|
|
9673
9683
|
role: G("assistant"),
|
|
9674
9684
|
id: w(),
|
|
9675
|
-
phase:
|
|
9685
|
+
phase: Se(["commentary", "final_answer"]).nullish(),
|
|
9676
9686
|
content: ce(
|
|
9677
9687
|
S({
|
|
9678
9688
|
type: G("output_text"),
|
|
@@ -9879,7 +9889,7 @@ var gi = Cs(
|
|
|
9879
9889
|
type: G("apply_patch_call"),
|
|
9880
9890
|
id: w(),
|
|
9881
9891
|
call_id: w(),
|
|
9882
|
-
status:
|
|
9892
|
+
status: Se(["in_progress", "completed"]),
|
|
9883
9893
|
operation: gt("type", [
|
|
9884
9894
|
S({
|
|
9885
9895
|
type: G("create_file"),
|
|
@@ -9901,7 +9911,7 @@ var gi = Cs(
|
|
|
9901
9911
|
type: G("shell_call"),
|
|
9902
9912
|
id: w(),
|
|
9903
9913
|
call_id: w(),
|
|
9904
|
-
status:
|
|
9914
|
+
status: Se(["in_progress", "completed", "incomplete"]),
|
|
9905
9915
|
action: S({
|
|
9906
9916
|
commands: ce(w())
|
|
9907
9917
|
})
|
|
@@ -9910,7 +9920,7 @@ var gi = Cs(
|
|
|
9910
9920
|
type: G("shell_call_output"),
|
|
9911
9921
|
id: w(),
|
|
9912
9922
|
call_id: w(),
|
|
9913
|
-
status:
|
|
9923
|
+
status: Se(["in_progress", "completed", "incomplete"]),
|
|
9914
9924
|
output: ce(
|
|
9915
9925
|
S({
|
|
9916
9926
|
stdout: w(),
|
|
@@ -9928,17 +9938,17 @@ var gi = Cs(
|
|
|
9928
9938
|
S({
|
|
9929
9939
|
type: G("tool_search_call"),
|
|
9930
9940
|
id: w(),
|
|
9931
|
-
execution:
|
|
9941
|
+
execution: Se(["server", "client"]),
|
|
9932
9942
|
call_id: w().nullable(),
|
|
9933
|
-
status:
|
|
9943
|
+
status: Se(["in_progress", "completed", "incomplete"]),
|
|
9934
9944
|
arguments: Mn()
|
|
9935
9945
|
}),
|
|
9936
9946
|
S({
|
|
9937
9947
|
type: G("tool_search_output"),
|
|
9938
9948
|
id: w(),
|
|
9939
|
-
execution:
|
|
9949
|
+
execution: Se(["server", "client"]),
|
|
9940
9950
|
call_id: w().nullable(),
|
|
9941
|
-
status:
|
|
9951
|
+
status: Se(["in_progress", "completed", "incomplete"]),
|
|
9942
9952
|
tools: ce(yt(w(), gi.optional()))
|
|
9943
9953
|
})
|
|
9944
9954
|
])
|
|
@@ -9969,7 +9979,7 @@ var gi = Cs(
|
|
|
9969
9979
|
* Example values: 'reasoning.encrypted_content', 'file_search_call.results', 'message.output_text.logprobs'.
|
|
9970
9980
|
*/
|
|
9971
9981
|
include: ce(
|
|
9972
|
-
|
|
9982
|
+
Se([
|
|
9973
9983
|
"reasoning.encrypted_content",
|
|
9974
9984
|
// handled internally by default, only needed for unknown reasoning models
|
|
9975
9985
|
"file_search_call.results",
|
|
@@ -10028,7 +10038,7 @@ var gi = Cs(
|
|
|
10028
10038
|
*
|
|
10029
10039
|
* @default 'in_memory'
|
|
10030
10040
|
*/
|
|
10031
|
-
promptCacheRetention:
|
|
10041
|
+
promptCacheRetention: Se(["in_memory", "24h"]).nullish(),
|
|
10032
10042
|
/**
|
|
10033
10043
|
* Reasoning effort for reasoning models. Defaults to `medium`. If you use
|
|
10034
10044
|
* `providerOptions` to set the `reasoningEffort` option, this model setting will be ignored.
|
|
@@ -10057,7 +10067,7 @@ var gi = Cs(
|
|
|
10057
10067
|
*
|
|
10058
10068
|
* Defaults to 'auto'.
|
|
10059
10069
|
*/
|
|
10060
|
-
serviceTier:
|
|
10070
|
+
serviceTier: Se(["auto", "flex", "priority", "default"]).nullish(),
|
|
10061
10071
|
/**
|
|
10062
10072
|
* Whether to store the generation. Defaults to `true`.
|
|
10063
10073
|
*/
|
|
@@ -10072,12 +10082,12 @@ var gi = Cs(
|
|
|
10072
10082
|
* in more concise responses, while higher values ('high') will result in more verbose responses.
|
|
10073
10083
|
* Valid values: 'low', 'medium', 'high'.
|
|
10074
10084
|
*/
|
|
10075
|
-
textVerbosity:
|
|
10085
|
+
textVerbosity: Se(["low", "medium", "high"]).nullish(),
|
|
10076
10086
|
/**
|
|
10077
10087
|
* Controls output truncation. 'auto' (default) performs truncation automatically;
|
|
10078
10088
|
* 'disabled' turns truncation off.
|
|
10079
10089
|
*/
|
|
10080
|
-
truncation:
|
|
10090
|
+
truncation: Se(["auto", "disabled"]).nullish(),
|
|
10081
10091
|
/**
|
|
10082
10092
|
* A unique identifier representing your end-user, which can help OpenAI to
|
|
10083
10093
|
* monitor and detect abuse.
|
|
@@ -10093,7 +10103,7 @@ var gi = Cs(
|
|
|
10093
10103
|
*
|
|
10094
10104
|
* If not specified, the mode is automatically determined based on the model.
|
|
10095
10105
|
*/
|
|
10096
|
-
systemMessageMode:
|
|
10106
|
+
systemMessageMode: Se(["system", "developer", "remove"]).optional(),
|
|
10097
10107
|
/**
|
|
10098
10108
|
* Force treating this model as a reasoning model.
|
|
10099
10109
|
*
|
|
@@ -10403,24 +10413,24 @@ var Px = class {
|
|
|
10403
10413
|
var N, R, M, P, j, Z, F, J, Y;
|
|
10404
10414
|
const z = [], U = qu(this.modelId);
|
|
10405
10415
|
u != null && z.push({ type: "unsupported", feature: "topK" }), m != null && z.push({ type: "unsupported", feature: "seed" }), f != null && z.push({ type: "unsupported", feature: "presencePenalty" }), g != null && z.push({ type: "unsupported", feature: "frequencyPenalty" }), o != null && z.push({ type: "unsupported", feature: "stopSequences" });
|
|
10406
|
-
const
|
|
10416
|
+
const ee = this.config.provider.includes("azure") ? "azure" : "openai";
|
|
10407
10417
|
let I = await Jn({
|
|
10408
|
-
provider:
|
|
10418
|
+
provider: ee,
|
|
10409
10419
|
providerOptions: x,
|
|
10410
10420
|
schema: xl
|
|
10411
10421
|
});
|
|
10412
|
-
I == null &&
|
|
10422
|
+
I == null && ee !== "openai" && (I = await Jn({
|
|
10413
10423
|
provider: "openai",
|
|
10414
10424
|
providerOptions: x,
|
|
10415
10425
|
schema: xl
|
|
10416
10426
|
}));
|
|
10417
|
-
const
|
|
10427
|
+
const Te = (N = I?.forceReasoning) != null ? N : U.isReasoningModel;
|
|
10418
10428
|
I?.conversation && I?.previousResponseId && z.push({
|
|
10419
10429
|
type: "unsupported",
|
|
10420
10430
|
feature: "conversation",
|
|
10421
10431
|
details: "conversation and previousResponseId cannot be used together"
|
|
10422
10432
|
});
|
|
10423
|
-
const
|
|
10433
|
+
const ye = nm({
|
|
10424
10434
|
tools: A,
|
|
10425
10435
|
providerToolNames: {
|
|
10426
10436
|
"openai.code_interpreter": "code_interpreter",
|
|
@@ -10435,35 +10445,35 @@ var Px = class {
|
|
|
10435
10445
|
"openai.tool_search": "tool_search"
|
|
10436
10446
|
},
|
|
10437
10447
|
resolveProviderToolName: (ze) => ze.id === "openai.custom" ? ze.args.name : void 0
|
|
10438
|
-
}),
|
|
10448
|
+
}), ne = /* @__PURE__ */ new Set(), {
|
|
10439
10449
|
tools: me,
|
|
10440
10450
|
toolChoice: Me,
|
|
10441
10451
|
toolWarnings: $
|
|
10442
10452
|
} = await Rx({
|
|
10443
10453
|
tools: A,
|
|
10444
10454
|
toolChoice: _,
|
|
10445
|
-
toolNameMapping:
|
|
10446
|
-
customProviderToolNames:
|
|
10447
|
-
}), { input: ge, warnings:
|
|
10455
|
+
toolNameMapping: ye,
|
|
10456
|
+
customProviderToolNames: ne
|
|
10457
|
+
}), { input: ge, warnings: te } = await Tx({
|
|
10448
10458
|
prompt: v,
|
|
10449
|
-
toolNameMapping:
|
|
10450
|
-
systemMessageMode: (R = I?.systemMessageMode) != null ? R :
|
|
10451
|
-
providerOptionsName:
|
|
10459
|
+
toolNameMapping: ye,
|
|
10460
|
+
systemMessageMode: (R = I?.systemMessageMode) != null ? R : Te ? "developer" : U.systemMessageMode,
|
|
10461
|
+
providerOptionsName: ee,
|
|
10452
10462
|
fileIdPrefixes: this.config.fileIdPrefixes,
|
|
10453
10463
|
store: (M = I?.store) != null ? M : !0,
|
|
10454
10464
|
hasConversation: I?.conversation != null,
|
|
10455
|
-
hasLocalShellTool:
|
|
10456
|
-
hasShellTool:
|
|
10457
|
-
hasApplyPatchTool:
|
|
10458
|
-
customProviderToolNames:
|
|
10465
|
+
hasLocalShellTool: re("openai.local_shell"),
|
|
10466
|
+
hasShellTool: re("openai.shell"),
|
|
10467
|
+
hasApplyPatchTool: re("openai.apply_patch"),
|
|
10468
|
+
customProviderToolNames: ne.size > 0 ? ne : void 0
|
|
10459
10469
|
});
|
|
10460
|
-
z.push(...
|
|
10470
|
+
z.push(...te);
|
|
10461
10471
|
const K = (P = I?.strictJsonSchema) != null ? P : !0;
|
|
10462
10472
|
let pe = I?.include;
|
|
10463
10473
|
function de(ze) {
|
|
10464
10474
|
pe == null ? pe = [ze] : pe.includes(ze) || (pe = [...pe, ze]);
|
|
10465
10475
|
}
|
|
10466
|
-
function
|
|
10476
|
+
function re(ze) {
|
|
10467
10477
|
return A?.find((Yt) => Yt.type === "provider" && Yt.id === ze) != null;
|
|
10468
10478
|
}
|
|
10469
10479
|
const he = typeof I?.logprobs == "number" ? I?.logprobs : I?.logprobs === !0 ? rd : void 0;
|
|
@@ -10471,9 +10481,9 @@ var Px = class {
|
|
|
10471
10481
|
const It = (j = A?.find(
|
|
10472
10482
|
(ze) => ze.type === "provider" && (ze.id === "openai.web_search" || ze.id === "openai.web_search_preview")
|
|
10473
10483
|
)) == null ? void 0 : j.name;
|
|
10474
|
-
It && de("web_search_call.action.sources"),
|
|
10484
|
+
It && de("web_search_call.action.sources"), re("openai.code_interpreter") && de("code_interpreter_call.outputs");
|
|
10475
10485
|
const Ae = I?.store;
|
|
10476
|
-
Ae === !1 &&
|
|
10486
|
+
Ae === !1 && Te && de("reasoning.encrypted_content");
|
|
10477
10487
|
const Dt = {
|
|
10478
10488
|
model: this.modelId,
|
|
10479
10489
|
input: ge,
|
|
@@ -10513,7 +10523,7 @@ var Px = class {
|
|
|
10513
10523
|
top_logprobs: he,
|
|
10514
10524
|
truncation: I?.truncation,
|
|
10515
10525
|
// model-specific settings:
|
|
10516
|
-
...
|
|
10526
|
+
...Te && (I?.reasoningEffort != null || I?.reasoningSummary != null) && {
|
|
10517
10527
|
reasoning: {
|
|
10518
10528
|
...I?.reasoningEffort != null && {
|
|
10519
10529
|
effort: I.reasoningEffort
|
|
@@ -10524,7 +10534,7 @@ var Px = class {
|
|
|
10524
10534
|
}
|
|
10525
10535
|
}
|
|
10526
10536
|
};
|
|
10527
|
-
|
|
10537
|
+
Te ? I?.reasoningEffort === "none" && U.supportsNonReasoningParameters || (Dt.temperature != null && (Dt.temperature = void 0, z.push({
|
|
10528
10538
|
type: "unsupported",
|
|
10529
10539
|
feature: "temperature",
|
|
10530
10540
|
details: "temperature is not supported for reasoning models"
|
|
@@ -10561,25 +10571,25 @@ var Px = class {
|
|
|
10561
10571
|
},
|
|
10562
10572
|
warnings: [...z, ...$],
|
|
10563
10573
|
store: Ae,
|
|
10564
|
-
toolNameMapping:
|
|
10565
|
-
providerOptionsName:
|
|
10574
|
+
toolNameMapping: ye,
|
|
10575
|
+
providerOptionsName: ee,
|
|
10566
10576
|
isShellProviderExecuted: pn
|
|
10567
10577
|
};
|
|
10568
10578
|
}
|
|
10569
10579
|
async doGenerate(t) {
|
|
10570
|
-
var r, o, c, u, f, g, m, v, x, A, _, D, N, R, M, P, j, Z, F, J, Y, z, U,
|
|
10580
|
+
var r, o, c, u, f, g, m, v, x, A, _, D, N, R, M, P, j, Z, F, J, Y, z, U, ee, I, Te, ye, ne;
|
|
10571
10581
|
const {
|
|
10572
10582
|
args: me,
|
|
10573
10583
|
warnings: Me,
|
|
10574
10584
|
webSearchToolName: $,
|
|
10575
10585
|
toolNameMapping: ge,
|
|
10576
|
-
providerOptionsName:
|
|
10586
|
+
providerOptionsName: te,
|
|
10577
10587
|
isShellProviderExecuted: K
|
|
10578
10588
|
} = await this.getArgs(t), pe = this.config.url({
|
|
10579
10589
|
path: "/responses",
|
|
10580
10590
|
modelId: this.modelId
|
|
10581
10591
|
}), de = yl(t.prompt), {
|
|
10582
|
-
responseHeaders:
|
|
10592
|
+
responseHeaders: re,
|
|
10583
10593
|
value: he,
|
|
10584
10594
|
rawValue: It
|
|
10585
10595
|
} = await Qn({
|
|
@@ -10599,7 +10609,7 @@ var Px = class {
|
|
|
10599
10609
|
url: pe,
|
|
10600
10610
|
requestBodyValues: me,
|
|
10601
10611
|
statusCode: 400,
|
|
10602
|
-
responseHeaders:
|
|
10612
|
+
responseHeaders: re,
|
|
10603
10613
|
responseBody: It,
|
|
10604
10614
|
isRetryable: !1
|
|
10605
10615
|
});
|
|
@@ -10615,7 +10625,7 @@ var Px = class {
|
|
|
10615
10625
|
type: "reasoning",
|
|
10616
10626
|
text: Oe.text,
|
|
10617
10627
|
providerMetadata: {
|
|
10618
|
-
[
|
|
10628
|
+
[te]: {
|
|
10619
10629
|
itemId: ue.id,
|
|
10620
10630
|
reasoningEncryptedContent: (r = ue.encrypted_content) != null ? r : null
|
|
10621
10631
|
}
|
|
@@ -10652,7 +10662,7 @@ var Px = class {
|
|
|
10652
10662
|
}),
|
|
10653
10663
|
...bt ? { providerExecuted: !0 } : {},
|
|
10654
10664
|
providerMetadata: {
|
|
10655
|
-
[
|
|
10665
|
+
[te]: {
|
|
10656
10666
|
itemId: ue.id
|
|
10657
10667
|
}
|
|
10658
10668
|
}
|
|
@@ -10669,7 +10679,7 @@ var Px = class {
|
|
|
10669
10679
|
tools: ue.tools
|
|
10670
10680
|
},
|
|
10671
10681
|
providerMetadata: {
|
|
10672
|
-
[
|
|
10682
|
+
[te]: {
|
|
10673
10683
|
itemId: ue.id
|
|
10674
10684
|
}
|
|
10675
10685
|
}
|
|
@@ -10685,7 +10695,7 @@ var Px = class {
|
|
|
10685
10695
|
action: ue.action
|
|
10686
10696
|
}),
|
|
10687
10697
|
providerMetadata: {
|
|
10688
|
-
[
|
|
10698
|
+
[te]: {
|
|
10689
10699
|
itemId: ue.id
|
|
10690
10700
|
}
|
|
10691
10701
|
}
|
|
@@ -10704,7 +10714,7 @@ var Px = class {
|
|
|
10704
10714
|
}),
|
|
10705
10715
|
...K && { providerExecuted: !0 },
|
|
10706
10716
|
providerMetadata: {
|
|
10707
|
-
[
|
|
10717
|
+
[te]: {
|
|
10708
10718
|
itemId: ue.id
|
|
10709
10719
|
}
|
|
10710
10720
|
}
|
|
@@ -10731,7 +10741,7 @@ var Px = class {
|
|
|
10731
10741
|
}
|
|
10732
10742
|
case "message": {
|
|
10733
10743
|
for (const Oe of ue.content) {
|
|
10734
|
-
(g = (f = t.providerOptions) == null ? void 0 : f[
|
|
10744
|
+
(g = (f = t.providerOptions) == null ? void 0 : f[te]) != null && g.logprobs && Oe.logprobs && Dt.push(Oe.logprobs);
|
|
10735
10745
|
const bt = {
|
|
10736
10746
|
itemId: ue.id,
|
|
10737
10747
|
...ue.phase != null && { phase: ue.phase },
|
|
@@ -10743,7 +10753,7 @@ var Px = class {
|
|
|
10743
10753
|
type: "text",
|
|
10744
10754
|
text: Oe.text,
|
|
10745
10755
|
providerMetadata: {
|
|
10746
|
-
[
|
|
10756
|
+
[te]: bt
|
|
10747
10757
|
}
|
|
10748
10758
|
});
|
|
10749
10759
|
for (const be of Oe.annotations)
|
|
@@ -10761,7 +10771,7 @@ var Px = class {
|
|
|
10761
10771
|
title: be.filename,
|
|
10762
10772
|
filename: be.filename,
|
|
10763
10773
|
providerMetadata: {
|
|
10764
|
-
[
|
|
10774
|
+
[te]: {
|
|
10765
10775
|
type: be.type,
|
|
10766
10776
|
fileId: be.file_id,
|
|
10767
10777
|
index: be.index
|
|
@@ -10775,7 +10785,7 @@ var Px = class {
|
|
|
10775
10785
|
title: be.filename,
|
|
10776
10786
|
filename: be.filename,
|
|
10777
10787
|
providerMetadata: {
|
|
10778
|
-
[
|
|
10788
|
+
[te]: {
|
|
10779
10789
|
type: be.type,
|
|
10780
10790
|
fileId: be.file_id,
|
|
10781
10791
|
containerId: be.container_id
|
|
@@ -10789,7 +10799,7 @@ var Px = class {
|
|
|
10789
10799
|
title: be.file_id,
|
|
10790
10800
|
filename: be.file_id,
|
|
10791
10801
|
providerMetadata: {
|
|
10792
|
-
[
|
|
10802
|
+
[te]: {
|
|
10793
10803
|
type: be.type,
|
|
10794
10804
|
fileId: be.file_id,
|
|
10795
10805
|
index: be.index
|
|
@@ -10806,7 +10816,7 @@ var Px = class {
|
|
|
10806
10816
|
toolName: ue.name,
|
|
10807
10817
|
input: ue.arguments,
|
|
10808
10818
|
providerMetadata: {
|
|
10809
|
-
[
|
|
10819
|
+
[te]: {
|
|
10810
10820
|
itemId: ue.id
|
|
10811
10821
|
}
|
|
10812
10822
|
}
|
|
@@ -10822,7 +10832,7 @@ var Px = class {
|
|
|
10822
10832
|
toolName: Oe,
|
|
10823
10833
|
input: JSON.stringify(ue.input),
|
|
10824
10834
|
providerMetadata: {
|
|
10825
|
-
[
|
|
10835
|
+
[te]: {
|
|
10826
10836
|
itemId: ue.id
|
|
10827
10837
|
}
|
|
10828
10838
|
}
|
|
@@ -10870,7 +10880,7 @@ var Px = class {
|
|
|
10870
10880
|
...ue.error != null ? { error: ue.error } : {}
|
|
10871
10881
|
},
|
|
10872
10882
|
providerMetadata: {
|
|
10873
|
-
[
|
|
10883
|
+
[te]: {
|
|
10874
10884
|
itemId: ue.id
|
|
10875
10885
|
}
|
|
10876
10886
|
}
|
|
@@ -10926,7 +10936,7 @@ var Px = class {
|
|
|
10926
10936
|
toolName: ge.toCustomToolName("file_search"),
|
|
10927
10937
|
result: {
|
|
10928
10938
|
queries: ue.queries,
|
|
10929
|
-
results: (I = (
|
|
10939
|
+
results: (I = (ee = ue.results) == null ? void 0 : ee.map((Oe) => ({
|
|
10930
10940
|
attributes: Oe.attributes,
|
|
10931
10941
|
fileId: Oe.file_id,
|
|
10932
10942
|
filename: Oe.filename,
|
|
@@ -10967,7 +10977,7 @@ var Px = class {
|
|
|
10967
10977
|
operation: ue.operation
|
|
10968
10978
|
}),
|
|
10969
10979
|
providerMetadata: {
|
|
10970
|
-
[
|
|
10980
|
+
[te]: {
|
|
10971
10981
|
itemId: ue.id
|
|
10972
10982
|
}
|
|
10973
10983
|
}
|
|
@@ -10976,7 +10986,7 @@ var Px = class {
|
|
|
10976
10986
|
}
|
|
10977
10987
|
}
|
|
10978
10988
|
const ze = {
|
|
10979
|
-
[
|
|
10989
|
+
[te]: {
|
|
10980
10990
|
responseId: he.id,
|
|
10981
10991
|
...Dt.length > 0 ? { logprobs: Dt } : {},
|
|
10982
10992
|
...typeof he.service_tier == "string" ? { serviceTier: he.service_tier } : {}
|
|
@@ -10986,10 +10996,10 @@ var Px = class {
|
|
|
10986
10996
|
content: Ae,
|
|
10987
10997
|
finishReason: {
|
|
10988
10998
|
unified: Bo({
|
|
10989
|
-
finishReason: (
|
|
10999
|
+
finishReason: (Te = he.incomplete_details) == null ? void 0 : Te.reason,
|
|
10990
11000
|
hasFunctionCall: Ce
|
|
10991
11001
|
}),
|
|
10992
|
-
raw: (
|
|
11002
|
+
raw: (ne = (ye = he.incomplete_details) == null ? void 0 : ye.reason) != null ? ne : void 0
|
|
10993
11003
|
},
|
|
10994
11004
|
usage: gl(Yt),
|
|
10995
11005
|
request: { body: me },
|
|
@@ -10997,7 +11007,7 @@ var Px = class {
|
|
|
10997
11007
|
id: he.id,
|
|
10998
11008
|
timestamp: new Date(he.created_at * 1e3),
|
|
10999
11009
|
modelId: he.model,
|
|
11000
|
-
headers:
|
|
11010
|
+
headers: re,
|
|
11001
11011
|
body: It
|
|
11002
11012
|
},
|
|
11003
11013
|
providerMetadata: ze,
|
|
@@ -11044,16 +11054,16 @@ var Px = class {
|
|
|
11044
11054
|
return {
|
|
11045
11055
|
stream: x.pipeThrough(
|
|
11046
11056
|
new TransformStream({
|
|
11047
|
-
start(
|
|
11048
|
-
|
|
11057
|
+
start(ee) {
|
|
11058
|
+
ee.enqueue({ type: "stream-start", warnings: o });
|
|
11049
11059
|
},
|
|
11050
|
-
transform(
|
|
11051
|
-
var
|
|
11052
|
-
if (t.includeRawChunks && I.enqueue({ type: "raw", rawValue:
|
|
11053
|
-
N = { unified: "error", raw: void 0 }, I.enqueue({ type: "error", error:
|
|
11060
|
+
transform(ee, I) {
|
|
11061
|
+
var Te, ye, ne, me, Me, $, ge, te, K, pe, de, re, he, It, Ae, Dt, Ce, pn, ze, Yt, ue, Oe, bt, be, en, Kt, Bn, St, Ye, Ve, Ln, ve, Gn, er, an, tr, $t, hr;
|
|
11062
|
+
if (t.includeRawChunks && I.enqueue({ type: "raw", rawValue: ee.rawValue }), !ee.success) {
|
|
11063
|
+
N = { unified: "error", raw: void 0 }, I.enqueue({ type: "error", error: ee.error });
|
|
11054
11064
|
return;
|
|
11055
11065
|
}
|
|
11056
|
-
const k =
|
|
11066
|
+
const k = ee.value;
|
|
11057
11067
|
if (wl(k)) {
|
|
11058
11068
|
if (k.item.type === "function_call")
|
|
11059
11069
|
j[k.output_index] = {
|
|
@@ -11065,16 +11075,16 @@ var Px = class {
|
|
|
11065
11075
|
toolName: k.item.name
|
|
11066
11076
|
});
|
|
11067
11077
|
else if (k.item.type === "custom_tool_call") {
|
|
11068
|
-
const
|
|
11078
|
+
const ie = u.toCustomToolName(
|
|
11069
11079
|
k.item.name
|
|
11070
11080
|
);
|
|
11071
11081
|
j[k.output_index] = {
|
|
11072
|
-
toolName:
|
|
11082
|
+
toolName: ie,
|
|
11073
11083
|
toolCallId: k.item.call_id
|
|
11074
11084
|
}, I.enqueue({
|
|
11075
11085
|
type: "tool-input-start",
|
|
11076
11086
|
id: k.item.call_id,
|
|
11077
|
-
toolName:
|
|
11087
|
+
toolName: ie
|
|
11078
11088
|
});
|
|
11079
11089
|
} else if (k.item.type === "web_search_call")
|
|
11080
11090
|
j[k.output_index] = {
|
|
@@ -11145,23 +11155,23 @@ var Px = class {
|
|
|
11145
11155
|
providerExecuted: !0
|
|
11146
11156
|
});
|
|
11147
11157
|
else if (k.item.type === "tool_search_call") {
|
|
11148
|
-
const
|
|
11158
|
+
const ie = k.item.id, Ke = u.toCustomToolName("tool_search"), ht = k.item.execution === "server";
|
|
11149
11159
|
j[k.output_index] = {
|
|
11150
11160
|
toolName: Ke,
|
|
11151
|
-
toolCallId:
|
|
11152
|
-
toolSearchExecution: (
|
|
11161
|
+
toolCallId: ie,
|
|
11162
|
+
toolSearchExecution: (Te = k.item.execution) != null ? Te : "server"
|
|
11153
11163
|
}, ht && I.enqueue({
|
|
11154
11164
|
type: "tool-input-start",
|
|
11155
|
-
id:
|
|
11165
|
+
id: ie,
|
|
11156
11166
|
toolName: Ke,
|
|
11157
11167
|
providerExecuted: !0
|
|
11158
11168
|
});
|
|
11159
11169
|
} else if (k.item.type !== "tool_search_output") {
|
|
11160
11170
|
if (!(k.item.type === "mcp_call" || k.item.type === "mcp_list_tools" || k.item.type === "mcp_approval_request")) if (k.item.type === "apply_patch_call") {
|
|
11161
|
-
const { call_id:
|
|
11171
|
+
const { call_id: ie, operation: Ke } = k.item;
|
|
11162
11172
|
if (j[k.output_index] = {
|
|
11163
11173
|
toolName: u.toCustomToolName("apply_patch"),
|
|
11164
|
-
toolCallId:
|
|
11174
|
+
toolCallId: ie,
|
|
11165
11175
|
applyPatch: {
|
|
11166
11176
|
// delete_file doesn't have diff
|
|
11167
11177
|
hasDiff: Ke.type === "delete_file",
|
|
@@ -11169,31 +11179,31 @@ var Px = class {
|
|
|
11169
11179
|
}
|
|
11170
11180
|
}, I.enqueue({
|
|
11171
11181
|
type: "tool-input-start",
|
|
11172
|
-
id:
|
|
11182
|
+
id: ie,
|
|
11173
11183
|
toolName: u.toCustomToolName("apply_patch")
|
|
11174
11184
|
}), Ke.type === "delete_file") {
|
|
11175
11185
|
const ht = JSON.stringify({
|
|
11176
|
-
callId:
|
|
11186
|
+
callId: ie,
|
|
11177
11187
|
operation: Ke
|
|
11178
11188
|
});
|
|
11179
11189
|
I.enqueue({
|
|
11180
11190
|
type: "tool-input-delta",
|
|
11181
|
-
id:
|
|
11191
|
+
id: ie,
|
|
11182
11192
|
delta: ht
|
|
11183
11193
|
}), I.enqueue({
|
|
11184
11194
|
type: "tool-input-end",
|
|
11185
|
-
id:
|
|
11195
|
+
id: ie
|
|
11186
11196
|
});
|
|
11187
11197
|
} else
|
|
11188
11198
|
I.enqueue({
|
|
11189
11199
|
type: "tool-input-delta",
|
|
11190
|
-
id:
|
|
11191
|
-
delta: `{"callId":"${_r(
|
|
11200
|
+
id: ie,
|
|
11201
|
+
delta: `{"callId":"${_r(ie)}","operation":{"type":"${_r(Ke.type)}","path":"${_r(Ke.path)}","diff":"`
|
|
11192
11202
|
});
|
|
11193
11203
|
} else k.item.type === "shell_call" ? j[k.output_index] = {
|
|
11194
11204
|
toolName: u.toCustomToolName("shell"),
|
|
11195
11205
|
toolCallId: k.item.call_id
|
|
11196
|
-
} : k.item.type === "shell_call_output" || (k.item.type === "message" ? (Z.splice(0, Z.length), F = (
|
|
11206
|
+
} : k.item.type === "shell_call_output" || (k.item.type === "message" ? (Z.splice(0, Z.length), F = (ye = k.item.phase) != null ? ye : void 0, I.enqueue({
|
|
11197
11207
|
type: "text-start",
|
|
11198
11208
|
id: k.item.id,
|
|
11199
11209
|
providerMetadata: {
|
|
@@ -11213,21 +11223,21 @@ var Px = class {
|
|
|
11213
11223
|
providerMetadata: {
|
|
11214
11224
|
[g]: {
|
|
11215
11225
|
itemId: k.item.id,
|
|
11216
|
-
reasoningEncryptedContent: (
|
|
11226
|
+
reasoningEncryptedContent: (ne = k.item.encrypted_content) != null ? ne : null
|
|
11217
11227
|
}
|
|
11218
11228
|
}
|
|
11219
11229
|
})));
|
|
11220
11230
|
}
|
|
11221
11231
|
} else if (Lx(k)) {
|
|
11222
11232
|
if (k.item.type === "message") {
|
|
11223
|
-
const
|
|
11233
|
+
const ie = (me = k.item.phase) != null ? me : F;
|
|
11224
11234
|
F = void 0, I.enqueue({
|
|
11225
11235
|
type: "text-end",
|
|
11226
11236
|
id: k.item.id,
|
|
11227
11237
|
providerMetadata: {
|
|
11228
11238
|
[g]: {
|
|
11229
11239
|
itemId: k.item.id,
|
|
11230
|
-
...
|
|
11240
|
+
...ie != null && { phase: ie },
|
|
11231
11241
|
...Z.length > 0 && {
|
|
11232
11242
|
annotations: Z
|
|
11233
11243
|
}
|
|
@@ -11251,7 +11261,7 @@ var Px = class {
|
|
|
11251
11261
|
});
|
|
11252
11262
|
else if (k.item.type === "custom_tool_call") {
|
|
11253
11263
|
j[k.output_index] = void 0, J = !0;
|
|
11254
|
-
const
|
|
11264
|
+
const ie = u.toCustomToolName(
|
|
11255
11265
|
k.item.name
|
|
11256
11266
|
);
|
|
11257
11267
|
I.enqueue({
|
|
@@ -11260,7 +11270,7 @@ var Px = class {
|
|
|
11260
11270
|
}), I.enqueue({
|
|
11261
11271
|
type: "tool-call",
|
|
11262
11272
|
toolCallId: k.item.call_id,
|
|
11263
|
-
toolName:
|
|
11273
|
+
toolName: ie,
|
|
11264
11274
|
input: JSON.stringify(k.item.input),
|
|
11265
11275
|
providerMetadata: {
|
|
11266
11276
|
[g]: {
|
|
@@ -11303,12 +11313,12 @@ var Px = class {
|
|
|
11303
11313
|
toolName: u.toCustomToolName("file_search"),
|
|
11304
11314
|
result: {
|
|
11305
11315
|
queries: k.item.queries,
|
|
11306
|
-
results: ($ = (Me = k.item.results) == null ? void 0 : Me.map((
|
|
11307
|
-
attributes:
|
|
11308
|
-
fileId:
|
|
11309
|
-
filename:
|
|
11310
|
-
score:
|
|
11311
|
-
text:
|
|
11316
|
+
results: ($ = (Me = k.item.results) == null ? void 0 : Me.map((ie) => ({
|
|
11317
|
+
attributes: ie.attributes,
|
|
11318
|
+
fileId: ie.file_id,
|
|
11319
|
+
filename: ie.filename,
|
|
11320
|
+
score: ie.score,
|
|
11321
|
+
text: ie.text
|
|
11312
11322
|
}))) != null ? $ : null
|
|
11313
11323
|
}
|
|
11314
11324
|
});
|
|
@@ -11331,20 +11341,20 @@ var Px = class {
|
|
|
11331
11341
|
}
|
|
11332
11342
|
});
|
|
11333
11343
|
else if (k.item.type === "tool_search_call") {
|
|
11334
|
-
const
|
|
11335
|
-
if (
|
|
11336
|
-
const ht = Ke ?
|
|
11344
|
+
const ie = j[k.output_index], Ke = k.item.execution === "server";
|
|
11345
|
+
if (ie != null) {
|
|
11346
|
+
const ht = Ke ? ie.toolCallId : (ge = k.item.call_id) != null ? ge : k.item.id;
|
|
11337
11347
|
Ke ? U.push(ht) : I.enqueue({
|
|
11338
11348
|
type: "tool-input-start",
|
|
11339
11349
|
id: ht,
|
|
11340
|
-
toolName:
|
|
11350
|
+
toolName: ie.toolName
|
|
11341
11351
|
}), I.enqueue({
|
|
11342
11352
|
type: "tool-input-end",
|
|
11343
11353
|
id: ht
|
|
11344
11354
|
}), I.enqueue({
|
|
11345
11355
|
type: "tool-call",
|
|
11346
11356
|
toolCallId: ht,
|
|
11347
|
-
toolName:
|
|
11357
|
+
toolName: ie.toolName,
|
|
11348
11358
|
input: JSON.stringify({
|
|
11349
11359
|
arguments: k.item.arguments,
|
|
11350
11360
|
call_id: Ke ? null : ht
|
|
@@ -11359,10 +11369,10 @@ var Px = class {
|
|
|
11359
11369
|
}
|
|
11360
11370
|
j[k.output_index] = void 0;
|
|
11361
11371
|
} else if (k.item.type === "tool_search_output") {
|
|
11362
|
-
const
|
|
11372
|
+
const ie = (K = (te = k.item.call_id) != null ? te : U.shift()) != null ? K : k.item.id;
|
|
11363
11373
|
I.enqueue({
|
|
11364
11374
|
type: "tool-result",
|
|
11365
|
-
toolCallId:
|
|
11375
|
+
toolCallId: ie,
|
|
11366
11376
|
toolName: u.toCustomToolName("tool_search"),
|
|
11367
11377
|
result: {
|
|
11368
11378
|
tools: k.item.tools
|
|
@@ -11375,9 +11385,9 @@ var Px = class {
|
|
|
11375
11385
|
});
|
|
11376
11386
|
} else if (k.item.type === "mcp_call") {
|
|
11377
11387
|
j[k.output_index] = void 0;
|
|
11378
|
-
const
|
|
11379
|
-
|
|
11380
|
-
)) != null ? de : _[
|
|
11388
|
+
const ie = (pe = k.item.approval_request_id) != null ? pe : void 0, Ke = ie != null && (re = (de = D.get(
|
|
11389
|
+
ie
|
|
11390
|
+
)) != null ? de : _[ie]) != null ? re : k.item.id, ht = `mcp.${k.item.name}`;
|
|
11381
11391
|
I.enqueue({
|
|
11382
11392
|
type: "tool-call",
|
|
11383
11393
|
toolCallId: Ke,
|
|
@@ -11406,21 +11416,21 @@ var Px = class {
|
|
|
11406
11416
|
} else if (k.item.type === "mcp_list_tools")
|
|
11407
11417
|
j[k.output_index] = void 0;
|
|
11408
11418
|
else if (k.item.type === "apply_patch_call") {
|
|
11409
|
-
const
|
|
11410
|
-
|
|
11419
|
+
const ie = j[k.output_index];
|
|
11420
|
+
ie?.applyPatch && !ie.applyPatch.endEmitted && k.item.operation.type !== "delete_file" && (ie.applyPatch.hasDiff || I.enqueue({
|
|
11411
11421
|
type: "tool-input-delta",
|
|
11412
|
-
id:
|
|
11422
|
+
id: ie.toolCallId,
|
|
11413
11423
|
delta: _r(k.item.operation.diff)
|
|
11414
11424
|
}), I.enqueue({
|
|
11415
11425
|
type: "tool-input-delta",
|
|
11416
|
-
id:
|
|
11426
|
+
id: ie.toolCallId,
|
|
11417
11427
|
delta: '"}}'
|
|
11418
11428
|
}), I.enqueue({
|
|
11419
11429
|
type: "tool-input-end",
|
|
11420
|
-
id:
|
|
11421
|
-
}),
|
|
11430
|
+
id: ie.toolCallId
|
|
11431
|
+
}), ie.applyPatch.endEmitted = !0), ie && k.item.status === "completed" && I.enqueue({
|
|
11422
11432
|
type: "tool-call",
|
|
11423
|
-
toolCallId:
|
|
11433
|
+
toolCallId: ie.toolCallId,
|
|
11424
11434
|
toolName: u.toCustomToolName("apply_patch"),
|
|
11425
11435
|
input: JSON.stringify({
|
|
11426
11436
|
callId: k.item.call_id,
|
|
@@ -11434,15 +11444,15 @@ var Px = class {
|
|
|
11434
11444
|
}), j[k.output_index] = void 0;
|
|
11435
11445
|
} else if (k.item.type === "mcp_approval_request") {
|
|
11436
11446
|
j[k.output_index] = void 0;
|
|
11437
|
-
const
|
|
11447
|
+
const ie = (Ae = (It = (he = A.config).generateId) == null ? void 0 : It.call(he)) != null ? Ae : on(), Ke = (Dt = k.item.approval_request_id) != null ? Dt : k.item.id;
|
|
11438
11448
|
D.set(
|
|
11439
11449
|
Ke,
|
|
11440
|
-
|
|
11450
|
+
ie
|
|
11441
11451
|
);
|
|
11442
11452
|
const ht = `mcp.${k.item.name}`;
|
|
11443
11453
|
I.enqueue({
|
|
11444
11454
|
type: "tool-call",
|
|
11445
|
-
toolCallId:
|
|
11455
|
+
toolCallId: ie,
|
|
11446
11456
|
toolName: ht,
|
|
11447
11457
|
input: k.item.arguments,
|
|
11448
11458
|
providerExecuted: !0,
|
|
@@ -11450,7 +11460,7 @@ var Px = class {
|
|
|
11450
11460
|
}), I.enqueue({
|
|
11451
11461
|
type: "tool-approval-request",
|
|
11452
11462
|
approvalId: Ke,
|
|
11453
|
-
toolCallId:
|
|
11463
|
+
toolCallId: ie
|
|
11454
11464
|
});
|
|
11455
11465
|
} else if (k.item.type === "local_shell_call")
|
|
11456
11466
|
j[k.output_index] = void 0, I.enqueue({
|
|
@@ -11495,20 +11505,20 @@ var Px = class {
|
|
|
11495
11505
|
toolName: u.toCustomToolName("shell"),
|
|
11496
11506
|
result: {
|
|
11497
11507
|
output: k.item.output.map(
|
|
11498
|
-
(
|
|
11499
|
-
stdout:
|
|
11500
|
-
stderr:
|
|
11501
|
-
outcome:
|
|
11508
|
+
(ie) => ({
|
|
11509
|
+
stdout: ie.stdout,
|
|
11510
|
+
stderr: ie.stderr,
|
|
11511
|
+
outcome: ie.outcome.type === "exit" ? {
|
|
11502
11512
|
type: "exit",
|
|
11503
|
-
exitCode:
|
|
11513
|
+
exitCode: ie.outcome.exit_code
|
|
11504
11514
|
} : { type: "timeout" }
|
|
11505
11515
|
})
|
|
11506
11516
|
)
|
|
11507
11517
|
}
|
|
11508
11518
|
});
|
|
11509
11519
|
else if (k.item.type === "reasoning") {
|
|
11510
|
-
const
|
|
11511
|
-
|
|
11520
|
+
const ie = Y[k.item.id], Ke = Object.entries(
|
|
11521
|
+
ie.summaryParts
|
|
11512
11522
|
).filter(
|
|
11513
11523
|
([ht, Nr]) => Nr === "active" || Nr === "can-conclude"
|
|
11514
11524
|
).map(([ht]) => ht);
|
|
@@ -11526,40 +11536,40 @@ var Px = class {
|
|
|
11526
11536
|
delete Y[k.item.id];
|
|
11527
11537
|
}
|
|
11528
11538
|
} else if (Zx(k)) {
|
|
11529
|
-
const
|
|
11530
|
-
|
|
11539
|
+
const ie = j[k.output_index];
|
|
11540
|
+
ie != null && I.enqueue({
|
|
11531
11541
|
type: "tool-input-delta",
|
|
11532
|
-
id:
|
|
11542
|
+
id: ie.toolCallId,
|
|
11533
11543
|
delta: k.delta
|
|
11534
11544
|
});
|
|
11535
11545
|
} else if ($x(k)) {
|
|
11536
|
-
const
|
|
11537
|
-
|
|
11546
|
+
const ie = j[k.output_index];
|
|
11547
|
+
ie != null && I.enqueue({
|
|
11538
11548
|
type: "tool-input-delta",
|
|
11539
|
-
id:
|
|
11549
|
+
id: ie.toolCallId,
|
|
11540
11550
|
delta: k.delta
|
|
11541
11551
|
});
|
|
11542
11552
|
} else if (jx(k)) {
|
|
11543
|
-
const
|
|
11544
|
-
|
|
11553
|
+
const ie = j[k.output_index];
|
|
11554
|
+
ie?.applyPatch && (I.enqueue({
|
|
11545
11555
|
type: "tool-input-delta",
|
|
11546
|
-
id:
|
|
11556
|
+
id: ie.toolCallId,
|
|
11547
11557
|
delta: _r(k.delta)
|
|
11548
|
-
}),
|
|
11558
|
+
}), ie.applyPatch.hasDiff = !0);
|
|
11549
11559
|
} else if (Gx(k)) {
|
|
11550
|
-
const
|
|
11551
|
-
|
|
11560
|
+
const ie = j[k.output_index];
|
|
11561
|
+
ie?.applyPatch && !ie.applyPatch.endEmitted && (ie.applyPatch.hasDiff || (I.enqueue({
|
|
11552
11562
|
type: "tool-input-delta",
|
|
11553
|
-
id:
|
|
11563
|
+
id: ie.toolCallId,
|
|
11554
11564
|
delta: _r(k.diff)
|
|
11555
|
-
}),
|
|
11565
|
+
}), ie.applyPatch.hasDiff = !0), I.enqueue({
|
|
11556
11566
|
type: "tool-input-delta",
|
|
11557
|
-
id:
|
|
11567
|
+
id: ie.toolCallId,
|
|
11558
11568
|
delta: '"}}'
|
|
11559
11569
|
}), I.enqueue({
|
|
11560
11570
|
type: "tool-input-end",
|
|
11561
|
-
id:
|
|
11562
|
-
}),
|
|
11571
|
+
id: ie.toolCallId
|
|
11572
|
+
}), ie.applyPatch.endEmitted = !0);
|
|
11563
11573
|
} else if (Vx(k))
|
|
11564
11574
|
I.enqueue({
|
|
11565
11575
|
type: "tool-result",
|
|
@@ -11571,28 +11581,28 @@ var Px = class {
|
|
|
11571
11581
|
preliminary: !0
|
|
11572
11582
|
});
|
|
11573
11583
|
else if (Hx(k)) {
|
|
11574
|
-
const
|
|
11575
|
-
|
|
11584
|
+
const ie = j[k.output_index];
|
|
11585
|
+
ie != null && I.enqueue({
|
|
11576
11586
|
type: "tool-input-delta",
|
|
11577
|
-
id:
|
|
11587
|
+
id: ie.toolCallId,
|
|
11578
11588
|
delta: _r(k.delta)
|
|
11579
11589
|
});
|
|
11580
11590
|
} else if (Wx(k)) {
|
|
11581
|
-
const
|
|
11582
|
-
|
|
11591
|
+
const ie = j[k.output_index];
|
|
11592
|
+
ie != null && (I.enqueue({
|
|
11583
11593
|
type: "tool-input-delta",
|
|
11584
|
-
id:
|
|
11594
|
+
id: ie.toolCallId,
|
|
11585
11595
|
delta: '"}'
|
|
11586
11596
|
}), I.enqueue({
|
|
11587
11597
|
type: "tool-input-end",
|
|
11588
|
-
id:
|
|
11598
|
+
id: ie.toolCallId
|
|
11589
11599
|
}), I.enqueue({
|
|
11590
11600
|
type: "tool-call",
|
|
11591
|
-
toolCallId:
|
|
11601
|
+
toolCallId: ie.toolCallId,
|
|
11592
11602
|
toolName: u.toCustomToolName("code_interpreter"),
|
|
11593
11603
|
input: JSON.stringify({
|
|
11594
11604
|
code: k.code,
|
|
11595
|
-
containerId:
|
|
11605
|
+
containerId: ie.codeInterpreter.containerId
|
|
11596
11606
|
}),
|
|
11597
11607
|
providerExecuted: !0
|
|
11598
11608
|
}));
|
|
@@ -11611,12 +11621,12 @@ var Px = class {
|
|
|
11611
11621
|
}), (ze = (pn = t.providerOptions) == null ? void 0 : pn[g]) != null && ze.logprobs && k.logprobs && M.push(k.logprobs);
|
|
11612
11622
|
else if (k.type === "response.reasoning_summary_part.added") {
|
|
11613
11623
|
if (k.summary_index > 0) {
|
|
11614
|
-
const
|
|
11615
|
-
|
|
11624
|
+
const ie = Y[k.item_id];
|
|
11625
|
+
ie.summaryParts[k.summary_index] = "active";
|
|
11616
11626
|
for (const Ke of Object.keys(
|
|
11617
|
-
|
|
11627
|
+
ie.summaryParts
|
|
11618
11628
|
))
|
|
11619
|
-
|
|
11629
|
+
ie.summaryParts[Ke] === "can-conclude" && (I.enqueue({
|
|
11620
11630
|
type: "reasoning-end",
|
|
11621
11631
|
id: `${k.item_id}:${Ke}`,
|
|
11622
11632
|
providerMetadata: {
|
|
@@ -11624,7 +11634,7 @@ var Px = class {
|
|
|
11624
11634
|
itemId: k.item_id
|
|
11625
11635
|
}
|
|
11626
11636
|
}
|
|
11627
|
-
}),
|
|
11637
|
+
}), ie.summaryParts[Ke] = "concluded");
|
|
11628
11638
|
I.enqueue({
|
|
11629
11639
|
type: "reasoning-start",
|
|
11630
11640
|
id: `${k.item_id}:${k.summary_index}`,
|
|
@@ -11666,13 +11676,13 @@ var Px = class {
|
|
|
11666
11676
|
raw: (be = (bt = k.response.incomplete_details) == null ? void 0 : bt.reason) != null ? be : void 0
|
|
11667
11677
|
}, R = k.response.usage, typeof k.response.service_tier == "string" && (z = k.response.service_tier);
|
|
11668
11678
|
else if (Ux(k)) {
|
|
11669
|
-
const
|
|
11679
|
+
const ie = (en = k.response.incomplete_details) == null ? void 0 : en.reason;
|
|
11670
11680
|
N = {
|
|
11671
|
-
unified:
|
|
11672
|
-
finishReason:
|
|
11681
|
+
unified: ie ? Bo({
|
|
11682
|
+
finishReason: ie,
|
|
11673
11683
|
hasFunctionCall: J
|
|
11674
11684
|
}) : "error",
|
|
11675
|
-
raw:
|
|
11685
|
+
raw: ie ?? "error"
|
|
11676
11686
|
}, R = (Kt = k.response.usage) != null ? Kt : void 0;
|
|
11677
11687
|
} else Xx(k) ? (Z.push(k.annotation), k.annotation.type === "url_citation" ? I.enqueue({
|
|
11678
11688
|
type: "source",
|
|
@@ -11683,7 +11693,7 @@ var Px = class {
|
|
|
11683
11693
|
}) : k.annotation.type === "file_citation" ? I.enqueue({
|
|
11684
11694
|
type: "source",
|
|
11685
11695
|
sourceType: "document",
|
|
11686
|
-
id: (
|
|
11696
|
+
id: (ve = (Ln = (Ve = A.config).generateId) == null ? void 0 : Ln.call(Ve)) != null ? ve : on(),
|
|
11687
11697
|
mediaType: "text/plain",
|
|
11688
11698
|
title: k.annotation.filename,
|
|
11689
11699
|
filename: k.annotation.filename,
|
|
@@ -11724,7 +11734,7 @@ var Px = class {
|
|
|
11724
11734
|
}
|
|
11725
11735
|
})) : qx(k) && I.enqueue({ type: "error", error: k });
|
|
11726
11736
|
},
|
|
11727
|
-
flush(
|
|
11737
|
+
flush(ee) {
|
|
11728
11738
|
const I = {
|
|
11729
11739
|
[g]: {
|
|
11730
11740
|
responseId: P,
|
|
@@ -11732,7 +11742,7 @@ var Px = class {
|
|
|
11732
11742
|
...z !== void 0 ? { serviceTier: z } : {}
|
|
11733
11743
|
}
|
|
11734
11744
|
};
|
|
11735
|
-
|
|
11745
|
+
ee.enqueue({
|
|
11736
11746
|
type: "finish",
|
|
11737
11747
|
finishReason: N,
|
|
11738
11748
|
usage: gl(R),
|
|
@@ -11957,7 +11967,7 @@ var Yx = Le(
|
|
|
11957
11967
|
* The timestamp granularities to populate for this transcription.
|
|
11958
11968
|
* @default ['segment']
|
|
11959
11969
|
*/
|
|
11960
|
-
timestampGranularities: ce(
|
|
11970
|
+
timestampGranularities: ce(Se(["word", "segment"])).default(["segment"]).optional()
|
|
11961
11971
|
})
|
|
11962
11972
|
)
|
|
11963
11973
|
), vl = {
|
|
@@ -12110,7 +12120,7 @@ var Yx = Le(
|
|
|
12110
12120
|
}
|
|
12111
12121
|
};
|
|
12112
12122
|
}
|
|
12113
|
-
}, ty = "3.0.
|
|
12123
|
+
}, ty = "3.0.49";
|
|
12114
12124
|
function id(t = {}) {
|
|
12115
12125
|
var r, o;
|
|
12116
12126
|
const c = (r = C2(
|
|
@@ -12718,7 +12728,7 @@ const ly = ({ systemPrompt: t, llmConfig: r, emit: o }) => {
|
|
|
12718
12728
|
// 记录着所有的会话和 currentId
|
|
12719
12729
|
} = v1({
|
|
12720
12730
|
client: u,
|
|
12721
|
-
autoSave: !
|
|
12731
|
+
autoSave: !0,
|
|
12722
12732
|
events: {
|
|
12723
12733
|
onLoaded() {
|
|
12724
12734
|
},
|
|
@@ -12733,28 +12743,28 @@ const ly = ({ systemPrompt: t, llmConfig: r, emit: o }) => {
|
|
|
12733
12743
|
return !1;
|
|
12734
12744
|
}
|
|
12735
12745
|
N.value = Y;
|
|
12736
|
-
const
|
|
12737
|
-
if (
|
|
12738
|
-
const I = [{ type: "text", text: N.value }, ...z],
|
|
12739
|
-
N.value &&
|
|
12746
|
+
const ee = m();
|
|
12747
|
+
if (ee && ee.title === "新会话" && A(ee.id, N.value.slice(0, 15)), z && z.length > 0) {
|
|
12748
|
+
const I = [{ type: "text", text: N.value }, ...z], Te = [];
|
|
12749
|
+
N.value && Te.push({
|
|
12740
12750
|
type: "text",
|
|
12741
12751
|
content: N.value
|
|
12742
12752
|
// ✅ 使用 content 字段
|
|
12743
12753
|
});
|
|
12744
|
-
for (const
|
|
12745
|
-
|
|
12754
|
+
for (const ne of z)
|
|
12755
|
+
ne.type === "image" && ne.image && Te.push({
|
|
12746
12756
|
type: "image",
|
|
12747
|
-
content:
|
|
12757
|
+
content: ne.image
|
|
12748
12758
|
// ✅ 使用 content 字段(统一格式)
|
|
12749
12759
|
});
|
|
12750
|
-
const
|
|
12760
|
+
const ye = {
|
|
12751
12761
|
role: "user",
|
|
12752
12762
|
content: I,
|
|
12753
12763
|
// API 格式:AI SDK 标准多模态数组
|
|
12754
|
-
uiContent:
|
|
12764
|
+
uiContent: Te
|
|
12755
12765
|
// UI 格式:用于界面显示
|
|
12756
12766
|
};
|
|
12757
|
-
P.value.push(
|
|
12767
|
+
P.value.push(ye), N.value = "", Z();
|
|
12758
12768
|
} else {
|
|
12759
12769
|
const I = {
|
|
12760
12770
|
role: "user",
|
|
@@ -13518,36 +13528,36 @@ var dw = sn({
|
|
|
13518
13528
|
var z;
|
|
13519
13529
|
const {
|
|
13520
13530
|
destroyOnClose: U,
|
|
13521
|
-
round:
|
|
13531
|
+
round: ee,
|
|
13522
13532
|
position: I,
|
|
13523
|
-
safeAreaInsetTop:
|
|
13524
|
-
safeAreaInsetBottom:
|
|
13525
|
-
show:
|
|
13533
|
+
safeAreaInsetTop: Te,
|
|
13534
|
+
safeAreaInsetBottom: ye,
|
|
13535
|
+
show: ne
|
|
13526
13536
|
} = t;
|
|
13527
|
-
if (!(!
|
|
13537
|
+
if (!(!ne && U))
|
|
13528
13538
|
return us(Pe("div", $r({
|
|
13529
13539
|
ref: m,
|
|
13530
13540
|
style: x.value,
|
|
13531
13541
|
role: "dialog",
|
|
13532
13542
|
tabindex: 0,
|
|
13533
13543
|
class: [kl({
|
|
13534
|
-
round:
|
|
13544
|
+
round: ee,
|
|
13535
13545
|
[I]: I
|
|
13536
13546
|
}), {
|
|
13537
|
-
"van-safe-area-top":
|
|
13538
|
-
"van-safe-area-bottom":
|
|
13547
|
+
"van-safe-area-top": Te,
|
|
13548
|
+
"van-safe-area-bottom": ye
|
|
13539
13549
|
}],
|
|
13540
13550
|
onKeydown: F
|
|
13541
|
-
}, o, Ol()), [(z = c.default) == null ? void 0 : z.call(c), M()]), [[ds,
|
|
13551
|
+
}, o, Ol()), [(z = c.default) == null ? void 0 : z.call(c), M()]), [[ds, ne]]);
|
|
13542
13552
|
}), Y = () => {
|
|
13543
13553
|
const {
|
|
13544
13554
|
position: z,
|
|
13545
13555
|
transition: U,
|
|
13546
|
-
transitionAppear:
|
|
13556
|
+
transitionAppear: ee
|
|
13547
13557
|
} = t, I = z === "center" ? "van-fade" : `van-popup-slide-${z}`;
|
|
13548
13558
|
return Pe(to, {
|
|
13549
13559
|
name: U || I,
|
|
13550
|
-
appear:
|
|
13560
|
+
appear: ee,
|
|
13551
13561
|
onAfterEnter: j,
|
|
13552
13562
|
onAfterLeave: Z
|
|
13553
13563
|
}, {
|
|
@@ -13888,13 +13898,13 @@ const Ew = (t) => (r) => et(jn({
|
|
|
13888
13898
|
};
|
|
13889
13899
|
};
|
|
13890
13900
|
function Nw(t, r, o) {
|
|
13891
|
-
const c = Xe([]), u = Xe([]), f = Xe(!1), g = (Y) => Y === "
|
|
13901
|
+
const c = Xe([]), u = Xe([]), f = Xe(!1), g = (Y) => t.mcpServers[Y]?.type === "local", m = (Y, z) => {
|
|
13892
13902
|
z ? t.ignoreToolnames = t.ignoreToolnames.filter((U) => U !== Y) : t.ignoreToolnames.includes(Y) || t.ignoreToolnames.push(Y);
|
|
13893
13903
|
}, v = (Y, z) => {
|
|
13894
13904
|
r.value || (r.value = {});
|
|
13895
13905
|
const U = { ...r.value };
|
|
13896
|
-
Y === null ? Object.keys(U).forEach((
|
|
13897
|
-
U[
|
|
13906
|
+
Y === null ? Object.keys(U).forEach((ee) => {
|
|
13907
|
+
U[ee] = z;
|
|
13898
13908
|
}) : U[Y] = z, r.value = U;
|
|
13899
13909
|
}, x = (Y) => {
|
|
13900
13910
|
const z = u.value.find((U) => U.id === Y);
|
|
@@ -13902,23 +13912,23 @@ function Nw(t, r, o) {
|
|
|
13902
13912
|
}, A = (Y) => {
|
|
13903
13913
|
const z = t.mcpTools[Y];
|
|
13904
13914
|
if (!z) return [];
|
|
13905
|
-
const U = g(Y),
|
|
13915
|
+
const U = g(Y), ee = r.value || {};
|
|
13906
13916
|
return Object.keys(z).map((I) => {
|
|
13907
|
-
const
|
|
13908
|
-
return m(I,
|
|
13917
|
+
const Te = Object.prototype.hasOwnProperty.call(ee, I), ye = U && Te ? ee[I] : !0;
|
|
13918
|
+
return m(I, ye), {
|
|
13909
13919
|
id: I,
|
|
13910
13920
|
name: I,
|
|
13911
13921
|
description: z[I].description,
|
|
13912
|
-
enabled:
|
|
13922
|
+
enabled: ye
|
|
13913
13923
|
};
|
|
13914
13924
|
});
|
|
13915
13925
|
}, _ = () => {
|
|
13916
13926
|
c.value.forEach((z) => {
|
|
13917
|
-
const U = new Map(z.tools.map((I) => [I.id, I.enabled])),
|
|
13918
|
-
const
|
|
13919
|
-
return m(I.id,
|
|
13927
|
+
const U = new Map(z.tools.map((I) => [I.id, I.enabled])), ee = A(z.id).map((I) => {
|
|
13928
|
+
const Te = U.has(I.id) ? !!U.get(I.id) : I.enabled;
|
|
13929
|
+
return m(I.id, Te), { ...I, enabled: Te };
|
|
13920
13930
|
});
|
|
13921
|
-
z.tools =
|
|
13931
|
+
z.tools = ee;
|
|
13922
13932
|
});
|
|
13923
13933
|
const Y = new Set(c.value.flatMap((z) => z.tools.map((U) => U.id)));
|
|
13924
13934
|
t.ignoreToolnames = t.ignoreToolnames.filter((z) => Y.has(z));
|
|
@@ -13929,12 +13939,12 @@ function Nw(t, r, o) {
|
|
|
13929
13939
|
if (!t.mcpTools[z])
|
|
13930
13940
|
return await t.removeMcpServer(z), !1;
|
|
13931
13941
|
const I = A(z);
|
|
13932
|
-
if (I.length === 0)
|
|
13942
|
+
if (I.length === 0 && Y.mcpServer?.type !== "builtin")
|
|
13933
13943
|
return await t.removeMcpServer(z), !1;
|
|
13934
|
-
const
|
|
13935
|
-
if (
|
|
13936
|
-
return
|
|
13937
|
-
const
|
|
13944
|
+
const Te = c.value.find((ne) => ne.id === Y.pluginId);
|
|
13945
|
+
if (Te)
|
|
13946
|
+
return Te.tools = I, Te.originMcpConfig = $o(Y.mcpServer), !0;
|
|
13947
|
+
const ye = {
|
|
13938
13948
|
id: Y.pluginId,
|
|
13939
13949
|
name: Y.name,
|
|
13940
13950
|
icon: Y.icon || o,
|
|
@@ -13945,7 +13955,7 @@ function Nw(t, r, o) {
|
|
|
13945
13955
|
// @ts-ignore
|
|
13946
13956
|
originMcpConfig: $o(Y.mcpServer)
|
|
13947
13957
|
};
|
|
13948
|
-
return c.value.push(
|
|
13958
|
+
return c.value.push(ye), !0;
|
|
13949
13959
|
};
|
|
13950
13960
|
return {
|
|
13951
13961
|
// 状态
|
|
@@ -13954,36 +13964,38 @@ function Nw(t, r, o) {
|
|
|
13954
13964
|
pluginVisible: f,
|
|
13955
13965
|
// 核心方法
|
|
13956
13966
|
loadMcpServerToPlugin: async (Y, z) => {
|
|
13957
|
-
let U,
|
|
13967
|
+
let U, ee;
|
|
13958
13968
|
if ("type" in z && z.type === "local")
|
|
13959
|
-
U = "本地工具",
|
|
13969
|
+
U = "本地工具", ee = "本地工具列表";
|
|
13970
|
+
else if ("type" in z && z.type === "builtin")
|
|
13971
|
+
U = "浏览器内置工具", ee = "通过 navigator.modelContextTesting 暴露的浏览器原生 MCP 工具";
|
|
13960
13972
|
else {
|
|
13961
13973
|
const I = new URL(z.url);
|
|
13962
|
-
U = I.origin,
|
|
13974
|
+
U = I.origin, ee = I.searchParams.get("sessionId") || ("sessionId" in z ? z.sessionId : "") || "";
|
|
13963
13975
|
}
|
|
13964
13976
|
await D({
|
|
13965
13977
|
pluginId: Y,
|
|
13966
13978
|
name: U,
|
|
13967
|
-
description:
|
|
13979
|
+
description: ee,
|
|
13968
13980
|
mcpServer: z
|
|
13969
13981
|
});
|
|
13970
13982
|
},
|
|
13971
13983
|
togglePlugin: (Y, z) => {
|
|
13972
13984
|
const U = g(Y.id);
|
|
13973
|
-
Y.tools.forEach((
|
|
13974
|
-
|
|
13985
|
+
Y.tools.forEach((ee) => {
|
|
13986
|
+
ee.enabled = z, m(ee.id, z), U && v(ee.id, z);
|
|
13975
13987
|
});
|
|
13976
13988
|
},
|
|
13977
13989
|
toggleTool: (Y, z, U) => {
|
|
13978
|
-
const
|
|
13990
|
+
const ee = g(Y.id);
|
|
13979
13991
|
Y.tools.forEach((I) => {
|
|
13980
13992
|
I.id === z && (I.enabled = U);
|
|
13981
|
-
}), m(z, U),
|
|
13993
|
+
}), m(z, U), ee && v(z, U);
|
|
13982
13994
|
},
|
|
13983
13995
|
deletePlugin: async (Y) => {
|
|
13984
|
-
const z = c.value.find((
|
|
13996
|
+
const z = c.value.find((ee) => ee.id === Y.id);
|
|
13985
13997
|
if (!z) return;
|
|
13986
|
-
c.value = c.value.filter((
|
|
13998
|
+
c.value = c.value.filter((ee) => ee.id !== z.id), x(z.id);
|
|
13987
13999
|
const U = Y.id;
|
|
13988
14000
|
await t.removeMcpServer(U);
|
|
13989
14001
|
},
|
|
@@ -14010,18 +14022,18 @@ function Nw(t, r, o) {
|
|
|
14010
14022
|
const U = {
|
|
14011
14023
|
type: "streamableHttp",
|
|
14012
14024
|
url: `${z}mcp?sessionId=${Y}`
|
|
14013
|
-
},
|
|
14025
|
+
}, ee = new URL(`${z}mcp?sessionId=${Y}`);
|
|
14014
14026
|
return await D({
|
|
14015
14027
|
pluginId: `plugin-${Y}`,
|
|
14016
|
-
name:
|
|
14028
|
+
name: ee.origin,
|
|
14017
14029
|
description: Y,
|
|
14018
14030
|
mcpServer: U
|
|
14019
14031
|
});
|
|
14020
14032
|
},
|
|
14021
14033
|
// 从扫码添加插件(新增)
|
|
14022
14034
|
handleClientDisconnected: async (Y) => {
|
|
14023
|
-
const z = Y, U = c.value.find((
|
|
14024
|
-
return await t.removeMcpServer(Y), U ? (c.value = c.value.filter((
|
|
14035
|
+
const z = Y, U = c.value.find((ee) => ee.id === z);
|
|
14036
|
+
return await t.removeMcpServer(Y), U ? (c.value = c.value.filter((ee) => ee.id !== z), x(z), U) : null;
|
|
14025
14037
|
},
|
|
14026
14038
|
searchPlugin: (Y, z) => Y.trim() === "" || z.name.toLowerCase().includes(Y.toLowerCase()),
|
|
14027
14039
|
syncInstalledPluginTools: _
|
|
@@ -14508,34 +14520,34 @@ function Ww(t) {
|
|
|
14508
14520
|
clearAttachments: v
|
|
14509
14521
|
};
|
|
14510
14522
|
}
|
|
14511
|
-
var
|
|
14523
|
+
var _e;
|
|
14512
14524
|
(function(t) {
|
|
14513
14525
|
t[t.QR_CODE = 0] = "QR_CODE", t[t.AZTEC = 1] = "AZTEC", t[t.CODABAR = 2] = "CODABAR", t[t.CODE_39 = 3] = "CODE_39", t[t.CODE_93 = 4] = "CODE_93", t[t.CODE_128 = 5] = "CODE_128", t[t.DATA_MATRIX = 6] = "DATA_MATRIX", t[t.MAXICODE = 7] = "MAXICODE", t[t.ITF = 8] = "ITF", t[t.EAN_13 = 9] = "EAN_13", t[t.EAN_8 = 10] = "EAN_8", t[t.PDF_417 = 11] = "PDF_417", t[t.RSS_14 = 12] = "RSS_14", t[t.RSS_EXPANDED = 13] = "RSS_EXPANDED", t[t.UPC_A = 14] = "UPC_A", t[t.UPC_E = 15] = "UPC_E", t[t.UPC_EAN_EXTENSION = 16] = "UPC_EAN_EXTENSION";
|
|
14514
|
-
})(
|
|
14526
|
+
})(_e || (_e = {}));
|
|
14515
14527
|
var Ml = /* @__PURE__ */ new Map([
|
|
14516
|
-
[
|
|
14517
|
-
[
|
|
14518
|
-
[
|
|
14519
|
-
[
|
|
14520
|
-
[
|
|
14521
|
-
[
|
|
14522
|
-
[
|
|
14523
|
-
[
|
|
14524
|
-
[
|
|
14525
|
-
[
|
|
14526
|
-
[
|
|
14527
|
-
[
|
|
14528
|
-
[
|
|
14529
|
-
[
|
|
14530
|
-
[
|
|
14531
|
-
[
|
|
14532
|
-
[
|
|
14528
|
+
[_e.QR_CODE, "QR_CODE"],
|
|
14529
|
+
[_e.AZTEC, "AZTEC"],
|
|
14530
|
+
[_e.CODABAR, "CODABAR"],
|
|
14531
|
+
[_e.CODE_39, "CODE_39"],
|
|
14532
|
+
[_e.CODE_93, "CODE_93"],
|
|
14533
|
+
[_e.CODE_128, "CODE_128"],
|
|
14534
|
+
[_e.DATA_MATRIX, "DATA_MATRIX"],
|
|
14535
|
+
[_e.MAXICODE, "MAXICODE"],
|
|
14536
|
+
[_e.ITF, "ITF"],
|
|
14537
|
+
[_e.EAN_13, "EAN_13"],
|
|
14538
|
+
[_e.EAN_8, "EAN_8"],
|
|
14539
|
+
[_e.PDF_417, "PDF_417"],
|
|
14540
|
+
[_e.RSS_14, "RSS_14"],
|
|
14541
|
+
[_e.RSS_EXPANDED, "RSS_EXPANDED"],
|
|
14542
|
+
[_e.UPC_A, "UPC_A"],
|
|
14543
|
+
[_e.UPC_E, "UPC_E"],
|
|
14544
|
+
[_e.UPC_EAN_EXTENSION, "UPC_EAN_EXTENSION"]
|
|
14533
14545
|
]), Dl;
|
|
14534
14546
|
(function(t) {
|
|
14535
14547
|
t[t.UNKNOWN = 0] = "UNKNOWN", t[t.URL = 1] = "URL";
|
|
14536
14548
|
})(Dl || (Dl = {}));
|
|
14537
14549
|
function jw(t) {
|
|
14538
|
-
return Object.values(
|
|
14550
|
+
return Object.values(_e).includes(t);
|
|
14539
14551
|
}
|
|
14540
14552
|
var mi;
|
|
14541
14553
|
(function(t) {
|
|
@@ -15274,10 +15286,10 @@ function Jw() {
|
|
|
15274
15286
|
}
|
|
15275
15287
|
}
|
|
15276
15288
|
U.kind = "FormatException";
|
|
15277
|
-
var
|
|
15289
|
+
var ee;
|
|
15278
15290
|
(function(C) {
|
|
15279
15291
|
C[C.Cp437 = 0] = "Cp437", C[C.ISO8859_1 = 1] = "ISO8859_1", C[C.ISO8859_2 = 2] = "ISO8859_2", C[C.ISO8859_3 = 3] = "ISO8859_3", C[C.ISO8859_4 = 4] = "ISO8859_4", C[C.ISO8859_5 = 5] = "ISO8859_5", C[C.ISO8859_6 = 6] = "ISO8859_6", C[C.ISO8859_7 = 7] = "ISO8859_7", C[C.ISO8859_8 = 8] = "ISO8859_8", C[C.ISO8859_9 = 9] = "ISO8859_9", C[C.ISO8859_10 = 10] = "ISO8859_10", C[C.ISO8859_11 = 11] = "ISO8859_11", C[C.ISO8859_13 = 12] = "ISO8859_13", C[C.ISO8859_14 = 13] = "ISO8859_14", C[C.ISO8859_15 = 14] = "ISO8859_15", C[C.ISO8859_16 = 15] = "ISO8859_16", C[C.SJIS = 16] = "SJIS", C[C.Cp1250 = 17] = "Cp1250", C[C.Cp1251 = 18] = "Cp1251", C[C.Cp1252 = 19] = "Cp1252", C[C.Cp1256 = 20] = "Cp1256", C[C.UnicodeBigUnmarked = 21] = "UnicodeBigUnmarked", C[C.UTF8 = 22] = "UTF8", C[C.ASCII = 23] = "ASCII", C[C.Big5 = 24] = "Big5", C[C.GB18030 = 25] = "GB18030", C[C.EUC_KR = 26] = "EUC_KR";
|
|
15280
|
-
})(
|
|
15292
|
+
})(ee || (ee = {}));
|
|
15281
15293
|
class I {
|
|
15282
15294
|
constructor(e, n, i, ...s) {
|
|
15283
15295
|
this.valueIdentifier = e, this.name = i, typeof n == "number" ? this.values = Int32Array.from([n]) : this.values = n, this.otherEncodingNames = s, I.VALUE_IDENTIFIER_TO_ECI.set(e, this), I.NAME_TO_ECI.set(i, this);
|
|
@@ -15341,11 +15353,11 @@ function Jw() {
|
|
|
15341
15353
|
return this.getName() === n.getName();
|
|
15342
15354
|
}
|
|
15343
15355
|
}
|
|
15344
|
-
I.VALUE_IDENTIFIER_TO_ECI = /* @__PURE__ */ new Map(), I.VALUES_TO_ECI = /* @__PURE__ */ new Map(), I.NAME_TO_ECI = /* @__PURE__ */ new Map(), I.Cp437 = new I(
|
|
15345
|
-
class
|
|
15356
|
+
I.VALUE_IDENTIFIER_TO_ECI = /* @__PURE__ */ new Map(), I.VALUES_TO_ECI = /* @__PURE__ */ new Map(), I.NAME_TO_ECI = /* @__PURE__ */ new Map(), I.Cp437 = new I(ee.Cp437, Int32Array.from([0, 2]), "Cp437"), I.ISO8859_1 = new I(ee.ISO8859_1, Int32Array.from([1, 3]), "ISO-8859-1", "ISO88591", "ISO8859_1"), I.ISO8859_2 = new I(ee.ISO8859_2, 4, "ISO-8859-2", "ISO88592", "ISO8859_2"), I.ISO8859_3 = new I(ee.ISO8859_3, 5, "ISO-8859-3", "ISO88593", "ISO8859_3"), I.ISO8859_4 = new I(ee.ISO8859_4, 6, "ISO-8859-4", "ISO88594", "ISO8859_4"), I.ISO8859_5 = new I(ee.ISO8859_5, 7, "ISO-8859-5", "ISO88595", "ISO8859_5"), I.ISO8859_6 = new I(ee.ISO8859_6, 8, "ISO-8859-6", "ISO88596", "ISO8859_6"), I.ISO8859_7 = new I(ee.ISO8859_7, 9, "ISO-8859-7", "ISO88597", "ISO8859_7"), I.ISO8859_8 = new I(ee.ISO8859_8, 10, "ISO-8859-8", "ISO88598", "ISO8859_8"), I.ISO8859_9 = new I(ee.ISO8859_9, 11, "ISO-8859-9", "ISO88599", "ISO8859_9"), I.ISO8859_10 = new I(ee.ISO8859_10, 12, "ISO-8859-10", "ISO885910", "ISO8859_10"), I.ISO8859_11 = new I(ee.ISO8859_11, 13, "ISO-8859-11", "ISO885911", "ISO8859_11"), I.ISO8859_13 = new I(ee.ISO8859_13, 15, "ISO-8859-13", "ISO885913", "ISO8859_13"), I.ISO8859_14 = new I(ee.ISO8859_14, 16, "ISO-8859-14", "ISO885914", "ISO8859_14"), I.ISO8859_15 = new I(ee.ISO8859_15, 17, "ISO-8859-15", "ISO885915", "ISO8859_15"), I.ISO8859_16 = new I(ee.ISO8859_16, 18, "ISO-8859-16", "ISO885916", "ISO8859_16"), I.SJIS = new I(ee.SJIS, 20, "SJIS", "Shift_JIS"), I.Cp1250 = new I(ee.Cp1250, 21, "Cp1250", "windows-1250"), I.Cp1251 = new I(ee.Cp1251, 22, "Cp1251", "windows-1251"), I.Cp1252 = new I(ee.Cp1252, 23, "Cp1252", "windows-1252"), I.Cp1256 = new I(ee.Cp1256, 24, "Cp1256", "windows-1256"), I.UnicodeBigUnmarked = new I(ee.UnicodeBigUnmarked, 25, "UnicodeBigUnmarked", "UTF-16BE", "UnicodeBig"), I.UTF8 = new I(ee.UTF8, 26, "UTF8", "UTF-8"), I.ASCII = new I(ee.ASCII, Int32Array.from([27, 170]), "ASCII", "US-ASCII"), I.Big5 = new I(ee.Big5, 28, "Big5"), I.GB18030 = new I(ee.GB18030, 29, "GB18030", "GB2312", "EUC_CN", "GBK"), I.EUC_KR = new I(ee.EUC_KR, 30, "EUC_KR", "EUC-KR");
|
|
15357
|
+
class Te extends x {
|
|
15346
15358
|
}
|
|
15347
|
-
|
|
15348
|
-
class
|
|
15359
|
+
Te.kind = "UnsupportedOperationException";
|
|
15360
|
+
class ye {
|
|
15349
15361
|
/**
|
|
15350
15362
|
* Decodes some Uint8Array to a string format.
|
|
15351
15363
|
*/
|
|
@@ -15360,7 +15372,7 @@ function Jw() {
|
|
|
15360
15372
|
* @param encodingName
|
|
15361
15373
|
*/
|
|
15362
15374
|
static shouldDecodeOnFallback(e) {
|
|
15363
|
-
return !
|
|
15375
|
+
return !ye.isBrowser() && e === "ISO-8859-1";
|
|
15364
15376
|
}
|
|
15365
15377
|
/**
|
|
15366
15378
|
* Encodes some string into a Uint8Array.
|
|
@@ -15389,7 +15401,7 @@ function Jw() {
|
|
|
15389
15401
|
*/
|
|
15390
15402
|
static decodeFallback(e, n) {
|
|
15391
15403
|
const i = this.encodingCharacterSet(n);
|
|
15392
|
-
if (
|
|
15404
|
+
if (ye.isDecodeFallbackSupported(i)) {
|
|
15393
15405
|
let s = "";
|
|
15394
15406
|
for (let a = 0, l = e.length; a < l; a++) {
|
|
15395
15407
|
let d = e[a].toString(16);
|
|
@@ -15399,7 +15411,7 @@ function Jw() {
|
|
|
15399
15411
|
}
|
|
15400
15412
|
if (i.equals(I.UnicodeBigUnmarked))
|
|
15401
15413
|
return String.fromCharCode.apply(null, new Uint16Array(e.buffer));
|
|
15402
|
-
throw new
|
|
15414
|
+
throw new Te(`Encoding ${this.encodingName(n)} not supported by fallback.`);
|
|
15403
15415
|
}
|
|
15404
15416
|
static isDecodeFallbackSupported(e) {
|
|
15405
15417
|
return e.equals(I.UTF8) || e.equals(I.ISO8859_1) || e.equals(I.ASCII);
|
|
@@ -15416,12 +15428,12 @@ function Jw() {
|
|
|
15416
15428
|
return new Uint8Array(s);
|
|
15417
15429
|
}
|
|
15418
15430
|
}
|
|
15419
|
-
class
|
|
15431
|
+
class ne {
|
|
15420
15432
|
// SHIFT_JIS.equalsIgnoreCase(PLATFORM_DEFAULT_ENCODING) ||
|
|
15421
15433
|
// EUC_JP.equalsIgnoreCase(PLATFORM_DEFAULT_ENCODING);
|
|
15422
15434
|
static castAsNonUtf8Char(e, n = null) {
|
|
15423
15435
|
const i = n ? n.getName() : this.ISO88591;
|
|
15424
|
-
return
|
|
15436
|
+
return ye.decode(new Uint8Array([e]), i);
|
|
15425
15437
|
}
|
|
15426
15438
|
/**
|
|
15427
15439
|
* @param bytes bytes encoding a string, whose encoding should be guessed
|
|
@@ -15443,7 +15455,7 @@ function Jw() {
|
|
|
15443
15455
|
const se = e[le] & 255;
|
|
15444
15456
|
l && (d > 0 ? (se & 128) === 0 ? l = !1 : d-- : (se & 128) !== 0 && ((se & 64) === 0 ? l = !1 : (d++, (se & 32) === 0 ? h++ : (d++, (se & 16) === 0 ? p++ : (d++, (se & 8) === 0 ? y++ : l = !1))))), s && (se > 127 && se < 160 ? s = !1 : se > 159 && (se < 192 || se === 215 || se === 247) && q++), a && (b > 0 ? se < 64 || se === 127 || se > 252 ? a = !1 : b-- : se === 128 || se === 160 || se > 239 ? a = !1 : se > 160 && se < 224 ? (E++, B = 0, O++, O > L && (L = O)) : se > 127 ? (b++, O = 0, B++, B > V && (V = B)) : (O = 0, B = 0));
|
|
15445
15457
|
}
|
|
15446
|
-
return l && d > 0 && (l = !1), a && b > 0 && (a = !1), l && (ae || h + p + y > 0) ?
|
|
15458
|
+
return l && d > 0 && (l = !1), a && b > 0 && (a = !1), l && (ae || h + p + y > 0) ? ne.UTF8 : a && (ne.ASSUME_SHIFT_JIS || L >= 3 || V >= 3) ? ne.SHIFT_JIS : s && a ? L === 2 && E === 2 || q * 10 >= i ? ne.SHIFT_JIS : ne.ISO88591 : s ? ne.ISO88591 : a ? ne.SHIFT_JIS : l ? ne.UTF8 : ne.PLATFORM_DEFAULT_ENCODING;
|
|
15447
15459
|
}
|
|
15448
15460
|
/**
|
|
15449
15461
|
*
|
|
@@ -15497,7 +15509,7 @@ function Jw() {
|
|
|
15497
15509
|
*
|
|
15498
15510
|
*/
|
|
15499
15511
|
static getBytes(e, n) {
|
|
15500
|
-
return
|
|
15512
|
+
return ye.encode(e, n);
|
|
15501
15513
|
}
|
|
15502
15514
|
/**
|
|
15503
15515
|
* Returns the charcode at the specified index or at index zero.
|
|
@@ -15512,7 +15524,7 @@ function Jw() {
|
|
|
15512
15524
|
return String.fromCharCode(e);
|
|
15513
15525
|
}
|
|
15514
15526
|
}
|
|
15515
|
-
|
|
15527
|
+
ne.SHIFT_JIS = I.SJIS.getName(), ne.GB2312 = "GB2312", ne.ISO88591 = I.ISO8859_1.getName(), ne.EUC_JP = "EUC_JP", ne.UTF8 = I.UTF8.getName(), ne.PLATFORM_DEFAULT_ENCODING = ne.UTF8, ne.ASSUME_SHIFT_JIS = !1;
|
|
15516
15528
|
class me {
|
|
15517
15529
|
constructor(e = "") {
|
|
15518
15530
|
this.value = e;
|
|
@@ -15521,7 +15533,7 @@ function Jw() {
|
|
|
15521
15533
|
return this.encoding = e, this;
|
|
15522
15534
|
}
|
|
15523
15535
|
append(e) {
|
|
15524
|
-
return typeof e == "string" ? this.value += e.toString() : this.encoding ? this.value +=
|
|
15536
|
+
return typeof e == "string" ? this.value += e.toString() : this.encoding ? this.value += ne.castAsNonUtf8Char(e, this.encoding) : this.value += String.fromCharCode(e), this;
|
|
15525
15537
|
}
|
|
15526
15538
|
appendChars(e, n, i) {
|
|
15527
15539
|
for (let s = n; n < n + i; s++)
|
|
@@ -15976,7 +15988,7 @@ function Jw() {
|
|
|
15976
15988
|
}
|
|
15977
15989
|
}
|
|
15978
15990
|
ge.LUMINANCE_BITS = 5, ge.LUMINANCE_SHIFT = 8 - ge.LUMINANCE_BITS, ge.LUMINANCE_BUCKETS = 1 << ge.LUMINANCE_BITS, ge.EMPTY = Uint8ClampedArray.from([0]);
|
|
15979
|
-
class
|
|
15991
|
+
class te extends ge {
|
|
15980
15992
|
constructor(e) {
|
|
15981
15993
|
super(e), this.matrix = null;
|
|
15982
15994
|
}
|
|
@@ -15990,21 +16002,21 @@ function Jw() {
|
|
|
15990
16002
|
if (this.matrix !== null)
|
|
15991
16003
|
return this.matrix;
|
|
15992
16004
|
const e = this.getLuminanceSource(), n = e.getWidth(), i = e.getHeight();
|
|
15993
|
-
if (n >=
|
|
16005
|
+
if (n >= te.MINIMUM_DIMENSION && i >= te.MINIMUM_DIMENSION) {
|
|
15994
16006
|
const s = e.getMatrix();
|
|
15995
|
-
let a = n >>
|
|
15996
|
-
(n &
|
|
15997
|
-
let l = i >>
|
|
15998
|
-
(i &
|
|
15999
|
-
const d =
|
|
16000
|
-
|
|
16007
|
+
let a = n >> te.BLOCK_SIZE_POWER;
|
|
16008
|
+
(n & te.BLOCK_SIZE_MASK) !== 0 && a++;
|
|
16009
|
+
let l = i >> te.BLOCK_SIZE_POWER;
|
|
16010
|
+
(i & te.BLOCK_SIZE_MASK) !== 0 && l++;
|
|
16011
|
+
const d = te.calculateBlackPoints(s, a, l, n, i), h = new Me(n, i);
|
|
16012
|
+
te.calculateThresholdForBlock(s, a, l, n, i, d, h), this.matrix = h;
|
|
16001
16013
|
} else
|
|
16002
16014
|
this.matrix = super.getBlackMatrix();
|
|
16003
16015
|
return this.matrix;
|
|
16004
16016
|
}
|
|
16005
16017
|
/*@Override*/
|
|
16006
16018
|
createBinarizer(e) {
|
|
16007
|
-
return new
|
|
16019
|
+
return new te(e);
|
|
16008
16020
|
}
|
|
16009
16021
|
/**
|
|
16010
16022
|
* For each block in the image, calculate the average black point using a 5x5 grid
|
|
@@ -16012,22 +16024,22 @@ function Jw() {
|
|
|
16012
16024
|
* on the last pixels in the row/column which are also used in the previous block).
|
|
16013
16025
|
*/
|
|
16014
16026
|
static calculateThresholdForBlock(e, n, i, s, a, l, d) {
|
|
16015
|
-
const h = a -
|
|
16027
|
+
const h = a - te.BLOCK_SIZE, p = s - te.BLOCK_SIZE;
|
|
16016
16028
|
for (let y = 0; y < i; y++) {
|
|
16017
|
-
let b = y <<
|
|
16029
|
+
let b = y << te.BLOCK_SIZE_POWER;
|
|
16018
16030
|
b > h && (b = h);
|
|
16019
|
-
const E =
|
|
16031
|
+
const E = te.cap(y, 2, i - 3);
|
|
16020
16032
|
for (let O = 0; O < n; O++) {
|
|
16021
|
-
let B = O <<
|
|
16033
|
+
let B = O << te.BLOCK_SIZE_POWER;
|
|
16022
16034
|
B > p && (B = p);
|
|
16023
|
-
const L =
|
|
16035
|
+
const L = te.cap(O, 2, n - 3);
|
|
16024
16036
|
let V = 0;
|
|
16025
16037
|
for (let ae = -2; ae <= 2; ae++) {
|
|
16026
16038
|
const le = l[E + ae];
|
|
16027
16039
|
V += le[L - 2] + le[L - 1] + le[L] + le[L + 1] + le[L + 2];
|
|
16028
16040
|
}
|
|
16029
16041
|
const q = V / 25;
|
|
16030
|
-
|
|
16042
|
+
te.thresholdBlock(e, B, b, q, s, d);
|
|
16031
16043
|
}
|
|
16032
16044
|
}
|
|
16033
16045
|
}
|
|
@@ -16038,8 +16050,8 @@ function Jw() {
|
|
|
16038
16050
|
* Applies a single threshold to a block of pixels.
|
|
16039
16051
|
*/
|
|
16040
16052
|
static thresholdBlock(e, n, i, s, a, l) {
|
|
16041
|
-
for (let d = 0, h = i * a + n; d <
|
|
16042
|
-
for (let p = 0; p <
|
|
16053
|
+
for (let d = 0, h = i * a + n; d < te.BLOCK_SIZE; d++, h += a)
|
|
16054
|
+
for (let p = 0; p < te.BLOCK_SIZE; p++)
|
|
16043
16055
|
(e[h + p] & 255) <= s && l.set(n + p, i + d);
|
|
16044
16056
|
}
|
|
16045
16057
|
/**
|
|
@@ -16048,27 +16060,27 @@ function Jw() {
|
|
|
16048
16060
|
* http://groups.google.com/group/zxing/browse_thread/thread/d06efa2c35a7ddc0
|
|
16049
16061
|
*/
|
|
16050
16062
|
static calculateBlackPoints(e, n, i, s, a) {
|
|
16051
|
-
const l = a -
|
|
16063
|
+
const l = a - te.BLOCK_SIZE, d = s - te.BLOCK_SIZE, h = new Array(i);
|
|
16052
16064
|
for (let p = 0; p < i; p++) {
|
|
16053
16065
|
h[p] = new Int32Array(n);
|
|
16054
|
-
let y = p <<
|
|
16066
|
+
let y = p << te.BLOCK_SIZE_POWER;
|
|
16055
16067
|
y > l && (y = l);
|
|
16056
16068
|
for (let b = 0; b < n; b++) {
|
|
16057
|
-
let E = b <<
|
|
16069
|
+
let E = b << te.BLOCK_SIZE_POWER;
|
|
16058
16070
|
E > d && (E = d);
|
|
16059
16071
|
let O = 0, B = 255, L = 0;
|
|
16060
|
-
for (let q = 0, ae = y * s + E; q <
|
|
16061
|
-
for (let le = 0; le <
|
|
16072
|
+
for (let q = 0, ae = y * s + E; q < te.BLOCK_SIZE; q++, ae += s) {
|
|
16073
|
+
for (let le = 0; le < te.BLOCK_SIZE; le++) {
|
|
16062
16074
|
const se = e[ae + le] & 255;
|
|
16063
16075
|
O += se, se < B && (B = se), se > L && (L = se);
|
|
16064
16076
|
}
|
|
16065
|
-
if (L - B >
|
|
16066
|
-
for (q++, ae += s; q <
|
|
16067
|
-
for (let le = 0; le <
|
|
16077
|
+
if (L - B > te.MIN_DYNAMIC_RANGE)
|
|
16078
|
+
for (q++, ae += s; q < te.BLOCK_SIZE; q++, ae += s)
|
|
16079
|
+
for (let le = 0; le < te.BLOCK_SIZE; le++)
|
|
16068
16080
|
O += e[ae + le] & 255;
|
|
16069
16081
|
}
|
|
16070
|
-
let V = O >>
|
|
16071
|
-
if (L - B <=
|
|
16082
|
+
let V = O >> te.BLOCK_SIZE_POWER * 2;
|
|
16083
|
+
if (L - B <= te.MIN_DYNAMIC_RANGE && (V = B / 2, p > 0 && b > 0)) {
|
|
16072
16084
|
const q = (h[p - 1][b] + 2 * h[p][b - 1] + h[p - 1][b - 1]) / 4;
|
|
16073
16085
|
B < q && (V = q);
|
|
16074
16086
|
}
|
|
@@ -16078,7 +16090,7 @@ function Jw() {
|
|
|
16078
16090
|
return h;
|
|
16079
16091
|
}
|
|
16080
16092
|
}
|
|
16081
|
-
|
|
16093
|
+
te.BLOCK_SIZE_POWER = 3, te.BLOCK_SIZE = 1 << te.BLOCK_SIZE_POWER, te.BLOCK_SIZE_MASK = te.BLOCK_SIZE - 1, te.MINIMUM_DIMENSION = te.BLOCK_SIZE * 5, te.MIN_DYNAMIC_RANGE = 24;
|
|
16082
16094
|
class K {
|
|
16083
16095
|
constructor(e, n) {
|
|
16084
16096
|
this.width = e, this.height = n;
|
|
@@ -16112,7 +16124,7 @@ function Jw() {
|
|
|
16112
16124
|
* @return A cropped version of this object.
|
|
16113
16125
|
*/
|
|
16114
16126
|
crop(e, n, i, s) {
|
|
16115
|
-
throw new
|
|
16127
|
+
throw new Te("This luminance source does not support cropping.");
|
|
16116
16128
|
}
|
|
16117
16129
|
/**
|
|
16118
16130
|
* @return Whether this subclass supports counter-clockwise rotation.
|
|
@@ -16127,7 +16139,7 @@ function Jw() {
|
|
|
16127
16139
|
* @return A rotated version of this object.
|
|
16128
16140
|
*/
|
|
16129
16141
|
rotateCounterClockwise() {
|
|
16130
|
-
throw new
|
|
16142
|
+
throw new Te("This luminance source does not support rotation by 90 degrees.");
|
|
16131
16143
|
}
|
|
16132
16144
|
/**
|
|
16133
16145
|
* Returns a new object with rotated image data by 45 degrees counterclockwise.
|
|
@@ -16136,7 +16148,7 @@ function Jw() {
|
|
|
16136
16148
|
* @return A rotated version of this object.
|
|
16137
16149
|
*/
|
|
16138
16150
|
rotateCounterClockwise45() {
|
|
16139
|
-
throw new
|
|
16151
|
+
throw new Te("This luminance source does not support rotation by 45 degrees.");
|
|
16140
16152
|
}
|
|
16141
16153
|
/*@Override*/
|
|
16142
16154
|
toString() {
|
|
@@ -16270,7 +16282,7 @@ function Jw() {
|
|
|
16270
16282
|
}
|
|
16271
16283
|
}
|
|
16272
16284
|
de.DEGREE_TO_RADIANS = Math.PI / 180;
|
|
16273
|
-
class
|
|
16285
|
+
class re {
|
|
16274
16286
|
/**
|
|
16275
16287
|
* Creates an instance of VideoInputDevice.
|
|
16276
16288
|
*
|
|
@@ -16401,7 +16413,7 @@ function Jw() {
|
|
|
16401
16413
|
*/
|
|
16402
16414
|
getVideoInputDevices() {
|
|
16403
16415
|
return he(this, void 0, void 0, function* () {
|
|
16404
|
-
return (yield this.listVideoInputDevices()).map((n) => new
|
|
16416
|
+
return (yield this.listVideoInputDevices()).map((n) => new re(n.deviceId, n.label));
|
|
16405
16417
|
});
|
|
16406
16418
|
}
|
|
16407
16419
|
/**
|
|
@@ -16878,7 +16890,7 @@ function Jw() {
|
|
|
16878
16890
|
*/
|
|
16879
16891
|
createBinaryBitmap(e) {
|
|
16880
16892
|
this.getCaptureCanvasContext(e), this._isHTMLVideoElement(e) ? this.drawFrameOnCanvas(e) : this.drawImageOnCanvas(e);
|
|
16881
|
-
const n = this.getCaptureCanvas(e), i = new de(n), s = new
|
|
16893
|
+
const n = this.getCaptureCanvas(e), i = new de(n), s = new te(i);
|
|
16882
16894
|
return new D(s);
|
|
16883
16895
|
}
|
|
16884
16896
|
getCaptureCanvasContext(e) {
|
|
@@ -17514,7 +17526,7 @@ function Jw() {
|
|
|
17514
17526
|
}
|
|
17515
17527
|
const p = Ye.readCode(e, l, 8);
|
|
17516
17528
|
a += /*(char)*/
|
|
17517
|
-
|
|
17529
|
+
ne.castAsNonUtf8Char(p), l += 8;
|
|
17518
17530
|
}
|
|
17519
17531
|
s = i;
|
|
17520
17532
|
} else {
|
|
@@ -17887,7 +17899,7 @@ function Jw() {
|
|
|
17887
17899
|
}
|
|
17888
17900
|
}
|
|
17889
17901
|
Ln.MAX_VALUE = Number.MAX_SAFE_INTEGER;
|
|
17890
|
-
class
|
|
17902
|
+
class ve {
|
|
17891
17903
|
constructor(e, n) {
|
|
17892
17904
|
this.x = e, this.y = n;
|
|
17893
17905
|
}
|
|
@@ -17899,7 +17911,7 @@ function Jw() {
|
|
|
17899
17911
|
}
|
|
17900
17912
|
/*@Override*/
|
|
17901
17913
|
equals(e) {
|
|
17902
|
-
if (e instanceof
|
|
17914
|
+
if (e instanceof ve) {
|
|
17903
17915
|
const n = e;
|
|
17904
17916
|
return this.x === n.x && this.y === n.y;
|
|
17905
17917
|
}
|
|
@@ -18066,7 +18078,7 @@ function Jw() {
|
|
|
18066
18078
|
for (let p = 0; p < a; p++) {
|
|
18067
18079
|
const y = Ve.round(e + p * l), b = Ve.round(n + p * d);
|
|
18068
18080
|
if (h.get(y, b))
|
|
18069
|
-
return new
|
|
18081
|
+
return new ve(y, b);
|
|
18070
18082
|
}
|
|
18071
18083
|
return null;
|
|
18072
18084
|
}
|
|
@@ -18086,15 +18098,15 @@ function Jw() {
|
|
|
18086
18098
|
centerEdges(e, n, i, s) {
|
|
18087
18099
|
const a = e.getX(), l = e.getY(), d = n.getX(), h = n.getY(), p = i.getX(), y = i.getY(), b = s.getX(), E = s.getY(), O = an.CORR;
|
|
18088
18100
|
return a < this.width / 2 ? [
|
|
18089
|
-
new
|
|
18090
|
-
new
|
|
18091
|
-
new
|
|
18092
|
-
new
|
|
18101
|
+
new ve(b - O, E + O),
|
|
18102
|
+
new ve(d + O, h + O),
|
|
18103
|
+
new ve(p - O, y - O),
|
|
18104
|
+
new ve(a + O, l - O)
|
|
18093
18105
|
] : [
|
|
18094
|
-
new
|
|
18095
|
-
new
|
|
18096
|
-
new
|
|
18097
|
-
new
|
|
18106
|
+
new ve(b + O, E + O),
|
|
18107
|
+
new ve(d + O, h - O),
|
|
18108
|
+
new ve(p - O, y + O),
|
|
18109
|
+
new ve(a - O, l - O)
|
|
18098
18110
|
];
|
|
18099
18111
|
}
|
|
18100
18112
|
/**
|
|
@@ -18242,12 +18254,12 @@ function Jw() {
|
|
|
18242
18254
|
}
|
|
18243
18255
|
}
|
|
18244
18256
|
k.gridSampler = new hr();
|
|
18245
|
-
class
|
|
18257
|
+
class ie {
|
|
18246
18258
|
constructor(e, n) {
|
|
18247
18259
|
this.x = e, this.y = n;
|
|
18248
18260
|
}
|
|
18249
18261
|
toResultPoint() {
|
|
18250
|
-
return new
|
|
18262
|
+
return new ve(this.getX(), this.getY());
|
|
18251
18263
|
}
|
|
18252
18264
|
getX() {
|
|
18253
18265
|
return this.x;
|
|
@@ -18367,7 +18379,7 @@ function Jw() {
|
|
|
18367
18379
|
if (this.nbCenterLayers !== 5 && this.nbCenterLayers !== 7)
|
|
18368
18380
|
throw new $();
|
|
18369
18381
|
this.compact = this.nbCenterLayers === 5;
|
|
18370
|
-
let d = new
|
|
18382
|
+
let d = new ve(n.getX() + 0.5, n.getY() - 0.5), h = new ve(i.getX() + 0.5, i.getY() + 0.5), p = new ve(s.getX() - 0.5, s.getY() + 0.5), y = new ve(a.getX() - 0.5, a.getY() - 0.5);
|
|
18371
18383
|
return this.expandSquare([d, h, p, y], 2 * this.nbCenterLayers - 3, 2 * this.nbCenterLayers);
|
|
18372
18384
|
}
|
|
18373
18385
|
/**
|
|
@@ -18382,16 +18394,16 @@ function Jw() {
|
|
|
18382
18394
|
e = d[0], n = d[1], i = d[2], s = d[3];
|
|
18383
18395
|
} catch {
|
|
18384
18396
|
let h = this.image.getWidth() / 2, p = this.image.getHeight() / 2;
|
|
18385
|
-
e = this.getFirstDifferent(new
|
|
18397
|
+
e = this.getFirstDifferent(new ie(h + 7, p - 7), !1, 1, -1).toResultPoint(), n = this.getFirstDifferent(new ie(h + 7, p + 7), !1, 1, 1).toResultPoint(), i = this.getFirstDifferent(new ie(h - 7, p + 7), !1, -1, 1).toResultPoint(), s = this.getFirstDifferent(new ie(h - 7, p - 7), !1, -1, -1).toResultPoint();
|
|
18386
18398
|
}
|
|
18387
18399
|
let a = Ve.round((e.getX() + s.getX() + n.getX() + i.getX()) / 4), l = Ve.round((e.getY() + s.getY() + n.getY() + i.getY()) / 4);
|
|
18388
18400
|
try {
|
|
18389
18401
|
let d = new an(this.image, 15, a, l).detect();
|
|
18390
18402
|
e = d[0], n = d[1], i = d[2], s = d[3];
|
|
18391
18403
|
} catch {
|
|
18392
|
-
e = this.getFirstDifferent(new
|
|
18404
|
+
e = this.getFirstDifferent(new ie(a + 7, l - 7), !1, 1, -1).toResultPoint(), n = this.getFirstDifferent(new ie(a + 7, l + 7), !1, 1, 1).toResultPoint(), i = this.getFirstDifferent(new ie(a - 7, l + 7), !1, -1, 1).toResultPoint(), s = this.getFirstDifferent(new ie(a - 7, l - 7), !1, -1, -1).toResultPoint();
|
|
18393
18405
|
}
|
|
18394
|
-
return a = Ve.round((e.getX() + s.getX() + n.getX() + i.getX()) / 4), l = Ve.round((e.getY() + s.getY() + n.getY() + i.getY()) / 4), new
|
|
18406
|
+
return a = Ve.round((e.getX() + s.getX() + n.getX() + i.getX()) / 4), l = Ve.round((e.getY() + s.getY() + n.getY() + i.getY()) / 4), new ie(a, l);
|
|
18395
18407
|
}
|
|
18396
18408
|
/**
|
|
18397
18409
|
* Gets the Aztec code corners from the bull's eye corners and the parameters.
|
|
@@ -18455,7 +18467,7 @@ function Jw() {
|
|
|
18455
18467
|
*/
|
|
18456
18468
|
isWhiteOrBlackRectangle(e, n, i, s) {
|
|
18457
18469
|
let a = 3;
|
|
18458
|
-
e = new
|
|
18470
|
+
e = new ie(e.getX() - a, e.getY() + a), n = new ie(n.getX() - a, n.getY() - a), i = new ie(i.getX() + a, i.getY() - a), s = new ie(s.getX() + a, s.getY() + a);
|
|
18459
18471
|
let l = this.getColor(s, e);
|
|
18460
18472
|
if (l === 0)
|
|
18461
18473
|
return !1;
|
|
@@ -18485,7 +18497,7 @@ function Jw() {
|
|
|
18485
18497
|
a += i;
|
|
18486
18498
|
for (a -= i; this.isValid(a, l) && this.image.get(a, l) === n; )
|
|
18487
18499
|
l += s;
|
|
18488
|
-
return l -= s, new
|
|
18500
|
+
return l -= s, new ie(a, l);
|
|
18489
18501
|
}
|
|
18490
18502
|
/**
|
|
18491
18503
|
* Expand the square represented by the corner points by pushing out equally in all directions
|
|
@@ -18496,9 +18508,9 @@ function Jw() {
|
|
|
18496
18508
|
* @return the corners of the expanded square
|
|
18497
18509
|
*/
|
|
18498
18510
|
expandSquare(e, n, i) {
|
|
18499
|
-
let s = i / (2 * n), a = e[0].getX() - e[2].getX(), l = e[0].getY() - e[2].getY(), d = (e[0].getX() + e[2].getX()) / 2, h = (e[0].getY() + e[2].getY()) / 2, p = new
|
|
18511
|
+
let s = i / (2 * n), a = e[0].getX() - e[2].getX(), l = e[0].getY() - e[2].getY(), d = (e[0].getX() + e[2].getX()) / 2, h = (e[0].getY() + e[2].getY()) / 2, p = new ve(d + s * a, h + s * l), y = new ve(d - s * a, h - s * l);
|
|
18500
18512
|
a = e[1].getX() - e[3].getX(), l = e[1].getY() - e[3].getY(), d = (e[1].getX() + e[3].getX()) / 2, h = (e[1].getY() + e[3].getY()) / 2;
|
|
18501
|
-
let b = new
|
|
18513
|
+
let b = new ve(d + s * a, h + s * l), E = new ve(d - s * a, h - s * l);
|
|
18502
18514
|
return [p, b, y, E];
|
|
18503
18515
|
}
|
|
18504
18516
|
isValid(e, n) {
|
|
@@ -18590,7 +18602,7 @@ function Jw() {
|
|
|
18590
18602
|
if (p !== null) {
|
|
18591
18603
|
const y = a.getHeight();
|
|
18592
18604
|
for (let b = 0; b < p.length; b++)
|
|
18593
|
-
p[b] = new
|
|
18605
|
+
p[b] = new ve(y - p[b].getY() - 1, p[b].getX());
|
|
18594
18606
|
}
|
|
18595
18607
|
return l;
|
|
18596
18608
|
} else
|
|
@@ -18640,7 +18652,7 @@ function Jw() {
|
|
|
18640
18652
|
if (B === 1) {
|
|
18641
18653
|
L.putMetadata(ze.ORIENTATION, 180);
|
|
18642
18654
|
const V = L.getResultPoints();
|
|
18643
|
-
V !== null && (V[0] = new
|
|
18655
|
+
V !== null && (V[0] = new ve(i - V[0].getX() - 1, V[0].getY()), V[1] = new ve(i - V[1].getX() - 1, V[1].getY()));
|
|
18644
18656
|
}
|
|
18645
18657
|
return L;
|
|
18646
18658
|
} catch {
|
|
@@ -18878,7 +18890,7 @@ function Jw() {
|
|
|
18878
18890
|
const fn = (a[1] + a[0]) / 2, ut = O + dn / 2, qt = h.length, gn = new Uint8Array(qt);
|
|
18879
18891
|
for (let Fr = 0; Fr < qt; Fr++)
|
|
18880
18892
|
gn[Fr] = h[Fr];
|
|
18881
|
-
const Lr = [new
|
|
18893
|
+
const Lr = [new ve(fn, e), new ve(ut, e)];
|
|
18882
18894
|
return new Ae(E, gn, 0, Lr, Ce.CODE_128, (/* @__PURE__ */ new Date()).getTime());
|
|
18883
18895
|
}
|
|
18884
18896
|
}
|
|
@@ -19056,7 +19068,7 @@ function Jw() {
|
|
|
19056
19068
|
let E;
|
|
19057
19069
|
this.extendedMode ? E = Pt.decodeExtended(this.decodeRowResult) : E = this.decodeRowResult;
|
|
19058
19070
|
let O = (a[1] + a[0]) / 2, B = p + y / 2;
|
|
19059
|
-
return new Ae(E, null, 0, [new
|
|
19071
|
+
return new Ae(E, null, 0, [new ve(O, e), new ve(B, e)], Ce.CODE_39, (/* @__PURE__ */ new Date()).getTime());
|
|
19060
19072
|
}
|
|
19061
19073
|
static findAsteriskPattern(e, n) {
|
|
19062
19074
|
let i = e.getSize(), s = e.getNextSet(0), a = 0, l = s, d = !1, h = n.length;
|
|
@@ -19234,7 +19246,7 @@ function Jw() {
|
|
|
19234
19246
|
}
|
|
19235
19247
|
if (!y && p > b && (y = !0), !y)
|
|
19236
19248
|
throw new U();
|
|
19237
|
-
const E = [new
|
|
19249
|
+
const E = [new ve(s[1], e), new ve(a[0], e)];
|
|
19238
19250
|
return new Ae(
|
|
19239
19251
|
d,
|
|
19240
19252
|
null,
|
|
@@ -19524,8 +19536,8 @@ function Jw() {
|
|
|
19524
19536
|
}
|
|
19525
19537
|
decodeRow(e, n, i) {
|
|
19526
19538
|
let s = this.decodeRowStringBuffer, a = this.decodeMiddle(n, i, s), l = s.toString(), d = He.parseExtensionString(l), h = [
|
|
19527
|
-
new
|
|
19528
|
-
new
|
|
19539
|
+
new ve((i[0] + i[1]) / 2, e),
|
|
19540
|
+
new ve(a, e)
|
|
19529
19541
|
], p = new Ae(l, null, 0, h, Ce.UPC_EAN_EXTENSION, (/* @__PURE__ */ new Date()).getTime());
|
|
19530
19542
|
return d != null && p.putAllMetadata(d), p;
|
|
19531
19543
|
}
|
|
@@ -19607,8 +19619,8 @@ function Jw() {
|
|
|
19607
19619
|
}
|
|
19608
19620
|
decodeRow(e, n, i) {
|
|
19609
19621
|
let s = this.decodeRowStringBuffer, a = this.decodeMiddle(n, i, s), l = s.toString(), d = ke.parseExtensionString(l), h = [
|
|
19610
|
-
new
|
|
19611
|
-
new
|
|
19622
|
+
new ve((i[0] + i[1]) / 2, e),
|
|
19623
|
+
new ve(a, e)
|
|
19612
19624
|
], p = new Ae(l, null, 0, h, Ce.UPC_EAN_EXTENSION, (/* @__PURE__ */ new Date()).getTime());
|
|
19613
19625
|
return d != null && p.putAllMetadata(d), p;
|
|
19614
19626
|
}
|
|
@@ -19663,17 +19675,17 @@ function Jw() {
|
|
|
19663
19675
|
decodeRow(e, n, i) {
|
|
19664
19676
|
let s = We.findStartGuardPattern(n), a = i == null ? null : i.get(z.NEED_RESULT_POINT_CALLBACK);
|
|
19665
19677
|
if (a != null) {
|
|
19666
|
-
const se = new
|
|
19678
|
+
const se = new ve((s[0] + s[1]) / 2, e);
|
|
19667
19679
|
a.foundPossibleResultPoint(se);
|
|
19668
19680
|
}
|
|
19669
19681
|
let l = this.decodeMiddle(n, s, this.decodeRowStringBuffer), d = l.rowOffset, h = l.resultString;
|
|
19670
19682
|
if (a != null) {
|
|
19671
|
-
const se = new
|
|
19683
|
+
const se = new ve(d, e);
|
|
19672
19684
|
a.foundPossibleResultPoint(se);
|
|
19673
19685
|
}
|
|
19674
19686
|
let p = this.decodeEnd(n, d);
|
|
19675
19687
|
if (a != null) {
|
|
19676
|
-
const se = new
|
|
19688
|
+
const se = new ve((p[0] + p[1]) / 2, e);
|
|
19677
19689
|
a.foundPossibleResultPoint(se);
|
|
19678
19690
|
}
|
|
19679
19691
|
let y = p[1], b = y + (y - p[0]);
|
|
@@ -19684,7 +19696,7 @@ function Jw() {
|
|
|
19684
19696
|
throw new U();
|
|
19685
19697
|
if (!We.checkChecksum(E))
|
|
19686
19698
|
throw new N();
|
|
19687
|
-
let O = (s[1] + s[0]) / 2, B = (p[1] + p[0]) / 2, L = this.getBarcodeFormat(), V = [new
|
|
19699
|
+
let O = (s[1] + s[0]) / 2, B = (p[1] + p[0]) / 2, L = this.getBarcodeFormat(), V = [new ve(O, e), new ve(B, e)], q = new Ae(E, null, 0, V, L, (/* @__PURE__ */ new Date()).getTime()), ae = 0;
|
|
19688
19700
|
try {
|
|
19689
19701
|
let se = Je.decodeRow(e, n, p[1]);
|
|
19690
19702
|
q.putMetadata(ze.UPC_EAN_EXTENSION, se.getText()), q.putAllMetadata(se.getResultMetadata()), q.addResultPoints(se.getResultPoints()), ae = se.getText().length;
|
|
@@ -20057,7 +20069,7 @@ function Jw() {
|
|
|
20057
20069
|
}
|
|
20058
20070
|
class bi {
|
|
20059
20071
|
constructor(e, n, i, s, a) {
|
|
20060
|
-
this.value = e, this.startEnd = n, this.value = e, this.startEnd = n, this.resultPoints = new Array(), this.resultPoints.push(new
|
|
20072
|
+
this.value = e, this.startEnd = n, this.value = e, this.startEnd = n, this.resultPoints = new Array(), this.resultPoints.push(new ve(i, a)), this.resultPoints.push(new ve(s, a));
|
|
20061
20073
|
}
|
|
20062
20074
|
getValue() {
|
|
20063
20075
|
return this.value;
|
|
@@ -20204,7 +20216,7 @@ function Jw() {
|
|
|
20204
20216
|
}
|
|
20205
20217
|
}
|
|
20206
20218
|
vn.FNC1 = 10;
|
|
20207
|
-
class
|
|
20219
|
+
class we {
|
|
20208
20220
|
constructor() {
|
|
20209
20221
|
}
|
|
20210
20222
|
static parseFieldsInGeneralPurpose(e) {
|
|
@@ -20213,24 +20225,24 @@ function Jw() {
|
|
|
20213
20225
|
if (e.length < 2)
|
|
20214
20226
|
throw new $();
|
|
20215
20227
|
let n = e.substring(0, 2);
|
|
20216
|
-
for (let a of
|
|
20228
|
+
for (let a of we.TWO_DIGIT_DATA_LENGTH)
|
|
20217
20229
|
if (a[0] === n)
|
|
20218
|
-
return a[1] ===
|
|
20230
|
+
return a[1] === we.VARIABLE_LENGTH ? we.processVariableAI(2, a[2], e) : we.processFixedAI(2, a[1], e);
|
|
20219
20231
|
if (e.length < 3)
|
|
20220
20232
|
throw new $();
|
|
20221
20233
|
let i = e.substring(0, 3);
|
|
20222
|
-
for (let a of
|
|
20234
|
+
for (let a of we.THREE_DIGIT_DATA_LENGTH)
|
|
20223
20235
|
if (a[0] === i)
|
|
20224
|
-
return a[1] ===
|
|
20225
|
-
for (let a of
|
|
20236
|
+
return a[1] === we.VARIABLE_LENGTH ? we.processVariableAI(3, a[2], e) : we.processFixedAI(3, a[1], e);
|
|
20237
|
+
for (let a of we.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH)
|
|
20226
20238
|
if (a[0] === i)
|
|
20227
|
-
return a[1] ===
|
|
20239
|
+
return a[1] === we.VARIABLE_LENGTH ? we.processVariableAI(4, a[2], e) : we.processFixedAI(4, a[1], e);
|
|
20228
20240
|
if (e.length < 4)
|
|
20229
20241
|
throw new $();
|
|
20230
20242
|
let s = e.substring(0, 4);
|
|
20231
|
-
for (let a of
|
|
20243
|
+
for (let a of we.FOUR_DIGIT_DATA_LENGTH)
|
|
20232
20244
|
if (a[0] === s)
|
|
20233
|
-
return a[1] ===
|
|
20245
|
+
return a[1] === we.VARIABLE_LENGTH ? we.processVariableAI(4, a[2], e) : we.processFixedAI(4, a[1], e);
|
|
20234
20246
|
throw new $();
|
|
20235
20247
|
}
|
|
20236
20248
|
static processFixedAI(e, n, i) {
|
|
@@ -20239,68 +20251,68 @@ function Jw() {
|
|
|
20239
20251
|
let s = i.substring(0, e);
|
|
20240
20252
|
if (i.length < e + n)
|
|
20241
20253
|
throw new $();
|
|
20242
|
-
let a = i.substring(e, e + n), l = i.substring(e + n), d = "(" + s + ")" + a, h =
|
|
20254
|
+
let a = i.substring(e, e + n), l = i.substring(e + n), d = "(" + s + ")" + a, h = we.parseFieldsInGeneralPurpose(l);
|
|
20243
20255
|
return h == null ? d : d + h;
|
|
20244
20256
|
}
|
|
20245
20257
|
static processVariableAI(e, n, i) {
|
|
20246
20258
|
let s = i.substring(0, e), a;
|
|
20247
20259
|
i.length < e + n ? a = i.length : a = e + n;
|
|
20248
|
-
let l = i.substring(e, a), d = i.substring(a), h = "(" + s + ")" + l, p =
|
|
20260
|
+
let l = i.substring(e, a), d = i.substring(a), h = "(" + s + ")" + l, p = we.parseFieldsInGeneralPurpose(d);
|
|
20249
20261
|
return p == null ? h : h + p;
|
|
20250
20262
|
}
|
|
20251
20263
|
}
|
|
20252
|
-
|
|
20264
|
+
we.VARIABLE_LENGTH = [], we.TWO_DIGIT_DATA_LENGTH = [
|
|
20253
20265
|
["00", 18],
|
|
20254
20266
|
["01", 14],
|
|
20255
20267
|
["02", 14],
|
|
20256
|
-
["10",
|
|
20268
|
+
["10", we.VARIABLE_LENGTH, 20],
|
|
20257
20269
|
["11", 6],
|
|
20258
20270
|
["12", 6],
|
|
20259
20271
|
["13", 6],
|
|
20260
20272
|
["15", 6],
|
|
20261
20273
|
["17", 6],
|
|
20262
20274
|
["20", 2],
|
|
20263
|
-
["21",
|
|
20264
|
-
["22",
|
|
20265
|
-
["30",
|
|
20266
|
-
["37",
|
|
20275
|
+
["21", we.VARIABLE_LENGTH, 20],
|
|
20276
|
+
["22", we.VARIABLE_LENGTH, 29],
|
|
20277
|
+
["30", we.VARIABLE_LENGTH, 8],
|
|
20278
|
+
["37", we.VARIABLE_LENGTH, 8],
|
|
20267
20279
|
// internal company codes
|
|
20268
|
-
["90",
|
|
20269
|
-
["91",
|
|
20270
|
-
["92",
|
|
20271
|
-
["93",
|
|
20272
|
-
["94",
|
|
20273
|
-
["95",
|
|
20274
|
-
["96",
|
|
20275
|
-
["97",
|
|
20276
|
-
["98",
|
|
20277
|
-
["99",
|
|
20278
|
-
],
|
|
20280
|
+
["90", we.VARIABLE_LENGTH, 30],
|
|
20281
|
+
["91", we.VARIABLE_LENGTH, 30],
|
|
20282
|
+
["92", we.VARIABLE_LENGTH, 30],
|
|
20283
|
+
["93", we.VARIABLE_LENGTH, 30],
|
|
20284
|
+
["94", we.VARIABLE_LENGTH, 30],
|
|
20285
|
+
["95", we.VARIABLE_LENGTH, 30],
|
|
20286
|
+
["96", we.VARIABLE_LENGTH, 30],
|
|
20287
|
+
["97", we.VARIABLE_LENGTH, 3],
|
|
20288
|
+
["98", we.VARIABLE_LENGTH, 30],
|
|
20289
|
+
["99", we.VARIABLE_LENGTH, 30]
|
|
20290
|
+
], we.THREE_DIGIT_DATA_LENGTH = [
|
|
20279
20291
|
// Same format as above
|
|
20280
|
-
["240",
|
|
20281
|
-
["241",
|
|
20282
|
-
["242",
|
|
20283
|
-
["250",
|
|
20284
|
-
["251",
|
|
20285
|
-
["253",
|
|
20286
|
-
["254",
|
|
20287
|
-
["400",
|
|
20288
|
-
["401",
|
|
20292
|
+
["240", we.VARIABLE_LENGTH, 30],
|
|
20293
|
+
["241", we.VARIABLE_LENGTH, 30],
|
|
20294
|
+
["242", we.VARIABLE_LENGTH, 6],
|
|
20295
|
+
["250", we.VARIABLE_LENGTH, 30],
|
|
20296
|
+
["251", we.VARIABLE_LENGTH, 30],
|
|
20297
|
+
["253", we.VARIABLE_LENGTH, 17],
|
|
20298
|
+
["254", we.VARIABLE_LENGTH, 20],
|
|
20299
|
+
["400", we.VARIABLE_LENGTH, 30],
|
|
20300
|
+
["401", we.VARIABLE_LENGTH, 30],
|
|
20289
20301
|
["402", 17],
|
|
20290
|
-
["403",
|
|
20302
|
+
["403", we.VARIABLE_LENGTH, 30],
|
|
20291
20303
|
["410", 13],
|
|
20292
20304
|
["411", 13],
|
|
20293
20305
|
["412", 13],
|
|
20294
20306
|
["413", 13],
|
|
20295
20307
|
["414", 13],
|
|
20296
|
-
["420",
|
|
20297
|
-
["421",
|
|
20308
|
+
["420", we.VARIABLE_LENGTH, 20],
|
|
20309
|
+
["421", we.VARIABLE_LENGTH, 15],
|
|
20298
20310
|
["422", 3],
|
|
20299
|
-
["423",
|
|
20311
|
+
["423", we.VARIABLE_LENGTH, 15],
|
|
20300
20312
|
["424", 3],
|
|
20301
20313
|
["425", 3],
|
|
20302
20314
|
["426", 3]
|
|
20303
|
-
],
|
|
20315
|
+
], we.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH = [
|
|
20304
20316
|
// Same format as above
|
|
20305
20317
|
["310", 6],
|
|
20306
20318
|
["311", 6],
|
|
@@ -20354,31 +20366,31 @@ function Jw() {
|
|
|
20354
20366
|
["367", 6],
|
|
20355
20367
|
["368", 6],
|
|
20356
20368
|
["369", 6],
|
|
20357
|
-
["390",
|
|
20358
|
-
["391",
|
|
20359
|
-
["392",
|
|
20360
|
-
["393",
|
|
20361
|
-
["703",
|
|
20362
|
-
],
|
|
20369
|
+
["390", we.VARIABLE_LENGTH, 15],
|
|
20370
|
+
["391", we.VARIABLE_LENGTH, 18],
|
|
20371
|
+
["392", we.VARIABLE_LENGTH, 15],
|
|
20372
|
+
["393", we.VARIABLE_LENGTH, 18],
|
|
20373
|
+
["703", we.VARIABLE_LENGTH, 30]
|
|
20374
|
+
], we.FOUR_DIGIT_DATA_LENGTH = [
|
|
20363
20375
|
// Same format as above
|
|
20364
20376
|
["7001", 13],
|
|
20365
|
-
["7002",
|
|
20377
|
+
["7002", we.VARIABLE_LENGTH, 30],
|
|
20366
20378
|
["7003", 10],
|
|
20367
20379
|
["8001", 14],
|
|
20368
|
-
["8002",
|
|
20369
|
-
["8003",
|
|
20370
|
-
["8004",
|
|
20380
|
+
["8002", we.VARIABLE_LENGTH, 20],
|
|
20381
|
+
["8003", we.VARIABLE_LENGTH, 30],
|
|
20382
|
+
["8004", we.VARIABLE_LENGTH, 30],
|
|
20371
20383
|
["8005", 6],
|
|
20372
20384
|
["8006", 18],
|
|
20373
|
-
["8007",
|
|
20374
|
-
["8008",
|
|
20385
|
+
["8007", we.VARIABLE_LENGTH, 30],
|
|
20386
|
+
["8008", we.VARIABLE_LENGTH, 12],
|
|
20375
20387
|
["8018", 18],
|
|
20376
|
-
["8020",
|
|
20388
|
+
["8020", we.VARIABLE_LENGTH, 25],
|
|
20377
20389
|
["8100", 6],
|
|
20378
20390
|
["8101", 10],
|
|
20379
20391
|
["8102", 2],
|
|
20380
|
-
["8110",
|
|
20381
|
-
["8200",
|
|
20392
|
+
["8110", we.VARIABLE_LENGTH, 70],
|
|
20393
|
+
["8200", we.VARIABLE_LENGTH, 70]
|
|
20382
20394
|
];
|
|
20383
20395
|
class kr {
|
|
20384
20396
|
constructor(e) {
|
|
@@ -20387,7 +20399,7 @@ function Jw() {
|
|
|
20387
20399
|
decodeAllCodes(e, n) {
|
|
20388
20400
|
let i = n, s = null;
|
|
20389
20401
|
do {
|
|
20390
|
-
let a = this.decodeGeneralPurposeField(i, s), l =
|
|
20402
|
+
let a = this.decodeGeneralPurposeField(i, s), l = we.parseFieldsInGeneralPurpose(a.getNewString());
|
|
20391
20403
|
if (l != null && e.append(l), a.isRemaining() ? s = "" + a.getRemainingValue() : s = null, i === a.getNewPosition())
|
|
20392
20404
|
break;
|
|
20393
20405
|
i = a.getNewPosition();
|
|
@@ -21370,7 +21382,7 @@ function Jw() {
|
|
|
21370
21382
|
let a = this.findFinderPattern(e, n), l = this.parseFoundFinderPattern(e, i, n, a), d = s == null ? null : s.get(z.NEED_RESULT_POINT_CALLBACK);
|
|
21371
21383
|
if (d != null) {
|
|
21372
21384
|
let y = (a[0] + a[1]) / 2;
|
|
21373
|
-
n && (y = e.getSize() - 1 - y), d.foundPossibleResultPoint(new
|
|
21385
|
+
n && (y = e.getSize() - 1 - y), d.foundPossibleResultPoint(new ve(y, i));
|
|
21374
21386
|
}
|
|
21375
21387
|
let h = this.decodeDataCharacter(e, l, !0), p = this.decodeDataCharacter(e, l, !1);
|
|
21376
21388
|
return new Sd(1597 * h.getValue() + p.getValue(), h.getChecksumPortion() + 4 * p.getChecksumPortion(), l);
|
|
@@ -22208,7 +22220,7 @@ function Jw() {
|
|
|
22208
22220
|
}
|
|
22209
22221
|
i.push(d);
|
|
22210
22222
|
try {
|
|
22211
|
-
n.append(
|
|
22223
|
+
n.append(ye.decode(d, ne.ISO88591));
|
|
22212
22224
|
} catch (h) {
|
|
22213
22225
|
throw new Kt("Platform does not support required encoding: " + h.message);
|
|
22214
22226
|
}
|
|
@@ -22435,11 +22447,11 @@ function Jw() {
|
|
|
22435
22447
|
}
|
|
22436
22448
|
static shiftPoint(e, n, i) {
|
|
22437
22449
|
let s = (n.getX() - e.getX()) / (i + 1), a = (n.getY() - e.getY()) / (i + 1);
|
|
22438
|
-
return new
|
|
22450
|
+
return new ve(e.getX() + s, e.getY() + a);
|
|
22439
22451
|
}
|
|
22440
22452
|
static moveAway(e, n, i) {
|
|
22441
22453
|
let s = e.getX(), a = e.getY();
|
|
22442
|
-
return s < n ? s -= 1 : s += 1, a < i ? a -= 1 : a += 1, new
|
|
22454
|
+
return s < n ? s -= 1 : s += 1, a < i ? a -= 1 : a += 1, new ve(s, a);
|
|
22443
22455
|
}
|
|
22444
22456
|
/**
|
|
22445
22457
|
* Detect a solid side which has minimum transition.
|
|
@@ -22461,7 +22473,7 @@ function Jw() {
|
|
|
22461
22473
|
correctTopRight(e) {
|
|
22462
22474
|
let n = e[0], i = e[1], s = e[2], a = e[3], l = this.transitionsBetween(n, a), d = this.transitionsBetween(i, a), h = Bt.shiftPoint(n, i, (d + 1) * 4), p = Bt.shiftPoint(s, i, (l + 1) * 4);
|
|
22463
22475
|
l = this.transitionsBetween(h, a), d = this.transitionsBetween(p, a);
|
|
22464
|
-
let y = new
|
|
22476
|
+
let y = new ve(a.getX() + (s.getX() - i.getX()) / (l + 1), a.getY() + (s.getY() - i.getY()) / (l + 1)), b = new ve(a.getX() + (n.getX() - i.getX()) / (d + 1), a.getY() + (n.getY() - i.getY()) / (d + 1));
|
|
22465
22477
|
if (!this.isValid(y))
|
|
22466
22478
|
return this.isValid(b) ? b : null;
|
|
22467
22479
|
if (!this.isValid(b))
|
|
@@ -23276,7 +23288,7 @@ function Jw() {
|
|
|
23276
23288
|
d & 255, a += 2, i--;
|
|
23277
23289
|
}
|
|
23278
23290
|
try {
|
|
23279
|
-
n.append(
|
|
23291
|
+
n.append(ye.decode(s, ne.GB2312));
|
|
23280
23292
|
} catch (l) {
|
|
23281
23293
|
throw new U(l);
|
|
23282
23294
|
}
|
|
@@ -23294,7 +23306,7 @@ function Jw() {
|
|
|
23294
23306
|
d, a += 2, i--;
|
|
23295
23307
|
}
|
|
23296
23308
|
try {
|
|
23297
|
-
n.append(
|
|
23309
|
+
n.append(ye.decode(s, ne.SHIFT_JIS));
|
|
23298
23310
|
} catch (l) {
|
|
23299
23311
|
throw new U(l);
|
|
23300
23312
|
}
|
|
@@ -23307,9 +23319,9 @@ function Jw() {
|
|
|
23307
23319
|
d[p] = /*(byte) */
|
|
23308
23320
|
e.readBits(8);
|
|
23309
23321
|
let h;
|
|
23310
|
-
s === null ? h =
|
|
23322
|
+
s === null ? h = ne.guessEncoding(d, l) : h = s.getName();
|
|
23311
23323
|
try {
|
|
23312
|
-
n.append(
|
|
23324
|
+
n.append(ye.decode(d, h));
|
|
23313
23325
|
} catch (p) {
|
|
23314
23326
|
throw new U(p);
|
|
23315
23327
|
}
|
|
@@ -23483,7 +23495,7 @@ function Jw() {
|
|
|
23483
23495
|
i[s];
|
|
23484
23496
|
}
|
|
23485
23497
|
}
|
|
23486
|
-
class yo extends
|
|
23498
|
+
class yo extends ve {
|
|
23487
23499
|
constructor(e, n, i) {
|
|
23488
23500
|
super(e, n), this.estimatedModuleSize = i;
|
|
23489
23501
|
}
|
|
@@ -23647,7 +23659,7 @@ function Jw() {
|
|
|
23647
23659
|
return null;
|
|
23648
23660
|
}
|
|
23649
23661
|
}
|
|
23650
|
-
class wo extends
|
|
23662
|
+
class wo extends ve {
|
|
23651
23663
|
// FinderPattern(posX: number/*float*/, posY: number/*float*/, estimatedModuleSize: number/*float*/) {
|
|
23652
23664
|
// this(posX, posY, estimatedModuleSize, 1)
|
|
23653
23665
|
// }
|
|
@@ -23754,7 +23766,7 @@ function Jw() {
|
|
|
23754
23766
|
Ht.foundPatternCross(p) && this.handlePossibleCenter(p, b, l, i) === !0 && (d = p[0], this.hasSkipped && (h = this.haveMultiplyConfirmedCenters()));
|
|
23755
23767
|
}
|
|
23756
23768
|
const y = this.selectBestPatterns();
|
|
23757
|
-
return
|
|
23769
|
+
return ve.orderBestPatterns(y), new Md(y);
|
|
23758
23770
|
}
|
|
23759
23771
|
/**
|
|
23760
23772
|
* Given a count of black/white/black/white/black pixels just seen and an end position,
|
|
@@ -24140,7 +24152,7 @@ function Jw() {
|
|
|
24140
24152
|
* of the finder patterns and estimated module size.</p>
|
|
24141
24153
|
*/
|
|
24142
24154
|
static computeDimension(e, n, i, s) {
|
|
24143
|
-
const a = Ve.round(
|
|
24155
|
+
const a = Ve.round(ve.distance(e, n) / s), l = Ve.round(ve.distance(e, i) / s);
|
|
24144
24156
|
let d = Math.floor((a + l) / 2) + 7;
|
|
24145
24157
|
switch (d & 3) {
|
|
24146
24158
|
// mod 4
|
|
@@ -30078,7 +30090,7 @@ function Jw() {
|
|
|
30078
30090
|
break;
|
|
30079
30091
|
}
|
|
30080
30092
|
}
|
|
30081
|
-
d[0] = new
|
|
30093
|
+
d[0] = new ve(b[0], s), d[1] = new ve(b[1], s), h = !0;
|
|
30082
30094
|
break;
|
|
30083
30095
|
}
|
|
30084
30096
|
}
|
|
@@ -30095,7 +30107,7 @@ function Jw() {
|
|
|
30095
30107
|
b++;
|
|
30096
30108
|
}
|
|
30097
30109
|
}
|
|
30098
|
-
y -= b + 1, d[2] = new
|
|
30110
|
+
y -= b + 1, d[2] = new ve(E[0], y), d[3] = new ve(E[1], y);
|
|
30099
30111
|
}
|
|
30100
30112
|
return y - s < Ze.BARCODE_MIN_HEIGHT && Z.fill(d, null), d;
|
|
30101
30113
|
}
|
|
@@ -30531,7 +30543,7 @@ function Jw() {
|
|
|
30531
30543
|
const l = n == null || i == null, d = s == null || a == null;
|
|
30532
30544
|
if (l && d)
|
|
30533
30545
|
throw new $();
|
|
30534
|
-
l ? (n = new
|
|
30546
|
+
l ? (n = new ve(0, s.getY()), i = new ve(0, a.getY())) : d && (s = new ve(e.getWidth() - 1, n.getY()), a = new ve(e.getWidth() - 1, i.getY())), this.image = e, this.topLeft = n, this.bottomLeft = i, this.topRight = s, this.bottomRight = a, this.minX = Math.trunc(Math.min(n.getX(), i.getX())), this.maxX = Math.trunc(Math.max(s.getX(), a.getX())), this.minY = Math.trunc(Math.min(n.getY(), s.getY())), this.maxY = Math.trunc(Math.max(i.getY(), a.getY()));
|
|
30535
30547
|
}
|
|
30536
30548
|
constructor_2(e) {
|
|
30537
30549
|
this.image = e.image, this.topLeft = e.getTopLeft(), this.bottomLeft = e.getBottomLeft(), this.topRight = e.getTopRight(), this.bottomRight = e.getBottomRight(), this.minX = e.getMinX(), this.maxX = e.getMaxX(), this.minY = e.getMinY(), this.maxY = e.getMaxY();
|
|
@@ -30550,13 +30562,13 @@ function Jw() {
|
|
|
30550
30562
|
if (e > 0) {
|
|
30551
30563
|
let h = i ? this.topLeft : this.topRight, p = Math.trunc(h.getY() - e);
|
|
30552
30564
|
p < 0 && (p = 0);
|
|
30553
|
-
let y = new
|
|
30565
|
+
let y = new ve(h.getX(), p);
|
|
30554
30566
|
i ? s = y : l = y;
|
|
30555
30567
|
}
|
|
30556
30568
|
if (n > 0) {
|
|
30557
30569
|
let h = i ? this.bottomLeft : this.bottomRight, p = Math.trunc(h.getY() + n);
|
|
30558
30570
|
p >= this.image.getHeight() && (p = this.image.getHeight() - 1);
|
|
30559
|
-
let y = new
|
|
30571
|
+
let y = new ve(h.getX(), p);
|
|
30560
30572
|
i ? a = y : d = y;
|
|
30561
30573
|
}
|
|
30562
30574
|
return new mr(this.image, s, a, l, d);
|
|
@@ -31984,7 +31996,7 @@ function Jw() {
|
|
|
31984
31996
|
}
|
|
31985
31997
|
break;
|
|
31986
31998
|
}
|
|
31987
|
-
return a.append(
|
|
31999
|
+
return a.append(ye.decode(l.toByteArray(), i)), s;
|
|
31988
32000
|
}
|
|
31989
32001
|
/**
|
|
31990
32002
|
* Numeric Compaction mode (see 5.4.4) permits efficient encoding of numeric data strings.
|
|
@@ -33343,7 +33355,7 @@ function Jw() {
|
|
|
33343
33355
|
static isOnlyDoubleByteKanji(e) {
|
|
33344
33356
|
let n;
|
|
33345
33357
|
try {
|
|
33346
|
-
n =
|
|
33358
|
+
n = ye.encode(e, I.SJIS);
|
|
33347
33359
|
} catch {
|
|
33348
33360
|
return !1;
|
|
33349
33361
|
}
|
|
@@ -33540,7 +33552,7 @@ function Jw() {
|
|
|
33540
33552
|
static append8BitBytes(e, n, i) {
|
|
33541
33553
|
let s;
|
|
33542
33554
|
try {
|
|
33543
|
-
s =
|
|
33555
|
+
s = ye.encode(e, i);
|
|
33544
33556
|
} catch (a) {
|
|
33545
33557
|
throw new ct(a);
|
|
33546
33558
|
}
|
|
@@ -33555,7 +33567,7 @@ function Jw() {
|
|
|
33555
33567
|
static appendKanjiBytes(e, n) {
|
|
33556
33568
|
let i;
|
|
33557
33569
|
try {
|
|
33558
|
-
i =
|
|
33570
|
+
i = ye.encode(e, I.SJIS);
|
|
33559
33571
|
} catch (a) {
|
|
33560
33572
|
throw new ct(a);
|
|
33561
33573
|
}
|
|
@@ -34210,7 +34222,7 @@ function Jw() {
|
|
|
34210
34222
|
* @Override
|
|
34211
34223
|
*/
|
|
34212
34224
|
toString() {
|
|
34213
|
-
return
|
|
34225
|
+
return ne.format("%s bits=%d bytes=%d", Xd[this.mode], this.bitCount, this.binaryShiftByteCount);
|
|
34214
34226
|
}
|
|
34215
34227
|
static calculateBinaryShiftCost(e) {
|
|
34216
34228
|
return e.binaryShiftByteCount > 62 ? 21 : e.binaryShiftByteCount > 31 ? 20 : e.binaryShiftByteCount > 0 ? 10 : 0;
|
|
@@ -34218,17 +34230,17 @@ function Jw() {
|
|
|
34218
34230
|
}
|
|
34219
34231
|
Vn.INITIAL_STATE = new Vn(qd, ar, 0, 0);
|
|
34220
34232
|
function Kd(C) {
|
|
34221
|
-
const e =
|
|
34233
|
+
const e = ne.getCharCode(" "), n = ne.getCharCode("."), i = ne.getCharCode(",");
|
|
34222
34234
|
C[ar][e] = 1;
|
|
34223
|
-
const s =
|
|
34235
|
+
const s = ne.getCharCode("Z"), a = ne.getCharCode("A");
|
|
34224
34236
|
for (let E = a; E <= s; E++)
|
|
34225
34237
|
C[ar][E] = E - a + 2;
|
|
34226
34238
|
C[Oi][e] = 1;
|
|
34227
|
-
const l =
|
|
34239
|
+
const l = ne.getCharCode("z"), d = ne.getCharCode("a");
|
|
34228
34240
|
for (let E = d; E <= l; E++)
|
|
34229
34241
|
C[Oi][E] = E - d + 2;
|
|
34230
34242
|
C[An][e] = 1;
|
|
34231
|
-
const h =
|
|
34243
|
+
const h = ne.getCharCode("9"), p = ne.getCharCode("0");
|
|
34232
34244
|
for (let E = p; E <= h; E++)
|
|
34233
34245
|
C[An][E] = E - p + 2;
|
|
34234
34246
|
C[An][i] = 12, C[An][n] = 13;
|
|
@@ -34264,7 +34276,7 @@ function Jw() {
|
|
|
34264
34276
|
""
|
|
34265
34277
|
];
|
|
34266
34278
|
for (let E = 0; E < y.length; E++)
|
|
34267
|
-
C[qs][
|
|
34279
|
+
C[qs][ne.getCharCode(y[E])] = E;
|
|
34268
34280
|
const b = [
|
|
34269
34281
|
"\0",
|
|
34270
34282
|
"\r",
|
|
@@ -34299,7 +34311,7 @@ function Jw() {
|
|
|
34299
34311
|
"}"
|
|
34300
34312
|
];
|
|
34301
34313
|
for (let E = 0; E < b.length; E++)
|
|
34302
|
-
|
|
34314
|
+
ne.getCharCode(b[E]) > 0 && (C[$n][ne.getCharCode(b[E])] = E);
|
|
34303
34315
|
return C;
|
|
34304
34316
|
}
|
|
34305
34317
|
const So = Kd(Z.createInt32Array(5, 256));
|
|
@@ -34311,22 +34323,22 @@ function Jw() {
|
|
|
34311
34323
|
* @return text represented by this encoder encoded as a {@link BitArray}
|
|
34312
34324
|
*/
|
|
34313
34325
|
encode() {
|
|
34314
|
-
const e =
|
|
34326
|
+
const e = ne.getCharCode(" "), n = ne.getCharCode(`
|
|
34315
34327
|
`);
|
|
34316
34328
|
let i = Xs.singletonList(Vn.INITIAL_STATE);
|
|
34317
34329
|
for (let a = 0; a < this.text.length; a++) {
|
|
34318
34330
|
let l, d = a + 1 < this.text.length ? this.text[a + 1] : 0;
|
|
34319
34331
|
switch (this.text[a]) {
|
|
34320
|
-
case
|
|
34332
|
+
case ne.getCharCode("\r"):
|
|
34321
34333
|
l = d === n ? 2 : 0;
|
|
34322
34334
|
break;
|
|
34323
|
-
case
|
|
34335
|
+
case ne.getCharCode("."):
|
|
34324
34336
|
l = d === e ? 3 : 0;
|
|
34325
34337
|
break;
|
|
34326
|
-
case
|
|
34338
|
+
case ne.getCharCode(","):
|
|
34327
34339
|
l = d === e ? 4 : 0;
|
|
34328
34340
|
break;
|
|
34329
|
-
case
|
|
34341
|
+
case ne.getCharCode(":"):
|
|
34330
34342
|
l = d === e ? 5 : 0;
|
|
34331
34343
|
break;
|
|
34332
34344
|
default:
|
|
@@ -34426,7 +34438,7 @@ function Jw() {
|
|
|
34426
34438
|
let s = new Kr(e).encode(), a = F.truncDivision(s.getSize() * n, 100) + 11, l = s.getSize() + a, d, h, p, y, b;
|
|
34427
34439
|
if (i !== qe.DEFAULT_AZTEC_LAYERS) {
|
|
34428
34440
|
if (d = i < 0, h = Math.abs(i), h > (d ? qe.MAX_NB_BITS_COMPACT : qe.MAX_NB_BITS))
|
|
34429
|
-
throw new _(
|
|
34441
|
+
throw new _(ne.format("Illegal value %s for layers", i));
|
|
34430
34442
|
p = qe.totalBitsInLayer(h, d), y = qe.WORD_SIZE[h];
|
|
34431
34443
|
let se = p - p % y;
|
|
34432
34444
|
if (b = qe.stuffBits(s, y), b.getSize() + a > se)
|
|
@@ -34600,7 +34612,7 @@ function Jw() {
|
|
|
34600
34612
|
static encodeLayers(e, n, i, s, a, l, d) {
|
|
34601
34613
|
if (n !== Ce.AZTEC)
|
|
34602
34614
|
throw new _("Can only encode AZTEC, but got " + n);
|
|
34603
|
-
let h = qe.encode(
|
|
34615
|
+
let h = qe.encode(ne.getBytes(e, a), l, d);
|
|
34604
34616
|
return ki.renderResult(h, i, s);
|
|
34605
34617
|
}
|
|
34606
34618
|
static renderResult(e, n, i) {
|
|
@@ -34614,7 +34626,7 @@ function Jw() {
|
|
|
34614
34626
|
return E;
|
|
34615
34627
|
}
|
|
34616
34628
|
}
|
|
34617
|
-
o.AbstractExpandedDecoder = fo, o.ArgumentException = A, o.ArithmeticException = bt, o.AztecCode = Gs, o.AztecCodeReader = ht, o.AztecCodeWriter = ki, o.AztecDecoder = Ye, o.AztecDetector = Ke, o.AztecDetectorResult = er, o.AztecEncoder = qe, o.AztecHighLevelEncoder = Kr, o.AztecPoint =
|
|
34629
|
+
o.AbstractExpandedDecoder = fo, o.ArgumentException = A, o.ArithmeticException = bt, o.AztecCode = Gs, o.AztecCodeReader = ht, o.AztecCodeWriter = ki, o.AztecDecoder = Ye, o.AztecDetector = Ke, o.AztecDetectorResult = er, o.AztecEncoder = qe, o.AztecHighLevelEncoder = Kr, o.AztecPoint = ie, o.BarcodeFormat = Ce, o.Binarizer = R, o.BinaryBitmap = D, o.BitArray = J, o.BitMatrix = Me, o.BitSource = mo, o.BrowserAztecCodeReader = Nr, o.BrowserBarcodeReader = Td, o.BrowserCodeReader = It, o.BrowserDatamatrixCodeReader = Od, o.BrowserMultiFormatReader = Zd, o.BrowserPDF417Reader = $d, o.BrowserQRCodeReader = Vd, o.BrowserQRCodeSvgWriter = yr, o.CharacterSetECI = I, o.ChecksumException = N, o.Code128Reader = fe, o.Code39Reader = Pt, o.DataMatrixDecodedBitStreamParser = rr, o.DataMatrixReader = ir, o.DecodeHintType = z, o.DecoderResult = Yt, o.DefaultGridSampler = hr, o.DetectorResult = Gn, o.EAN13Reader = Xn, o.EncodeHintType = zt, o.Exception = x, o.FormatException = U, o.GenericGF = be, o.GenericGFPoly = Oe, o.GlobalHistogramBinarizer = ge, o.GridSampler = tr, o.GridSamplerInstance = k, o.HTMLCanvasElementLuminanceSource = de, o.HybridBinarizer = te, o.ITFReader = st, o.IllegalArgumentException = _, o.IllegalStateException = Kt, o.InvertedLuminanceSource = pe, o.LuminanceSource = K, o.MathUtils = Ve, o.MultiFormatOneDReader = Mr, o.MultiFormatReader = Ws, o.MultiFormatWriter = Wd, o.NotFoundException = $, o.OneDReader = Tt, o.PDF417DecodedBitStreamParser = X, o.PDF417DecoderErrorCorrection = Us, o.PDF417Reader = Xt, o.PDF417ResultMetadata = Zs, o.PerspectiveTransform = $t, o.PlanarYUVLuminanceSource = Zn, o.QRCodeByteMatrix = Ni, o.QRCodeDataMask = Cn, o.QRCodeDecodedBitStreamParser = At, o.QRCodeDecoderErrorCorrectionLevel = pt, o.QRCodeDecoderFormatInformation = Qt, o.QRCodeEncoder = mt, o.QRCodeEncoderQRCode = xr, o.QRCodeMaskUtil = Ot, o.QRCodeMatrixUtil = Re, o.QRCodeMode = Ne, o.QRCodeReader = or, o.QRCodeVersion = Ie, o.QRCodeWriter = Pr, o.RGBLuminanceSource = bo, o.RSS14Reader = Nt, o.RSSExpandedReader = oe, o.ReaderException = Ti, o.ReedSolomonDecoder = Bn, o.ReedSolomonEncoder = Co, o.ReedSolomonException = en, o.Result = Ae, o.ResultMetadataType = ze, o.ResultPoint = ve, o.StringUtils = ne, o.UnsupportedOperationException = Te, o.VideoInputDevice = re, o.WhiteRectangleDetector = an, o.WriterException = ct, o.ZXingArrays = Z, o.ZXingCharset = js, o.ZXingInteger = F, o.ZXingStandardCharsets = Ao, o.ZXingStringBuilder = me, o.ZXingStringEncoding = ye, o.ZXingSystem = M, o.createAbstractExpandedDecoder = Ls, Object.defineProperty(o, "__esModule", { value: !0 });
|
|
34618
34630
|
}));
|
|
34619
34631
|
})(oi, oi.exports)), oi.exports;
|
|
34620
34632
|
}
|
|
@@ -34626,36 +34638,36 @@ const Qw = /* @__PURE__ */ Yw(xt), e3 = /* @__PURE__ */ L1({
|
|
|
34626
34638
|
var Ll = (function() {
|
|
34627
34639
|
function t(r, o, c) {
|
|
34628
34640
|
if (this.formatMap = /* @__PURE__ */ new Map([
|
|
34629
|
-
[
|
|
34630
|
-
[
|
|
34631
|
-
[
|
|
34632
|
-
[
|
|
34633
|
-
[
|
|
34641
|
+
[_e.QR_CODE, xt.BarcodeFormat.QR_CODE],
|
|
34642
|
+
[_e.AZTEC, xt.BarcodeFormat.AZTEC],
|
|
34643
|
+
[_e.CODABAR, xt.BarcodeFormat.CODABAR],
|
|
34644
|
+
[_e.CODE_39, xt.BarcodeFormat.CODE_39],
|
|
34645
|
+
[_e.CODE_93, xt.BarcodeFormat.CODE_93],
|
|
34634
34646
|
[
|
|
34635
|
-
|
|
34647
|
+
_e.CODE_128,
|
|
34636
34648
|
xt.BarcodeFormat.CODE_128
|
|
34637
34649
|
],
|
|
34638
34650
|
[
|
|
34639
|
-
|
|
34651
|
+
_e.DATA_MATRIX,
|
|
34640
34652
|
xt.BarcodeFormat.DATA_MATRIX
|
|
34641
34653
|
],
|
|
34642
34654
|
[
|
|
34643
|
-
|
|
34655
|
+
_e.MAXICODE,
|
|
34644
34656
|
xt.BarcodeFormat.MAXICODE
|
|
34645
34657
|
],
|
|
34646
|
-
[
|
|
34647
|
-
[
|
|
34648
|
-
[
|
|
34649
|
-
[
|
|
34650
|
-
[
|
|
34658
|
+
[_e.ITF, xt.BarcodeFormat.ITF],
|
|
34659
|
+
[_e.EAN_13, xt.BarcodeFormat.EAN_13],
|
|
34660
|
+
[_e.EAN_8, xt.BarcodeFormat.EAN_8],
|
|
34661
|
+
[_e.PDF_417, xt.BarcodeFormat.PDF_417],
|
|
34662
|
+
[_e.RSS_14, xt.BarcodeFormat.RSS_14],
|
|
34651
34663
|
[
|
|
34652
|
-
|
|
34664
|
+
_e.RSS_EXPANDED,
|
|
34653
34665
|
xt.BarcodeFormat.RSS_EXPANDED
|
|
34654
34666
|
],
|
|
34655
|
-
[
|
|
34656
|
-
[
|
|
34667
|
+
[_e.UPC_A, xt.BarcodeFormat.UPC_A],
|
|
34668
|
+
[_e.UPC_E, xt.BarcodeFormat.UPC_E],
|
|
34657
34669
|
[
|
|
34658
|
-
|
|
34670
|
+
_e.UPC_EAN_EXTENSION,
|
|
34659
34671
|
xt.BarcodeFormat.UPC_EAN_EXTENSION
|
|
34660
34672
|
]
|
|
34661
34673
|
]), this.reverseFormatMap = this.createReverseFormatMap(), !e3)
|
|
@@ -34786,19 +34798,19 @@ var Ll = (function() {
|
|
|
34786
34798
|
}, Fl = (function() {
|
|
34787
34799
|
function t(r, o, c) {
|
|
34788
34800
|
if (this.formatMap = /* @__PURE__ */ new Map([
|
|
34789
|
-
[
|
|
34790
|
-
[
|
|
34791
|
-
[
|
|
34792
|
-
[
|
|
34793
|
-
[
|
|
34794
|
-
[
|
|
34795
|
-
[
|
|
34796
|
-
[
|
|
34797
|
-
[
|
|
34798
|
-
[
|
|
34799
|
-
[
|
|
34800
|
-
[
|
|
34801
|
-
[
|
|
34801
|
+
[_e.QR_CODE, "qr_code"],
|
|
34802
|
+
[_e.AZTEC, "aztec"],
|
|
34803
|
+
[_e.CODABAR, "codabar"],
|
|
34804
|
+
[_e.CODE_39, "code_39"],
|
|
34805
|
+
[_e.CODE_93, "code_93"],
|
|
34806
|
+
[_e.CODE_128, "code_128"],
|
|
34807
|
+
[_e.DATA_MATRIX, "data_matrix"],
|
|
34808
|
+
[_e.ITF, "itf"],
|
|
34809
|
+
[_e.EAN_13, "ean_13"],
|
|
34810
|
+
[_e.EAN_8, "ean_8"],
|
|
34811
|
+
[_e.PDF_417, "pdf417"],
|
|
34812
|
+
[_e.UPC_A, "upc_a"],
|
|
34813
|
+
[_e.UPC_E, "upc_e"]
|
|
34802
34814
|
]), this.reverseFormatMap = this.createReverseFormatMap(), !t.isSupported())
|
|
34803
34815
|
throw "Use html5qrcode.min.js without edit, Use BarcodeDetectorDelegate only if it isSupported();";
|
|
34804
34816
|
this.verbose = o, this.logger = c;
|
|
@@ -35772,23 +35784,23 @@ var p3 = (function() {
|
|
|
35772
35784
|
return this.renderedCamera;
|
|
35773
35785
|
}, t.prototype.getSupportedFormats = function(r) {
|
|
35774
35786
|
var o = [
|
|
35775
|
-
|
|
35776
|
-
|
|
35777
|
-
|
|
35778
|
-
|
|
35779
|
-
|
|
35780
|
-
|
|
35781
|
-
|
|
35782
|
-
|
|
35783
|
-
|
|
35784
|
-
|
|
35785
|
-
|
|
35786
|
-
|
|
35787
|
-
|
|
35788
|
-
|
|
35789
|
-
|
|
35790
|
-
|
|
35791
|
-
|
|
35787
|
+
_e.QR_CODE,
|
|
35788
|
+
_e.AZTEC,
|
|
35789
|
+
_e.CODABAR,
|
|
35790
|
+
_e.CODE_39,
|
|
35791
|
+
_e.CODE_93,
|
|
35792
|
+
_e.CODE_128,
|
|
35793
|
+
_e.DATA_MATRIX,
|
|
35794
|
+
_e.MAXICODE,
|
|
35795
|
+
_e.ITF,
|
|
35796
|
+
_e.EAN_13,
|
|
35797
|
+
_e.EAN_8,
|
|
35798
|
+
_e.PDF_417,
|
|
35799
|
+
_e.RSS_14,
|
|
35800
|
+
_e.RSS_EXPANDED,
|
|
35801
|
+
_e.UPC_A,
|
|
35802
|
+
_e.UPC_E,
|
|
35803
|
+
_e.UPC_EAN_EXTENSION
|
|
35792
35804
|
];
|
|
35793
35805
|
if (!r || typeof r == "boolean" || !r.formatsToSupport)
|
|
35794
35806
|
return o;
|
|
@@ -36825,18 +36837,18 @@ const H3 = { render: V3 }, W3 = /* @__PURE__ */ sn({
|
|
|
36825
36837
|
conversationState: Y,
|
|
36826
36838
|
messages: z,
|
|
36827
36839
|
messageState: U,
|
|
36828
|
-
inputMessage:
|
|
36840
|
+
inputMessage: ee,
|
|
36829
36841
|
abortRequest: I,
|
|
36830
|
-
senderRef:
|
|
36831
|
-
sendMessage:
|
|
36832
|
-
handleSendMessage:
|
|
36842
|
+
senderRef: Te,
|
|
36843
|
+
sendMessage: ye,
|
|
36844
|
+
handleSendMessage: ne,
|
|
36833
36845
|
// 重命名为 Base,稍后包装
|
|
36834
36846
|
addMessage: me,
|
|
36835
36847
|
send: Me,
|
|
36836
36848
|
// 基础会话方法(供其他 composable 使用)
|
|
36837
36849
|
createConversation: $,
|
|
36838
36850
|
switchConversation: ge,
|
|
36839
|
-
deleteConversation:
|
|
36851
|
+
deleteConversation: te,
|
|
36840
36852
|
getCurrentConversation: K
|
|
36841
36853
|
} = ly({
|
|
36842
36854
|
systemPrompt: c.systemPrompt || "",
|
|
@@ -36852,16 +36864,16 @@ const H3 = { render: V3 }, W3 = /* @__PURE__ */ sn({
|
|
|
36852
36864
|
const pe = Ri(c, "skills"), { processSkillMentions: de } = kw({
|
|
36853
36865
|
skillsRef: pe,
|
|
36854
36866
|
customAgentProvider: J
|
|
36855
|
-
}),
|
|
36867
|
+
}), re = async (He, ke) => ne(He, ke, de), { welcomeIcon: he, roles: It } = Lw({
|
|
36856
36868
|
props: c,
|
|
36857
36869
|
messages: z,
|
|
36858
36870
|
messageState: U,
|
|
36859
|
-
inputMessage:
|
|
36860
|
-
handleSendMessage:
|
|
36871
|
+
inputMessage: ee,
|
|
36872
|
+
handleSendMessage: re
|
|
36861
36873
|
}), { showHistory: Ae, handleCreateConversation: Dt, handleHistorySelect: Ce, handleHistoryUpdateTitle: pn, handleHistoryDelete: ze } = Fw({
|
|
36862
36874
|
createConversation: $,
|
|
36863
36875
|
switchConversation: ge,
|
|
36864
|
-
deleteConversation:
|
|
36876
|
+
deleteConversation: te,
|
|
36865
36877
|
getCurrentConversation: K,
|
|
36866
36878
|
abortRequest: I,
|
|
36867
36879
|
conversationState: Y,
|
|
@@ -36922,7 +36934,7 @@ const H3 = { render: V3 }, W3 = /* @__PURE__ */ sn({
|
|
|
36922
36934
|
deletePlugin: Ye,
|
|
36923
36935
|
addPluginCore: Ve,
|
|
36924
36936
|
addPluginFromMarket: Ln,
|
|
36925
|
-
addPluginFromScan:
|
|
36937
|
+
addPluginFromScan: ve,
|
|
36926
36938
|
// 从扫码添加插件(统一接口)
|
|
36927
36939
|
handleClientDisconnected: Gn,
|
|
36928
36940
|
// 处理客户端断开连接
|
|
@@ -36940,7 +36952,7 @@ const H3 = { render: V3 }, W3 = /* @__PURE__ */ sn({
|
|
|
36940
36952
|
{ value: "communication", label: "沟通协作" },
|
|
36941
36953
|
{ value: "development", label: "开发工具" },
|
|
36942
36954
|
{ value: "ai", label: "AI 助手" }
|
|
36943
|
-
]), $t = t_(c), hr = dt(() => c.pillItems ?? $t.pillItems), k = dt(() => c.promptItems ?? $t.promptItems),
|
|
36955
|
+
]), $t = t_(c), hr = dt(() => c.pillItems ?? $t.pillItems), k = dt(() => c.promptItems ?? $t.promptItems), ie = $t.lang, {
|
|
36944
36956
|
handleScanSuccess: Ke,
|
|
36945
36957
|
handleSessionIdInput: ht,
|
|
36946
36958
|
initialize: Nr
|
|
@@ -36953,24 +36965,26 @@ const H3 = { render: V3 }, W3 = /* @__PURE__ */ sn({
|
|
|
36953
36965
|
menuItems: Ri(c, "menuItems"),
|
|
36954
36966
|
AILogoUrl: c.AILogoUrl,
|
|
36955
36967
|
show: g,
|
|
36956
|
-
addPluginFromScan:
|
|
36957
|
-
inputMessage:
|
|
36968
|
+
addPluginFromScan: ve,
|
|
36969
|
+
inputMessage: ee
|
|
36958
36970
|
}), Tt = async (He) => {
|
|
36959
|
-
if (await ht(
|
|
36971
|
+
if (await ht(ee.value) || !P())
|
|
36960
36972
|
return;
|
|
36961
36973
|
const Je = await j();
|
|
36962
36974
|
try {
|
|
36963
|
-
await
|
|
36975
|
+
await re(He, Je), Z();
|
|
36964
36976
|
} catch (We) {
|
|
36965
36977
|
console.error("发送消息失败:", We);
|
|
36966
36978
|
}
|
|
36967
36979
|
}, fe = dt(
|
|
36968
|
-
() => Wi.includes(U.status) ?
|
|
36980
|
+
() => Wi.includes(U.status) ? ie[c.locale].thinking : ie[c.locale].placeholder
|
|
36969
36981
|
), Pt = dt(() => Wi.includes(U.status)), st = (He) => {
|
|
36970
|
-
|
|
36982
|
+
ee.value = He.inputMessage;
|
|
36971
36983
|
};
|
|
36972
36984
|
Nr(), Vr(async () => {
|
|
36973
|
-
|
|
36985
|
+
setTimeout(() => {
|
|
36986
|
+
Dt();
|
|
36987
|
+
}, 100), F.onError = (ke) => {
|
|
36974
36988
|
ke && et(n_(ke));
|
|
36975
36989
|
};
|
|
36976
36990
|
const He = be.value.filter((ke) => ke.addState === "added" && ke.enabled);
|
|
@@ -36993,13 +37007,13 @@ const H3 = { render: V3 }, W3 = /* @__PURE__ */ sn({
|
|
|
36993
37007
|
/** 对话卡片的角色配置 */
|
|
36994
37008
|
roles: It,
|
|
36995
37009
|
/** 输入框的文本 */
|
|
36996
|
-
inputMessage:
|
|
37010
|
+
inputMessage: ee,
|
|
36997
37011
|
/** 输入框组件的实例 */
|
|
36998
|
-
senderRef:
|
|
37012
|
+
senderRef: Te,
|
|
36999
37013
|
/** 取消发送 */
|
|
37000
37014
|
abortRequest: I,
|
|
37001
37015
|
/** 发送消息 */
|
|
37002
|
-
sendMessage:
|
|
37016
|
+
sendMessage: ye,
|
|
37003
37017
|
/** 向插件市场添加一个server */
|
|
37004
37018
|
loadMcpServerToPlugin: Kt,
|
|
37005
37019
|
/** 处理客户端断开连接 */
|
|
@@ -37101,12 +37115,12 @@ const H3 = { render: V3 }, W3 = /* @__PURE__ */ sn({
|
|
|
37101
37115
|
], !0),
|
|
37102
37116
|
Pe(xe(h1), {
|
|
37103
37117
|
ref_key: "senderRef",
|
|
37104
|
-
ref:
|
|
37118
|
+
ref: Te,
|
|
37105
37119
|
mode: "multiple",
|
|
37106
|
-
modelValue: xe(
|
|
37107
|
-
"onUpdate:modelValue": ke[9] || (ke[9] = (Je) => Hi(
|
|
37120
|
+
modelValue: xe(ee),
|
|
37121
|
+
"onUpdate:modelValue": ke[9] || (ke[9] = (Je) => Hi(ee) ? ee.value = Je : null),
|
|
37108
37122
|
placeholder: fe.value,
|
|
37109
|
-
clearable: !!xe(
|
|
37123
|
+
clearable: !!xe(ee),
|
|
37110
37124
|
loading: Pt.value,
|
|
37111
37125
|
showWordLimit: !0,
|
|
37112
37126
|
maxLength: 2e4,
|
|
@@ -37185,8 +37199,8 @@ const H3 = { render: V3 }, W3 = /* @__PURE__ */ sn({
|
|
|
37185
37199
|
xe(z).length === 0 ? ri(He.$slots, "welcome", { key: 0 }, () => [
|
|
37186
37200
|
tt("div", i_, [
|
|
37187
37201
|
Pe(xe(l1), {
|
|
37188
|
-
title: xe(
|
|
37189
|
-
description: xe(
|
|
37202
|
+
title: xe(ie)[t.locale].title,
|
|
37203
|
+
description: xe(ie)[t.locale].description,
|
|
37190
37204
|
icon: xe(he)
|
|
37191
37205
|
}, null, 8, ["title", "description", "icon"]),
|
|
37192
37206
|
Pe(xe(c1), {
|
|
@@ -37212,7 +37226,7 @@ const H3 = { render: V3 }, W3 = /* @__PURE__ */ sn({
|
|
|
37212
37226
|
_: 3
|
|
37213
37227
|
}, 8, ["show", "fullscreen", "style"]));
|
|
37214
37228
|
}
|
|
37215
|
-
}), Gl = /* @__PURE__ */ fr(c_, [["__scopeId", "data-v-
|
|
37229
|
+
}), Gl = /* @__PURE__ */ fr(c_, [["__scopeId", "data-v-bda25851"]]);
|
|
37216
37230
|
function N_(t) {
|
|
37217
37231
|
const r = t.sessionId ? Xl(t.sessionId, t.agentRoot) : [], o = new Ql({
|
|
37218
37232
|
llmConfig: t.llmConfig,
|