Skip to content

Commit b728091

Browse files
authored
Merge pull request #106 from TrueNine/dev
dev
2 parents a630bdc + 5035acc commit b728091

Some content is hidden

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

43 files changed

+655
-414
lines changed

Cargo.lock

Lines changed: 5 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 & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ members = [
99
]
1010

1111
[workspace.package]
12-
version = "2026.10328.106"
12+
version = "2026.10329.110"
1313
edition = "2024"
1414
license = "AGPL-3.0-only"
1515
authors = ["TrueNine"]

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.10328.106",
3+
"version": "2026.10329.110",
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.10328.106",
3+
"version": "2026.10329.110",
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.10328.106",
3+
"version": "2026.10329.110",
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.10328.106",
3+
"version": "2026.10329.110",
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.10328.106",
3+
"version": "2026.10329.110",
44
"os": [
55
"win32"
66
],

cli/package.json

Lines changed: 10 additions & 5 deletions
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.10328.106",
4+
"version": "2026.10329.110",
55
"description": "TrueNine Memory Synchronization CLI",
66
"author": "TrueNine",
77
"license": "AGPL-3.0-only",
@@ -51,18 +51,23 @@
5151
"build": "run-s build:deps build:napi bundle finalize:bundle generate:schema",
5252
"build:napi": "tsx ../scripts/copy-napi.ts",
5353
"build:deps": "pnpm -F @truenine/logger -F @truenine/md-compiler -F @truenine/script-runtime run build",
54+
"build:deps:ts": "pnpm -F @truenine/logger -F @truenine/md-compiler -F @truenine/script-runtime run build:ts",
5455
"bundle": "tsx ../scripts/build-quiet.ts",
55-
"check": "run-p typecheck lint",
56+
"check": "run-s build:deps:ts check:run",
57+
"check:run": "run-p lint:run typecheck:run",
5658
"finalize:bundle": "tsx scripts/finalize-bundle.ts",
5759
"generate:schema": "tsx scripts/generate-schema.ts",
58-
"lint": "eslint --cache --cache-location node_modules/.cache/.eslintcache .",
60+
"lint": "run-s build:deps:ts lint:run",
61+
"lint:run": "eslint --cache --cache-location node_modules/.cache/.eslintcache .",
5962
"prepublishOnly": "run-s build check",
6063
"test": "run-s build:deps test:run",
6164
"test:native-cleanup-smoke": "tsx scripts/cleanup-native-smoke.ts",
6265
"test:run": "vitest run",
6366
"benchmark:cleanup": "tsx scripts/benchmark-cleanup.ts",
64-
"lintfix": "eslint --fix --cache --cache-location node_modules/.cache/.eslintcache .",
65-
"typecheck": "tsc --noEmit -p tsconfig.lib.json"
67+
"lintfix": "run-s build:deps:ts lintfix:run",
68+
"lintfix:run": "eslint --fix --cache --cache-location node_modules/.cache/.eslintcache .",
69+
"typecheck": "run-s build:deps:ts typecheck:run",
70+
"typecheck:run": "tsc --noEmit -p tsconfig.lib.json"
6671
},
6772
"dependencies": {
6873
"json5": "catalog:",

cli/src/ConfigLoader.test.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,36 @@ describe('configLoader', () => {
3232
fs.rmSync(tempHome, {recursive: true, force: true})
3333
}
3434
})
35+
36+
it('defaults aindex.softwares when loading an older config file', () => {
37+
const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), 'tnmsc-config-loader-'))
38+
const configPath = path.join(tempDir, '.tnmsc.json')
39+
40+
try {
41+
fs.writeFileSync(configPath, JSON.stringify({
42+
workspaceDir: '/tmp/workspace',
43+
aindex: {
44+
dir: 'aindex',
45+
skills: {src: 'skills', dist: 'dist/skills'},
46+
commands: {src: 'commands', dist: 'dist/commands'},
47+
subAgents: {src: 'subagents', dist: 'dist/subagents'},
48+
rules: {src: 'rules', dist: 'dist/rules'},
49+
globalPrompt: {src: 'global.src.mdx', dist: 'dist/global.mdx'},
50+
workspacePrompt: {src: 'workspace.src.mdx', dist: 'dist/workspace.mdx'},
51+
app: {src: 'app', dist: 'dist/app'},
52+
ext: {src: 'ext', dist: 'dist/ext'},
53+
arch: {src: 'arch', dist: 'dist/arch'}
54+
}
55+
}), 'utf8')
56+
57+
const loader = new ConfigLoader()
58+
const result = loader.loadFromFile(configPath)
59+
60+
expect(result.found).toBe(true)
61+
expect(result.config.aindex?.softwares).toEqual({src: 'softwares', dist: 'dist/softwares'})
62+
}
63+
finally {
64+
fs.rmSync(tempDir, {recursive: true, force: true})
65+
}
66+
})
3567
})

cli/src/ConfigLoader.ts

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,25 @@
1+
import type {ILogger} from '@truenine/logger'
12
import type {
23
AindexConfig,
34
CleanupProtectionOptions,
45
ConfigLoaderOptions,
56
ConfigLoadResult,
67
FrontMatterOptions,
7-
ILogger,
88
OutputScopeOptions,
99
PluginOutputScopeTopics,
1010
UserConfigFile,
1111
WindowsOptions
1212
} from './plugins/plugin-core'
1313
import * as fs from 'node:fs'
1414
import process from 'node:process'
15+
import {createLogger} from '@truenine/logger'
1516
import {
1617
buildConfigDiagnostic,
1718
buildFileOperationDiagnostic,
1819
diagnosticLines,
1920
splitDiagnosticText
2021
} from './diagnostics'
21-
import {createLogger, ZUserConfigFile} from './plugins/plugin-core'
22+
import {mergeAindexConfig, ZUserConfigFile} from './plugins/plugin-core'
2223
import {
2324
getRequiredGlobalConfigPath,
2425
resolveRuntimeEnvironment,
@@ -189,18 +190,7 @@ export class ConfigLoader {
189190
if (a == null && b == null) return void 0
190191
if (a == null) return b
191192
if (b == null) return a
192-
return {
193-
dir: b.dir ?? a.dir,
194-
skills: {...a.skills, ...b.skills},
195-
commands: {...a.commands, ...b.commands},
196-
subAgents: {...a.subAgents, ...b.subAgents},
197-
rules: {...a.rules, ...b.rules},
198-
globalPrompt: {...a.globalPrompt, ...b.globalPrompt},
199-
workspacePrompt: {...a.workspacePrompt, ...b.workspacePrompt},
200-
app: {...a.app, ...b.app},
201-
ext: {...a.ext, ...b.ext},
202-
arch: {...a.arch, ...b.arch}
203-
}
193+
return mergeAindexConfig(a, b)
204194
}
205195

206196
private mergeOutputScopeTopics(

0 commit comments

Comments
 (0)