devframe 0.2.3 → 0.4.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/dist/adapters/build.d.mts +1 -1
- package/dist/adapters/build.mjs +6 -6
- package/dist/adapters/cli.d.mts +1 -1
- package/dist/adapters/cli.mjs +2 -2
- package/dist/adapters/dev.d.mts +2 -2
- package/dist/adapters/dev.mjs +1 -1
- package/dist/adapters/embedded.d.mts +1 -1
- package/dist/adapters/mcp.d.mts +1 -1
- package/dist/adapters/mcp.mjs +9 -8
- package/dist/client/index.d.mts +1 -1
- package/dist/client/index.mjs +44 -37
- package/dist/{context-GUzIxrEK.d.mts → context-Ca70YtrW.d.mts} +1 -1
- package/dist/{dev-BVtS7qBK.mjs → dev-C2wjXjGB.mjs} +4 -4
- package/dist/{devframe-C4DNeFuG.d.mts → devframe-xC8Q-xyt.d.mts} +50 -41
- package/dist/diagnostics-GitRGKbr.mjs +33 -0
- package/dist/diagnostics-reporter-CBBZwoMv.mjs +38 -0
- package/dist/{dump-C5LPsKJC.mjs → dump-B1wd4u68.mjs} +10 -10
- package/dist/helpers/vite.d.mts +1 -1
- package/dist/helpers/vite.mjs +7 -6
- package/dist/{host-h3-DYFKJxAV.mjs → host-h3-Div5Vp8R.mjs} +31 -39
- package/dist/{index-DWczSqdd.d.mts → index-C5PmWqBf.d.mts} +1 -1
- package/dist/{index-CSi2Y5JU.d.mts → index-CTK6fuXs.d.mts} +2 -2
- package/dist/{index-aNunf5Za.d.mts → index-DTeZXHSi.d.mts} +1 -1
- package/dist/index.d.mts +4 -4
- package/dist/index.mjs +1 -1
- package/dist/node/auth.d.mts +2 -2
- package/dist/node/auth.mjs +1 -1
- package/dist/node/index.d.mts +10 -14
- package/dist/node/index.mjs +3 -3
- package/dist/node/internal.d.mts +2 -2
- package/dist/node/internal.mjs +3 -3
- package/dist/recipes/open-helpers.d.mts +1 -1
- package/dist/recipes/open-helpers.mjs +2 -2
- package/dist/rpc/dump.d.mts +1 -1
- package/dist/rpc/dump.mjs +1 -1
- package/dist/rpc/index.d.mts +2 -2
- package/dist/rpc/index.mjs +8 -8
- package/dist/rpc/transports/ws-client.d.mts +1 -1
- package/dist/rpc/transports/ws-client.mjs +2 -2
- package/dist/rpc/transports/ws-server.d.mts +1 -1
- package/dist/rpc/transports/ws-server.mjs +2 -2
- package/dist/{serialization-lBLV02kQ.mjs → serialization-BD_qXGjd.mjs} +3 -3
- package/dist/{server-DjMtJQhO.d.mts → server-FNcskEBD.d.mts} +1 -1
- package/dist/{shared-state-SzgfilJP.mjs → shared-state-CasqoUba.mjs} +25 -64
- package/dist/{storage-CTlHUtXI.mjs → storage-CZVTPKsw.mjs} +5 -2
- package/dist/types/index.d.mts +4 -4
- package/dist/utils/events.d.mts +1 -1
- package/dist/utils/open.mjs +1 -1
- package/dist/utils/shared-state.d.mts +1 -1
- package/dist/utils/streaming-channel.d.mts +1 -1
- package/dist/{ws-server-lHQaafrS.d.mts → ws-server-DOwLJL23.d.mts} +1 -1
- package/package.json +3 -3
- package/skills/devframe/SKILL.md +1 -1
- package/dist/diagnostics-D7miaTpL.mjs +0 -36
- /package/dist/{_shared-BNoPn1NG.mjs → _shared-CUFqO4kJ.mjs} +0 -0
- /package/dist/{define-Bb4zh-Dc.mjs → define-CW9gLnyG.mjs} +0 -0
- /package/dist/{human-id-CiBWzVcg.mjs → human-id-Dq-qgtES.mjs} +0 -0
- /package/dist/{open-CX4CiMyw.mjs → open-DiQn6zCH.mjs} +0 -0
- /package/dist/{server-DxiOFSpu.mjs → server-BO8IDVsJ.mjs} +0 -0
- /package/dist/{structured-clone-qP1sPovr.mjs → structured-clone-jegjz0hM.mjs} +0 -0
- /package/dist/{transports-Bl1zuYhZ.mjs → transports-DTFoMUbE.mjs} +0 -0
- /package/dist/{types-kKDaD2NT.d.mts → types-BXL7EIDM.d.mts} +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { t as
|
|
1
|
+
import { t as devframeReporter } from "./diagnostics-reporter-CBBZwoMv.mjs";
|
|
2
|
+
import { t as diagnostics } from "./diagnostics-GitRGKbr.mjs";
|
|
2
3
|
import { RpcFunctionsCollectorBase } from "./rpc/index.mjs";
|
|
3
4
|
import { defineRpcFunction } from "./index.mjs";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { ansiFormatter } from "logs-sdk/formatters/ansi";
|
|
5
|
+
import { i as diagnostics$1, n as nanoid, r as createEventEmitter, t as createSharedState } from "./shared-state-CasqoUba.mjs";
|
|
6
|
+
import { defineDiagnostics } from "nostics";
|
|
7
7
|
import { isatty } from "node:tty";
|
|
8
8
|
import { formatWithOptions, inspect } from "node:util";
|
|
9
9
|
import { existsSync } from "node:fs";
|
|
@@ -51,7 +51,7 @@ var DevToolsAgentHost = class {
|
|
|
51
51
|
return existed;
|
|
52
52
|
}
|
|
53
53
|
registerResource(input) {
|
|
54
|
-
if (this.resources.has(input.id)) throw
|
|
54
|
+
if (this.resources.has(input.id)) throw diagnostics$1.DF0016({ id: input.id });
|
|
55
55
|
const resource = {
|
|
56
56
|
id: input.id,
|
|
57
57
|
name: input.name,
|
|
@@ -113,11 +113,11 @@ var DevToolsAgentHost = class {
|
|
|
113
113
|
this._rpcUnsubscribe = void 0;
|
|
114
114
|
}
|
|
115
115
|
_validateToolId(id) {
|
|
116
|
-
if (this.tools.has(id)) throw
|
|
117
|
-
if (this.context.rpc.definitions.get(id)?.agent) throw
|
|
116
|
+
if (this.tools.has(id)) throw diagnostics$1.DF0015({ id });
|
|
117
|
+
if (this.context.rpc.definitions.get(id)?.agent) throw diagnostics$1.DF0015({ id });
|
|
118
118
|
}
|
|
119
119
|
_projectTool(input) {
|
|
120
|
-
if (!input.description || typeof input.description !== "string") throw
|
|
120
|
+
if (!input.description || typeof input.description !== "string") throw diagnostics$1.DF0014({ name: input.id });
|
|
121
121
|
return {
|
|
122
122
|
id: input.id,
|
|
123
123
|
kind: "tool",
|
|
@@ -135,7 +135,7 @@ var DevToolsAgentHost = class {
|
|
|
135
135
|
for (const [name, def] of this.context.rpc.definitions) {
|
|
136
136
|
const agent = def.agent;
|
|
137
137
|
if (!agent) continue;
|
|
138
|
-
if (!agent.description || typeof agent.description !== "string") throw
|
|
138
|
+
if (!agent.description || typeof agent.description !== "string") throw diagnostics$1.DF0014({ name });
|
|
139
139
|
const type = def.type ?? "query";
|
|
140
140
|
const safety = agent.safety ?? inferSafety(type);
|
|
141
141
|
out.push({
|
|
@@ -186,28 +186,20 @@ function hasPositionalKeys(obj) {
|
|
|
186
186
|
//#region src/node/host-diagnostics.ts
|
|
187
187
|
var DevToolsDiagnosticsHost = class {
|
|
188
188
|
context;
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
defineDiagnostics =
|
|
192
|
-
|
|
189
|
+
_registry = {};
|
|
190
|
+
logger = new Proxy({}, { get: (_, code) => this._registry[code] });
|
|
191
|
+
defineDiagnostics = (opts) => {
|
|
192
|
+
return defineDiagnostics({
|
|
193
|
+
...opts,
|
|
194
|
+
reporters: [devframeReporter, ...opts.reporters ?? []]
|
|
195
|
+
});
|
|
196
|
+
};
|
|
193
197
|
constructor(context, initialDefinitions = []) {
|
|
194
198
|
this.context = context;
|
|
195
|
-
|
|
196
|
-
this._rebuild();
|
|
197
|
-
}
|
|
198
|
-
get logger() {
|
|
199
|
-
return this._logger;
|
|
199
|
+
for (const d of initialDefinitions) this.register(d);
|
|
200
200
|
}
|
|
201
|
-
register(
|
|
202
|
-
this.
|
|
203
|
-
this._rebuild();
|
|
204
|
-
}
|
|
205
|
-
_rebuild() {
|
|
206
|
-
this._logger = createLogger({
|
|
207
|
-
diagnostics: this._definitions,
|
|
208
|
-
formatter: ansiFormatter(colors$1),
|
|
209
|
-
reporters: consoleReporter
|
|
210
|
-
});
|
|
201
|
+
register(diagnostics) {
|
|
202
|
+
Object.assign(this._registry, diagnostics);
|
|
211
203
|
}
|
|
212
204
|
};
|
|
213
205
|
//#endregion
|
|
@@ -511,7 +503,7 @@ function createRpcSharedStateServerHost(rpc) {
|
|
|
511
503
|
const host = {
|
|
512
504
|
get: async (key, options) => {
|
|
513
505
|
if (sharedState.has(key)) return sharedState.get(key);
|
|
514
|
-
if (options?.initialValue === void 0 && options?.sharedState === void 0) throw
|
|
506
|
+
if (options?.initialValue === void 0 && options?.sharedState === void 0) throw diagnostics$1.DF0013({ key });
|
|
515
507
|
debug$1("new-state", key);
|
|
516
508
|
const state = options.sharedState ?? createSharedState({
|
|
517
509
|
initialValue: options.initialValue,
|
|
@@ -876,18 +868,18 @@ function createRpcStreamingServerHost(rpc) {
|
|
|
876
868
|
handler(channelName, id, opts) {
|
|
877
869
|
const state = channels.get(channelName);
|
|
878
870
|
if (!state) {
|
|
879
|
-
|
|
871
|
+
diagnostics$1.DF0030({
|
|
880
872
|
channel: channelName,
|
|
881
873
|
id
|
|
882
|
-
})
|
|
874
|
+
}, { method: "error" });
|
|
883
875
|
return;
|
|
884
876
|
}
|
|
885
877
|
const record = state.streams.get(id);
|
|
886
878
|
if (!record) {
|
|
887
|
-
|
|
879
|
+
diagnostics$1.DF0030({
|
|
888
880
|
channel: channelName,
|
|
889
881
|
id
|
|
890
|
-
})
|
|
882
|
+
}, { method: "error" });
|
|
891
883
|
return;
|
|
892
884
|
}
|
|
893
885
|
const session = rpc.getCurrentRpcSession();
|
|
@@ -957,10 +949,10 @@ function createRpcStreamingServerHost(rpc) {
|
|
|
957
949
|
handler(channelName, id, seq, chunk) {
|
|
958
950
|
const record = channels.get(channelName)?.inbound.get(id);
|
|
959
951
|
if (!record) {
|
|
960
|
-
|
|
952
|
+
diagnostics$1.DF0030({
|
|
961
953
|
channel: channelName,
|
|
962
954
|
id
|
|
963
|
-
})
|
|
955
|
+
}, { method: "error" });
|
|
964
956
|
return;
|
|
965
957
|
}
|
|
966
958
|
if (!record.uploaderMeta) {
|
|
@@ -987,7 +979,7 @@ function createRpcStreamingServerHost(rpc) {
|
|
|
987
979
|
}
|
|
988
980
|
});
|
|
989
981
|
function createChannel(name, opts = {}) {
|
|
990
|
-
if (channels.has(name)) throw
|
|
982
|
+
if (channels.has(name)) throw diagnostics$1.DF0032({ channel: name });
|
|
991
983
|
const replayWindow = opts.replayWindow ?? 0;
|
|
992
984
|
const state = {
|
|
993
985
|
name,
|
|
@@ -1150,7 +1142,7 @@ var RpcFunctionsHost = class extends RpcFunctionsCollectorBase {
|
|
|
1150
1142
|
this.streaming._onSessionDisconnected(meta);
|
|
1151
1143
|
}
|
|
1152
1144
|
async invokeLocal(method, ...args) {
|
|
1153
|
-
if (!this.definitions.has(method)) throw
|
|
1145
|
+
if (!this.definitions.has(method)) throw diagnostics$1.DF0006({ name: String(method) });
|
|
1154
1146
|
const handler = await this.getHandler(method);
|
|
1155
1147
|
return await Promise.resolve(handler(...args));
|
|
1156
1148
|
}
|
|
@@ -1167,7 +1159,7 @@ var RpcFunctionsHost = class extends RpcFunctionsCollectorBase {
|
|
|
1167
1159
|
}));
|
|
1168
1160
|
}
|
|
1169
1161
|
getCurrentRpcSession() {
|
|
1170
|
-
if (!this._asyncStorage) throw
|
|
1162
|
+
if (!this._asyncStorage) throw diagnostics$1.DF0007();
|
|
1171
1163
|
return this._asyncStorage.getStore();
|
|
1172
1164
|
}
|
|
1173
1165
|
};
|
|
@@ -1183,7 +1175,7 @@ var DevToolsViewHost = class {
|
|
|
1183
1175
|
this.context = context;
|
|
1184
1176
|
}
|
|
1185
1177
|
hostStatic(baseUrl, distDir) {
|
|
1186
|
-
if (!existsSync(distDir)) throw
|
|
1178
|
+
if (!existsSync(distDir)) throw diagnostics$1.DF0008({ distDir });
|
|
1187
1179
|
this.buildStaticDirs.push({
|
|
1188
1180
|
baseUrl,
|
|
1189
1181
|
distDir
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as RpcFunctionDefinitionAny, c as RpcDumpClientOptions, l as RpcDumpCollectionOptions, m as RpcDumpStore, n as BirpcReturn, o as RpcDefinitionsToFunctions, p as RpcDumpRecordError } from "./types-
|
|
1
|
+
import { _ as RpcFunctionDefinitionAny, c as RpcDumpClientOptions, l as RpcDumpCollectionOptions, m as RpcDumpStore, n as BirpcReturn, o as RpcDefinitionsToFunctions, p as RpcDumpRecordError } from "./types-BXL7EIDM.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/rpc/dump/static.d.ts
|
|
4
4
|
type StaticRpcDumpSerialization = 'json' | 'structured-clone';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as RpcFunctionsCollector, S as RpcFunctionType, _ as RpcFunctionDefinitionAny, g as RpcFunctionDefinition, i as RpcArgsSchema, w as RpcReturnSchema, x as RpcFunctionSetupResult } from "./types-
|
|
2
|
-
import { a as getDefinitionsWithDumps$1, c as StaticRpcDumpManifest$1, d as StaticRpcDumpManifestValue$1, f as StaticRpcDumpSerialization$1, i as dumpFunctions$1, l as StaticRpcDumpManifestQueryEntry$1, n as serializeDumpError$1, o as StaticRpcDumpCollection$1, p as collectStaticRpcDump$1, r as createClientFromDump$1, s as StaticRpcDumpFile$1, t as reviveDumpError$1, u as StaticRpcDumpManifestStaticEntry$1 } from "./index-
|
|
1
|
+
import { C as RpcFunctionsCollector, S as RpcFunctionType, _ as RpcFunctionDefinitionAny, g as RpcFunctionDefinition, i as RpcArgsSchema, w as RpcReturnSchema, x as RpcFunctionSetupResult } from "./types-BXL7EIDM.mjs";
|
|
2
|
+
import { a as getDefinitionsWithDumps$1, c as StaticRpcDumpManifest$1, d as StaticRpcDumpManifestValue$1, f as StaticRpcDumpSerialization$1, i as dumpFunctions$1, l as StaticRpcDumpManifestQueryEntry$1, n as serializeDumpError$1, o as StaticRpcDumpCollection$1, p as collectStaticRpcDump$1, r as createClientFromDump$1, s as StaticRpcDumpFile$1, t as reviveDumpError$1, u as StaticRpcDumpManifestStaticEntry$1 } from "./index-C5PmWqBf.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/rpc/cache.d.ts
|
|
5
5
|
interface RpcCacheOptions {
|
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import { S as RpcFunctionType, g as RpcFunctionDefinition, h as RpcFunctionAgentOptions, i as RpcArgsSchema, w as RpcReturnSchema } from "./types-
|
|
3
|
-
import { t as DevToolsNodeRpcSessionMeta } from "./ws-server-
|
|
1
|
+
import { A as DevToolsDiagnosticsDefinition, B as DevToolsAgentHost, C as PartialWithoutId, D as DevToolsRpcSharedStates, E as DevToolsRpcServerFunctions, F as AgentResource, H as EventEmitter, I as AgentResourceContent, L as AgentResourceInput, M as DevToolsDiagnosticsLogger, N as AgentHandle, O as DevToolsHost, P as AgentManifest, R as AgentTool, S as EntriesToObject, T as DevToolsRpcClientFunctions, U as EventUnsubscribe, V as DevToolsAgentHostEvents, W as EventsMap, _ as RpcStreamingChannel, a as DevframeRuntime, c as defineDevframe, d as DevToolsNodeContext, f as DevToolsNodeRpcSession, g as RpcSharedStateHost, h as RpcSharedStateGetOptions, i as DevframeDeploymentKind, j as DevToolsDiagnosticsHost, k as DevToolsDefineDiagnosticsOptions, l as ConnectionMeta, m as RpcFunctionsHost, n as DevframeCliOptions, o as DevframeSetupInfo, p as RpcBroadcastOptions, r as DevframeDefinition, s as DevframeSpaOptions, t as DevframeBrowserContext, u as DevToolsCapabilities, v as RpcStreamingChannelOptions, w as Thenable, x as DevToolsViewHost, y as RpcStreamingHost, z as AgentToolInput } from "./devframe-xC8Q-xyt.mjs";
|
|
2
|
+
import { S as RpcFunctionType, g as RpcFunctionDefinition, h as RpcFunctionAgentOptions, i as RpcArgsSchema, w as RpcReturnSchema } from "./types-BXL7EIDM.mjs";
|
|
3
|
+
import { t as DevToolsNodeRpcSessionMeta } from "./ws-server-DOwLJL23.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
7
|
//#endregion
|
|
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, EntriesToObject, EventEmitter, EventUnsubscribe, EventsMap, PartialWithoutId, RpcBroadcastOptions, RpcFunctionAgentOptions, RpcFunctionsHost, RpcSharedStateGetOptions, RpcSharedStateHost, RpcStreamingChannel, RpcStreamingChannelOptions, RpcStreamingHost, Thenable, defineDevframe, defineRpcFunction };
|
|
8
|
+
export { AgentHandle, AgentManifest, AgentResource, AgentResourceContent, AgentResourceInput, AgentTool, AgentToolInput, ConnectionMeta, DevToolsAgentHost, DevToolsAgentHostEvents, DevToolsCapabilities, DevToolsDefineDiagnosticsOptions, DevToolsDiagnosticsDefinition, DevToolsDiagnosticsHost, DevToolsDiagnosticsLogger, DevToolsHost, DevToolsNodeContext, DevToolsNodeRpcSession, DevToolsNodeRpcSessionMeta, DevToolsRpcClientFunctions, DevToolsRpcServerFunctions, DevToolsRpcSharedStates, DevToolsViewHost, DevframeBrowserContext, DevframeCliOptions, DevframeDefinition, DevframeDeploymentKind, DevframeRuntime, DevframeSetupInfo, DevframeSpaOptions, EntriesToObject, EventEmitter, EventUnsubscribe, EventsMap, PartialWithoutId, RpcBroadcastOptions, RpcFunctionAgentOptions, RpcFunctionsHost, RpcSharedStateGetOptions, RpcSharedStateHost, RpcStreamingChannel, RpcStreamingChannelOptions, RpcStreamingHost, Thenable, defineDevframe, defineRpcFunction };
|
package/dist/index.mjs
CHANGED
package/dist/node/auth.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { b as SharedState, d as DevToolsNodeContext, f as DevToolsNodeRpcSession } from "../devframe-
|
|
2
|
-
import { n as InternalAnonymousAuthStorage } from "../context-
|
|
1
|
+
import { b as SharedState, d as DevToolsNodeContext, f as DevToolsNodeRpcSession } from "../devframe-xC8Q-xyt.mjs";
|
|
2
|
+
import { n as InternalAnonymousAuthStorage } from "../context-Ca70YtrW.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/node/auth/revoke.d.ts
|
|
5
5
|
/**
|
package/dist/node/auth.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as revokeActiveConnectionsForToken, r as revokeAuthToken, t as humanId } from "../human-id-
|
|
1
|
+
import { n as revokeActiveConnectionsForToken, r as revokeAuthToken, t as humanId } from "../human-id-Dq-qgtES.mjs";
|
|
2
2
|
//#region src/node/auth/state.ts
|
|
3
3
|
let pendingAuth = null;
|
|
4
4
|
let tempAuthToken = generateTempId();
|
package/dist/node/index.d.mts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { _ as RpcFunctionDefinitionAny } from "../types-
|
|
3
|
-
import { S as RpcFunctionsCollectorBase } from "../index-
|
|
4
|
-
import { t as DevToolsNodeRpcSessionMeta } from "../ws-server-
|
|
5
|
-
import { n as StartedServer, r as startHttpAndWs, t as StartHttpAndWsOptions } from "../server-
|
|
6
|
-
import { createLogger, defineDiagnostics } from "logs-sdk";
|
|
1
|
+
import { B as DevToolsAgentHost$1, E as DevToolsRpcServerFunctions, F as AgentResource, H as EventEmitter, I as AgentResourceContent, L as AgentResourceInput, M as DevToolsDiagnosticsLogger, N as AgentHandle, O as DevToolsHost, P as AgentManifest, R as AgentTool, T as DevToolsRpcClientFunctions, V as DevToolsAgentHostEvents, b as SharedState, d as DevToolsNodeContext, f as DevToolsNodeRpcSession, g as RpcSharedStateHost, j as DevToolsDiagnosticsHost$1, m as RpcFunctionsHost$1, p as RpcBroadcastOptions, x as DevToolsViewHost$1, y as RpcStreamingHost, z as AgentToolInput } from "../devframe-xC8Q-xyt.mjs";
|
|
2
|
+
import { _ as RpcFunctionDefinitionAny } from "../types-BXL7EIDM.mjs";
|
|
3
|
+
import { S as RpcFunctionsCollectorBase } from "../index-CTK6fuXs.mjs";
|
|
4
|
+
import { t as DevToolsNodeRpcSessionMeta } from "../ws-server-DOwLJL23.mjs";
|
|
5
|
+
import { n as StartedServer, r as startHttpAndWs, t as StartHttpAndWsOptions } from "../server-FNcskEBD.mjs";
|
|
7
6
|
import { BirpcGroup } from "birpc";
|
|
8
7
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
9
8
|
|
|
@@ -67,14 +66,11 @@ declare class DevToolsAgentHost implements DevToolsAgentHost$1 {
|
|
|
67
66
|
//#region src/node/host-diagnostics.d.ts
|
|
68
67
|
declare class DevToolsDiagnosticsHost implements DevToolsDiagnosticsHost$1 {
|
|
69
68
|
readonly context: DevToolsNodeContext;
|
|
70
|
-
private
|
|
71
|
-
|
|
72
|
-
readonly defineDiagnostics:
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
get logger(): DevToolsDiagnosticsLogger;
|
|
76
|
-
register(definitions: unknown): void;
|
|
77
|
-
private _rebuild;
|
|
69
|
+
private _registry;
|
|
70
|
+
readonly logger: DevToolsDiagnosticsLogger;
|
|
71
|
+
readonly defineDiagnostics: DevToolsDiagnosticsHost$1['defineDiagnostics'];
|
|
72
|
+
constructor(context: DevToolsNodeContext, initialDefinitions?: Array<Record<string, unknown>>);
|
|
73
|
+
register(diagnostics: Record<string, unknown>): void;
|
|
78
74
|
}
|
|
79
75
|
//#endregion
|
|
80
76
|
//#region src/node/host-functions.d.ts
|
package/dist/node/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as createRpcStreamingServerHost, c as DevToolsAgentHost, i as RpcFunctionsHost, n as createHostContext, o as createRpcSharedStateServerHost, r as DevToolsViewHost, s as DevToolsDiagnosticsHost, t as createH3DevToolsHost } from "../host-h3-
|
|
2
|
-
import { t as startHttpAndWs } from "../server-
|
|
3
|
-
import { t as createStorage } from "../storage-
|
|
1
|
+
import { a as createRpcStreamingServerHost, c as DevToolsAgentHost, i as RpcFunctionsHost, n as createHostContext, o as createRpcSharedStateServerHost, r as DevToolsViewHost, s as DevToolsDiagnosticsHost, t as createH3DevToolsHost } from "../host-h3-Div5Vp8R.mjs";
|
|
2
|
+
import { t as startHttpAndWs } from "../server-BO8IDVsJ.mjs";
|
|
3
|
+
import { t as createStorage } from "../storage-CZVTPKsw.mjs";
|
|
4
4
|
import { isIP } from "node:net";
|
|
5
5
|
//#region src/node/utils.ts
|
|
6
6
|
function isObject(value) {
|
package/dist/node/internal.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as DevframeDeploymentKind, r as DevframeDefinition } from "../devframe-
|
|
2
|
-
import { a as internalContextMap, i as getInternalContext, n as InternalAnonymousAuthStorage, r as RemoteTokenRecord, t as DevToolsInternalContext } from "../context-
|
|
1
|
+
import { i as DevframeDeploymentKind, r as DevframeDefinition } from "../devframe-xC8Q-xyt.mjs";
|
|
2
|
+
import { a as internalContextMap, i as getInternalContext, n as InternalAnonymousAuthStorage, r as RemoteTokenRecord, t as DevToolsInternalContext } from "../context-Ca70YtrW.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/adapters/_shared.d.ts
|
|
5
5
|
/**
|
package/dist/node/internal.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as createStorage } from "../storage-
|
|
2
|
-
import { n as revokeActiveConnectionsForToken, r as revokeAuthToken, t as humanId } from "../human-id-
|
|
3
|
-
import { n as resolveBasePath, t as normalizeBasePath } from "../_shared-
|
|
1
|
+
import { t as createStorage } from "../storage-CZVTPKsw.mjs";
|
|
2
|
+
import { n as revokeActiveConnectionsForToken, r as revokeAuthToken, t as humanId } from "../human-id-Dq-qgtES.mjs";
|
|
3
|
+
import { n as resolveBasePath, t as normalizeBasePath } from "../_shared-CUFqO4kJ.mjs";
|
|
4
4
|
import { join } from "pathe";
|
|
5
5
|
//#region src/node/internal/context.ts
|
|
6
6
|
const internalContextMap = /* @__PURE__ */ new WeakMap();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { T as Thenable, h as RpcFunctionAgentOptions, s as RpcDump, x as RpcFunctionSetupResult } from "../types-
|
|
1
|
+
import { T as Thenable, h as RpcFunctionAgentOptions, s as RpcDump, x as RpcFunctionSetupResult } from "../types-BXL7EIDM.mjs";
|
|
2
2
|
import * as v from "valibot";
|
|
3
3
|
|
|
4
4
|
//#region src/recipes/open-helpers.d.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as launchEditor } from "../launch-editor-BbNhtg7b.mjs";
|
|
2
|
-
import { n as defineRpcFunction } from "../define-
|
|
3
|
-
import { t as open } from "../open-
|
|
2
|
+
import { n as defineRpcFunction } from "../define-CW9gLnyG.mjs";
|
|
3
|
+
import { t as open } from "../open-DiQn6zCH.mjs";
|
|
4
4
|
import * as v from "valibot";
|
|
5
5
|
//#region src/recipes/open-helpers.ts
|
|
6
6
|
/**
|
package/dist/rpc/dump.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as getDefinitionsWithDumps, c as StaticRpcDumpManifest, d as StaticRpcDumpManifestValue, f as StaticRpcDumpSerialization, i as dumpFunctions, l as StaticRpcDumpManifestQueryEntry, n as serializeDumpError, o as StaticRpcDumpCollection, p as collectStaticRpcDump, r as createClientFromDump, s as StaticRpcDumpFile, t as reviveDumpError, u as StaticRpcDumpManifestStaticEntry } from "../index-
|
|
1
|
+
import { a as getDefinitionsWithDumps, c as StaticRpcDumpManifest, d as StaticRpcDumpManifestValue, f as StaticRpcDumpSerialization, i as dumpFunctions, l as StaticRpcDumpManifestQueryEntry, n as serializeDumpError, o as StaticRpcDumpCollection, p as collectStaticRpcDump, r as createClientFromDump, s as StaticRpcDumpFile, t as reviveDumpError, u as StaticRpcDumpManifestStaticEntry } from "../index-C5PmWqBf.mjs";
|
|
2
2
|
export { StaticRpcDumpCollection, StaticRpcDumpFile, StaticRpcDumpManifest, StaticRpcDumpManifestQueryEntry, StaticRpcDumpManifestStaticEntry, StaticRpcDumpManifestValue, StaticRpcDumpSerialization, collectStaticRpcDump, createClientFromDump, dumpFunctions, getDefinitionsWithDumps, reviveDumpError, serializeDumpError };
|
package/dist/rpc/dump.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as dumpFunctions, c as serializeDumpError, i as createClientFromDump, o as getDefinitionsWithDumps, s as reviveDumpError, t as collectStaticRpcDump } from "../dump-
|
|
1
|
+
import { a as dumpFunctions, c as serializeDumpError, i as createClientFromDump, o as getDefinitionsWithDumps, s as reviveDumpError, t as collectStaticRpcDump } from "../dump-B1wd4u68.mjs";
|
|
2
2
|
export { collectStaticRpcDump, createClientFromDump, dumpFunctions, getDefinitionsWithDumps, reviveDumpError, serializeDumpError };
|
package/dist/rpc/index.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { C as RpcFunctionsCollector, S as RpcFunctionType, T as Thenable, _ as RpcFunctionDefinitionAny, a as RpcDefinitionsFilter, b as RpcFunctionDefinitionToFunction, c as RpcDumpClientOptions, d as RpcDumpGetter, f as RpcDumpRecord, g as RpcFunctionDefinition, h as RpcFunctionAgentOptions, i as RpcArgsSchema, l as RpcDumpCollectionOptions, m as RpcDumpStore, n as BirpcReturn, o as RpcDefinitionsToFunctions, p as RpcDumpRecordError, r as EntriesToObject, s as RpcDump, t as BirpcFn, u as RpcDumpDefinition, v as RpcFunctionDefinitionAnyWithContext, w as RpcReturnSchema, x as RpcFunctionSetupResult, y as RpcFunctionDefinitionBase } from "../types-
|
|
2
|
-
import { C as RpcCacheManager, S as RpcFunctionsCollectorBase, _ as strictJsonStringify, a as StaticRpcDumpManifestStaticEntry, b as createDefineWrapperWithContext, c as collectStaticRpcDump, d as getDefinitionsWithDumps, f as reviveDumpError, g as STRUCTURED_CLONE_PREFIX, h as validateDefinitions, i as StaticRpcDumpManifestQueryEntry, l as createClientFromDump, m as validateDefinition, n as StaticRpcDumpFile, o as StaticRpcDumpManifestValue, p as serializeDumpError, r as StaticRpcDumpManifest, s as StaticRpcDumpSerialization, t as StaticRpcDumpCollection, u as dumpFunctions, v as getRpcHandler, w as RpcCacheOptions, x as defineRpcFunction, y as getRpcResolvedSetupResult } from "../index-
|
|
1
|
+
import { C as RpcFunctionsCollector, S as RpcFunctionType, T as Thenable, _ as RpcFunctionDefinitionAny, a as RpcDefinitionsFilter, b as RpcFunctionDefinitionToFunction, c as RpcDumpClientOptions, d as RpcDumpGetter, f as RpcDumpRecord, g as RpcFunctionDefinition, h as RpcFunctionAgentOptions, i as RpcArgsSchema, l as RpcDumpCollectionOptions, m as RpcDumpStore, n as BirpcReturn, o as RpcDefinitionsToFunctions, p as RpcDumpRecordError, r as EntriesToObject, s as RpcDump, t as BirpcFn, u as RpcDumpDefinition, v as RpcFunctionDefinitionAnyWithContext, w as RpcReturnSchema, x as RpcFunctionSetupResult, y as RpcFunctionDefinitionBase } from "../types-BXL7EIDM.mjs";
|
|
2
|
+
import { C as RpcCacheManager, S as RpcFunctionsCollectorBase, _ as strictJsonStringify, a as StaticRpcDumpManifestStaticEntry, b as createDefineWrapperWithContext, c as collectStaticRpcDump, d as getDefinitionsWithDumps, f as reviveDumpError, g as STRUCTURED_CLONE_PREFIX, h as validateDefinitions, i as StaticRpcDumpManifestQueryEntry, l as createClientFromDump, m as validateDefinition, n as StaticRpcDumpFile, o as StaticRpcDumpManifestValue, p as serializeDumpError, r as StaticRpcDumpManifest, s as StaticRpcDumpSerialization, t as StaticRpcDumpCollection, u as dumpFunctions, v as getRpcHandler, w as RpcCacheOptions, x as defineRpcFunction, y as getRpcResolvedSetupResult } from "../index-CTK6fuXs.mjs";
|
|
3
3
|
export { BirpcFn, BirpcReturn, EntriesToObject, RpcArgsSchema, RpcCacheManager, RpcCacheOptions, RpcDefinitionsFilter, RpcDefinitionsToFunctions, RpcDump, RpcDumpClientOptions, RpcDumpCollectionOptions, RpcDumpDefinition, RpcDumpGetter, RpcDumpRecord, RpcDumpRecordError, RpcDumpStore, RpcFunctionAgentOptions, RpcFunctionDefinition, RpcFunctionDefinitionAny, RpcFunctionDefinitionAnyWithContext, RpcFunctionDefinitionBase, RpcFunctionDefinitionToFunction, RpcFunctionSetupResult, RpcFunctionType, RpcFunctionsCollector, RpcFunctionsCollectorBase, RpcReturnSchema, STRUCTURED_CLONE_PREFIX, StaticRpcDumpCollection, StaticRpcDumpFile, StaticRpcDumpManifest, StaticRpcDumpManifestQueryEntry, StaticRpcDumpManifestStaticEntry, StaticRpcDumpManifestValue, StaticRpcDumpSerialization, Thenable, collectStaticRpcDump, createClientFromDump, createDefineWrapperWithContext, defineRpcFunction, dumpFunctions, getDefinitionsWithDumps, getRpcHandler, getRpcResolvedSetupResult, reviveDumpError, serializeDumpError, strictJsonStringify, validateDefinition, validateDefinitions };
|
package/dist/rpc/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as dumpFunctions$1, c as serializeDumpError$1, d as hash, i as createClientFromDump$1, l as validateDefinition, n as getRpcHandler, o as getDefinitionsWithDumps$1, r as getRpcResolvedSetupResult, s as reviveDumpError$1, t as collectStaticRpcDump$1, u as validateDefinitions } from "../dump-
|
|
2
|
-
import {
|
|
3
|
-
import { n as defineRpcFunction, t as createDefineWrapperWithContext } from "../define-
|
|
4
|
-
import { n as strictJsonStringify, t as STRUCTURED_CLONE_PREFIX } from "../serialization-
|
|
1
|
+
import { a as dumpFunctions$1, c as serializeDumpError$1, d as hash, i as createClientFromDump$1, l as validateDefinition, n as getRpcHandler, o as getDefinitionsWithDumps$1, r as getRpcResolvedSetupResult, s as reviveDumpError$1, t as collectStaticRpcDump$1, u as validateDefinitions } from "../dump-B1wd4u68.mjs";
|
|
2
|
+
import { t as diagnostics } from "../diagnostics-GitRGKbr.mjs";
|
|
3
|
+
import { n as defineRpcFunction, t as createDefineWrapperWithContext } from "../define-CW9gLnyG.mjs";
|
|
4
|
+
import { n as strictJsonStringify, t as STRUCTURED_CLONE_PREFIX } from "../serialization-BD_qXGjd.mjs";
|
|
5
5
|
//#region src/rpc/cache.ts
|
|
6
6
|
/**
|
|
7
7
|
* @experimental API is expected to change.
|
|
@@ -70,13 +70,13 @@ var RpcFunctionsCollectorBase = class {
|
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
72
|
register(fn, force = false) {
|
|
73
|
-
if (this.definitions.has(fn.name) && !force) throw
|
|
73
|
+
if (this.definitions.has(fn.name) && !force) throw diagnostics.DF0021({ name: fn.name });
|
|
74
74
|
assertAgentJsonSerializable(fn);
|
|
75
75
|
this.definitions.set(fn.name, fn);
|
|
76
76
|
this._onChanged.forEach((cb) => cb(fn.name));
|
|
77
77
|
}
|
|
78
78
|
update(fn, force = false) {
|
|
79
|
-
if (!this.definitions.has(fn.name) && !force) throw
|
|
79
|
+
if (!this.definitions.has(fn.name) && !force) throw diagnostics.DF0022({ name: fn.name });
|
|
80
80
|
assertAgentJsonSerializable(fn);
|
|
81
81
|
this.definitions.set(fn.name, fn);
|
|
82
82
|
this._onChanged.forEach((cb) => cb(fn.name));
|
|
@@ -93,7 +93,7 @@ var RpcFunctionsCollectorBase = class {
|
|
|
93
93
|
}
|
|
94
94
|
getSchema(name) {
|
|
95
95
|
const definition = this.definitions.get(name);
|
|
96
|
-
if (!definition) throw
|
|
96
|
+
if (!definition) throw diagnostics.DF0023({ name: String(name) });
|
|
97
97
|
return {
|
|
98
98
|
args: definition.args,
|
|
99
99
|
returns: definition.returns
|
|
@@ -110,7 +110,7 @@ var RpcFunctionsCollectorBase = class {
|
|
|
110
110
|
}
|
|
111
111
|
};
|
|
112
112
|
function assertAgentJsonSerializable(fn) {
|
|
113
|
-
if (fn.agent && fn.jsonSerializable !== true) throw
|
|
113
|
+
if (fn.agent && fn.jsonSerializable !== true) throw diagnostics.DF0019({ name: fn.name });
|
|
114
114
|
}
|
|
115
115
|
//#endregion
|
|
116
116
|
//#region src/rpc/index.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as strictJsonStringify } from "../../serialization-
|
|
2
|
-
import { n as structuredCloneStringify, t as structuredCloneParse } from "../../structured-clone-
|
|
1
|
+
import { n as strictJsonStringify } from "../../serialization-BD_qXGjd.mjs";
|
|
2
|
+
import { n as structuredCloneStringify, t as structuredCloneParse } from "../../structured-clone-jegjz0hM.mjs";
|
|
3
3
|
//#region src/rpc/transports/ws-client.ts
|
|
4
4
|
function NOOP() {}
|
|
5
5
|
const EMPTY_DEFS = /* @__PURE__ */ new Map();
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as WsRpcTransportOptions, r as attachWsRpcTransport, t as DevToolsNodeRpcSessionMeta } from "../../ws-server-
|
|
1
|
+
import { n as WsRpcTransportOptions, r as attachWsRpcTransport, t as DevToolsNodeRpcSessionMeta } from "../../ws-server-DOwLJL23.mjs";
|
|
2
2
|
export { DevToolsNodeRpcSessionMeta, WsRpcTransportOptions, attachWsRpcTransport };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as strictJsonStringify } from "../../serialization-
|
|
2
|
-
import { n as structuredCloneStringify, t as structuredCloneParse } from "../../structured-clone-
|
|
1
|
+
import { n as strictJsonStringify } from "../../serialization-BD_qXGjd.mjs";
|
|
2
|
+
import { n as structuredCloneStringify, t as structuredCloneParse } from "../../structured-clone-jegjz0hM.mjs";
|
|
3
3
|
import { createServer } from "node:https";
|
|
4
4
|
import { WebSocketServer } from "ws";
|
|
5
5
|
//#region src/rpc/transports/ws-server.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as diagnostics } from "./diagnostics-GitRGKbr.mjs";
|
|
2
2
|
//#region src/rpc/serialization.ts
|
|
3
3
|
/**
|
|
4
4
|
* Wire format used by the WS RPC transport.
|
|
@@ -62,11 +62,11 @@ function strictJsonStringify(value, fnName = "") {
|
|
|
62
62
|
}
|
|
63
63
|
function nonJsonAt(fnName, type, parent, key) {
|
|
64
64
|
const path = formatPath(parent, key);
|
|
65
|
-
return
|
|
65
|
+
return diagnostics.DF0020({
|
|
66
66
|
name: fnName || "<anonymous>",
|
|
67
67
|
type,
|
|
68
68
|
path
|
|
69
|
-
})
|
|
69
|
+
});
|
|
70
70
|
}
|
|
71
71
|
function formatPath(parent, key) {
|
|
72
72
|
if (Array.isArray(parent)) return `[${key}]`;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as DevToolsRpcServerFunctions, T as DevToolsRpcClientFunctions, d as DevToolsNodeContext } from "./devframe-
|
|
1
|
+
import { E as DevToolsRpcServerFunctions, T as DevToolsRpcClientFunctions, d as DevToolsNodeContext } from "./devframe-xC8Q-xyt.mjs";
|
|
2
2
|
import { BirpcGroup } from "birpc";
|
|
3
3
|
import { WebSocketServer } from "ws";
|
|
4
4
|
import { H3 } from "h3";
|
|
@@ -1,86 +1,47 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
//#region src/utils/colors.ts
|
|
4
|
-
function makeColor(open, close) {
|
|
5
|
-
const o = `\x1B[${open}m`;
|
|
6
|
-
const c = `\x1B[${close}m`;
|
|
7
|
-
return ((arg, ...values) => {
|
|
8
|
-
if (Array.isArray(arg) && "raw" in arg) {
|
|
9
|
-
const strings = arg;
|
|
10
|
-
let out = "";
|
|
11
|
-
for (let i = 0; i < strings.length; i++) {
|
|
12
|
-
out += strings[i];
|
|
13
|
-
if (i < values.length) out += String(values[i]);
|
|
14
|
-
}
|
|
15
|
-
return `${o}${out}${c}`;
|
|
16
|
-
}
|
|
17
|
-
return `${o}${String(arg)}${c}`;
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
const colors = {
|
|
21
|
-
blue: makeColor(34, 39),
|
|
22
|
-
cyan: makeColor(36, 39),
|
|
23
|
-
gray: makeColor(90, 39),
|
|
24
|
-
green: makeColor(32, 39),
|
|
25
|
-
red: makeColor(31, 39),
|
|
26
|
-
yellow: makeColor(33, 39),
|
|
27
|
-
bold: makeColor(1, 22),
|
|
28
|
-
dim: makeColor(2, 22),
|
|
29
|
-
reset: makeColor(0, 0),
|
|
30
|
-
underline: makeColor(4, 24)
|
|
31
|
-
};
|
|
32
|
-
//#endregion
|
|
1
|
+
import { t as devframeReporter } from "./diagnostics-reporter-CBBZwoMv.mjs";
|
|
2
|
+
import { defineDiagnostics } from "nostics";
|
|
33
3
|
//#region src/node/diagnostics.ts
|
|
34
4
|
const diagnostics = defineDiagnostics({
|
|
35
5
|
docsBase: "https://devfra.me/errors",
|
|
6
|
+
reporters: [devframeReporter],
|
|
36
7
|
codes: {
|
|
37
|
-
DF0006: {
|
|
38
|
-
DF0007: {
|
|
39
|
-
DF0008: {
|
|
40
|
-
DF0012: {
|
|
41
|
-
|
|
42
|
-
level: "warn"
|
|
43
|
-
},
|
|
44
|
-
DF0013: { message: (p) => `Shared state of "${p.key}" is not found, please provide an initial value for the first time` },
|
|
8
|
+
DF0006: { why: (p) => `RPC function "${p.name}" is not registered` },
|
|
9
|
+
DF0007: { why: "AsyncLocalStorage is not set, it likely to be an internal bug of the DevTools foundation" },
|
|
10
|
+
DF0008: { why: (p) => `distDir ${p.distDir} does not exist` },
|
|
11
|
+
DF0012: { why: (p) => `Failed to parse storage file: ${p.filepath}, falling back to defaults.` },
|
|
12
|
+
DF0013: { why: (p) => `Shared state of "${p.key}" is not found, please provide an initial value for the first time` },
|
|
45
13
|
DF0014: {
|
|
46
|
-
|
|
47
|
-
|
|
14
|
+
why: (p) => `RPC function "${p.name}" has an invalid \`agent\` field — \`description\` must be a non-empty string.`,
|
|
15
|
+
fix: "Provide a short description (~1–3 sentences) explaining what the tool does and when agents should invoke it."
|
|
48
16
|
},
|
|
49
17
|
DF0015: {
|
|
50
|
-
|
|
51
|
-
|
|
18
|
+
why: (p) => `Agent tool "${p.id}" is already registered.`,
|
|
19
|
+
fix: "Tool ids must be unique across RPC functions with an `agent` field and tools registered via `ctx.agent.registerTool()`."
|
|
52
20
|
},
|
|
53
|
-
DF0016: {
|
|
54
|
-
DF0017: {
|
|
21
|
+
DF0016: { why: (p) => `Agent resource "${p.id}" is already registered.` },
|
|
22
|
+
DF0017: { why: (p) => `Failed to start MCP server (${p.transport}): ${p.reason}` },
|
|
55
23
|
DF0029: {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
level: "warn"
|
|
24
|
+
why: (p) => `Stream "${p.channel}#${p.id}" dropped ${p.dropped} chunk(s) after exceeding the client high-water mark.`,
|
|
25
|
+
fix: "The consumer is too slow for the producer. Raise `highWaterMark` on the subscription, slow the producer, or batch chunks."
|
|
59
26
|
},
|
|
60
27
|
DF0030: {
|
|
61
|
-
|
|
62
|
-
|
|
28
|
+
why: (p) => `Stream "${p.channel}#${p.id}" is unknown — no producer has called \`channel.start({ id: "${p.id}" })\`.`,
|
|
29
|
+
fix: "Ensure the server-side producer is running before clients subscribe, or check for typos in the stream id."
|
|
63
30
|
},
|
|
64
31
|
DF0031: {
|
|
65
|
-
|
|
66
|
-
|
|
32
|
+
why: (p) => `Cannot write to closed stream "${p.channel}#${p.id}".`,
|
|
33
|
+
fix: "Track the producer lifecycle — guard writes with the `stream.signal.aborted` flag."
|
|
67
34
|
},
|
|
68
35
|
DF0032: {
|
|
69
|
-
|
|
70
|
-
|
|
36
|
+
why: (p) => `Streaming channel "${p.channel}" is already registered.`,
|
|
37
|
+
fix: "Each channel name must be unique within a context. Pick a different name or reuse the existing channel handle."
|
|
71
38
|
},
|
|
72
39
|
DF0033: {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
level: "warn"
|
|
40
|
+
why: (p) => `Failed to start dev RPC bridge for "${p.id}": ${p.reason}`,
|
|
41
|
+
fix: "Verify the bridge port is free and the devframe setup function does not throw. Pin a port via `cli.port` / `cli.portRange` on the definition, or via `devMiddleware.port` on `viteDevBridge`."
|
|
76
42
|
}
|
|
77
43
|
}
|
|
78
44
|
});
|
|
79
|
-
const logger = createLogger({
|
|
80
|
-
diagnostics: [diagnostics],
|
|
81
|
-
formatter: ansiFormatter(colors),
|
|
82
|
-
reporters: consoleReporter
|
|
83
|
-
});
|
|
84
45
|
//#endregion
|
|
85
46
|
//#region src/utils/events.ts
|
|
86
47
|
/**
|
|
@@ -1055,4 +1016,4 @@ function createSharedState(options) {
|
|
|
1055
1016
|
};
|
|
1056
1017
|
}
|
|
1057
1018
|
//#endregion
|
|
1058
|
-
export {
|
|
1019
|
+
export { diagnostics as i, nanoid as n, createEventEmitter as r, createSharedState as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { i as diagnostics, t as createSharedState } from "./shared-state-CasqoUba.mjs";
|
|
2
2
|
import fs from "node:fs";
|
|
3
3
|
import { dirname } from "pathe";
|
|
4
4
|
//#region ../../node_modules/.pnpm/perfect-debounce@2.1.0/node_modules/perfect-debounce/dist/index.mjs
|
|
@@ -99,7 +99,10 @@ function createStorage(options) {
|
|
|
99
99
|
const savedValue = JSON.parse(fs.readFileSync(options.filepath, "utf-8"));
|
|
100
100
|
initialValue = mergeInitialValue ? mergeInitialValue(options.initialValue, savedValue) : savedValue;
|
|
101
101
|
} catch (error) {
|
|
102
|
-
|
|
102
|
+
diagnostics.DF0012({
|
|
103
|
+
filepath: options.filepath,
|
|
104
|
+
cause: error
|
|
105
|
+
}, { method: "warn" });
|
|
103
106
|
initialValue = options.initialValue;
|
|
104
107
|
}
|
|
105
108
|
const state = createSharedState({
|
package/dist/types/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import { h as RpcFunctionAgentOptions } from "../types-
|
|
3
|
-
import { t as DevToolsNodeRpcSessionMeta } from "../ws-server-
|
|
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, EntriesToObject, EventEmitter, EventUnsubscribe, EventsMap, PartialWithoutId, RpcBroadcastOptions, RpcFunctionAgentOptions, RpcFunctionsHost, RpcSharedStateGetOptions, RpcSharedStateHost, RpcStreamingChannel, RpcStreamingChannelOptions, RpcStreamingHost, Thenable, defineDevframe };
|
|
1
|
+
import { A as DevToolsDiagnosticsDefinition, B as DevToolsAgentHost, C as PartialWithoutId, D as DevToolsRpcSharedStates, E as DevToolsRpcServerFunctions, F as AgentResource, H as EventEmitter, I as AgentResourceContent, L as AgentResourceInput, M as DevToolsDiagnosticsLogger, N as AgentHandle, O as DevToolsHost, P as AgentManifest, R as AgentTool, S as EntriesToObject, T as DevToolsRpcClientFunctions, U as EventUnsubscribe, V as DevToolsAgentHostEvents, W as EventsMap, _ as RpcStreamingChannel, a as DevframeRuntime, c as defineDevframe, d as DevToolsNodeContext, f as DevToolsNodeRpcSession, g as RpcSharedStateHost, h as RpcSharedStateGetOptions, i as DevframeDeploymentKind, j as DevToolsDiagnosticsHost, k as DevToolsDefineDiagnosticsOptions, l as ConnectionMeta, m as RpcFunctionsHost, n as DevframeCliOptions, o as DevframeSetupInfo, p as RpcBroadcastOptions, r as DevframeDefinition, s as DevframeSpaOptions, t as DevframeBrowserContext, u as DevToolsCapabilities, v as RpcStreamingChannelOptions, w as Thenable, x as DevToolsViewHost, y as RpcStreamingHost, z as AgentToolInput } from "../devframe-xC8Q-xyt.mjs";
|
|
2
|
+
import { h as RpcFunctionAgentOptions } from "../types-BXL7EIDM.mjs";
|
|
3
|
+
import { t as DevToolsNodeRpcSessionMeta } from "../ws-server-DOwLJL23.mjs";
|
|
4
|
+
export { AgentHandle, AgentManifest, AgentResource, AgentResourceContent, AgentResourceInput, AgentTool, AgentToolInput, ConnectionMeta, DevToolsAgentHost, DevToolsAgentHostEvents, DevToolsCapabilities, DevToolsDefineDiagnosticsOptions, DevToolsDiagnosticsDefinition, DevToolsDiagnosticsHost, DevToolsDiagnosticsLogger, DevToolsHost, DevToolsNodeContext, DevToolsNodeRpcSession, DevToolsNodeRpcSessionMeta, DevToolsRpcClientFunctions, DevToolsRpcServerFunctions, DevToolsRpcSharedStates, DevToolsViewHost, DevframeBrowserContext, DevframeCliOptions, DevframeDefinition, DevframeDeploymentKind, DevframeRuntime, DevframeSetupInfo, DevframeSpaOptions, EntriesToObject, EventEmitter, EventUnsubscribe, EventsMap, PartialWithoutId, RpcBroadcastOptions, RpcFunctionAgentOptions, RpcFunctionsHost, RpcSharedStateGetOptions, RpcSharedStateHost, RpcStreamingChannel, RpcStreamingChannelOptions, RpcStreamingHost, Thenable, defineDevframe };
|
package/dist/utils/events.d.mts
CHANGED