Skip to content

Commit a630bdc

Browse files
authored
Merge pull request #105 from TrueNine/dev
feat: refine prompt inputs and file categories
2 parents 899567b + 50c7c34 commit a630bdc

Some content is hidden

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

48 files changed

+1820
-761
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.10327.10010"
12+
version = "2026.10328.106"
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.10327.10010",
3+
"version": "2026.10328.106",
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.10327.10010",
3+
"version": "2026.10328.106",
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.10327.10010",
3+
"version": "2026.10328.106",
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.10327.10010",
3+
"version": "2026.10328.106",
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.10327.10010",
3+
"version": "2026.10328.106",
44
"os": [
55
"win32"
66
],

cli/package.json

Lines changed: 5 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.10327.10010",
4+
"version": "2026.10328.106",
55
"description": "TrueNine Memory Synchronization CLI",
66
"author": "TrueNine",
77
"license": "AGPL-3.0-only",
@@ -48,20 +48,20 @@
4848
"registry": "https://registry.npmjs.org/"
4949
},
5050
"scripts": {
51-
"build": "run-s build:deps build:napi bundle finalize:bundle generate:schema check",
51+
"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",
5454
"bundle": "tsx ../scripts/build-quiet.ts",
5555
"check": "run-p typecheck lint",
5656
"finalize:bundle": "tsx scripts/finalize-bundle.ts",
5757
"generate:schema": "tsx scripts/generate-schema.ts",
58-
"lint": "eslint --cache .",
59-
"prepublishOnly": "run-s build",
58+
"lint": "eslint --cache --cache-location node_modules/.cache/.eslintcache .",
59+
"prepublishOnly": "run-s build check",
6060
"test": "run-s build:deps test:run",
6161
"test:native-cleanup-smoke": "tsx scripts/cleanup-native-smoke.ts",
6262
"test:run": "vitest run",
6363
"benchmark:cleanup": "tsx scripts/benchmark-cleanup.ts",
64-
"lintfix": "eslint --fix --cache .",
64+
"lintfix": "eslint --fix --cache --cache-location node_modules/.cache/.eslintcache .",
6565
"typecheck": "tsc --noEmit -p tsconfig.lib.json"
6666
},
6767
"dependencies": {

cli/src/ProtectedDeletionGuard.ts

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -282,25 +282,24 @@ function collectWorkspaceReservedRules(
282282

283283
for (const projectRoot of projectRoots) rules.push(createProtectedPathRule(projectRoot, 'direct', 'workspace project root', 'workspace-project-root'))
284284

285-
if (includeReservedWorkspaceContentRoots) {
286-
rules.push(
287-
createProtectedPathRule(
288-
path.join(workspaceDir, 'aindex', 'dist', '**', '*.mdx'),
289-
'direct',
290-
'reserved workspace aindex dist mdx files',
291-
'workspace-reserved',
292-
'glob'
293-
),
294-
createProtectedPathRule(
295-
path.join(workspaceDir, 'aindex', 'app', '**', '*.mdx'),
296-
'direct',
297-
'reserved workspace aindex app mdx files',
298-
'workspace-reserved',
299-
'glob'
300-
)
301-
)
285+
if (!includeReservedWorkspaceContentRoots) return rules
286+
287+
rules.push(createProtectedPathRule(
288+
path.join(workspaceDir, 'aindex', 'dist', '**', '*.mdx'),
289+
'direct',
290+
'reserved workspace aindex dist mdx files',
291+
'workspace-reserved',
292+
'glob'
293+
))
294+
for (const seriesName of ['app', 'ext', 'arch'] as const) {
295+
rules.push(createProtectedPathRule(
296+
path.join(workspaceDir, 'aindex', seriesName, '**', '*.mdx'),
297+
'direct',
298+
`reserved workspace aindex ${seriesName} mdx files`,
299+
'workspace-reserved',
300+
'glob'
301+
))
302302
}
303-
304303
return rules
305304
}
306305

cli/src/aindex-project-series.ts

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
import type {AindexProjectSeriesName, PluginOptions} from '@/plugins/plugin-core'
2+
import {AINDEX_PROJECT_SERIES_NAMES} from '@/plugins/plugin-core'
3+
4+
export interface AindexProjectSeriesConfig {
5+
readonly name: AindexProjectSeriesName
6+
readonly src: string
7+
readonly dist: string
8+
}
9+
10+
export interface AindexProjectSeriesProjectRef {
11+
readonly projectName: string
12+
readonly seriesName: AindexProjectSeriesName
13+
readonly seriesDir: string
14+
}
15+
16+
export interface AindexProjectSeriesProjectNameConflict {
17+
readonly projectName: string
18+
readonly refs: readonly AindexProjectSeriesProjectRef[]
19+
}
20+
21+
type AindexProjectSeriesOptions = Required<PluginOptions>['aindex']
22+
23+
export function isAindexProjectSeriesName(value: string): value is AindexProjectSeriesName {
24+
return AINDEX_PROJECT_SERIES_NAMES.includes(value as AindexProjectSeriesName)
25+
}
26+
27+
export function resolveAindexProjectSeriesConfigs(
28+
options: Required<PluginOptions>
29+
): readonly AindexProjectSeriesConfig[] {
30+
return AINDEX_PROJECT_SERIES_NAMES.map(name => buildAindexProjectSeriesConfig(options.aindex, name))
31+
}
32+
33+
export function resolveAindexProjectSeriesConfig(
34+
options: Required<PluginOptions>,
35+
seriesName: AindexProjectSeriesName
36+
): AindexProjectSeriesConfig {
37+
return buildAindexProjectSeriesConfig(options.aindex, seriesName)
38+
}
39+
40+
export function collectAindexProjectSeriesProjectNameConflicts(
41+
refs: readonly AindexProjectSeriesProjectRef[]
42+
): readonly AindexProjectSeriesProjectNameConflict[] {
43+
const refsByProjectName = new Map<string, AindexProjectSeriesProjectRef[]>()
44+
45+
for (const ref of refs) {
46+
const existingRefs = refsByProjectName.get(ref.projectName)
47+
if (existingRefs == null) refsByProjectName.set(ref.projectName, [ref])
48+
else existingRefs.push(ref)
49+
}
50+
51+
return Array.from(refsByProjectName.entries(), ([projectName, projectRefs]) => ({
52+
projectName,
53+
refs: [...projectRefs]
54+
.sort((left, right) => left.seriesName.localeCompare(right.seriesName))
55+
}))
56+
.filter(conflict => {
57+
const uniqueSeriesNames = new Set(conflict.refs.map(ref => ref.seriesName))
58+
return uniqueSeriesNames.size > 1
59+
})
60+
.sort((left, right) => left.projectName.localeCompare(right.projectName))
61+
}
62+
63+
function buildAindexProjectSeriesConfig(
64+
aindexOptions: AindexProjectSeriesOptions,
65+
seriesName: AindexProjectSeriesName
66+
): AindexProjectSeriesConfig {
67+
return {
68+
name: seriesName,
69+
src: aindexOptions[seriesName].src,
70+
dist: aindexOptions[seriesName].dist
71+
}
72+
}

0 commit comments

Comments
 (0)