devframe 0.9.20 → 0.10.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.
Files changed (100) hide show
  1. package/dist/_shared-B2PZsp-J.mjs +191 -0
  2. package/dist/{_shared-BIUet_Jh.d.mts → _shared-Dy1UBMUN.d.mts} +13 -14
  3. package/dist/adapters/build.d.mts +3 -4
  4. package/dist/adapters/build.mjs +4 -5
  5. package/dist/adapters/cac.d.mts +3 -4
  6. package/dist/adapters/cac.mjs +3 -3
  7. package/dist/adapters/dev.d.mts +8 -8
  8. package/dist/adapters/dev.mjs +2 -2
  9. package/dist/adapters/embedded.d.mts +1 -1
  10. package/dist/adapters/initiate.d.mts +8 -8
  11. package/dist/adapters/initiate.mjs +1 -1
  12. package/dist/adapters/mcp.d.mts +4 -142
  13. package/dist/adapters/mcp.mjs +1 -597
  14. package/dist/agentic-D4QQQUjE.d.mts +30 -0
  15. package/dist/cli/main.mjs +12 -260
  16. package/dist/client/index.d.mts +6 -6
  17. package/dist/client/index.mjs +3 -4
  18. package/dist/constants.d.mts +2 -1
  19. package/dist/constants.mjs +2 -1
  20. package/dist/{context-BA5FPz7K.d.mts → context-B4BKPuaa.d.mts} +1 -1
  21. package/dist/{context-BLXXjoBW.mjs → context-C141q8H4.mjs} +5 -5
  22. package/dist/{context-jXO5vzjH.mjs → context-CHpyLX8W.mjs} +1 -1
  23. package/dist/{context-BLHBDQcZ.d.mts → context-CTAxz9ec.d.mts} +108 -47
  24. package/dist/{dev-BdKKOH8S.mjs → dev-DM1mIlgi.mjs} +16 -24
  25. package/dist/{diagnostics-DZA6KQ_Z.mjs → diagnostics-Cx4_VjlG.mjs} +11 -3
  26. package/dist/dist-Bw3EbMj4.mjs +305 -0
  27. package/dist/dist-CO98PBnQ.mjs +265 -0
  28. package/dist/{host-agent-C3MBpNCd.mjs → host-agent-ZSKgzMVu.mjs} +2 -7
  29. package/dist/import-runtime-module-BzlEQ9PI.mjs +24 -0
  30. package/dist/in-page-channel/index.d.mts +2 -7
  31. package/dist/in-page-channel/index.mjs +1 -4
  32. package/dist/index-Bia1vKjL.d.mts +218 -0
  33. package/dist/{index-r6NstVmM.d.mts → index-CcPSKbxb.d.mts} +2 -2
  34. package/dist/index-CeEtxDmK.d.mts +78 -0
  35. package/dist/{index-CiA6C705.d.mts → index-DuEm0sDH.d.mts} +1 -1
  36. package/dist/index.d.mts +4 -11
  37. package/dist/index.mjs +1 -10
  38. package/dist/{instance-registry-DCq762YJ.mjs → instance-registry-DtvYxc0Y.mjs} +1 -1
  39. package/dist/{instance-shell-C6Vg97lg.d.mts → instance-shell-DOZSxst6.d.mts} +31 -5
  40. package/dist/{instance-shell-yfrM3_vK.mjs → instance-shell-wC2sfEU_.mjs} +7 -7
  41. package/dist/interactive-auth-BCa_iamv.mjs +384 -0
  42. package/dist/internal/index.d.mts +66 -22
  43. package/dist/internal/index.mjs +143 -8
  44. package/dist/mrmime-40h5OOIp.mjs +448 -0
  45. package/dist/node/auth.d.mts +2 -2
  46. package/dist/node/hub-internals.d.mts +2 -2
  47. package/dist/node/hub-internals.mjs +2 -2
  48. package/dist/node/index.d.mts +2 -4
  49. package/dist/node/index.mjs +2 -2
  50. package/dist/{nostics-0sKe5HIj.d.mts → nostics-DWvukRwa.d.mts} +11 -2
  51. package/dist/{origin-D_eBKEzr.mjs → origin-DZit9g29.mjs} +1 -21
  52. package/dist/recipes/interactive-auth.d.mts +2 -2
  53. package/dist/recipes/interactive-auth.mjs +1 -231
  54. package/dist/{remote-assets-D0StJVLp.mjs → remote-assets-B9MeWmW6.mjs} +2 -2
  55. package/dist/rpc/client.d.mts +1 -1
  56. package/dist/rpc/client.mjs +1 -1
  57. package/dist/rpc/dump.d.mts +2 -1
  58. package/dist/rpc/index.d.mts +3 -2
  59. package/dist/rpc/server.d.mts +1 -1
  60. package/dist/rpc/server.mjs +1 -1
  61. package/dist/rpc/transports/sse-client.d.mts +1 -1
  62. package/dist/rpc/transports/sse-server.d.mts +3 -3
  63. package/dist/rpc/transports/sse-server.mjs +1 -1
  64. package/dist/rpc/transports/ws-bun.d.mts +2 -2
  65. package/dist/rpc/transports/ws-bun.mjs +1 -1
  66. package/dist/rpc/transports/ws-client.d.mts +1 -1
  67. package/dist/rpc/transports/ws-deno.d.mts +2 -2
  68. package/dist/rpc/transports/ws-deno.mjs +1 -1
  69. package/dist/rpc/transports/ws-server.d.mts +1 -1
  70. package/dist/rpc/transports/ws-server.mjs +1 -1
  71. package/dist/{rpc-core-CvkU23bQ.mjs → rpc-core-BXyMjbKG.mjs} +1 -1
  72. package/dist/{rpc-core-BlL-Ip8n.d.mts → rpc-core-rLrwFEcw.d.mts} +4 -4
  73. package/dist/{services-install-Ben4yh52.mjs → services-install-D5YUwFXW.mjs} +17 -1
  74. package/dist/{sse-client-BcbYwXdD.d.mts → sse-client-DNdscfu_.d.mts} +2 -2
  75. package/dist/{storage-B70AXK64.mjs → storage-CHD1IkqU.mjs} +1 -1
  76. package/dist/types/index.d.mts +4 -4
  77. package/dist/{types-D2vGd7-2.d.mts → types-BmDbfHCx.d.mts} +2 -3
  78. package/dist/utils/debounce.d.mts +50 -0
  79. package/dist/utils/debounce.mjs +88 -0
  80. package/dist/utils/events.d.mts +1 -1
  81. package/dist/utils/launch-editor.d.mts +8 -0
  82. package/dist/utils/launch-editor.mjs +36 -1
  83. package/dist/utils/nostics.d.mts +2 -2
  84. package/dist/utils/remote-assets.mjs +1 -1
  85. package/dist/utils/serve-static.mjs +1 -1
  86. package/dist/utils/shared-state.d.mts +1 -1
  87. package/dist/utils/simple-schema.d.mts +3 -2
  88. package/dist/utils/streaming-channel.d.mts +1 -1
  89. package/dist/utils/url.d.mts +31 -0
  90. package/dist/utils/url.mjs +58 -0
  91. package/dist/{ws-client-CNpP6Ium.d.mts → ws-client-6Mrz6eC4.d.mts} +2 -2
  92. package/dist/{ws-server-BB8jhxeT.d.mts → ws-server-y2R76aSW.d.mts} +2 -2
  93. package/package.json +10 -11
  94. package/dist/_shared-U8D-xzrp.mjs +0 -115
  95. package/dist/agent-tool-name-DGzeuWcO.mjs +0 -31
  96. package/dist/client-assets-DNdhagGm.mjs +0 -16
  97. package/dist/nostics-DD6gsDZA.mjs +0 -108
  98. package/dist/recipes/common-rpc-functions.d.mts +0 -70
  99. package/dist/recipes/common-rpc-functions.mjs +0 -115
  100. package/dist/simple-schema-Bi40l-P6.mjs +0 -154
