@soleri/cli 9.15.0 → 9.16.7
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/commands/add-domain.js +65 -0
- package/dist/commands/add-domain.js.map +1 -1
- package/dist/commands/chat.d.ts +11 -0
- package/dist/commands/chat.js +295 -0
- package/dist/commands/chat.js.map +1 -0
- package/dist/commands/create.js +11 -9
- package/dist/commands/create.js.map +1 -1
- package/dist/commands/dev.js +19 -0
- package/dist/commands/dev.js.map +1 -1
- package/dist/commands/hooks.js +29 -0
- package/dist/commands/hooks.js.map +1 -1
- package/dist/commands/knowledge.d.ts +9 -0
- package/dist/commands/knowledge.js +99 -0
- package/dist/commands/knowledge.js.map +1 -0
- package/dist/commands/pack.js +164 -3
- package/dist/commands/pack.js.map +1 -1
- package/dist/commands/schedule.d.ts +11 -0
- package/dist/commands/schedule.js +130 -0
- package/dist/commands/schedule.js.map +1 -0
- package/dist/commands/staging.d.ts +2 -17
- package/dist/commands/staging.js +4 -4
- package/dist/commands/staging.js.map +1 -1
- package/dist/main.js +6 -0
- package/dist/main.js.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/hook-packs.test.ts +0 -18
- package/src/__tests__/hooks-convert.test.ts +0 -28
- package/src/__tests__/hooks-sync.test.ts +109 -0
- package/src/__tests__/hooks.test.ts +0 -20
- package/src/__tests__/update.test.ts +0 -19
- package/src/__tests__/validator.test.ts +0 -16
- package/src/commands/add-domain.ts +89 -1
- package/src/commands/chat.ts +373 -0
- package/src/commands/create.ts +11 -8
- package/src/commands/dev.ts +21 -0
- package/src/commands/hooks.ts +32 -0
- package/src/commands/knowledge.ts +124 -0
- package/src/commands/pack.ts +219 -1
- package/src/commands/schedule.ts +150 -0
- package/src/commands/staging.ts +5 -5
- package/src/main.ts +6 -0
- package/src/__tests__/dream.test.ts +0 -119
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect, vi, beforeEach } from 'vitest';
|
|
2
|
-
import { Command } from 'commander';
|
|
3
|
-
|
|
4
|
-
// Mock @soleri/core before importing the command
|
|
5
|
-
vi.mock('@soleri/core', () => {
|
|
6
|
-
const mockDreamEngine = {
|
|
7
|
-
run: vi.fn().mockReturnValue({
|
|
8
|
-
durationMs: 1234,
|
|
9
|
-
duplicatesFound: 3,
|
|
10
|
-
staleArchived: 2,
|
|
11
|
-
contradictionsFound: 1,
|
|
12
|
-
totalDreams: 5,
|
|
13
|
-
timestamp: '2026-03-31T00:00:00.000Z',
|
|
14
|
-
}),
|
|
15
|
-
getStatus: vi.fn().mockReturnValue({
|
|
16
|
-
sessionsSinceLastDream: 7,
|
|
17
|
-
lastDreamAt: '2026-03-30T22:00:00.000Z',
|
|
18
|
-
lastDreamDurationMs: 1234,
|
|
19
|
-
totalDreams: 4,
|
|
20
|
-
gateEligible: true,
|
|
21
|
-
}),
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
return {
|
|
25
|
-
DreamEngine: vi.fn().mockImplementation(() => mockDreamEngine),
|
|
26
|
-
Vault: vi.fn().mockImplementation(() => ({
|
|
27
|
-
getProvider: vi.fn().mockReturnValue({}),
|
|
28
|
-
close: vi.fn(),
|
|
29
|
-
})),
|
|
30
|
-
Curator: vi.fn().mockImplementation(() => ({})),
|
|
31
|
-
SOLERI_HOME: '/tmp/soleri-test',
|
|
32
|
-
getSchedule: vi.fn().mockReturnValue({
|
|
33
|
-
isScheduled: true,
|
|
34
|
-
time: '22:00',
|
|
35
|
-
logPath: '/tmp/soleri-test/dream-cron.log',
|
|
36
|
-
projectDir: '/tmp/project',
|
|
37
|
-
}),
|
|
38
|
-
schedule: vi.fn().mockReturnValue({
|
|
39
|
-
isScheduled: true,
|
|
40
|
-
time: '22:03',
|
|
41
|
-
logPath: '/tmp/soleri-test/dream-cron.log',
|
|
42
|
-
projectDir: '/tmp/project',
|
|
43
|
-
}),
|
|
44
|
-
unschedule: vi.fn().mockReturnValue({
|
|
45
|
-
isScheduled: false,
|
|
46
|
-
time: null,
|
|
47
|
-
logPath: null,
|
|
48
|
-
projectDir: null,
|
|
49
|
-
}),
|
|
50
|
-
};
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
describe('dream command', () => {
|
|
54
|
-
let program: Command;
|
|
55
|
-
|
|
56
|
-
beforeEach(() => {
|
|
57
|
-
vi.clearAllMocks();
|
|
58
|
-
program = new Command();
|
|
59
|
-
program.exitOverride(); // Prevent process.exit in tests
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
it('should register dream command with subcommands', async () => {
|
|
63
|
-
const { registerDream } = await import('../commands/dream.js');
|
|
64
|
-
registerDream(program);
|
|
65
|
-
|
|
66
|
-
const dreamCmd = program.commands.find((c) => c.name() === 'dream');
|
|
67
|
-
expect(dreamCmd).toBeDefined();
|
|
68
|
-
expect(dreamCmd!.description()).toBeTruthy();
|
|
69
|
-
|
|
70
|
-
// Check subcommands exist
|
|
71
|
-
const subNames = dreamCmd!.commands.map((c) => c.name());
|
|
72
|
-
expect(subNames).toContain('schedule');
|
|
73
|
-
expect(subNames).toContain('unschedule');
|
|
74
|
-
expect(subNames).toContain('status');
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
it('should have schedule subcommand with --time option', async () => {
|
|
78
|
-
const { registerDream } = await import('../commands/dream.js');
|
|
79
|
-
registerDream(program);
|
|
80
|
-
|
|
81
|
-
const dreamCmd = program.commands.find((c) => c.name() === 'dream');
|
|
82
|
-
const scheduleCmd = dreamCmd!.commands.find((c) => c.name() === 'schedule');
|
|
83
|
-
expect(scheduleCmd).toBeDefined();
|
|
84
|
-
|
|
85
|
-
// Verify --time option is registered
|
|
86
|
-
const timeOption = scheduleCmd!.options.find((o) => o.long === '--time' || o.short === '-t');
|
|
87
|
-
expect(timeOption).toBeDefined();
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
it('should register status subcommand', async () => {
|
|
91
|
-
const { registerDream } = await import('../commands/dream.js');
|
|
92
|
-
registerDream(program);
|
|
93
|
-
|
|
94
|
-
const dreamCmd = program.commands.find((c) => c.name() === 'dream');
|
|
95
|
-
const statusCmd = dreamCmd!.commands.find((c) => c.name() === 'status');
|
|
96
|
-
expect(statusCmd).toBeDefined();
|
|
97
|
-
expect(statusCmd!.description()).toBeTruthy();
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
it('should register unschedule subcommand', async () => {
|
|
101
|
-
const { registerDream } = await import('../commands/dream.js');
|
|
102
|
-
registerDream(program);
|
|
103
|
-
|
|
104
|
-
const dreamCmd = program.commands.find((c) => c.name() === 'dream');
|
|
105
|
-
const unscheduleCmd = dreamCmd!.commands.find((c) => c.name() === 'unschedule');
|
|
106
|
-
expect(unscheduleCmd).toBeDefined();
|
|
107
|
-
expect(unscheduleCmd!.description()).toBeTruthy();
|
|
108
|
-
});
|
|
109
|
-
|
|
110
|
-
it('should have dream as parent command with its own action', async () => {
|
|
111
|
-
const { registerDream } = await import('../commands/dream.js');
|
|
112
|
-
registerDream(program);
|
|
113
|
-
|
|
114
|
-
const dreamCmd = program.commands.find((c) => c.name() === 'dream');
|
|
115
|
-
expect(dreamCmd).toBeDefined();
|
|
116
|
-
// The parent dream command should have a description indicating it runs consolidation
|
|
117
|
-
expect(dreamCmd!.description()).toMatch(/dream|consolidat|memory/i);
|
|
118
|
-
});
|
|
119
|
-
});
|