devframe 0.6.1 → 0.7.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 (40) hide show
  1. package/dist/adapters/build.d.mts +1 -1
  2. package/dist/adapters/cac.d.mts +41 -0
  3. package/dist/adapters/cac.mjs +2 -0
  4. package/dist/adapters/cli.d.mts +8 -31
  5. package/dist/adapters/cli.mjs +3 -143
  6. package/dist/adapters/dev.d.mts +3 -3
  7. package/dist/adapters/dev.mjs +1 -1
  8. package/dist/adapters/embedded.d.mts +1 -1
  9. package/dist/adapters/mcp.d.mts +1 -1
  10. package/dist/cac-DCBSjlzl.mjs +152 -0
  11. package/dist/client/index.d.mts +90 -5
  12. package/dist/client/index.mjs +143 -6
  13. package/dist/{context-UX9qUDK7.d.mts → context-BsiCAEC4.d.mts} +1 -1
  14. package/dist/{dev-DE51PeJc.mjs → dev-YeAm6GL0.mjs} +1 -1
  15. package/dist/{devframe-BtVHhmwM.d.mts → devframe-Dma0XG3U.d.mts} +53 -6
  16. package/dist/helpers/vite.d.mts +2 -2
  17. package/dist/helpers/vite.mjs +2 -2
  18. package/dist/{index-DXHWuwJk.d.mts → index-BAZpbgHu.d.mts} +1 -1
  19. package/dist/{index-Dy6GFDRf.d.mts → index-DI_TMGjv.d.mts} +2 -2
  20. package/dist/{index-ByaMT1Xp.d.mts → index-d40ZLcYw.d.mts} +3 -3
  21. package/dist/index.d.mts +4 -4
  22. package/dist/node/auth.d.mts +1 -1
  23. package/dist/node/hub-internals.d.mts +2 -2
  24. package/dist/node/index.d.mts +5 -5
  25. package/dist/recipes/interactive-auth.d.mts +2 -2
  26. package/dist/recipes/open-helpers.d.mts +1 -1
  27. package/dist/rpc/dump.d.mts +1 -1
  28. package/dist/rpc/index.d.mts +2 -2
  29. package/dist/rpc/transports/ws-client.d.mts +1 -1
  30. package/dist/rpc/transports/ws-server.d.mts +1 -1
  31. package/dist/{server-Cfr1NrGQ.d.mts → server-BD-tKDVf.d.mts} +2 -2
  32. package/dist/types/index.d.mts +4 -4
  33. package/dist/{types-DZEx4ffs.d.mts → types-oEqKqUC9.d.mts} +4 -4
  34. package/dist/utils/events.d.mts +1 -1
  35. package/dist/utils/shared-state.d.mts +1 -1
  36. package/dist/utils/streaming-channel.d.mts +1 -1
  37. package/dist/{ws-client-D0z0pOhn.d.mts → ws-client-nBjpin71.d.mts} +1 -1
  38. package/dist/{ws-server-Bc2wBHl-.d.mts → ws-server-BUgJpdX4.d.mts} +1 -1
  39. package/package.json +8 -3
  40. package/skills/devframe/SKILL.md +4 -4
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "devframe",
3
3
  "type": "module",
4
- "version": "0.6.1",
4
+ "version": "0.7.0",
5
5
  "description": "Framework for building generic devframes",
6
6
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",
@@ -21,6 +21,7 @@
21
21
  "exports": {
22
22
  ".": "./dist/index.mjs",
23
23
  "./adapters/build": "./dist/adapters/build.mjs",
24
+ "./adapters/cac": "./dist/adapters/cac.mjs",
24
25
  "./adapters/cli": "./dist/adapters/cli.mjs",
25
26
  "./adapters/dev": "./dist/adapters/dev.mjs",
26
27
  "./adapters/embedded": "./dist/adapters/embedded.mjs",
@@ -62,17 +63,20 @@
62
63
  "skills"
63
64
  ],
64
65
  "peerDependencies": {
65
- "@modelcontextprotocol/sdk": "^1.0.0"
66
+ "@modelcontextprotocol/sdk": "^1.0.0",
67
+ "cac": "^7.0.0"
66
68
  },
67
69
  "peerDependenciesMeta": {
68
70
  "@modelcontextprotocol/sdk": {
69
71
  "optional": true
72
+ },
73
+ "cac": {
74
+ "optional": true
70
75
  }
71
76
  },
