anvil-dev-framework 0.1.6
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/README.md +719 -0
- package/VERSION +1 -0
- package/docs/ANVIL-REPO-IMPLEMENTATION-PLAN.md +441 -0
- package/docs/FIRST-SKILL-TUTORIAL.md +408 -0
- package/docs/INSTALLATION-RETRO-NOTES.md +458 -0
- package/docs/INSTALLATION.md +984 -0
- package/docs/anvil-hud.md +469 -0
- package/docs/anvil-init.md +255 -0
- package/docs/anvil-state.md +210 -0
- package/docs/boris-cherny-ralph-wiggum-insights.md +608 -0
- package/docs/command-reference.md +2022 -0
- package/docs/hooks-tts.md +368 -0
- package/docs/implementation-guide.md +810 -0
- package/docs/linear-github-integration.md +247 -0
- package/docs/local-issues.md +677 -0
- package/docs/patterns/README.md +419 -0
- package/docs/planning-responsibilities.md +139 -0
- package/docs/session-workflow.md +573 -0
- package/docs/simplification-plan-template.md +297 -0
- package/docs/simplification-principles.md +129 -0
- package/docs/specifications/CCS-RALPH-INTEGRATION-DESIGN.md +633 -0
- package/docs/specifications/CCS-RESEARCH-REPORT.md +169 -0
- package/docs/specifications/PLAN-ANV-verification-ralph-wiggum.md +403 -0
- package/docs/specifications/PLAN-parallel-tracks-anvil-memory-ccs.md +494 -0
- package/docs/specifications/SPEC-ANV-VRW/component-01-verify.md +208 -0
- package/docs/specifications/SPEC-ANV-VRW/component-02-stop-gate.md +226 -0
- package/docs/specifications/SPEC-ANV-VRW/component-03-posttooluse.md +209 -0
- package/docs/specifications/SPEC-ANV-VRW/component-04-ralph-wiggum.md +604 -0
- package/docs/specifications/SPEC-ANV-VRW/component-05-atomic-actions.md +311 -0
- package/docs/specifications/SPEC-ANV-VRW/component-06-verify-subagent.md +264 -0
- package/docs/specifications/SPEC-ANV-VRW/component-07-claude-md.md +363 -0
- package/docs/specifications/SPEC-ANV-VRW/index.md +182 -0
- package/docs/specifications/SPEC-ANV-anvil-memory.md +573 -0
- package/docs/specifications/SPEC-ANV-context-checkpoints.md +781 -0
- package/docs/specifications/SPEC-ANV-verification-ralph-wiggum.md +789 -0
- package/docs/sync.md +122 -0
- package/global/CLAUDE.md +140 -0
- package/global/agents/verify-app.md +164 -0
- package/global/commands/anvil-settings.md +527 -0
- package/global/commands/anvil-sync.md +121 -0
- package/global/commands/change.md +197 -0
- package/global/commands/clarify.md +252 -0
- package/global/commands/cleanup.md +292 -0
- package/global/commands/commit-push-pr.md +207 -0
- package/global/commands/decay-review.md +127 -0
- package/global/commands/discover.md +158 -0
- package/global/commands/doc-coverage.md +122 -0
- package/global/commands/evidence.md +307 -0
- package/global/commands/explore.md +121 -0
- package/global/commands/force-exit.md +135 -0
- package/global/commands/handoff.md +191 -0
- package/global/commands/healthcheck.md +302 -0
- package/global/commands/hud.md +84 -0
- package/global/commands/insights.md +319 -0
- package/global/commands/linear-setup.md +184 -0
- package/global/commands/lint-fix.md +198 -0
- package/global/commands/orient.md +510 -0
- package/global/commands/plan.md +228 -0
- package/global/commands/ralph.md +346 -0
- package/global/commands/ready.md +182 -0
- package/global/commands/release.md +305 -0
- package/global/commands/retro.md +96 -0
- package/global/commands/shard.md +166 -0
- package/global/commands/spec.md +227 -0
- package/global/commands/sprint.md +184 -0
- package/global/commands/tasks.md +228 -0
- package/global/commands/test-and-commit.md +151 -0
- package/global/commands/validate.md +132 -0
- package/global/commands/verify.md +251 -0
- package/global/commands/weekly-review.md +156 -0
- package/global/hooks/__pycache__/ralph_context_monitor.cpython-314.pyc +0 -0
- package/global/hooks/__pycache__/statusline_agent_sync.cpython-314.pyc +0 -0
- package/global/hooks/anvil_memory_observe.ts +322 -0
- package/global/hooks/anvil_memory_session.ts +166 -0
- package/global/hooks/anvil_memory_stop.ts +187 -0
- package/global/hooks/parse_transcript.py +116 -0
- package/global/hooks/post_merge_cleanup.sh +132 -0
- package/global/hooks/post_tool_format.sh +215 -0
- package/global/hooks/ralph_context_monitor.py +240 -0
- package/global/hooks/ralph_stop.sh +502 -0
- package/global/hooks/statusline.sh +1110 -0
- package/global/hooks/statusline_agent_sync.py +224 -0
- package/global/hooks/stop_gate.sh +250 -0
- package/global/lib/.claude/anvil-state.json +21 -0
- package/global/lib/__pycache__/agent_registry.cpython-314.pyc +0 -0
- package/global/lib/__pycache__/claim_service.cpython-314.pyc +0 -0
- package/global/lib/__pycache__/coderabbit_service.cpython-314.pyc +0 -0
- package/global/lib/__pycache__/config_service.cpython-314.pyc +0 -0
- package/global/lib/__pycache__/coordination_service.cpython-314.pyc +0 -0
- package/global/lib/__pycache__/doc_coverage_service.cpython-314.pyc +0 -0
- package/global/lib/__pycache__/gate_logger.cpython-314.pyc +0 -0
- package/global/lib/__pycache__/github_service.cpython-314.pyc +0 -0
- package/global/lib/__pycache__/hygiene_service.cpython-314.pyc +0 -0
- package/global/lib/__pycache__/issue_models.cpython-314.pyc +0 -0
- package/global/lib/__pycache__/issue_provider.cpython-314.pyc +0 -0
- package/global/lib/__pycache__/linear_data_service.cpython-314.pyc +0 -0
- package/global/lib/__pycache__/linear_provider.cpython-314.pyc +0 -0
- package/global/lib/__pycache__/local_provider.cpython-314.pyc +0 -0
- package/global/lib/__pycache__/quality_service.cpython-314.pyc +0 -0
- package/global/lib/__pycache__/ralph_state.cpython-314.pyc +0 -0
- package/global/lib/__pycache__/state_manager.cpython-314.pyc +0 -0
- package/global/lib/__pycache__/transcript_parser.cpython-314.pyc +0 -0
- package/global/lib/__pycache__/verification_runner.cpython-314.pyc +0 -0
- package/global/lib/__pycache__/verify_iteration.cpython-314.pyc +0 -0
- package/global/lib/__pycache__/verify_subagent.cpython-314.pyc +0 -0
- package/global/lib/agent_registry.py +995 -0
- package/global/lib/anvil-state.sh +435 -0
- package/global/lib/claim_service.py +515 -0
- package/global/lib/coderabbit_service.py +314 -0
- package/global/lib/config_service.py +423 -0
- package/global/lib/coordination_service.py +331 -0
- package/global/lib/doc_coverage_service.py +1305 -0
- package/global/lib/gate_logger.py +316 -0
- package/global/lib/github_service.py +310 -0
- package/global/lib/handoff_generator.py +775 -0
- package/global/lib/hygiene_service.py +712 -0
- package/global/lib/issue_models.py +257 -0
- package/global/lib/issue_provider.py +339 -0
- package/global/lib/linear_data_service.py +210 -0
- package/global/lib/linear_provider.py +987 -0
- package/global/lib/linear_provider.py.backup +671 -0
- package/global/lib/local_provider.py +486 -0
- package/global/lib/orient_fast.py +457 -0
- package/global/lib/quality_service.py +470 -0
- package/global/lib/ralph_prompt_generator.py +563 -0
- package/global/lib/ralph_state.py +1202 -0
- package/global/lib/state_manager.py +417 -0
- package/global/lib/transcript_parser.py +597 -0
- package/global/lib/verification_runner.py +557 -0
- package/global/lib/verify_iteration.py +490 -0
- package/global/lib/verify_subagent.py +250 -0
- package/global/skills/README.md +155 -0
- package/global/skills/quality-gates/SKILL.md +252 -0
- package/global/skills/skill-template/SKILL.md +109 -0
- package/global/skills/testing-strategies/SKILL.md +337 -0
- package/global/templates/CHANGE-template.md +105 -0
- package/global/templates/HANDOFF-template.md +63 -0
- package/global/templates/PLAN-template.md +111 -0
- package/global/templates/SPEC-template.md +93 -0
- package/global/templates/ralph/PROMPT.md.template +89 -0
- package/global/templates/ralph/fix_plan.md.template +31 -0
- package/global/templates/ralph/progress.txt.template +23 -0
- package/global/tests/__pycache__/test_doc_coverage.cpython-314.pyc +0 -0
- package/global/tests/test_doc_coverage.py +520 -0
- package/global/tests/test_issue_models.py +299 -0
- package/global/tests/test_local_provider.py +323 -0
- package/global/tools/README.md +178 -0
- package/global/tools/__pycache__/anvil-hud.cpython-314.pyc +0 -0
- package/global/tools/anvil-hud.py +3622 -0
- package/global/tools/anvil-hud.py.bak +3318 -0
- package/global/tools/anvil-issue.py +432 -0
- package/global/tools/anvil-memory/CLAUDE.md +49 -0
- package/global/tools/anvil-memory/README.md +42 -0
- package/global/tools/anvil-memory/bun.lock +25 -0
- package/global/tools/anvil-memory/bunfig.toml +9 -0
- package/global/tools/anvil-memory/package.json +23 -0
- package/global/tools/anvil-memory/src/__tests__/ccs/context-monitor.test.ts +535 -0
- package/global/tools/anvil-memory/src/__tests__/ccs/edge-cases.test.ts +645 -0
- package/global/tools/anvil-memory/src/__tests__/ccs/fixtures.ts +363 -0
- package/global/tools/anvil-memory/src/__tests__/ccs/index.ts +8 -0
- package/global/tools/anvil-memory/src/__tests__/ccs/integration.test.ts +417 -0
- package/global/tools/anvil-memory/src/__tests__/ccs/prompt-generator.test.ts +571 -0
- package/global/tools/anvil-memory/src/__tests__/ccs/ralph-stop.test.ts +440 -0
- package/global/tools/anvil-memory/src/__tests__/ccs/test-utils.ts +252 -0
- package/global/tools/anvil-memory/src/__tests__/commands.test.ts +657 -0
- package/global/tools/anvil-memory/src/__tests__/db.test.ts +641 -0
- package/global/tools/anvil-memory/src/__tests__/hooks.test.ts +272 -0
- package/global/tools/anvil-memory/src/__tests__/performance.test.ts +427 -0
- package/global/tools/anvil-memory/src/__tests__/test-utils.ts +113 -0
- package/global/tools/anvil-memory/src/commands/checkpoint.ts +197 -0
- package/global/tools/anvil-memory/src/commands/get.ts +115 -0
- package/global/tools/anvil-memory/src/commands/init.ts +94 -0
- package/global/tools/anvil-memory/src/commands/observe.ts +163 -0
- package/global/tools/anvil-memory/src/commands/search.ts +112 -0
- package/global/tools/anvil-memory/src/db.ts +638 -0
- package/global/tools/anvil-memory/src/index.ts +205 -0
- package/global/tools/anvil-memory/src/types.ts +122 -0
- package/global/tools/anvil-memory/tsconfig.json +29 -0
- package/global/tools/ralph-loop.sh +359 -0
- package/package.json +45 -0
- package/scripts/anvil +822 -0
- package/scripts/extract_patterns.py +222 -0
- package/scripts/init-project.sh +541 -0
- package/scripts/install.sh +229 -0
- package/scripts/postinstall.js +41 -0
- package/scripts/rollback.sh +188 -0
- package/scripts/sync.sh +623 -0
- package/scripts/test-statusline.sh +248 -0
- package/scripts/update_claude_md.py +224 -0
- package/scripts/verify.sh +255 -0
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
/**
|
|
3
|
+
* Anvil Memory CLI
|
|
4
|
+
*
|
|
5
|
+
* Persistent memory system for the Anvil framework.
|
|
6
|
+
*
|
|
7
|
+
* Commands:
|
|
8
|
+
* init Initialize the memory database
|
|
9
|
+
* observe Create a new observation
|
|
10
|
+
* search Search observations with FTS5
|
|
11
|
+
* get Fetch observation by ID
|
|
12
|
+
* context Generate session context
|
|
13
|
+
* timeline Query events around an anchor
|
|
14
|
+
* checkpoint Record a CCS checkpoint
|
|
15
|
+
* ralph-iteration Record a Ralph iteration
|
|
16
|
+
*
|
|
17
|
+
* Usage:
|
|
18
|
+
* anvil-memory init [--path <path>]
|
|
19
|
+
* anvil-memory observe --type <type> --title <title> [--content <content>]
|
|
20
|
+
* anvil-memory search <query> [--limit <n>] [--type <type>]
|
|
21
|
+
* anvil-memory get <id>
|
|
22
|
+
* anvil-memory context [--limit <n>] [--format <format>]
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
import { parseArgs } from 'util';
|
|
26
|
+
import type { CommandResult } from './types.ts';
|
|
27
|
+
import { handleInit } from './commands/init.ts';
|
|
28
|
+
import { handleObserve } from './commands/observe.ts';
|
|
29
|
+
import { handleSearch } from './commands/search.ts';
|
|
30
|
+
import { handleGet } from './commands/get.ts';
|
|
31
|
+
import { handleCheckpoint } from './commands/checkpoint.ts';
|
|
32
|
+
|
|
33
|
+
const VERSION = '0.1.0';
|
|
34
|
+
|
|
35
|
+
// Available commands
|
|
36
|
+
const COMMANDS = [
|
|
37
|
+
'init',
|
|
38
|
+
'observe',
|
|
39
|
+
'search',
|
|
40
|
+
'get',
|
|
41
|
+
'context',
|
|
42
|
+
'timeline',
|
|
43
|
+
'checkpoint',
|
|
44
|
+
'ralph-iteration',
|
|
45
|
+
'help',
|
|
46
|
+
'version',
|
|
47
|
+
] as const;
|
|
48
|
+
|
|
49
|
+
type Command = (typeof COMMANDS)[number];
|
|
50
|
+
|
|
51
|
+
function printHelp(): void {
|
|
52
|
+
console.log(`
|
|
53
|
+
anvil-memory v${VERSION}
|
|
54
|
+
Persistent memory system for the Anvil framework.
|
|
55
|
+
|
|
56
|
+
USAGE:
|
|
57
|
+
anvil-memory <command> [options]
|
|
58
|
+
|
|
59
|
+
COMMANDS:
|
|
60
|
+
init Initialize the memory database
|
|
61
|
+
observe Create a new observation
|
|
62
|
+
search <query> Search observations with full-text search
|
|
63
|
+
get <id> Fetch observation by ID
|
|
64
|
+
context Generate session context
|
|
65
|
+
timeline Query events around an anchor
|
|
66
|
+
checkpoint Record a CCS checkpoint
|
|
67
|
+
ralph-iteration Record a Ralph iteration
|
|
68
|
+
help Show this help message
|
|
69
|
+
version Show version
|
|
70
|
+
|
|
71
|
+
OPTIONS:
|
|
72
|
+
--help, -h Show help for a command
|
|
73
|
+
--json Output in JSON format
|
|
74
|
+
--path <path> Database path (default: ~/.anvil/memory.db)
|
|
75
|
+
|
|
76
|
+
EXAMPLES:
|
|
77
|
+
anvil-memory init
|
|
78
|
+
anvil-memory observe --type feature --title "Added auth" --content "Details..."
|
|
79
|
+
anvil-memory search "authentication" --limit 10
|
|
80
|
+
anvil-memory get 42
|
|
81
|
+
anvil-memory context --limit 20 --format inject
|
|
82
|
+
|
|
83
|
+
For more information, see: docs/guides/anvil-memory.md
|
|
84
|
+
`);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function printVersion(): void {
|
|
88
|
+
console.log(`anvil-memory v${VERSION}`);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
async function main(): Promise<void> {
|
|
92
|
+
const args = process.argv.slice(2);
|
|
93
|
+
|
|
94
|
+
// Handle no arguments
|
|
95
|
+
if (args.length === 0) {
|
|
96
|
+
printHelp();
|
|
97
|
+
process.exit(0);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
const command = args[0] as Command;
|
|
101
|
+
|
|
102
|
+
// Handle help and version
|
|
103
|
+
if (command === 'help' || args.includes('--help') || args.includes('-h')) {
|
|
104
|
+
printHelp();
|
|
105
|
+
process.exit(0);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
if (command === 'version' || args.includes('--version') || args.includes('-v')) {
|
|
109
|
+
printVersion();
|
|
110
|
+
process.exit(0);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// Validate command
|
|
114
|
+
if (!COMMANDS.includes(command as Command)) {
|
|
115
|
+
console.error(`Error: Unknown command '${command}'`);
|
|
116
|
+
console.error(`Run 'anvil-memory help' for available commands.`);
|
|
117
|
+
process.exit(1);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// Route to command handler
|
|
121
|
+
let result: CommandResult;
|
|
122
|
+
|
|
123
|
+
try {
|
|
124
|
+
switch (command) {
|
|
125
|
+
case 'init':
|
|
126
|
+
result = await handleInit(args.slice(1));
|
|
127
|
+
break;
|
|
128
|
+
case 'observe':
|
|
129
|
+
result = await handleObserve(args.slice(1));
|
|
130
|
+
break;
|
|
131
|
+
case 'search':
|
|
132
|
+
result = await handleSearch(args.slice(1));
|
|
133
|
+
break;
|
|
134
|
+
case 'get':
|
|
135
|
+
result = await handleGet(args.slice(1));
|
|
136
|
+
break;
|
|
137
|
+
case 'context':
|
|
138
|
+
result = await handleContext(args.slice(1));
|
|
139
|
+
break;
|
|
140
|
+
case 'timeline':
|
|
141
|
+
result = await handleTimeline(args.slice(1));
|
|
142
|
+
break;
|
|
143
|
+
case 'checkpoint':
|
|
144
|
+
result = await handleCheckpoint(args.slice(1));
|
|
145
|
+
break;
|
|
146
|
+
case 'ralph-iteration':
|
|
147
|
+
result = await handleRalphIteration(args.slice(1));
|
|
148
|
+
break;
|
|
149
|
+
default:
|
|
150
|
+
result = { success: false, error: `Command '${command}' not implemented` };
|
|
151
|
+
}
|
|
152
|
+
} catch (error) {
|
|
153
|
+
result = {
|
|
154
|
+
success: false,
|
|
155
|
+
error: error instanceof Error ? error.message : String(error),
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// Output result
|
|
160
|
+
const useJson = args.includes('--json');
|
|
161
|
+
|
|
162
|
+
if (useJson) {
|
|
163
|
+
console.log(JSON.stringify(result, null, 2));
|
|
164
|
+
} else if (!result.success) {
|
|
165
|
+
console.error(`Error: ${result.error}`);
|
|
166
|
+
process.exit(1);
|
|
167
|
+
} else if (result.message) {
|
|
168
|
+
console.log(result.message);
|
|
169
|
+
} else if (result.data) {
|
|
170
|
+
console.log(JSON.stringify(result.data, null, 2));
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
// Command handlers - stubs for later phases
|
|
175
|
+
async function handleContext(_args: string[]): Promise<CommandResult> {
|
|
176
|
+
// TODO: Implement in Phase 4.1 (ANV-188)
|
|
177
|
+
return {
|
|
178
|
+
success: false,
|
|
179
|
+
error: 'context command not yet implemented (Phase 4.1)',
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
async function handleTimeline(_args: string[]): Promise<CommandResult> {
|
|
184
|
+
// TODO: Implement in Phase 4.2 (ANV-189)
|
|
185
|
+
return {
|
|
186
|
+
success: false,
|
|
187
|
+
error: 'timeline command not yet implemented (Phase 4.2)',
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
// handleCheckpoint is now imported from ./commands/checkpoint.ts (ANV-202)
|
|
192
|
+
|
|
193
|
+
async function handleRalphIteration(_args: string[]): Promise<CommandResult> {
|
|
194
|
+
// TODO: Implement in Phase 4.3 (ANV-190)
|
|
195
|
+
return {
|
|
196
|
+
success: false,
|
|
197
|
+
error: 'ralph-iteration command not yet implemented (Phase 4.3)',
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
// Run main
|
|
202
|
+
main().catch((error) => {
|
|
203
|
+
console.error('Fatal error:', error);
|
|
204
|
+
process.exit(1);
|
|
205
|
+
});
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Anvil Memory Type Definitions
|
|
3
|
+
*
|
|
4
|
+
* Core types for the persistent memory system.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
// Observation types matching spec
|
|
8
|
+
export type ObservationType =
|
|
9
|
+
| 'bugfix'
|
|
10
|
+
| 'feature'
|
|
11
|
+
| 'refactor'
|
|
12
|
+
| 'discovery'
|
|
13
|
+
| 'decision'
|
|
14
|
+
| 'change'
|
|
15
|
+
| 'checkpoint'
|
|
16
|
+
| 'ralph_iteration'
|
|
17
|
+
| 'handoff'
|
|
18
|
+
| 'shard'
|
|
19
|
+
| 'linear_sync'
|
|
20
|
+
| 'session_request';
|
|
21
|
+
|
|
22
|
+
// Core observation record
|
|
23
|
+
export interface Observation {
|
|
24
|
+
id: number;
|
|
25
|
+
timestamp: string; // ISO 8601
|
|
26
|
+
type: ObservationType;
|
|
27
|
+
title: string;
|
|
28
|
+
content: string;
|
|
29
|
+
project?: string; // Project identifier
|
|
30
|
+
files?: string[]; // Associated file paths
|
|
31
|
+
concepts?: string[]; // Semantic tags
|
|
32
|
+
work_tokens?: number; // Tokens spent on this work
|
|
33
|
+
session_id?: number; // FK to sessions
|
|
34
|
+
linear_issue?: string; // Linear issue ID (e.g., "ANV-180")
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// Session record (conversation boundary)
|
|
38
|
+
export interface Session {
|
|
39
|
+
id: number;
|
|
40
|
+
started_at: string; // ISO 8601
|
|
41
|
+
ended_at?: string; // ISO 8601
|
|
42
|
+
project: string;
|
|
43
|
+
branch?: string;
|
|
44
|
+
git_hash?: string;
|
|
45
|
+
context_peak_percent?: number;
|
|
46
|
+
summary?: string;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// Checkpoint record (CCS events)
|
|
50
|
+
export interface Checkpoint {
|
|
51
|
+
id: number;
|
|
52
|
+
timestamp: string; // ISO 8601
|
|
53
|
+
level: 'L1' | 'L2' | 'L3';
|
|
54
|
+
context_percent: number;
|
|
55
|
+
handoff_file?: string;
|
|
56
|
+
session_id?: number;
|
|
57
|
+
resumed?: boolean;
|
|
58
|
+
resume_session_id?: number;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// Ralph iteration record
|
|
62
|
+
export interface RalphIteration {
|
|
63
|
+
id: number;
|
|
64
|
+
session_id: string; // Ralph session ID
|
|
65
|
+
iteration: number;
|
|
66
|
+
started_at: string; // ISO 8601
|
|
67
|
+
ended_at?: string;
|
|
68
|
+
status: 'running' | 'completed' | 'failed' | 'checkpointed';
|
|
69
|
+
items_completed?: number;
|
|
70
|
+
items_total?: number;
|
|
71
|
+
checkpoint_id?: number;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// User prompt record
|
|
75
|
+
export interface Prompt {
|
|
76
|
+
id: number;
|
|
77
|
+
timestamp: string; // ISO 8601
|
|
78
|
+
content: string;
|
|
79
|
+
project?: string;
|
|
80
|
+
session_id?: number;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// Search result with highlighting
|
|
84
|
+
export interface SearchResult<T> {
|
|
85
|
+
item: T;
|
|
86
|
+
snippet?: string; // Highlighted match
|
|
87
|
+
score?: number; // Relevance score
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// Context generation options
|
|
91
|
+
export interface ContextOptions {
|
|
92
|
+
limit?: number; // Max observations
|
|
93
|
+
types?: ObservationType[]; // Filter by type
|
|
94
|
+
project?: string; // Filter by project
|
|
95
|
+
since?: string; // ISO 8601 timestamp
|
|
96
|
+
concepts?: string[]; // Filter by concepts
|
|
97
|
+
format?: 'inject' | 'markdown' | 'json';
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// Timeline query options
|
|
101
|
+
export interface TimelineOptions {
|
|
102
|
+
anchor: number; // Observation ID as center
|
|
103
|
+
depthBefore?: number; // Events before anchor
|
|
104
|
+
depthAfter?: number; // Events after anchor
|
|
105
|
+
types?: string[]; // Filter record types
|
|
106
|
+
project?: string;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// CLI command result
|
|
110
|
+
export interface CommandResult {
|
|
111
|
+
success: boolean;
|
|
112
|
+
data?: unknown;
|
|
113
|
+
error?: string;
|
|
114
|
+
message?: string;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// Database configuration
|
|
118
|
+
export interface DbConfig {
|
|
119
|
+
path: string; // Path to SQLite database
|
|
120
|
+
migrated: boolean; // Whether migrations have run
|
|
121
|
+
version: number; // Schema version
|
|
122
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
// Environment setup & latest features
|
|
4
|
+
"lib": ["ESNext"],
|
|
5
|
+
"target": "ESNext",
|
|
6
|
+
"module": "Preserve",
|
|
7
|
+
"moduleDetection": "force",
|
|
8
|
+
"jsx": "react-jsx",
|
|
9
|
+
"allowJs": true,
|
|
10
|
+
|
|
11
|
+
// Bundler mode
|
|
12
|
+
"moduleResolution": "bundler",
|
|
13
|
+
"allowImportingTsExtensions": true,
|
|
14
|
+
"verbatimModuleSyntax": true,
|
|
15
|
+
"noEmit": true,
|
|
16
|
+
|
|
17
|
+
// Best practices
|
|
18
|
+
"strict": true,
|
|
19
|
+
"skipLibCheck": true,
|
|
20
|
+
"noFallthroughCasesInSwitch": true,
|
|
21
|
+
"noUncheckedIndexedAccess": true,
|
|
22
|
+
"noImplicitOverride": true,
|
|
23
|
+
|
|
24
|
+
// Some stricter flags (disabled by default)
|
|
25
|
+
"noUnusedLocals": false,
|
|
26
|
+
"noUnusedParameters": false,
|
|
27
|
+
"noPropertyAccessFromIndexSignature": false
|
|
28
|
+
}
|
|
29
|
+
}
|