devframe 0.7.14 → 0.7.16

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.
Files changed (54) hide show
  1. package/dist/adapters/build.d.mts +8 -1
  2. package/dist/adapters/build.mjs +4 -2
  3. package/dist/adapters/cac.d.mts +1 -1
  4. package/dist/adapters/cac.mjs +1 -1
  5. package/dist/adapters/cli.d.mts +1 -1
  6. package/dist/adapters/cli.mjs +1 -1
  7. package/dist/adapters/dev.d.mts +18 -3
  8. package/dist/adapters/dev.mjs +2 -2
  9. package/dist/adapters/embedded.d.mts +1 -1
  10. package/dist/adapters/mcp.d.mts +5 -3
  11. package/dist/adapters/mcp.mjs +1 -1
  12. package/dist/{build-server-CBAxmnC8.mjs → build-server-C7vTKjiQ.mjs} +16 -5
  13. package/dist/{cac-Drj5sjnU.mjs → cac-CPaOy3LD.mjs} +2 -2
  14. package/dist/client/index.d.mts +42 -6
  15. package/dist/client/index.mjs +179 -92
  16. package/dist/constants.d.mts +7 -1
  17. package/dist/constants.mjs +7 -1
  18. package/dist/{context-FonV8enL.d.mts → context-CzqPrJSz.d.mts} +1 -1
  19. package/dist/{context-C1Gr2BGB.mjs → context-DY72brRI.mjs} +1 -1
  20. package/dist/{dev-BdegDQKt.mjs → dev-BCeaQuGE.mjs} +28 -5
  21. package/dist/{devframe-DfzYvlKI.d.mts → devframe-Ckhf3kFw.d.mts} +16 -1
  22. package/dist/helpers/vite.d.mts +14 -1
  23. package/dist/helpers/vite.mjs +7 -4
  24. package/dist/{host-h3-SjwRTwkE.mjs → host-h3-CgOetlNE.mjs} +1 -1
  25. package/dist/{http-BaCZYhIR.mjs → http-_pPbryTQ.mjs} +1 -1
  26. package/dist/{index-CxpC1ItQ.d.mts → index-8dndvIxR.d.mts} +2 -2
  27. package/dist/index.d.mts +1 -1
  28. package/dist/node/auth.d.mts +2 -2
  29. package/dist/node/hub-internals.d.mts +2 -2
  30. package/dist/node/hub-internals.mjs +1 -1
  31. package/dist/node/index.d.mts +2 -2
  32. package/dist/node/index.mjs +3 -3
  33. package/dist/recipes/common-rpc-functions.d.mts +118 -0
  34. package/dist/recipes/common-rpc-functions.mjs +105 -0
  35. package/dist/recipes/interactive-auth.d.mts +2 -2
  36. package/dist/recipes/interactive-auth.mjs +1 -1
  37. package/dist/recipes/open-helpers.d.mts +3 -101
  38. package/dist/recipes/open-helpers.mjs +3 -63
  39. package/dist/rpc/transports/ws-client.mjs +1 -1
  40. package/dist/rpc/transports/ws-server.mjs +1 -1
  41. package/dist/{server-Bf27EWpv.d.mts → server-B0wiP_Oi.d.mts} +2 -2
  42. package/dist/{server-BFsuZI9e.mjs → server-DykHCza_.mjs} +2 -2
  43. package/dist/{storage-D_Xy9v1l.mjs → storage-gEnj9ASQ.mjs} +4 -0
  44. package/dist/{structured-clone-XpHLZ8nr.mjs → structured-clone-CbAV5rFI.mjs} +32 -3
  45. package/dist/{structured-clone-CeZOHvkd.mjs → structured-clone-CgtQ61SA.mjs} +32 -3
  46. package/dist/types/index.d.mts +1 -1
  47. package/dist/utils/events.d.mts +1 -1
  48. package/dist/utils/launch-editor.mjs +745 -1
  49. package/dist/utils/shared-state.d.mts +1 -1
  50. package/dist/utils/streaming-channel.d.mts +1 -1
  51. package/dist/utils/structured-clone.mjs +1 -1
  52. package/package.json +5 -31
  53. package/skills/devframe/SKILL.md +1 -1
  54. package/dist/launch-editor-C_xuzLnF.mjs +0 -746