72
77
  "dependencies": {
73
78
  "@valibot/to-json-schema": "^1.7.1",
74
79
  "birpc": "^4.0.0",
75
- "cac": "^7.0.0",
76
80
  "crossws": "^0.4.9",
77
81
  "destr": "^2.0.5",
78
82
  "h3": "2.0.1-rc.22",
@@ -84,6 +88,7 @@
84
88
  },
85
89
  "devDependencies": {
86
90
  "@modelcontextprotocol/sdk": "^1.29.0",
91
+ "cac": "^7.0.0",
87
92
  "get-port-please": "^3.2.0",
88
93
  "immer": "^11.1.11",
89
94
  "launch-editor": "^2.14.1",
@@ -11,7 +11,7 @@ description: >
11
11
  terminals, palette, etc.), the devframe can be mounted into a
12
12
  host that provides them — Vite DevTools is one supported target,
13
13
  reached via the `vite` adapter. Triggers on `devframe` imports,
14
- `defineDevframe`, `createCli`, `createMcpServer`,
14
+ `defineDevframe`, `createCac`, `createMcpServer`,
15
15
  `connectDevframe`, and on migrations of existing inspectors
16
16
  (eslint-config-inspector, unocss-inspector,
17
17
  node-modules-inspector-style tools) to devframe.
@@ -31,7 +31,7 @@ All adapter factories share the shape `createXxx(devframeDef, options?)`.
31
31
 
32
32
  | Author goal | Factory | Entry |
33
33
  |-------------|---------|-------|
34
- | Standalone CLI for local use | `createCli(def, options?)` | `devframe/adapters/cli` |
34
+ | Standalone CLI for local use | `createCac(def, options?)` | `devframe/adapters/cac` |
35
35
  | Run the dev server programmatically (any CLI framework) | `createDevServer(def, options?)` | `devframe/adapters/dev` |
36
36
  | Self-contained static deploy with baked data | `createBuild(def, options?)` | `devframe/adapters/build` |
37
37
  | Mount into a host (Vite DevTools or any compatible host) | `createPluginFromDevframe(def, options?)` | `@vitejs/devtools-kit/node` |
@@ -530,7 +530,7 @@ At runtime, static clients look up the argument hash in the dump; misses resolve
530
530
 
531
531
  ## CLI adapter subcommands
532
532
 
533
- `createCli(devframe).parse()` gives the tool four subcommands out of the box:
533
+ `createCac(devframe).parse()` gives the tool four subcommands out of the box:
534
534
 
535
535
  | Subcommand | Action |
536
536
  |------------|--------|
@@ -539,7 +539,7 @@ At runtime, static clients look up the argument hash in the dump; misses resolve
539
539
  | `spa` | Deployable SPA → `./dist-spa/` |
540
540
  | `mcp` | stdio MCP server (experimental) |
541
541
 
542
- **Bring your own CLI framework?** `createCli` is just a cac wrapper around three peer factories — `createDevServer` (`devframe/adapters/dev`), `createBuild` (`devframe/adapters/build`), and `createMcpServer` (`devframe/adapters/mcp`). Use them directly with commander/yargs/oclif when `createCli`'s baked-in command structure doesn't fit. `createDevServer` returns a `StartedServer` handle (`origin`, `port`, `app`, `wss`, `close()`) so you can wire SIGINT / hot-reload teardown into the surrounding program. `parseCliFlags(schema, raw)` and `defineCliFlags(...)` (both from `devframe/adapters/cli`) validate an arbitrary flag bag against a `CliFlagsSchema` — typed flags aren't tied to cac.
542
+ **Bring your own CLI framework?** `createCac` (`devframe/adapters/cac`) is just a cac wrapper around three peer factories — `createDevServer` (`devframe/adapters/dev`), `createBuild` (`devframe/adapters/build`), and `createMcpServer` (`devframe/adapters/mcp`). Use them directly with commander/yargs/oclif when `createCac`'s baked-in command structure doesn't fit. `cac` is an optional peer dependency pulled in only through `devframe/adapters/cac`, so bring-your-own-CLI tools run without installing it. (The legacy `devframe/adapters/cli` entry / `createCli` remains as a deprecated alias.) `createDevServer` returns a `StartedServer` handle (`origin`, `port`, `app`, `wss`, `close()`) so you can wire SIGINT / hot-reload teardown into the surrounding program. `parseCliFlags(schema, raw)` and `defineCliFlags(...)` (both from `devframe/adapters/cac`) validate an arbitrary flag bag against a `CliFlagsSchema` — the helpers are framework-agnostic.
543
543
 
544
544
  ## Bundled utilities
545
545