devframe 0.1.20 → 0.1.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +41 -18
- package/dist/{_shared-S-Ujqz_L.mjs → _shared-DcJX9-Az.mjs} +4 -4
- package/dist/adapters/build.d.mts +7 -7
- package/dist/adapters/build.mjs +15 -14
- package/dist/adapters/cli.d.mts +2 -2
- package/dist/adapters/cli.mjs +5 -5
- package/dist/adapters/dev.d.mts +18 -9
- package/dist/adapters/dev.mjs +1 -1
- package/dist/adapters/embedded.d.mts +6 -6
- package/dist/adapters/embedded.mjs +3 -3
- package/dist/adapters/mcp.d.mts +3 -3
- package/dist/adapters/mcp.mjs +6 -5
- package/dist/adapters/vite.d.mts +46 -12
- package/dist/adapters/vite.mjs +81 -17
- package/dist/chunk-e9Ob2GDo.mjs +26 -0
- package/dist/client/index.d.mts +19 -144
- package/dist/client/index.mjs +20 -20
- package/dist/colors-Bl4W18Mh.mjs +123 -0
- package/dist/constants.d.mts +12 -15
- package/dist/constants.mjs +12 -29
- package/dist/context-DBd794Rn.d.mts +51 -0
- package/dist/context-DUibxhrR.mjs +1034 -0
- package/dist/{dev-B8i_CBlQ.mjs → dev-BGpTpYiR.mjs} +20 -21
- package/dist/{devtool-Bm6zZAw5.d.mts → devframe-DulcIxwu.d.mts} +59 -569
- package/dist/diagnostics-BFhNNmST.mjs +56 -0
- package/dist/hash-BHZbo80D.mjs +126 -0
- package/dist/{human-id-CHS0s28X.mjs → human-id-adtUWQLr.mjs} +12 -4
- package/dist/{index-BCo03GEF.d.mts → index-DB2Ie0Or.d.mts} +2 -3
- package/dist/index.d.mts +4 -6
- package/dist/index.mjs +2 -8
- package/dist/launch-editor-KA_21J1T.mjs +581 -0
- package/dist/node/auth.d.mts +44 -0
- package/dist/node/auth.mjs +55 -0
- package/dist/node/index.d.mts +14 -187
- package/dist/node/index.mjs +6 -61
- package/dist/node/internal.d.mts +16 -0
- package/dist/node/internal.mjs +50 -0
- package/dist/{open-BtOOEldu.mjs → open-DmFp0qZA.mjs} +15 -6
- package/dist/recipes/open-helpers.d.mts +4 -9
- package/dist/recipes/open-helpers.mjs +7 -12
- package/dist/revoke-DIMz1r7-.mjs +35 -0
- package/dist/rpc/index.d.mts +3 -3
- package/dist/rpc/index.mjs +4 -4
- package/dist/rpc/transports/ws-client.d.mts +1 -1
- package/dist/rpc/transports/ws-client.mjs +2 -1
- package/dist/rpc/transports/ws-server.d.mts +1 -1
- package/dist/rpc/transports/ws-server.mjs +2 -1
- package/dist/{rpc-INbWfHoX.mjs → rpc-CkZuoz-m.mjs} +3 -2
- package/dist/{serialization-DwKi05Pn.mjs → serialization-CwO31axa.mjs} +1 -2
- package/dist/{server-qRRM8t3v.mjs → server-ma8-ZVyX.mjs} +1 -1
- package/dist/{server-DksyT-um.d.mts → server-zKEDxgqD.d.mts} +4 -3
- package/dist/shared-state-DCDs0e7y.mjs +928 -0
- package/dist/{static-dump-C1aVSwxY.mjs → static-dump-D7AvjrgL.mjs} +1 -1
- package/dist/storage-CNC38eU-.mjs +117 -0
- package/dist/structured-clone-DcDc2Dds.mjs +221 -0
- package/dist/types/index.d.mts +4 -4
- package/dist/types/index.mjs +11 -2
- package/dist/utils/colors.d.mts +28 -0
- package/dist/utils/colors.mjs +2 -0
- package/dist/utils/events.d.mts +1 -1
- package/dist/utils/hash.d.mts +7 -0
- package/dist/utils/hash.mjs +2 -0
- package/dist/utils/human-id.d.mts +6 -8
- package/dist/utils/human-id.mjs +1 -2
- package/dist/utils/launch-editor.d.mts +13 -0
- package/dist/utils/launch-editor.mjs +2 -0
- package/dist/utils/open.d.mts +16 -0
- package/dist/utils/open.mjs +2 -0
- package/dist/utils/serve-static.d.mts +30 -0
- package/dist/utils/serve-static.mjs +152 -0
- package/dist/utils/shared-state.d.mts +1 -1
- package/dist/utils/shared-state.mjs +1 -35
- package/dist/utils/streaming-channel.d.mts +1 -1
- package/dist/utils/structured-clone.d.mts +21 -0
- package/dist/utils/structured-clone.mjs +2 -0
- package/dist/utils/when.d.mts +384 -2
- package/dist/utils/when.mjs +20 -2
- package/dist/{ws-client-DQySVfF_.d.mts → ws-client-Bavoya6-.d.mts} +1 -1
- package/dist/{ws-server-VQqESKAs.d.mts → ws-server-DjvlwLuM.d.mts} +1 -1
- package/package.json +23 -13
- package/skills/devframe/SKILL.md +93 -117
- package/skills/devframe/templates/{counter-devtool.ts → counter-devframe.ts} +5 -10
- package/skills/devframe/templates/{spa-devtool.ts → spa-devframe.ts} +5 -10
- package/skills/devframe/templates/vite-client.ts +2 -2
- package/dist/adapters/kit.d.mts +0 -23
- package/dist/adapters/kit.mjs +0 -16
- package/dist/context-BfvbAyGk.mjs +0 -7215
- package/dist/main-DpINGndA.mjs +0 -601
- package/dist/utils/state.d.mts +0 -50
- package/dist/utils/state.mjs +0 -26
- package/dist/when-aBBXAEh5.d.mts +0 -401
- package/dist/{define-Bb4zh-Dc.mjs → define-CW9gLnyG.mjs} +0 -0
- package/dist/{host-h3-BMvrFzIJ.mjs → host-h3-Dz8YnFgu.mjs} +2 -2
- /package/dist/{transports-BPUzHhI2.mjs → transports-BnCs4rj9.mjs} +0 -0
- /package/dist/{types-ag029cAe.d.mts → types-4rdUEi2R.d.mts} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as dumpFunctions, s as getRpcHandler } from "./rpc-
|
|
1
|
+
import { n as dumpFunctions, s as getRpcHandler } from "./rpc-CkZuoz-m.mjs";
|
|
2
2
|
import { DEVTOOLS_RPC_DUMP_DIRNAME } from "./constants.mjs";
|
|
3
3
|
//#region src/node/static-dump.ts
|
|
4
4
|
function makeDumpKey(name) {
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { n as logger } from "./diagnostics-BFhNNmST.mjs";
|
|
2
|
+
import { t as createSharedState } from "./shared-state-DCDs0e7y.mjs";
|
|
3
|
+
import fs from "node:fs";
|
|
4
|
+
import { dirname } from "pathe";
|
|
5
|
+
//#region ../../../node_modules/.pnpm/perfect-debounce@2.1.0/node_modules/perfect-debounce/dist/index.mjs
|
|
6
|
+
const DEBOUNCE_DEFAULTS = { trailing: true };
|
|
7
|
+
/**
|
|
8
|
+
Debounce functions
|
|
9
|
+
@param fn - Promise-returning/async function to debounce.
|
|
10
|
+
@param wait - Milliseconds to wait before calling `fn`. Default value is 25ms
|
|
11
|
+
@returns A function that delays calling `fn` until after `wait` milliseconds have elapsed since the last time it was called.
|
|
12
|
+
@example
|
|
13
|
+
```
|
|
14
|
+
import { debounce } from 'perfect-debounce';
|
|
15
|
+
const expensiveCall = async input => input;
|
|
16
|
+
const debouncedFn = debounce(expensiveCall, 200);
|
|
17
|
+
for (const number of [1, 2, 3]) {
|
|
18
|
+
console.log(await debouncedFn(number));
|
|
19
|
+
}
|
|
20
|
+
//=> 1
|
|
21
|
+
//=> 2
|
|
22
|
+
//=> 3
|
|
23
|
+
```
|
|
24
|
+
*/
|
|
25
|
+
function debounce(fn, wait = 25, options = {}) {
|
|
26
|
+
options = {
|
|
27
|
+
...DEBOUNCE_DEFAULTS,
|
|
28
|
+
...options
|
|
29
|
+
};
|
|
30
|
+
if (!Number.isFinite(wait)) throw new TypeError("Expected `wait` to be a finite number");
|
|
31
|
+
let leadingValue;
|
|
32
|
+
let timeout;
|
|
33
|
+
let resolveList = [];
|
|
34
|
+
let currentPromise;
|
|
35
|
+
let trailingArgs;
|
|
36
|
+
const applyFn = (_this, args) => {
|
|
37
|
+
currentPromise = _applyPromised(fn, _this, args);
|
|
38
|
+
currentPromise.finally(() => {
|
|
39
|
+
currentPromise = null;
|
|
40
|
+
if (options.trailing && trailingArgs && !timeout) {
|
|
41
|
+
const promise = applyFn(_this, trailingArgs);
|
|
42
|
+
trailingArgs = null;
|
|
43
|
+
return promise;
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
return currentPromise;
|
|
47
|
+
};
|
|
48
|
+
const debounced = function(...args) {
|
|
49
|
+
if (options.trailing) trailingArgs = args;
|
|
50
|
+
if (currentPromise) return currentPromise;
|
|
51
|
+
return new Promise((resolve) => {
|
|
52
|
+
const shouldCallNow = !timeout && options.leading;
|
|
53
|
+
clearTimeout(timeout);
|
|
54
|
+
timeout = setTimeout(() => {
|
|
55
|
+
timeout = null;
|
|
56
|
+
const promise = options.leading ? leadingValue : applyFn(this, args);
|
|
57
|
+
trailingArgs = null;
|
|
58
|
+
for (const _resolve of resolveList) _resolve(promise);
|
|
59
|
+
resolveList = [];
|
|
60
|
+
}, wait);
|
|
61
|
+
if (shouldCallNow) {
|
|
62
|
+
leadingValue = applyFn(this, args);
|
|
63
|
+
resolve(leadingValue);
|
|
64
|
+
} else resolveList.push(resolve);
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
const _clearTimeout = (timer) => {
|
|
68
|
+
if (timer) {
|
|
69
|
+
clearTimeout(timer);
|
|
70
|
+
timeout = null;
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
debounced.isPending = () => !!timeout;
|
|
74
|
+
debounced.cancel = () => {
|
|
75
|
+
_clearTimeout(timeout);
|
|
76
|
+
resolveList = [];
|
|
77
|
+
trailingArgs = null;
|
|
78
|
+
};
|
|
79
|
+
debounced.flush = () => {
|
|
80
|
+
_clearTimeout(timeout);
|
|
81
|
+
if (!trailingArgs || currentPromise) return;
|
|
82
|
+
const args = trailingArgs;
|
|
83
|
+
trailingArgs = null;
|
|
84
|
+
return applyFn(this, args);
|
|
85
|
+
};
|
|
86
|
+
return debounced;
|
|
87
|
+
}
|
|
88
|
+
async function _applyPromised(fn, _this, args) {
|
|
89
|
+
return await fn.apply(_this, args);
|
|
90
|
+
}
|
|
91
|
+
//#endregion
|
|
92
|
+
//#region src/node/storage.ts
|
|
93
|
+
function createStorage(options) {
|
|
94
|
+
const { mergeInitialValue = (initialValue, savedValue) => ({
|
|
95
|
+
...initialValue,
|
|
96
|
+
...savedValue
|
|
97
|
+
}), debounce: debounceTime = 100 } = options;
|
|
98
|
+
let initialValue = options.initialValue;
|
|
99
|
+
if (fs.existsSync(options.filepath)) try {
|
|
100
|
+
const savedValue = JSON.parse(fs.readFileSync(options.filepath, "utf-8"));
|
|
101
|
+
initialValue = mergeInitialValue ? mergeInitialValue(options.initialValue, savedValue) : savedValue;
|
|
102
|
+
} catch (error) {
|
|
103
|
+
logger.DF0012({ filepath: options.filepath }, { cause: error }).log();
|
|
104
|
+
initialValue = options.initialValue;
|
|
105
|
+
}
|
|
106
|
+
const state = createSharedState({
|
|
107
|
+
initialValue,
|
|
108
|
+
enablePatches: false
|
|
109
|
+
});
|
|
110
|
+
state.on("updated", debounce((newState) => {
|
|
111
|
+
fs.mkdirSync(dirname(options.filepath), { recursive: true });
|
|
112
|
+
fs.writeFileSync(options.filepath, `${JSON.stringify(newState, null, 2)}\n`);
|
|
113
|
+
}, debounceTime));
|
|
114
|
+
return state;
|
|
115
|
+
}
|
|
116
|
+
//#endregion
|
|
117
|
+
export { createStorage as t };
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
//#region ../../../node_modules/.pnpm/structured-clone-es@2.0.0/node_modules/structured-clone-es/dist/index.mjs
|
|
2
|
+
const env = typeof self === "object" ? self : globalThis;
|
|
3
|
+
function deserializer($, _) {
|
|
4
|
+
const as = (out, index) => {
|
|
5
|
+
$.set(index, out);
|
|
6
|
+
return out;
|
|
7
|
+
};
|
|
8
|
+
const unpair = (index) => {
|
|
9
|
+
if ($.has(index)) return $.get(index);
|
|
10
|
+
const [type, value] = _[index];
|
|
11
|
+
switch (type) {
|
|
12
|
+
case 0:
|
|
13
|
+
case -1: return as(value, index);
|
|
14
|
+
case 1: {
|
|
15
|
+
const arr = as([], index);
|
|
16
|
+
for (const index of value) arr.push(unpair(index));
|
|
17
|
+
return arr;
|
|
18
|
+
}
|
|
19
|
+
case 2: {
|
|
20
|
+
const object = as({}, index);
|
|
21
|
+
for (const [key, index] of value) object[unpair(key)] = unpair(index);
|
|
22
|
+
return object;
|
|
23
|
+
}
|
|
24
|
+
case 3: return as(new Date(value), index);
|
|
25
|
+
case 4: {
|
|
26
|
+
const { source, flags } = value;
|
|
27
|
+
return as(new RegExp(source, flags), index);
|
|
28
|
+
}
|
|
29
|
+
case 5: {
|
|
30
|
+
const map = as(/* @__PURE__ */ new Map(), index);
|
|
31
|
+
for (const [key, index] of value) map.set(unpair(key), unpair(index));
|
|
32
|
+
return map;
|
|
33
|
+
}
|
|
34
|
+
case 6: {
|
|
35
|
+
const set = as(/* @__PURE__ */ new Set(), index);
|
|
36
|
+
for (const index of value) set.add(unpair(index));
|
|
37
|
+
return set;
|
|
38
|
+
}
|
|
39
|
+
case 7: {
|
|
40
|
+
const { name, message } = value;
|
|
41
|
+
return as(new env[name](message), index);
|
|
42
|
+
}
|
|
43
|
+
case 8: return as(BigInt(value), index);
|
|
44
|
+
case "BigInt": return as(Object(BigInt(value)), index);
|
|
45
|
+
case "ArrayBuffer": return as(new Uint8Array(value).buffer, value);
|
|
46
|
+
case "DataView": {
|
|
47
|
+
const { buffer } = new Uint8Array(value);
|
|
48
|
+
return as(new DataView(buffer), value);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return as(new env[type](value), index);
|
|
52
|
+
};
|
|
53
|
+
return unpair;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Returns a deserialized value from a serialized array of Records.
|
|
57
|
+
* @param serialized a previously serialized value.
|
|
58
|
+
*/
|
|
59
|
+
function deserialize(serialized) {
|
|
60
|
+
return deserializer(/* @__PURE__ */ new Map(), serialized)(0);
|
|
61
|
+
}
|
|
62
|
+
const EMPTY = "";
|
|
63
|
+
const { toString } = {};
|
|
64
|
+
const { keys } = Object;
|
|
65
|
+
function typeOf(value) {
|
|
66
|
+
const type = typeof value;
|
|
67
|
+
if (type !== "object" || !value) return [0, type];
|
|
68
|
+
const asString = toString.call(value).slice(8, -1);
|
|
69
|
+
switch (asString) {
|
|
70
|
+
case "Array": return [1, EMPTY];
|
|
71
|
+
case "Object": return [2, EMPTY];
|
|
72
|
+
case "Date": return [3, EMPTY];
|
|
73
|
+
case "RegExp": return [4, EMPTY];
|
|
74
|
+
case "Map": return [5, EMPTY];
|
|
75
|
+
case "Set": return [6, EMPTY];
|
|
76
|
+
case "DataView": return [1, asString];
|
|
77
|
+
}
|
|
78
|
+
if (asString.includes("Array")) return [1, asString];
|
|
79
|
+
if (asString.includes("Error")) return [7, asString];
|
|
80
|
+
return [2, asString];
|
|
81
|
+
}
|
|
82
|
+
function shouldSkip([TYPE, type]) {
|
|
83
|
+
return TYPE === 0 && (type === "function" || type === "symbol");
|
|
84
|
+
}
|
|
85
|
+
function serializer(strict, json, $, _) {
|
|
86
|
+
const as = (out, value) => {
|
|
87
|
+
const index = _.push(out) - 1;
|
|
88
|
+
$.set(value, index);
|
|
89
|
+
return index;
|
|
90
|
+
};
|
|
91
|
+
const pair = (value) => {
|
|
92
|
+
if ($.has(value)) return $.get(value);
|
|
93
|
+
let [TYPE, type] = typeOf(value);
|
|
94
|
+
switch (TYPE) {
|
|
95
|
+
case 0: {
|
|
96
|
+
let entry = value;
|
|
97
|
+
switch (type) {
|
|
98
|
+
case "bigint":
|
|
99
|
+
TYPE = 8;
|
|
100
|
+
entry = value.toString();
|
|
101
|
+
break;
|
|
102
|
+
case "function":
|
|
103
|
+
case "symbol":
|
|
104
|
+
if (strict) throw new TypeError(`unable to serialize ${type}`);
|
|
105
|
+
entry = null;
|
|
106
|
+
break;
|
|
107
|
+
case "undefined": return as([-1], value);
|
|
108
|
+
}
|
|
109
|
+
return as([TYPE, entry], value);
|
|
110
|
+
}
|
|
111
|
+
case 1: {
|
|
112
|
+
if (type) {
|
|
113
|
+
let spread = value;
|
|
114
|
+
if (type === "DataView") spread = new Uint8Array(value.buffer);
|
|
115
|
+
else if (type === "ArrayBuffer") spread = new Uint8Array(value);
|
|
116
|
+
return as([type, [...spread]], value);
|
|
117
|
+
}
|
|
118
|
+
const arr = [];
|
|
119
|
+
const index = as([TYPE, arr], value);
|
|
120
|
+
for (const entry of value) arr.push(pair(entry));
|
|
121
|
+
return index;
|
|
122
|
+
}
|
|
123
|
+
case 2: {
|
|
124
|
+
if (type) switch (type) {
|
|
125
|
+
case "BigInt": return as([type, value.toString()], value);
|
|
126
|
+
case "Boolean":
|
|
127
|
+
case "Number":
|
|
128
|
+
case "String": return as([type, value.valueOf()], value);
|
|
129
|
+
}
|
|
130
|
+
if (json && "toJSON" in value) return pair(value.toJSON());
|
|
131
|
+
const entries = [];
|
|
132
|
+
const index = as([TYPE, entries], value);
|
|
133
|
+
for (const key of keys(value)) if (strict || !shouldSkip(typeOf(value[key]))) entries.push([pair(key), pair(value[key])]);
|
|
134
|
+
return index;
|
|
135
|
+
}
|
|
136
|
+
case 3: return as([TYPE, value.toISOString()], value);
|
|
137
|
+
case 4: {
|
|
138
|
+
const { source, flags } = value;
|
|
139
|
+
return as([TYPE, {
|
|
140
|
+
source,
|
|
141
|
+
flags
|
|
142
|
+
}], value);
|
|
143
|
+
}
|
|
144
|
+
case 5: {
|
|
145
|
+
const entries = [];
|
|
146
|
+
const index = as([TYPE, entries], value);
|
|
147
|
+
for (const [key, entry] of value) if (strict || !(shouldSkip(typeOf(key)) || shouldSkip(typeOf(entry)))) entries.push([pair(key), pair(entry)]);
|
|
148
|
+
return index;
|
|
149
|
+
}
|
|
150
|
+
case 6: {
|
|
151
|
+
const entries = [];
|
|
152
|
+
const index = as([TYPE, entries], value);
|
|
153
|
+
for (const entry of value) if (strict || !shouldSkip(typeOf(entry))) entries.push(pair(entry));
|
|
154
|
+
return index;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
const { message } = value;
|
|
158
|
+
return as([TYPE, {
|
|
159
|
+
name: type,
|
|
160
|
+
message
|
|
161
|
+
}], value);
|
|
162
|
+
};
|
|
163
|
+
return pair;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Returns an array of serialized Records.
|
|
167
|
+
*/
|
|
168
|
+
function serialize(value, options = {}) {
|
|
169
|
+
const _ = [];
|
|
170
|
+
serializer(!(options.json || options.lossy), !!options.json, /* @__PURE__ */ new Map(), _)(value);
|
|
171
|
+
return _;
|
|
172
|
+
}
|
|
173
|
+
const { parse: $parse, stringify: $stringify } = JSON;
|
|
174
|
+
const options = {
|
|
175
|
+
json: true,
|
|
176
|
+
lossy: true
|
|
177
|
+
};
|
|
178
|
+
/**
|
|
179
|
+
* Revive a previously stringified structured clone.
|
|
180
|
+
* @param str previously stringified data as string.
|
|
181
|
+
*/
|
|
182
|
+
function parse(str) {
|
|
183
|
+
return deserialize($parse(str));
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Represent a structured clone value as string.
|
|
187
|
+
* @param any some clone-able value to stringify.
|
|
188
|
+
*/
|
|
189
|
+
function stringify(any) {
|
|
190
|
+
return $stringify(serialize(any, options));
|
|
191
|
+
}
|
|
192
|
+
//#endregion
|
|
193
|
+
//#region src/utils/structured-clone.ts
|
|
194
|
+
/**
|
|
195
|
+
* Serialize a structured-cloneable value (`Map`, `Set`, `Date`, `BigInt`,
|
|
196
|
+
* cycles, class instances, …) into a JSON-safe records array.
|
|
197
|
+
*/
|
|
198
|
+
function structuredCloneSerialize(value) {
|
|
199
|
+
return serialize(value);
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Inverse of {@link structuredCloneSerialize}.
|
|
203
|
+
*/
|
|
204
|
+
function structuredCloneDeserialize(value) {
|
|
205
|
+
return deserialize(value);
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Serialize a structured-cloneable value to a single string. Equivalent
|
|
209
|
+
* to `JSON.stringify(structuredCloneSerialize(value))`.
|
|
210
|
+
*/
|
|
211
|
+
function structuredCloneStringify(value) {
|
|
212
|
+
return stringify(value);
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Inverse of {@link structuredCloneStringify}.
|
|
216
|
+
*/
|
|
217
|
+
function structuredCloneParse(value) {
|
|
218
|
+
return parse(value);
|
|
219
|
+
}
|
|
220
|
+
//#endregion
|
|
221
|
+
export { structuredCloneStringify as i, structuredCloneParse as n, structuredCloneSerialize as r, structuredCloneDeserialize as t };
|
package/dist/types/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import { m as RpcFunctionAgentOptions } from "../types-
|
|
3
|
-
import { t as DevToolsNodeRpcSessionMeta } from "../ws-server-
|
|
4
|
-
export { AgentHandle, AgentManifest, AgentResource, AgentResourceContent, AgentResourceInput, AgentTool, AgentToolInput,
|
|
1
|
+
import { $ as DevToolsRpcSharedStates, C as RpcSharedStateGetOptions, D as RpcStreamingHost, E as RpcStreamingChannelOptions, J as EntriesToObject, Q as DevToolsRpcServerFunctions, S as RpcFunctionsHost, T as RpcStreamingChannel, X as Thenable, Y as PartialWithoutId, Z as DevToolsRpcClientFunctions, _ as ConnectionMeta, a as DevframeRuntime, at as AgentManifest, b as DevToolsNodeRpcSession, c as DevtoolBrowserContext, ct as AgentResourceInput, d as DevtoolDeploymentKind, dt as DevToolsAgentHost, et as DevToolsHost, f as DevtoolRuntime, ft as DevToolsAgentHostEvents, g as defineDevtool, h as defineDevframe, ht as EventsMap, i as DevframeDeploymentKind, it as AgentHandle, l as DevtoolCliOptions, lt as AgentTool, m as DevtoolSpaOptions, mt as EventUnsubscribe, n as DevframeCliOptions, nt as DevToolsDiagnosticsHost, o as DevframeSetupInfo, ot as AgentResource, p as DevtoolSetupInfo, pt as EventEmitter, q as DevToolsViewHost, r as DevframeDefinition, rt as DevToolsDiagnosticsLogger, s as DevframeSpaOptions, st as AgentResourceContent, t as DevframeBrowserContext, tt as DevToolsDiagnosticsDefinition, u as DevtoolDefinition, ut as AgentToolInput, v as DevToolsCapabilities, w as RpcSharedStateHost, x as RpcBroadcastOptions, y as DevToolsNodeContext } from "../devframe-DulcIxwu.mjs";
|
|
2
|
+
import { m as RpcFunctionAgentOptions } from "../types-4rdUEi2R.mjs";
|
|
3
|
+
import { t as DevToolsNodeRpcSessionMeta } from "../ws-server-DjvlwLuM.mjs";
|
|
4
|
+
export { AgentHandle, AgentManifest, AgentResource, AgentResourceContent, AgentResourceInput, AgentTool, AgentToolInput, ConnectionMeta, DevToolsAgentHost, DevToolsAgentHostEvents, DevToolsCapabilities, DevToolsDiagnosticsDefinition, DevToolsDiagnosticsHost, DevToolsDiagnosticsLogger, DevToolsHost, DevToolsNodeContext, DevToolsNodeRpcSession, DevToolsNodeRpcSessionMeta, DevToolsRpcClientFunctions, DevToolsRpcServerFunctions, DevToolsRpcSharedStates, DevToolsViewHost, DevframeBrowserContext, DevframeCliOptions, DevframeDefinition, DevframeDeploymentKind, DevframeRuntime, DevframeSetupInfo, DevframeSpaOptions, DevtoolBrowserContext, DevtoolCliOptions, DevtoolDefinition, DevtoolDeploymentKind, DevtoolRuntime, DevtoolSetupInfo, DevtoolSpaOptions, EntriesToObject, EventEmitter, EventUnsubscribe, EventsMap, PartialWithoutId, RpcBroadcastOptions, RpcFunctionAgentOptions, RpcFunctionsHost, RpcSharedStateGetOptions, RpcSharedStateHost, RpcStreamingChannel, RpcStreamingChannelOptions, RpcStreamingHost, Thenable, defineDevframe, defineDevtool };
|
package/dist/types/index.mjs
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
|
-
//#region src/types/
|
|
1
|
+
//#region src/types/devframe.ts
|
|
2
|
+
function defineDevframe(d) {
|
|
3
|
+
return d;
|
|
4
|
+
}
|
|
5
|
+
let warnedDefineDevtool = false;
|
|
6
|
+
/** @deprecated Use `defineDevframe`. */
|
|
2
7
|
function defineDevtool(d) {
|
|
8
|
+
if (!warnedDefineDevtool) {
|
|
9
|
+
warnedDefineDevtool = true;
|
|
10
|
+
console.warn("[devframe] `defineDevtool` is deprecated; use `defineDevframe` instead.");
|
|
11
|
+
}
|
|
3
12
|
return d;
|
|
4
13
|
}
|
|
5
14
|
//#endregion
|
|
6
|
-
export { defineDevtool };
|
|
15
|
+
export { defineDevframe, defineDevtool };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
//#region src/utils/colors.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* A colorizer — callable as a function (`colors.red('foo')`) or as a
|
|
4
|
+
* tagged template (``colors.red`foo ${bar}` ``).
|
|
5
|
+
*/
|
|
6
|
+
interface ColorFn {
|
|
7
|
+
(text: unknown): string;
|
|
8
|
+
(template: TemplateStringsArray, ...values: unknown[]): string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Minimal terminal color palette. Each entry is callable as both a
|
|
12
|
+
* plain function and a tagged template.
|
|
13
|
+
*/
|
|
14
|
+
interface Colors {
|
|
15
|
+
blue: ColorFn;
|
|
16
|
+
cyan: ColorFn;
|
|
17
|
+
gray: ColorFn;
|
|
18
|
+
green: ColorFn;
|
|
19
|
+
red: ColorFn;
|
|
20
|
+
yellow: ColorFn;
|
|
21
|
+
bold: ColorFn;
|
|
22
|
+
dim: ColorFn;
|
|
23
|
+
reset: ColorFn;
|
|
24
|
+
underline: ColorFn;
|
|
25
|
+
}
|
|
26
|
+
declare const colors: Colors;
|
|
27
|
+
//#endregion
|
|
28
|
+
export { ColorFn, Colors, colors };
|
package/dist/utils/events.d.mts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
//#region
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
declare function humanId(options?: Options | string | boolean): string;
|
|
1
|
+
//#region src/utils/human-id.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Generate a human-readable, lowercase, dash-separated random ID
|
|
4
|
+
* (e.g. `bright-orange-tiger`).
|
|
5
|
+
*/
|
|
6
|
+
declare function humanId(): string;
|
|
9
7
|
//#endregion
|
|
10
8
|
export { humanId };
|
package/dist/utils/human-id.mjs
CHANGED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region src/utils/launch-editor.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Open a file in the user's editor.
|
|
4
|
+
*
|
|
5
|
+
* `target` may be a plain path, `file:line`, or `file:line:column`.
|
|
6
|
+
*
|
|
7
|
+
* If `editor` is provided, it is used as the editor command (e.g. `'code'`,
|
|
8
|
+
* `'subl'`) or absolute binary path. Otherwise the editor is auto-detected
|
|
9
|
+
* via the `LAUNCH_EDITOR` env var with a fallback to common defaults.
|
|
10
|
+
*/
|
|
11
|
+
declare function launchEditor(target: string, editor?: string): void;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { launchEditor };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//#region src/utils/open.d.ts
|
|
2
|
+
interface OpenOptions {
|
|
3
|
+
/**
|
|
4
|
+
* Resolve only after the launched app exits.
|
|
5
|
+
*
|
|
6
|
+
* @default false
|
|
7
|
+
*/
|
|
8
|
+
wait?: boolean;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Open a URL, file, or other target in its default OS handler
|
|
12
|
+
* (browser for URLs, Finder/Explorer for paths, etc.).
|
|
13
|
+
*/
|
|
14
|
+
declare function open(target: string, options?: OpenOptions): Promise<void>;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { OpenOptions, open };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { IncomingMessage, ServerResponse } from "node:http";
|
|
2
|
+
import { EventHandler, EventHandlerRequest } from "h3";
|
|
3
|
+
|
|
4
|
+
//#region src/utils/serve-static.d.ts
|
|
5
|
+
interface ServeStaticOptions {
|
|
6
|
+
/** Default: `['index.html']`. */
|
|
7
|
+
indexNames?: string[];
|
|
8
|
+
/** SPA fallback to `indexNames[0]` on miss. Default: `true`. */
|
|
9
|
+
single?: boolean;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* h3 event handler that serves files from `dir` with SPA fallback.
|
|
13
|
+
*
|
|
14
|
+
* Drop-in replacement for `fromNodeMiddleware(sirv(dir, { dev: true, single: true }))`
|
|
15
|
+
* when the surrounding server is an h3 app — no `Cache-Control` beyond
|
|
16
|
+
* `no-store`, `Content-Type` resolved via `mrmime`, and a miss with no
|
|
17
|
+
* file extension falls back to `<dir>/index.html` so client-side routing
|
|
18
|
+
* works.
|
|
19
|
+
*/
|
|
20
|
+
declare function serveStaticHandler(dir: string, options?: ServeStaticOptions): EventHandler<EventHandlerRequest>;
|
|
21
|
+
/**
|
|
22
|
+
* Connect/Express-style Node middleware variant of {@link serveStaticHandler}.
|
|
23
|
+
*
|
|
24
|
+
* Use when mounting onto `viteServer.middlewares.use(base, …)` or any other
|
|
25
|
+
* Connect stack — avoids forcing the host package to depend on h3 just to
|
|
26
|
+
* adapt an event handler back into Node middleware.
|
|
27
|
+
*/
|
|
28
|
+
declare function serveStaticNodeMiddleware(dir: string, options?: ServeStaticOptions): (req: IncomingMessage, res: ServerResponse, next?: (err?: Error) => void) => void;
|
|
29
|
+
//#endregion
|
|
30
|
+
export { ServeStaticOptions, serveStaticHandler, serveStaticNodeMiddleware };
|