@@ -1,66 +1,6 @@
1
- import { t as launchEditor } from "../launch-editor-C_xuzLnF.mjs";
2
- import { n as defineRpcFunction } from "../define-BLWPsH6y.mjs";
3
- import { t as open } from "../open-Deb5xmIT.mjs";
4
- import * as v from "valibot";
1
+ import { commonRpcFunctions, openInEditor, openInFinder } from "./common-rpc-functions.mjs";
5
2
  //#region src/recipes/open-helpers.ts
6
- /**
7
- * Prebuilt RPC action that opens a file in the user's configured editor.
8
- *
9
- * Registered name: `devframe:open-in-editor`.
10
- *
11
- * ```ts
12
- * import { openInEditor } from 'devframe/recipes/open-helpers'
13
- *
14
- * defineDevframe({
15
- * id: 'my-tool',
16
- * name: 'My Tool',
17
- * setup(ctx) {
18
- * ctx.rpc.register(openInEditor)
19
- * },
20
- * })
21
- * ```
22
- */
23
- const openInEditor = defineRpcFunction({
24
- name: "devframe:open-in-editor",
25
- type: "action",
26
- jsonSerializable: true,
27
- args: [v.string()],
28
- returns: v.void(),
29
- async handler(filename) {
30
- launchEditor(filename);
31
- }
32
- });
33
- /**
34
- * Prebuilt RPC action that reveals a path in the OS file explorer.
35
- *
36
- * Registered name: `devframe:open-in-finder`.
37
- *
38
- * ```ts
39
- * import { openInFinder } from 'devframe/recipes/open-helpers'
40
- *
41
- * ctx.rpc.register(openInFinder)
42
- * ```
43
- */
44
- const openInFinder = defineRpcFunction({
45
- name: "devframe:open-in-finder",
46
- type: "action",
47
- jsonSerializable: true,
48
- args: [v.string()],
49
- returns: v.void(),
50
- async handler(path) {
51
- await open(path);
52
- }
53
- });
54
- /**
55
- * Convenience array bundling both helpers so callers can register them
56
- * in a single `forEach`.
57
- *
58
- * ```ts
59
- * import { openHelpers } from 'devframe/recipes/open-helpers'
60
- *
61
- * openHelpers.forEach(fn => ctx.rpc.register(fn))
62
- * ```
63
- */
64
- const openHelpers = [openInEditor, openInFinder];
3
+ /** @deprecated Use `commonRpcFunctions` from `devframe/recipes/common-rpc-functions` instead. */
4
+ const openHelpers = commonRpcFunctions;
65
5
  //#endregion
66
6
  export { openHelpers, openInEditor, openInFinder };
@@ -1,6 +1,6 @@
1
1
  import { DEVFRAME_AUTH_TOKEN_QUERY_PARAM } from "../../constants.mjs";
2
2
  import { n as strictJsonStringify } from "../../serialization-DpLXCy13.mjs";
3
- import { n as structuredCloneStringify, t as structuredCloneParse } from "../../structured-clone-XpHLZ8nr.mjs";
3
+ import { n as structuredCloneStringify, t as structuredCloneParse } from "../../structured-clone-CbAV5rFI.mjs";
4
4
  //#region src/rpc/transports/ws-client.ts
5
5
  function NOOP() {}
6
6
  const EMPTY_DEFS = /* @__PURE__ */ new Map();
@@ -1,5 +1,5 @@
1
1
  import { n as strictJsonStringify } from "../../serialization-DpLXCy13.mjs";
2
- import { n as structuredCloneStringify, t as structuredCloneParse } from "../../structured-clone-XpHLZ8nr.mjs";
2
+ import { n as structuredCloneStringify, t as structuredCloneParse } from "../../structured-clone-CbAV5rFI.mjs";
3
3
  import { createServer } from "node:http";
4
4
  import { createServer as createServer$1 } from "node:https";
5
5
  import crossws from "crossws/adapters/node";
@@ -1,5 +1,5 @@
1
- import { $ as DevframeRpcServerFunctions, Q as DevframeRpcClientFunctions, W as DevframeNodeRpcSession, _ as ConnectionMeta, b as DevframeNodeContext, p as DevframeAuthHandler } from "./devframe-DfzYvlKI.mjs";
2
- import "./index-CxpC1ItQ.mjs";
1
+ import { $ as DevframeRpcServerFunctions, Q as DevframeRpcClientFunctions, W as DevframeNodeRpcSession, _ as ConnectionMeta, b as DevframeNodeContext, p as DevframeAuthHandler } from "./devframe-Ckhf3kFw.mjs";
2
+ import "./index-8dndvIxR.mjs";
3
3
  import { Peer } from "crossws";
