@ubean/devtools 0.4.5 → 0.4.6
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/client/assets/index-BTXnh1xi.js +454 -0
- package/dist/client/index.html +1 -1
- package/dist/index.d.ts +43 -43
- package/dist/index.js +2 -2
- package/package.json +7 -7
- package/dist/client/assets/index-BYahQvLp.js +0 -454
package/dist/client/index.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<link rel="icon" href="https://r2.soybeanjs.tech/soybeanjs/logo-ubean.svg?v=202608192144" type="image/svg+xml" />
|
|
7
7
|
<title>Ubean DevTools</title>
|
|
8
|
-
<script type="module" crossorigin src="/_devtools/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/_devtools/assets/index-BTXnh1xi.js"></script>
|
|
9
9
|
<link rel="stylesheet" crossorigin href="/_devtools/assets/index-BY5Yi4Eq.css">
|
|
10
10
|
</head>
|
|
11
11
|
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { Plugin } from "vite";
|
|
|
2
2
|
import { ViteDevToolsNodeContext, defineRpcFunction } from "@vitejs/devtools-kit";
|
|
3
3
|
import { SharedState } from "devframe/utils/shared-state";
|
|
4
4
|
//#region src/shared/env.d.ts
|
|
5
|
-
declare function maskSensitiveEnv(env: Record<string, string>): Record<string, string>;
|
|
5
|
+
export declare function maskSensitiveEnv(env: Record<string, string>): Record<string, string>;
|
|
6
6
|
//#endregion
|
|
7
7
|
//#region src/server/hooks.d.ts
|
|
8
8
|
interface DevToolsHooks {
|
|
@@ -13,7 +13,7 @@ interface DevToolsHooks {
|
|
|
13
13
|
beforeDelete: (ctx: CrudHookContext) => void | Promise<void>;
|
|
14
14
|
afterDelete: (ctx: CrudHookContext) => void | Promise<void>;
|
|
15
15
|
}
|
|
16
|
-
declare function createDevToolsHooks(): {
|
|
16
|
+
export declare function createDevToolsHooks(): {
|
|
17
17
|
registerHook: (type: CrudHookType, handler: CrudHookHandler) => void;
|
|
18
18
|
runHook: (type: CrudHookType, ctx: CrudHookContext) => Promise<void>;
|
|
19
19
|
removeHook: (type: CrudHookType, handler: CrudHookHandler) => void;
|
|
@@ -35,7 +35,7 @@ interface CrudServerOptions {
|
|
|
35
35
|
onFileChange?: () => void | Promise<void>;
|
|
36
36
|
scaffoldOps?: DevToolsScaffoldOps;
|
|
37
37
|
}
|
|
38
|
-
declare function createCrudServer(options: CrudServerOptions): {
|
|
38
|
+
export declare function createCrudServer(options: CrudServerOptions): {
|
|
39
39
|
create: (params: CreateCrudParams) => Promise<CrudResult>;
|
|
40
40
|
read: (params: ReadCrudParams) => Promise<{
|
|
41
41
|
success: boolean;
|
|
@@ -107,7 +107,7 @@ interface AiStreamChunk {
|
|
|
107
107
|
toolResults?: AiToolResult[];
|
|
108
108
|
error?: string;
|
|
109
109
|
}
|
|
110
|
-
declare function createAiServer(crud: DevToolsCrudServer, getInfo: () => DevToolsInfo, onStreamChunk?: (chunk: AiStreamChunk) => void): {
|
|
110
|
+
export declare function createAiServer(crud: DevToolsCrudServer, getInfo: () => DevToolsInfo, onStreamChunk?: (chunk: AiStreamChunk) => void): {
|
|
111
111
|
getToolDefinitions: () => AiToolDefinition[];
|
|
112
112
|
executeToolCall: (call: AiToolCall) => Promise<AiToolResult>;
|
|
113
113
|
chat: (options: AiChatOptions) => Promise<AiChatResponse>;
|
|
@@ -146,7 +146,7 @@ interface TerminalPollResult {
|
|
|
146
146
|
exited: boolean;
|
|
147
147
|
exitCode: number | null;
|
|
148
148
|
}
|
|
149
|
-
declare function createTerminalServer(): {
|
|
149
|
+
export declare function createTerminalServer(): {
|
|
150
150
|
start: (params: TerminalStartParams) => {
|
|
151
151
|
sessionId: string;
|
|
152
152
|
};
|
|
@@ -159,7 +159,7 @@ declare function createTerminalServer(): {
|
|
|
159
159
|
type TerminalServer = ReturnType<typeof createTerminalServer>;
|
|
160
160
|
//#endregion
|
|
161
161
|
//#region src/types.d.ts
|
|
162
|
-
interface DevToolsOptions {
|
|
162
|
+
export interface DevToolsOptions {
|
|
163
163
|
enabled?: boolean;
|
|
164
164
|
port?: number;
|
|
165
165
|
host?: string;
|
|
@@ -169,41 +169,41 @@ interface DevToolsOptions {
|
|
|
169
169
|
model?: string;
|
|
170
170
|
};
|
|
171
171
|
}
|
|
172
|
-
interface DevToolsRouteInfo {
|
|
172
|
+
export interface DevToolsRouteInfo {
|
|
173
173
|
method: string;
|
|
174
174
|
path: string;
|
|
175
175
|
filePath?: string;
|
|
176
176
|
}
|
|
177
|
-
interface DevToolsPageInfo {
|
|
177
|
+
export interface DevToolsPageInfo {
|
|
178
178
|
path: string;
|
|
179
179
|
name?: string;
|
|
180
180
|
filePath?: string;
|
|
181
181
|
layout?: string;
|
|
182
182
|
}
|
|
183
|
-
interface DevToolsMiddlewareInfo {
|
|
183
|
+
export interface DevToolsMiddlewareInfo {
|
|
184
184
|
path: string;
|
|
185
185
|
filePath?: string;
|
|
186
186
|
global: boolean;
|
|
187
187
|
}
|
|
188
|
-
interface DevToolsCronInfo {
|
|
188
|
+
export interface DevToolsCronInfo {
|
|
189
189
|
name: string;
|
|
190
190
|
schedule?: string;
|
|
191
191
|
filePath?: string;
|
|
192
192
|
}
|
|
193
|
-
interface DevToolsLayoutInfo {
|
|
193
|
+
export interface DevToolsLayoutInfo {
|
|
194
194
|
name: string;
|
|
195
195
|
path: string;
|
|
196
196
|
filePath?: string;
|
|
197
197
|
isDefault: boolean;
|
|
198
198
|
}
|
|
199
|
-
interface DevToolsCustomTab {
|
|
199
|
+
export interface DevToolsCustomTab {
|
|
200
200
|
id: string;
|
|
201
201
|
label: string;
|
|
202
202
|
icon?: string;
|
|
203
203
|
src: string;
|
|
204
204
|
sandbox?: string[];
|
|
205
205
|
}
|
|
206
|
-
interface DevToolsInfo {
|
|
206
|
+
export interface DevToolsInfo {
|
|
207
207
|
version: string;
|
|
208
208
|
startTime: number;
|
|
209
209
|
config: Record<string, unknown>;
|
|
@@ -236,14 +236,14 @@ interface DevToolsInfo {
|
|
|
236
236
|
customTabs?: DevToolsCustomTab[];
|
|
237
237
|
}
|
|
238
238
|
/** Read-result shape returned by `ubean:crud:read`. */
|
|
239
|
-
interface CrudReadResult {
|
|
239
|
+
export interface CrudReadResult {
|
|
240
240
|
success: boolean;
|
|
241
241
|
content?: string;
|
|
242
242
|
data?: unknown;
|
|
243
243
|
error?: string;
|
|
244
244
|
}
|
|
245
245
|
/** Params for `ubean:ai:chat`. */
|
|
246
|
-
interface AiChatParams {
|
|
246
|
+
export interface AiChatParams {
|
|
247
247
|
messages: AiChatMessage[];
|
|
248
248
|
apiKey?: string;
|
|
249
249
|
apiBase?: string;
|
|
@@ -284,29 +284,29 @@ declare module 'devframe' {
|
|
|
284
284
|
'ubean:info': DevToolsInfo;
|
|
285
285
|
}
|
|
286
286
|
}
|
|
287
|
-
type RpcHandler = (params: unknown) => unknown | Promise<unknown>;
|
|
288
|
-
interface DevToolsServer {
|
|
287
|
+
export type RpcHandler = (params: unknown) => unknown | Promise<unknown>;
|
|
288
|
+
export interface DevToolsServer {
|
|
289
289
|
rpcHandlers: Map<string, RpcHandler>;
|
|
290
290
|
registerHandler: (name: string, handler: RpcHandler) => void;
|
|
291
291
|
getInfo: () => DevToolsInfo;
|
|
292
292
|
}
|
|
293
|
-
interface RpcRequest {
|
|
293
|
+
export interface RpcRequest {
|
|
294
294
|
id: string;
|
|
295
295
|
method: string;
|
|
296
296
|
params?: unknown;
|
|
297
297
|
}
|
|
298
|
-
interface RpcResponse<T = unknown> {
|
|
298
|
+
export interface RpcResponse<T = unknown> {
|
|
299
299
|
id: string;
|
|
300
300
|
result?: T;
|
|
301
301
|
error?: string;
|
|
302
302
|
}
|
|
303
|
-
interface DevToolsTab {
|
|
303
|
+
export interface DevToolsTab {
|
|
304
304
|
id: string;
|
|
305
305
|
label: string;
|
|
306
306
|
icon?: string;
|
|
307
307
|
}
|
|
308
|
-
type CrudResourceType = 'page' | 'api' | 'layout' | 'middleware' | 'reuse' | 'cron' | 'plugin';
|
|
309
|
-
interface CrudResult {
|
|
308
|
+
export type CrudResourceType = 'page' | 'api' | 'layout' | 'middleware' | 'reuse' | 'cron' | 'plugin';
|
|
309
|
+
export interface CrudResult {
|
|
310
310
|
success: boolean;
|
|
311
311
|
created?: string[];
|
|
312
312
|
deleted?: string[];
|
|
@@ -315,7 +315,7 @@ interface CrudResult {
|
|
|
315
315
|
skipped?: string[];
|
|
316
316
|
errors?: string[];
|
|
317
317
|
}
|
|
318
|
-
interface CreateCrudParams {
|
|
318
|
+
export interface CreateCrudParams {
|
|
319
319
|
type: CrudResourceType;
|
|
320
320
|
path: string;
|
|
321
321
|
method?: string;
|
|
@@ -323,41 +323,41 @@ interface CreateCrudParams {
|
|
|
323
323
|
content?: string;
|
|
324
324
|
force?: boolean;
|
|
325
325
|
}
|
|
326
|
-
interface ReadCrudParams {
|
|
326
|
+
export interface ReadCrudParams {
|
|
327
327
|
type: CrudResourceType | 'env' | 'config';
|
|
328
328
|
path?: string;
|
|
329
329
|
}
|
|
330
|
-
interface UpdateCrudParams {
|
|
330
|
+
export interface UpdateCrudParams {
|
|
331
331
|
type: CrudResourceType | 'env' | 'config';
|
|
332
332
|
path?: string;
|
|
333
333
|
key?: string;
|
|
334
334
|
content?: string;
|
|
335
335
|
value?: string;
|
|
336
336
|
}
|
|
337
|
-
interface DeleteCrudParams {
|
|
337
|
+
export interface DeleteCrudParams {
|
|
338
338
|
type: CrudResourceType | 'env';
|
|
339
339
|
path?: string;
|
|
340
340
|
key?: string;
|
|
341
341
|
force?: boolean;
|
|
342
342
|
}
|
|
343
|
-
type CrudHookType = 'beforeCreate' | 'afterCreate' | 'beforeUpdate' | 'afterUpdate' | 'beforeDelete' | 'afterDelete';
|
|
344
|
-
interface CrudHookContext {
|
|
343
|
+
export type CrudHookType = 'beforeCreate' | 'afterCreate' | 'beforeUpdate' | 'afterUpdate' | 'beforeDelete' | 'afterDelete';
|
|
344
|
+
export interface CrudHookContext {
|
|
345
345
|
type: CrudResourceType | 'env' | 'config';
|
|
346
346
|
path?: string;
|
|
347
347
|
key?: string;
|
|
348
348
|
content?: string;
|
|
349
349
|
value?: string;
|
|
350
350
|
}
|
|
351
|
-
type CrudHookHandler = (ctx: CrudHookContext) => void | Promise<void>;
|
|
352
|
-
type DevToolsScaffoldType = 'page' | 'api' | 'layout' | 'middleware' | 'reuse';
|
|
353
|
-
interface ScaffoldResult {
|
|
351
|
+
export type CrudHookHandler = (ctx: CrudHookContext) => void | Promise<void>;
|
|
352
|
+
export type DevToolsScaffoldType = 'page' | 'api' | 'layout' | 'middleware' | 'reuse';
|
|
353
|
+
export interface ScaffoldResult {
|
|
354
354
|
created: string[];
|
|
355
355
|
deleted: string[];
|
|
356
356
|
restored: string[];
|
|
357
357
|
skipped: string[];
|
|
358
358
|
errors: string[];
|
|
359
359
|
}
|
|
360
|
-
interface ScaffoldOptions {
|
|
360
|
+
export interface ScaffoldOptions {
|
|
361
361
|
cwd?: string;
|
|
362
362
|
type: DevToolsScaffoldType;
|
|
363
363
|
path: string;
|
|
@@ -366,7 +366,7 @@ interface ScaffoldOptions {
|
|
|
366
366
|
dry?: boolean;
|
|
367
367
|
baseDir?: string;
|
|
368
368
|
}
|
|
369
|
-
interface DevToolsFsOps {
|
|
369
|
+
export interface DevToolsFsOps {
|
|
370
370
|
exists: (path: string) => Promise<boolean>;
|
|
371
371
|
readFile: (path: string, enc?: BufferEncoding) => Promise<string>;
|
|
372
372
|
writeFile: (path: string, content: string, enc?: BufferEncoding) => Promise<void>;
|
|
@@ -380,7 +380,7 @@ interface DevToolsFsOps {
|
|
|
380
380
|
backupSuffix?: string;
|
|
381
381
|
}) => Promise<void>;
|
|
382
382
|
}
|
|
383
|
-
interface DevToolsScaffoldOps {
|
|
383
|
+
export interface DevToolsScaffoldOps {
|
|
384
384
|
createFsOps: (cwd: string) => DevToolsFsOps;
|
|
385
385
|
scaffold: (opts: ScaffoldOptions) => Promise<ScaffoldResult>;
|
|
386
386
|
deleteScaffold: (opts: ScaffoldOptions) => Promise<ScaffoldResult>;
|
|
@@ -389,7 +389,7 @@ interface DevToolsScaffoldOps {
|
|
|
389
389
|
//#endregion
|
|
390
390
|
//#region src/node/state.d.ts
|
|
391
391
|
/** SharedState key for the ubean devtools info snapshot. */
|
|
392
|
-
declare const UBEAN_INFO_STATE_KEY = "ubean:info";
|
|
392
|
+
export declare const UBEAN_INFO_STATE_KEY = "ubean:info";
|
|
393
393
|
/**
|
|
394
394
|
* Structural shape of the scan data passed by `dev.ts`. Defined here
|
|
395
395
|
* (rather than importing ubean's `ScanResult`) so `@ubean/devtools`
|
|
@@ -458,9 +458,9 @@ interface BuildInfoOptions {
|
|
|
458
458
|
envData: Record<string, string>;
|
|
459
459
|
}
|
|
460
460
|
/** Build a fresh `DevToolsInfo` from scan + config metadata. */
|
|
461
|
-
declare function buildDevToolsInfo(opts: BuildInfoOptions): DevToolsInfo;
|
|
461
|
+
export declare function buildDevToolsInfo(opts: BuildInfoOptions): DevToolsInfo;
|
|
462
462
|
/** Initial empty state (used before scan data arrives). */
|
|
463
|
-
declare function emptyDevToolsInfo(startTime: number): DevToolsInfo;
|
|
463
|
+
export declare function emptyDevToolsInfo(startTime: number): DevToolsInfo;
|
|
464
464
|
//#endregion
|
|
465
465
|
//#region src/node/index.d.ts
|
|
466
466
|
/**
|
|
@@ -517,7 +517,7 @@ interface UbeanDevtoolsPluginOptions {
|
|
|
517
517
|
* the SPA. This replaces the previous Hono-middleware-based transport with
|
|
518
518
|
* the Vite DevTools Kit (DTK) birpc + shared-state machinery.
|
|
519
519
|
*/
|
|
520
|
-
declare function ubeanDevtoolsPlugin(options?: UbeanDevtoolsPluginOptions): Plugin;
|
|
520
|
+
export declare function ubeanDevtoolsPlugin(options?: UbeanDevtoolsPluginOptions): Plugin;
|
|
521
521
|
//#endregion
|
|
522
522
|
//#region src/node/rpc/index.d.ts
|
|
523
523
|
interface RpcDeps {
|
|
@@ -537,7 +537,7 @@ interface RpcDeps {
|
|
|
537
537
|
* generic instantiation varies per function — the individual functions are
|
|
538
538
|
* already type-checked at their definition site.
|
|
539
539
|
*/
|
|
540
|
-
declare function createAllRpcFunctions(deps: RpcDeps): any[];
|
|
540
|
+
export declare function createAllRpcFunctions(deps: RpcDeps): any[];
|
|
541
541
|
//#endregion
|
|
542
542
|
//#region src/define-tab.d.ts
|
|
543
543
|
/**
|
|
@@ -554,8 +554,8 @@ interface DevToolsTabDefinition {
|
|
|
554
554
|
src: string;
|
|
555
555
|
sandbox?: string[];
|
|
556
556
|
}
|
|
557
|
-
declare function defineDevToolsTab(tab: DevToolsTabDefinition): DevToolsTabDefinition;
|
|
558
|
-
declare function getCustomTabs(): DevToolsTabDefinition[];
|
|
559
|
-
declare function clearCustomTabs(): void;
|
|
557
|
+
export declare function defineDevToolsTab(tab: DevToolsTabDefinition): DevToolsTabDefinition;
|
|
558
|
+
export declare function getCustomTabs(): DevToolsTabDefinition[];
|
|
559
|
+
export declare function clearCustomTabs(): void;
|
|
560
560
|
//#endregion
|
|
561
|
-
export { type AiChatMessage,
|
|
561
|
+
export { type AiChatMessage, type AiChatResponse, type AiToolDefinition, type DevToolsAiServer, type DevToolsConfigMeta, type DevToolsCrudServer, type DevToolsHooks, type DevToolsHooksInstance, type DevToolsTabDefinition, type ScanResultLike, type TerminalPollResult, type TerminalServer, type TerminalStartParams, type UbeanDevtoolsPluginOptions, type ViteDevToolsNodeContext, defineRpcFunction };
|
package/dist/index.js
CHANGED
|
@@ -1315,14 +1315,14 @@ function createTerminalServer() {
|
|
|
1315
1315
|
};
|
|
1316
1316
|
}
|
|
1317
1317
|
//#endregion
|
|
1318
|
-
//#region ../../node_modules/.pnpm/devframe@0.9.
|
|
1318
|
+
//#region ../../node_modules/.pnpm/devframe@0.9.16_cac@7.0.0_srvx@1.0.4/node_modules/devframe/dist/define-BLWPsH6y.mjs
|
|
1319
1319
|
function createDefineWrapperWithContext() {
|
|
1320
1320
|
return function defineRpcFunctionWithContext(definition) {
|
|
1321
1321
|
return definition;
|
|
1322
1322
|
};
|
|
1323
1323
|
}
|
|
1324
1324
|
//#endregion
|
|
1325
|
-
//#region ../../node_modules/.pnpm/@vitejs+devtools-kit@0.6.3_@voidzero-dev+vite-plus-core@0.3.
|
|
1325
|
+
//#region ../../node_modules/.pnpm/@vitejs+devtools-kit@0.6.3_@voidzero-dev+vite-plus-core@0.3.1_@types+node@26.5.0_@vitej_bfbd6bd8e39efffb4a24acafe7796c01/node_modules/@vitejs/devtools-kit/dist/index.js
|
|
1326
1326
|
const defineRpcFunction = createDefineWrapperWithContext();
|
|
1327
1327
|
//#endregion
|
|
1328
1328
|
//#region src/node/rpc/ai.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ubean/devtools",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.6",
|
|
4
4
|
"description": "DevTools for the ubean framework — server middleware, RPC, and the iframe SPA client",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -38,10 +38,10 @@
|
|
|
38
38
|
"@xterm/addon-fit": "^0.11.0",
|
|
39
39
|
"@xterm/xterm": "^6.0.0",
|
|
40
40
|
"hono": "4.13.7",
|
|
41
|
-
"typescript": "
|
|
42
|
-
"unocss": "^66.10.
|
|
43
|
-
"vite": "npm:@voidzero-dev/vite-plus-core@0.3.
|
|
44
|
-
"vite-plus": "0.3.
|
|
41
|
+
"typescript": "npm:typescript-native-bridge@latest",
|
|
42
|
+
"unocss": "^66.10.1",
|
|
43
|
+
"vite": "npm:@voidzero-dev/vite-plus-core@0.3.1",
|
|
44
|
+
"vite-plus": "0.3.1",
|
|
45
45
|
"vue": "^3.5.42"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
@@ -57,8 +57,8 @@
|
|
|
57
57
|
}
|
|
58
58
|
},
|
|
59
59
|
"optionalDependencies": {
|
|
60
|
-
"@ai-sdk/openai-compatible": "3.0.
|
|
61
|
-
"ai": "7.0.
|
|
60
|
+
"@ai-sdk/openai-compatible": "3.0.45",
|
|
61
|
+
"ai": "7.0.94"
|
|
62
62
|
},
|
|
63
63
|
"scripts": {
|
|
64
64
|
"build": "pnpm run build:server && pnpm run build:client",
|