Skip to content

Commit 983acf5

Browse files
author
Terraphim CI
committed
feat: scaffold terraphim_usage and terraphim_ccusage crates (Refs #187)
- Create terraphim_usage crate with UsageProvider trait, ProviderUsage model, MetricLine types, UsageRegistry, SQLite storage layer, output formatters, and CLI command definitions - Create terraphim_ccusage crate with CcusageClient for Claude/Codex token tracking via external CLI, caching, and graceful degradation - Add stub provider implementations for Claude, Kimi, Z.ai, MiniMax, OpenCode Go - 18 tests passing (12 usage, 6 ccusage) - Both crates compile as part of workspace
1 parent d1d8e96 commit 983acf5

60 files changed

Lines changed: 1999 additions & 390 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Cargo.lock

Lines changed: 75 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
[workspace]
33
resolver = "2"
44
members = ["crates/*", "terraphim_server", "terraphim_firecracker", "terraphim_ai_nodejs"]
5+
# Note: terraphim_usage and terraphim_ccusage are new crates in crates/*
56
exclude = [
67
# Experimental crates
78
"crates/terraphim_agent_application",

crates/terraphim_agent/data/guard_allowlist.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,52 +2,52 @@
22
"name": "guard_allowlist",
33
"data": {
44
"git checkout -b ": {
5-
"id": 1,
5+
"id": "1",
66
"nterm": "safe_git_branch_create",
77
"url": "Creating a new branch is safe."
88
},
99
"git checkout --orphan ": {
10-
"id": 1,
10+
"id": "1",
1111
"nterm": "safe_git_branch_create",
1212
"url": "Creating an orphan branch is safe."
1313
},
1414
"git restore --staged": {
15-
"id": 2,
15+
"id": "2",
1616
"nterm": "safe_git_unstage",
1717
"url": "Unstaging files is safe; it does not discard working tree changes."
1818
},
1919
"git clean -n": {
20-
"id": 3,
20+
"id": "3",
2121
"nterm": "safe_git_dry_run",
2222
"url": "Dry run only shows what would be removed without deleting anything."
2323
},
2424
"git clean --dry-run": {
25-
"id": 3,
25+
"id": "3",
2626
"nterm": "safe_git_dry_run",
2727
"url": "Dry run only shows what would be removed without deleting anything."
2828
},
2929
"git push --force-with-lease": {
30-
"id": 4,
30+
"id": "4",
3131
"nterm": "safe_force_push",
3232
"url": "Force-with-lease checks that the remote has not been updated before pushing, preventing accidental overwrites."
3333
},
3434
"rm -rf /tmp/": {
35-
"id": 5,
35+
"id": "5",
3636
"nterm": "safe_tmp_cleanup",
3737
"url": "Cleaning temporary directories is safe."
3838
},
3939
"rm -rf /var/tmp/": {
40-
"id": 5,
40+
"id": "5",
4141
"nterm": "safe_tmp_cleanup",
4242
"url": "Cleaning temporary directories is safe."
4343
},
4444
"rm -fr /tmp/": {
45-
"id": 5,
45+
"id": "5",
4646
"nterm": "safe_tmp_cleanup",
4747
"url": "Cleaning temporary directories is safe."
4848
},
4949
"rm -fr /var/tmp/": {
50-
"id": 5,
50+
"id": "5",
5151
"nterm": "safe_tmp_cleanup",
5252
"url": "Cleaning temporary directories is safe."
5353
}

0 commit comments

Comments
 (0)