@agentrix/cli 0.0.8 → 0.0.10

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/dist/lib.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var _package = require('./logger-CNLPJOjS.cjs');
3
+ var _package = require('./logger-DVI_I2D6.cjs');
4
4
  require('winston');
5
5
  require('chalk');
6
6
  require('node:os');
package/dist/lib.d.cts CHANGED
@@ -67,6 +67,9 @@ declare class Machine implements AgentContext {
67
67
  getInitialCommitHashPath(userId: string, taskId: string): string;
68
68
  readInitialCommitHash(userId: string, taskId: string): Promise<string | null>;
69
69
  writeInitialCommitHash(userId: string, taskId: string, hash: string): Promise<void>;
70
+ getLastSentCommitHashPath(userId: string, taskId: string): string;
71
+ readLastSentCommitHash(userId: string, taskId: string): Promise<string | null>;
72
+ writeLastSentCommitHash(userId: string, taskId: string, hash: string): Promise<void>;
70
73
  writeTaskInput(data: CreateTaskEventData | ResumeTaskEventData): void;
71
74
  readTaskInput(userId: string, taskId: string): (CreateTaskEventData | ResumeTaskEventData);
72
75
  getSecretKey(): Promise<Uint8Array<ArrayBufferLike> | undefined>;
package/dist/lib.d.mts CHANGED
@@ -67,6 +67,9 @@ declare class Machine implements AgentContext {
67
67
  getInitialCommitHashPath(userId: string, taskId: string): string;
68
68
  readInitialCommitHash(userId: string, taskId: string): Promise<string | null>;
69
69
  writeInitialCommitHash(userId: string, taskId: string, hash: string): Promise<void>;
70
+ getLastSentCommitHashPath(userId: string, taskId: string): string;
71
+ readLastSentCommitHash(userId: string, taskId: string): Promise<string | null>;
72
+ writeLastSentCommitHash(userId: string, taskId: string, hash: string): Promise<void>;
70
73
  writeTaskInput(data: CreateTaskEventData | ResumeTaskEventData): void;
71
74
  readTaskInput(userId: string, taskId: string): (CreateTaskEventData | ResumeTaskEventData);
72
75
  getSecretKey(): Promise<Uint8Array<ArrayBufferLike> | undefined>;
package/dist/lib.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { M as Machine, l as logger, m as machine } from './logger-D8V27PkS.mjs';
1
+ export { M as Machine, l as logger, m as machine } from './logger-ChZYRh-E.mjs';
2
2
  import 'winston';
3
3
  import 'chalk';
4
4
  import 'node:os';
@@ -10,7 +10,7 @@ import { dirname, resolve } from 'path';
10
10
  import { fileURLToPath } from 'url';
11
11
 
12
12
  var name = "@agentrix/cli";
13
- var version = "0.0.8";
13
+ var version = "0.0.10";
14
14
  var description = "Mobile and Web client for Claude Code and Codex";
15
15
  var author = "agentrix.xmz.ai";
16
16
  var type = "module";
@@ -93,6 +93,10 @@ var dependencies = {
93
93
  "http-proxy": "^1.18.1",
94
94
  "http-proxy-middleware": "^3.0.5",
95
95
  ink: "^6.1.0",
96
+ "ink-box": "^2.0.0",
97
+ "ink-select-input": "^6.0.0",
98
+ "ink-spinner": "^5.0.0",
99
+ "ink-text-input": "^6.0.0",
96
100
  open: "^10.2.0",
97
101
  "ps-list": "^8.1.1",
98
102
  "qrcode-terminal": "^0.12.0",
@@ -387,6 +391,25 @@ class Machine {
387
391
  const path = this.getInitialCommitHashPath(userId, taskId);
388
392
  await writeFile(path, hash);
389
393
  }
394
+ getLastSentCommitHashPath(userId, taskId) {
395
+ return join(this.resolveDataDir(userId, taskId), "last-sent-commit-hash.txt");
396
+ }
397
+ async readLastSentCommitHash(userId, taskId) {
398
+ const path = this.getLastSentCommitHashPath(userId, taskId);
399
+ if (!existsSync(path)) {
400
+ return null;
401
+ }
402
+ try {
403
+ const content = await readFile(path, "utf-8");
404
+ return content.trim();
405
+ } catch {
406
+ return null;
407
+ }
408
+ }
409
+ async writeLastSentCommitHash(userId, taskId, hash) {
410
+ const path = this.getLastSentCommitHashPath(userId, taskId);
411
+ await writeFile(path, hash);
412
+ }
390
413
  writeTaskInput(data) {
391
414
  const path = this.resolveDataDir(data.userId, data.taskId);
392
415
  const inputFile = join(path, "input.json");
@@ -6,14 +6,14 @@ var os = require('node:os');
6
6
  var node_crypto = require('node:crypto');
7
7
  var fs = require('node:fs');
8
8
  var promises = require('node:fs/promises');
9
- var path = require('node:path');
9
+ var path$1 = require('node:path');
10
10
  var shared = require('@agentrix/shared');
11
- var require$$1 = require('path');
12
- var url = require('url');
11
+ var path = require('path');
12
+ var require$$7 = require('url');
13
13
 
14
14
  var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
15
15
  var name = "@agentrix/cli";
16
- var version = "0.0.8";
16
+ var version = "0.0.10";
17
17
  var description = "Mobile and Web client for Claude Code and Codex";
18
18
  var author = "agentrix.xmz.ai";
19
19
  var type = "module";
@@ -96,6 +96,10 @@ var dependencies = {
96
96
  "http-proxy": "^1.18.1",
97
97
  "http-proxy-middleware": "^3.0.5",
98
98
  ink: "^6.1.0",
99
+ "ink-box": "^2.0.0",
100
+ "ink-select-input": "^6.0.0",
101
+ "ink-spinner": "^5.0.0",
102
+ "ink-text-input": "^6.0.0",
99
103
  open: "^10.2.0",
100
104
  "ps-list": "^8.1.1",
101
105
  "qrcode-terminal": "^0.12.0",
@@ -185,10 +189,10 @@ var _package = /*#__PURE__*/Object.freeze({
185
189
  version: version
186
190
  });
187
191
 
188
- const __dirname$1 = require$$1.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('logger-CNLPJOjS.cjs', document.baseURI).href))));
192
+ const __dirname$1 = path.dirname(require$$7.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('logger-DVI_I2D6.cjs', document.baseURI).href))));
189
193
  function projectPath() {
190
- const path = require$$1.resolve(__dirname$1, "..");
191
- return path;
194
+ const path$1 = path.resolve(__dirname$1, "..");
195
+ return path$1;
192
196
  }
