tokensafe-ui 0.1.0 → 0.1.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.
package/bin/cli.js ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env node
2
+ const arg = process.argv[2];
3
+
4
+ if (arg === 'mcp' || !arg) {
5
+ import('./mcp.js');
6
+ } else {
7
+ console.log(`TokenSafe UI CLI v0.1.1\nUsage:\n tokensafe-ui mcp Start MCP server over stdio\n`);
8
+ }
package/bin/mcp.js ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env node
2
+ import { startMcpServer } from '../dist/mcp.js';
3
+
4
+ startMcpServer().catch((err) => {
5
+ console.error('Failed to start TokenSafe UI MCP server:', err);
6
+ process.exit(1);
7
+ });
package/dist/index.cjs CHANGED
@@ -1,3 +1,9 @@
1
+ import { createRequire as __createRequire } from 'node:module';
2
+ import { fileURLToPath as __fileURLToPath } from 'node:url';
3
+ import { dirname as __dirnameFunc } from 'node:path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __dirnameFunc(__filename);
1
7
  "use strict";
2
8
  var __defProp = Object.defineProperty;
3
9
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
package/package.json CHANGED
@@ -1,8 +1,12 @@
1
1
  {
2
2
  "name": "tokensafe-ui",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Deterministic, token-efficient frontend reactive micro-framework for AI coding agents",
5
5
  "type": "module",
6
+ "bin": {
7
+ "tokensafe-ui": "./bin/cli.js",
8
+ "tokensafe-mcp": "./bin/mcp.js"
9
+ },
6
10
  "main": "./dist/index.cjs",
7
11
  "module": "./dist/index.js",
8
12
  "types": "./dist/index.d.ts",
@@ -31,6 +35,16 @@
31
35
  "types": "./dist/testing.d.ts",
32
36
  "import": "./dist/testing.js",
33
37
  "require": "./dist/testing.cjs"
38
+ },
39
+ "./vite": {
40
+ "types": "./dist/vite.d.ts",
41
+ "import": "./dist/vite.js",
42
+ "require": "./dist/vite.cjs"
43
+ },
44
+ "./mcp": {
45
+ "types": "./dist/mcp.d.ts",
46
+ "import": "./dist/mcp.js",
47
+ "require": "./dist/mcp.cjs"
34
48
  }
35
49
  },
36
50
  "publishConfig": {
@@ -55,9 +69,11 @@
55
69
  "micro-framework"
56
70
  ],
57
71
  "dependencies": {
72
+ "@babel/generator": "^7.26.5",
58
73
  "@babel/parser": "^7.26.5",
59
74
  "@babel/traverse": "^7.26.5",
60
75
  "@babel/types": "^7.26.5",
76
+ "@modelcontextprotocol/sdk": "^1.4.0",
61
77
  "zod": "^3.24.1"
62
78
  },
63
79
  "devDependencies": {
@@ -66,6 +82,7 @@
66
82
  "@agent-dom/observer": "0.1.0",
67
83
  "@agent-dom/oumv": "0.3.0",
68
84
  "@agent-dom/patcher": "0.1.0",
85
+ "@agent-dom/vite": "0.1.0",
69
86
  "tsup": "^8.3.5",
70
87
  "typescript": "^5.7.2"
71
88
  },
package/src/mcp.ts ADDED
@@ -0,0 +1,10 @@
1
+ export * from '@agent-dom/mcp';
2
+
3
+ import { createAgentDomMcpServer } from '@agent-dom/mcp';
4
+ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
5
+
6
+ export async function startMcpServer(): Promise<void> {
7
+ const server = createAgentDomMcpServer();
8
+ const transport = new StdioServerTransport();
9
+ await server.connect(transport);
10
+ }
package/src/vite.ts ADDED
@@ -0,0 +1,2 @@
1
+ export * from '@agent-dom/vite';
2
+ export { agentDom as tokensafePlugin, agentDom as tokensafeUIPlugin } from '@agent-dom/vite';
package/tsup.config.ts CHANGED
@@ -7,6 +7,8 @@ export default defineConfig({
7
7
  'src/oumv.ts',
8
8
  'src/patcher.ts',
9
9
  'src/testing.ts',
10
+ 'src/vite.ts',
11
+ 'src/mcp.ts',
10
12
  ],
11
13
  format: ['cjs', 'esm'],
12
14
  dts: true,
@@ -18,13 +20,25 @@ export default defineConfig({
18
20
  '@agent-dom/oumv',
19
21
  '@agent-dom/patcher',
20
22
  '@agent-dom/mcp',
23
+ '@agent-dom/vite',
21
24
  ],
22
25
  external: [
23
26
  'zod',
24
27
  '@babel/parser',
25
28
  '@babel/traverse',
26
29
  '@babel/types',
30
+ '@babel/generator',
31
+ '@modelcontextprotocol/sdk',
32
+ 'vite',
27
33
  'typescript',
28
34
  ],
35
+ banner: {
36
+ js: `import { createRequire as __createRequire } from 'node:module';
37
+ import { fileURLToPath as __fileURLToPath } from 'node:url';
38
+ import { dirname as __dirnameFunc } from 'node:path';
39
+ const require = __createRequire(import.meta.url);
40
+ const __filename = __fileURLToPath(import.meta.url);
41
+ const __dirname = __dirnameFunc(__filename);`,
42
+ },
29
43
  });
30
44