1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
use clap::{Subcommand, ValueEnum};
#[derive(Subcommand)]
pub(in crate::cli) enum TimelineAction {
/// Get chronological observations around an anchor observation or search query.
Around {
/// Anchor observation ID.
#[arg(long)]
anchor: Option<i64>,
/// Search query used to resolve the anchor.
#[arg(long)]
query: Option<String>,
/// Restrict timeline rows to one project path.
#[arg(long, short)]
project: Option<String>,
/// Observations before the anchor.
#[arg(long, default_value = "5")]
depth_before: i64,
/// Observations after the anchor.
#[arg(long, default_value = "5")]
depth_after: i64,
/// Emit a single JSON object with stable fields for scripts.
#[arg(long)]
json: bool,
},
/// Generate a project timeline report.
Report {
/// Project path to report.
project: String,
/// Include recent timeline and monthly breakdown.
#[arg(long)]
full: bool,
/// Emit a single JSON object with stable fields for scripts.
#[arg(long)]
json: bool,
},
}
#[derive(Subcommand)]
pub(in crate::cli) enum WorkstreamAction {
/// List project workstreams.
List {
/// Project path to list workstreams for.
#[arg(long, short)]
project: String,
/// Status filter: active, paused, completed, abandoned.
#[arg(long, value_enum)]
status: Option<WorkstreamStatusArg>,
/// Emit a single JSON object with stable fields for scripts.
#[arg(long)]
json: bool,
},
/// Update a workstream's manual status, next action, or blockers.
Update {
/// Workstream ID to update.
id: i64,
/// Project path that owns the workstream.
#[arg(long, short)]
project: String,
/// New status: active, paused, completed, abandoned.
#[arg(long, value_enum)]
status: Option<WorkstreamStatusArg>,
/// Next action to take.
#[arg(long)]
next_action: Option<String>,
/// Current blockers.
#[arg(long)]
blockers: Option<String>,
/// Confirm the mutation after reviewing id, project, and fields.
#[arg(long)]
confirm: bool,
/// Emit a single JSON object with stable fields for scripts.
#[arg(long)]
json: bool,
},
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, ValueEnum)]
pub(in crate::cli) enum WorkstreamStatusArg {
Active,
Paused,
Completed,
Abandoned,
}
impl WorkstreamStatusArg {
pub(in crate::cli) fn as_str(self) -> &'static str {
match self {
Self::Active => "active",
Self::Paused => "paused",
Self::Completed => "completed",
Self::Abandoned => "abandoned",
}
}
}
#[derive(Subcommand)]
pub(in crate::cli) enum CommitAction {
/// Look up git metadata and linked memory sessions for a full or short SHA.
Show {
sha: String,
#[arg(long, short)]
project: Option<String>,
#[arg(long)]
json: bool,
},
/// List commits linked to a content session ID or memory session ID.
Session {
session_id: String,
#[arg(long, short)]
project: Option<String>,
#[arg(long, short = 'n', default_value = "20")]
limit: i64,
#[arg(long)]
json: bool,
},
}
#[derive(Subcommand)]
pub(in crate::cli) enum RawAction {
/// Search raw captured user/assistant chat turns, not curated memories.
Search {
/// Literal phrase or terms to search in raw archive rows.
query: String,
/// Restrict search to one project path.
#[arg(long, short)]
project: Option<String>,
/// Include rows from this branch plus branchless older rows.
#[arg(long)]
branch: Option<String>,
/// Restrict search to one message role.
#[arg(long, value_enum)]
role: Option<RawRole>,
/// Maximum raw rows to show.
#[arg(long, short = 'n', default_value = "20")]
limit: i64,
/// Result offset for pagination.
#[arg(long, default_value = "0")]
offset: i64,
/// Emit a single JSON object with stable fields for scripts.
#[arg(long)]
json: bool,
},
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, ValueEnum)]
pub(in crate::cli) enum RawRole {
User,
Assistant,
}
impl RawRole {
pub(in crate::cli) fn as_str(self) -> &'static str {
match self {
Self::User => "user",
Self::Assistant => "assistant",
}
}
}