@tonyclaw/llm-inspector 1.10.0 → 1.11.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/.output/nitro.json +1 -1
- package/.output/public/assets/index-BIZeMR5N.js +105 -0
- package/.output/public/assets/index-SmtLx1lM.css +1 -0
- package/.output/public/assets/main-QfbQ5oBP.js +17 -0
- package/.output/server/_libs/@radix-ui/react-use-controllable-state+[...].mjs +1 -1
- package/.output/server/_libs/ajv-formats.mjs +18 -18
- package/.output/server/_libs/ajv.mjs +6306 -942
- package/.output/server/_libs/cookie-es.mjs +21 -7
- package/.output/server/_libs/diff.mjs +320 -0
- package/.output/server/_libs/floating-ui__core.mjs +17 -18
- package/.output/server/_libs/floating-ui__dom.mjs +20 -24
- package/.output/server/_libs/floating-ui__react-dom.mjs +28 -55
- package/.output/server/_libs/floating-ui__utils.mjs +36 -36
- package/.output/server/_libs/h3-v2.mjs +9 -20
- package/.output/server/_libs/isbot.mjs +2 -3
- package/.output/server/_libs/json-schema-traverse.mjs +90 -1
- package/.output/server/_libs/jszip.mjs +28 -28
- package/.output/server/_libs/lucide-react.mjs +103 -80
- package/.output/server/_libs/mdast-util-from-markdown.mjs +1 -1
- package/.output/server/_libs/pako.mjs +13 -13
- package/.output/server/_libs/property-information.mjs +1 -13
- package/.output/server/_libs/radix-ui__react-collection.mjs +1 -1
- package/.output/server/_libs/radix-ui__react-id.mjs +1 -1
- package/.output/server/_libs/react-dom.mjs +10 -10
- package/.output/server/_libs/react.mjs +44 -44
- package/.output/server/_libs/readable-stream.mjs +15 -15
- package/.output/server/_libs/rou3.mjs +7 -1
- package/.output/server/_libs/safe-buffer.mjs +3 -3
- package/.output/server/_libs/semver.mjs +10 -10
- package/.output/server/_libs/seroval-plugins.mjs +5 -5
- package/.output/server/_libs/seroval.mjs +596 -606
- package/.output/server/_libs/srvx.mjs +245 -10
- package/.output/server/_libs/swr.mjs +1 -1
- package/.output/server/_libs/tailwind-merge.mjs +41 -286
- package/.output/server/_libs/tanstack__history.mjs +44 -31
- package/.output/server/_libs/tanstack__react-router.mjs +1089 -780
- package/.output/server/_libs/tanstack__react-store.mjs +1 -1
- package/.output/server/_libs/tanstack__react-virtual.mjs +7 -82
- package/.output/server/_libs/tanstack__router-core.mjs +2331 -2226
- package/.output/server/_libs/tanstack__virtual-core.mjs +17 -58
- package/.output/server/_libs/tiny-invariant.mjs +12 -0
- package/.output/server/_libs/tiny-warning.mjs +5 -0
- package/.output/server/_libs/ungap__structured-clone.mjs +2 -14
- package/.output/server/_libs/use-sync-external-store.mjs +1 -1
- package/.output/server/_libs/zod.mjs +207 -505
- package/.output/server/_ssr/{index-XyU4WVWt.mjs → index-I_Nx8QEB.mjs} +532 -79
- package/.output/server/_ssr/index.mjs +776 -1098
- package/.output/server/_ssr/{router-BR4XO8XJ.mjs → router-BVxfVFsb.mjs} +98 -53
- package/.output/server/_tanstack-start-manifest_v-Cm2Owszu.mjs +4 -0
- package/.output/server/index.mjs +28 -28
- package/README.md +1 -1
- package/package.json +2 -1
- package/src/components/ProxyViewer.tsx +10 -3
- package/src/components/ProxyViewerContainer.tsx +6 -0
- package/src/components/proxy-viewer/ConversationGroup.tsx +10 -1
- package/src/components/proxy-viewer/LogEntry.tsx +114 -5
- package/src/components/proxy-viewer/diff/DiffView.tsx +319 -0
- package/src/components/proxy-viewer/diff/computeDiff.ts +178 -0
- package/src/components/proxy-viewer/diff/index.ts +3 -0
- package/src/components/ui/crab-logo.tsx +45 -0
- package/src/proxy/config.ts +3 -17
- package/src/proxy/dataDir.ts +56 -0
- package/src/proxy/formats/anthropic/stream.ts +5 -2
- package/src/proxy/formats/jsonSchema.ts +12 -0
- package/src/proxy/formats/openai/stream.ts +21 -16
- package/src/proxy/handler.ts +15 -5
- package/src/proxy/providers.ts +61 -1
- package/src/proxy/schemas.ts +42 -0
- package/src/proxy/store.ts +6 -23
- package/.output/public/assets/index-BFuUQkWu.js +0 -11
- package/.output/public/assets/index-F2ojFPJp.css +0 -1
- package/.output/public/assets/index-nKnhyW4Y.js +0 -122
- package/.output/server/_ssr/empty-plugin-adapters-BFgPZ6_d.mjs +0 -6
- package/.output/server/_tanstack-start-manifest_v-DFoSjBkb.mjs +0 -4
|
@@ -1,34 +1,39 @@
|
|
|
1
|
-
|
|
1
|
+
const stateIndexKey = "__TSR_index";
|
|
2
2
|
function createHistory(opts) {
|
|
3
3
|
let location = opts.getLocation();
|
|
4
4
|
const subscribers = /* @__PURE__ */ new Set();
|
|
5
5
|
const notify = (action) => {
|
|
6
6
|
location = opts.getLocation();
|
|
7
|
-
subscribers.forEach((subscriber) => subscriber({
|
|
8
|
-
location,
|
|
9
|
-
action
|
|
10
|
-
}));
|
|
7
|
+
subscribers.forEach((subscriber) => subscriber({ location, action }));
|
|
11
8
|
};
|
|
12
9
|
const handleIndexChange = (action) => {
|
|
13
10
|
if (opts.notifyOnIndexChange ?? true) notify(action);
|
|
14
11
|
else location = opts.getLocation();
|
|
15
12
|
};
|
|
16
|
-
const tryNavigation = async ({
|
|
17
|
-
|
|
13
|
+
const tryNavigation = async ({
|
|
14
|
+
task,
|
|
15
|
+
navigateOpts,
|
|
16
|
+
...actionInfo
|
|
17
|
+
}) => {
|
|
18
|
+
const ignoreBlocker = navigateOpts?.ignoreBlocker ?? false;
|
|
19
|
+
if (ignoreBlocker) {
|
|
18
20
|
task();
|
|
19
21
|
return;
|
|
20
22
|
}
|
|
21
23
|
const blockers = opts.getBlockers?.() ?? [];
|
|
22
24
|
const isPushOrReplace = actionInfo.type === "PUSH" || actionInfo.type === "REPLACE";
|
|
23
|
-
if (typeof document !== "undefined" && blockers.length && isPushOrReplace)
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
if (typeof document !== "undefined" && blockers.length && isPushOrReplace) {
|
|
26
|
+
for (const blocker of blockers) {
|
|
27
|
+
const nextLocation = parseHref(actionInfo.path, actionInfo.state);
|
|
28
|
+
const isBlocked = await blocker.blockerFn({
|
|
29
|
+
currentLocation: location,
|
|
30
|
+
nextLocation,
|
|
31
|
+
action: actionInfo.type
|
|
32
|
+
});
|
|
33
|
+
if (isBlocked) {
|
|
34
|
+
opts.onBlocked?.();
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
32
37
|
}
|
|
33
38
|
}
|
|
34
39
|
task();
|
|
@@ -79,10 +84,7 @@ function createHistory(opts) {
|
|
|
79
84
|
tryNavigation({
|
|
80
85
|
task: () => {
|
|
81
86
|
opts.go(index);
|
|
82
|
-
handleIndexChange({
|
|
83
|
-
type: "GO",
|
|
84
|
-
index
|
|
85
|
-
});
|
|
87
|
+
handleIndexChange({ type: "GO", index });
|
|
86
88
|
},
|
|
87
89
|
navigateOpts,
|
|
88
90
|
type: "GO"
|
|
@@ -126,19 +128,26 @@ function createHistory(opts) {
|
|
|
126
128
|
};
|
|
127
129
|
}
|
|
128
130
|
function assignKeyAndIndex(index, state) {
|
|
129
|
-
if (!state)
|
|
131
|
+
if (!state) {
|
|
132
|
+
state = {};
|
|
133
|
+
}
|
|
130
134
|
const key = createRandomKey();
|
|
131
135
|
return {
|
|
132
136
|
...state,
|
|
133
137
|
key,
|
|
138
|
+
// TODO: Remove in v2 - use __TSR_key instead
|
|
134
139
|
__TSR_key: key,
|
|
135
140
|
[stateIndexKey]: index
|
|
136
141
|
};
|
|
137
142
|
}
|
|
138
|
-
function createMemoryHistory(opts = {
|
|
143
|
+
function createMemoryHistory(opts = {
|
|
144
|
+
initialEntries: ["/"]
|
|
145
|
+
}) {
|
|
139
146
|
const entries = opts.initialEntries;
|
|
140
147
|
let index = opts.initialIndex ? Math.min(Math.max(opts.initialIndex, 0), entries.length - 1) : entries.length - 1;
|
|
141
|
-
const states = entries.map(
|
|
148
|
+
const states = entries.map(
|
|
149
|
+
(_entry, index2) => assignKeyAndIndex(index2, void 0)
|
|
150
|
+
);
|
|
142
151
|
const getLocation = () => parseHref(entries[index], states[index]);
|
|
143
152
|
let blockers = [];
|
|
144
153
|
const _getBlockers = () => blockers;
|
|
@@ -175,7 +184,9 @@ function createMemoryHistory(opts = { initialEntries: ["/"] }) {
|
|
|
175
184
|
}
|
|
176
185
|
function sanitizePath(path) {
|
|
177
186
|
let sanitized = path.replace(/[\x00-\x1f\x7f]/g, "");
|
|
178
|
-
if (sanitized.startsWith("//"))
|
|
187
|
+
if (sanitized.startsWith("//")) {
|
|
188
|
+
sanitized = "/" + sanitized.replace(/^\/+/, "");
|
|
189
|
+
}
|
|
179
190
|
return sanitized;
|
|
180
191
|
}
|
|
181
192
|
function parseHref(href, state) {
|
|
@@ -185,14 +196,16 @@ function parseHref(href, state) {
|
|
|
185
196
|
const addedKey = createRandomKey();
|
|
186
197
|
return {
|
|
187
198
|
href: sanitizedHref,
|
|
188
|
-
pathname: sanitizedHref.substring(
|
|
199
|
+
pathname: sanitizedHref.substring(
|
|
200
|
+
0,
|
|
201
|
+
hashIndex > 0 ? searchIndex > 0 ? Math.min(hashIndex, searchIndex) : hashIndex : searchIndex > 0 ? searchIndex : sanitizedHref.length
|
|
202
|
+
),
|
|
189
203
|
hash: hashIndex > -1 ? sanitizedHref.substring(hashIndex) : "",
|
|
190
|
-
search: searchIndex > -1 ? sanitizedHref.slice(
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
}
|
|
204
|
+
search: searchIndex > -1 ? sanitizedHref.slice(
|
|
205
|
+
searchIndex,
|
|
206
|
+
hashIndex === -1 ? void 0 : hashIndex
|
|
207
|
+
) : "",
|
|
208
|
+
state: state || { [stateIndexKey]: 0, key: addedKey, __TSR_key: addedKey }
|
|
196
209
|
};
|
|
197
210
|
}
|
|
198
211
|
function createRandomKey() {
|