Skip to content

Commit 834753c

Browse files
authored
Merge pull request #33 from TrueNine/dev
Dev
2 parents 19174fc + c7196b6 commit 834753c

File tree

10 files changed

+48
-9
lines changed

10 files changed

+48
-9
lines changed

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.10221.10031",
4+
"version": "2026.10221.10118",
55
"description": "TrueNine Memory Synchronization CLI",
66
"author": "TrueNine",
77
"license": "AGPL-3.0-only",

cli/public/tnmsc.example.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "2026.10221.10031",
2+
"version": "2026.10221.10118",
33
"workspaceDir": "~/project",
44
"shadowSourceProject": {
55
"name": "tnmsc-shadow",

cli/src/ConfigLoader.ts

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,43 @@ export function loadUserConfig(cwd?: string): MergedConfigResult {
225225
return getConfigLoader().load(cwd)
226226
}
227227

228+
/**
229+
* Ensure the shadow source project directory has a .tnmsc.json symlink
230+
* pointing to the global config. Creates a symlink where possible, falls
231+
* back to a file copy when symlinks are unavailable (e.g. Windows without
232+
* Developer Mode). Skips if the file already exists.
233+
*/
234+
export function ensureShadowProjectConfigLink(shadowProjectDir: string, logger: ILogger): void {
235+
const resolved = shadowProjectDir.startsWith('~')
236+
? path.join(os.homedir(), shadowProjectDir.slice(1))
237+
: shadowProjectDir
238+
239+
if (!fs.existsSync(resolved)) return
240+
241+
const globalConfigPath = getGlobalConfigPath()
242+
if (!fs.existsSync(globalConfigPath)) return
243+
244+
const configPath = path.join(resolved, DEFAULT_CONFIG_FILE_NAME)
245+
if (fs.existsSync(configPath)) return
246+
247+
try {
248+
fs.symlinkSync(globalConfigPath, configPath, 'file')
249+
logger.debug('linked config to shadow project', {link: configPath, target: globalConfigPath})
250+
}
251+
catch {
252+
try {
253+
fs.copyFileSync(globalConfigPath, configPath)
254+
logger.debug('copied config to shadow project (symlink unavailable)', {dest: configPath})
255+
}
256+
catch (copyErr) {
257+
logger.warn('failed to link or copy config to shadow project', {
258+
path: configPath,
259+
error: copyErr instanceof Error ? copyErr.message : String(copyErr)
260+
})
261+
}
262+
}
263+
}
264+
228265
/**
229266
* Validate global config file strictly.
230267
* - If config doesn't exist: create default config, log warn, continue

cli/src/config.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import * as fs from 'node:fs'
44
import * as path from 'node:path'
55
import process from 'node:process'
66
import glob from 'fast-glob'
7-
import {loadUserConfig, validateAndEnsureGlobalConfig} from '@/ConfigLoader'
7+
import {ensureShadowProjectConfigLink, loadUserConfig, validateAndEnsureGlobalConfig} from '@/ConfigLoader'
88
import {DEFAULT_USER_CONFIG} from '@/constants'
99
import {createLogger} from '@/log'
1010
import {PluginPipeline} from '@/PluginPipeline'
@@ -208,6 +208,8 @@ export async function defineConfig(options: PluginOptions | DefineConfigOptions
208208
})
209209
}
210210

211+
ensureShadowProjectConfigLink(path.join(mergedOptions.workspaceDir, mergedOptions.shadowSourceProject.name), logger) // Auto-link .tnmsc.json into shadow source project dir
212+
211213
const baseCtx: Omit<InputPluginContext, 'dependencyContext' | 'globalScope' | 'scopeRegistry'> = { // Base context without dependencyContext, globalScope, scopeRegistry (will be provided by pipeline)
212214
logger,
213215
userConfigOptions: mergedOptions,

doc/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-docs",
33
"private": true,
4-
"version": "2026.10221.10031",
4+
"version": "2026.10221.10118",
55
"description": "Documentation site for @truenine/memory-sync, built with Next.js 16 and MDX.",
66
"scripts": {
77
"dev": "next dev",

gui/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-gui",
3-
"version": "2026.10221.10031",
3+
"version": "2026.10221.10118",
44
"private": true,
55
"engines": {
66
"node": ">=25.2.1",

gui/src-tauri/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "memory-sync-gui"
3-
version = "2026.10221.10031"
3+
version = "2026.10221.10118"
44
description = "Memory Sync desktop GUI application"
55
authors = ["TrueNine"]
66
edition = "2021"

gui/src-tauri/tauri.conf.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "https://schema.tauri.app/config/2",
3-
"version": "2026.10221.10031",
3+
"version": "2026.10221.10118",
44
"productName": "Memory Sync",
55
"identifier": "org.truenine.memory-sync",
66
"build": {

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",
3-
"version": "2026.10221.10031",
3+
"version": "2026.10221.10118",
44
"description": "Cross-AI-tool prompt synchronisation toolkit (CLI + Tauri desktop GUI) — one ruleset, multi-target adaptation. Monorepo powered by pnpm + Turbo.",
55
"license": "AGPL-3.0-only",
66
"keywords": [

packages/init-bundle/public/public/tnmsc.example.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "https://unpkg.com/@truenine/memory-sync-cli/dist/tnmsc.schema.json",
3-
"version": "2026.10221.10031",
3+
"version": "2026.10221.10118",
44
"workspaceDir": "~/project",
55
"shadowSourceProject": {
66
"name": "tnmsc-shadow",

0 commit comments

Comments
 (0)