4
4
  import { BirpcGroup, EventOptions } from "birpc";
5
5
  import { NodeAdapter } from "crossws/adapters/node";
@@ -1,7 +1,7 @@
1
1
  import { createRpcServer } from "./rpc/server.mjs";
2
2
  import { attachWsRpcTransport } from "./rpc/transports/ws-server.mjs";
3
- import { a as diagnostics } from "./storage-D_Xy9v1l.mjs";
4
- import { t as getInternalContext } from "./context-C1Gr2BGB.mjs";
3
+ import { a as diagnostics } from "./storage-gEnj9ASQ.mjs";
4
+ import { t as getInternalContext } from "./context-DY72brRI.mjs";
5
5
  import { createServer } from "node:http";
6
6
  import { AsyncLocalStorage } from "node:async_hooks";
7
7
  import { H3, toNodeHandler } from "h3";
@@ -59,6 +59,10 @@ const diagnostics = defineDiagnostics({
59
59
  DF0037: {
60
60
  why: (p) => `A service is already provided under "${p.id}".`,
61
61
  fix: "Service ids are unique per context. Revoke the existing provider first (the `provide()` call returns a revoke function), or namespace the id with your plugin id to avoid collisions."
62
+ },
63
+ DF0042: {
64
+ why: (p) => `"${p.id}" declares \`capabilities.build: false\` — its static export is not meaningful (writes are excluded and any live-served data won't be there).`,
65
+ fix: "Pass `{ force: true }` to `createBuild()` if the degraded export is still useful to you, or drop `capabilities.build: false` on the definition."
62
66
  }
63
67
  }
64
68
  });
@@ -1,5 +1,32 @@
1
- //#region ../../node_modules/.pnpm/structured-clone-es@2.0.0/node_modules/structured-clone-es/dist/index.mjs
1
+ //#region ../../node_modules/.pnpm/structured-clone-es@2.0.1/node_modules/structured-clone-es/dist/index.mjs
2
2
  const env = typeof self === "object" ? self : globalThis;
3
+ const SAFE_ERROR_NAMES = /* @__PURE__ */ new Set([
4
+ "Error",
5
+ "EvalError",
6
+ "RangeError",
7
+ "ReferenceError",
8
+ "SyntaxError",
9
+ "TypeError",
10
+ "URIError",
11
+ "AggregateError"
12
+ ]);
13
+ const SAFE_CONSTRUCTOR_NAMES = /* @__PURE__ */ new Set([
14
+ "Boolean",
15
+ "Number",
16
+ "String",
17
+ "Int8Array",
18
+ "Uint8Array",
19
+ "Uint8ClampedArray",
20
+ "Int16Array",
21
+ "Uint16Array",
22
+ "Int32Array",
23
+ "Uint32Array",
24
+ "Float16Array",
25
+ "Float32Array",
26
+ "Float64Array",
27
+ "BigInt64Array",
28
+ "BigUint64Array"
29
+ ]);
3
30
  function deserializer($, _) {
4
31
  const as = (out, index) => {
5
32
  $.set(index, out);
@@ -38,7 +65,8 @@ function deserializer($, _) {
38
65
  }
39
66
  case 7: {
40
67
  const { name, message } = value;
41
- return as(new env[name](message), index);
68
+ const Ctor = SAFE_ERROR_NAMES.has(name) ? env[name] : void 0;
69
+ return as(new (Ctor ?? env.Error)(message), index);
42
70
  }
43
71
  case 8: return as(BigInt(value), index);
44
72
  case "BigInt": return as(Object(BigInt(value)), index);
@@ -48,7 +76,8 @@ function deserializer($, _) {
48
76
  return as(new DataView(buffer), value);
49
77
  }
50
78
  }
51
- return as(new env[type](value), index);
79
+ if (typeof type === "string" && SAFE_CONSTRUCTOR_NAMES.has(type)) return as(new env[type](value), index);
80
+ throw new TypeError(`unable to deserialize unsafe or unknown type: ${String(type)}`);
52
81
  };
53
82
  return unpair;
54
83
  }
@@ -1,5 +1,32 @@
1
- //#region ../../node_modules/.pnpm/structured-clone-es@2.0.0/node_modules/structured-clone-es/dist/index.mjs
1
+ //#region ../../node_modules/.pnpm/structured-clone-es@2.0.1/node_modules/structured-clone-es/dist/index.mjs
2
2
  const env = typeof self === "object" ? self : globalThis;
