@cloudcli-ai/cloudcli 1.28.0 → 1.28.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.
@@ -1,4 +1,4 @@
1
- import{r as em,a as ve}from"./vendor-react-CdSTmIF1.js";var Cs={exports:{}},Bi={};/**
1
+ import{r as em,a as ve}from"./vendor-react-D7WwDXvu.js";var Cs={exports:{}},Bi={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.min.js
4
4
  *
@@ -56,4 +56,4 @@ Error generating stack: `+u.message+`
56
56
  * LICENSE.md file in the root directory of this source tree.
57
57
  *
58
58
  * @license MIT
59
- */const up="6";try{window.__reactRouterVersion=up}catch{}const ip="startTransition",Ha=od[ip];function dp(o){let{basename:f,children:a,future:y,window:g}=o,C=j.useRef();C.current==null&&(C.current=pd({window:g,v5Compat:!0}));let _=C.current,[T,P]=j.useState({action:_.action,location:_.location}),{v7_startTransition:U}=y||{},$=j.useCallback(N=>{U&&Ha?Ha(()=>P(N)):P(N)},[P,U]);return j.useLayoutEffect(()=>_.listen($),[_,$]),j.useEffect(()=>np(y),[y]),j.createElement(lp,{basename:f,children:a,location:T.location,navigationType:T.action,navigator:_,future:y})}var Qa;(function(o){o.UseScrollRestoration="useScrollRestoration",o.UseSubmit="useSubmit",o.UseSubmitFetcher="useSubmitFetcher",o.UseFetcher="useFetcher",o.useViewTransitionState="useViewTransitionState"})(Qa||(Qa={}));var Ka;(function(o){o.UseFetcher="useFetcher",o.UseFetchers="useFetchers",o.UseScrollRestoration="useScrollRestoration"})(Ka||(Ka={}));export{dp as B,sp as R,j as a,fd as b,id as c,op as d,cp as e,fp as f,Ya as g,rp as h,Xa as r,ap as u};
59
+ */const up="6";try{window.__reactRouterVersion=up}catch{}const ip="startTransition",Ha=od[ip];function dp(o){let{basename:f,children:a,future:y,window:g}=o,C=j.useRef();C.current==null&&(C.current=pd({window:g,v5Compat:!0}));let _=C.current,[T,P]=j.useState({action:_.action,location:_.location}),{v7_startTransition:U}=y||{},$=j.useCallback(N=>{U&&Ha?Ha(()=>P(N)):P(N)},[P,U]);return j.useLayoutEffect(()=>_.listen($),[_,$]),j.useEffect(()=>np(y),[y]),j.createElement(lp,{basename:f,children:a,location:T.location,navigationType:T.action,navigator:_,future:y})}var Qa;(function(o){o.UseScrollRestoration="useScrollRestoration",o.UseSubmit="useSubmit",o.UseSubmitFetcher="useSubmitFetcher",o.UseFetcher="useFetcher",o.useViewTransitionState="useViewTransitionState"})(Qa||(Qa={}));var Ka;(function(o){o.UseFetcher="useFetcher",o.UseFetchers="useFetchers",o.UseScrollRestoration="useScrollRestoration"})(Ka||(Ka={}));export{dp as B,sp as R,j as a,fd as b,dd as c,id as d,op as e,cp as f,Ya as g,fp as h,rp as i,Xa as r,ap as u};
package/dist/index.html CHANGED
@@ -25,11 +25,11 @@
25
25
 
26
26
  <!-- Prevent zoom on iOS -->
27
27
  <meta name="format-detection" content="telephone=no" />
28
- <script type="module" crossorigin src="/assets/index-BWQPmiP5.js"></script>
29
- <link rel="modulepreload" crossorigin href="/assets/vendor-react-CdSTmIF1.js">
30
- <link rel="modulepreload" crossorigin href="/assets/vendor-codemirror-C8f1vU1x.js">
28
+ <script type="module" crossorigin src="/assets/index-_9VG3czA.js"></script>
29
+ <link rel="modulepreload" crossorigin href="/assets/vendor-react-D7WwDXvu.js">
30
+ <link rel="modulepreload" crossorigin href="/assets/vendor-codemirror-NA4v81it.js">
31
31
  <link rel="modulepreload" crossorigin href="/assets/vendor-xterm-CJZjLICi.js">
