wecool-chat 0.10.0 → 0.11.1
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/CHANGELOG.md +37 -0
- package/README.ja.md +9 -3
- package/README.md +14 -3
- package/dist/CopyIndicator-DcJtCBYP.js +63 -0
- package/dist/{MarkdownBody-EIz0jnQy.js → MarkdownBody-DX0DoV4C.js} +901 -893
- package/dist/VoiceControls-B_kX2Uj3.js +160 -0
- package/dist/{VoiceRuntime-DrYjNkZK.js → VoiceRuntime-D1nURNly.js} +13 -13
- package/dist/blank-line-D-aLg3m0.js +213 -0
- package/dist/{browser-M7mS-hAN.js → browser-a2qIWP48.js} +1 -1
- package/dist/core/client.d.ts +5 -0
- package/dist/core/client.d.ts.map +1 -1
- package/dist/core/consume-stream.d.ts +18 -1
- package/dist/core/consume-stream.d.ts.map +1 -1
- package/dist/core/i18n/messages.d.ts +2 -0
- package/dist/core/i18n/messages.d.ts.map +1 -1
- package/dist/core/narration-round.d.ts +27 -0
- package/dist/core/narration-round.d.ts.map +1 -0
- package/dist/core/placeholder-manager.d.ts +30 -0
- package/dist/core/placeholder-manager.d.ts.map +1 -0
- package/dist/core/run-conversation.d.ts.map +1 -1
- package/dist/core/stream-state.d.ts +9 -1
- package/dist/core/stream-state.d.ts.map +1 -1
- package/dist/core/types.d.ts +21 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/createLucideIcon-Dc6H577p.js +120 -0
- package/dist/index.css +2 -2
- package/dist/index.js +6514 -5325
- package/dist/{jsx-runtime-Cyy0mp0f.js → jsx-runtime-2MlY8uwR.js} +132 -122
- package/dist/{messages-FvtWi3lI.js → messages-ZLdeJx9N.js} +11 -31
- package/dist/observe/__tests__/widget-self-http.test.d.ts +2 -0
- package/dist/observe/__tests__/widget-self-http.test.d.ts.map +1 -0
- package/dist/observe/__tests__/widget-self.test.d.ts +2 -0
- package/dist/observe/__tests__/widget-self.test.d.ts.map +1 -0
- package/dist/observe/observers/http.d.ts.map +1 -1
- package/dist/observe/observers/js-error.d.ts +7 -2
- package/dist/observe/observers/js-error.d.ts.map +1 -1
- package/dist/observe/widget-self.d.ts +46 -0
- package/dist/observe/widget-self.d.ts.map +1 -0
- package/dist/plugin/logger.d.ts.map +1 -1
- package/dist/plugins/qrcode.js +7 -6
- package/dist/remark-gfm-DDNju7JY.js +2247 -0
- package/dist/{remark-parse-BnwSmQr-.js → remark-parse-B3YPcONN.js} +377 -445
- package/dist/rolldown-runtime-Csywlj8R.js +25 -0
- package/dist/ui/components/ChatFooter.d.ts +4 -3
- package/dist/ui/components/ChatFooter.d.ts.map +1 -1
- package/dist/ui/components/ChatHeader.d.ts +1 -1
- package/dist/ui/components/ChatHeaderMenu.d.ts +1 -1
- package/dist/ui/components/ChatPanel.d.ts +1 -1
- package/dist/ui/components/ChatWidget.d.ts.map +1 -1
- package/dist/ui/components/CommandConfirmationCard.d.ts +1 -1
- package/dist/ui/components/CommandOverlays.d.ts +1 -1
- package/dist/ui/components/CommandPalette.d.ts +1 -1
- package/dist/ui/components/ConversationSelect.d.ts +1 -1
- package/dist/ui/components/CopyIndicator.d.ts +1 -1
- package/dist/ui/components/FloatButton.d.ts +1 -1
- package/dist/ui/components/FooterActions.d.ts +1 -1
- package/dist/ui/components/HelpDialogContent.d.ts +1 -1
- package/dist/ui/components/MessageActionsPopover.d.ts +1 -1
- package/dist/ui/components/MessageAttachments.d.ts +1 -1
- package/dist/ui/components/MessageBubble.d.ts +1 -1
- package/dist/ui/components/MessageCopyButton.d.ts +1 -1
- package/dist/ui/components/MessageEditor.d.ts +1 -1
- package/dist/ui/components/MessageList.d.ts +1 -1
- package/dist/ui/components/MessagePopoverButton.d.ts +1 -1
- package/dist/ui/components/MessageRow.d.ts +1 -1
- package/dist/ui/components/MessageRowActions.d.ts +1 -1
- package/dist/ui/components/MicButton.d.ts +1 -1
- package/dist/ui/components/ResizeHandles.d.ts +1 -1
- package/dist/ui/components/ToolConfirmationCard.d.ts +1 -1
- package/dist/ui/components/ToolConfirmationRecord.d.ts +1 -1
- package/dist/ui/components/ToolsDialogContent.d.ts +1 -1
- package/dist/ui/components/VoiceControls.d.ts +1 -1
- package/dist/ui/components/VoiceControls.d.ts.map +1 -1
- package/dist/ui/components/VoiceLoopStatusBar.d.ts +1 -1
- package/dist/ui/components/VoiceLoopToggle.d.ts +1 -1
- package/dist/ui/components/VoiceRuntime.d.ts +1 -1
- package/dist/ui/components/WidgetDialog.d.ts +1 -1
- package/dist/ui/components/markdown/CodeBlock.d.ts +1 -1
- package/dist/ui/components/markdown/MarkdownBody.d.ts +1 -1
- package/dist/ui/components/markdown/MarkdownMessage.d.ts +1 -1
- package/dist/ui/hooks/use-mic-button.d.ts +2 -0
- package/dist/ui/hooks/use-mic-button.d.ts.map +1 -1
- package/dist/ui/hooks/use-send-message.d.ts.map +1 -1
- package/dist/{unified-DctkAd9P.js → unified-DvM6W8YC.js} +3 -3
- package/dist/{use-voice-input-LtJJz-zQ.js → use-voice-input-DJtyHnsT.js} +3 -3
- package/dist/{voice-support-BeOiOzcn.js → voice-support-DYXg7xML.js} +2 -2
- package/package.json +33 -33
- package/dist/CopyIndicator-RR3hSsBA.js +0 -51
- package/dist/VoiceControls-A7N4uPTo.js +0 -146
- package/dist/blank-line-CUDmZ-mX.js +0 -143
- package/dist/createLucideIcon-C7wGkK-Q.js +0 -43
- package/dist/remark-gfm-Bzy1u34W.js +0 -1962
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { r as tt, t as C } from "./rolldown-runtime-Csywlj8R.js";
|
|
2
|
+
import { t as et } from "./messages-ZLdeJx9N.js";
|
|
3
|
+
var nt = /* @__PURE__ */ C(((r) => {
|
|
4
|
+
var l = /* @__PURE__ */ Symbol.for("react.transitional.element"), d = /* @__PURE__ */ Symbol.for("react.portal"), R = /* @__PURE__ */ Symbol.for("react.fragment"), A = /* @__PURE__ */ Symbol.for("react.strict_mode"), a = /* @__PURE__ */ Symbol.for("react.profiler"), v = /* @__PURE__ */ Symbol.for("react.consumer"), y = /* @__PURE__ */ Symbol.for("react.context"), T = /* @__PURE__ */ Symbol.for("react.forward_ref"), W = /* @__PURE__ */ Symbol.for("react.suspense"), B = /* @__PURE__ */ Symbol.for("react.memo"), H = /* @__PURE__ */ Symbol.for("react.lazy"), J = /* @__PURE__ */ Symbol.for("react.activity"), Q = /* @__PURE__ */ Symbol.for("react.view_transition"), M = Symbol.iterator;
|
|
5
|
+
function X(t) {
|
|
6
|
+
return t === null || typeof t != "object" ? null : (t = M && t[M] || t["@@iterator"], typeof t == "function" ? t : null);
|
|
6
7
|
}
|
|
7
|
-
var
|
|
8
|
+
var $ = {
|
|
8
9
|
isMounted: function() {
|
|
9
10
|
return !1;
|
|
10
11
|
},
|
|
@@ -14,9 +15,9 @@ var x = /* @__PURE__ */ C(((n) => {
|
|
|
14
15
|
},
|
|
15
16
|
enqueueSetState: function() {
|
|
16
17
|
}
|
|
17
|
-
},
|
|
18
|
-
function E(t, e,
|
|
19
|
-
this.props = t, this.context = e, this.refs = Y, this.updater =
|
|
18
|
+
}, h = Object.assign, Y = {};
|
|
19
|
+
function E(t, e, n) {
|
|
20
|
+
this.props = t, this.context = e, this.refs = Y, this.updater = n || $;
|
|
20
21
|
}
|
|
21
22
|
E.prototype.isReactComponent = {}, E.prototype.setState = function(t, e) {
|
|
22
23
|
if (typeof t != "object" && typeof t != "function" && t != null) throw Error("takes an object of state variables to update or a function which returns an object of state variables.");
|
|
@@ -27,57 +28,57 @@ var x = /* @__PURE__ */ C(((n) => {
|
|
|
27
28
|
function N() {
|
|
28
29
|
}
|
|
29
30
|
N.prototype = E.prototype;
|
|
30
|
-
function
|
|
31
|
-
this.props = t, this.context = e, this.refs = Y, this.updater =
|
|
31
|
+
function S(t, e, n) {
|
|
32
|
+
this.props = t, this.context = e, this.refs = Y, this.updater = n || $;
|
|
32
33
|
}
|
|
33
|
-
var
|
|
34
|
-
|
|
35
|
-
var
|
|
36
|
-
function
|
|
34
|
+
var w = S.prototype = new N();
|
|
35
|
+
w.constructor = S, h(w, E.prototype), w.isPureReactComponent = !0;
|
|
36
|
+
var I = Array.isArray;
|
|
37
|
+
function P() {
|
|
37
38
|
}
|
|
38
39
|
var i = {
|
|
39
40
|
H: null,
|
|
40
41
|
A: null,
|
|
41
42
|
T: null,
|
|
42
43
|
S: null
|
|
43
|
-
},
|
|
44
|
-
function j(t, e,
|
|
45
|
-
var
|
|
44
|
+
}, k = Object.prototype.hasOwnProperty;
|
|
45
|
+
function j(t, e, n) {
|
|
46
|
+
var u = n.ref;
|
|
46
47
|
return {
|
|
47
48
|
$$typeof: l,
|
|
48
49
|
type: t,
|
|
49
50
|
key: e,
|
|
50
|
-
ref:
|
|
51
|
-
props:
|
|
51
|
+
ref: u !== void 0 ? u : null,
|
|
52
|
+
props: n
|
|
52
53
|
};
|
|
53
54
|
}
|
|
54
|
-
function
|
|
55
|
+
function Z(t, e) {
|
|
55
56
|
return j(t.type, e, t.props);
|
|
56
57
|
}
|
|
57
58
|
function g(t) {
|
|
58
59
|
return typeof t == "object" && t !== null && t.$$typeof === l;
|
|
59
60
|
}
|
|
60
|
-
function
|
|
61
|
+
function V(t) {
|
|
61
62
|
var e = {
|
|
62
63
|
"=": "=0",
|
|
63
64
|
":": "=2"
|
|
64
65
|
};
|
|
65
|
-
return "$" + t.replace(/[=:]/g, function(
|
|
66
|
-
return e[
|
|
66
|
+
return "$" + t.replace(/[=:]/g, function(n) {
|
|
67
|
+
return e[n];
|
|
67
68
|
});
|
|
68
69
|
}
|
|
69
70
|
var L = /\/+/g;
|
|
70
|
-
function
|
|
71
|
-
return typeof t == "object" && t !== null && t.key != null ?
|
|
71
|
+
function O(t, e) {
|
|
72
|
+
return typeof t == "object" && t !== null && t.key != null ? V("" + t.key) : e.toString(36);
|
|
72
73
|
}
|
|
73
|
-
function
|
|
74
|
+
function b(t) {
|
|
74
75
|
switch (t.status) {
|
|
75
76
|
case "fulfilled":
|
|
76
77
|
return t.value;
|
|
77
78
|
case "rejected":
|
|
78
79
|
throw t.reason;
|
|
79
80
|
default:
|
|
80
|
-
switch (typeof t.status == "string" ? t.then(
|
|
81
|
+
switch (typeof t.status == "string" ? t.then(P, P) : (t.status = "pending", t.then(function(e) {
|
|
81
82
|
t.status === "pending" && (t.status = "fulfilled", t.value = e);
|
|
82
83
|
}, function(e) {
|
|
83
84
|
t.status === "pending" && (t.status = "rejected", t.reason = e);
|
|
@@ -90,7 +91,7 @@ var x = /* @__PURE__ */ C(((n) => {
|
|
|
90
91
|
}
|
|
91
92
|
throw t;
|
|
92
93
|
}
|
|
93
|
-
function p(t, e,
|
|
94
|
+
function p(t, e, n, u, o) {
|
|
94
95
|
var s = typeof t;
|
|
95
96
|
(s === "undefined" || s === "boolean") && (t = null);
|
|
96
97
|
var f = !1;
|
|
@@ -104,41 +105,41 @@ var x = /* @__PURE__ */ C(((n) => {
|
|
|
104
105
|
case "object":
|
|
105
106
|
switch (t.$$typeof) {
|
|
106
107
|
case l:
|
|
107
|
-
case
|
|
108
|
+
case d:
|
|
108
109
|
f = !0;
|
|
109
110
|
break;
|
|
110
111
|
case H:
|
|
111
|
-
return f = t._init, p(f(t._payload), e,
|
|
112
|
+
return f = t._init, p(f(t._payload), e, n, u, o);
|
|
112
113
|
}
|
|
113
114
|
}
|
|
114
|
-
if (f) return o = o(t), f =
|
|
115
|
-
return
|
|
116
|
-
})) : o != null && (g(o) && (o =
|
|
115
|
+
if (f) return o = o(t), f = u === "" ? "." + O(t, 0) : u, I(o) ? (n = "", f != null && (n = f.replace(L, "$&/") + "/"), p(o, e, n, "", function(x) {
|
|
116
|
+
return x;
|
|
117
|
+
})) : o != null && (g(o) && (o = Z(o, n + (o.key == null || t && t.key === o.key ? "" : ("" + o.key).replace(L, "$&/") + "/") + f)), e.push(o)), 1;
|
|
117
118
|
f = 0;
|
|
118
|
-
var _ =
|
|
119
|
-
if (
|
|
120
|
-
else if (c =
|
|
119
|
+
var _ = u === "" ? "." : u + ":";
|
|
120
|
+
if (I(t)) for (var c = 0; c < t.length; c++) u = t[c], s = _ + O(u, c), f += p(u, e, n, s, o);
|
|
121
|
+
else if (c = X(t), typeof c == "function") for (t = c.call(t), c = 0; !(u = t.next()).done; ) u = u.value, s = _ + O(u, c++), f += p(u, e, n, s, o);
|
|
121
122
|
else if (s === "object") {
|
|
122
|
-
if (typeof t.then == "function") return p(
|
|
123
|
+
if (typeof t.then == "function") return p(b(t), e, n, u, o);
|
|
123
124
|
throw e = String(t), Error("Objects are not valid as a React child (found: " + (e === "[object Object]" ? "object with keys {" + Object.keys(t).join(", ") + "}" : e) + "). If you meant to render a collection of children, use an array instead.");
|
|
124
125
|
}
|
|
125
126
|
return f;
|
|
126
127
|
}
|
|
127
|
-
function m(t, e,
|
|
128
|
+
function m(t, e, n) {
|
|
128
129
|
if (t == null) return t;
|
|
129
|
-
var
|
|
130
|
-
return p(t,
|
|
131
|
-
return e.call(
|
|
132
|
-
}),
|
|
130
|
+
var u = [], o = 0;
|
|
131
|
+
return p(t, u, "", "", function(s) {
|
|
132
|
+
return e.call(n, s, o++);
|
|
133
|
+
}), u;
|
|
133
134
|
}
|
|
134
|
-
function
|
|
135
|
+
function K(t) {
|
|
135
136
|
if (t._status === -1) {
|
|
136
|
-
var e = t._result;
|
|
137
|
-
|
|
138
|
-
(t._status === 0 || t._status === -1) && (t._status = 1, t._result = u);
|
|
137
|
+
var e = t._result, n = e();
|
|
138
|
+
n.then(function(u) {
|
|
139
|
+
(t._status === 0 || t._status === -1) && (t._status = 1, t._result = u, n.status === void 0 && (n.status = "fulfilled", n.value = u));
|
|
139
140
|
}, function(u) {
|
|
140
|
-
(t._status === 0 || t._status === -1) && (t._status = 2, t._result = u);
|
|
141
|
-
}), t._status === -1 && (t._status = 0, t._result =
|
|
141
|
+
(t._status === 0 || t._status === -1) && (t._status = 2, t._result = u, n.status === void 0 && (n.status = "rejected", n.reason = u));
|
|
142
|
+
}), t._status === -1 && (t._status = 0, t._result = n);
|
|
142
143
|
}
|
|
143
144
|
if (t._status === 1) return t._result.default;
|
|
144
145
|
throw t._result;
|
|
@@ -157,12 +158,32 @@ var x = /* @__PURE__ */ C(((n) => {
|
|
|
157
158
|
return;
|
|
158
159
|
}
|
|
159
160
|
console.error(t);
|
|
160
|
-
}
|
|
161
|
+
};
|
|
162
|
+
function q(t) {
|
|
163
|
+
var e = i.T, n = {};
|
|
164
|
+
n.types = e !== null ? e.types : null, i.T = n;
|
|
165
|
+
try {
|
|
166
|
+
var u = t(), o = i.S;
|
|
167
|
+
o !== null && o(n, u), typeof u == "object" && u !== null && typeof u.then == "function" && u.then(P, U);
|
|
168
|
+
} catch (s) {
|
|
169
|
+
U(s);
|
|
170
|
+
} finally {
|
|
171
|
+
e !== null && n.types !== null && (e.types = n.types), i.T = e;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
function D(t) {
|
|
175
|
+
var e = i.T;
|
|
176
|
+
if (e !== null) {
|
|
177
|
+
var n = e.types;
|
|
178
|
+
n === null ? e.types = [t] : n.indexOf(t) === -1 && n.push(t);
|
|
179
|
+
} else q(D.bind(null, t));
|
|
180
|
+
}
|
|
181
|
+
var F = {
|
|
161
182
|
map: m,
|
|
162
|
-
forEach: function(t, e,
|
|
183
|
+
forEach: function(t, e, n) {
|
|
163
184
|
m(t, function() {
|
|
164
185
|
e.apply(this, arguments);
|
|
165
|
-
},
|
|
186
|
+
}, n);
|
|
166
187
|
},
|
|
167
188
|
count: function(t) {
|
|
168
189
|
var e = 0;
|
|
@@ -180,29 +201,29 @@ var x = /* @__PURE__ */ C(((n) => {
|
|
|
180
201
|
return t;
|
|
181
202
|
}
|
|
182
203
|
};
|
|
183
|
-
|
|
204
|
+
r.Activity = J, r.Children = F, r.Component = E, r.Fragment = R, r.Profiler = a, r.PureComponent = S, r.StrictMode = A, r.Suspense = W, r.ViewTransition = Q, r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = i, r.__COMPILER_RUNTIME = {
|
|
184
205
|
__proto__: null,
|
|
185
206
|
c: function(t) {
|
|
186
207
|
return i.H.useMemoCache(t);
|
|
187
208
|
}
|
|
188
|
-
},
|
|
209
|
+
}, r.addTransitionType = D, r.cache = function(t) {
|
|
189
210
|
return function() {
|
|
190
211
|
return t.apply(null, arguments);
|
|
191
212
|
};
|
|
192
|
-
},
|
|
213
|
+
}, r.cacheSignal = function() {
|
|
193
214
|
return null;
|
|
194
|
-
},
|
|
215
|
+
}, r.cloneElement = function(t, e, n) {
|
|
195
216
|
if (t == null) throw Error("The argument must be a React element, but you passed " + t + ".");
|
|
196
|
-
var
|
|
197
|
-
if (e != null) for (s in e.key !== void 0 && (o = "" + e.key), e) !
|
|
217
|
+
var u = h({}, t.props), o = t.key;
|
|
218
|
+
if (e != null) for (s in e.key !== void 0 && (o = "" + e.key), e) !k.call(e, s) || s === "key" || s === "__self" || s === "__source" || s === "ref" && e.ref === void 0 || (u[s] = e[s]);
|
|
198
219
|
var s = arguments.length - 2;
|
|
199
|
-
if (s === 1)
|
|
220
|
+
if (s === 1) u.children = n;
|
|
200
221
|
else if (1 < s) {
|
|
201
222
|
for (var f = Array(s), _ = 0; _ < s; _++) f[_] = arguments[_ + 2];
|
|
202
|
-
|
|
223
|
+
u.children = f;
|
|
203
224
|
}
|
|
204
|
-
return j(t.type, o,
|
|
205
|
-
},
|
|
225
|
+
return j(t.type, o, u);
|
|
226
|
+
}, r.createContext = function(t) {
|
|
206
227
|
return t = {
|
|
207
228
|
$$typeof: y,
|
|
208
229
|
_currentValue: t,
|
|
@@ -214,95 +235,84 @@ var x = /* @__PURE__ */ C(((n) => {
|
|
|
214
235
|
$$typeof: v,
|
|
215
236
|
_context: t
|
|
216
237
|
}, t;
|
|
217
|
-
},
|
|
218
|
-
var
|
|
219
|
-
if (e != null) for (
|
|
238
|
+
}, r.createElement = function(t, e, n) {
|
|
239
|
+
var u, o = {}, s = null;
|
|
240
|
+
if (e != null) for (u in e.key !== void 0 && (s = "" + e.key), e) k.call(e, u) && u !== "key" && u !== "__self" && u !== "__source" && (o[u] = e[u]);
|
|
220
241
|
var f = arguments.length - 2;
|
|
221
|
-
if (f === 1) o.children =
|
|
242
|
+
if (f === 1) o.children = n;
|
|
222
243
|
else if (1 < f) {
|
|
223
244
|
for (var _ = Array(f), c = 0; c < f; c++) _[c] = arguments[c + 2];
|
|
224
245
|
o.children = _;
|
|
225
246
|
}
|
|
226
|
-
if (t && t.defaultProps) for (
|
|
247
|
+
if (t && t.defaultProps) for (u in f = t.defaultProps, f) o[u] === void 0 && (o[u] = f[u]);
|
|
227
248
|
return j(t, s, o);
|
|
228
|
-
},
|
|
249
|
+
}, r.createRef = function() {
|
|
229
250
|
return { current: null };
|
|
230
|
-
},
|
|
251
|
+
}, r.forwardRef = function(t) {
|
|
231
252
|
return {
|
|
232
253
|
$$typeof: T,
|
|
233
254
|
render: t
|
|
234
255
|
};
|
|
235
|
-
},
|
|
256
|
+
}, r.isValidElement = g, r.lazy = function(t) {
|
|
236
257
|
return {
|
|
237
258
|
$$typeof: H,
|
|
238
259
|
_payload: {
|
|
239
260
|
_status: -1,
|
|
240
261
|
_result: t
|
|
241
262
|
},
|
|
242
|
-
_init:
|
|
263
|
+
_init: K
|
|
243
264
|
};
|
|
244
|
-
},
|
|
265
|
+
}, r.memo = function(t, e) {
|
|
245
266
|
return {
|
|
246
|
-
$$typeof:
|
|
267
|
+
$$typeof: B,
|
|
247
268
|
type: t,
|
|
248
269
|
compare: e === void 0 ? null : e
|
|
249
270
|
};
|
|
250
|
-
},
|
|
251
|
-
var e = i.T, u = {};
|
|
252
|
-
i.T = u;
|
|
253
|
-
try {
|
|
254
|
-
var r = t(), o = i.S;
|
|
255
|
-
o !== null && o(u, r), typeof r == "object" && r !== null && typeof r.then == "function" && r.then(w, U);
|
|
256
|
-
} catch (s) {
|
|
257
|
-
U(s);
|
|
258
|
-
} finally {
|
|
259
|
-
e !== null && u.types !== null && (e.types = u.types), i.T = e;
|
|
260
|
-
}
|
|
261
|
-
}, n.unstable_useCacheRefresh = function() {
|
|
271
|
+
}, r.startTransition = q, r.unstable_useCacheRefresh = function() {
|
|
262
272
|
return i.H.useCacheRefresh();
|
|
263
|
-
},
|
|
273
|
+
}, r.use = function(t) {
|
|
264
274
|
return i.H.use(t);
|
|
265
|
-
},
|
|
266
|
-
return i.H.useActionState(t, e,
|
|
267
|
-
},
|
|
275
|
+
}, r.useActionState = function(t, e, n) {
|
|
276
|
+
return i.H.useActionState(t, e, n);
|
|
277
|
+
}, r.useCallback = function(t, e) {
|
|
268
278
|
return i.H.useCallback(t, e);
|
|
269
|
-
},
|
|
279
|
+
}, r.useContext = function(t) {
|
|
270
280
|
return i.H.useContext(t);
|
|
271
|
-
},
|
|
272
|
-
},
|
|
281
|
+
}, r.useDebugValue = function() {
|
|
282
|
+
}, r.useDeferredValue = function(t, e) {
|
|
273
283
|
return i.H.useDeferredValue(t, e);
|
|
274
|
-
},
|
|
284
|
+
}, r.useEffect = function(t, e) {
|
|
275
285
|
return i.H.useEffect(t, e);
|
|
276
|
-
},
|
|
286
|
+
}, r.useEffectEvent = function(t) {
|
|
277
287
|
return i.H.useEffectEvent(t);
|
|
278
|
-
},
|
|
288
|
+
}, r.useId = function() {
|
|
279
289
|
return i.H.useId();
|
|
280
|
-
},
|
|
281
|
-
return i.H.useImperativeHandle(t, e,
|
|
282
|
-
},
|
|
290
|
+
}, r.useImperativeHandle = function(t, e, n) {
|
|
291
|
+
return i.H.useImperativeHandle(t, e, n);
|
|
292
|
+
}, r.useInsertionEffect = function(t, e) {
|
|
283
293
|
return i.H.useInsertionEffect(t, e);
|
|
284
|
-
},
|
|
294
|
+
}, r.useLayoutEffect = function(t, e) {
|
|
285
295
|
return i.H.useLayoutEffect(t, e);
|
|
286
|
-
},
|
|
296
|
+
}, r.useMemo = function(t, e) {
|
|
287
297
|
return i.H.useMemo(t, e);
|
|
288
|
-
},
|
|
298
|
+
}, r.useOptimistic = function(t, e) {
|
|
289
299
|
return i.H.useOptimistic(t, e);
|
|
290
|
-
},
|
|
291
|
-
return i.H.useReducer(t, e,
|
|
292
|
-
},
|
|
300
|
+
}, r.useReducer = function(t, e, n) {
|
|
301
|
+
return i.H.useReducer(t, e, n);
|
|
302
|
+
}, r.useRef = function(t) {
|
|
293
303
|
return i.H.useRef(t);
|
|
294
|
-
},
|
|
304
|
+
}, r.useState = function(t) {
|
|
295
305
|
return i.H.useState(t);
|
|
296
|
-
},
|
|
297
|
-
return i.H.useSyncExternalStore(t, e,
|
|
298
|
-
},
|
|
306
|
+
}, r.useSyncExternalStore = function(t, e, n) {
|
|
307
|
+
return i.H.useSyncExternalStore(t, e, n);
|
|
308
|
+
}, r.useTransition = function() {
|
|
299
309
|
return i.H.useTransition();
|
|
300
|
-
},
|
|
301
|
-
})),
|
|
302
|
-
l.exports =
|
|
303
|
-
})),
|
|
304
|
-
var l = /* @__PURE__ */ Symbol.for("react.transitional.element"),
|
|
305
|
-
function R(
|
|
310
|
+
}, r.version = "19.3.1";
|
|
311
|
+
})), rt = /* @__PURE__ */ C(((r, l) => {
|
|
312
|
+
l.exports = nt();
|
|
313
|
+
})), z = /* @__PURE__ */ tt(rt(), 1), G = (0, z.createContext)(et()), it = G.Provider, ft = () => (0, z.useContext)(G), ut = /* @__PURE__ */ C(((r) => {
|
|
314
|
+
var l = /* @__PURE__ */ Symbol.for("react.transitional.element"), d = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
315
|
+
function R(A, a, v) {
|
|
306
316
|
var y = null;
|
|
307
317
|
if (v !== void 0 && (y = "" + v), a.key !== void 0 && (y = "" + a.key), "key" in a) {
|
|
308
318
|
v = {};
|
|
@@ -310,19 +320,19 @@ var x = /* @__PURE__ */ C(((n) => {
|
|
|
310
320
|
} else v = a;
|
|
311
321
|
return a = v.ref, {
|
|
312
322
|
$$typeof: l,
|
|
313
|
-
type:
|
|
323
|
+
type: A,
|
|
314
324
|
key: y,
|
|
315
325
|
ref: a !== void 0 ? a : null,
|
|
316
326
|
props: v
|
|
317
327
|
};
|
|
318
328
|
}
|
|
319
|
-
|
|
320
|
-
})),
|
|
321
|
-
l.exports =
|
|
329
|
+
r.Fragment = d, r.jsx = R, r.jsxs = R;
|
|
330
|
+
})), ct = /* @__PURE__ */ C(((r, l) => {
|
|
331
|
+
l.exports = ut();
|
|
322
332
|
}));
|
|
323
333
|
export {
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
334
|
+
rt as i,
|
|
335
|
+
it as n,
|
|
336
|
+
ft as r,
|
|
337
|
+
ct as t
|
|
328
338
|
};
|
|
@@ -1,23 +1,4 @@
|
|
|
1
|
-
var
|
|
2
|
-
let n = {};
|
|
3
|
-
for (var a in e)
|
|
4
|
-
i(n, a, {
|
|
5
|
-
get: e[a],
|
|
6
|
-
enumerable: !0
|
|
7
|
-
});
|
|
8
|
-
return o || i(n, Symbol.toStringTag, { value: "Module" }), n;
|
|
9
|
-
}, C = (e, o, n, a) => {
|
|
10
|
-
if (o && typeof o == "object" || typeof o == "function")
|
|
11
|
-
for (var c = h(o), r = 0, g = c.length, t; r < g; r++)
|
|
12
|
-
t = c[r], !p.call(e, t) && t !== n && i(e, t, {
|
|
13
|
-
get: ((u) => o[u]).bind(null, t),
|
|
14
|
-
enumerable: !(a = v(o, t)) || a.enumerable
|
|
15
|
-
});
|
|
16
|
-
return e;
|
|
17
|
-
}, y = (e, o, n) => (n = e != null ? m(L(e)) : {}, C(o || !e || !e.__esModule || !p.call(e, "default") ? i(n, "default", {
|
|
18
|
-
value: e,
|
|
19
|
-
enumerable: !0
|
|
20
|
-
}) : n, e)), d = {
|
|
1
|
+
var a = {
|
|
21
2
|
inputPlaceholder: "メッセージを入力...",
|
|
22
3
|
emptyState: "メッセージを入力してください",
|
|
23
4
|
errorGeneric: "エラーが発生しました。しばらくしてからお試しください。",
|
|
@@ -64,6 +45,7 @@ var m = Object.create, i = Object.defineProperty, v = Object.getOwnPropertyDescr
|
|
|
64
45
|
errorRateLimit: "アクセスが集中しています。1 分ほど待ってからもう一度お試しください。",
|
|
65
46
|
errorDailyLimit: "本日の利用上限に達しました。明日以降にもう一度お試しください。",
|
|
66
47
|
errorMonthlyLimit: "今月の利用上限に達しました。プランの利用状況をご確認ください。",
|
|
48
|
+
errorResponseIncomplete: "応答が途中で途切れました。もう一度お試しください。",
|
|
67
49
|
qrcodeStopTextTooLong: "テキストが長すぎます。{max} 文字以内に収めてもう一度お試しください。",
|
|
68
50
|
toolConfirmationPrompt: "この操作を実行しますか?",
|
|
69
51
|
toolConfirmationApprove: "実行する",
|
|
@@ -123,8 +105,8 @@ var m = Object.create, i = Object.defineProperty, v = Object.getOwnPropertyDescr
|
|
|
123
105
|
speakMessageAria: "メッセージを読み上げる",
|
|
124
106
|
stopSpeakingLabel: "停止",
|
|
125
107
|
stopSpeakingAria: "読み上げを停止"
|
|
126
|
-
},
|
|
127
|
-
ja:
|
|
108
|
+
}, t = {
|
|
109
|
+
ja: a,
|
|
128
110
|
en: {
|
|
129
111
|
inputPlaceholder: "Type a message...",
|
|
130
112
|
emptyState: "Type a message to get started",
|
|
@@ -172,6 +154,7 @@ var m = Object.create, i = Object.defineProperty, v = Object.getOwnPropertyDescr
|
|
|
172
154
|
errorRateLimit: "Too many requests right now. Please wait about a minute and try again.",
|
|
173
155
|
errorDailyLimit: "The daily usage limit has been reached. Please try again tomorrow.",
|
|
174
156
|
errorMonthlyLimit: "The monthly usage limit has been reached. Please check your plan usage.",
|
|
157
|
+
errorResponseIncomplete: "The response was cut off. Please try again.",
|
|
175
158
|
qrcodeStopTextTooLong: "The text is too long. Please shorten it to within {max} characters and try again.",
|
|
176
159
|
toolConfirmationPrompt: "Do you want to run this action?",
|
|
177
160
|
toolConfirmationApprove: "Run",
|
|
@@ -232,16 +215,13 @@ var m = Object.create, i = Object.defineProperty, v = Object.getOwnPropertyDescr
|
|
|
232
215
|
stopSpeakingLabel: "Stop",
|
|
233
216
|
stopSpeakingAria: "Stop reading aloud"
|
|
234
217
|
}
|
|
235
|
-
},
|
|
218
|
+
}, r = (e) => e && t[e] ? t[e] : a, o = (e) => e !== void 0 && e.length > 0 ? e : void 0, s = (e, n) => {
|
|
236
219
|
if (e === void 0) return;
|
|
237
|
-
if (typeof e == "string") return
|
|
238
|
-
const
|
|
239
|
-
return
|
|
220
|
+
if (typeof e == "string") return o(e);
|
|
221
|
+
const i = n === "ja" ? "en" : "ja";
|
|
222
|
+
return o(e[n]) ?? o(e[i]);
|
|
240
223
|
};
|
|
241
224
|
export {
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
w as n,
|
|
245
|
-
b as r,
|
|
246
|
-
A as t
|
|
225
|
+
s as n,
|
|
226
|
+
r as t
|
|
247
227
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"widget-self-http.test.d.ts","sourceRoot":"","sources":["../../../src/observe/__tests__/widget-self-http.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"widget-self.test.d.ts","sourceRoot":"","sources":["../../../src/observe/__tests__/widget-self.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../../src/observe/observers/http.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../../src/observe/observers/http.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAG9C;;;;;;;;;;GAUG;AAEH,KAAK,UAAU,GAAG,CAAC,KAAK,EAAE,OAAO,CAAC,aAAa,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,KAAK,IAAI,CAAC;AA4G5E;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,GAAI,QAAQ,UAAU,KAAG,CAAC,MAAM,IAAI,CAUrE,CAAC"}
|
|
@@ -2,8 +2,13 @@ import { ObservedEvent } from '../types';
|
|
|
2
2
|
/**
|
|
3
3
|
* JS エラー(未捕捉例外・Promise reject・console.error)を観測する module-level シングルトン。
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
* observe の目的はホストのページで起きているエラーを AI へ伝えること。既定では記録し、
|
|
6
|
+
* **ウィジェットが自分の出し口(widget-self.ts)から出した console.error だけを除く**(#367)。
|
|
7
|
+
*
|
|
8
|
+
* 未捕捉例外 / reject には widget 起源判定(core/widget-origin.ts)を使わない。あの判定は
|
|
9
|
+
* スタックのどこかにバンドルがあれば真を返す(error-reporter 用の「迷ったら送らない」側)ため、
|
|
10
|
+
* ホストのコールバック内で投げられたホストの例外まで落としてしまう。ウィジェットの未捕捉例外は
|
|
11
|
+
* 稀で、ホストのエラーを取りこぼす害の方が大きいので、従来どおりすべて記録する。
|
|
7
12
|
*
|
|
8
13
|
* console.error は window の `error` イベントを発火しないため、ここだけは元関数をラップする
|
|
9
14
|
* (元 console.error を必ず呼び、ホストの既存ロガーを壊さない)。最後の購読解除で原状復帰する。
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"js-error.d.ts","sourceRoot":"","sources":["../../../src/observe/observers/js-error.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"js-error.d.ts","sourceRoot":"","sources":["../../../src/observe/observers/js-error.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAG9C;;;;;;;;;;;;;GAaG;AAEH,KAAK,WAAW,GAAG,CAAC,KAAK,EAAE,OAAO,CAAC,aAAa,EAAE;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,CAAC,KAAK,IAAI,CAAC;AAwEjF;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,GAAI,QAAQ,WAAW,KAAG,CAAC,MAAM,IAAI,CAOzE,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ページ観測から「ウィジェット自身が起こしたもの」を除くための目印とあて先の登録(issue #367)。
|
|
3
|
+
*
|
|
4
|
+
* observe の目的はホストのページで起きていることを AI へ伝えること。ウィジェット自身の
|
|
5
|
+
* 失敗(チャットの失敗ログ・自分の API への通信の 4xx/5xx)まで拾うと、ホストに問題が
|
|
6
|
+
* 無いのに AI がエラーの話を始める。
|
|
7
|
+
*
|
|
8
|
+
* - エラーログは「ウィジェットが出している間だけ立つ目印」で見分ける。console.error の
|
|
9
|
+
* 呼び出しは同期的に観測のラッパーへ届くため、間にホストのロガー(Sentry 等)が
|
|
10
|
+
* 挟まっても目印は保たれる。スタックの URL による判定は npm でホストのバンドルに
|
|
11
|
+
* 取り込まれると効かないため使わない。
|
|
12
|
+
* - 通信は「ウィジェットの API のあて先」で見分ける。エラー報告は作成時の fetch を
|
|
13
|
+
* 保持しており、目印方式では観測の割り込みと前後関係が崩れるため、あて先で判定する。
|
|
14
|
+
*
|
|
15
|
+
* 観測(http.ts / js-error.ts)と同じく module-level で持つ。同一ページの複数ウィジェットが
|
|
16
|
+
* 同じ仕組みを共有するため、あて先はページ単位で数えて管理する。
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* 目印を立てたまま fn を同期的に実行する。その間の console.error はページ観測に記録しない。
|
|
20
|
+
* ホストの失敗通知コールバック(onError)の呼び出しにも使う: 渡すのはウィジェットの失敗で、
|
|
21
|
+
* 中で出されたログはその失敗についてのものと見なす(#367)。await 後など非同期のログは対象外。
|
|
22
|
+
*
|
|
23
|
+
* @param fn - 目印を立てている間に実行する処理
|
|
24
|
+
*/
|
|
25
|
+
export declare const runAsWidget: (fn: () => void) => void;
|
|
26
|
+
/**
|
|
27
|
+
* ウィジェット自身のエラーログを出す。出力中だけ目印を立て、ページ観測に記録させない。
|
|
28
|
+
* ブラウザのコンソールとホストのロガーには従来どおり届く。
|
|
29
|
+
*
|
|
30
|
+
* @param args - console.error に渡す引数
|
|
31
|
+
*/
|
|
32
|
+
export declare const logWidgetError: (...args: unknown[]) => void;
|
|
33
|
+
/** いまの console.error 呼び出しがウィジェット自身のエラーログかどうか */
|
|
34
|
+
export declare const isLoggingAsWidget: () => boolean;
|
|
35
|
+
/**
|
|
36
|
+
* ウィジェットの API あて先を登録する。このプレフィックスで始まる URL への通信は
|
|
37
|
+
* ページ観測に記録しない。同じあて先を複数のウィジェットが登録した場合は数を数え、
|
|
38
|
+
* 最後の解除で外す。
|
|
39
|
+
*
|
|
40
|
+
* @param prefix - あて先のプレフィックス(例: `https://api.example.com/api/v1/`)
|
|
41
|
+
* @returns 解除関数(多重呼び出しは無害)
|
|
42
|
+
*/
|
|
43
|
+
export declare const registerWidgetEndpoint: (prefix: string) => (() => void);
|
|
44
|
+
/** URL が登録済みのウィジェット API あて先への通信かどうか */
|
|
45
|
+
export declare const isWidgetRequestUrl: (url: string) => boolean;
|
|
46
|
+
//# sourceMappingURL=widget-self.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"widget-self.d.ts","sourceRoot":"","sources":["../../src/observe/widget-self.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAQH;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,GAAI,IAAI,MAAM,IAAI,KAAG,IAU5C,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,cAAc,GAAI,GAAG,MAAM,OAAO,EAAE,KAAG,IAEnD,CAAC;AAEF,gDAAgD;AAChD,eAAO,MAAM,iBAAiB,QAAO,OAA0B,CAAC;AAEhE;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,GAAI,QAAQ,MAAM,KAAG,CAAC,MAAM,IAAI,CAUlE,CAAC;AAEF,uCAAuC;AACvC,eAAO,MAAM,kBAAkB,GAAI,KAAK,MAAM,KAAG,OAKhD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/plugin/logger.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/plugin/logger.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,GAAI,OAAO,MAAM,KAAG,YASlD,CAAC"}
|
package/dist/plugins/qrcode.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as
|
|
1
|
+
import { r as c } from "../rolldown-runtime-Csywlj8R.js";
|
|
2
|
+
import { t as d } from "../define-DZ0itsfG.js";
|
|
3
|
+
import { t as u } from "../messages-ZLdeJx9N.js";
|
|
3
4
|
import { t as l } from "../abort-BjeyCmGn.js";
|
|
4
5
|
var h = [
|
|
5
6
|
"L",
|
|
@@ -80,7 +81,7 @@ Security responsibilities: do NOT call this tool and ask the user to confirm int
|
|
|
80
81
|
|
|
81
82
|
The result is displayed as an image inside the chat. No file is downloaded until the user presses the download button; never try to trigger a download from the tool call.`, R = (e) => {
|
|
82
83
|
let r = null;
|
|
83
|
-
const o = () => (r ??= import("../browser-
|
|
84
|
+
const o = () => (r ??= import("../browser-a2qIWP48.js").then((t) => /* @__PURE__ */ c(t.default, 1)), r);
|
|
84
85
|
return {
|
|
85
86
|
name: "generate_qrcode",
|
|
86
87
|
description: L,
|
|
@@ -101,7 +102,7 @@ The result is displayed as an image inside the chat. No file is downloaded until
|
|
|
101
102
|
}, i = (e) => ({ forLLM: e }), y = (e, r) => ({ stop: {
|
|
102
103
|
reason: "text_too_long",
|
|
103
104
|
category: "user_error",
|
|
104
|
-
userMessage:
|
|
105
|
+
userMessage: u(e).qrcodeStopTextTooLong.replace("{max}", String(r))
|
|
105
106
|
} }), _ = (e, r, o) => {
|
|
106
107
|
const t = g(e, r);
|
|
107
108
|
if (!t.ok)
|
|
@@ -165,7 +166,7 @@ The result is displayed as an image inside the chat. No file is downloaded until
|
|
|
165
166
|
l(r.signal);
|
|
166
167
|
const s = await E(n.text, n.size, n.errorCorrectionLevel, a);
|
|
167
168
|
return typeof s != "string" ? s : T(n, s);
|
|
168
|
-
}, b = 256, k = "M", w = 2e3,
|
|
169
|
+
}, b = 256, k = "M", w = 2e3, F = (e = {}) => d({
|
|
169
170
|
pluginApiVersion: 1,
|
|
170
171
|
id: "wecool/qrcode",
|
|
171
172
|
version: "0.1.0",
|
|
@@ -178,5 +179,5 @@ The result is displayed as an image inside the chat. No file is downloaded until
|
|
|
178
179
|
}
|
|
179
180
|
});
|
|
180
181
|
export {
|
|
181
|
-
|
|
182
|
+
F as createQrcodePlugin
|
|
182
183
|
};
|