@cc-monitoring/proxy-core 0.1.3-alpha.1 → 0.1.3-alpha.2

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.
@@ -3,6 +3,7 @@ import path from 'path';
3
3
  import fs from 'fs';
4
4
  import { spawn } from 'child_process';
5
5
  import { WebSocketServer, WebSocket } from 'ws';
6
+ import { nanoid } from 'nanoid';
6
7
  import { loadConfig, saveConfig } from '../config/index.js';
7
8
  import { getProcessStatus, startProcess, stopProcess, reloadProcess } from '../utils/pm2.js';
8
9
  import { getCallerDirname } from '../utils/esm-dirname.js';
@@ -235,7 +236,7 @@ export async function setupUiRoutes(fastify) {
235
236
  }
236
237
  if (stream) {
237
238
  // Streaming mode: use SSE
238
- const newSessionId = sessionId ?? crypto.randomUUID();
239
+ const newSessionId = sessionId ?? nanoid();
239
240
  reply.hijack();
240
241
  const res = reply.raw;
241
242
  res.writeHead(200, {
@@ -298,7 +299,7 @@ export async function setupUiRoutes(fastify) {
298
299
  }
299
300
  else {
300
301
  // Non-streaming mode: buffer all output
301
- const newSessionId = sessionId ?? crypto.randomUUID();
302
+ const newSessionId = sessionId ?? nanoid();
302
303
  const spawnArgs = sessionId
303
304
  ? ['-r', sessionId, '-p', prompt]
304
305
  : ['--session-id', newSessionId, '-p', prompt];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cc-monitoring/proxy-core",
3
- "version": "0.1.3-alpha.1",
3
+ "version": "0.1.3-alpha.2",
4
4
  "description": "Claude Code 代理 + 监控 CLI(Fastify 代理服务器 + PM2 守护 + Web UI + 请求记录)",
5
5
  "keywords": [
6
6
  "claude",