193
197
  class Machine {
194
198
  serverUrl;
@@ -206,9 +210,9 @@ class Machine {
206
210
  this.isDaemonProcess = args[0] === "daemon";
207
211
  this.serverUrl = process.env.AGENTRIX_SERVER_URL || "https://agentrix.xmz.ai";
208
212
  this.webappUrl = process.env.AGENTRIX_WEBAPP_URL || "https://agentrix.xmz.ai";
209
- this.agentrixHomeDir = process.env.AGENTRIX_HOME_DIR ? process.env.AGENTRIX_HOME_DIR.replace(/^~/, os.homedir()) : path.join(os.homedir(), ".agentrix");
210
- this.agentrixWorkspaceHomeDir = process.env.AGENTRIX_WORKSPACE_HOME_DIR ? process.env.AGENTRIX_WORKSPACE_HOME_DIR.replace(/^~/, os.homedir()) : path.join(this.agentrixHomeDir, "workspaces");
211
- this.agentrixAgentsHomeDir = process.env.AGENTRIX_AGENTS_HOME_DIR ? process.env.AGENTRIX_AGENTS_HOME_DIR.replace(/^~/, os.homedir()) : path.join(this.agentrixHomeDir, "agents");
213
+ this.agentrixHomeDir = process.env.AGENTRIX_HOME_DIR ? process.env.AGENTRIX_HOME_DIR.replace(/^~/, os.homedir()) : path$1.join(os.homedir(), ".agentrix");
214
+ this.agentrixWorkspaceHomeDir = process.env.AGENTRIX_WORKSPACE_HOME_DIR ? process.env.AGENTRIX_WORKSPACE_HOME_DIR.replace(/^~/, os.homedir()) : path$1.join(this.agentrixHomeDir, "workspaces");
215
+ this.agentrixAgentsHomeDir = process.env.AGENTRIX_AGENTS_HOME_DIR ? process.env.AGENTRIX_AGENTS_HOME_DIR.replace(/^~/, os.homedir()) : path$1.join(this.agentrixHomeDir, "agents");
212
216
  this.disableCaffeinate = ["true", "1", "yes"].includes(
213
217
  (process.env.AGENTRIX_DISABLE_CAFFEINATE ?? "").toLowerCase()
214
218
  );
@@ -218,11 +222,11 @@ class Machine {
218
222
  this.ensureDir(this.agentrixAgentsHomeDir);
219
223
  this.statePaths = {
220
224
  rootDir: this.agentrixHomeDir,
221
- logsDir: this.ensureDir(path.join(this.agentrixHomeDir, "logs")),
222
- settingsFile: path.join(this.agentrixHomeDir, "settings.json"),
223
- credentialsFile: path.join(this.agentrixHomeDir, "credentials.json"),
224
- daemonStateFile: path.join(this.agentrixHomeDir, "daemon.state.json"),
225
- daemonLockFile: path.join(this.agentrixHomeDir, "daemon.state.json.lock")
225
+ logsDir: this.ensureDir(path$1.join(this.agentrixHomeDir, "logs")),
226
+ settingsFile: path$1.join(this.agentrixHomeDir, "settings.json"),
227
+ credentialsFile: path$1.join(this.agentrixHomeDir, "credentials.json"),
228
+ daemonStateFile: path$1.join(this.agentrixHomeDir, "daemon.state.json"),
229
+ daemonLockFile: path$1.join(this.agentrixHomeDir, "daemon.state.json.lock")
226
230
  };
227
231
  }
228
232
  generateMachineId() {
@@ -357,22 +361,22 @@ class Machine {
357
361
  if (cwd) {
358
362
  return this.ensureDir(cwd.replace(/^~/, os.homedir()));
359
363
  }
360
- const workspaceDir = path.join(this.agentrixWorkspaceHomeDir, "users", userId, taskId, "project");
364
+ const workspaceDir = path$1.join(this.agentrixWorkspaceHomeDir, "users", userId, taskId, "project");
361
365
  return this.ensureDir(workspaceDir);
362
366
  }
363
367
  resolveDataDir(userId, taskId) {
364
- const dataDir = path.join(this.agentrixWorkspaceHomeDir, "users", userId, taskId, "data");
368
+ const dataDir = path$1.join(this.agentrixWorkspaceHomeDir, "users", userId, taskId, "data");
365
369
  return this.ensureDir(dataDir);
366
370
  }
367
371
  resolveAttachmentsDir(userId, taskId) {
368
- const attachmentsDir = path.join(this.resolveDataDir(userId, taskId), "attachments");
372
+ const attachmentsDir = path$1.join(this.resolveDataDir(userId, taskId), "attachments");
369
373
  return this.ensureDir(attachmentsDir);
370
374
  }
371
375
  resolveAgentDir(agentId) {
372
- return path.join(this.agentrixAgentsHomeDir, agentId);
376
+ return path$1.join(this.agentrixAgentsHomeDir, agentId);
373
377
  }
374
378
  getInitialCommitHashPath(userId, taskId) {
375
- return path.join(this.resolveDataDir(userId, taskId), "initial-commit-hash.txt");
379
+ return path$1.join(this.resolveDataDir(userId, taskId), "initial-commit-hash.txt");
376
380
  }
377
381
  async readInitialCommitHash(userId, taskId) {
378
382
  const path = this.getInitialCommitHashPath(userId, taskId);
@@ -390,14 +394,33 @@ class Machine {
390
394
  const path = this.getInitialCommitHashPath(userId, taskId);
391
395
  await promises.writeFile(path, hash);
392
396
  }
397
+ getLastSentCommitHashPath(userId, taskId) {
398
+ return path$1.join(this.resolveDataDir(userId, taskId), "last-sent-commit-hash.txt");
399
+ }
400
+ async readLastSentCommitHash(userId, taskId) {
401
+ const path = this.getLastSentCommitHashPath(userId, taskId);
402
+ if (!fs.existsSync(path)) {
403
+ return null;
404
+ }
405
+ try {
406
+ const content = await promises.readFile(path, "utf-8");
407
+ return content.trim();
408
+ } catch {
409
+ return null;
410
+ }
411
+ }
412
+ async writeLastSentCommitHash(userId, taskId, hash) {
413
+ const path = this.getLastSentCommitHashPath(userId, taskId);
414
+ await promises.writeFile(path, hash);
415
+ }
393
416
  writeTaskInput(data) {
394
- const path$1 = this.resolveDataDir(data.userId, data.taskId);
395
- const inputFile = path.join(path$1, "input.json");
417
+ const path = this.resolveDataDir(data.userId, data.taskId);
418
+ const inputFile = path$1.join(path, "input.json");
396
419
  fs.writeFileSync(inputFile, JSON.stringify(data, null, 2));
397
420
  }
398
421
  readTaskInput(userId, taskId) {
399
- const path$1 = this.resolveDataDir(userId, taskId);
400
- const inputFile = path.join(path$1, "input.json");
422
+ const path = this.resolveDataDir(userId, taskId);
423
+ const inputFile = path$1.join(path, "input.json");
401
424
  if (!fs.existsSync(inputFile)) {
402
425
  throw new Error(`Task input file does not exist: ${inputFile}`);
403
426
  }
@@ -503,7 +526,7 @@ function getLogPath(context) {
503
526
  return "";
504
527
  }
505
528
  const filename = context.type === "daemon" ? "daemon.log" : `task-${context.taskId}.log`;
506
- return path.join(logsDir, filename);
529
+ return path$1.join(logsDir, filename);
507
530
  }
508
531
 
509
532
  var logger$1 = /*#__PURE__*/Object.freeze({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentrix/cli",
3
- "version": "0.0.8",
3
+ "version": "0.0.10",
4
4
  "description": "Mobile and Web client for Claude Code and Codex",
5
5
  "author": "agentrix.xmz.ai",
6
6
  "type": "module",
@@ -83,6 +83,10 @@
83
83
  "http-proxy": "^1.18.1",
84
84
  "http-proxy-middleware": "^3.0.5",
85
85
  "ink": "^6.1.0",
86
+ "ink-box": "^2.0.0",
87
+ "ink-select-input": "^6.0.0",
88
+ "ink-spinner": "^5.0.0",
89
+ "ink-text-input": "^6.0.0",
86
90
  "open": "^10.2.0",
87
91
  "ps-list": "^8.1.1",
88
92
  "qrcode-terminal": "^0.12.0",