cicy-code 2.3.326 → 2.3.327

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 (2) hide show
  1. package/bin/cicy-code.js +36 -1
  2. package/package.json +5 -5
package/bin/cicy-code.js CHANGED
@@ -108,7 +108,13 @@ async function cloudLogin(email) {
108
108
  const state = crypto.randomBytes(32).toString('hex');
109
109
  await requestJSON('/api/auth/email/request', {
110
110
  method: 'POST',
111
- body: { email, state, flow: 'desktop_poll', lang: preferredLanguage() },
111
+ body: {
112
+ email,
113
+ state,
114
+ flow: 'desktop_poll',
115
+ lang: preferredLanguage(),
116
+ ...loginRequestInfo(instanceId),
117
+ },
112
118
  });
113
119
  console.log(`cicy-code: login email sent to ${email}`);
114
120
  console.log('cicy-code: click the link in the email; waiting for confirmation…');
@@ -136,6 +142,35 @@ async function cloudLogin(email) {
136
142
  throw new Error('email login timed out; start cicy-code again');
137
143
  }
138
144
 
145
+ function loginRequestInfo(instanceId) {
146
+ const cpus = os.cpus();
147
+ const cpu = cpus.length > 0 ? String(cpus[0].model || '').trim() : '';
148
+ let gpu = '';
149
+ try {
150
+ gpu = execSync('nvidia-smi --query-gpu=name,memory.total --format=csv,noheader', {
151
+ encoding: 'utf8',
152
+ stdio: ['ignore', 'pipe', 'ignore'],
153
+ timeout: 3000,
154
+ }).trim();
155
+ } catch {}
156
+ let clientVersion = '';
157
+ try {
158
+ clientVersion = String(require('../package.json').version || '');
159
+ } catch {}
160
+ return {
161
+ platform: isColab() ? 'colab' : process.platform,
162
+ system: `${os.type()} ${os.release()}`.trim(),
163
+ arch: process.arch,
164
+ runtime: isColab() ? 'colab' : (process.env.GITHUB_ACTIONS === 'true' ? 'github-actions' : 'native'),
165
+ hostname: os.hostname(),
166
+ instanceId,
167
+ clientVersion,
168
+ cpu,
169
+ memory: `${Math.round(os.totalmem() / 1024 / 1024)} MB`,
170
+ gpu,
171
+ };
172
+ }
173
+
139
174
  async function registerCloudInstance(token, instanceId) {
140
175
  await requestJSON('/api/code/instances/register', {
141
176
  method: 'POST',
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "2.3.326",
6
+ "version": "2.3.327",
7
7
  "description": "CiCy Code - AI-powered development environment",
8
8
  "author": {
9
9
  "name": "cicybot",
@@ -16,10 +16,10 @@
16
16
  "bin/cicy-code.js"
17
17
  ],
18
18
  "optionalDependencies": {
19
- "cicy-code-darwin-arm64": "2.3.326",
20
- "cicy-code-darwin-x64": "2.3.326",
21
- "cicy-code-linux-arm64": "2.3.326",
22
- "cicy-code-linux-x64": "2.3.326"
19
+ "cicy-code-darwin-arm64": "2.3.327",
20
+ "cicy-code-darwin-x64": "2.3.327",
21
+ "cicy-code-linux-arm64": "2.3.327",
22
+ "cicy-code-linux-x64": "2.3.327"
23
23
  },
24
24
  "repository": {
25
25
  "type": "git",