devframe 0.9.20 → 0.10.1

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 (102) hide show
  1. package/dist/_shared-B2PZsp-J.mjs +191 -0
  2. package/dist/{_shared-BIUet_Jh.d.mts → _shared-D1ebaX_J.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-DLqHMOyN.d.mts +30 -0
  15. package/dist/browser-agent-Pu-FLk6I.mjs +26 -0
  16. package/dist/browser-agent-rpc-BXhoSh1z.mjs +70 -0
  17. package/dist/cli/main.mjs +12 -260
  18. package/dist/client/index.d.mts +6 -6
  19. package/dist/client/index.mjs +12 -87
  20. package/dist/constants.d.mts +2 -1
  21. package/dist/constants.mjs +2 -1
  22. package/dist/{context-BLHBDQcZ.d.mts → context--tVkJw3W.d.mts} +127 -47
  23. package/dist/{context-BLXXjoBW.mjs → context-BqpgC5tq.mjs} +55 -5
  24. package/dist/{context-jXO5vzjH.mjs → context-CHpyLX8W.mjs} +1 -1
  25. package/dist/{context-BA5FPz7K.d.mts → context-D3qBv0IX.d.mts} +1 -1
  26. package/dist/{dev-BdKKOH8S.mjs → dev-BTbLJekh.mjs} +16 -24
  27. package/dist/{diagnostics-DZA6KQ_Z.mjs → diagnostics-Cx4_VjlG.mjs} +11 -3
  28. package/dist/dist-CO98PBnQ.mjs +265 -0
  29. package/dist/{host-agent-C3MBpNCd.mjs → host-agent-mIbQ6Qi5.mjs} +14 -13
  30. package/dist/import-runtime-module-BzlEQ9PI.mjs +24 -0
  31. package/dist/in-page-channel/index.d.mts +16 -12
  32. package/dist/in-page-channel/index.mjs +42 -14
  33. package/dist/index-Bia1vKjL.d.mts +218 -0
  34. package/dist/index-CeEtxDmK.d.mts +78 -0
  35. package/dist/{index-r6NstVmM.d.mts → index-D-2IdY1I.d.mts} +2 -2
  36. package/dist/{index-CiA6C705.d.mts → index-DuEm0sDH.d.mts} +1 -1
  37. package/dist/index.d.mts +4 -11
  38. package/dist/index.mjs +1 -10
  39. package/dist/{instance-registry-DCq762YJ.mjs → instance-registry-DtvYxc0Y.mjs} +1 -1
  40. package/dist/{instance-shell-C6Vg97lg.d.mts → instance-shell-CXnpSuK7.d.mts} +31 -5
  41. package/dist/{instance-shell-yfrM3_vK.mjs → instance-shell-wC2sfEU_.mjs} +7 -7
  42. package/dist/interactive-auth-BCa_iamv.mjs +384 -0
  43. package/dist/internal/index.d.mts +66 -22
  44. package/dist/internal/index.mjs +143 -8
  45. package/dist/mrmime-40h5OOIp.mjs +448 -0
  46. package/dist/node/auth.d.mts +2 -2
  47. package/dist/node/hub-internals.d.mts +2 -2
  48. package/dist/node/hub-internals.mjs +2 -2
  49. package/dist/node/index.d.mts +2 -4
  50. package/dist/node/index.mjs +2 -2
  51. package/dist/{nostics-0sKe5HIj.d.mts → nostics-DWvukRwa.d.mts} +11 -2
  52. package/dist/{origin-D_eBKEzr.mjs → origin-DZit9g29.mjs} +1 -21
  53. package/dist/recipes/interactive-auth.d.mts +2 -2
  54. package/dist/recipes/interactive-auth.mjs +1 -231
  55. package/dist/{remote-assets-D0StJVLp.mjs → remote-assets-B9MeWmW6.mjs} +2 -2
  56. package/dist/rpc/client.d.mts +1 -1
  57. package/dist/rpc/client.mjs +1 -1
  58. package/dist/rpc/dump.d.mts +2 -1
  59. package/dist/rpc/index.d.mts +3 -2
  60. package/dist/rpc/server.d.mts +1 -1
  61. package/dist/rpc/server.mjs +1 -1
  62. package/dist/rpc/transports/sse-client.d.mts +1 -1
  63. package/dist/rpc/transports/sse-server.d.mts +3 -3
  64. package/dist/rpc/transports/sse-server.mjs +1 -1
  65. package/dist/rpc/transports/ws-bun.d.mts +2 -2
  66. package/dist/rpc/transports/ws-bun.mjs +1 -1
  67. package/dist/rpc/transports/ws-client.d.mts +1 -1
  68. package/dist/rpc/transports/ws-deno.d.mts +2 -2
  69. package/dist/rpc/transports/ws-deno.mjs +1 -1
  70. package/dist/rpc/transports/ws-server.d.mts +1 -1
  71. package/dist/rpc/transports/ws-server.mjs +1 -1
  72. package/dist/{rpc-core-BlL-Ip8n.d.mts → rpc-core-B6n9MQsc.d.mts} +4 -4
  73. package/dist/{rpc-core-CvkU23bQ.mjs → rpc-core-BXyMjbKG.mjs} +1 -1
  74. package/dist/{services-install-Ben4yh52.mjs → services-install-D5YUwFXW.mjs} +17 -1
  75. package/dist/{sse-client-BcbYwXdD.d.mts → sse-client-DNdscfu_.d.mts} +2 -2
  76. package/dist/{storage-B70AXK64.mjs → storage-CHD1IkqU.mjs} +1 -1
  77. package/dist/tool-input-BAQXvvqL.mjs +393 -0
  78. package/dist/types/index.d.mts +4 -4
  79. package/dist/{types-D2vGd7-2.d.mts → types-BmDbfHCx.d.mts} +2 -3
  80. package/dist/utils/debounce.d.mts +50 -0
  81. package/dist/utils/debounce.mjs +88 -0
  82. package/dist/utils/events.d.mts +1 -1
  83. package/dist/utils/launch-editor.d.mts +8 -0
  84. package/dist/utils/launch-editor.mjs +36 -1
  85. package/dist/utils/nostics.d.mts +2 -2
  86. package/dist/utils/remote-assets.mjs +1 -1
  87. package/dist/utils/serve-static.mjs +1 -1
  88. package/dist/utils/shared-state.d.mts +1 -1
  89. package/dist/utils/simple-schema.d.mts +3 -2
  90. package/dist/utils/streaming-channel.d.mts +1 -1
  91. package/dist/utils/url.d.mts +31 -0
  92. package/dist/utils/url.mjs +58 -0
  93. package/dist/{ws-client-CNpP6Ium.d.mts → ws-client-6Mrz6eC4.d.mts} +2 -2
  94. package/dist/{ws-server-BB8jhxeT.d.mts → ws-server-y2R76aSW.d.mts} +2 -2
  95. package/package.json +10 -11
  96. package/dist/_shared-U8D-xzrp.mjs +0 -115
  97. package/dist/agent-tool-name-DGzeuWcO.mjs +0 -31
  98. package/dist/client-assets-DNdhagGm.mjs +0 -16
  99. package/dist/nostics-DD6gsDZA.mjs +0 -108
  100. package/dist/recipes/common-rpc-functions.d.mts +0 -70
  101. package/dist/recipes/common-rpc-functions.mjs +0 -115
  102. package/dist/simple-schema-Bi40l-P6.mjs +0 -154
@@ -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 };