This repository has no description
1// SPDX-License-Identifier: MIT
2// Copyright (c) 2026 sol pbc
3
4import { describe, test, expect } from 'bun:test';
5import { run } from './helpers.js';
6import { mkdirSync, rmSync } from 'node:fs';
7import { tmpdir } from 'node:os';
8import { join } from 'node:path';
9
10const agentEnv = { CLAUDECODE: '1' };
11
12describe('vit skim --skills', () => {
13 test('still requires beacon in default mode', () => {
14 const result = run('skim --did did:plc:test123', '/tmp', agentEnv);
15 expect(result.exitCode).not.toBe(0);
16 expect(result.stderr).toContain('no beacon set');
17 });
18
19 test('still requires beacon with --caps flag', () => {
20 const result = run('skim --caps --did did:plc:test123', '/tmp', agentEnv);
21 expect(result.exitCode).not.toBe(0);
22 expect(result.stderr).toContain('no beacon set');
23 });
24
25 test('does NOT require beacon with --skills flag', () => {
26 const configHome = join(tmpdir(), '.test-skim-skills-' + Math.random().toString(36).slice(2));
27 mkdirSync(configHome, { recursive: true });
28 const result = run('skim --skills --did did:plc:test123', '/tmp', { ...agentEnv, XDG_CONFIG_HOME: configHome });
29 expect(result.exitCode).not.toBe(0);
30 // Should fail at auth, not at beacon check
31 expect(result.stderr).not.toContain('no beacon set');
32 rmSync(configHome, { recursive: true, force: true });
33 });
34
35 test('shows help mentioning --skills and --caps', () => {
36 const result = run('skim --help');
37 expect(result.stdout).toContain('--skills');
38 expect(result.stdout).toContain('--caps');
39 });
40});