3
+ const SAFE_ERROR_NAMES = /* @__PURE__ */ new Set([
4
+ "Error",
5
+ "EvalError",
6
+ "RangeError",
7
+ "ReferenceError",
8
+ "SyntaxError",
9
+ "TypeError",
10
+ "URIError",
11
+ "AggregateError"
12
+ ]);
13
+ const SAFE_CONSTRUCTOR_NAMES = /* @__PURE__ */ new Set([
14
+ "Boolean",
15
+ "Number",
16
+ "String",
17
+ "Int8Array",
18
+ "Uint8Array",
19
+ "Uint8ClampedArray",
20
+ "Int16Array",
21
+ "Uint16Array",
22
+ "Int32Array",
23
+ "Uint32Array",
24
+ "Float16Array",
25
+ "Float32Array",
26
+ "Float64Array",
27
+ "BigInt64Array",
28
+ "BigUint64Array"
29
+ ]);
3
30
  function deserializer($, _) {
4
31
  const as = (out, index) => {
5
32
  $.set(index, out);
@@ -38,7 +65,8 @@ function deserializer($, _) {
38
65
  }
39
66
  case 7: {
40
67
  const { name, message } = value;
41
- return as(new env[name](message), index);
68
+ const Ctor = SAFE_ERROR_NAMES.has(name) ? env[name] : void 0;
69
+ return as(new (Ctor ?? env.Error)(message), index);
42
70
  }
43
71
  case 8: return as(BigInt(value), index);
44
72
  case "BigInt": return as(Object(BigInt(value)), index);
@@ -48,7 +76,8 @@ function deserializer($, _) {
48
76
  return as(new DataView(buffer), value);
49
77
  }
50
78
  }
51
- return as(new env[type](value), index);
79
+ if (typeof type === "string" && SAFE_CONSTRUCTOR_NAMES.has(type)) return as(new env[type](value), index);
80
+ throw new TypeError(`unable to deserialize unsafe or unknown type: ${String(type)}`);
52
81
  };
53
82
  return unpair;
54
83
  }
@@ -1,4 +1,4 @@
1
- import { $ as DevframeRpcServerFunctions, A as DevframeSettingsStore, At as EventUnsubscribe, B as DevframeDefineDiagnosticsOptions, C as DevframeServicesHost, Ct as AgentResourceContent, D as DevframeScopedStreamingHost, Dt as DevframeAgentHost, E as DevframeScopedNodeRpc, Et as AgentToolInput, F as ScopedSharedStates, G as RpcBroadcastOptions, H as DevframeDiagnosticsHost, I as SettingsForNamespace, J as RpcSharedStateHost, K as RpcFunctionsHost, L as DevframeViewHost, M as ScopedClientFunctions, N as ScopedRpcFn, O as DevframeSettings, Ot as DevframeAgentHostEvents, P as ScopedServerFunctions, Q as DevframeRpcClientFunctions, R as DevframeHost, S as DevframeServiceOf, St as AgentResource, T as DevframeScopedNodeContext, Tt as AgentTool, U as DevframeDiagnosticsLogger, V as DevframeDiagnosticsDefinition, W as DevframeNodeRpcSession, X as RpcStreamingChannelOptions, Y as RpcStreamingChannel, Z as RpcStreamingHost, _ as ConnectionMeta, a as DevframeDockDefaults, b as DevframeNodeContext, bt as AgentHandle, c as DevframeSetupInfo, d as McpRouteOptions, et as DevframeRpcSharedStates, f as defineDevframe, g as Thenable, h as PartialWithoutId, i as DevframeDeploymentKind, j as ScopedBroadcastOptions, jt as EventsMap, k as DevframeSettingsRegistry, kt as EventEmitter, l as DevframeSpaOptions, m as EntriesToObject, n as DevframeCliOptions, o as DevframeDuplicationStrategy, q as RpcSharedStateGetOptions, r as DevframeDefinition, s as DevframeRuntime, t as DevframeBrowserContext, u as DevframeWsOptions, v as ConnectionMetaWebsocket, w as DevframeServicesRegistry, wt as AgentResourceInput, x as DevframeServiceId, xt as AgentManifest, y as DevframeCapabilities, z as DevframeStorageScope } from "../devframe-DfzYvlKI.mjs";
1
+ import { $ as DevframeRpcServerFunctions, A as DevframeSettingsStore, At as EventUnsubscribe, B as DevframeDefineDiagnosticsOptions, C as DevframeServicesHost, Ct as AgentResourceContent, D as DevframeScopedStreamingHost, Dt as DevframeAgentHost, E as DevframeScopedNodeRpc, Et as AgentToolInput, F as ScopedSharedStates, G as RpcBroadcastOptions, H as DevframeDiagnosticsHost, I as SettingsForNamespace, J as RpcSharedStateHost, K as RpcFunctionsHost, L as DevframeViewHost, M as ScopedClientFunctions, N as ScopedRpcFn, O as DevframeSettings, Ot as DevframeAgentHostEvents, P as ScopedServerFunctions, Q as DevframeRpcClientFunctions, R as DevframeHost, S as DevframeServiceOf, St as AgentResource, T as DevframeScopedNodeContext, Tt as AgentTool, U as DevframeDiagnosticsLogger, V as DevframeDiagnosticsDefinition, W as DevframeNodeRpcSession, X as RpcStreamingChannelOptions, Y as RpcStreamingChannel, Z as RpcStreamingHost, _ as ConnectionMeta, a as DevframeDockDefaults, b as DevframeNodeContext, bt as AgentHandle, c as DevframeSetupInfo, d as McpRouteOptions, et as DevframeRpcSharedStates, f as defineDevframe, g as Thenable, h as PartialWithoutId, i as DevframeDeploymentKind, j as ScopedBroadcastOptions, jt as EventsMap, k as DevframeSettingsRegistry, kt as EventEmitter, l as DevframeSpaOptions, m as EntriesToObject, n as DevframeCliOptions, o as DevframeDuplicationStrategy, q as RpcSharedStateGetOptions, r as DevframeDefinition, s as DevframeRuntime, t as DevframeBrowserContext, u as DevframeWsOptions, v as ConnectionMetaWebsocket, w as DevframeServicesRegistry, wt as AgentResourceInput, x as DevframeServiceId, xt as AgentManifest, y as DevframeCapabilities, z as DevframeStorageScope } from "../devframe-Ckhf3kFw.mjs";
2
2
  import { g as RpcFunctionAgentOptions } from "../types-CrzNxXKq.mjs";