@@ -1,115 +0,0 @@
1
- import { n as defineRpcFunction } from "../define-BLWPsH6y.mjs";
2
- import { t as s } from "../simple-schema-Bi40l-P6.mjs";
3
- //#region src/recipes/common-rpc-functions.ts
4
- /** Runtime list of every {@link KnownEditor}. */
5
- const KNOWN_EDITORS = [
6
- "atom",
7
- "subl",
8
- "sublime",
9
- "sublime_text",
10
- "wstorm",
11
- "charm",
12
- "zed",
13
- "notepad++",
14
- "vim",
15
- "mvim",
16
- "joe",
17
- "gvim",
18
- "emacs",
19
- "emacsclient",
20
- "rmate",
21
- "mate",
22
- "code",
23
- "code-insiders",
24
- "codium",
25
- "vscodium",
26
- "trae",
27
- "antigravity",
28
- "cursor",
29
- "appcode",
30
- "clion",
31
- "idea",
32
- "phpstorm",
33
- "pycharm",
34
- "rubymine",
35
- "webstorm",
36
- "goland",
37
- "rider"
38
- ];
39
- /**
40
- * Prebuilt RPC action that opens a file in the user's configured editor.
41
- *
42
- * Registered name: `devframe:open-in-editor`.
43
- *
44
- * The optional second argument picks the editor command explicitly (must be
45
- * one of {@link KNOWN_EDITORS}); otherwise it's auto-detected per
46
- * `devframe/utils/launch-editor`.
47
- *
48
- * ```ts
49
- * import { openInEditor } from 'devframe/recipes/common-rpc-functions'
50
- *
51
- * defineDevframe({
52
- * id: 'my-tool',
53
- * name: 'My Tool',
54
- * setup(ctx) {
55
- * ctx.rpc.register(openInEditor)
56
- * },
57
- * })
58
- * ```
59
- *
60
- * @deprecated Use the `@devframes/service-open` wire service instead: one
61
- * host-level installation shared by every plugin and feature-detectable from
62
- * clients, with workspace-root path containment on top of the editor gating.
63
- */
64
- const openInEditor = defineRpcFunction({
65
- name: "devframe:open-in-editor",
66
- type: "action",
67
- jsonSerializable: true,
68
- args: [s.string(), s.optional(s.picklist(KNOWN_EDITORS))],
69
- returns: s.void(),
70
- async handler(filename, editor) {
71
- const { launchEditor } = await import("../utils/launch-editor.mjs");
72
- launchEditor(filename, editor);
73
- }
74
- });
75
- /**
76
- * Prebuilt RPC action that reveals a path in the OS file explorer.
77
- *
78
- * Registered name: `devframe:open-in-finder`.
79
- *
80
- * ```ts
81
- * import { openInFinder } from 'devframe/recipes/common-rpc-functions'
82
- *
83
- * ctx.rpc.register(openInFinder)
84
- * ```
85
- *
86
- * @deprecated Use the `@devframes/service-open` wire service instead: one
87
- * host-level installation shared by every plugin and feature-detectable from
88
- * clients, with workspace-root path containment.
89
- */
90
- const openInFinder = defineRpcFunction({
91
- name: "devframe:open-in-finder",
92
- type: "action",
93
- jsonSerializable: true,
94
- args: [s.string()],
95
- returns: s.void(),
96
- async handler(path) {
97
- const { open } = await import("../utils/open.mjs");
98
- await open(path);
99
- }
100
- });
101
- /**
102
- * Convenience array bundling both helpers so callers can register them
103
- * in a single `forEach`.
104
- *
105
- * ```ts
106
- * import { commonRpcFunctions } from 'devframe/recipes/common-rpc-functions'
107
- *
108
- * commonRpcFunctions.forEach(fn => ctx.rpc.register(fn))
109
- * ```
110
- *
111
- * @deprecated Use the `@devframes/service-open` wire service instead.
112
- */
113
- const commonRpcFunctions = [openInEditor, openInFinder];
114
- //#endregion
115
- export { KNOWN_EDITORS, commonRpcFunctions, openInEditor, openInFinder };
@@ -1,154 +0,0 @@
1
- //#region src/utils/simple-schema.ts
2
- function ok(value) {
3
- return { value };
4
- }
5
- function fail(message, path) {
6
- return { issues: [path ? {
7
- message,
8
- path
9
- } : { message }] };
10
- }
11
- function make(type, validate, extra) {
12
- return {
13
- type,
14
- ...extra,
15
- "~standard": {
16
- version: 1,
17
- vendor: "devframe",
18
- validate
19
- }
20
- };
21
- }
22
- /** Run a Standard Schema synchronously, rejecting async validators. */
23
- function runSync(schema, value) {
24
- const result = schema["~standard"].validate(value);
25
- if (result instanceof Promise) throw new TypeError("[devframe/utils/simple-schema] async validators are not supported inside object()/optional()/nullable()");
26
- return result;
27
- }
28
- /** Any string. */
29
- function string() {
30
- return make("string", (v) => typeof v === "string" ? ok(v) : fail("Expected a string"));
31
- }
32
- /** A finite number (rejects `NaN`). */
33
- function number() {
34
- return make("number", (v) => typeof v === "number" && !Number.isNaN(v) ? ok(v) : fail("Expected a number"));
35
- }
36
- /** A boolean. */
37
- function boolean() {
38
- return make("boolean", (v) => typeof v === "boolean" ? ok(v) : fail("Expected a boolean"));
39
- }
40
- /** `undefined`, mirroring valibot's `void`. */
41
- function voidType() {
42
- return make("void", (v) => v === void 0 ? ok(void 0) : fail("Expected undefined"));
43
- }
44
- /** `null`. */
45
- function nullType() {
46
- return make("null", (v) => v === null ? ok(null) : fail("Expected null"));
47
- }
48
- /** One of a fixed set of literal values. */
49
- function picklist(values) {
50
- const set = new Set(values);
51
- return make("picklist", (v) => set.has(v) ? ok(v) : fail(`Expected one of: ${values.join(", ")}`), { values });
52
- }
53
- /** A single literal value (string / number / boolean). */
54
- function literal(value) {
55
- return make("literal", (v) => v === value ? ok(v) : fail(`Expected ${JSON.stringify(value)}`), { value });
56
- }
57
- /** A value matching any one of the given schemas. */
58
- function union(options) {
59
- return make("union", (v) => {
60
- const issues = [];
61
- for (const option of options) {
62
- const result = runSync(option, v);
63
- if (!result.issues) return ok(v);
64
- issues.push(...result.issues);
65
- }
66
- return { issues };
67
- }, { options });
68
- }
69
- /** A record with string keys whose values each satisfy the value schema. */
70
- function record(_key, value) {
71
- return make("record", (v) => {
72
- if (typeof v !== "object" || v === null || Array.isArray(v)) return fail("Expected an object");
73
- const obj = v;
74
- const issues = [];
75
- for (const key of Object.keys(obj)) {
76
- const result = runSync(value, obj[key]);
77
- if (result.issues) for (const issue of result.issues) issues.push({
78
- message: issue.message,
79
- path: [key, ...issue.path ?? []]
80
- });
81
- }
82
- return issues.length ? { issues } : ok(v);
83
- });
84
- }
85
- /** An array whose every element satisfies the item schema. */
86
- function array(item) {
87
- return make("array", (v) => {
88
- if (!Array.isArray(v)) return fail("Expected an array");
89
- const issues = [];
90
- for (let i = 0; i < v.length; i++) {
91
- const result = runSync(item, v[i]);
92
- if (result.issues) for (const issue of result.issues) issues.push({
93
- message: issue.message,
94
- path: [i, ...issue.path ?? []]
95
- });
96
- }
97
- return issues.length ? { issues } : ok(v);
98
- });
99
- }
100
- /** An object whose known keys each satisfy their schema (extra keys are kept). */
101
- function object(shape) {
102
- const entries = Object.entries(shape);
103
- return make("object", (v) => {
104
- if (typeof v !== "object" || v === null || Array.isArray(v)) return fail("Expected an object");
105
- const obj = v;
106
- const issues = [];
107
- for (const [key, schema] of entries) {
108
- const result = runSync(schema, obj[key]);
109
- if (result.issues) for (const issue of result.issues) issues.push({
110
- message: issue.message,
111
- path: [key, ...issue.path ?? []]
112
- });
113
- }
114
- return issues.length ? { issues } : ok(v);
115
- });
116
- }
117
- /** Allow `undefined` in addition to the inner schema. */
118
- function optional(inner) {
119
- return make("optional", (v) => v === void 0 ? ok(void 0) : runSync(inner, v), { wrapped: inner });
120
- }
121
- /** Allow `null` in addition to the inner schema. */
122
- function nullable(inner) {
123
- return make("nullable", (v) => v === null ? ok(null) : runSync(inner, v), { wrapped: inner });
124
- }
125
- /** Attach a human-readable description (used for CLI option help). */
126
- function describe(schema, description) {
127
- return {
128
- ...schema,
129
- description
130
- };
131
- }
132
- /**
133
- * Grouped access to every builder: `s.string()`, `s.object({ ... })`,
134
- * `s.void()`, etc. Handy for a valibot-like `import { s } from
135
- * 'devframe/utils/simple-schema'` call site.
136
- */
137
- const s = {
138
- string,
139
- number,
140
- boolean,
141
- void: voidType,
142
- null: nullType,
143
- literal,
144
- picklist,
145
- union,
146
- record,
147
- array,
148
- object,
149
- optional,
150
- nullable,
151
- describe
152
- };
153
- //#endregion
154
- export { s as t };