Skip to content

Commit e3e60b0

Browse files
authored
Merge pull request #128 from TrueNine/dev
Simplify config handling around fixed aindex paths
2 parents 4e32b38 + 3209269 commit e3e60b0

Some content is hidden

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

49 files changed

+322
-876
lines changed

Cargo.lock

Lines changed: 6 additions & 6 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 & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ members = [
1010
]
1111

1212
[workspace.package]
13-
version = "2026.10403.117"
13+
version = "2026.10404.101"
1414
edition = "2024"
1515
rust-version = "1.88"
1616
license = "AGPL-3.0-only"

cli/npm/darwin-arm64/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@truenine/memory-sync-cli-darwin-arm64",
3-
"version": "2026.10403.117",
3+
"version": "2026.10404.101",
44
"os": [
55
"darwin"
66
],

cli/npm/darwin-x64/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@truenine/memory-sync-cli-darwin-x64",
3-
"version": "2026.10403.117",
3+
"version": "2026.10404.101",
44
"os": [
55
"darwin"
66
],

cli/npm/linux-arm64-gnu/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@truenine/memory-sync-cli-linux-arm64-gnu",
3-
"version": "2026.10403.117",
3+
"version": "2026.10404.101",
44
"os": [
55
"linux"
66
],

cli/npm/linux-x64-gnu/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@truenine/memory-sync-cli-linux-x64-gnu",
3-
"version": "2026.10403.117",
3+
"version": "2026.10404.101",
44
"os": [
55
"linux"
66
],

cli/npm/win32-x64-msvc/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@truenine/memory-sync-cli-win32-x64-msvc",
3-
"version": "2026.10403.117",
3+
"version": "2026.10404.101",
44
"os": [
55
"win32"
66
],

cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@truenine/memory-sync-cli",
33
"type": "module",
4-
"version": "2026.10403.117",
4+
"version": "2026.10404.101",
55
"description": "TrueNine Memory Synchronization CLI shell",
66
"author": "TrueNine",
77
"license": "AGPL-3.0-only",

cli/src/cli.rs

Lines changed: 0 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,6 @@ pub enum CliCommand {
5252
/// Remove all generated output files and directories
5353
Clean(CleanArgs),
5454

55-
/// Set or show configuration values
56-
Config(ConfigArgs),
57-
5855
/// List all registered plugins
5956
Plugins,
6057
}
@@ -66,20 +63,6 @@ pub struct CleanArgs {
6663
pub dry_run: bool,
6764
}
6865

69-
#[derive(Args, Debug)]
70-
pub struct ConfigArgs {
71-
/// Show merged configuration as JSON
72-
#[arg(long = "show")]
73-
pub show: bool,
74-
75-
/// Configuration key=value pairs to set
76-
#[arg(long = "set", value_name = "KEY=VALUE")]
77-
pub set: Vec<String>,
78-
79-
/// Positional key=value pairs
80-
pub positional: Vec<String>,
81-
}
82-
8366
/// Resolved log level from CLI flags.
8467
/// When multiple flags are provided, the most verbose wins.
8568
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
@@ -161,34 +144,9 @@ pub enum ResolvedCommand {
161144
DryRun,
162145
Clean,
163146
DryRunClean,
164-
Config(Vec<(String, String)>),
165-
ConfigShow,
166147
Plugins,
167148
}
168149

169-
/// Parse --set and positional key=value pairs into (key, value) tuples.
170-
fn parse_key_value_pairs(args: &ConfigArgs) -> Vec<(String, String)> {
171-
let mut pairs = Vec::new();
172-
173-
for s in &args.set {
174-
if let Some(eq_idx) = s.find('=')
175-
&& eq_idx > 0
176-
{
177-
pairs.push((s[..eq_idx].to_string(), s[eq_idx + 1..].to_string()));
178-
}
179-
}
180-
181-
for s in &args.positional {
182-
if let Some(eq_idx) = s.find('=')
183-
&& eq_idx > 0
184-
{
185-
pairs.push((s[..eq_idx].to_string(), s[eq_idx + 1..].to_string()));
186-
}
187-
}
188-
189-
pairs
190-
}
191-
192150
/// Resolve the command to execute from parsed CLI args.
193151
pub fn resolve_command(cli: &Cli) -> ResolvedCommand {
194152
match &cli.command {
@@ -203,18 +161,6 @@ pub fn resolve_command(cli: &Cli) -> ResolvedCommand {
203161
ResolvedCommand::Clean
204162
}
205163
}
206-
Some(CliCommand::Config(args)) => {
207-
if args.show {
208-
ResolvedCommand::ConfigShow
209-
} else {
210-
let pairs = parse_key_value_pairs(args);
211-
if pairs.is_empty() {
212-
ResolvedCommand::Execute
213-
} else {
214-
ResolvedCommand::Config(pairs)
215-
}
216-
}
217-
}
218164
Some(CliCommand::Plugins) => ResolvedCommand::Plugins,
219165
}
220166
}
@@ -235,23 +181,4 @@ mod tests {
235181
let cli = Cli::parse_from(["tnmsc", "clean", "--dry-run"]);
236182
assert_eq!(resolve_command(&cli), ResolvedCommand::DryRunClean);
237183
}
238-
239-
#[test]
240-
fn config_key_value_parsing_combines_flag_and_positional_pairs() {
241-
let cli = Cli::parse_from([
242-
"tnmsc",
243-
"config",
244-
"--set",
245-
"workspaceDir=/tmp/workspace",
246-
"logLevel=debug",
247-
]);
248-
249-
assert_eq!(
250-
resolve_command(&cli),
251-
ResolvedCommand::Config(vec![
252-
("workspaceDir".to_string(), "/tmp/workspace".to_string()),
253-
("logLevel".to_string(), "debug".to_string()),
254-
])
255-
);
256-
}
257184
}

cli/src/commands/Command.ts

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ import type {
55
OutputCollectedContext,
66
OutputPlugin,
77
OutputWriteContext,
8-
PluginOptions,
9-
UserConfigFile
8+
PluginOptions
109
} from '@truenine/memory-sync-sdk'
1110

1211
export interface CommandContext {
@@ -35,17 +34,6 @@ export interface PluginExecutionResult {
3534
readonly duration?: number
3635
}
3736

38-
export interface JsonConfigInfo {
39-
readonly merged: UserConfigFile
40-
readonly sources: readonly ConfigSource[]
41-
}
42-
43-
export interface ConfigSource {
44-
readonly path: string
45-
readonly layer: 'programmatic' | 'global' | 'default'
46-
readonly config: Partial<UserConfigFile>
47-
}
48-
4937
export interface JsonPluginInfo {
5038
readonly name: string
5139
readonly kind: 'Input' | 'Output'

0 commit comments

Comments
 (0)