3
3
  import { t as DevframeNodeRpcSessionMeta } from "../ws-server-9-wn7MNQ.mjs";
4
4
  export { AgentHandle, AgentManifest, AgentResource, AgentResourceContent, AgentResourceInput, AgentTool, AgentToolInput, ConnectionMeta, ConnectionMetaWebsocket, DevframeAgentHost, DevframeAgentHostEvents, DevframeBrowserContext, DevframeCapabilities, DevframeCliOptions, DevframeDefineDiagnosticsOptions, DevframeDefinition, DevframeDeploymentKind, DevframeDiagnosticsDefinition, DevframeDiagnosticsHost, DevframeDiagnosticsLogger, DevframeDockDefaults, DevframeDuplicationStrategy, DevframeHost, DevframeNodeContext, DevframeNodeRpcSession, type DevframeNodeRpcSessionMeta, DevframeRpcClientFunctions, DevframeRpcServerFunctions, DevframeRpcSharedStates, DevframeRuntime, DevframeScopedNodeContext, DevframeScopedNodeRpc, DevframeScopedStreamingHost, DevframeServiceId, DevframeServiceOf, DevframeServicesHost, DevframeServicesRegistry, DevframeSettings, DevframeSettingsRegistry, DevframeSettingsStore, DevframeSetupInfo, DevframeSpaOptions, DevframeStorageScope, DevframeViewHost, DevframeWsOptions, EntriesToObject, EventEmitter, EventUnsubscribe, EventsMap, McpRouteOptions, PartialWithoutId, RpcBroadcastOptions, type RpcFunctionAgentOptions, RpcFunctionsHost, RpcSharedStateGetOptions, RpcSharedStateHost, RpcStreamingChannel, RpcStreamingChannelOptions, RpcStreamingHost, ScopedBroadcastOptions, ScopedClientFunctions, ScopedRpcFn, ScopedServerFunctions, ScopedSharedStates, SettingsForNamespace, Thenable, defineDevframe };
@@ -1,4 +1,4 @@
1
- import { jt as EventsMap, kt as EventEmitter } from "../devframe-DfzYvlKI.mjs";
1
+ import { jt as EventsMap, kt as EventEmitter } from "../devframe-Ckhf3kFw.mjs";
2
2
  //#region src/utils/events.d.ts
3
3
  /**
4
4
  * Create event emitter.