@rigour-labs/cli 2.18.0 → 2.18.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.
@@ -261,6 +261,40 @@ async function setupApiAndLaunch(apiPort, studioPort, eventsPath, cwd, studioPro
261
261
  res.end(e.message);
262
262
  }
263
263
  }
264
+ else if (url.pathname === '/api/agents') {
265
+ try {
266
+ const sessionPath = path.join(cwd, '.rigour/agent-session.json');
267
+ if (await fs.pathExists(sessionPath)) {
268
+ res.writeHead(200, { 'Content-Type': 'application/json' });
269
+ res.end(await fs.readFile(sessionPath, 'utf-8'));
270
+ }
271
+ else {
272
+ res.writeHead(200, { 'Content-Type': 'application/json' });
273
+ res.end(JSON.stringify({ agents: [], status: 'inactive' }));
274
+ }
275
+ }
276
+ catch (e) {
277
+ res.writeHead(500);
278
+ res.end(e.message);
279
+ }
280
+ }
281
+ else if (url.pathname === '/api/checkpoints') {
282
+ try {
283
+ const checkpointPath = path.join(cwd, '.rigour/checkpoint-session.json');
284
+ if (await fs.pathExists(checkpointPath)) {
285
+ res.writeHead(200, { 'Content-Type': 'application/json' });
286
+ res.end(await fs.readFile(checkpointPath, 'utf-8'));
287
+ }
288
+ else {
289
+ res.writeHead(200, { 'Content-Type': 'application/json' });
290
+ res.end(JSON.stringify({ checkpoints: [], status: 'inactive' }));
291
+ }
292
+ }
293
+ catch (e) {
294
+ res.writeHead(500);
295
+ res.end(e.message);
296
+ }
297
+ }
264
298
  else if (url.pathname === '/api/arbitrate' && req.method === 'POST') {
265
299
  let body = '';
266
300
  req.on('data', chunk => body += chunk);
@@ -13,7 +13,16 @@ describe('CLI Smoke Test', () => {
13
13
  vi.spyOn(process, 'exit').mockImplementation(() => { });
14
14
  });
15
15
  afterEach(async () => {
16
- await fs.remove(testDir);
16
+ try {
17
+ const restrictedDir = path.join(testDir, '.restricted');
18
+ if (await fs.pathExists(restrictedDir)) {
19
+ await fs.chmod(restrictedDir, 0o777);
20
+ }
21
+ await fs.remove(testDir);
22
+ }
23
+ catch (e) {
24
+ // Best effort cleanup
25
+ }
17
26
  vi.restoreAllMocks();
18
27
  });
19
28
  it('should respect ignore patterns and avoid EPERM', async () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rigour-labs/cli",
3
- "version": "2.18.0",
3
+ "version": "2.18.1",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "rigour": "dist/cli.js"
@@ -28,7 +28,7 @@
28
28
  "inquirer": "9.2.16",
29
29
  "ora": "^8.0.1",
30
30
  "yaml": "^2.8.2",
31
- "@rigour-labs/core": "2.18.0"
31
+ "@rigour-labs/core": "2.18.1"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@types/fs-extra": "^11.0.4",