devframe 0.1.21 → 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-iZy45oG3.mjs → _shared-DcJX9-Az.mjs} +2 -2
- package/dist/adapters/build.d.mts +5 -5
- package/dist/adapters/build.mjs +13 -12
- 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 +5 -5
- package/dist/adapters/embedded.mjs +2 -2
- package/dist/adapters/mcp.d.mts +3 -3
- package/dist/adapters/mcp.mjs +5 -5
- package/dist/adapters/vite.d.mts +45 -12
- package/dist/adapters/vite.mjs +81 -18
- package/dist/chunk-e9Ob2GDo.mjs +26 -0
- package/dist/client/index.d.mts +10 -5
- package/dist/client/index.mjs +19 -10
- package/dist/colors-Bl4W18Mh.mjs +123 -0
- package/dist/{context-internal-saIAfNVw.d.mts → context-DBd794Rn.d.mts} +2 -2
- package/dist/{context-BJ4r2SmR.mjs → context-DUibxhrR.mjs} +14 -31
- package/dist/{dev-CdAy400a.mjs → dev-BGpTpYiR.mjs} +19 -20
- package/dist/{devtool-CNvLs2_Y.d.mts → devframe-DulcIxwu.d.mts} +49 -58
- package/dist/{diagnostics-DxPnRoXO.mjs → diagnostics-BFhNNmST.mjs} +7 -2
- package/dist/hash-BHZbo80D.mjs +126 -0
- package/dist/{human-id-BLoGo_e5.mjs → human-id-adtUWQLr.mjs} +12 -3
- package/dist/{index-CuLRIMto.d.mts → index-DB2Ie0Or.d.mts} +2 -3
- package/dist/index.d.mts +4 -5
- package/dist/index.mjs +2 -5
- 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 +10 -51
- package/dist/node/index.mjs +6 -62
- package/dist/{internal/index.d.mts → node/internal.d.mts} +5 -5
- package/dist/node/internal.mjs +50 -0
- package/dist/{open-Dede_w9r.mjs → open-DmFp0qZA.mjs} +12 -3
- 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-CBsxXIH5.mjs → server-ma8-ZVyX.mjs} +1 -1
- package/dist/{server-BAqOajx_.d.mts → server-zKEDxgqD.d.mts} +4 -3
- package/dist/shared-state-DCDs0e7y.mjs +928 -0
- package/dist/{static-dump-D5VH8Iqk.mjs → static-dump-D7AvjrgL.mjs} +1 -1
- package/dist/{context-internal-Dx_NoSv1.mjs → storage-CNC38eU-.mjs} +4 -86
- 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 +32 -49
- package/dist/utils/when.mjs +20 -2
- package/dist/{ws-client-CjPuPFbA.d.mts → ws-client-Bavoya6-.d.mts} +1 -1
- package/dist/{ws-server-C7LnhOHi.d.mts → ws-server-DjvlwLuM.d.mts} +1 -1
- package/package.json +23 -10
- package/skills/devframe/SKILL.md +45 -23
- package/skills/devframe/templates/{counter-devtool.ts → counter-devframe.ts} +4 -4
- package/skills/devframe/templates/{spa-devtool.ts → spa-devframe.ts} +3 -3
- package/skills/devframe/templates/vite-client.ts +2 -2
- package/dist/internal/index.mjs +0 -3
- package/dist/utils/state.d.mts +0 -50
- package/dist/utils/state.mjs +0 -26
- package/dist/{define-Bb4zh-Dc.mjs → define-CW9gLnyG.mjs} +0 -0
- package/dist/{host-h3-9jeHcltx.mjs → host-h3-Dz8YnFgu.mjs} +1 -1
- /package/dist/{transports-DSV5_5QM.mjs → transports-BnCs4rj9.mjs} +0 -0
- /package/dist/{types-C5OVe4AC.d.mts → types-4rdUEi2R.d.mts} +0 -0
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
//#region ../../../node_modules/.pnpm/ohash@2.0.11/node_modules/ohash/dist/shared/ohash.D__AXeF1.mjs
|
|
3
|
+
function serialize(o) {
|
|
4
|
+
return typeof o == "string" ? `'${o}'` : new c().serialize(o);
|
|
5
|
+
}
|
|
6
|
+
const c = /* @__PURE__ */ function() {
|
|
7
|
+
class o {
|
|
8
|
+
#t = /* @__PURE__ */ new Map();
|
|
9
|
+
compare(t, r) {
|
|
10
|
+
const e = typeof t, n = typeof r;
|
|
11
|
+
return e === "string" && n === "string" ? t.localeCompare(r) : e === "number" && n === "number" ? t - r : String.prototype.localeCompare.call(this.serialize(t, true), this.serialize(r, true));
|
|
12
|
+
}
|
|
13
|
+
serialize(t, r) {
|
|
14
|
+
if (t === null) return "null";
|
|
15
|
+
switch (typeof t) {
|
|
16
|
+
case "string": return r ? t : `'${t}'`;
|
|
17
|
+
case "bigint": return `${t}n`;
|
|
18
|
+
case "object": return this.$object(t);
|
|
19
|
+
case "function": return this.$function(t);
|
|
20
|
+
}
|
|
21
|
+
return String(t);
|
|
22
|
+
}
|
|
23
|
+
serializeObject(t) {
|
|
24
|
+
const r = Object.prototype.toString.call(t);
|
|
25
|
+
if (r !== "[object Object]") return this.serializeBuiltInType(r.length < 10 ? `unknown:${r}` : r.slice(8, -1), t);
|
|
26
|
+
const e = t.constructor, n = e === Object || e === void 0 ? "" : e.name;
|
|
27
|
+
if (n !== "" && globalThis[n] === e) return this.serializeBuiltInType(n, t);
|
|
28
|
+
if (typeof t.toJSON == "function") {
|
|
29
|
+
const i = t.toJSON();
|
|
30
|
+
return n + (i !== null && typeof i == "object" ? this.$object(i) : `(${this.serialize(i)})`);
|
|
31
|
+
}
|
|
32
|
+
return this.serializeObjectEntries(n, Object.entries(t));
|
|
33
|
+
}
|
|
34
|
+
serializeBuiltInType(t, r) {
|
|
35
|
+
const e = this["$" + t];
|
|
36
|
+
if (e) return e.call(this, r);
|
|
37
|
+
if (typeof r?.entries == "function") return this.serializeObjectEntries(t, r.entries());
|
|
38
|
+
throw new Error(`Cannot serialize ${t}`);
|
|
39
|
+
}
|
|
40
|
+
serializeObjectEntries(t, r) {
|
|
41
|
+
const e = Array.from(r).sort((i, a) => this.compare(i[0], a[0]));
|
|
42
|
+
let n = `${t}{`;
|
|
43
|
+
for (let i = 0; i < e.length; i++) {
|
|
44
|
+
const [a, l] = e[i];
|
|
45
|
+
n += `${this.serialize(a, true)}:${this.serialize(l)}`, i < e.length - 1 && (n += ",");
|
|
46
|
+
}
|
|
47
|
+
return n + "}";
|
|
48
|
+
}
|
|
49
|
+
$object(t) {
|
|
50
|
+
let r = this.#t.get(t);
|
|
51
|
+
return r === void 0 && (this.#t.set(t, `#${this.#t.size}`), r = this.serializeObject(t), this.#t.set(t, r)), r;
|
|
52
|
+
}
|
|
53
|
+
$function(t) {
|
|
54
|
+
const r = Function.prototype.toString.call(t);
|
|
55
|
+
return r.slice(-15) === "[native code] }" ? `${t.name || ""}()[native]` : `${t.name}(${t.length})${r.replace(/\s*\n\s*/g, "")}`;
|
|
56
|
+
}
|
|
57
|
+
$Array(t) {
|
|
58
|
+
let r = "[";
|
|
59
|
+
for (let e = 0; e < t.length; e++) r += this.serialize(t[e]), e < t.length - 1 && (r += ",");
|
|
60
|
+
return r + "]";
|
|
61
|
+
}
|
|
62
|
+
$Date(t) {
|
|
63
|
+
try {
|
|
64
|
+
return `Date(${t.toISOString()})`;
|
|
65
|
+
} catch {
|
|
66
|
+
return "Date(null)";
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
$ArrayBuffer(t) {
|
|
70
|
+
return `ArrayBuffer[${new Uint8Array(t).join(",")}]`;
|
|
71
|
+
}
|
|
72
|
+
$Set(t) {
|
|
73
|
+
return `Set${this.$Array(Array.from(t).sort((r, e) => this.compare(r, e)))}`;
|
|
74
|
+
}
|
|
75
|
+
$Map(t) {
|
|
76
|
+
return this.serializeObjectEntries("Map", t.entries());
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
for (const s of [
|
|
80
|
+
"Error",
|
|
81
|
+
"RegExp",
|
|
82
|
+
"URL"
|
|
83
|
+
]) o.prototype["$" + s] = function(t) {
|
|
84
|
+
return `${s}(${t})`;
|
|
85
|
+
};
|
|
86
|
+
for (const s of [
|
|
87
|
+
"Int8Array",
|
|
88
|
+
"Uint8Array",
|
|
89
|
+
"Uint8ClampedArray",
|
|
90
|
+
"Int16Array",
|
|
91
|
+
"Uint16Array",
|
|
92
|
+
"Int32Array",
|
|
93
|
+
"Uint32Array",
|
|
94
|
+
"Float32Array",
|
|
95
|
+
"Float64Array"
|
|
96
|
+
]) o.prototype["$" + s] = function(t) {
|
|
97
|
+
return `${s}[${t.join(",")}]`;
|
|
98
|
+
};
|
|
99
|
+
for (const s of ["BigInt64Array", "BigUint64Array"]) o.prototype["$" + s] = function(t) {
|
|
100
|
+
return `${s}[${t.join("n,")}${t.length > 0 ? "n" : ""}]`;
|
|
101
|
+
};
|
|
102
|
+
return o;
|
|
103
|
+
}();
|
|
104
|
+
//#endregion
|
|
105
|
+
//#region ../../../node_modules/.pnpm/ohash@2.0.11/node_modules/ohash/dist/crypto/node/index.mjs
|
|
106
|
+
const e = globalThis.process?.getBuiltinModule?.("crypto")?.hash, r = "sha256", s = "base64url";
|
|
107
|
+
function digest(t) {
|
|
108
|
+
if (e) return e(r, t, s);
|
|
109
|
+
const o = createHash(r).update(t);
|
|
110
|
+
return globalThis.process?.versions?.webcontainer ? o.digest().toString(s) : o.digest(s);
|
|
111
|
+
}
|
|
112
|
+
//#endregion
|
|
113
|
+
//#region ../../../node_modules/.pnpm/ohash@2.0.11/node_modules/ohash/dist/index.mjs
|
|
114
|
+
function hash$1(input) {
|
|
115
|
+
return digest(serialize(input));
|
|
116
|
+
}
|
|
117
|
+
//#endregion
|
|
118
|
+
//#region src/utils/hash.ts
|
|
119
|
+
/**
|
|
120
|
+
* Stable, deterministic hash of any structured-cloneable value.
|
|
121
|
+
*/
|
|
122
|
+
function hash(value) {
|
|
123
|
+
return hash$1(value);
|
|
124
|
+
}
|
|
125
|
+
//#endregion
|
|
126
|
+
export { hash as t };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
|
|
1
|
+
import { t as __commonJSMin } from "./chunk-e9Ob2GDo.mjs";
|
|
3
2
|
//#endregion
|
|
4
3
|
//#region src/utils/human-id.ts
|
|
5
4
|
var import_dist = (/* @__PURE__ */ __commonJSMin(((exports) => {
|
|
@@ -839,5 +838,15 @@ var import_dist = (/* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
839
838
|
exports.minLength = minLength;
|
|
840
839
|
exports.default = humanId;
|
|
841
840
|
})))();
|
|
841
|
+
/**
|
|
842
|
+
* Generate a human-readable, lowercase, dash-separated random ID
|
|
843
|
+
* (e.g. `bright-orange-tiger`).
|
|
844
|
+
*/
|
|
845
|
+
function humanId() {
|
|
846
|
+
return (0, import_dist.humanId)({
|
|
847
|
+
separator: "-",
|
|
848
|
+
capitalize: false
|
|
849
|
+
});
|
|
850
|
+
}
|
|
842
851
|
//#endregion
|
|
843
|
-
export {
|
|
852
|
+
export { humanId as t };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { C as RpcReturnSchema, S as RpcFunctionsCollector, b as RpcFunctionSetupResult, c as RpcDumpClientOptions, g as RpcFunctionDefinitionAny, h as RpcFunctionDefinition, i as RpcArgsSchema, l as RpcDumpCollectionOptions, n as BirpcReturn, o as RpcDefinitionsToFunctions, p as RpcDumpStore, x as RpcFunctionType } from "./types-
|
|
2
|
-
import { deserialize as structuredCloneDeserialize, parse as structuredCloneParse, serialize as structuredCloneSerialize, stringify as structuredCloneStringify } from "structured-clone-es";
|
|
1
|
+
import { C as RpcReturnSchema, S as RpcFunctionsCollector, b as RpcFunctionSetupResult, c as RpcDumpClientOptions, g as RpcFunctionDefinitionAny, h as RpcFunctionDefinition, i as RpcArgsSchema, l as RpcDumpCollectionOptions, n as BirpcReturn, o as RpcDefinitionsToFunctions, p as RpcDumpStore, x as RpcFunctionType } from "./types-4rdUEi2R.mjs";
|
|
3
2
|
|
|
4
3
|
//#region src/rpc/cache.d.ts
|
|
5
4
|
interface RpcCacheOptions {
|
|
@@ -137,4 +136,4 @@ declare function validateDefinitions(definitions: readonly RpcFunctionDefinition
|
|
|
137
136
|
*/
|
|
138
137
|
declare function validateDefinition(definition: RpcFunctionDefinitionAny): void;
|
|
139
138
|
//#endregion
|
|
140
|
-
export {
|
|
139
|
+
export { getRpcHandler as a, dumpFunctions as c, defineRpcFunction as d, RpcFunctionsCollectorBase as f, strictJsonStringify as i, getDefinitionsWithDumps as l, RpcCacheOptions as m, validateDefinitions as n, getRpcResolvedSetupResult as o, RpcCacheManager as p, STRUCTURED_CLONE_PREFIX as r, createClientFromDump as s, validateDefinition as t, createDefineWrapperWithContext as u };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import { C as RpcReturnSchema, h as RpcFunctionDefinition, i as RpcArgsSchema, m as RpcFunctionAgentOptions, x as RpcFunctionType } from "./types-
|
|
3
|
-
import { t as DevToolsNodeRpcSessionMeta } from "./ws-server-
|
|
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 { C as RpcReturnSchema, h as RpcFunctionDefinition, i as RpcArgsSchema, m as RpcFunctionAgentOptions, x as RpcFunctionType } from "./types-4rdUEi2R.mjs";
|
|
3
|
+
import { t as DevToolsNodeRpcSessionMeta } from "./ws-server-DjvlwLuM.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/define.d.ts
|
|
6
6
|
declare const defineRpcFunction: <NAME extends string, TYPE extends RpcFunctionType, ARGS extends any[], RETURN = void, const AS extends RpcArgsSchema | undefined = undefined, const RS extends RpcReturnSchema | undefined = undefined>(definition: RpcFunctionDefinition<NAME, TYPE, ARGS, RETURN, AS, RS, DevToolsNodeContext>) => RpcFunctionDefinition<NAME, TYPE, ARGS, RETURN, AS, RS, DevToolsNodeContext>;
|
|
7
|
-
declare function defineJsonRenderSpec(spec: JsonRenderSpec): JsonRenderSpec;
|
|
8
7
|
//#endregion
|
|
9
|
-
export { AgentHandle, AgentManifest, AgentResource, AgentResourceContent, AgentResourceInput, AgentTool, AgentToolInput, ConnectionMeta, DevToolsAgentHost, DevToolsAgentHostEvents, DevToolsCapabilities, DevToolsDiagnosticsDefinition, DevToolsDiagnosticsHost, DevToolsDiagnosticsLogger, DevToolsHost, DevToolsNodeContext, DevToolsNodeRpcSession, DevToolsNodeRpcSessionMeta, DevToolsRpcClientFunctions, DevToolsRpcServerFunctions, DevToolsRpcSharedStates, DevToolsViewHost, DevtoolBrowserContext, DevtoolCliOptions, DevtoolDefinition, DevtoolDeploymentKind, DevtoolRuntime, DevtoolSetupInfo, DevtoolSpaOptions, EntriesToObject, EventEmitter, EventUnsubscribe, EventsMap,
|
|
8
|
+
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, defineRpcFunction };
|
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import { t as createDefineWrapperWithContext } from "./define-
|
|
1
|
+
import { t as createDefineWrapperWithContext } from "./define-CW9gLnyG.mjs";
|
|
2
2
|
//#region src/define.ts
|
|
3
3
|
const defineRpcFunction = createDefineWrapperWithContext();
|
|
4
|
-
function defineJsonRenderSpec(spec) {
|
|
5
|
-
return spec;
|
|
6
|
-
}
|
|
7
4
|
//#endregion
|
|
8
|
-
export {
|
|
5
|
+
export { defineRpcFunction };
|