32
- <link rel="stylesheet" crossorigin href="/assets/index-B1XAhG_4.css">
32
+ <link rel="stylesheet" crossorigin href="/assets/index-ByHZ8-LL.css">
33
33
  </head>
34
34
  <body>
35
35
  <div id="root"></div>
package/dist/sw.js CHANGED
@@ -1,4 +1,4 @@
1
- // Service Worker for Claude Code UI PWA
1
+ // Service Worker for CloudCLI PWA
2
2
  // Cache only manifest (needed for PWA install). HTML and JS are never pre-cached
3
3
  // so a rebuild + refresh always picks up the latest assets.
4
4
  const CACHE_NAME = 'claude-ui-v2';
@@ -79,7 +79,7 @@ self.addEventListener('push', event => {
79
79
  try {
80
80
  payload = event.data.json();
81
81
  } catch {
82
- payload = { title: 'Claude Code UI', body: event.data.text() };
82
+ payload = { title: 'CloudCLI', body: event.data.text() };
83
83
  }
84
84
 
85
85
  const options = {
@@ -92,7 +92,7 @@ self.addEventListener('push', event => {
92
92
  };
93
93
 
94
94
  event.waitUntil(
95
- self.registration.showNotification(payload.title || 'Claude Code UI', options)
95
+ self.registration.showNotification(payload.title || 'CloudCLI', options)
96
96
  );
97
97
  });
98
98
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudcli-ai/cloudcli",
3
- "version": "1.28.0",
3
+ "version": "1.28.1",
4
4
  "description": "A web-based UI for Claude Code CLI",
5
5
  "type": "module",
6
6
  "main": "server/index.js",
package/server/cli.js CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
- * Claude Code UI CLI
3
+ * CloudCLI CLI
4
4
  *
5
- * Provides command-line utilities for managing Claude Code UI
5
+ * Provides command-line utilities for managing CloudCLI
6
6
  *
7
7
  * Commands:
8
8
  * (no args) - Start the server (default)
@@ -84,7 +84,7 @@ function getInstallDir() {
84
84
 
85
85
  // Show status command
86
86
  function showStatus() {
87
- console.log(`\n${c.bright('Claude Code UI - Status')}\n`);
87
+ console.log(`\n${c.bright('CloudCLI UI - Status')}\n`);
88
88
  console.log(c.dim('═'.repeat(60)));
89
89
 
90
90
  // Version info
@@ -141,7 +141,7 @@ function showStatus() {
141
141
  function showHelp() {
142
142
  console.log(`
143
143
  ╔═══════════════════════════════════════════════════════════════╗
144
- Claude Code UI - Command Line Tool ║
144
+ CloudCLI - Command Line Tool ║
145
145
  ╚═══════════════════════════════════════════════════════════════╝
146
146
 
147
147
  Usage:
@@ -149,7 +149,7 @@ Usage:
149
149
  cloudcli [command] [options]
150
150
 
151
151
  Commands:
152
- start Start the Claude Code UI server (default)
152
+ start Start the CloudCLI server (default)
153
153
  status Show configuration and data locations
154
154
  update Update to the latest version
155
155
  help Show this help information
package/server/index.js CHANGED
@@ -812,7 +812,7 @@ app.get('/api/projects/:projectName/file', authenticateToken, async (req, res) =
812
812
  }
813
813
  });
814
814
 
815
- // Serve binary file content endpoint (for images, etc.)
815
+ // Serve raw file bytes for previews and downloads.
816
816
  app.get('/api/projects/:projectName/files/content', authenticateToken, async (req, res) => {
817
817
  try {
818
818
  const { projectName } = req.params;
@@ -829,7 +829,11 @@ app.get('/api/projects/:projectName/files/content', authenticateToken, async (re
829
829
  return res.status(404).json({ error: 'Project not found' });
830
830
  }
831
831
 
832
- const resolved = path.resolve(filePath);
832
+ // Match the text reader endpoint so callers can pass either project-relative
833
+ // or absolute paths without changing how the bytes are served.
834
+ const resolved = path.isAbsolute(filePath)
835
+ ? path.resolve(filePath)
836
+ : path.resolve(projectRoot, filePath);
833
837
  const normalizedRoot = path.resolve(projectRoot) + path.sep;
834
838
  if (!resolved.startsWith(normalizedRoot)) {
835
839
  return res.status(403).json({ error: 'Path must be under project root' });
@@ -1980,155 +1984,6 @@ function handleShellConnection(ws) {
1980
1984
  console.error('[ERROR] Shell WebSocket error:', error);
1981
1985
  });
1982
1986
  }
1983
- // Audio transcription endpoint
1984
- app.post('/api/transcribe', authenticateToken, async (req, res) => {
1985
- try {
1986
- const multer = (await import('multer')).default;
1987
- const upload = multer({ storage: multer.memoryStorage() });
1988
-
1989
- // Handle multipart form data
1990
- upload.single('audio')(req, res, async (err) => {
1991
- if (err) {
1992
- return res.status(400).json({ error: 'Failed to process audio file' });
1993
- }
1994
-
1995
- if (!req.file) {
1996
- return res.status(400).json({ error: 'No audio file provided' });
1997
- }
1998
-
1999
- const apiKey = process.env.OPENAI_API_KEY;
2000
- if (!apiKey) {
2001
- return res.status(500).json({ error: 'OpenAI API key not configured. Please set OPENAI_API_KEY in server environment.' });
2002
- }
2003
-
2004
- try {
2005
- // Create form data for OpenAI
2006
- const FormData = (await import('form-data')).default;
2007
- const formData = new FormData();
2008
- formData.append('file', req.file.buffer, {
2009
- filename: req.file.originalname,
2010
- contentType: req.file.mimetype
2011
- });
2012
- formData.append('model', 'whisper-1');
2013
- formData.append('response_format', 'json');
2014
- formData.append('language', 'en');
2015
-
2016
- // Make request to OpenAI
2017
- const response = await fetch('https://api.openai.com/v1/audio/transcriptions', {
2018
- method: 'POST',
2019
- headers: {
2020
- 'Authorization': `Bearer ${apiKey}`,
2021
- ...formData.getHeaders()
2022
- },
2023
- body: formData
2024
- });
2025
-
2026
- if (!response.ok) {
2027
- const errorData = await response.json().catch(() => ({}));
2028
- throw new Error(errorData.error?.message || `Whisper API error: ${response.status}`);
2029
- }
2030
-
2031
- const data = await response.json();
2032
- let transcribedText = data.text || '';
2033
-
2034
- // Check if enhancement mode is enabled
2035
- const mode = req.body.mode || 'default';
2036
-
2037
- // If no transcribed text, return empty
2038
- if (!transcribedText) {
2039
- return res.json({ text: '' });
2040
- }
2041
-
2042
- // If default mode, return transcribed text without enhancement
2043
- if (mode === 'default') {
2044
- return res.json({ text: transcribedText });
2045
- }
2046
-
2047
- // Handle different enhancement modes
2048
- try {
2049
- const OpenAI = (await import('openai')).default;
2050
- const openai = new OpenAI({ apiKey });
2051
-
2052
- let prompt, systemMessage, temperature = 0.7, maxTokens = 800;
2053
-
2054
- switch (mode) {
2055
- case 'prompt':
2056
- systemMessage = 'You are an expert prompt engineer who creates clear, detailed, and effective prompts.';
2057
- prompt = `You are an expert prompt engineer. Transform the following rough instruction into a clear, detailed, and context-aware AI prompt.
2058
-
2059
- Your enhanced prompt should:
2060
- 1. Be specific and unambiguous
2061
- 2. Include relevant context and constraints
2062
- 3. Specify the desired output format
2063
- 4. Use clear, actionable language
2064
- 5. Include examples where helpful
2065
- 6. Consider edge cases and potential ambiguities
2066
-
2067
- Transform this rough instruction into a well-crafted prompt:
2068
- "${transcribedText}"
2069
-
2070
- Enhanced prompt:`;
2071
- break;
2072
-
2073
- case 'vibe':
2074
- case 'instructions':
2075
- case 'architect':
2076
- systemMessage = 'You are a helpful assistant that formats ideas into clear, actionable instructions for AI agents.';
2077
- temperature = 0.5; // Lower temperature for more controlled output
2078
- prompt = `Transform the following idea into clear, well-structured instructions that an AI agent can easily understand and execute.
2079
-
2080
- IMPORTANT RULES:
2081
- - Format as clear, step-by-step instructions
2082
- - Add reasonable implementation details based on common patterns
2083
- - Only include details directly related to what was asked
2084
- - Do NOT add features or functionality not mentioned
2085
- - Keep the original intent and scope intact
2086
- - Use clear, actionable language an agent can follow
2087
-
2088
- Transform this idea into agent-friendly instructions:
2089
- "${transcribedText}"
2090
-
2091
- Agent instructions:`;
2092
- break;
2093
-
2094
- default:
2095
- // No enhancement needed
2096
- break;
2097
- }
2098
-
2099
- // Only make GPT call if we have a prompt
2100
- if (prompt) {
2101
- const completion = await openai.chat.completions.create({
2102
- model: 'gpt-4o-mini',
2103
- messages: [
2104
- { role: 'system', content: systemMessage },
2105
- { role: 'user', content: prompt }
2106
- ],
2107
- temperature: temperature,
2108
- max_tokens: maxTokens
2109
- });
2110
-
2111
- transcribedText = completion.choices[0].message.content || transcribedText;
2112
- }
2113
-
2114
- } catch (gptError) {
2115
- console.error('GPT processing error:', gptError);
2116
- // Fall back to original transcription if GPT fails
2117
- }
2118
-
2119
- res.json({ text: transcribedText });
2120
-
2121
- } catch (error) {
2122
- console.error('Transcription error:', error);
2123
- res.status(500).json({ error: error.message });
2124
- }
2125
- });
2126
- } catch (error) {
2127
- console.error('Endpoint error:', error);
2128
- res.status(500).json({ error: 'Internal server error' });
2129
- }
2130
- });
2131
-
2132
1987
  // Image upload endpoint
2133
1988
  app.post('/api/projects/:projectName/upload-images', authenticateToken, async (req, res) => {
2134
1989
  try {
@@ -2544,7 +2399,7 @@ async function startServer() {
2544
2399
 
2545
2400
  console.log('');
2546
2401
  console.log(c.dim('═'.repeat(63)));
2547
- console.log(` ${c.bright('Claude Code UI Server - Ready')}`);
2402
+ console.log(` ${c.bright('CloudCLI Server - Ready')}`);
2548
2403
  console.log(c.dim('═'.repeat(63)));
2549
2404
  console.log('');
2550
2405
  console.log(`${c.info('[INFO]')} Server URL: ${c.bright('http://' + DISPLAY_HOST + ':' + SERVER_PORT)}`);
@@ -1125,7 +1125,7 @@ router.post('/', validateExternalApiKey, async (req, res) => {
1125
1125
  } else {
1126
1126
  prBody += `Agent task: ${message}`;
1127
1127
  }
1128
- prBody += '\n\n---\n*This pull request was automatically created by Claude Code UI Agent.*';
1128
+ prBody += '\n\n---\n*This pull request was automatically created by CloudCLI.ai Agent.*';
1129
1129
 
1130
1130
  console.log(`📝 PR Title: ${prTitle}`);
1131
1131
 
@@ -125,7 +125,7 @@ function buildPushBody(event) {
125
125
  const message = CODE_MAP[event.code] || 'You have a new notification';
126
126
 
127
127
  return {
128
- title: sessionName || 'Claude Code UI',
128
+ title: sessionName || 'CloudCLI',
129
129
  body: `${providerLabel}: ${message}`,
130
130
  data: {
131
131
  sessionId: event.sessionId || null,